#define wxCHECK_LESSTIF() ( __WXLESSTIF__ )
+// some compilers (e.g. Sun CC) give warnings when treating string literals as
+// (non const) "char *" but many Motif functions take "char *" parameters which
+// are really "const char *" so use this macro to suppress the warnings when we
+// know it's ok
+#define wxMOTIF_STR(x) wx_const_cast(char *, x)
+
// ----------------------------------------------------------------------------
// Miscellaneous functions
// ----------------------------------------------------------------------------
XtDispatchEvent((XEvent*) event); /* let Motif do the work */
}
-// some compilers (e.g. Sun CC) give warnings when treating string literals as
-// (non const) "char *" so use this macro to suppress them when we know it's ok
-#define STR(x) wx_const_cast(char *, x)
-
static char *fallbackResources[] = {
// better defaults for CDE under Irix
//
// TODO: do something similar for the other systems, the hardcoded defaults
// below are ugly
#ifdef __SGI__
- STR("*sgiMode: True"),
- STR("*useSchemes: all"),
+ wxMOTIF_STR("*sgiMode: True"),
+ wxMOTIF_STR("*useSchemes: all"),
#else // !__SGI__
- STR("*menuBar.marginHeight: 0"),
- STR("*menuBar.shadowThickness: 1"),
- STR("*background: #c0c0c0"),
- STR("*foreground: black"),
+ wxMOTIF_STR("*menuBar.marginHeight: 0"),
+ wxMOTIF_STR("*menuBar.shadowThickness: 1"),
+ wxMOTIF_STR("*background: #c0c0c0"),
+ wxMOTIF_STR("*foreground: black"),
#endif // __SGI__/!__SGI__
NULL
};
// Add general resize proc
XtActionsRec rec;
- rec.string = STR("resize");
+ rec.string = wxMOTIF_STR("resize");
rec.proc = (XtActionProc)wxWidgetResizeProc;
XtAppAddActions((XtAppContext) wxTheApp->m_appContext, &rec, 1);
* Create the popup menu
*/
m_menuWidget = (WXWidget) XmCreatePulldownMenu ((Widget) m_formWidget,
- "choiceMenu", NULL, 0);
+ wxMOTIF_STR("choiceMenu"),
+ NULL, 0);
if (n > 0)
{
XtSetArg (args[argcnt], XmNmarginHeight, 0); ++argcnt;
XtSetArg (args[argcnt], XmNpacking, XmPACK_TIGHT); ++argcnt;
m_buttonWidget = (WXWidget) XmCreateOptionMenu ((Widget) m_formWidget,
- "choiceButton",
+ wxMOTIF_STR("choiceButton"),
args, argcnt);
m_mainWidget = m_buttonWidget;
#endif
Widget fileSel = XmCreateFileSelectionDialog(parentWidget,
- "file_selector", args, ac);
+ wxMOTIF_STR("file_selector"),
+ args, ac);
#define wxFSChild( name ) \
XmFileSelectionBoxGetChild(fileSel, name)
return true;
}
- Widget menuBarW = XmCreateMenuBar ((Widget) parent->GetMainWidget(), "MenuBar", NULL, 0);
+ Widget menuBarW = XmCreateMenuBar ((Widget) parent->GetMainWidget(),
+ wxMOTIF_STR("MenuBar"), NULL, 0);
m_mainWidget = (WXWidget) menuBarW;
size_t menuCount = GetMenuCount();
if (!pullDown)
{
- menu = XmCreatePopupMenu ((Widget) parent, "popup", args, 2);
+ menu = XmCreatePopupMenu ((Widget) parent, wxMOTIF_STR("popup"), args, 2);
#if 0
XtAddCallback(menu,
XmNunmapCallback,
else
{
char mnem = wxFindMnemonic (title);
- menu = XmCreatePulldownMenu ((Widget) parent, "pulldown", args, 2);
+ menu = XmCreatePulldownMenu ((Widget) parent, wxMOTIF_STR("pulldown"), args, 2);
wxString title2(wxStripMenuCodes(title));
wxXmString label_str(title2);
#else
int type = event.xany.type;
static char* event_name[] = {
- "", "unknown(-)", // 0-1
- "KeyPress", "KeyRelease", "ButtonPress", "ButtonRelease", // 2-5
- "MotionNotify", "EnterNotify", "LeaveNotify", "FocusIn", // 6-9
- "FocusOut", "KeymapNotify", "Expose", "GraphicsExpose", // 10-13
- "NoExpose", "VisibilityNotify", "CreateNotify", // 14-16
- "DestroyNotify", "UnmapNotify", "MapNotify", "MapRequest",// 17-20
- "ReparentNotify", "ConfigureNotify", "ConfigureRequest", // 21-23
- "GravityNotify", "ResizeRequest", "CirculateNotify", // 24-26
- "CirculateRequest", "PropertyNotify", "SelectionClear", // 27-29
- "SelectionRequest", "SelectionNotify", "ColormapNotify", // 30-32
- "ClientMessage", "MappingNotify", // 33-34
- "unknown(+)"}; // 35
+ wxMOTIF_STR(""), wxMOTIF_STR("unknown(-)"), // 0-1
+ wxMOTIF_STR("KeyPress"), wxMOTIF_STR("KeyRelease"), wxMOTIF_STR("ButtonPress"), wxMOTIF_STR("ButtonRelease"), // 2-5
+ wxMOTIF_STR("MotionNotify"), wxMOTIF_STR("EnterNotify"), wxMOTIF_STR("LeaveNotify"), wxMOTIF_STR("FocusIn"), // 6-9
+ wxMOTIF_STR("FocusOut"), wxMOTIF_STR("KeymapNotify"), wxMOTIF_STR("Expose"), wxMOTIF_STR("GraphicsExpose"), // 10-13
+ wxMOTIF_STR("NoExpose"), wxMOTIF_STR("VisibilityNotify"), wxMOTIF_STR("CreateNotify"), // 14-16
+ wxMOTIF_STR("DestroyNotify"), wxMOTIF_STR("UnmapNotify"), wxMOTIF_STR("MapNotify"), wxMOTIF_STR("MapRequest"),// 17-20
+ wxMOTIF_STR("ReparentNotify"), wxMOTIF_STR("ConfigureNotify"), wxMOTIF_STR("ConfigureRequest"), // 21-23
+ wxMOTIF_STR("GravityNotify"), wxMOTIF_STR("ResizeRequest"), wxMOTIF_STR("CirculateNotify"), // 24-26
+ wxMOTIF_STR("CirculateRequest"), wxMOTIF_STR("PropertyNotify"), wxMOTIF_STR("SelectionClear"), // 27-29
+ wxMOTIF_STR("SelectionRequest"), wxMOTIF_STR("SelectionNotify"), wxMOTIF_STR("ColormapNotify"), // 30-32
+ wxMOTIF_STR("ClientMessage"), wxMOTIF_STR("MappingNotify"), // 33-34
+ wxMOTIF_STR("unknown(+)")}; // 35
type = wxMin(35, type); type = wxMax(1, type);
wxString str(event_name[type]);
return str;
//// drawing area, since otherwise the translations are different.
// New translations for getting mouse motion feedback
- static const String translations =
+ static const String translations = wxMOTIF_STR(
"<Btn1Motion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
<Btn2Motion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
<Btn3Motion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
<Motion>: wxCanvasMotionEvent() DrawingAreaInput()\n\
<EnterWindow>: wxCanvasMotionEvent() DrawingAreaInput()\n\
<LeaveWindow>: wxCanvasMotionEvent() DrawingAreaInput()\n\
-<Key>: DrawingAreaInput()";
+<Key>: DrawingAreaInput()");
XtActionsRec actions[1];
- actions[0].string = "wxCanvasMotionEvent";
+ actions[0].string = wxMOTIF_STR("wxCanvasMotionEvent");
actions[0].proc = (XtActionProc) wxCanvasMotionEvent;
XtAppAddActions ((XtAppContext) wxTheApp->GetAppContext(), actions, 1);