Crude hack to enable PageUp/DownKeys when controlbar is enabled.
Needs improvement, but better than no keyboard support at all. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2853 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -189,7 +189,6 @@ public:
|
|||||||
virtual void Initialize();
|
virtual void Initialize();
|
||||||
virtual void CreateCanvas();
|
virtual void CreateCanvas();
|
||||||
virtual void CreateControlBar();
|
virtual void CreateControlBar();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxWindow* m_previewCanvas;
|
wxWindow* m_previewCanvas;
|
||||||
wxPreviewControlBar* m_controlBar;
|
wxPreviewControlBar* m_controlBar;
|
||||||
@@ -242,8 +241,11 @@ public:
|
|||||||
|
|
||||||
void OnPrint(wxCommandEvent& event);
|
void OnPrint(wxCommandEvent& event);
|
||||||
void OnWindowClose(wxCommandEvent& event);
|
void OnWindowClose(wxCommandEvent& event);
|
||||||
void OnNext(wxCommandEvent& event);
|
void OnNext();
|
||||||
void OnPrevious(wxCommandEvent& event);
|
void OnPrevious();
|
||||||
|
void OnNextButton(wxCommandEvent &event) { OnNext(); }
|
||||||
|
void OnPreviousButton(wxCommandEvent &event) { OnPrevious(); }
|
||||||
|
void OnChar(wxKeyEvent &event);
|
||||||
void OnZoom(wxCommandEvent& event);
|
void OnZoom(wxCommandEvent& event);
|
||||||
void OnPaint(wxPaintEvent& event);
|
void OnPaint(wxPaintEvent& event);
|
||||||
|
|
||||||
|
@@ -220,8 +220,9 @@ void wxPreviewCanvas::OnSysColourChanged(wxSysColourChangedEvent& event)
|
|||||||
BEGIN_EVENT_TABLE(wxPreviewControlBar, wxPanel)
|
BEGIN_EVENT_TABLE(wxPreviewControlBar, wxPanel)
|
||||||
EVT_BUTTON(wxID_PREVIEW_CLOSE, wxPreviewControlBar::OnWindowClose)
|
EVT_BUTTON(wxID_PREVIEW_CLOSE, wxPreviewControlBar::OnWindowClose)
|
||||||
EVT_BUTTON(wxID_PREVIEW_PRINT, wxPreviewControlBar::OnPrint)
|
EVT_BUTTON(wxID_PREVIEW_PRINT, wxPreviewControlBar::OnPrint)
|
||||||
EVT_BUTTON(wxID_PREVIEW_PREVIOUS, wxPreviewControlBar::OnPrevious)
|
EVT_BUTTON(wxID_PREVIEW_PREVIOUS, wxPreviewControlBar::OnPreviousButton)
|
||||||
EVT_BUTTON(wxID_PREVIEW_NEXT, wxPreviewControlBar::OnNext)
|
EVT_BUTTON(wxID_PREVIEW_NEXT, wxPreviewControlBar::OnNextButton)
|
||||||
|
EVT_CHAR(wxPreviewControlBar::OnChar)
|
||||||
EVT_CHOICE(wxID_PREVIEW_ZOOM, wxPreviewControlBar::OnZoom)
|
EVT_CHOICE(wxID_PREVIEW_ZOOM, wxPreviewControlBar::OnZoom)
|
||||||
EVT_PAINT(wxPreviewControlBar::OnPaint)
|
EVT_PAINT(wxPreviewControlBar::OnPaint)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
@@ -267,7 +268,20 @@ void wxPreviewControlBar::OnPrint(wxCommandEvent& WXUNUSED(event))
|
|||||||
preview->Print(TRUE);
|
preview->Print(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPreviewControlBar::OnNext(wxCommandEvent& WXUNUSED(event))
|
void wxPreviewControlBar::OnChar(wxKeyEvent &event)
|
||||||
|
{
|
||||||
|
switch(event.KeyCode())
|
||||||
|
{
|
||||||
|
case WXK_NEXT:
|
||||||
|
OnNext(); break;
|
||||||
|
case WXK_PRIOR:
|
||||||
|
OnPrevious(); break;
|
||||||
|
default:
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPreviewControlBar::OnNext(void)
|
||||||
{
|
{
|
||||||
wxPrintPreviewBase *preview = GetPrintPreview();
|
wxPrintPreviewBase *preview = GetPrintPreview();
|
||||||
if (preview)
|
if (preview)
|
||||||
@@ -282,7 +296,7 @@ void wxPreviewControlBar::OnNext(wxCommandEvent& WXUNUSED(event))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPreviewControlBar::OnPrevious(wxCommandEvent& WXUNUSED(event))
|
void wxPreviewControlBar::OnPrevious(void)
|
||||||
{
|
{
|
||||||
wxPrintPreviewBase *preview = GetPrintPreview();
|
wxPrintPreviewBase *preview = GetPrintPreview();
|
||||||
if (preview)
|
if (preview)
|
||||||
@@ -410,7 +424,7 @@ int wxPreviewControlBar::GetZoomControl()
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxPreviewFrame, wxFrame)
|
BEGIN_EVENT_TABLE(wxPreviewFrame, wxFrame)
|
||||||
EVT_CLOSE(wxPreviewFrame::OnCloseWindow)
|
EVT_CLOSE(wxPreviewFrame::OnCloseWindow)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
wxPreviewFrame::wxPreviewFrame(wxPrintPreviewBase *preview, wxFrame *parent, const wxString& title,
|
wxPreviewFrame::wxPreviewFrame(wxPrintPreviewBase *preview, wxFrame *parent, const wxString& title,
|
||||||
|
Reference in New Issue
Block a user