\subsubsection{Window sizing in wxWinCE}
-When creating frames and dialogs, create them with wxDefaultPosition and
-wxDefaultSize, which will tell WinCE to create them full-screen.
-
-Don't call Fit() and Centre(), so the content sizes to
-the window rather than fitting the window to the content. (We really need a single API call
-that will do the right thing on each platform.)
+Top level windows (dialogs, frames) are created always full-screen. Fit() of sizers will not rescale top
+level windows but instead will scale window content.
If the screen orientation changes, the windows will automatically be resized
so no further action needs to be taken (unless you want to change the layout
// Return a window size that will fit within the screens dimensions
wxSize wxSizer::FitSize( wxWindow *window )
{
+ if ( window->IsTopLevel() )
+ {
+ wxTopLevelWindow *tlw = wxDynamicCast(window, wxTopLevelWindow);
+ if ( tlw && tlw->IsAlwaysMaximized() )
+ {
+ return tlw->GetClientSize();
+ }
+ }
+
wxSize size = GetMinWindowSize( window );
wxSize sizeMax = GetMaxWindowSize( window );
const wxPoint& pos,
long styleLbox)
{
-#if defined(__SMARTPHONE__) || defined(__POCKETPC__)
- styleDlg &= ~wxBORDER_MASK;
- styleDlg &= ~wxRESIZE_BORDER;
- styleDlg &= ~wxCAPTION;
-#endif
#ifdef __WXMAC__
if ( !wxDialog::Create(parent, wxID_ANY, caption, pos, wxDefaultSize, styleDlg & (~wxCANCEL) ) )
return false;
SetSizer( topsizer );
-#if !defined(__SMARTPHONE__) && !defined(__POCKETPC__)
topsizer->SetSizeHints( this );
topsizer->Fit( this );
if ( styleDlg & wxCENTRE )
Centre(wxBOTH);
-#endif
m_listbox->SetFocus();
SetAutoLayout( true );
SetSizer( topsizer );
-#if !defined(__SMARTPHONE__) && !defined(__POCKETPC__)
topsizer->SetSizeHints( this );
topsizer->Fit( this );
Centre( wxBOTH );
-#endif
}
void wxGenericDirDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{
if ( !wxDialog::Create(parent, wxID_ANY, title,
wxDefaultPosition, wxDefaultSize,
- wxDEFAULT_DIALOG_STYLE
-#if !defined(__SMARTPHONE__) && !defined(__POCKETPC__)
- | wxRESIZE_BORDER
-#endif
+ wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER
| style) )
{
return false;
_T("can't create dialog without data") );
bool isPda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA);
-
+
wxBoxSizer *leftsizer = new wxBoxSizer( wxVERTICAL );
// 3 columns because there is a spacer in the middle
rbStyle = wxRA_SPECIFY_ROWS;
else
rbStyle = wxRA_SPECIFY_COLS;
-
+
m_radioDir = new wxRadioBox(this, wxID_ANY, _("Search direction"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(searchDirections), searchDirections,
SetAutoLayout( true );
SetSizer( topsizer );
-#if !defined(__SMARTPHONE__) && !defined(__POCKETPC__)
topsizer->SetSizeHints( this );
topsizer->Fit( this );
Centre( wxBOTH );
-#endif
m_textFind->SetFocus();
}
#endif // wxUSE_FINDREPLDLG
-
return true;
if (!wxDialog::Create( parent, wxID_ANY, message, pos, wxDefaultSize,
- wxDEFAULT_DIALOG_STYLE
-#if !(defined(__PDA__) || defined(__SMARTPHONE__))
- | wxRESIZE_BORDER
-#endif
+ wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER
))
{
return false;
m_pointSizeChoice->SetSelection(m_dialogFont.GetPointSize()-1);
#endif
-#if !defined(__SMARTPHONE__) && !defined(__POCKETPC__)
GetSizer()->SetItemMinSize(m_previewer, is_pda ? 100 : 430, is_pda ? 40 : 100);
GetSizer()->SetSizeHints(this);
GetSizer()->Fit(this);
Centre(wxBOTH);
-#endif
delete[] families;
delete[] styles;
SetSizer( topsizer );
SetAutoLayout( true );
-#if !defined(__SMARTPHONE__) && !defined(__POCKETPC__)
topsizer->SetSizeHints( this );
topsizer->Fit( this );
Centre( wxBOTH );
-#endif
m_spinctrl->SetSelection(-1, -1);
m_spinctrl->SetFocus();
SetAutoLayout( true );
SetSizer( topsizer );
-#if !defined(__SMARTPHONE__) && !defined(__POCKETPC__)
topsizer->SetSizeHints( this );
topsizer->Fit( this );
if ( style & wxCENTRE )
Centre( wxBOTH );
-#endif
m_textctrl->SetSelection(-1, -1);
m_textctrl->SetFocus();
///////////////////////////////////////////////////////////////////////////////
-// Name: tipdlg.cpp
+// Name: src/generic/tipdlg.cpp
// Purpose: implementation of wxTipDialog
// Author: Vadim Zeitlin
// Modified by:
bool showAtStartup)
: wxDialog(parent, wxID_ANY, _("Tip of the Day"),
wxDefaultPosition, wxDefaultSize,
- wxDEFAULT_DIALOG_STYLE
-#if !defined(__SMARTPHONE__) && !defined(__POCKETPC__)
- | wxRESIZE_BORDER
-#endif
+ wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER
)
{
m_tipProvider = tipProvider;
SetSizer( topsizer );
-#if !defined(__SMARTPHONE__) && !defined(__POCKETPC__)
topsizer->SetSizeHints( this );
topsizer->Fit( this );
Centre(wxBOTH | wxCENTER_FRAME);
-#endif
}
// ----------------------------------------------------------------------------
}
#endif // wxUSE_STARTUP_TIPS
-
MSWUpdateUIState(UIS_INITIALIZE);
}
+ // Note: if we include PocketPC in this test, dialogs can fail to show up,
+ // for example the text entry dialog in the dialogs sample. Problem with Maximise()?
+#if defined(__WXWINCE__) && (defined(__SMARTPHONE__) || defined(__WINCE_STANDARDSDK__))
if ( ( style & wxMAXIMIZE ) || IsAlwaysMaximized() )
{
this->Maximize();
}
+#endif
#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
SetRightMenu(); // to nothing for initialization