patch by Utensil Candel: implementation of the new interface and some bug fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58201 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
48def411aa
commit
8da17c8609
@ -18,7 +18,8 @@
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#include "wx/filename.h"
|
||||
#include <ctime>
|
||||
#include <wx/notebook.h>
|
||||
|
||||
#include "autocapture.h"
|
||||
|
||||
@ -34,6 +35,14 @@
|
||||
/* static */
|
||||
wxString AutoCaptureMechanism::default_dir = _T("screenshots");
|
||||
|
||||
/* static */
|
||||
wxString AutoCaptureMechanism::GetDefaultDirectoryAbsPath()
|
||||
{
|
||||
wxFileName output = wxFileName::DirName(GetDefaultDirectory());
|
||||
output.MakeAbsolute();
|
||||
return output.GetFullPath();
|
||||
}
|
||||
|
||||
/* static */
|
||||
void AutoCaptureMechanism::Delay(int seconds)
|
||||
{
|
||||
@ -76,7 +85,7 @@ wxBitmap AutoCaptureMechanism::Capture(int x, int y, int width, int height, int
|
||||
|
||||
#else // Under other paltforms, take a real screenshot
|
||||
|
||||
wxUnusedVar(delay);
|
||||
if(delay) Delay(delay);
|
||||
|
||||
// Create a DC for the whole screen area
|
||||
wxScreenDC dcScreen;
|
||||
@ -155,24 +164,19 @@ void AutoCaptureMechanism::CaptureAll()
|
||||
continue;
|
||||
}
|
||||
|
||||
// // create the screenshot
|
||||
// wxBitmap screenshot = Capture(ctrl);
|
||||
// if (ctrl.flag & AJ_Union)
|
||||
// screenshot = Union(screenshot, Capture(*(++it)));
|
||||
//
|
||||
// // and save it
|
||||
// Save(screenshot, ctrl.name);
|
||||
// create the screenshot
|
||||
wxBitmap screenshot = Capture(ctrl);
|
||||
|
||||
if(ctrl.flag & AJ_Union)
|
||||
{
|
||||
// union screenshots until AJ_UnionEnd
|
||||
do
|
||||
{
|
||||
ctrl = *(++it);
|
||||
screenshot = Union(screenshot, Capture(ctrl));
|
||||
++it;
|
||||
it->name = ctrl.name; //preserving the name
|
||||
screenshot = Union(screenshot, Capture(*it));
|
||||
}
|
||||
while(!(ctrl.flag & AJ_UnionEnd));
|
||||
while(!(it->flag & AJ_UnionEnd));
|
||||
}
|
||||
|
||||
// and save it
|
||||
@ -182,7 +186,9 @@ void AutoCaptureMechanism::CaptureAll()
|
||||
|
||||
wxBitmap AutoCaptureMechanism::Capture(Control& ctrl)
|
||||
{
|
||||
if (ctrl.name == wxT("")) // no manual specification for the control name
|
||||
// no manual specification for the control name
|
||||
// or name adjustment is disabled globally
|
||||
if (ctrl.name == _T("") || m_flag & AJ_DisableNameAdjust)
|
||||
{
|
||||
// Get its name from wxRTTI
|
||||
ctrl.name = ctrl.ctrl->GetClassInfo()->GetClassName();
|
||||
@ -190,31 +196,29 @@ wxBitmap AutoCaptureMechanism::Capture(Control& ctrl)
|
||||
|
||||
int choice = wxNO;
|
||||
|
||||
// for drop-down controls we need the help of the user
|
||||
if (ctrl.flag & AJ_Dropdown)
|
||||
wxRect rect = GetRect(ctrl.ctrl, ctrl.flag);
|
||||
|
||||
if (ctrl.flag & AJ_Dropdown && !(m_flag & AJ_DisableDropdown))
|
||||
{
|
||||
// for drop-down controls we need the help of the user
|
||||
wxString caption = _("Drop-down screenshot...");
|
||||
wxString msg =
|
||||
wxString::Format(_("Do you wish to capture the drop-down list of '%s' ?\n\nIf you click YES you must drop-down the list of '%s' in 3 seconds after closing this message box.\nIf you click NO the screenshot for this control won't contain its drop-down list."),
|
||||
wxString::Format(_("Do you wish to capture the drop-down list of '%s' ?\n\n If YES, please drop down the list of '%s' in 5 seconds after closing this message box.\n If NO, the screenshot for this control won't contain its drop-down list."),
|
||||
ctrl.name, ctrl.name);
|
||||
|
||||
choice = wxMessageBox(msg, caption, wxYES_NO, m_notebook);
|
||||
|
||||
#ifndef __WXMAC__ //not __WXMAC__
|
||||
if (choice == wxYES) Delay(3);
|
||||
#endif
|
||||
}
|
||||
if (choice == wxYES)
|
||||
{
|
||||
//A little hint
|
||||
ctrl.ctrl->SetCursor(wxCursor(wxCURSOR_HAND));
|
||||
|
||||
wxRect rect = GetRect(ctrl.ctrl, ctrl.flag);
|
||||
|
||||
// Do some rect adjust so it can include the dropdown list;
|
||||
// currently this only works well under MSW; not adjusted for Linux and Mac OS
|
||||
if (ctrl.flag & AJ_Dropdown && choice == wxYES)
|
||||
{
|
||||
// #ifdef __WXMSW__
|
||||
int h = rect.GetHeight();
|
||||
rect.SetHeight(h * 4);
|
||||
// #endif
|
||||
// Do some rect adjust so it can include the dropdown list
|
||||
// This adjust isn't pretty, but it works fine on all three paltforms.
|
||||
// Looking forward to a better solution
|
||||
int h = rect.GetHeight();
|
||||
rect.SetHeight(h * 4);
|
||||
}
|
||||
}
|
||||
|
||||
// cut off "wx" and change the name into lowercase.
|
||||
@ -223,7 +227,9 @@ wxBitmap AutoCaptureMechanism::Capture(Control& ctrl)
|
||||
ctrl.name.MakeLower();
|
||||
|
||||
// take the screenshot
|
||||
wxBitmap screenshot = Capture(rect);
|
||||
wxBitmap screenshot = Capture(rect, (choice == wxYES)?5:0);
|
||||
|
||||
if (choice == wxYES) ctrl.ctrl->SetCursor(wxNullCursor);
|
||||
|
||||
if (ctrl.flag & AJ_RegionAdjust)
|
||||
PutBack(ctrl.ctrl);
|
||||
@ -246,24 +252,6 @@ wxBitmap AutoCaptureMechanism::Union(wxBitmap pic1, wxBitmap pic2)
|
||||
|
||||
wxBitmap result(w, h, -1);
|
||||
|
||||
#if 0
|
||||
//Mask the bitmap "result"
|
||||
wxMemoryDC maskDC;
|
||||
wxBitmap mask(w, h, 1);
|
||||
maskDC.SelectObject(mask);
|
||||
|
||||
maskDC.SetPen(*wxTRANSPARENT_PEN);
|
||||
maskDC.SetBrush(*wxBLACK_BRUSH);
|
||||
maskDC.DrawRectangle(0, 0, w + 1, h + 1);
|
||||
|
||||
maskDC.SetBrush(*wxWHITE_BRUSH);
|
||||
maskDC.DrawRectangle(0, 0, w1, h1);
|
||||
maskDC.DrawRectangle(0, h1 + gap_between, w2, h2);
|
||||
maskDC.SelectObject(wxNullBitmap);
|
||||
|
||||
result.SetMask(new wxMask(mask));
|
||||
#endif
|
||||
|
||||
wxMemoryDC dstDC;
|
||||
dstDC.SelectObject(result);
|
||||
|
||||
@ -280,57 +268,55 @@ wxBitmap AutoCaptureMechanism::Union(wxBitmap pic1, wxBitmap pic2)
|
||||
|
||||
wxRect AutoCaptureMechanism::GetRect(wxWindow* ctrl, int flag)
|
||||
{
|
||||
if (flag & AJ_RegionAdjust)
|
||||
if( !(m_flag & AJ_DisableRegionAdjust) && (flag & AJ_RegionAdjust)
|
||||
|| (m_flag & AJ_AlwaysRegionAdjust) )
|
||||
{
|
||||
wxWindow * parent = ctrl->GetParent();
|
||||
wxSizer * sizer = parent->GetSizer();
|
||||
|
||||
if (sizer)
|
||||
{
|
||||
sizer->Detach(ctrl);
|
||||
//The assertion won't fail if controls are still managed by wxSizer, and it's unlikely to
|
||||
//change in the future.
|
||||
wxASSERT_MSG(sizer,
|
||||
"The GUI that AutoCaptureMechanism working with doesn't manage controls with wxSizer");
|
||||
|
||||
/*
|
||||
+---------+-----------+---------+
|
||||
| 0 | label | 1 |
|
||||
+---------+-----------+---------+
|
||||
| label | ctrl | label |
|
||||
+---------+-----------+---------+
|
||||
| 2 | label | 3 |
|
||||
+---------+-----------+---------+
|
||||
*/
|
||||
sizer->Detach(ctrl);
|
||||
|
||||
m_grid = new wxFlexGridSizer(3, 3, m_margin, m_margin);
|
||||
/*
|
||||
+---------+-----------+---------+
|
||||
| 0 | label | 1 |
|
||||
+---------+-----------+---------+
|
||||
| label | ctrl | label |
|
||||
+---------+-----------+---------+
|
||||
| 2 | label | 3 |
|
||||
+---------+-----------+---------+
|
||||
*/
|
||||
|
||||
wxStaticText* l[4];
|
||||
m_grid = new wxFlexGridSizer(3, 3, m_margin, m_margin);
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
l[i] = new wxStaticText(parent, wxID_ANY, wxT(" "));
|
||||
wxStaticText* l[4];
|
||||
|
||||
m_grid->Add(l[0]);
|
||||
m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
|
||||
m_grid->Add(l[1]);
|
||||
m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
|
||||
m_grid->Add(ctrl);
|
||||
m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
|
||||
m_grid->Add(l[2]);
|
||||
m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
|
||||
m_grid->Add(l[3]);
|
||||
for (int i = 0; i < 4; ++i)
|
||||
l[i] = new wxStaticText(parent, wxID_ANY, _T(" "));
|
||||
|
||||
sizer->Add(m_grid);
|
||||
parent->SetSizer(sizer);
|
||||
parent->Layout();
|
||||
m_grid->Add(l[0]);
|
||||
m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" ")));
|
||||
m_grid->Add(l[1]);
|
||||
m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" ")));
|
||||
m_grid->Add(ctrl, 1, wxEXPAND);
|
||||
m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" ")));
|
||||
m_grid->Add(l[2]);
|
||||
m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" ")));
|
||||
m_grid->Add(l[3]);
|
||||
|
||||
parent->Refresh();
|
||||
wxYield();
|
||||
sizer->Add(m_grid);
|
||||
parent->SetSizer(sizer);
|
||||
parent->Layout();
|
||||
|
||||
return wxRect(l[0]->GetScreenRect().GetBottomRight(),
|
||||
l[3]->GetScreenRect().GetTopLeft());
|
||||
parent->Refresh();
|
||||
wxYield();
|
||||
|
||||
}
|
||||
else // Actually it won't get here working with the current guiframe.h/guiframe.cpp
|
||||
{
|
||||
return ctrl->GetScreenRect().Inflate(m_margin);
|
||||
}
|
||||
return wxRect(l[0]->GetScreenRect().GetBottomRight(),
|
||||
l[3]->GetScreenRect().GetTopLeft());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -340,6 +326,8 @@ wxRect AutoCaptureMechanism::GetRect(wxWindow* ctrl, int flag)
|
||||
|
||||
void AutoCaptureMechanism::PutBack(wxWindow * ctrl)
|
||||
{
|
||||
if(!m_grid) return;
|
||||
|
||||
m_grid->Detach(ctrl);
|
||||
|
||||
wxSizerItemList children = m_grid->GetChildren();
|
||||
@ -351,8 +339,16 @@ void AutoCaptureMechanism::PutBack(wxWindow * ctrl)
|
||||
}
|
||||
|
||||
wxSizer * sizer = ctrl->GetParent()->GetSizer();
|
||||
|
||||
//The assertion won't fail if controls are still managed by wxSizer, and it's unlikely to
|
||||
//change in the future.
|
||||
wxASSERT_MSG(sizer,
|
||||
"The GUI that AutoCaptureMechanism working with doesn't manage controls with wxSizer");
|
||||
|
||||
sizer->Detach(m_grid);
|
||||
delete m_grid;
|
||||
m_grid = NULL;
|
||||
|
||||
sizer->Add(ctrl);
|
||||
}
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
#define _AUTOCAPTURE_H_
|
||||
|
||||
#include <vector>
|
||||
#include <ctime>
|
||||
#include "wx/filename.h"
|
||||
|
||||
#include <wx/notebook.h>
|
||||
class wxNotebook;
|
||||
|
||||
/**
|
||||
GlobalAdjustFlags works with AutoCaptureMechanism's constructor, to disbale/enable
|
||||
@ -38,6 +38,9 @@ enum GlobalAdjustFlags
|
||||
|
||||
/**
|
||||
Enable region adjustment for all controls.
|
||||
|
||||
If AJ_DisableRegionAdjust and AJ_AlwaysRegionAdjust are both specified, current
|
||||
implemetation will ignore AJ_DisableRegionAdjust.
|
||||
*/
|
||||
AJ_AlwaysRegionAdjust = 1 << 1,
|
||||
|
||||
@ -97,15 +100,14 @@ enum AdjustFlags
|
||||
AJ_TurnPage = 1 << 2,
|
||||
|
||||
/**
|
||||
This flag provides a functionality to union screenshots of different controls into
|
||||
one image.
|
||||
|
||||
It's especially useful to demonstrate different modes/states of a control,
|
||||
e.g. the single-line/multi-line modes of a wxTextCtrl.
|
||||
This flag provides a functionality to union screenshots of different modes/states of
|
||||
a control into one image. e.g. the single-line/multi-line modes of a wxTextCtrl.
|
||||
|
||||
For a series of controls to be unioned, you should specify AJ_Union for the first,
|
||||
and AJ_UnionEnd for the last. For the controls between them, you can either specify
|
||||
AJ_Union or not.
|
||||
|
||||
The filename of the generated screenshot is the name of the first control in the series.
|
||||
*/
|
||||
AJ_Union = 1 << 3,
|
||||
|
||||
@ -309,12 +311,7 @@ public:
|
||||
/**
|
||||
Get the absolute path of the default directory where the screenshots will be generated.
|
||||
*/
|
||||
static wxString GetDefaultDirectoryAbsPath()
|
||||
{
|
||||
wxFileName output = wxFileName::DirName(GetDefaultDirectory());
|
||||
output.MakeAbsolute();
|
||||
return output.GetFullPath();
|
||||
}
|
||||
static wxString GetDefaultDirectoryAbsPath();
|
||||
|
||||
private:
|
||||
|
||||
@ -389,6 +386,9 @@ private:
|
||||
*/
|
||||
static wxBitmap Union(wxBitmap pic1, wxBitmap pic2);
|
||||
|
||||
/*
|
||||
Delay a few seconds without blocking GUI.
|
||||
*/
|
||||
static void Delay(int seconds);
|
||||
|
||||
/*
|
||||
|
@ -66,13 +66,13 @@ void GUIFrame::AddMenuBar()
|
||||
fileMenu = new wxMenu();
|
||||
|
||||
wxMenuItem* m_menuSeeScr;
|
||||
m_menuSeeScr = new wxMenuItem( fileMenu, wxID_ZOOM_IN, wxString( _("&Open screenshots folder...") ) + wxT('\t') + wxT("Ctrl+O"), _("Opens the directory where the screenshots are saved."), wxITEM_NORMAL );
|
||||
m_menuSeeScr = new wxMenuItem( fileMenu, wxID_ZOOM_IN, wxString( _("&Open screenshots folder...") ) + _T('\t') + _T("Ctrl+O"), _("Opens the directory where the screenshots are saved."), wxITEM_NORMAL );
|
||||
fileMenu->Append( m_menuSeeScr );
|
||||
|
||||
fileMenu->AppendSeparator();
|
||||
|
||||
wxMenuItem* m_menuFileQuit;
|
||||
m_menuFileQuit = new wxMenuItem( fileMenu, wxID_EXIT, wxString( _("&Quit") ) + wxT('\t') + wxT("Alt+F4"), _("Quits the application."), wxITEM_NORMAL );
|
||||
m_menuFileQuit = new wxMenuItem( fileMenu, wxID_EXIT, wxString( _("&Quit") ) + _T('\t') + _T("Alt+F4"), _("Quits the application."), wxITEM_NORMAL );
|
||||
fileMenu->Append( m_menuFileQuit );
|
||||
|
||||
mbar->Append( fileMenu, _("&File") );
|
||||
@ -81,11 +81,11 @@ void GUIFrame::AddMenuBar()
|
||||
captureMenu = new wxMenu();
|
||||
|
||||
wxMenuItem* m_menuCapFullScreen;
|
||||
m_menuCapFullScreen = new wxMenuItem( captureMenu, idMenuCapFullScreen, wxString( _("&Full Screen") ) + wxT('\t') + wxT("Ctrl+Alt+F"), _("Takes a screenshot of the entire screen."), wxITEM_NORMAL );
|
||||
m_menuCapFullScreen = new wxMenuItem( captureMenu, idMenuCapFullScreen, wxString( _("&Full Screen") ) + _T('\t') + _T("Ctrl+Alt+F"), _("Takes a screenshot of the entire screen."), wxITEM_NORMAL );
|
||||
captureMenu->Append( m_menuCapFullScreen );
|
||||
|
||||
wxMenuItem* m_menuCapAll;
|
||||
m_menuCapAll = new wxMenuItem( captureMenu, idMenuCapAll, wxString( _("Capture All") ) + wxT('\t') + wxT("Ctrl+Alt+A"), _("Takes screenshots for all controls automatically."), wxITEM_NORMAL );
|
||||
m_menuCapAll = new wxMenuItem( captureMenu, idMenuCapAll, wxString( _("Capture All") ) + _T('\t') + _T("Ctrl+Alt+A"), _("Takes screenshots for all controls automatically."), wxITEM_NORMAL );
|
||||
captureMenu->Append( m_menuCapAll );
|
||||
|
||||
mbar->Append( captureMenu, _("&Capture") );
|
||||
@ -93,7 +93,7 @@ void GUIFrame::AddMenuBar()
|
||||
//Help Menu
|
||||
helpMenu = new wxMenu();
|
||||
wxMenuItem* m_menuHelpAbout;
|
||||
m_menuHelpAbout = new wxMenuItem( helpMenu, wxID_ABOUT, wxString( _("&About...") ) + wxT('\t') + wxT("F1"), _("Shows info about this application."), wxITEM_NORMAL );
|
||||
m_menuHelpAbout = new wxMenuItem( helpMenu, wxID_ABOUT, wxString( _("&About...") ) + _T('\t') + _T("F1"), _("Shows info about this application."), wxITEM_NORMAL );
|
||||
helpMenu->Append( m_menuHelpAbout );
|
||||
|
||||
mbar->Append( helpMenu, _("&Help") );
|
||||
@ -147,16 +147,16 @@ void GUIFrame::AddPanel_1()
|
||||
m_radioBtn2->SetToolTip( _("wxRadioButton") );
|
||||
fgSizer1->Add( m_radioBtn2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
|
||||
|
||||
m_bpButton1 = new wxBitmapButton( m_panel1, wxID_ANY, wxBitmap( wxT("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
|
||||
m_bpButton1 = new wxBitmapButton( m_panel1, wxID_ANY, wxBitmap( _T("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
|
||||
m_bpButton1->SetToolTip( _("wxBitmapButton") );
|
||||
m_bpButton1->SetToolTip( _("wxBitmapButton") );
|
||||
fgSizer1->Add( m_bpButton1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
|
||||
|
||||
m_bitmap1 = new wxStaticBitmap( m_panel1, wxID_ANY, wxBitmap( wxT("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_bitmap1 = new wxStaticBitmap( m_panel1, wxID_ANY, wxBitmap( _T("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_bitmap1->SetToolTip( _("wxStaticBitmap") );
|
||||
fgSizer1->Add( m_bitmap1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
|
||||
|
||||
m_gauge1 = new wxGauge( m_panel1, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL, wxDefaultValidator, wxT("_Gauge") );
|
||||
m_gauge1 = new wxGauge( m_panel1, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL, wxDefaultValidator, _T("_Gauge") );
|
||||
m_gauge1->SetValue( 50 );
|
||||
m_gauge1->SetToolTip( _("wxGauge") );
|
||||
fgSizer1->Add( m_gauge1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 20 );
|
||||
@ -174,11 +174,11 @@ void GUIFrame::AddPanel_1()
|
||||
m_toggleBtn2->SetToolTip( _("wxToggleButton") );
|
||||
fgSizer1->Add( m_toggleBtn2, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 20 );
|
||||
|
||||
m_hyperlink1 = new wxHyperlinkCtrl( m_panel1, wxID_ANY, _("www.wxwidgets.org"), wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
m_hyperlink1 = new wxHyperlinkCtrl( m_panel1, wxID_ANY, _("www.wxwidgets.org"), _T("http://www.wxwidgets.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
m_hyperlink1->SetToolTip( _("wxHyperlinkCtrl") );
|
||||
fgSizer1->Add( m_hyperlink1, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 20 );
|
||||
|
||||
m_spinCtrl1 = new wxSpinCtrl( m_panel1, wxID_ANY, wxT("5"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10, 0 );
|
||||
m_spinCtrl1 = new wxSpinCtrl( m_panel1, wxID_ANY, _T("5"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10, 0 );
|
||||
m_spinCtrl1->SetToolTip( _("wxSpinCtrl") );
|
||||
fgSizer1->Add( m_spinCtrl1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
|
||||
|
||||
@ -247,19 +247,19 @@ void GUIFrame::AddPanel_2()
|
||||
|
||||
m_animationCtrl1 = new wxAnimationCtrl(m_panel2, wxID_ANY);
|
||||
m_animationCtrl1->SetToolTip(_("wxAnimationCtrl"));
|
||||
if (m_animationCtrl1->LoadFile(wxT("bitmaps/throbber.gif")))
|
||||
if (m_animationCtrl1->LoadFile(_T("bitmaps/throbber.gif")))
|
||||
m_animationCtrl1->Play();
|
||||
fgSizer2->Add( m_animationCtrl1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
|
||||
|
||||
//wxCollapsiblePane 1
|
||||
m_collPane1 = new wxCollapsiblePane(m_panel2, -1, wxT("Collapsed"));
|
||||
m_collPane1 = new wxCollapsiblePane(m_panel2, -1, _T("Collapsed"));
|
||||
wxWindow *win = m_collPane1->GetPane();
|
||||
m_collPane1->SetToolTip(_("wxCollapsiblePane"));
|
||||
|
||||
wxBoxSizer * collbSizer = new wxBoxSizer(wxVERTICAL);
|
||||
wxStaticText* m_collSText = new wxStaticText(win, -1, wxT("You can place"));
|
||||
wxButton* m_collBut = new wxButton(win, -1, wxT("anything"));
|
||||
wxTextCtrl* m_collText = new wxTextCtrl(win, -1, wxT("inside a wxCollapsiblePane"));
|
||||
wxStaticText* m_collSText = new wxStaticText(win, -1, _T("You can place"));
|
||||
wxButton* m_collBut = new wxButton(win, -1, _T("anything"));
|
||||
wxTextCtrl* m_collText = new wxTextCtrl(win, -1, _T("inside a wxCollapsiblePane"));
|
||||
collbSizer->Add( m_collSText, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
|
||||
collbSizer->Add( m_collBut, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
|
||||
collbSizer->Add( m_collText, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
|
||||
@ -267,14 +267,14 @@ void GUIFrame::AddPanel_2()
|
||||
fgSizer2->Add( m_collPane1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
//wxCollapsiblePane 2
|
||||
m_collPane2 = new wxCollapsiblePane(m_panel2, -1, wxT("Expanded"));
|
||||
m_collPane2 = new wxCollapsiblePane(m_panel2, -1, _T("Expanded"));
|
||||
wxWindow *win2 = m_collPane2->GetPane();
|
||||
m_collPane2->SetToolTip(_("wxCollapsiblePane"));
|
||||
|
||||
wxBoxSizer * collbSizer2 = new wxBoxSizer(wxVERTICAL);
|
||||
wxStaticText* m_collSText2 = new wxStaticText(win2, -1, wxT("You can place"));
|
||||
wxButton* m_collBut2 = new wxButton(win2, -1, wxT("anything"));
|
||||
wxTextCtrl* m_collText2 = new wxTextCtrl(win2, -1, wxT("inside a wxCollapsiblePane"));
|
||||
wxStaticText* m_collSText2 = new wxStaticText(win2, -1, _T("You can place"));
|
||||
wxButton* m_collBut2 = new wxButton(win2, -1, _T("anything"));
|
||||
wxTextCtrl* m_collText2 = new wxTextCtrl(win2, -1, _T("inside a wxCollapsiblePane"));
|
||||
collbSizer2->Add( m_collSText2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
|
||||
collbSizer2->Add( m_collBut2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
|
||||
collbSizer2->Add( m_collText2, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
|
||||
@ -339,7 +339,7 @@ void GUIFrame::AddPanel_4()
|
||||
m_fontPicker1->SetToolTip( _("wxFontPickerCtrl") );
|
||||
fgSizer5->Add( m_fontPicker1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 20 );
|
||||
|
||||
m_filePicker1 = new wxFilePickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a file"), wxT("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE, wxDefaultValidator, wxT("_FilePickerCtrl") );
|
||||
m_filePicker1 = new wxFilePickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a file"), _T("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE, wxDefaultValidator, _T("_FilePickerCtrl") );
|
||||
#if defined(__WXMSW__)
|
||||
const wxString a_file = "C:\\Windows\\explorer.exe";
|
||||
#else
|
||||
@ -359,13 +359,13 @@ void GUIFrame::AddPanel_4()
|
||||
m_datePicker1->SetToolTip( _("wxDatePickerCtrl") );
|
||||
fgSizer5->Add( m_datePicker1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
|
||||
|
||||
m_genericDirCtrl1 = new wxGenericDirCtrl( m_panel4, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, wxEmptyString, 0, wxT("_GenericDirCtrl") );
|
||||
m_genericDirCtrl1 = new wxGenericDirCtrl( m_panel4, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, wxEmptyString, 0, _T("_GenericDirCtrl") );
|
||||
m_genericDirCtrl1->ShowHidden( false );
|
||||
m_genericDirCtrl1->SetToolTip( _("wxGenericDirCtrl") );
|
||||
m_genericDirCtrl1->SetMinSize( wxSize( -1,150 ) );
|
||||
fgSizer5->Add( m_genericDirCtrl1, 1, wxEXPAND|wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
|
||||
|
||||
m_dirPicker1 = new wxDirPickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE, wxDefaultValidator, wxT("_DirPickerCtrl") );
|
||||
m_dirPicker1 = new wxDirPickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE, wxDefaultValidator, _T("_DirPickerCtrl") );
|
||||
#if defined(__WXMSW__)
|
||||
const wxString a_dir = "C:\\Windows";
|
||||
#else
|
||||
@ -437,17 +437,17 @@ void GUIFrame::AddPanel_5()
|
||||
m_comboCtrl1->SetPopupControl(popupList);
|
||||
m_comboCtrl1->SetPopupMaxHeight(80);
|
||||
|
||||
m_comboCtrl1->SetText(wxT("wxComboCtrl"));
|
||||
m_comboCtrl1->SetText(_T("wxComboCtrl"));
|
||||
m_comboCtrl1->SetToolTip(_("wxComboCtrl"));
|
||||
|
||||
// Populate using wxListView methods
|
||||
popupList->InsertItem(popupList->GetItemCount(),wxT("wxComboCtrl"));
|
||||
popupList->InsertItem(popupList->GetItemCount(),wxT("with"));
|
||||
popupList->InsertItem(popupList->GetItemCount(),wxT("wxListView"));
|
||||
popupList->InsertItem(popupList->GetItemCount(),wxT("popup"));
|
||||
popupList->InsertItem(popupList->GetItemCount(),wxT("Item1"));
|
||||
popupList->InsertItem(popupList->GetItemCount(),wxT("Item2"));
|
||||
popupList->InsertItem(popupList->GetItemCount(),wxT("Item3"));
|
||||
popupList->InsertItem(popupList->GetItemCount(),_T("wxComboCtrl"));
|
||||
popupList->InsertItem(popupList->GetItemCount(),_T("with"));
|
||||
popupList->InsertItem(popupList->GetItemCount(),_T("wxListView"));
|
||||
popupList->InsertItem(popupList->GetItemCount(),_T("popup"));
|
||||
popupList->InsertItem(popupList->GetItemCount(),_T("Item1"));
|
||||
popupList->InsertItem(popupList->GetItemCount(),_T("Item2"));
|
||||
popupList->InsertItem(popupList->GetItemCount(),_T("Item3"));
|
||||
|
||||
popupList->Select(0, true);
|
||||
fgSizer4->Add( m_comboCtrl1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 20 );
|
||||
@ -459,7 +459,7 @@ void GUIFrame::AddPanel_5()
|
||||
m_comboCtrl2->SetPopupControl(popupTree);
|
||||
m_comboCtrl2->SetPopupMaxHeight(80);
|
||||
|
||||
m_comboCtrl2->SetText(wxT("wxComboCtrl"));
|
||||
m_comboCtrl2->SetText(_T("wxComboCtrl"));
|
||||
m_comboCtrl2->SetToolTip(_("wxComboCtrl"));
|
||||
|
||||
//Add a root and some nodes using wxTreeCtrl methods
|
||||
|
@ -106,7 +106,7 @@ void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event))
|
||||
case wxYES:
|
||||
{
|
||||
wxArrayString files;
|
||||
wxDir::GetAllFiles(dir, &files, wxT("*.png"), wxDIR_FILES);
|
||||
wxDir::GetAllFiles(dir, &files, _T("*.png"), wxDIR_FILES);
|
||||
|
||||
// remove all PNG files from the screenshots folder
|
||||
int n = files.GetCount();
|
||||
@ -134,11 +134,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, wxT("wxGauge"));
|
||||
auto_cap.RegisterControl(m_gauge1, _T("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, wxT("wxHyperlinkCtrl"));
|
||||
auto_cap.RegisterControl(m_hyperlink1, _T("wxHyperlinkCtrl"));
|
||||
auto_cap.RegisterControl(m_spinCtrl1, AJ_RegionAdjust);
|
||||
auto_cap.RegisterControl(m_spinBtn1);
|
||||
auto_cap.RegisterControl(m_scrollBar1);
|
||||
@ -150,10 +150,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, wxT("wxListCtrl"));
|
||||
auto_cap.RegisterControl(m_listCtrl1, _T("wxListCtrl"));
|
||||
|
||||
auto_cap.RegisterControl(m_animationCtrl1);
|
||||
auto_cap.RegisterControl(m_collPane1, wxT("wxCollapsiblePane"), AJ_Union);
|
||||
auto_cap.RegisterControl(m_collPane1, _T("wxCollapsiblePane"), AJ_Union);
|
||||
auto_cap.RegisterControl(m_collPane2, AJ_UnionEnd);
|
||||
|
||||
auto_cap.RegisterPageTurn();
|
||||
@ -164,13 +164,13 @@ void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
auto_cap.RegisterPageTurn();
|
||||
|
||||
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.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.RegisterPageTurn();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user