X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd3f686c274a264e89ea97505350a82c1134f307..eeccd5d94ce6b11f36af95db4ac528a2e2e0c4c5:/src/msw/frame.cpp diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 0f5da8a297..090bf260e2 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -45,7 +45,7 @@ #endif extern wxList wxModelessWindows; -extern wxList wxPendingDelete; +extern wxList WXDLLEXPORT wxPendingDelete; extern char wxFrameClassName[]; extern wxMenu *wxCurrentPopupMenu; @@ -331,6 +331,12 @@ bool wxFrame::IsIconized(void) const return m_iconized; } +// Is it maximized? +bool wxFrame::IsMaximized(void) const +{ + return (::IsZoomed((HWND) GetHWND()) != 0) ; +} + void wxFrame::SetTitle(const wxString& title) { SetWindowText((HWND) GetHWND(), (const char *)title); @@ -370,7 +376,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); @@ -508,7 +514,7 @@ bool wxFrame::LoadAccelerators(const wxString& table) void wxFrame::Fit(void) { // Work out max. size - wxNode *node = GetChildren()->First(); + wxNode *node = GetChildren().First(); int max_width = 0; int max_height = 0; while (node) @@ -606,6 +612,11 @@ void wxFrame::MSWCreate(int id, wxWindow *parent, const char *wclass, wxWindow * WXDWORD extendedStyle = MakeExtendedStyle(style); +#if !defined(__WIN16__) && !defined(__SC__) + if (style & wxFRAME_TOOL_WINDOW) + extendedStyle |= WS_EX_TOOLWINDOW; +#endif + if (style & wxSTAY_ON_TOP) extendedStyle |= WS_EX_TOPMOST; @@ -637,7 +648,7 @@ bool wxFrame::MSWOnPaint(void) HDC cdc = BeginPaint((HWND) GetHWND(), &ps); // Erase background before painting or we get white background - this->MSWDefWindowProc(WM_ICONERASEBKGND,(WORD)ps.hdc,0L); + this->MSWDefWindowProc(WM_ICONERASEBKGND,(WORD)(LONG) ps.hdc,0L); if (the_icon) { @@ -801,7 +812,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)) && @@ -831,7 +842,7 @@ 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(); @@ -883,9 +894,14 @@ void wxFrame::OnMenuHighlight(wxMenuEvent& event) wxMenuBar *menuBar = GetMenuBar(); if (menuBar) { - wxString helpString(menuBar->GetHelpString(event.GetMenuId())); +// #ifndef __SALFORDC__ + int menuId = event.GetMenuId(); + wxString helpString; + // This causes a spurious access violation with Salford C++ + helpString = menuBar->GetHelpString(menuId); if (helpString != "") - SetStatusText(helpString); + SetStatusText(helpString); +// #endif } } } @@ -920,7 +936,7 @@ void wxFrame::Command(int id) void wxFrame::ProcessCommand(int id) { - wxCommandEvent commandEvent(wxEVENT_TYPE_MENU_COMMAND, id); + wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id); commandEvent.SetInt( id ); commandEvent.SetEventObject( this ); @@ -1037,7 +1053,7 @@ void wxFrame::PositionToolBar(void) // propagate our state change to all child frames void wxFrame::IconizeChildFrames(bool bIconize) { - 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)) ) { ((wxFrame *)win)->Iconize(bIconize);