const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxControlNameStr);
- // simulates the event, returns TRUE if the event was processed
+ // simulates the event, returns true if the event was processed
virtual void Command(wxCommandEvent& WXUNUSED(event)) { }
- // calls the callback and appropriate event handlers, returns TRUE if
+ // calls the callback and appropriate event handlers, returns true if
// event was processed
virtual bool ProcessCommand(wxCommandEvent& event);
const wxValidator& validator,
const wxString& name);
+ // native implementation using XtQueryGeometry
+ virtual wxSize DoGetBestSize() const;
+
// Motif: prevent callbacks being called while in SetValue
bool m_inSetValue;
m_backgroundColour = *wxWHITE;
m_foregroundColour = *wxBLACK;
- m_inSetValue = FALSE;
+ m_inSetValue = false;
}
bool wxControl::Create( wxWindow *parent,
{
if( !wxControlBase::CreateControl( parent, id, pos, size, style,
validator, name ) )
- return FALSE;
+ return false;
m_backgroundColour = parent->GetBackgroundColour();
m_foregroundColour = parent->GetForegroundColour();
m_font = parent->GetFont();
- return TRUE;
+ return true;
}
void wxControl::SetLabel(const wxString& label)
{
return GetEventHandler()->ProcessEvent(event);
}
+
+wxSize wxControl::DoGetBestSize() const
+{
+ Widget w = (Widget)GetTopWidget();
+
+ // Do not return any arbitrary default value...
+ wxASSERT_MSG (w, wxT("DoGetBestSize called before creation"));
+
+ XtWidgetGeometry preferred;
+ XtQueryGeometry (w, NULL, &preferred);
+
+ return wxSize(preferred.width, preferred.height);
+}