]> git.saurik.com Git - wxWidgets.git/commitdiff
wxMSW update for CW, wxMac updated
authorStefan Csomor <csomor@advancedconcepts.ch>
Fri, 3 Dec 1999 14:30:39 +0000 (14:30 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Fri, 3 Dec 1999 14:30:39 +0000 (14:30 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4801 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/mac/printmac.h
include/wx/notebook.h
src/mac/app.cpp
src/mac/carbon/app.cpp
src/mac/carbon/frame.cpp
src/mac/carbon/mdi.cpp
src/mac/carbon/window.cpp
src/mac/frame.cpp
src/mac/mdi.cpp
src/mac/window.cpp
src/msw/app.cpp

index df7ccd0b82d5056e4f0b23f21fa299989d43a68a..243ed2fefeee67a8c91122556e4e8fb198348b5a 100644 (file)
@@ -27,14 +27,15 @@ class WXDLLEXPORT wxMacPrinter: public wxPrinterBase
   DECLARE_DYNAMIC_CLASS(wxMacPrinter)
 
  public:
-  wxMacPrinter(wxPrintData *data = NULL);
-  ~wxMacPrinter(void);
+    wxMacPrinter(wxPrintDialogData *data = NULL);
+    virtual ~wxMacPrinter();
 
-  virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = TRUE);
-  virtual bool PrintDialog(wxWindow *parent);
+    virtual bool Print(wxWindow *parent,
+                       wxPrintout *printout,
+                       bool prompt = TRUE);
+    virtual wxDC* PrintDialog(wxWindow *parent);
   virtual bool Setup(wxWindow *parent);
 
- private:
 };
 
 /*
@@ -47,11 +48,16 @@ class WXDLLEXPORT wxMacPrintPreview: public wxPrintPreviewBase
   DECLARE_CLASS(wxMacPrintPreview)
 
  public:
-  wxMacPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting = NULL, wxPrintData *data = NULL);
-  ~wxMacPrintPreview(void);
+    wxMacPrintPreview(wxPrintout *printout,
+                          wxPrintout *printoutForPrinting = NULL,
+                          wxPrintDialogData *data = NULL);
+    wxMacPrintPreview(wxPrintout *printout,
+                          wxPrintout *printoutForPrinting,
+                          wxPrintData *data);
+    virtual ~wxMacPrintPreview();
 
   virtual bool Print(bool interactive);
-  virtual void DetermineScaling(void);
+    virtual void DetermineScaling();
 };
 
 #endif
index 63bbee89ead8109b379af773f81db424b2a71db3..4dea9653ef0504708afd78563549ef0c4405faca 100644 (file)
@@ -102,7 +102,7 @@ typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
 #elif defined(__WXQT__)
   #include  "wx/qt/notebook.h"
 #elif defined(__WXMAC__)
-  #include  "wx/mac/notebook.h"
+  #include  "wx/generic/notebook.h"
 #elif defined(__WXPM__)
   #include  "wx/os2/notebook.h"
 #elif defined(__WXSTUBS__)
index ed4cdaf1f30ae03a64ae35cad95942cfa24303ca..1bd9461b3dc4afbb068f73a3a3743f14e79e119d 100644 (file)
@@ -50,7 +50,7 @@ extern wxList wxPendingDelete;
 extern wxList *wxWinMacWindowList;
 extern wxList *wxWinMacControlList;
 
-extern wxApp *wxTheApp ;
+wxApp *wxTheApp = NULL;
 
 #if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
index ed4cdaf1f30ae03a64ae35cad95942cfa24303ca..1bd9461b3dc4afbb068f73a3a3743f14e79e119d 100644 (file)
@@ -50,7 +50,7 @@ extern wxList wxPendingDelete;
 extern wxList *wxWinMacWindowList;
 extern wxList *wxWinMacControlList;
 
-extern wxApp *wxTheApp ;
+wxApp *wxTheApp = NULL;
 
 #if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
index 6e980623227a8a9dff1ef80b47f26d6a7e8805c6..ba1377151f40e3185e51fe84282bbaf4ad580c0d 100644 (file)
@@ -341,6 +341,56 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
 
 // Default resizing behaviour - if only ONE subwindow,
 // resize to client rectangle size
+void wxFrame::OnIdle(wxIdleEvent& WXUNUSED(event) )
+{
+    DoMenuUpdates();
+}
+
+
+// update all menus
+void wxFrame::DoMenuUpdates()
+{
+    wxMenuBar* bar = GetMenuBar();
+
+    if ( bar != NULL )
+    {
+        int nCount = bar->GetMenuCount();
+        for (int n = 0; n < nCount; n++)
+            DoMenuUpdates(bar->GetMenu(n), (wxWindow*) NULL);
+    }
+}
+
+// update a menu and all submenus recursively
+void wxFrame::DoMenuUpdates(wxMenu* menu, wxWindow* WXUNUSED(focusWin))
+{
+    wxEvtHandler* evtHandler = GetEventHandler();
+    wxMenuItemList::Node* node = menu->GetMenuItems().GetFirst();
+    while (node)
+    {
+        wxMenuItem* item = node->GetData();
+        if ( !item->IsSeparator() )
+        {
+            wxWindowID id = item->GetId();
+            wxUpdateUIEvent event(id);
+            event.SetEventObject( this );
+
+            if (evtHandler->ProcessEvent(event))
+            {
+                if (event.GetSetText())
+                    menu->SetLabel(id, event.GetText());
+                if (event.GetSetChecked())
+                    menu->Check(id, event.GetChecked());
+                if (event.GetSetEnabled())
+                    menu->Enable(id, event.GetEnabled());
+            }
+
+            if (item->GetSubMenu())
+                DoMenuUpdates(item->GetSubMenu(), (wxWindow*) NULL);
+        }
+        node = node->GetNext();
+    }
+}
+
 void wxFrame::OnSize(wxSizeEvent& event)
 {
   // if we're using constraints - do use them
index 57862a20ffd9f937fdc7ec29c21921cc079add33..598f62c3f5470f3921db8c9066b6b183a2ee93d4 100644 (file)
@@ -241,6 +241,5 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
 // Explicitly call default scroll behaviour
 void wxMDIClientWindow::OnScroll(wxScrollEvent& event)
 {
-    Default(); // Default processing
 }
 
index a9aec9174fab614bf0dc654801523bec21634285..43e490d70bfd0aa34bb0bb4976da6037cc5d9da0 100644 (file)
@@ -838,7 +838,6 @@ void wxWindow::WarpPointer (int x_pos, int y_pos)
 void wxWindow::OnEraseBackground(wxEraseEvent& event)
 {
     // TODO : probably we would adopt the EraseEvent structure
-    Default();
 }
 
 int wxWindow::GetScrollPos(int orient) const
index 6e980623227a8a9dff1ef80b47f26d6a7e8805c6..ba1377151f40e3185e51fe84282bbaf4ad580c0d 100644 (file)
@@ -341,6 +341,56 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
 
 // Default resizing behaviour - if only ONE subwindow,
 // resize to client rectangle size
+void wxFrame::OnIdle(wxIdleEvent& WXUNUSED(event) )
+{
+    DoMenuUpdates();
+}
+
+
+// update all menus
+void wxFrame::DoMenuUpdates()
+{
+    wxMenuBar* bar = GetMenuBar();
+
+    if ( bar != NULL )
+    {
+        int nCount = bar->GetMenuCount();
+        for (int n = 0; n < nCount; n++)
+            DoMenuUpdates(bar->GetMenu(n), (wxWindow*) NULL);
+    }
+}
+
+// update a menu and all submenus recursively
+void wxFrame::DoMenuUpdates(wxMenu* menu, wxWindow* WXUNUSED(focusWin))
+{
+    wxEvtHandler* evtHandler = GetEventHandler();
+    wxMenuItemList::Node* node = menu->GetMenuItems().GetFirst();
+    while (node)
+    {
+        wxMenuItem* item = node->GetData();
+        if ( !item->IsSeparator() )
+        {
+            wxWindowID id = item->GetId();
+            wxUpdateUIEvent event(id);
+            event.SetEventObject( this );
+
+            if (evtHandler->ProcessEvent(event))
+            {
+                if (event.GetSetText())
+                    menu->SetLabel(id, event.GetText());
+                if (event.GetSetChecked())
+                    menu->Check(id, event.GetChecked());
+                if (event.GetSetEnabled())
+                    menu->Enable(id, event.GetEnabled());
+            }
+
+            if (item->GetSubMenu())
+                DoMenuUpdates(item->GetSubMenu(), (wxWindow*) NULL);
+        }
+        node = node->GetNext();
+    }
+}
+
 void wxFrame::OnSize(wxSizeEvent& event)
 {
   // if we're using constraints - do use them
index 57862a20ffd9f937fdc7ec29c21921cc079add33..598f62c3f5470f3921db8c9066b6b183a2ee93d4 100644 (file)
@@ -241,6 +241,5 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
 // Explicitly call default scroll behaviour
 void wxMDIClientWindow::OnScroll(wxScrollEvent& event)
 {
-    Default(); // Default processing
 }
 
index a9aec9174fab614bf0dc654801523bec21634285..43e490d70bfd0aa34bb0bb4976da6037cc5d9da0 100644 (file)
@@ -838,7 +838,6 @@ void wxWindow::WarpPointer (int x_pos, int y_pos)
 void wxWindow::OnEraseBackground(wxEraseEvent& event)
 {
     // TODO : probably we would adopt the EraseEvent structure
-    Default();
 }
 
 int wxWindow::GetScrollPos(int orient) const
index 0b947a540974716b12f63b748328cf06709b090f..b3da445a290bbcf28770db37dd1da7d378503e3f 100644 (file)
@@ -593,7 +593,17 @@ int wxEntry(WXHINSTANCE hInstance,
     // (another useful flag is _CRTDBG_DELAY_FREE_MEM_DF which doesn't free
     //  deallocated memory which may be used to simulate low-memory condition)
     wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
-
+#ifdef __MWERKS__
+#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
+    // This seems to be necessary since there are 'rogue'
+    // objects present at this point (perhaps global objects?)
+    // Setting a checkpoint will ignore them as far as the
+    // memory checking facility is concerned.
+    // Of course you may argue that memory allocated in globals should be
+    // checked, but this is a reasonable compromise.
+    wxDebugContext::SetCheckpoint();
+#endif
+#endif
     // take everything into a try-except block in release build
     // FIXME other compilers must support Win32 SEH (structured exception
     //       handling) too, just find the appropriate keyword in their docs!