+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( _("Enter a page number between %d and %d:"),
+ preview->GetMinPage(), preview->GetMaxPage());
+ strPage.Printf( wxT("%d"), preview->GetCurrentPage() );
+
+ strPage =
+ wxGetTextFromUser( strPrompt, _("Goto Page"), strPage, GetParent());
+
+ if ( strPage.ToLong( ¤tPage ) )
+ if (preview->GetPrintout()->HasPage(currentPage))
+ {
+ preview->SetCurrentPage(currentPage);
+ }
+ }
+ }
+}
+