m_resizing = FALSE;
}
-wxWindow::wxWindow( wxWindow *parent, wxWindowID id,
- const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
-{
- m_cursor = NULL;
- Create( parent, id, pos, size, style, name );
-}
-
bool wxWindow::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
+ long style, const wxString &name )
{
m_isShown = FALSE;
m_isEnabled = TRUE;
m_needParent = TRUE;
+ m_cursor = NULL;
+
PreCreation( parent, id, pos, size, style, name );
m_widget = gtk_scrolled_window_new( NULL, NULL );
m_windowSizer = NULL;
}
// If this is a child of a sizer, remove self from parent
- if (m_sizerParent)
- m_sizerParent->RemoveChild((wxWindow *)this);
+ if (m_sizerParent) m_sizerParent->RemoveChild((wxWindow *)this);
// Just in case the window has been Closed, but
// we're then deleting immediately: don't leave
// class
wxTopLevelWindows.DeleteObject(this);
+ if (m_windowValidator) delete m_windowValidator;
}
void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
if (m_height == -1) m_height = 20;
m_retCode = 0;
m_eventHandler = this;
- m_windowValidator = NULL;
m_windowId = id;
m_sizeSet = FALSE;
if (m_cursor == NULL)
m_drawingOffsetY = 0;
m_pDropTarget = NULL;
m_resizing = FALSE;
+ m_windowValidator = NULL;
}
void wxWindow::PostCreation(void)
return m_windowValidator;
}
-void wxWindow::SetValidator( wxValidator *validator )
+void wxWindow::SetValidator( const wxValidator& validator )
{
- m_windowValidator = validator;
+ if (m_windowValidator) delete m_windowValidator;
+ m_windowValidator = validator.Clone();
+ if (m_windowValidator) m_windowValidator->SetWindow(this);
}
bool wxWindow::IsBeingDeleted(void)
// do something ?
}
+wxColour wxWindow::GetForegroundColour(void) const
+{
+ return m_foregroundColour;
+}
+
+void wxWindow::SetForegroundColour( const wxColour &colour )
+{
+ m_foregroundColour = colour;
+}
+
bool wxWindow::Validate(void)
{
wxNode *node = GetChildren()->First();