- // Specify constraints for the button sizer
- wxLayoutConstraints *c = new wxLayoutConstraints;
- c->width.AsIs ();
- c->height.AsIs ();
- c->top.Below (spacingSizer2);
- c->centreX.SameAs (textSizer, wxCentreX);
- buttonSizer->SetConstraints(c);
+ // 2) text ctrl
+ m_textctrl = new wxTextCtrl(this, wxID_TEXT, value,
+ wxDefaultPosition, wxSize(300, wxDefaultCoord),
+ style & ~wxTextEntryDialogStyle);
+ topsizer->Add( m_textctrl, style & wxTE_MULTILINE ? 1 : 0, wxEXPAND | wxLEFT|wxRIGHT, wxLARGESMALL(15,0) );
+
+#if wxUSE_VALIDATORS
+ wxTextValidator validator( wxFILTER_NONE, &m_value );
+ m_textctrl->SetValidator( validator );
+#endif // wxUSE_VALIDATORS
+
+ // 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 );
+
+#if !defined(__SMARTPHONE__) && !defined(__POCKETPC__)
+ topsizer->SetSizeHints( this );
+ topsizer->Fit( this );
+
+ if ( style & wxCENTRE )
+ Centre( wxBOTH );
+#endif