bool wxWindow_Toggle(wxWindow* wnd) { wxWindow* parent = wnd->GetParent(); const bool show = !wnd->IsShown(); wnd->Show(show); if (wxIS_KIND_OF(parent, wxFrame)) wxStaticCast(parent, wxFrame)->SendSizeEvent(); // needed when mdi else parent->Layout(); // needed when non-mdi return show; }
bool FieldSelectionPanelValidator::TransferFromWindow() { if (GetWindow() && wxIS_KIND_OF(GetWindow(), FieldSelectionPanel)) { m_userSelectedFields.clear(); FieldSelectionPanel* fsp = wxDynamicCast(GetWindow(), FieldSelectionPanel); for (size_t idx = 0; idx < fsp->GetNumSelectedFields(); ++idx) { CItemData::FieldType ft = fsp->GetSelectedFieldAt(idx); wxCHECK2_MSG(ft != CItemData::END, continue, wxT("Unexpected field type in selected item")); m_userSelectedFields.insert(ft); } return true; }
static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child ) { wxASSERT( GTK_IS_WIDGET(child->m_widget) ); if (!parent->m_insertInClientArea) { // These are outside the client area wxFrame* frame = (wxFrame*) parent; gtk_pizza_put( GTK_PIZZA(frame->m_mainWidget), GTK_WIDGET(child->m_widget), child->m_x, child->m_y, child->m_width, child->m_height ); #if wxUSE_TOOLBAR_NATIVE // We connect to these events for recalculating the client area // space when the toolbar is floating if (wxIS_KIND_OF(child,wxToolBar)) { wxToolBar *toolBar = (wxToolBar*) child; if (toolBar->GetWindowStyle() & wxTB_DOCKABLE) { gtk_signal_connect( GTK_OBJECT(toolBar->m_widget), "child_attached", GTK_SIGNAL_FUNC(gtk_toolbar_attached_callback), (gpointer)parent ); gtk_signal_connect( GTK_OBJECT(toolBar->m_widget), "child_detached", GTK_SIGNAL_FUNC(gtk_toolbar_detached_callback), (gpointer)parent ); } } #endif // wxUSE_TOOLBAR } else { // These are inside the client area gtk_pizza_put( GTK_PIZZA(parent->m_wxwindow), GTK_WIDGET(child->m_widget), child->m_x, child->m_y, child->m_width, child->m_height ); } // Resize on OnInternalIdle parent->GtkUpdateSize(); }