本文整理汇总了C++中GetActiveChild函数的典型用法代码示例。如果您正苦于以下问题:C++ GetActiveChild函数的具体用法?C++ GetActiveChild怎么用?C++ GetActiveChild使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetActiveChild函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
//---------------------------------------------------------
void CSAGA_Frame::On_Frame_Close_All(wxCommandEvent &WXUNUSED(event))
{
while( GetActiveChild() != NULL )
{
delete(GetActiveChild());
}
}
示例2: GetActiveChild
//---------------------------------------------------------
void CSAGA_Frame::On_Frame_Close(wxCommandEvent &WXUNUSED(event))
{
if( GetActiveChild() != NULL )
{
GetActiveChild()->Close();
}
}
示例3: wxGetApp
// Make sure the correct toolbars are showing for the active view
void csFrame::OnIdle(wxIdleEvent& event)
{
wxSashLayoutWindow* paletteWin = wxGetApp().GetDiagramPaletteSashWindow();
wxSashLayoutWindow* diagramToolBarWin = wxGetApp().GetDiagramToolBarSashWindow();
if (!paletteWin || !diagramToolBarWin)
return;
bool doLayout = false;
if (GetActiveChild())
{
if (!paletteWin->IsShown() || !diagramToolBarWin->IsShown())
{
paletteWin->Show(true);
diagramToolBarWin->Show(true);
doLayout = true;
}
}
else
{
if (paletteWin->IsShown() || diagramToolBarWin->IsShown())
{
paletteWin->Show(false);
diagramToolBarWin->Show(false);
doLayout = true;
}
}
if (doLayout)
{
wxLayoutAlgorithm layout;
layout.LayoutMDIFrame(this);
#if defined(__WXMSW__)
// Need to do something else to get it to refresh properly
// when a client frame is first displayed; moving the client
// window doesn't cause the proper refresh. Just refreshing the
// client doesn't work (presumably because it's clipping the
// children).
// FIXED in wxWidgets, by intercepting wxMDIClientWindow::DoSetSize
// and checking if the position has changed, before redrawing the
// child windows.
#if 0
wxMDIChildFrame* childFrame = GetActiveChild();
if (childFrame)
{
HWND hWnd = (HWND) childFrame->GetHWND();
::RedrawWindow(hWnd, NULL, NULL, RDW_FRAME|RDW_ALLCHILDREN|RDW_INVALIDATE );
}
#endif
#endif // __WXMSW__
}
event.Skip();
}
示例4: GetActiveChild
wxMenuItem *wxMDIParentFrame::FindItemInMenuBar(int menuId) const
{
wxMenuItem *item = wxFrame::FindItemInMenuBar(menuId);
if ( !item && GetActiveChild() )
{
item = GetActiveChild()->FindItemInMenuBar(menuId);
}
if ( !item && m_windowMenu )
item = m_windowMenu->FindItem(menuId);
return item;
}
示例5: GetActiveChild
void wxMDIParentFrame::DoMenuUpdates(wxMenu* menu)
{
wxMDIChildFrame *child = GetActiveChild();
if ( child )
{
wxEvtHandler* source = child->GetEventHandler();
wxMenuBar* bar = child->GetMenuBar();
if (menu)
{
menu->UpdateUI(source);
}
else
{
if ( bar != NULL )
{
int nCount = bar->GetMenuCount();
for (int n = 0; n < nCount; n++)
bar->GetMenu(n)->UpdateUI(source);
}
}
}
else
{
wxFrameBase::DoMenuUpdates(menu);
}
}
示例6: GetActiveChild
wxMenuItem *wxMDIParentFrame::FindItemInMenuBar(int menuId) const
{
// We must look in the child menu first: if it has an item with the same ID
// as in our own menu bar, the child item should be used to determine
// whether it's currently enabled.
wxMenuItem *item = GetActiveChild()
? GetActiveChild()->FindItemInMenuBar(menuId)
: NULL;
if ( !item )
item = wxFrame::FindItemInMenuBar(menuId);
if ( !item && m_windowMenu )
item = m_windowMenu->FindItem(menuId);
return item;
}
示例7: On_Command_Child_UI
void CSAGA_Frame::On_Command_Child_UI(wxUpdateUIEvent &event)
{
CVIEW_Base *pChild;
if( (pChild = wxDynamicCast(GetActiveChild(), CVIEW_Base)) != NULL )
{
pChild->On_Command_UI(event);
}
}
示例8: On_Command_Child
//---------------------------------------------------------
void CSAGA_Frame::On_Command_Child(wxCommandEvent &event)
{
wxMDIChildFrame *pChild;
if( (pChild = GetActiveChild()) != NULL )
{
pChild->GetEventHandler()->AddPendingEvent(event);
}
}
示例9: SetStatusText
// Default menu selection behaviour - display a help string
void wxMDIParentFrame::OnMenuHighlight(wxMenuEvent& event)
{
if (GetStatusBar())
{
if (event.GetMenuId() == -1)
SetStatusText("");
else
{
wxMenuBar *menuBar = (wxMenuBar*) NULL;
if (GetActiveChild())
menuBar = GetActiveChild()->GetMenuBar();
else
menuBar = GetMenuBar();
if (menuBar)
{
wxString helpString(menuBar->GetHelpString(event.GetMenuId()));
if (helpString != "")
SetStatusText(helpString);
}
}
}
}
示例10: InternalSetMenuBar
void wxMDIParentFrame::InternalSetMenuBar()
{
if ( GetActiveChild() )
{
AddWindowMenu();
}
else // we don't have any MDI children yet
{
// wait until we do to add the window menu but do set the main menu for
// now (this is done by AddWindowMenu() as a side effect)
MDISetMenu(GetClientWindow(), (HMENU)m_hMenu, NULL);
}
}
示例11: event
bool wxMDIParentFrame::HandleActivate(int state, bool minimized, WXHWND activate)
{
bool processed = false;
if ( wxWindow::HandleActivate(state, minimized, activate) )
{
// already processed
processed = true;
}
// If this window is an MDI parent, we must also send an OnActivate message
// to the current child.
if ( GetActiveChild() &&
((state == WA_ACTIVE) || (state == WA_CLICKACTIVE)) )
{
wxActivateEvent event(wxEVT_ACTIVATE, true, GetActiveChild()->GetId());
event.SetEventObject( GetActiveChild() );
if ( GetActiveChild()->HandleWindowEvent(event) )
processed = true;
}
return processed;
}
示例12: GetActiveChild
void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
{
wxFrame::GtkOnSize( x, y, width, height );
wxMDIChildFrame *child_frame = GetActiveChild();
if (!child_frame) return;
wxMenuBar *menu_bar = child_frame->m_menuBar;
if (!menu_bar) return;
if (!menu_bar->m_widget) return;
menu_bar->m_x = 0;
menu_bar->m_y = 0;
menu_bar->m_width = m_width;
menu_bar->m_height = wxMENU_HEIGHT;
gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
menu_bar->m_widget,
0, 0, m_width, wxMENU_HEIGHT );
}
示例13: GetActiveChild
void wxMDIParentFrame::DoGetClientSize(int* width, int* height) const
{
wxFrame::DoGetClientSize(width, height);
if (height)
{
wxMDIChildFrame* active_child_frame = GetActiveChild();
if (active_child_frame)
{
wxMenuBar* menubar = active_child_frame->m_menuBar;
if (menubar && menubar->IsShown())
{
GtkRequisition req;
gtk_widget_size_request(menubar->m_widget, &req);
*height -= req.height;
if (*height < 0) *height = 0;
}
}
}
}
示例14: WXUNUSED
void MyFrame::FileSavePicture (wxCommandEvent & WXUNUSED(event) )
{
#if wxUSE_FILEDLG
MyChild * pChild = (MyChild *)GetActiveChild();
if (pChild == NULL)
{
return;
}
wxFileDialog dialog(this, wxT("Save Picture as"), wxEmptyString, pChild->GetTitle(),
wxT("SVG vector picture files (*.svg)|*.svg"),
wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
if (dialog.ShowModal() == wxID_OK)
{
if (!pChild->OnSave ( dialog.GetPath() ))
{
return;
}
}
return;
#endif // wxUSE_FILEDLG
}
示例15: On_Frame_Previous_UI
void CSAGA_Frame::On_Frame_Previous_UI(wxUpdateUIEvent &event)
{
event.Enable(GetActiveChild() != NULL);
}