XtAppSetFallbackResources((XtAppContext) wxTheApp->m_appContext, fallbackResources);
Display *dpy = XtOpenDisplay((XtAppContext) wxTheApp->m_appContext,(String)NULL,NULL,
- (const char*) wxTheApp->GetClassName(), NULL, 0,
+ wxTheApp->GetClassName().c_str(), NULL, 0,
# if XtSpecificationRelease < 5
(Cardinal*) &argc,
# else
delete wxLog::SetActiveTarget(new wxLogStderr);
wxString className(wxTheApp->GetClassName());
wxLogError(_("wxWindows could not open display for '%s': exiting."),
- (const char*) className);
+ className.c_str());
exit(-1);
}
m_initialDisplay = (WXDisplay*) dpy;
gs_pfnXErrorHandler = XSetErrorHandler(wxXErrorHandler);
#endif // __WXDEBUG__
- wxTheApp->m_topLevelWidget = (WXWidget) XtAppCreateShell((String)NULL, (const char*) wxTheApp->GetClassName(),
- applicationShellWidgetClass,dpy,
- NULL,0) ;
+ wxTheApp->m_topLevelWidget =
+ (WXWidget) XtAppCreateShell((String)NULL,
+ wxTheApp->GetClassName().c_str(),
+ applicationShellWidgetClass,dpy,
+ NULL,0) ;
// Add general resize proc
XtActionsRec rec;
M_BITMAPDATA->m_display = (WXDisplay*) dpy;
int value = XReadBitmapFile (dpy, RootWindow (dpy, DefaultScreen (dpy)),
- (char*) (const char*) name, &w, &h, &pixmap, &hotX, &hotY);
+ wxConstCast(name.c_str(), char), &w, &h, &pixmap, &hotX, &hotY);
M_BITMAPHANDLERDATA->m_width = w;
M_BITMAPHANDLERDATA->m_height = h;
M_BITMAPHANDLERDATA->m_depth = 1;
xpmAttr.valuemask = XpmReturnInfos | XpmCloseness;
xpmAttr.closeness = 40000;
int errorStatus = XpmReadFileToPixmap(dpy,
- RootWindow(dpy, DefaultScreen(dpy)), (char*) (const char*) name,
+ RootWindow(dpy, DefaultScreen(dpy)),
+ wxConstCast(name.c_str(), char),
&pixmap, &mask, &xpmAttr);
if (errorStatus == XpmSuccess)
if (M_BITMAPHANDLERDATA->m_ok && M_BITMAPHANDLERDATA->m_pixmap)
{
Display *dpy = (Display*) M_BITMAPHANDLERDATA->m_display;
- int errorStatus = XpmWriteFileFromPixmap(dpy, (char*) (const char*) name,
+ int errorStatus = XpmWriteFileFromPixmap(dpy,
+ wxConstCast(name.c_str(), char),
(Pixmap) M_BITMAPHANDLERDATA->m_pixmap,
(M_BITMAPHANDLERDATA->m_bitmapMask ? (Pixmap) M_BITMAPHANDLERDATA->m_bitmapMask->GetPixmap() : (Pixmap) 0),
(XpmAttributes *) NULL);
xmToggleButtonWidgetClass, parentWidget,
wxFont::GetFontTag(), m_font.GetFontType(XtDisplay(parentWidget)),
XmNlabelString, text(),
+ XmNrecomputeSize, False,
NULL);
XtAddCallback( (Widget)m_mainWidget,
{
m_inSetValue = TRUE;
if( !value.empty() )
- XmComboBoxSetString( (Widget)m_mainWidget, (char*)value.c_str() );
+ XmComboBoxSetString( (Widget)m_mainWidget,
+ wxConstCast(value.c_str(), char) );
m_inSetValue = FALSE;
}
void wxComboBox::Replace(long from, long to, const wxString& value)
{
- XmComboBoxReplace ((Widget) m_mainWidget, (XmTextPosition) from, (XmTextPosition) to,
- (char*) (const char*) value);
+ XmComboBoxReplace ((Widget) m_mainWidget, (XmTextPosition) from,
+ (XmTextPosition) to,
+ wxConstCast(value.c_str(), char));
}
void wxComboBox::Remove(long from, long to)
m_inSetValue = true;
XtVaSetValues( GetXmText(this),
- XmNvalue, (char *)value.c_str(),
+ XmNvalue, wxConstCast(value.c_str(), char),
NULL);
m_inSetValue = false;
void wxComboBox::Replace(long from, long to, const wxString& value)
{
XmTextReplace( GetXmText(this), (XmTextPosition)from, (XmTextPosition)to,
- (char*)value.c_str() );
+ wxConstCast(value.c_str(), char) );
}
void wxComboBox::Remove(long from, long to)
int screen_num = DefaultScreen (dpy);
int value = XReadBitmapFile (dpy, RootWindow (dpy, DefaultScreen (dpy)),
- (char*) (const char*) name, &w, &h, &pixmap, &hotX, &hotY);
+ wxConstCast(name.c_str(), char),
+ &w, &h, &pixmap, &hotX, &hotY);
M_BITMAPDATA->m_width = w;
M_BITMAPDATA->m_height = h;
&ascent, &descent, &overall_return);
else
#endif // 0
- (void)XTextExtents((XFontStruct*) pFontStruct, (char*) (const char*) text, slen, &direction,
+ (void)XTextExtents((XFontStruct*) pFontStruct,
+ wxConstCast(text.c_str(), char),
+ slen, &direction,
&ascent, &descent, &overall_return);
cx = overall_return.width;
else
#endif // 0
XDrawString((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), (GC) m_gcBacking,
- XLOG2DEV_2 (x), YLOG2DEV_2 (y) + ascent, (char*) (const char*) text, slen);
+ XLOG2DEV_2 (x), YLOG2DEV_2 (y) + ascent,
+ wxConstCast(text.c_str(), char), slen);
}
// restore fill style
else
#endif // 0
(void)XTextExtents((XFontStruct*) pFontStruct,
- (char*)text.c_str(), slen, &direction,
+ wxConstCast(text.c_str(), char),
+ slen, &direction,
&ascent, &descent, &overall_return);
cx = overall_return.width;
&ascent, &descent2, &overall);
else
#endif // 0
- XTextExtents((XFontStruct*) pFontStruct, (char*) (const char*) string, slen, &direction,
+ XTextExtents((XFontStruct*) pFontStruct,
+ wxConstCast(string.c_str(), char), slen, &direction,
&ascent, &descent2, &overall);
if (width) *width = XDEV2LOGREL (overall.width);
XtSetArg (args[0], XmNdefaultPosition, False);
XtSetArg (args[1], XmNautoUnmanage, False);
Widget dialogShell =
- XmCreateBulletinBoardDialog( parentWidget, (char*)name.c_str(),
+ XmCreateBulletinBoardDialog( parentWidget,
+ wxConstCast(name.c_str(), char),
args, 2);
m_mainWidget = (WXWidget) dialogShell;
Widget shell = XtParent(fileSel);
if (!m_message.IsNull())
- XtVaSetValues(shell, XmNtitle, (char*) (const char*) m_message, NULL);
+ XtVaSetValues(shell,
+ XmNtitle, wxConstCast(m_message.c_str(), char),
+ NULL);
wxString entirePath("");
else
filter = wildCard;
- XmTextSetString(filterWidget, (char*)filter.c_str());
+ XmTextSetString(filterWidget, wxConstCast(filter.c_str(), char));
XmFileSelectionDoSearch(fileSel, NULL);
}
if (entirePath != "")
{
- XmTextSetString(selectionWidget, (char*)entirePath.c_str());
+ XmTextSetString(selectionWidget,
+ wxConstCast(entirePath.c_str(), char));
}
XtAddCallback(fileSel, XmNcancelCallback, (XtCallbackProc)wxFileSelCancel, (XtPointer)NULL);
static wxString
wxDefaultFileSelector(bool load, const char *what, const char *extension, const char *default_name, wxWindow *parent)
{
- char *ext = (char *)extension;
+ char *ext = wxConstCast(extension, char);
wxString prompt;
wxString str;
++count;
}
- Widget listWidget = XmCreateScrolledList(parentWidget,
- (char*)name.c_str(), args, count);
+ Widget listWidget =
+ XmCreateScrolledList(parentWidget,
+ wxConstCast(name.c_str(), char), args, count);
m_mainWidget = (WXWidget) listWidget;
XmString *text = new XmString[items.GetCount()];
size_t i;
for (i = 0; i < items.GetCount(); ++i)
- text[i] = XmStringCreateSimple ((char*)items[i].c_str());
+ text[i] = wxStringToXmString (items[i]);
if ( clientData )
for (i = 0; i < items.GetCount(); ++i)
// Corrected by Sergey Krasnov from Steve Hammes' code
#if XmVersion > 1001
for (i = 0; i < items.GetCount(); i++)
- text[i] = XmStringCreateSimple((char*)items[i].c_str());
+ text[i] = wxStringToXmString(items[i]);
XmListAddItemsUnselected(listBox, text, items.GetCount(), pos+1);
#else
for (i = 0; i < items.GetCount(); i++)
{
- text[i] = XmStringCreateSimple((char*)items[i].c_str());
+ text[i] = wxStringToXmString(items[i]);
// Another Sergey correction
XmListAddItemUnselected(listBox, text[i], pos+i+1);
}
{
char buf1[200];
char buf2[200];
- wxStripMenuCodes ((char *)(const char *)menuString, buf1);
+ wxStripMenuCodes (wxConstCast(menuString.c_str(), char), buf1);
size_t menuCount = GetMenuCount();
for (size_t i = 0; i < menuCount; i++)
{
- wxStripMenuCodes ((char *)(const char *)m_titles[i], buf2);
+ wxStripMenuCodes (wxConstCast(m_titles[i].c_str(), char), buf2);
if (strcmp (buf1, buf2) == 0)
return m_menus[i]->FindItem (itemString);
}
{
wxString str(wxStripMenuCodes(choices[i]));
m_radioButtonLabels[i] = str;
- m_radioButtons[i] = (WXWidget) XtVaCreateManagedWidget ((char*) (const char*) str,
+ m_radioButtons[i] = (WXWidget) XtVaCreateManagedWidget (wxConstCast(str.c_str(), char),
#if wxUSE_GADGETS
xmToggleButtonGadgetClass, radioBoxWidget,
#else
m_windowStyle = style;
m_font = parent->GetFont();
-#if 0 // gcc 2.95 doesn't like this apparently
- char* label1 = (label.IsNull() ? "" : (char*) (const char*) label);
-#endif
-
Widget parentWidget = (Widget) parent->GetClientWidget();
Widget borderWidget = NULL;
WXFontType fontType = m_font.GetFontType(XtDisplay(parentWidget));
- m_labelWidget = XtVaCreateManagedWidget ((char*) (const char*) name,
+ m_labelWidget = XtVaCreateManagedWidget (wxConstCast(name.c_str(), char),
xmLabelWidgetClass,
borderWidget ? borderWidget : parentWidget,
wxFont::GetFontTag(), fontType,
XtSetArg (args[1], XmNwordWrap, wantWordWrap ? True : False);
m_mainWidget = (WXWidget) XmCreateScrolledText(parentWidget,
- (char*)name.c_str(),
+ wxConstCast(name.c_str(), char),
args, 2);
XtVaSetValues ((Widget) m_mainWidget,
{
m_mainWidget = (WXWidget)XtVaCreateManagedWidget
(
- (char*)name.c_str(),
+ wxConstCast(name.c_str(), char),
xmTextWidgetClass,
parentWidget,
NULL
// do this instead... MB
//
XtVaSetValues( (Widget) m_mainWidget,
- XmNvalue, (char *)value.c_str(),
+ XmNvalue, wxConstCast(value.c_str(), char),
NULL);
}
// do this instead... MB
//
XtVaSetValues( (Widget) m_mainWidget,
- XmNvalue, (char *)value.c_str(),
+ XmNvalue, wxConstCast(value.c_str(), char),
NULL);
m_inSetValue = FALSE;
void wxTextCtrl::Replace(long from, long to, const wxString& value)
{
XmTextReplace ((Widget) m_mainWidget, (XmTextPosition) from, (XmTextPosition) to,
- (char*) (const char*) value);
+ wxConstCast(value.c_str(), char));
}
void wxTextCtrl::Remove(long from, long to)
FILE *fp = 0;
struct stat statb;
- if ((stat ((char*) (const char*) file, &statb) == -1) || (statb.st_mode & S_IFMT) != S_IFREG ||
- !(fp = fopen ((char*) (const char*) file, "r")))
+ if ((stat (wxConstCast(file.c_str(), char), &statb) == -1) || (statb.st_mode & S_IFMT) != S_IFREG ||
+ !(fp = fopen (wxConstCast(file.c_str(), char), "r")))
{
return FALSE;
}
Widget textWidget = (Widget) m_mainWidget;
FILE *fp;
- if (!(fp = fopen ((char*) (const char*) theFile, "w")))
+ if (!(fp = fopen (wxConstCast(theFile.c_str(), char), "w")))
{
return FALSE;
}
void wxTextCtrl::WriteText(const wxString& text)
{
long textPosition = GetInsertionPoint() + strlen (text);
- XmTextInsert ((Widget) m_mainWidget, GetInsertionPoint(), (char*) (const char*) text);
+ XmTextInsert ((Widget) m_mainWidget, GetInsertionPoint(),
+ wxConstCast(text.c_str(), char));
XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL);
SetInsertionPoint(textPosition);
XmTextShowPosition ((Widget) m_mainWidget, textPosition);
void wxTextCtrl::AppendText(const wxString& text)
{
long textPosition = GetLastPosition() + strlen(text);
- XmTextInsert ((Widget) m_mainWidget, GetLastPosition(), (char*) (const char*) text);
+ XmTextInsert ((Widget) m_mainWidget, GetLastPosition(),
+ wxConstCast(text.c_str(), char));
XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL);
SetInsertionPoint(textPosition);
XmTextShowPosition ((Widget) m_mainWidget, textPosition);