DECLARE_DYNAMIC_CLASS(wxRadioButton)
public:
- inline wxRadioButton(void) {}
+ inline wxRadioButton() {}
inline wxRadioButton( wxWindow *parent, wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxString& name = wxRadioButtonNameStr );
virtual void SetLabel(const wxString& label);
virtual void SetValue(bool val);
- virtual bool GetValue(void) const;
+ virtual bool GetValue() const;
bool Enable( bool enable );
// implementation
DECLARE_DYNAMIC_CLASS(wxRadioButton)
public:
- inline wxRadioButton(void) {}
+ inline wxRadioButton() {}
inline wxRadioButton( wxWindow *parent, wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxString& name = wxRadioButtonNameStr );
virtual void SetLabel(const wxString& label);
virtual void SetValue(bool val);
- virtual bool GetValue(void) const;
+ virtual bool GetValue() const;
bool Enable( bool enable );
// implementation
class WXDLLEXPORT wxClientData;
class WXDLLEXPORT wxControl;
class WXDLLEXPORT wxCursor;
-class WXDLLEXPORT wxDc;
+class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxDropTarget;
class WXDLLEXPORT wxItemResource;
class WXDLLEXPORT wxLayoutConstraints;
const wxPoint &pos, const wxSize &size )
: wxScrolledWindow( parent, id, pos, size, wxSUNKEN_BORDER | wxTAB_TRAVERSAL )
{
-
- SetBackgroundColour( *wxWHITE );
-
- (void) new wxButton( this, -1, "wxButton", wxPoint(10,10) );
-
- (void) new wxTextCtrl( this, -1, "wxTextCtrl", wxPoint(10,50) );
-
- (void) new wxRadioButton( this, -1, "Disable", wxPoint(10,90) );
-
wxString choices[] =
{
"This",
"examples."
};
- (void) new wxComboBox( this, -1, "This", wxPoint(10,130), wxDefaultSize, 5, choices );
+// (void) new wxButton( this, -1, "wxButton", wxPoint(10,10) );
+
+// (void) new wxTextCtrl( this, -1, "wxTextCtrl", wxPoint(10,50) );
+
+ (void) new wxRadioButton( this, -1, "Disable", wxPoint(10,90) );
+
+// (void) new wxComboBox( this, -1, "This", wxPoint(10,130), wxDefaultSize, 5, choices );
(void) new wxRadioBox( this, -1, "This", wxPoint(10,200), wxDefaultSize, 5, choices );
+
+ SetBackgroundColour( *wxWHITE );
}
MyCanvas::~MyCanvas()
: wxFrame( (wxFrame *)NULL, -1, "wxScrolledWindow sample",
wxPoint(20,20), wxSize(470,360) )
{
+/*
wxMenu *file_menu = new wxMenu();
file_menu->Append( ID_ABOUT, "&About..");
file_menu->Append( ID_QUIT, "E&xit\tAlt-X");
int widths[] = { -1, 100 };
SetStatusWidths( 2, widths );
+*/
m_canvas = new MyCanvas( this, -1, wxPoint(0,0), wxSize(10,10) );
m_canvas->SetScrollbars( 10, 10, 50, 100 );
}
// Just in case we've loaded a top-level window via LoadNativeDialog but
// we weren't a dialog class
wxTopLevelWindows.DeleteObject(this);
-
- DestroyChildren();
+
+ wxASSERT_MSG( GetChildren().GetCount() == 0, "children not destroyed" );
if ( m_windowValidator )
delete m_windowValidator;
bool wxWindowBase::DestroyChildren()
{
wxWindowList::Node *node;
- for ( node = GetChildren().GetFirst(); node; node = node->GetNext() )
+ while ( (node = GetChildren().GetFirst()) )
{
wxWindow *child = node->GetData();
- if ( child )
- {
- delete child;
- }
+
+ wxASSERT_MSG( child, "m_children contains empty nodes" );
+
+ delete child;
+
+ wxASSERT_MSG( !GetChildren().Find(child), "child didn't remove itself using RemoveChild()" );
}
return TRUE;
gtk_signal_connect( GTK_OBJECT(m_widget), "released",
GTK_SIGNAL_FUNC(gtk_bmpbutton_release_callback), (gpointer*)this );
- m_parent->AddChild( this );
-
- m_parent->InsertChild( this );
+ m_parent->DoAddChild( this );
PostCreation();
gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_theOtherRadioButtton), TRUE );
}
-bool wxRadioButton::GetValue(void) const
+bool wxRadioButton::GetValue() const
{
wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobutton") );
m_vAdjust->page_size = fthumb;
}
- if (m_wxwindow->window)
- {
- if (orient == wxHORIZONTAL)
- gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "changed" );
- else
- gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "changed" );
-
- gtk_widget_set_usize( m_widget, m_width, m_height );
- }
+ if (orient == wxHORIZONTAL)
+ gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "changed" );
+ else
+ gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "changed" );
}
void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
m_vAdjust->value = fpos;
}
- if (!m_isScrolling)
+ if (!m_isScrolling) /* prevent recursion */
{
if (m_wxwindow->window)
{
gtk_signal_connect( GTK_OBJECT(m_widget), "released",
GTK_SIGNAL_FUNC(gtk_bmpbutton_release_callback), (gpointer*)this );
- m_parent->AddChild( this );
-
- m_parent->InsertChild( this );
+ m_parent->DoAddChild( this );
PostCreation();
gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_theOtherRadioButtton), TRUE );
}
-bool wxRadioButton::GetValue(void) const
+bool wxRadioButton::GetValue() const
{
wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobutton") );
m_vAdjust->page_size = fthumb;
}
- if (m_wxwindow->window)
- {
- if (orient == wxHORIZONTAL)
- gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "changed" );
- else
- gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "changed" );
-
- gtk_widget_set_usize( m_widget, m_width, m_height );
- }
+ if (orient == wxHORIZONTAL)
+ gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "changed" );
+ else
+ gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "changed" );
}
void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
m_vAdjust->value = fpos;
}
- if (!m_isScrolling)
+ if (!m_isScrolling) /* prevent recursion */
{
if (m_wxwindow->window)
{