LightWrap++
AC++wrapperfortheLightWave3DSDK
message.h
Go to the documentation of this file.
1 #ifndef LWPP_MESSAGE_H
2 #define LWPP_MESSAGE_H
3 #include <lwpp/interface.h>
4 #include <lwpp/xpanel.h>
5 
6 namespace lwpp
7 {
8  // constant strings for formatting text, not documented
9 #define TXT_JUSTIFY_LEFT "\03(j:0)"
10 #define TXT_JUSTIFY_CENTRE "\03(j:1)"
11 #define TXT_JUSTIFY_RIGHT "\03(j:2)"
12 
13 #define CHAR_UP "\03(i:1)"
14 #define CHAR_DOWN "\03(i:2)"
15 #define CHAR_UPDOWN "\03(i:3)"
16 #define CHAR_CHECKMARK "\03(i:4)"
17 #define CHAR_LEFTRIGHT "\03(i:5)"
18 #define CHAR_QUAD "\03(i:6)"
19 #define CHAR_PAN "\03(i:7)"
20 #define CHAR_PLUS "\03(i:8)"
21 #define CHAR_MINUS "\03(i:9)"
22 #define CHAR_CIRCLE "\03(i:10)"
23 #define CHAR_ELLIPSIS "\03(i:28)"
24 #define CHAR_COLOUR(x) "\03(c:" #x ")"
25 
27  class LWMessage : protected GlobalBase<LWMessageFuncs>
28  {
29  public:
30  LWMessage() {;}
31  void static Info(const std::string &a)
32  {
33  globPtr->info(a.c_str(), 0);
34  }
35  void static Info(const std::string &a, const std::string &b)
36  {
37  globPtr->info(a.c_str(),b.c_str());
38  }
39  void static Error(const std::string &a)
40  {
41  globPtr->error(a.c_str(), 0);
42  }
43  void static Error(const std::string &a, const std::string &b)
44  {
45  globPtr->error(a.c_str(),b.c_str());
46  }
47  void static Warning(const std::string &a)
48  {
49  globPtr->warning(a.c_str(), 0);
50  }
51  void static Warning(const std::string &a, const std::string &b )
52  {
53  globPtr->warning(a.c_str(),b.c_str());
54  }
55  int static OkCancel(const std::string &t, const std::string &a, const std::string &b = "")
56  {
57  return globPtr->okCancel(t.c_str(),a.c_str(),b.c_str());
58  }
59  int static YesNo(const std::string &t, const std::string &a, const std::string &b = "")
60  {
61  return globPtr->yesNo(t.c_str(),a.c_str(),b.c_str());
62  }
63  int static YesNoCan(const std::string &t, const std::string &a, const std::string &b = "")
64  {
65  return globPtr->yesNoCan(t.c_str(),a.c_str(),b.c_str());
66  }
67  int static YesNoAll(const std::string &t, const std::string &a, const std::string &b = "")
68  {
69  return globPtr->yesNoAll(t.c_str(),a.c_str(),b.c_str());
70  }
71  void static InfoPanel (const char *title, const char *text)
72  {
73  enum {ID_TEXT = 0xb000};
74  LWXPanelControl ctrl_list[] =
75  {
76  {ID_TEXT, "sInfo", "string"},
77  { 0 }
78  };
79  LWXPanelDataDesc data_descrip[] = { { 0 } };
80  LWXPanelHint hint[] =
81  {
82  XpLABEL( 0, title),
83  XpDLOGTYPE(LWXPDLG_OKONLY),
84  XpLEFT(ID_TEXT),
85  XpEND
86  };
87  lwpp::XPanel xpanel(LWXP_FORM, ctrl_list);
88  if ( xpanel.isValid() )
89  {
90  xpanel.Hint(hint);
91  xpanel.Describe(data_descrip);
92  xpanel.setForm(ID_TEXT, text);
93  if (xpanel.Post() == 1)
94  {
95  ;
96  }
97  }
98  };
99  };
100 
101 }
102 #endif // LWPP_MESSAGE_H