X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/34138703c3997ce676a1e713d9ff9eb020640da7..1e92909e9aaaadde61f917a2f34a241caa2b51db:/src/stubs/frame.cpp diff --git a/src/stubs/frame.cpp b/src/stubs/frame.cpp index 5c22818c61..aeb2a78007 100644 --- a/src/stubs/frame.cpp +++ b/src/stubs/frame.cpp @@ -26,7 +26,6 @@ extern wxList wxModelessWindows; extern wxList wxPendingDelete; -#if !USE_SHARED_LIBRARY BEGIN_EVENT_TABLE(wxFrame, wxWindow) EVT_SIZE(wxFrame::OnSize) EVT_ACTIVATE(wxFrame::OnActivate) @@ -37,9 +36,8 @@ BEGIN_EVENT_TABLE(wxFrame, wxWindow) END_EVENT_TABLE() IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow) -#endif -#if USE_NATIVE_STATUSBAR +#if wxUSE_NATIVE_STATUSBAR bool wxFrame::m_useNativeStatusBar = TRUE; #else bool wxFrame::m_useNativeStatusBar = FALSE; @@ -163,6 +161,13 @@ bool wxFrame::IsIconized() const return FALSE; } +// Is the frame maximized? +bool wxFrame::IsMaximized(void) const +{ + // TODO + return FALSE; +} + void wxFrame::SetTitle(const wxString& title) { // TODO @@ -180,11 +185,6 @@ void wxFrame::SetIcon(const wxIcon& icon) // TODO } -void wxFrame::SetAcceleratorTable(const wxAcceleratorTable& accel) -{ - m_acceleratorTable = accel; -} - wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id, const wxString& name) { @@ -195,7 +195,7 @@ wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id, // Set the height according to the font and the border size wxClientDC dc(statusBar); - dc.SetFont(* statusBar->GetFont()); + dc.SetFont(statusBar->GetFont()); long x, y; dc.GetTextExtent("X", &x, &y); @@ -269,7 +269,7 @@ void wxFrame::SetMenuBar(wxMenuBar *menuBar) void wxFrame::Fit() { // Work out max. size - wxNode *node = GetChildren()->First(); + wxNode *node = GetChildren().First(); int max_width = 0; int max_height = 0; while (node) @@ -317,7 +317,7 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) void wxFrame::OnSize(wxSizeEvent& event) { // if we're using constraints - do use them - #if USE_CONSTRAINTS + #if wxUSE_CONSTRAINTS if ( GetAutoLayout() ) { Layout(); return; @@ -326,7 +326,7 @@ void wxFrame::OnSize(wxSizeEvent& event) // do we have _exactly_ one child? wxWindow *child = NULL; - for ( wxNode *node = GetChildren()->First(); node; node = node->Next() ) + for ( wxNode *node = GetChildren().First(); node; node = node->Next() ) { wxWindow *win = (wxWindow *)node->Data(); if ( !win->IsKindOf(CLASSINFO(wxFrame)) && @@ -356,37 +356,24 @@ void wxFrame::OnSize(wxSizeEvent& event) // subwindow found. void wxFrame::OnActivate(wxActivateEvent& event) { - for(wxNode *node = GetChildren()->First(); node; node = node->Next()) + for(wxNode *node = GetChildren().First(); node; node = node->Next()) { // Find a child that's a subwindow, but not a dialog box. wxWindow *child = (wxWindow *)node->Data(); if (!child->IsKindOf(CLASSINFO(wxFrame)) && !child->IsKindOf(CLASSINFO(wxDialog))) { -#if WXDEBUG > 1 - wxDebugMsg("wxFrame::OnActivate: about to set the child's focus.\n"); -#endif child->SetFocus(); return; } } } -// The default implementation for the close window event - calls -// OnClose for backward compatibility. +// The default implementation for the close window event. void wxFrame::OnCloseWindow(wxCloseEvent& event) { - // Compatibility - if ( GetEventHandler()->OnClose() || event.GetForce()) - { - this->Destroy(); - } -} - -bool wxFrame::OnClose() -{ - return TRUE; + this->Destroy(); } // Destroy the window (delayed, if a managed window) @@ -462,7 +449,8 @@ void wxFrame::ProcessCommand(int id) } */ - GetEventHandler()->ProcessEvent(commandEvent); + wxEvtHandler* evtHandler = GetEventHandler(); + evtHandler->ProcessEvent(commandEvent); } // Checks if there is a toolbar, and returns the first free client position @@ -486,6 +474,30 @@ wxPoint wxFrame::GetClientAreaOrigin() const return pt; } +void wxFrame::ScreenToClient(int *x, int *y) const +{ + wxWindow::ScreenToClient(x, y); + + // We may be faking the client origin. + // So a window that's really at (0, 30) may appear + // (to wxWin apps) to be at (0, 0). + wxPoint pt(GetClientAreaOrigin()); + *x -= pt.x; + *y -= pt.y; +} + +void wxFrame::ClientToScreen(int *x, int *y) const +{ + // We may be faking the client origin. + // So a window that's really at (0, 30) may appear + // (to wxWin apps) to be at (0, 0). + wxPoint pt1(GetClientAreaOrigin()); + *x += pt1.x; + *y += pt1.y; + + wxWindow::ClientToScreen(x, y); +} + wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name) { wxCHECK_MSG( m_frameToolBar == NULL, FALSE,