X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/46ccb5107ff22cb5cc1b36ef2a28ea1e31b0fc91..ad5c34f309074eefe625b82e1203eec5b91247f5:/src/stubs/frame.cpp?ds=sidebyside diff --git a/src/stubs/frame.cpp b/src/stubs/frame.cpp index 5326e615d9..1e8c9e9ae5 100644 --- a/src/stubs/frame.cpp +++ b/src/stubs/frame.cpp @@ -39,7 +39,7 @@ 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 +163,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 @@ -190,7 +197,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); @@ -264,7 +271,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) @@ -312,7 +319,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; @@ -321,7 +328,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)) && @@ -351,16 +358,13 @@ 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; } @@ -481,6 +485,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,