X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8da17c8609ea5f904b48cd60e92ab0725208cdcf..7a36d9c7c1a077ba7e05c248bcf19c4c9bb1356f:/utils/screenshotgen/src/screenshot_main.cpp diff --git a/utils/screenshotgen/src/screenshot_main.cpp b/utils/screenshotgen/src/screenshot_main.cpp index 365518ade8..9dd085e648 100644 --- a/utils/screenshotgen/src/screenshot_main.cpp +++ b/utils/screenshotgen/src/screenshot_main.cpp @@ -3,7 +3,7 @@ // Purpose: Implements the window containing all controls. // Author: Utensil Candel (UtensilCandel@@gmail.com) // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx/wx.h". @@ -68,7 +68,7 @@ void ScreenshotFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) info.SetName(_("Automatic Screenshot Generator")); info.SetVersion(_("1.0")); info.SetDescription(_("This utility automatically creates screenshots of wxWidgets controls for use in wxWidgets documentation.")); - info.SetCopyright(_T("(C) 2008 Utensil Candel")); + info.SetCopyright(wxT("(C) 2008 Utensil Candel")); wxAboutBox(info); } @@ -82,12 +82,13 @@ void ScreenshotFrame::OnCaptureFullScreen(wxCommandEvent& WXUNUSED(event)) wxCoord screenWidth, screenHeight; dcScreen.GetSize(&screenWidth, &screenHeight); - wxBitmap fullscreen = AutoCaptureMechanism::Capture(0, 0, screenWidth, screenHeight); + wxBitmap fullscreen(1, 1); + AutoCaptureMechanism::Capture(&fullscreen, 0, 0, screenWidth, screenHeight); - AutoCaptureMechanism::Save(fullscreen, _T("fullscreen")); + AutoCaptureMechanism::Save(&fullscreen, wxT("fullscreen")); wxMessageBox(_("A screenshot of the entire screen was saved as:\n\n ") - + AutoCaptureMechanism::GetDefaultDirectoryAbsPath() + _T("fullscreen.png"), + + AutoCaptureMechanism::GetDefaultDirectoryAbsPath() + wxT("fullscreen.png"), _("Full screen capture"), wxICON_INFORMATION|wxOK, this); } @@ -98,15 +99,17 @@ void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event)) // check if there are other screenshots taken before if (wxFileName::DirExists(dir)) { - int choice = wxMessageBox(_("It seems that you have already generated some screenshots.\n\nClick YES to delete them all (recommended) or NO to preserve them.\nClick CANCEL to cancel this auto-capture operation."), - _("Delete existing screenshots?"), - wxYES_NO|wxCANCEL|wxICON_QUESTION, this); + int choice = wxMessageBox( + _("It seems that you have already generated some screenshots.\n\nClick YES to delete them all (recommended) or NO to preserve them.\nClick CANCEL to cancel this auto-capture operation."), + _("Delete existing screenshots?"), + wxYES_NO | wxCANCEL | wxICON_QUESTION, this); + switch(choice) { case wxYES: { wxArrayString files; - wxDir::GetAllFiles(dir, &files, _T("*.png"), wxDIR_FILES); + wxDir::GetAllFiles(dir, &files, wxT("*.png"), wxDIR_FILES); // remove all PNG files from the screenshots folder int n = files.GetCount(); @@ -134,11 +137,11 @@ void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event)) auto_cap.RegisterControl(m_radioBtn2, AJ_UnionEnd); auto_cap.RegisterControl(m_bpButton1); auto_cap.RegisterControl(m_bitmap1); - auto_cap.RegisterControl(m_gauge1, _T("wxGauge")); + auto_cap.RegisterControl(m_gauge1, wxT("wxGauge")); auto_cap.RegisterControl(m_slider1); auto_cap.RegisterControl(m_toggleBtn1, AJ_Union); auto_cap.RegisterControl(m_toggleBtn2, AJ_UnionEnd); - auto_cap.RegisterControl(m_hyperlink1, _T("wxHyperlinkCtrl")); + auto_cap.RegisterControl(m_hyperlink1, wxT("wxHyperlinkCtrl")); auto_cap.RegisterControl(m_spinCtrl1, AJ_RegionAdjust); auto_cap.RegisterControl(m_spinBtn1); auto_cap.RegisterControl(m_scrollBar1); @@ -150,10 +153,10 @@ void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event)) auto_cap.RegisterControl(m_radioBox1); auto_cap.RegisterControl(m_staticBox1); auto_cap.RegisterControl(m_treeCtrl1); - auto_cap.RegisterControl(m_listCtrl1, _T("wxListCtrl")); + auto_cap.RegisterControl(m_listCtrl1, wxT("wxListCtrl")); auto_cap.RegisterControl(m_animationCtrl1); - auto_cap.RegisterControl(m_collPane1, _T("wxCollapsiblePane"), AJ_Union); + auto_cap.RegisterControl(m_collPane1, wxT("wxCollapsiblePane"), AJ_Union); auto_cap.RegisterControl(m_collPane2, AJ_UnionEnd); auto_cap.RegisterPageTurn(); @@ -164,13 +167,13 @@ void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event)) auto_cap.RegisterPageTurn(); - auto_cap.RegisterControl(m_colourPicker1, _T("wxColourPickerCtrl")); - auto_cap.RegisterControl(m_fontPicker1, _T("wxFontPickerCtrl")); - auto_cap.RegisterControl(m_filePicker1, _T("wxFilePickerCtrl"), AJ_RegionAdjust); - auto_cap.RegisterControl(m_calendar1, _T("wxCalendarCtrl"), AJ_RegionAdjust); - auto_cap.RegisterControl(m_datePicker1, _T("wxDatePickerCtrl")); - auto_cap.RegisterControl(m_genericDirCtrl1, _T("wxGenericDirCtrl")); - auto_cap.RegisterControl(m_dirPicker1, _T("wxDirPickerCtrl"), AJ_RegionAdjust); + auto_cap.RegisterControl(m_colourPicker1, wxT("wxColourPickerCtrl")); + auto_cap.RegisterControl(m_fontPicker1, wxT("wxFontPickerCtrl")); + auto_cap.RegisterControl(m_filePicker1, wxT("wxFilePickerCtrl"), AJ_RegionAdjust); + auto_cap.RegisterControl(m_calendar1, wxT("wxCalendarCtrl"), AJ_RegionAdjust); + auto_cap.RegisterControl(m_datePicker1, wxT("wxDatePickerCtrl")); + auto_cap.RegisterControl(m_genericDirCtrl1, wxT("wxGenericDirCtrl")); + auto_cap.RegisterControl(m_dirPicker1, wxT("wxDirPickerCtrl"), AJ_RegionAdjust); auto_cap.RegisterPageTurn();