virtual void DrawSpline( int n, wxPoint points[] );
virtual bool CanDrawBitmap(void) const = 0;
- virtual void DrawIcon( const wxIcon &icon, long x, long y, bool useMask=FALSE );
+ virtual void DrawIcon( const wxIcon &icon, long x, long y )
+ { DrawIcon( icon, x, y, TRUE ); }
+ virtual void DrawIcon( const wxIcon &icon, long x, long y, bool useMask );
void DrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask=FALSE )
{ DrawIcon( *((wxIcon*)(&bmp)), x, y, useMask ); }
virtual bool Blit( long xdest, long ydest, long width, long height,
wxWindow *GetParent();
wxEvtHandler *GetEventHandler();
- void SetEventhandler( wxEvtHandler *handler );
+ void SetEventHandler( wxEvtHandler *handler );
+ void PushEventHandler( wxEvtHandler *handler );
+ wxEvtHandler *PopEventHandler( bool deleteHandler = FALSE );
virtual wxValidator *GetValidator();
virtual void SetValidator( wxValidator *validator );
virtual void DrawSpline( int n, wxPoint points[] );
virtual bool CanDrawBitmap(void) const = 0;
- virtual void DrawIcon( const wxIcon &icon, long x, long y, bool useMask=FALSE );
+ virtual void DrawIcon( const wxIcon &icon, long x, long y )
+ { DrawIcon( icon, x, y, TRUE ); }
+ virtual void DrawIcon( const wxIcon &icon, long x, long y, bool useMask );
void DrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask=FALSE )
{ DrawIcon( *((wxIcon*)(&bmp)), x, y, useMask ); }
virtual bool Blit( long xdest, long ydest, long width, long height,
wxWindow *GetParent();
wxEvtHandler *GetEventHandler();
- void SetEventhandler( wxEvtHandler *handler );
+ void SetEventHandler( wxEvtHandler *handler );
+ void PushEventHandler( wxEvtHandler *handler );
+ wxEvtHandler *PopEventHandler( bool deleteHandler = FALSE );
virtual wxValidator *GetValidator();
virtual void SetValidator( wxValidator *validator );
void DrawOpenSpline(wxList *points);
void DrawIcon(const wxIcon& icon, long x, long y);
+#ifdef __WXGTK__
+ void DrawIcon(const wxIcon& icon, long x, long y, bool WXUNUSED(usemask) )
+ { DrawIcon( icon, x, y ); }
+#endif
void DrawText(const wxString& text, long x, long y, bool use16 = FALSE);
void Clear(void);
#include "aiai.xbm"
#endif
+#ifdef __WXGTK__
+#include "folder.xpm"
+#endif
+
+
// Writes a header on a page. Margin units are in millimetres.
bool WritePageHeader(wxPrintout *printout, wxDC *dc, char *text, float mmToLogical);
dc.SetPen(wxBLACK_PEN);
dc.DrawLine(0, 0, 200, 200);
dc.DrawLine(200, 0, 0, 200);
+
+ wxIcon my_icon( folder_xpm );
+ dc.DrawIcon( my_icon, 100, 100, TRUE );
}
void MyFrame::OnSize(wxSizeEvent& event )
wxString choices[2];
choices[0] = _("All");
choices[1] = _("Pages");
-
+
+ fromText = (wxTextCtrl*)NULL;
+
rangeRadioBox = new wxRadioBox(this, wxPRINTID_RANGE, _("Print Range"),
wxPoint(5, yPos), wxSize(-1, -1), 2, choices, 2);
rangeRadioBox->SetSelection(1);
void wxGenericPrintDialog::OnRange(wxCommandEvent& event)
{
- if (event.GetInt() == 0)
+ if (!fromText) return;
+
+ if (event.GetInt() == 1)
{
fromText->Enable(FALSE);
toText->Enable(FALSE);
}
- else if (event.GetInt() == 1)
+ else if (event.GetInt() == 0)
{
fromText->Enable(TRUE);
toText->Enable(TRUE);
return m_eventHandler;
}
-void wxWindow::SetEventhandler( wxEvtHandler *handler )
+void wxWindow::SetEventHandler( wxEvtHandler *handler )
{
m_eventHandler = handler;
}
+void wxWindow::PushEventHandler(wxEvtHandler *handler)
+{
+ handler->SetNextHandler(GetEventHandler());
+ SetEventHandler(handler);
+}
+
+wxEvtHandler *wxWindow::PopEventHandler(bool deleteHandler)
+{
+ if ( GetEventHandler() )
+ {
+ wxEvtHandler *handlerA = GetEventHandler();
+ wxEvtHandler *handlerB = handlerA->GetNextHandler();
+ handlerA->SetNextHandler(NULL);
+ SetEventHandler(handlerB);
+ if ( deleteHandler )
+ {
+ delete handlerA;
+ return NULL;
+ }
+ else
+ return handlerA;
+ }
+ else
+ return NULL;
+}
+
wxValidator *wxWindow::GetValidator(void)
{
return m_windowValidator;
return m_eventHandler;
}
-void wxWindow::SetEventhandler( wxEvtHandler *handler )
+void wxWindow::SetEventHandler( wxEvtHandler *handler )
{
m_eventHandler = handler;
}
+void wxWindow::PushEventHandler(wxEvtHandler *handler)
+{
+ handler->SetNextHandler(GetEventHandler());
+ SetEventHandler(handler);
+}
+
+wxEvtHandler *wxWindow::PopEventHandler(bool deleteHandler)
+{
+ if ( GetEventHandler() )
+ {
+ wxEvtHandler *handlerA = GetEventHandler();
+ wxEvtHandler *handlerB = handlerA->GetNextHandler();
+ handlerA->SetNextHandler(NULL);
+ SetEventHandler(handlerB);
+ if ( deleteHandler )
+ {
+ delete handlerA;
+ return NULL;
+ }
+ else
+ return handlerA;
+ }
+ else
+ return NULL;
+}
+
wxValidator *wxWindow::GetValidator(void)
{
return m_windowValidator;