X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6fa6d65956285379aa1d99b76d92db76aaecf11e..b404a8f3b072129c107c6d9a5e0f6f53cd34807b:/src/msw/filedlg.cpp diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index 7b5ac99870..cf0bb81e98 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -65,7 +65,7 @@ // ---------------------------------------------------------------------------- // standard dialog size for the old Windows systems where the dialog wasn't -// resizeable +// resizable static wxRect gs_rectDialog(0, 0, 428, 266); // ============================================================================ @@ -86,6 +86,7 @@ wxFileDialogHookFunction(HWND hDlg, { switch ( iMsg ) { +#ifndef __WXWINCE__ case WM_INITDIALOG: { OPENFILENAME* ofn = reinterpret_cast(lParam); @@ -93,6 +94,7 @@ wxFileDialogHookFunction(HWND hDlg, ->MSWOnInitDialogHook((WXHWND)hDlg); } break; +#endif // __WXWINCE__ case WM_NOTIFY: { @@ -154,8 +156,8 @@ void wxFileDialog::GetPaths(wxArrayString& paths) const paths.Empty(); wxString dir(m_dir); - if ( m_dir.Last() != _T('\\') ) - dir += _T('\\'); + if ( m_dir.Last() != wxT('\\') ) + dir += wxT('\\'); size_t count = m_fileNames.GetCount(); for ( size_t n = 0; n < count; n++ ) @@ -172,14 +174,6 @@ void wxFileDialog::GetFilenames(wxArrayString& files) const files = m_fileNames; } -void wxFileDialog::SetPath(const wxString& path) -{ - wxString ext; - wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext); - if ( !ext.empty() ) - m_fileName << _T('.') << ext; -} - void wxFileDialog::DoGetPosition(int *x, int *y) const { if ( x ) @@ -231,7 +225,7 @@ void wxFileDialog::DoCentre(int dir) void wxFileDialog::MSWOnInitDone(WXHWND hDlg) { - // note the the dialog is the parent window: hDlg is a child of it when + // note the dialog is the parent window: hDlg is a child of it when // OFN_EXPLORER is used HWND hFileDlg = ::GetParent((HWND)hDlg); @@ -349,7 +343,7 @@ static bool ShowCommFileDialog(OPENFILENAME *of, long style) { // this can happen if the default file name is invalid, try without it // now - of->lpstrFile[0] = _T('\0'); + of->lpstrFile[0] = wxT('\0'); success = DoShowCommFileDialog(of, style, &errCode); } @@ -368,6 +362,7 @@ static bool ShowCommFileDialog(OPENFILENAME *of, long style) return true; } +#ifndef __WXWINCE__ void wxFileDialog::MSWOnInitDialogHook(WXHWND hwnd) { SetHWND(hwnd); @@ -376,6 +371,7 @@ void wxFileDialog::MSWOnInitDialogHook(WXHWND hwnd) SetHWND(NULL); } +#endif // __WXWINCE__ int wxFileDialog::ShowModal() { @@ -455,12 +451,11 @@ int wxFileDialog::ShowModal() lpdt->x = 0; lpdt->y = 0; - wxSize extra_size = GetExtraControlSize(); - // setting cx doesn't change the width of the dialog - lpdt->cx = extra_size.GetWidth(); - // Dividing by 2 gives expected height on WinXP and Wine. - // I don't know why (MW). - lpdt->cy = extra_size.GetHeight() / 2; + // convert the size of the extra controls to the dialog units + const wxSize extraSize = GetExtraControlSize(); + const LONG baseUnits = ::GetDialogBaseUnits(); + lpdt->cx = ::MulDiv(extraSize.x, 4, LOWORD(baseUnits)); + lpdt->cy = ::MulDiv(extraSize.y, 8, HIWORD(baseUnits)); // after the DLGTEMPLATE there are 3 additional WORDs for dialog menu, // class and title, all three set to zeros. @@ -481,17 +476,17 @@ int wxFileDialog::ShowModal() wxChar ch = m_dir[i]; switch ( ch ) { - case _T('/'): + case wxT('/'): // convert to backslash - ch = _T('\\'); + ch = wxT('\\'); // fall through - case _T('\\'): + case wxT('\\'): while ( i < len - 1 ) { wxChar chNext = m_dir[i + 1]; - if ( chNext != _T('\\') && chNext != _T('/') ) + if ( chNext != wxT('\\') && chNext != wxT('/') ) break; // ignore the next one, unless it is at the start of a UNC path @@ -518,7 +513,7 @@ int wxFileDialog::ShowModal() size_t items = wxParseCommonDialogsFilter(m_wildCard, wildDescriptions, wildFilters); - wxASSERT_MSG( items > 0 , _T("empty wildcard list") ); + wxASSERT_MSG( items > 0 , wxT("empty wildcard list") ); wxString filterBuffer; @@ -610,7 +605,7 @@ int wxFileDialog::ShowModal() i += wxStrlen(&fileNameBuffer[i]) + 1; } #else - wxStringTokenizer toke(fileNameBuffer, _T(" \t\r\n")); + wxStringTokenizer toke(fileNameBuffer, wxT(" \t\r\n")); m_dir = toke.GetNextToken(); m_fileName = toke.GetNextToken(); m_fileNames.Add(m_fileName); @@ -620,8 +615,8 @@ int wxFileDialog::ShowModal() #endif // OFN_EXPLORER wxString dir(m_dir); - if ( m_dir.Last() != _T('\\') ) - dir += _T('\\'); + if ( m_dir.Last() != wxT('\\') ) + dir += wxT('\\'); m_path = dir + m_fileName; m_filterIndex = (int)of.nFilterIndex - 1;