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:
};
/*
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
#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__)
extern wxList *wxWinMacWindowList;
extern wxList *wxWinMacControlList;
-extern wxApp *wxTheApp ;
+wxApp *wxTheApp = NULL;
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
extern wxList *wxWinMacWindowList;
extern wxList *wxWinMacControlList;
-extern wxApp *wxTheApp ;
+wxApp *wxTheApp = NULL;
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
// 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
// Explicitly call default scroll behaviour
void wxMDIClientWindow::OnScroll(wxScrollEvent& event)
{
- Default(); // Default processing
}
void wxWindow::OnEraseBackground(wxEraseEvent& event)
{
// TODO : probably we would adopt the EraseEvent structure
- Default();
}
int wxWindow::GetScrollPos(int orient) const
// 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
// Explicitly call default scroll behaviour
void wxMDIClientWindow::OnScroll(wxScrollEvent& event)
{
- Default(); // Default processing
}
void wxWindow::OnEraseBackground(wxEraseEvent& event)
{
// TODO : probably we would adopt the EraseEvent structure
- Default();
}
int wxWindow::GetScrollPos(int orient) const
// (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!