Allow setting default file name in wxMotif wxFileDialog.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19292 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2003-02-23 19:24:45 +00:00
parent 1da51aafba
commit d4d46b56f0

View File

@@ -190,7 +190,9 @@ static void wxChangeListBoxColours(wxWindow* WXUNUSED(win), Widget widget)
// Change colour of the scrolled areas of the listboxes // Change colour of the scrolled areas of the listboxes
Widget listParent = XtParent (widget); Widget listParent = XtParent (widget);
#if 0
wxWindow::DoChangeBackgroundColour((WXWidget) listParent, *wxWHITE, TRUE); wxWindow::DoChangeBackgroundColour((WXWidget) listParent, *wxWHITE, TRUE);
#endif
Widget hsb = (Widget) 0; Widget hsb = (Widget) 0;
Widget vsb = (Widget) 0; Widget vsb = (Widget) 0;
@@ -277,11 +279,6 @@ int wxFileDialog::ShowModal()
entirePath = m_fileName; entirePath = m_fileName;
} }
if (entirePath != "")
{
XmTextSetString(selectionWidget, (char*) (const char*) entirePath);
}
if (m_wildCard != "") if (m_wildCard != "")
{ {
// return something understandable by Motif // return something understandable by Motif
@@ -300,14 +297,16 @@ int wxFileDialog::ShowModal()
// file selector on Solaris 1.5.1. // file selector on Solaris 1.5.1.
if ( m_dir != "" ) if ( m_dir != "" )
{ {
XmString thePath = XmStringCreateLtoR ((char*) (const char*) m_dir, wxXmString thePath( m_dir );
XmSTRING_DEFAULT_CHARSET);
XtVaSetValues (fileSel, XtVaSetValues (fileSel,
XmNdirectory, thePath, XmNdirectory, thePath(),
NULL); NULL);
}
XmStringFree(thePath); if (entirePath != "")
{
XmTextSetString(selectionWidget, (char*)entirePath.c_str());
} }
XtAddCallback(fileSel, XmNcancelCallback, (XtCallbackProc)wxFileSelCancel, (XtPointer)NULL); XtAddCallback(fileSel, XmNcancelCallback, (XtCallbackProc)wxFileSelCancel, (XtPointer)NULL);