static wxString ParseWildCard( const wxString& wild )
{
+#ifdef __WXDEBUG__
static const wxChar* msg =
_T("Motif file dialog does not understand this ")
_T("wildcard syntax");
+#endif
wxStringTokenizer tok( wild, _T("|") );
static void wxChangeListBoxColours(wxWindow* WXUNUSED(win), Widget widget)
{
- wxWindow::DoChangeBackgroundColour((WXWidget) widget, *wxWHITE);
+ wxDoChangeBackgroundColour((WXWidget) widget, *wxWHITE);
// Change colour of the scrolled areas of the listboxes
Widget listParent = XtParent (widget);
#if 0
- wxWindow::DoChangeBackgroundColour((WXWidget) listParent, *wxWHITE, TRUE);
+ wxDoChangeBackgroundColour((WXWidget) listParent, *wxWHITE, TRUE);
#endif
Widget hsb = (Widget) 0;
* function to change them (by default, taken from wxSystemSettings)
*/
wxColour backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
- wxWindow::DoChangeBackgroundColour((WXWidget) hsb, backgroundColour, TRUE);
- wxWindow::DoChangeBackgroundColour((WXWidget) vsb, backgroundColour, TRUE);
+ wxDoChangeBackgroundColour((WXWidget) hsb, backgroundColour, TRUE);
+ wxDoChangeBackgroundColour((WXWidget) vsb, backgroundColour, TRUE);
if (hsb)
XtVaSetValues (hsb,
// static char fileBuf[512];
Widget parentWidget = (Widget) 0;
if (m_parent)
- {
parentWidget = (Widget) m_parent->GetTopWidget();
- }
else
parentWidget = (Widget) wxTheApp->GetTopLevelWidget();
// prepare the arg list
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);
XmNresizePolicy, XmRESIZE_NONE,
NULL);
#endif
- // DoChangeBackgroundColour((WXWidget) fileSel, m_backgroundColour);
- DoChangeBackgroundColour((WXWidget) filterWidget, *wxWHITE);
- DoChangeBackgroundColour((WXWidget) selectionWidget, *wxWHITE);
+ // wxDoChangeBackgroundColour((WXWidget) fileSel, m_backgroundColour);
+ wxDoChangeBackgroundColour((WXWidget) filterWidget, *wxWHITE);
+ wxDoChangeBackgroundColour((WXWidget) selectionWidget, *wxWHITE);
wxChangeListBoxColours(this, dirListWidget);
wxChangeListBoxColours(this, fileListWidget);
wxEndBusyCursor();
XtAddGrab(XtParent(fileSel), TRUE, FALSE);
+ XtAppContext context = (XtAppContext) wxTheApp->GetAppContext();
XEvent event;
while (!m_fileSelectorReturned)
{
- XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
+ XtAppNextEvent(context, &event);
+ XtDispatchEvent(&event);
}
XtRemoveGrab(XtParent(fileSel));
- XmUpdateDisplay((Widget) wxTheApp->GetTopLevelWidget()); // Experimental
+ // XmUpdateDisplay((Widget) wxTheApp->GetTopLevelWidget()); // Experimental
+
+ Display* display = XtDisplay(fileSel);
- // XtDestroyWidget(fileSel);
XtUnmapWidget(XtParent(fileSel));
XtDestroyWidget(XtParent(fileSel));
// Now process all events, because otherwise
// this might remain on the screen
- XSync(XtDisplay((Widget) wxTheApp->GetTopLevelWidget()), FALSE);
- while (XtAppPending((XtAppContext) wxTheApp->GetAppContext()))
- {
- XFlush(XtDisplay((Widget) wxTheApp->GetTopLevelWidget()));
- XtAppNextEvent((XtAppContext) wxTheApp->GetAppContext(), &event);
- XtDispatchEvent(&event);
- }
+ wxFlushEvents(display);
m_path = m_fileSelectorAnswer;
m_fileName = wxFileNameFromPath(m_fileSelectorAnswer);
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;