+void wxPreviewControlBar::OnFirst(void)
+{
+ wxPrintPreviewBase *preview = GetPrintPreview();
+ if (preview)
+ {
+ int currentPage = preview->GetMinPage();
+ if (preview->GetPrintout()->HasPage(currentPage))
+ {
+ preview->SetCurrentPage(currentPage);
+ }
+ }
+}
+
+void wxPreviewControlBar::OnLast(void)
+{
+ wxPrintPreviewBase *preview = GetPrintPreview();
+ if (preview)
+ {
+ int currentPage = preview->GetMaxPage();
+ if (preview->GetPrintout()->HasPage(currentPage))
+ {
+ preview->SetCurrentPage(currentPage);
+ }
+ }
+}
+
+void wxPreviewControlBar::OnGoto(void)
+{
+ wxPrintPreviewBase *preview = GetPrintPreview();
+ if (preview)
+ {
+ long currentPage;
+
+ if (preview->GetMinPage() > 0)
+ {
+ wxString strPrompt;
+ wxString strPage;
+
+ strPrompt.Printf( wxT("%d...%d"),
+ preview->GetMinPage(), preview->GetMaxPage());
+ strPage.Printf( wxT("%d"), preview->GetCurrentPage() );
+
+ strPage =
+ wxGetTextFromUser( strPrompt, _("Goto Page"), strPage);
+
+ if ( strPage.ToLong( ¤tPage ) )
+ if (preview->GetPrintout()->HasPage(currentPage))
+ {
+ preview->SetCurrentPage(currentPage);
+ }
+ }
+ }
+}
+