More common code moved from generic dialogs to wxDialogBase::CreateButtonSizer(). New system option 'wince.dialog.real-ok-cancel'.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36880 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2006-01-15 10:06:15 +00:00
parent f3078f075b
commit 897b24cf5c
10 changed files with 184 additions and 125 deletions

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: textdlgg.cpp
// Name: src/generic/textdlgg.cpp
// Purpose: wxTextEntryDialog
// Author: Julian Smart
// Modified by:
@@ -96,7 +96,7 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent,
#if wxUSE_STATTEXT
// 1) text message
topsizer->Add( CreateTextSizer( message ), 0, wxALL, wxLARGESMALL(10,0) );
#endif
#endif
// 2) text ctrl
m_textctrl = new wxTextCtrl(this, wxID_TEXT, value,
@@ -107,25 +107,19 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent,
#if wxUSE_VALIDATORS
wxTextValidator validator( wxFILTER_NONE, &m_value );
m_textctrl->SetValidator( validator );
#endif
// wxUSE_VALIDATORS
#endif // wxUSE_VALIDATORS
// smart phones does not support or do not waste space for wxButtons
#ifdef __SMARTPHONE__
SetRightMenu(wxID_CANCEL, _("Cancel"));
#else // __SMARTPHONE__/!__SMARTPHONE__
#if wxUSE_STATLINE
// 3) static line
topsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif
// 4) buttons
topsizer->Add( CreateButtonSizer( style ), 0, wxEXPAND | wxALL, 10 );
#endif // !__SMARTPHONE__
// 3) buttons if any
wxSizer *buttonSizer = CreateButtonSizer( style & ButtonSizerFlags , true, wxLARGESMALL(10,0) );
if(buttonSizer->GetChildren().GetCount() > 0 )
{
topsizer->Add( buttonSizer, 0, wxEXPAND | wxALL, wxLARGESMALL(10,0) );
}
else
{
topsizer->AddSpacer( wxLARGESMALL(15,0) );
delete buttonSizer;
}
SetAutoLayout( true );
SetSizer( topsizer );