remove wxWindow::m_needParent and use GTKNeedsParent() which can be overridden in just wxMenuBar (and not set in each and every wxGTK control)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -40,6 +40,10 @@ public:
|
|||||||
void SetLayoutDirection(wxLayoutDirection dir);
|
void SetLayoutDirection(wxLayoutDirection dir);
|
||||||
wxLayoutDirection GetLayoutDirection() const;
|
wxLayoutDirection GetLayoutDirection() const;
|
||||||
|
|
||||||
|
// wxMenuBar is not a top level window but it still doesn't need a parent
|
||||||
|
// window
|
||||||
|
virtual bool GTKNeedsParent() const { return false; }
|
||||||
|
|
||||||
void Attach(wxFrame *frame);
|
void Attach(wxFrame *frame);
|
||||||
|
|
||||||
// implementation only from now on
|
// implementation only from now on
|
||||||
|
@@ -181,6 +181,11 @@ public:
|
|||||||
static wxLayoutDirection GTKGetLayout(GtkWidget *widget);
|
static wxLayoutDirection GTKGetLayout(GtkWidget *widget);
|
||||||
static void GTKSetLayout(GtkWidget *widget, wxLayoutDirection dir);
|
static void GTKSetLayout(GtkWidget *widget, wxLayoutDirection dir);
|
||||||
|
|
||||||
|
// return true if this window must have a non-NULL parent, false if it can
|
||||||
|
// be created without parent (normally only top level windows but in wxGTK
|
||||||
|
// there is also the exception of wxMenuBar)
|
||||||
|
virtual bool GTKNeedsParent() const { return !IsTopLevel(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Override GTKWidgetNeedsMnemonic and return true if your
|
// Override GTKWidgetNeedsMnemonic and return true if your
|
||||||
// needs to set its mnemonic widget, such as for a
|
// needs to set its mnemonic widget, such as for a
|
||||||
@@ -292,7 +297,6 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// extra (wxGTK-specific) flags
|
// extra (wxGTK-specific) flags
|
||||||
bool m_needParent:1; // ! wxFrame, wxDialog, wxNotebookPage ?
|
|
||||||
bool m_noExpose:1; // wxGLCanvas has its own redrawing
|
bool m_noExpose:1; // wxGLCanvas has its own redrawing
|
||||||
bool m_nativeSizeEvent:1; // wxGLCanvas sends wxSizeEvent upon "alloc_size"
|
bool m_nativeSizeEvent:1; // wxGLCanvas sends wxSizeEvent upon "alloc_size"
|
||||||
bool m_hasScrolling:1;
|
bool m_hasScrolling:1;
|
||||||
|
@@ -199,8 +199,6 @@ bool wxAnimationCtrl::Create( wxWindow *parent, wxWindowID id,
|
|||||||
long style,
|
long style,
|
||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!base_type::CreateBase(parent, id, pos, size, style & wxWINDOW_STYLE_MASK,
|
!base_type::CreateBase(parent, id, pos, size, style & wxWINDOW_STYLE_MASK,
|
||||||
wxDefaultValidator, name))
|
wxDefaultValidator, name))
|
||||||
|
@@ -121,8 +121,6 @@ bool wxBitmapButton::Create( wxWindow *parent,
|
|||||||
const wxValidator& validator,
|
const wxValidator& validator,
|
||||||
const wxString &name )
|
const wxString &name )
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||||
{
|
{
|
||||||
|
@@ -97,12 +97,15 @@ wxButton::~wxButton()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
bool wxButton::Create(wxWindow *parent,
|
||||||
const wxPoint &pos, const wxSize &size,
|
wxWindowID id,
|
||||||
long style, const wxValidator& validator, const wxString &name )
|
const wxString &label,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||||
{
|
{
|
||||||
|
@@ -107,7 +107,6 @@ bool wxCheckBox::Create(wxWindow *parent,
|
|||||||
const wxValidator& validator,
|
const wxValidator& validator,
|
||||||
const wxString &name )
|
const wxString &name )
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
m_blockEvent = false;
|
m_blockEvent = false;
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
|
@@ -94,8 +94,6 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
|
|||||||
int n, const wxString choices[],
|
int n, const wxString choices[],
|
||||||
long style, const wxValidator& validator, const wxString &name )
|
long style, const wxValidator& validator, const wxString &name )
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||||
{
|
{
|
||||||
|
@@ -61,8 +61,6 @@ bool wxColourButton::Create( wxWindow *parent, wxWindowID id,
|
|||||||
{
|
{
|
||||||
if (!gtk_check_version(2,4,0))
|
if (!gtk_check_version(2,4,0))
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!wxControl::CreateBase(parent, id, pos, size, style, validator, name))
|
!wxControl::CreateBase(parent, id, pos, size, style, validator, name))
|
||||||
{
|
{
|
||||||
|
@@ -198,7 +198,6 @@ bool wxCollapsiblePane::Create(wxWindow *parent,
|
|||||||
return wxGenericCollapsiblePane::Create(parent, id, label,
|
return wxGenericCollapsiblePane::Create(parent, id, label,
|
||||||
pos, size, style, val, name);
|
pos, size, style, val, name);
|
||||||
|
|
||||||
m_needParent = true;
|
|
||||||
m_bIgnoreNextChange = false;
|
m_bIgnoreNextChange = false;
|
||||||
|
|
||||||
if ( !PreCreation( parent, pos, size ) ||
|
if ( !PreCreation( parent, pos, size ) ||
|
||||||
|
@@ -242,7 +242,6 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
|
|||||||
const wxString& name )
|
const wxString& name )
|
||||||
{
|
{
|
||||||
m_ignoreNextUpdate = false;
|
m_ignoreNextUpdate = false;
|
||||||
m_needParent = true;
|
|
||||||
m_prevSelection = 0;
|
m_prevSelection = 0;
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
|
@@ -37,7 +37,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxControl, wxWindow)
|
|||||||
|
|
||||||
wxControl::wxControl()
|
wxControl::wxControl()
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxControl::Create( wxWindow *parent,
|
bool wxControl::Create( wxWindow *parent,
|
||||||
|
@@ -488,7 +488,7 @@ static GtkCellEditable *gtk_wx_cell_renderer_start_editing(
|
|||||||
GdkRectangle *background_area,
|
GdkRectangle *background_area,
|
||||||
GdkRectangle *cell_area,
|
GdkRectangle *cell_area,
|
||||||
GtkCellRendererState flags );
|
GtkCellRendererState flags );
|
||||||
|
|
||||||
|
|
||||||
static GObjectClass *cell_parent_class = NULL;
|
static GObjectClass *cell_parent_class = NULL;
|
||||||
|
|
||||||
@@ -572,7 +572,7 @@ static GtkCellEditable *gtk_wx_cell_renderer_start_editing(
|
|||||||
wxDataViewCustomRenderer *cell = wxrenderer->cell;
|
wxDataViewCustomRenderer *cell = wxrenderer->cell;
|
||||||
if (!cell->HasEditorCtrl())
|
if (!cell->HasEditorCtrl())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
GdkRectangle rect;
|
GdkRectangle rect;
|
||||||
gtk_wx_cell_renderer_get_size (renderer, widget, cell_area,
|
gtk_wx_cell_renderer_get_size (renderer, widget, cell_area,
|
||||||
&rect.x,
|
&rect.x,
|
||||||
@@ -733,11 +733,11 @@ gtk_wx_cell_renderer_activate(
|
|||||||
if (!event)
|
if (!event)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
// activated by <ENTER>
|
// activated by <ENTER>
|
||||||
if (cell->Activate( renderrect, model, model_col, model_row ))
|
if (cell->Activate( renderrect, model, model_col, model_row ))
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
else if (event->type == GDK_BUTTON_PRESS)
|
else if (event->type == GDK_BUTTON_PRESS)
|
||||||
@@ -1933,7 +1933,7 @@ static void wxInsertChildInDataViewCtrl( wxWindowGTK* parent, wxWindowGTK* child
|
|||||||
|
|
||||||
// Insert widget in GtkTreeView
|
// Insert widget in GtkTreeView
|
||||||
if (GTK_WIDGET_REALIZED(treeview))
|
if (GTK_WIDGET_REALIZED(treeview))
|
||||||
gtk_widget_set_parent_window( child->m_widget,
|
gtk_widget_set_parent_window( child->m_widget,
|
||||||
gtk_tree_view_get_bin_window( GTK_TREE_VIEW(treeview) ) );
|
gtk_tree_view_get_bin_window( GTK_TREE_VIEW(treeview) ) );
|
||||||
gtk_widget_set_parent( child->m_widget, treeview );
|
gtk_widget_set_parent( child->m_widget, treeview );
|
||||||
}
|
}
|
||||||
@@ -1943,22 +1943,22 @@ void gtk_dataviewctrl_size_callback( GtkWidget *WXUNUSED(widget),
|
|||||||
GtkAllocation *alloc,
|
GtkAllocation *alloc,
|
||||||
wxDataViewCtrl *win )
|
wxDataViewCtrl *win )
|
||||||
{
|
{
|
||||||
|
|
||||||
wxWindowList::Node *node = win->GetChildren().GetFirst();
|
wxWindowList::Node *node = win->GetChildren().GetFirst();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
wxWindow *child = node->GetData();
|
wxWindow *child = node->GetData();
|
||||||
|
|
||||||
GtkRequisition req;
|
GtkRequisition req;
|
||||||
gtk_widget_size_request( child->m_widget, &req );
|
gtk_widget_size_request( child->m_widget, &req );
|
||||||
|
|
||||||
GtkAllocation alloc;
|
GtkAllocation alloc;
|
||||||
alloc.x = child->m_x;
|
alloc.x = child->m_x;
|
||||||
alloc.y = child->m_y;
|
alloc.y = child->m_y;
|
||||||
alloc.width = child->m_width;
|
alloc.width = child->m_width;
|
||||||
alloc.height = child->m_height;
|
alloc.height = child->m_height;
|
||||||
gtk_widget_size_allocate( child->m_widget, &alloc );
|
gtk_widget_size_allocate( child->m_widget, &alloc );
|
||||||
|
|
||||||
node = node->GetNext();
|
node = node->GetNext();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1988,8 +1988,6 @@ bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id,
|
|||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
|
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, validator ))
|
!CreateBase( parent, id, pos, size, style, validator ))
|
||||||
{
|
{
|
||||||
@@ -2005,7 +2003,7 @@ bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
m_treeview = gtk_tree_view_new();
|
m_treeview = gtk_tree_view_new();
|
||||||
gtk_container_add (GTK_CONTAINER (m_widget), m_treeview);
|
gtk_container_add (GTK_CONTAINER (m_widget), m_treeview);
|
||||||
|
|
||||||
g_signal_connect (m_treeview, "size_allocate",
|
g_signal_connect (m_treeview, "size_allocate",
|
||||||
G_CALLBACK (gtk_dataviewctrl_size_callback), this);
|
G_CALLBACK (gtk_dataviewctrl_size_callback), this);
|
||||||
|
|
||||||
|
@@ -97,7 +97,6 @@ wxDirDialog::wxDirDialog(wxWindow* parent, const wxString& title,
|
|||||||
if (!gtk_check_version(2,4,0))
|
if (!gtk_check_version(2,4,0))
|
||||||
{
|
{
|
||||||
m_message = title;
|
m_message = title;
|
||||||
m_needParent = false;
|
|
||||||
|
|
||||||
parent = GetParentForModalDialog(parent);
|
parent = GetParentForModalDialog(parent);
|
||||||
|
|
||||||
|
@@ -152,8 +152,6 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_needParent = false;
|
|
||||||
|
|
||||||
parent = GetParentForModalDialog(parent);
|
parent = GetParentForModalDialog(parent);
|
||||||
|
|
||||||
if (!PreCreation(parent, pos, wxDefaultSize) ||
|
if (!PreCreation(parent, pos, wxDefaultSize) ||
|
||||||
|
@@ -46,8 +46,6 @@ bool wxFileButton::Create( wxWindow *parent, wxWindowID id,
|
|||||||
// VERY IMPORTANT: this code is identic to relative code in wxDirButton;
|
// VERY IMPORTANT: this code is identic to relative code in wxDirButton;
|
||||||
// if you find a problem here, fix it also in wxDirButton !
|
// if you find a problem here, fix it also in wxDirButton !
|
||||||
|
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!wxControl::CreateBase(parent, id, pos, size, style & wxWINDOW_STYLE_MASK,
|
!wxControl::CreateBase(parent, id, pos, size, style & wxWINDOW_STYLE_MASK,
|
||||||
validator, name))
|
validator, name))
|
||||||
@@ -195,8 +193,6 @@ bool wxDirButton::Create( wxWindow *parent, wxWindowID id,
|
|||||||
// VERY IMPORTANT: this code is identic to relative code in wxFileButton;
|
// VERY IMPORTANT: this code is identic to relative code in wxFileButton;
|
||||||
// if you find a problem here, fix it also in wxFileButton !
|
// if you find a problem here, fix it also in wxFileButton !
|
||||||
|
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!wxControl::CreateBase(parent, id, pos, size, style & wxWINDOW_STYLE_MASK,
|
!wxControl::CreateBase(parent, id, pos, size, style & wxWINDOW_STYLE_MASK,
|
||||||
validator, name))
|
validator, name))
|
||||||
|
@@ -86,8 +86,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog)
|
|||||||
|
|
||||||
bool wxFontDialog::DoCreate(wxWindow *parent)
|
bool wxFontDialog::DoCreate(wxWindow *parent)
|
||||||
{
|
{
|
||||||
m_needParent = false;
|
|
||||||
|
|
||||||
parent = GetParentForModalDialog(parent);
|
parent = GetParentForModalDialog(parent);
|
||||||
|
|
||||||
if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) ||
|
if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) ||
|
||||||
|
@@ -60,8 +60,6 @@ bool wxFontButton::Create( wxWindow *parent, wxWindowID id,
|
|||||||
{
|
{
|
||||||
if (!gtk_check_version(2,4,0))
|
if (!gtk_check_version(2,4,0))
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!wxControl::CreateBase(parent, id, pos, size, style, validator, name))
|
!wxControl::CreateBase(parent, id, pos, size, style, validator, name))
|
||||||
{
|
{
|
||||||
|
@@ -31,8 +31,6 @@ bool wxGauge::Create( wxWindow *parent,
|
|||||||
const wxValidator& validator,
|
const wxValidator& validator,
|
||||||
const wxString& name )
|
const wxString& name )
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||||
{
|
{
|
||||||
|
@@ -76,8 +76,6 @@ bool wxHyperlinkCtrl::Create(wxWindow *parent, wxWindowID id,
|
|||||||
// do validation checks:
|
// do validation checks:
|
||||||
CheckParams(label, url, style);
|
CheckParams(label, url, style);
|
||||||
|
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
|
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
|
||||||
{
|
{
|
||||||
|
@@ -303,7 +303,6 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
|
|||||||
long style, const wxValidator& validator,
|
long style, const wxValidator& validator,
|
||||||
const wxString &name )
|
const wxString &name )
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
m_blockEvent = false;
|
m_blockEvent = false;
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
|
@@ -496,8 +496,6 @@ wxMDIClientWindow::~wxMDIClientWindow()
|
|||||||
|
|
||||||
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI;
|
m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI;
|
||||||
|
|
||||||
if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) ||
|
if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) ||
|
||||||
@@ -523,4 +521,4 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif // wxUSE_MDI
|
||||||
|
@@ -140,13 +140,11 @@ IMPLEMENT_DYNAMIC_CLASS(wxMenuBar,wxWindow)
|
|||||||
|
|
||||||
void wxMenuBar::Init(size_t n, wxMenu *menus[], const wxString titles[], long style)
|
void wxMenuBar::Init(size_t n, wxMenu *menus[], const wxString titles[], long style)
|
||||||
{
|
{
|
||||||
// the parent window is known after wxFrame::SetMenu()
|
|
||||||
m_needParent = false;
|
|
||||||
m_style = style;
|
m_style = style;
|
||||||
m_invokingWindow = (wxWindow*) NULL;
|
m_invokingWindow = NULL;
|
||||||
|
|
||||||
if (!PreCreation( (wxWindow*) NULL, wxDefaultPosition, wxDefaultSize ) ||
|
if (!PreCreation( NULL, wxDefaultPosition, wxDefaultSize ) ||
|
||||||
!CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("menubar") ))
|
!CreateBase( NULL, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("menubar") ))
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxMenuBar creation failed") );
|
wxFAIL_MSG( wxT("wxMenuBar creation failed") );
|
||||||
return;
|
return;
|
||||||
|
@@ -217,7 +217,6 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
|
|||||||
const wxPoint& pos, const wxSize& size,
|
const wxPoint& pos, const wxSize& size,
|
||||||
long style, const wxString& name )
|
long style, const wxString& name )
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
m_insertCallback = (wxInsertChildFunction)wxInsertChildInNotebook;
|
m_insertCallback = (wxInsertChildFunction)wxInsertChildInNotebook;
|
||||||
|
|
||||||
if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
|
if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
|
||||||
|
@@ -143,8 +143,6 @@ wxPopupWindow::~wxPopupWindow()
|
|||||||
|
|
||||||
bool wxPopupWindow::Create( wxWindow *parent, int style )
|
bool wxPopupWindow::Create( wxWindow *parent, int style )
|
||||||
{
|
{
|
||||||
m_needParent = false;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) ||
|
if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) ||
|
||||||
!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("popup") ))
|
!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("popup") ))
|
||||||
{
|
{
|
||||||
|
@@ -212,8 +212,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
|
|||||||
|
|
||||||
void wxRadioBox::Init()
|
void wxRadioBox::Init()
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
m_hasFocus =
|
m_hasFocus =
|
||||||
m_lostFocus = false;
|
m_lostFocus = false;
|
||||||
}
|
}
|
||||||
|
@@ -60,15 +60,13 @@ bool wxRadioButton::Create( wxWindow *parent,
|
|||||||
const wxValidator& validator,
|
const wxValidator& validator,
|
||||||
const wxString& name )
|
const wxString& name )
|
||||||
{
|
{
|
||||||
m_needParent = TRUE;
|
m_blockEvent = false;
|
||||||
|
|
||||||
m_blockEvent = FALSE;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxRadioButton creation failed") );
|
wxFAIL_MSG( wxT("wxRadioButton creation failed") );
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
GSList* radioButtonGroup = NULL;
|
GSList* radioButtonGroup = NULL;
|
||||||
|
@@ -129,8 +129,6 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
|
|||||||
const wxPoint& pos, const wxSize& size,
|
const wxPoint& pos, const wxSize& size,
|
||||||
long style, const wxValidator& validator, const wxString& name )
|
long style, const wxValidator& validator, const wxString& name )
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||||
{
|
{
|
||||||
|
@@ -281,13 +281,17 @@ wxSlider::wxSlider()
|
|||||||
m_needThumbRelease = false;
|
m_needThumbRelease = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxSlider::Create(wxWindow *parent, wxWindowID id,
|
bool wxSlider::Create(wxWindow *parent,
|
||||||
int value, int minValue, int maxValue,
|
wxWindowID id,
|
||||||
const wxPoint& pos, const wxSize& size,
|
int value,
|
||||||
long style, const wxValidator& validator, const wxString& name )
|
int minValue,
|
||||||
|
int maxValue,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||||
{
|
{
|
||||||
|
@@ -91,8 +91,6 @@ bool wxSpinButton::Create(wxWindow *parent,
|
|||||||
long style,
|
long style,
|
||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
wxSize new_size = size,
|
wxSize new_size = size,
|
||||||
sizeBest = DoGetBestSize();
|
sizeBest = DoGetBestSize();
|
||||||
new_size.x = sizeBest.x; // override width always
|
new_size.x = sizeBest.x; // override width always
|
||||||
|
@@ -97,8 +97,6 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id,
|
|||||||
int min, int max, int initial,
|
int min, int max, int initial,
|
||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
|
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
|
||||||
{
|
{
|
||||||
|
@@ -38,8 +38,6 @@ bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
|
|||||||
const wxPoint &pos, const wxSize &size,
|
const wxPoint &pos, const wxSize &size,
|
||||||
long style, const wxString &name )
|
long style, const wxString &name )
|
||||||
{
|
{
|
||||||
m_needParent = TRUE;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
|
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
|
||||||
{
|
{
|
||||||
|
@@ -90,13 +90,11 @@ bool wxStaticBox::Create( wxWindow *parent,
|
|||||||
long style,
|
long style,
|
||||||
const wxString& name )
|
const wxString& name )
|
||||||
{
|
{
|
||||||
m_needParent = TRUE;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
|
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxStaticBox creation failed") );
|
wxFAIL_MSG( wxT("wxStaticBox creation failed") );
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_widget = GTKCreateFrame(label);
|
m_widget = GTKCreateFrame(label);
|
||||||
|
@@ -38,8 +38,6 @@ bool wxStaticLine::Create( wxWindow *parent, wxWindowID id,
|
|||||||
const wxPoint &pos, const wxSize &size,
|
const wxPoint &pos, const wxSize &size,
|
||||||
long style, const wxString &name )
|
long style, const wxString &name )
|
||||||
{
|
{
|
||||||
m_needParent = TRUE;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
|
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
|
||||||
{
|
{
|
||||||
|
@@ -52,13 +52,11 @@ bool wxStaticText::Create(wxWindow *parent,
|
|||||||
long style,
|
long style,
|
||||||
const wxString &name )
|
const wxString &name )
|
||||||
{
|
{
|
||||||
m_needParent = TRUE;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
|
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxStaticText creation failed") );
|
wxFAIL_MSG( wxT("wxStaticText creation failed") );
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_widget = gtk_label_new(NULL);
|
m_widget = gtk_label_new(NULL);
|
||||||
|
@@ -293,7 +293,6 @@ bool wxToolBar::Create( wxWindow *parent,
|
|||||||
long style,
|
long style,
|
||||||
const wxString& name )
|
const wxString& name )
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
m_insertCallback = (wxInsertChildFunction)wxInsertChildInToolBar;
|
m_insertCallback = (wxInsertChildFunction)wxInsertChildInToolBar;
|
||||||
|
|
||||||
if ( !PreCreation( parent, pos, size ) ||
|
if ( !PreCreation( parent, pos, size ) ||
|
||||||
|
@@ -685,8 +685,6 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
|||||||
const wxValidator& validator,
|
const wxValidator& validator,
|
||||||
const wxString &name )
|
const wxString &name )
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||||
{
|
{
|
||||||
|
@@ -55,8 +55,6 @@ bool wxToggleBitmapButton::Create(wxWindow *parent, wxWindowID id,
|
|||||||
const wxValidator& validator,
|
const wxValidator& validator,
|
||||||
const wxString &name)
|
const wxString &name)
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
m_blockEvent = false;
|
m_blockEvent = false;
|
||||||
|
|
||||||
if (!PreCreation(parent, pos, size) ||
|
if (!PreCreation(parent, pos, size) ||
|
||||||
@@ -197,8 +195,6 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
|
|||||||
const wxValidator& validator,
|
const wxValidator& validator,
|
||||||
const wxString &name)
|
const wxString &name)
|
||||||
{
|
{
|
||||||
m_needParent = true;
|
|
||||||
|
|
||||||
m_blockEvent = false;
|
m_blockEvent = false;
|
||||||
|
|
||||||
if (!PreCreation(parent, pos, size) ||
|
if (!PreCreation(parent, pos, size) ||
|
||||||
|
@@ -458,8 +458,6 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
|
|||||||
|
|
||||||
wxTopLevelWindows.Append( this );
|
wxTopLevelWindows.Append( this );
|
||||||
|
|
||||||
m_needParent = false;
|
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
|
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
|
||||||
{
|
{
|
||||||
|
@@ -2229,7 +2229,6 @@ void wxWindowGTK::Init()
|
|||||||
|
|
||||||
m_sizeSet = false;
|
m_sizeSet = false;
|
||||||
m_hasVMT = false;
|
m_hasVMT = false;
|
||||||
m_needParent = true;
|
|
||||||
m_isBeingDeleted = false;
|
m_isBeingDeleted = false;
|
||||||
|
|
||||||
m_showOnIdle= false;
|
m_showOnIdle= false;
|
||||||
@@ -2452,7 +2451,10 @@ wxWindowGTK::~wxWindowGTK()
|
|||||||
|
|
||||||
bool wxWindowGTK::PreCreation( wxWindowGTK *parent, const wxPoint &pos, const wxSize &size )
|
bool wxWindowGTK::PreCreation( wxWindowGTK *parent, const wxPoint &pos, const wxSize &size )
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( !m_needParent || parent, false, wxT("Need complete parent.") );
|
if ( GTKNeedsParent() )
|
||||||
|
{
|
||||||
|
wxCHECK_MSG( parent, false, wxT("Must have non-NULL parent") );
|
||||||
|
}
|
||||||
|
|
||||||
// Use either the given size, or the default if -1 is given.
|
// Use either the given size, or the default if -1 is given.
|
||||||
// See wxWindowBase for these functions.
|
// See wxWindowBase for these functions.
|
||||||
|
Reference in New Issue
Block a user