// Purpose: Implement wxCtrlMaskOut class
// Author: Utensil Candel (UtensilCandel@@gmail.com)
// RCS-ID: $Id$
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
}
/* static */
-wxString AutoCaptureMechanism::default_dir = _T("screenshots");
+wxString AutoCaptureMechanism::default_dir = wxT("screenshots");
/* static */
wxString AutoCaptureMechanism::GetDefaultDirectoryAbsPath()
// Wait for 3 seconds
clock_t start = clock();
- while (clock() - start < CLOCKS_PER_SEC * seconds)
+ while ( clock() - start < (clock_t)CLOCKS_PER_SEC * seconds)
wxYieldIfNeeded();
}
// Somehow wxScreenDC.Blit() doesn't work under Mac for now. Here is a trick.
#ifdef __WXMAC__
- // wxExecute(_T("screencapture -x ") + tempfile, wxEXEC_SYNC);
+ // wxExecute(wxT("screencapture -x ") + tempfile, wxEXEC_SYNC);
char captureCommand[80] =""; // a reasonable max size is 80
sprintf(captureCommand, "sleep %d;%s", delay, "screencapture -x /tmp/wx_screen_capture.png");
wxBitmap fullscreen;
do
{
- fullscreen = wxBitmap(_T("/tmp/wx_screen_capture.png"), wxBITMAP_TYPE_PNG);
+ fullscreen = wxBitmap(wxT("/tmp/wx_screen_capture.png"), wxBITMAP_TYPE_PNG);
}
while(!fullscreen.IsOk());
- bitmap = fullscreen.GetSubBitmap(wxRect(x,y,width,height));
+ *bitmap = fullscreen.GetSubBitmap(wxRect(x, y, width, height));
// to prevent loading the old screenshot next time
system("rm /tmp/wx_screen_capture.png");
if (!wxDirExists(default_dir))
wxMkdir(default_dir);
- wxFileName fullFileName(default_dir, fileName + ".png");
+ wxFileName fullFileName(default_dir, "appear-" + fileName +
+ "-" + wxPlatformInfo::Get().GetPortIdShortName() + ".png");
// do not overwrite already existing files with this name
while (fullFileName.FileExists())
}
// create the screenshot
- wxBitmap screenshot(0, 0);
+ wxBitmap screenshot(1, 1);
Capture(&screenshot, ctrl);
if(ctrl.flag & AJ_Union)
{
++it;
it->name = ctrl.name; //preserving the name
- wxBitmap screenshot2(0, 0);
+ wxBitmap screenshot2(1, 1);
Capture(&screenshot2, *it);
- wxBitmap combined(0, 0);
+ wxBitmap combined(1, 1);
Union(&screenshot, &screenshot2, &combined);
screenshot = combined;
}
{
// no manual specification for the control name
// or name adjustment is disabled globally
- if (ctrl.name == _T("") || m_flag & AJ_DisableNameAdjust)
+ if (ctrl.name == wxT("") || m_flag & AJ_DisableNameAdjust)
{
// Get its name from wxRTTI
ctrl.name = ctrl.ctrl->GetClassInfo()->GetClassName();
// cut off "wx" and change the name into lowercase.
// e.g. wxButton will have a name of "button" at the end
- ctrl.name.StartsWith(_T("wx"), &(ctrl.name));
+ ctrl.name.StartsWith(wxT("wx"), &(ctrl.name));
ctrl.name.MakeLower();
// take the screenshot
wxRect AutoCaptureMechanism::GetRect(wxWindow* ctrl, int flag)
{
- if( !(m_flag & AJ_DisableRegionAdjust) && (flag & AJ_RegionAdjust)
+ if( (!(m_flag & AJ_DisableRegionAdjust) && (flag & AJ_RegionAdjust))
|| (m_flag & AJ_AlwaysRegionAdjust) )
{
wxWindow * parent = ctrl->GetParent();
wxStaticText* l[4];
for (int i = 0; i < 4; ++i)
- l[i] = new wxStaticText(parent, wxID_ANY, _T(" "));
+ l[i] = new wxStaticText(parent, wxID_ANY, wxT(" "));
m_grid->Add(l[0]);
- m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" ")));
+ m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
m_grid->Add(l[1]);
- m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" ")));
+ m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
m_grid->Add(ctrl, 1, wxEXPAND);
- m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" ")));
+ m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
m_grid->Add(l[2]);
- m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" ")));
+ m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
m_grid->Add(l[3]);
sizer->Add(m_grid);