many fixes; now the application correctly starts up
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56112 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
5e53c1c21e
commit
4bae10bdff
@ -219,7 +219,7 @@ uninstall_screenshotgen:
|
||||
|
||||
data:
|
||||
@mkdir -p .
|
||||
@for f in richtext.xml bitmaps/wxwin32x32.png bitmaps/bell.png bitmaps/info.png bitmaps/sound.png bitmaps/dropbuth.png bitmaps/dropbutn.png bitmaps/dropbutp.png bitmaps/throbber.gif; do \
|
||||
@for f in richtext.xml bitmaps/wxwin32x32.png bitmaps/bell.png bitmaps/sound.png bitmaps/dropbuth.png bitmaps/dropbutn.png bitmaps/dropbutp.png bitmaps/throbber.gif; do \
|
||||
if test ! -f ./$$f -a ! -d ./$$f ; \
|
||||
then x=yep ; \
|
||||
else x=`find $(srcdir)/$$f -newer ./$$f -print` ; \
|
||||
|
@ -84,6 +84,117 @@ wxBitmap Capture(wxRect rect)
|
||||
return Capture(origin.x, origin.y, rect.GetWidth(), rect.GetHeight());
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// AutoCaptureMechanism
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxBitmap AutoCaptureMechanism::Capture(Control & ctrl)
|
||||
{
|
||||
if(ctrl.name == wxT("")) //no mannual specification for the control name
|
||||
{
|
||||
//Get name from wxRTTI
|
||||
ctrl.name = ctrl.ctrl->GetClassInfo()->GetClassName();
|
||||
}
|
||||
|
||||
int choice = wxNO;
|
||||
|
||||
if(ctrl.flag & AJ_Dropdown)
|
||||
{
|
||||
wxString caption = _("Do you wish to capture the dropdown list of ") + ctrl.name + _("?");
|
||||
wxString notice = _("Click YES to capture it.\nAnd you MUST drop down the ") + ctrl.name + _(" in 3 seconds after close me.\n");
|
||||
notice += _("Click NO otherwise.");
|
||||
|
||||
choice = wxMessageBox(notice, caption, wxYES_NO, m_notebook);
|
||||
|
||||
if(choice == wxYES)
|
||||
{
|
||||
//Wait for 3 seconds
|
||||
using std::clock;
|
||||
using std::clock_t;
|
||||
|
||||
clock_t start = clock();
|
||||
while(clock() - start < CLOCKS_PER_SEC * 3)
|
||||
{
|
||||
wxYieldIfNeeded();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wxRect rect = GetRect(ctrl.ctrl, ctrl.flag);
|
||||
|
||||
//Do some rect adjust so it can include the dropdown list
|
||||
//Currently it 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
|
||||
}
|
||||
|
||||
//cut off "wx" and change them into lowercase.
|
||||
// e.g. wxButton will have a name of "button" at the end
|
||||
ctrl.name.StartsWith(_T("wx"), &(ctrl.name));
|
||||
ctrl.name.MakeLower();
|
||||
|
||||
wxBitmap screenshot = ::Capture(rect);
|
||||
|
||||
if(ctrl.flag & AJ_RegionAdjust)
|
||||
{
|
||||
PutBack(ctrl.ctrl);
|
||||
}
|
||||
|
||||
return screenshot;
|
||||
}
|
||||
|
||||
//if AJ_RegionAdjust is specified, the following line will use the label trick to adjust
|
||||
//the region position and size
|
||||
wxRect GetRect(wxWindow* ctrl, int flag);
|
||||
//put the control back after the label trick(Using reparent/resizer approach)
|
||||
void PutBack(wxWindow * ctrl);
|
||||
|
||||
wxBitmap AutoCaptureMechanism::Union(wxBitmap pic1, wxBitmap pic2)
|
||||
{
|
||||
int w1, w2, h1, h2, w, h;
|
||||
w1 = pic1.GetWidth();
|
||||
w2 = pic2.GetWidth();
|
||||
h1 = pic1.GetHeight();
|
||||
h2 = pic2.GetHeight();
|
||||
|
||||
const int gap_between = 20;
|
||||
|
||||
w = (w1 >= w2) ? w1 : w2;
|
||||
h = h1 + h2 + gap_between;
|
||||
|
||||
wxBitmap result(w, h, -1);
|
||||
|
||||
wxMemoryDC dstDC;
|
||||
dstDC.SelectObject(result);
|
||||
|
||||
dstDC.DrawBitmap(pic1, 0, 0, false);
|
||||
dstDC.DrawBitmap(pic2, 0, h1 + gap_between, false);
|
||||
|
||||
dstDC.SelectObject(wxNullBitmap);
|
||||
|
||||
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));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void AutoCaptureMechanism::Save(wxBitmap screenshot, wxString fileName)
|
||||
{
|
||||
//Check if m_defaultDir already existed
|
||||
|
@ -28,6 +28,11 @@ enum AdjustFlags
|
||||
AJ_UnionEnd = 1 << 4
|
||||
};
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// class AutoCaptureMechanism
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class AutoCaptureMechanism
|
||||
{
|
||||
public:
|
||||
@ -86,7 +91,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
protected: // internal utils
|
||||
struct Control
|
||||
{
|
||||
Control() {}
|
||||
@ -99,6 +104,20 @@ private:
|
||||
int flag;
|
||||
};
|
||||
|
||||
wxBitmap Capture(Control & ctrl);
|
||||
|
||||
//if AJ_RegionAdjust is specified, the following line will use the label trick to adjust
|
||||
//the region position and size
|
||||
wxRect GetRect(wxWindow* ctrl, int flag);
|
||||
|
||||
//put the control back after the label trick(Using reparent/resizer approach)
|
||||
void PutBack(wxWindow * ctrl);
|
||||
|
||||
wxBitmap Union(wxBitmap pic1, wxBitmap pic2);
|
||||
|
||||
void Save(wxBitmap screenshot, wxString fileName);
|
||||
|
||||
private:
|
||||
typedef std::vector<Control> ControlList;
|
||||
ControlList m_controlList;
|
||||
|
||||
@ -111,116 +130,6 @@ private:
|
||||
|
||||
wxString m_dir;
|
||||
int m_border;
|
||||
|
||||
|
||||
|
||||
wxBitmap Capture(Control & ctrl)
|
||||
{
|
||||
if(ctrl.name == wxT("")) //no mannual specification for the control name
|
||||
{
|
||||
//Get name from wxRTTI
|
||||
ctrl.name = ctrl.ctrl->GetClassInfo()->GetClassName();
|
||||
}
|
||||
|
||||
int choice = wxNO;
|
||||
|
||||
if(ctrl.flag & AJ_Dropdown)
|
||||
{
|
||||
wxString caption = _("Do you wish to capture the dropdown list of ") + ctrl.name + _("?");
|
||||
wxString notice = _("Click YES to capture it.\nAnd you MUST drop down the ") + ctrl.name + _(" in 3 seconds after close me.\n");
|
||||
notice += _("Click NO otherwise.");
|
||||
|
||||
choice = wxMessageBox(notice, caption, wxYES_NO, m_notebook);
|
||||
|
||||
if(choice == wxYES)
|
||||
{
|
||||
//Wait for 3 seconds
|
||||
using std::clock;
|
||||
using std::clock_t;
|
||||
|
||||
clock_t start = clock();
|
||||
while(clock() - start < CLOCKS_PER_SEC * 3)
|
||||
{
|
||||
wxYieldIfNeeded();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wxRect rect = GetRect(ctrl.ctrl, ctrl.flag);
|
||||
|
||||
//Do some rect adjust so it can include the dropdown list
|
||||
//Currently it 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
|
||||
}
|
||||
|
||||
//cut off "wx" and change them into lowercase.
|
||||
// e.g. wxButton will have a name of "button" at the end
|
||||
ctrl.name.StartsWith(_T("wx"), &(ctrl.name));
|
||||
ctrl.name.MakeLower();
|
||||
|
||||
wxBitmap screenshot = ::Capture(rect);
|
||||
|
||||
if(ctrl.flag & AJ_RegionAdjust)
|
||||
{
|
||||
PutBack(ctrl.ctrl);
|
||||
}
|
||||
|
||||
return screenshot;
|
||||
}
|
||||
|
||||
//if AJ_RegionAdjust is specified, the following line will use the label trick to adjust
|
||||
//the region position and size
|
||||
wxRect GetRect(wxWindow* ctrl, int flag);
|
||||
//put the control back after the label trick(Using reparent/resizer approach)
|
||||
void PutBack(wxWindow * ctrl);
|
||||
|
||||
wxBitmap Union(wxBitmap pic1, wxBitmap pic2)
|
||||
{
|
||||
int w1, w2, h1, h2, w, h;
|
||||
w1 = pic1.GetWidth();
|
||||
w2 = pic2.GetWidth();
|
||||
h1 = pic1.GetHeight();
|
||||
h2 = pic2.GetHeight();
|
||||
|
||||
const int gap_between = 20;
|
||||
|
||||
w = (w1 >= w2) ? w1 : w2;
|
||||
h = h1 + h2 + gap_between;
|
||||
|
||||
wxBitmap result(w, h, -1);
|
||||
|
||||
wxMemoryDC dstDC;
|
||||
dstDC.SelectObject(result);
|
||||
|
||||
dstDC.DrawBitmap(pic1, 0, 0, false);
|
||||
dstDC.DrawBitmap(pic2, 0, h1 + gap_between, false);
|
||||
|
||||
dstDC.SelectObject(wxNullBitmap);
|
||||
|
||||
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));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void Save(wxBitmap screenshot, wxString fileName);
|
||||
};
|
||||
|
||||
#endif // AUTOCAP_H
|
||||
|
25
utils/screenshotgen/src/bitmaps/play.xpm
Normal file
25
utils/screenshotgen/src/bitmaps/play.xpm
Normal file
@ -0,0 +1,25 @@
|
||||
/* XPM */
|
||||
static const char * play_xpm[] = {
|
||||
"20 20 2 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
" ",
|
||||
" ",
|
||||
" ..... ",
|
||||
" ...... ",
|
||||
" ....... ",
|
||||
" ........ ",
|
||||
" ......... ",
|
||||
" .......... ",
|
||||
" ........... ",
|
||||
" ............ ",
|
||||
" ............ ",
|
||||
" ........... ",
|
||||
" .......... ",
|
||||
" ......... ",
|
||||
" ........ ",
|
||||
" ....... ",
|
||||
" ...... ",
|
||||
" ..... ",
|
||||
" ",
|
||||
" "};
|
25
utils/screenshotgen/src/bitmaps/stop.xpm
Normal file
25
utils/screenshotgen/src/bitmaps/stop.xpm
Normal file
@ -0,0 +1,25 @@
|
||||
/* XPM */
|
||||
static const char * stop_xpm[] = {
|
||||
"20 20 2 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" .............. ",
|
||||
" .............. ",
|
||||
" .............. ",
|
||||
" .............. ",
|
||||
" .............. ",
|
||||
" .............. ",
|
||||
" .............. ",
|
||||
" .............. ",
|
||||
" .............. ",
|
||||
" .............. ",
|
||||
" .............. ",
|
||||
" .............. ",
|
||||
" .............. ",
|
||||
" .............. ",
|
||||
" ",
|
||||
" ",
|
||||
" "};
|
@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: ctrlmaskout.cpp
|
||||
// Purpose: Implement wxCtrlMaskOut class
|
||||
// Purpose: Implement CtrlMaskOut class
|
||||
// Author: Utensil Candel (UtensilCandel@@gmail.com)
|
||||
// RCS-ID: $Id$
|
||||
// Licence: wxWindows license
|
||||
@ -31,7 +31,7 @@
|
||||
|
||||
// It's copied from src/aui/framemanager.cpp and modified, a failed attempt to
|
||||
// visualize the process of taking the screenshot when wxTopLevelWindow::CanSetTransparent
|
||||
// returns false. see wxCtrlMaskOut::CreateMask for more info
|
||||
// returns false. see CtrlMaskOut::CreateMask for more info
|
||||
// now it shows nothing and does nothing
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -103,10 +103,10 @@ END_EVENT_TABLE()
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCtrlMaskOut
|
||||
// CtrlMaskOut
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxCtrlMaskOut::wxCtrlMaskOut()
|
||||
CtrlMaskOut::CtrlMaskOut()
|
||||
: m_defaultDir(_T("screenshots")),
|
||||
m_controlName(_T("")),
|
||||
m_currentRect(0, 0, 0, 0),
|
||||
@ -116,7 +116,7 @@ wxCtrlMaskOut::wxCtrlMaskOut()
|
||||
{
|
||||
}
|
||||
|
||||
wxCtrlMaskOut::~wxCtrlMaskOut()
|
||||
CtrlMaskOut::~CtrlMaskOut()
|
||||
{
|
||||
if (m_mask != NULL)
|
||||
{
|
||||
@ -125,7 +125,7 @@ wxCtrlMaskOut::~wxCtrlMaskOut()
|
||||
}
|
||||
}
|
||||
|
||||
void wxCtrlMaskOut::OnLeftButtonDown(wxMouseEvent& event)
|
||||
void CtrlMaskOut::OnLeftButtonDown(wxMouseEvent& event)
|
||||
{
|
||||
if (m_isTiming) event.Skip();
|
||||
|
||||
@ -138,7 +138,7 @@ void wxCtrlMaskOut::OnLeftButtonDown(wxMouseEvent& event)
|
||||
CreateMask(thePanel);
|
||||
}
|
||||
|
||||
void wxCtrlMaskOut::OnMouseMoving(wxMouseEvent& event)
|
||||
void CtrlMaskOut::OnMouseMoving(wxMouseEvent& event)
|
||||
{
|
||||
if (!event.Dragging())
|
||||
{
|
||||
@ -159,7 +159,7 @@ void wxCtrlMaskOut::OnMouseMoving(wxMouseEvent& event)
|
||||
m_mask->SetSize(m_currentRect);
|
||||
}
|
||||
|
||||
void wxCtrlMaskOut::OnLeftButtonUp(wxMouseEvent& event)
|
||||
void CtrlMaskOut::OnLeftButtonUp(wxMouseEvent& event)
|
||||
{
|
||||
if (m_mask == NULL)// Which means it's not after specifying a rect region
|
||||
{
|
||||
@ -177,7 +177,7 @@ void wxCtrlMaskOut::OnLeftButtonUp(wxMouseEvent& event)
|
||||
{
|
||||
m_isTiming = true;
|
||||
(new wxTimer(this))->Start(3000, wxTIMER_ONE_SHOT);
|
||||
this->Connect(wxEVT_TIMER, wxTimerEventHandler( wxCtrlMaskOut::OnTimingFinished ), NULL, this);
|
||||
this->Connect(wxEVT_TIMER, wxTimerEventHandler( CtrlMaskOut::OnTimingFinished ), NULL, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -188,7 +188,7 @@ void wxCtrlMaskOut::OnLeftButtonUp(wxMouseEvent& event)
|
||||
}
|
||||
}
|
||||
|
||||
void wxCtrlMaskOut::OnTimingFinished(wxTimerEvent& event)
|
||||
void CtrlMaskOut::OnTimingFinished(wxTimerEvent& event)
|
||||
{
|
||||
// The final rect region is determined.
|
||||
DetermineCtrlNameAndRect();
|
||||
@ -196,10 +196,10 @@ void wxCtrlMaskOut::OnTimingFinished(wxTimerEvent& event)
|
||||
Capture(m_currentRect, m_controlName);
|
||||
|
||||
m_isTiming = false;
|
||||
this->Disconnect(wxEVT_TIMER, wxTimerEventHandler( wxCtrlMaskOut::OnTimingFinished ), NULL, this);
|
||||
this->Disconnect(wxEVT_TIMER, wxTimerEventHandler( CtrlMaskOut::OnTimingFinished ), NULL, this);
|
||||
}
|
||||
|
||||
void wxCtrlMaskOut::Capture(int x, int y, int width, int height, wxString fileName)
|
||||
void CtrlMaskOut::Capture(int x, int y, int width, int height, wxString fileName)
|
||||
{
|
||||
// Somehow wxScreenDC.Blit() doesn't work under Mac for now. Here is a trick.
|
||||
#ifdef __WXMAC__
|
||||
@ -259,13 +259,13 @@ void wxCtrlMaskOut::Capture(int x, int y, int width, int height, wxString fileNa
|
||||
fileName + _T(".png"), wxBITMAP_TYPE_PNG);
|
||||
}
|
||||
|
||||
void wxCtrlMaskOut::Capture(wxRect rect, wxString fileName)
|
||||
void CtrlMaskOut::Capture(wxRect rect, wxString fileName)
|
||||
{
|
||||
wxPoint origin = rect.GetPosition();
|
||||
Capture(origin.x, origin.y, rect.GetWidth(), rect.GetHeight(), fileName);
|
||||
}
|
||||
|
||||
void wxCtrlMaskOut::DetermineCtrlNameAndRect()
|
||||
void CtrlMaskOut::DetermineCtrlNameAndRect()
|
||||
{
|
||||
// Detect windows using (n-1)*(n-1) points
|
||||
const int n = 5;
|
||||
@ -357,7 +357,7 @@ void wxCtrlMaskOut::DetermineCtrlNameAndRect()
|
||||
m_currentRect.Inflate(m_inflateBorder);
|
||||
}
|
||||
|
||||
void wxCtrlMaskOut::CreateMask(wxWindow* parent)
|
||||
void CtrlMaskOut::CreateMask(wxWindow* parent)
|
||||
{
|
||||
if (m_mask != NULL)
|
||||
m_mask->Destroy();
|
||||
@ -392,9 +392,9 @@ void wxCtrlMaskOut::CreateMask(wxWindow* parent)
|
||||
p->SetBackgroundColour(*wxBLUE);
|
||||
|
||||
// So that even if the cursor run into the mask, the events are still correctly processed.
|
||||
p->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( wxCtrlMaskOut::OnLeftButtonDown ), NULL, this);
|
||||
p->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( wxCtrlMaskOut::OnLeftButtonUp ), NULL, this);
|
||||
p->Connect( wxEVT_MOTION, wxMouseEventHandler( wxCtrlMaskOut::OnMouseMoving ), NULL, this);
|
||||
p->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( CtrlMaskOut::OnLeftButtonDown ), NULL, this);
|
||||
p->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( CtrlMaskOut::OnLeftButtonUp ), NULL, this);
|
||||
p->Connect( wxEVT_MOTION, wxMouseEventHandler( CtrlMaskOut::OnMouseMoving ), NULL, this);
|
||||
#endif
|
||||
|
||||
// If the platform doesn't support SetTransparent()
|
||||
@ -420,16 +420,16 @@ void wxCtrlMaskOut::CreateMask(wxWindow* parent)
|
||||
m_mask->Show(true);
|
||||
|
||||
// So that even if the cursor run into the mask, the events are still correctly processed.
|
||||
m_mask->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( wxCtrlMaskOut::OnLeftButtonDown ), NULL, this);
|
||||
m_mask->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( wxCtrlMaskOut::OnLeftButtonUp ), NULL, this);
|
||||
m_mask->Connect( wxEVT_MOTION, wxMouseEventHandler( wxCtrlMaskOut::OnMouseMoving ), NULL, this);
|
||||
m_mask->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( CtrlMaskOut::OnLeftButtonDown ), NULL, this);
|
||||
m_mask->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( CtrlMaskOut::OnLeftButtonUp ), NULL, this);
|
||||
m_mask->Connect( wxEVT_MOTION, wxMouseEventHandler( CtrlMaskOut::OnMouseMoving ), NULL, this);
|
||||
}
|
||||
|
||||
void wxCtrlMaskOut::DestroyMask()
|
||||
void CtrlMaskOut::DestroyMask()
|
||||
{
|
||||
m_mask->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( wxCtrlMaskOut::OnLeftButtonDown ), NULL, this);
|
||||
m_mask->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( wxCtrlMaskOut::OnLeftButtonUp ), NULL, this);
|
||||
m_mask->Disconnect( wxEVT_MOTION, wxMouseEventHandler( wxCtrlMaskOut::OnMouseMoving ), NULL, this);
|
||||
m_mask->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( CtrlMaskOut::OnLeftButtonDown ), NULL, this);
|
||||
m_mask->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( CtrlMaskOut::OnLeftButtonUp ), NULL, this);
|
||||
m_mask->Disconnect( wxEVT_MOTION, wxMouseEventHandler( CtrlMaskOut::OnMouseMoving ), NULL, this);
|
||||
wxWindow * parent = m_mask->GetParent();
|
||||
// m_mask->Destroy();
|
||||
delete m_mask;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: ctrlmaskout.h
|
||||
// Purpose: Defines the wxCtrlMaskOut class
|
||||
// Purpose: Defines the CtrlMaskOut class
|
||||
// Author: Utensil Candel (UtensilCandel@@gmail.com)
|
||||
// RCS-ID: $Id$
|
||||
// Licence: wxWindows license
|
||||
@ -13,14 +13,14 @@
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// class wxCtrlMaskOut
|
||||
// class CtrlMaskOut
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxCtrlMaskOut : public wxEvtHandler
|
||||
class CtrlMaskOut : public wxEvtHandler
|
||||
{
|
||||
public:
|
||||
wxCtrlMaskOut();
|
||||
~wxCtrlMaskOut();
|
||||
CtrlMaskOut();
|
||||
~CtrlMaskOut();
|
||||
|
||||
public:
|
||||
void OnLeftButtonDown(wxMouseEvent& event);
|
||||
|
@ -44,10 +44,10 @@ END_EVENT_TABLE()
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxPenStyleComboBox
|
||||
// PenStyleComboBox
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxPenStyleComboBox::OnDrawItem( wxDC& dc,
|
||||
void PenStyleComboBox::OnDrawItem( wxDC& dc,
|
||||
const wxRect& rect,
|
||||
int item,
|
||||
int flags ) const
|
||||
@ -103,7 +103,7 @@ void wxPenStyleComboBox::OnDrawItem( wxDC& dc,
|
||||
}
|
||||
}
|
||||
|
||||
void wxPenStyleComboBox::OnDrawBackground( wxDC& dc, const wxRect& rect,
|
||||
void PenStyleComboBox::OnDrawBackground( wxDC& dc, const wxRect& rect,
|
||||
int item, int flags ) const
|
||||
{
|
||||
// If item is selected or even, or we are painting the
|
||||
@ -122,7 +122,7 @@ void wxPenStyleComboBox::OnDrawBackground( wxDC& dc, const wxRect& rect,
|
||||
dc.DrawRectangle(rect);
|
||||
}
|
||||
|
||||
inline wxCoord wxPenStyleComboBox::OnMeasureItem( size_t item ) const
|
||||
inline wxCoord PenStyleComboBox::OnMeasureItem( size_t item ) const
|
||||
{
|
||||
// Simply demonstrate the ability to have variable-height items
|
||||
if ( item & 1 )
|
||||
@ -131,14 +131,14 @@ inline wxCoord wxPenStyleComboBox::OnMeasureItem( size_t item ) const
|
||||
return 24;
|
||||
}
|
||||
|
||||
inline wxCoord wxPenStyleComboBox::OnMeasureItemWidth( size_t WXUNUSED(item) ) const
|
||||
inline wxCoord PenStyleComboBox::OnMeasureItemWidth( size_t WXUNUSED(item) ) const
|
||||
{
|
||||
return -1; // default - will be measured from text width
|
||||
}
|
||||
|
||||
wxPenStyleComboBox * wxPenStyleComboBox::CreateSample(wxWindow* parent)
|
||||
PenStyleComboBox * PenStyleComboBox::CreateSample(wxWindow* parent)
|
||||
{
|
||||
wxPenStyleComboBox* odc;
|
||||
PenStyleComboBox* odc;
|
||||
|
||||
// Common list of items for all dialogs.
|
||||
wxArrayString arrItems;
|
||||
@ -161,7 +161,7 @@ wxPenStyleComboBox * wxPenStyleComboBox::CreateSample(wxWindow* parent)
|
||||
// When defining derivative class for callbacks, we need
|
||||
// to use two-stage creation (or redefine the common wx
|
||||
// constructor).
|
||||
odc = new wxPenStyleComboBox();
|
||||
odc = new PenStyleComboBox();
|
||||
odc->Create(parent,wxID_ANY,wxEmptyString,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
arrItems,
|
||||
@ -172,9 +172,9 @@ wxPenStyleComboBox * wxPenStyleComboBox::CreateSample(wxWindow* parent)
|
||||
odc->SetSelection(0);
|
||||
|
||||
// Load images from disk
|
||||
wxImage imgNormal(wxT("dropbutn.png"));
|
||||
wxImage imgPressed(wxT("dropbutp.png"));
|
||||
wxImage imgHover(wxT("dropbuth.png"));
|
||||
wxImage imgNormal(wxT("bitmaps/dropbutn.png"));
|
||||
wxImage imgPressed(wxT("bitmaps/dropbutp.png"));
|
||||
wxImage imgHover(wxT("bitmaps/dropbuth.png"));
|
||||
|
||||
if ( imgNormal.IsOk() && imgPressed.IsOk() && imgHover.IsOk() )
|
||||
{
|
||||
|
@ -10,13 +10,13 @@
|
||||
#define WX_CUSTOM_COMBO_H
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// class wxPenStyleComboBox
|
||||
// class PenStyleComboBox
|
||||
// This class is a modified version of the one from samples/combo.cpp
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include <wx/odcombo.h>
|
||||
|
||||
class wxPenStyleComboBox : public wxOwnerDrawnComboBox
|
||||
class PenStyleComboBox : public wxOwnerDrawnComboBox
|
||||
{
|
||||
public:
|
||||
virtual void OnDrawItem( wxDC& dc,
|
||||
@ -32,7 +32,7 @@ public:
|
||||
|
||||
virtual wxCoord OnMeasureItemWidth( size_t WXUNUSED(item) ) const;
|
||||
|
||||
static wxPenStyleComboBox* CreateSample(wxWindow* parent);
|
||||
static PenStyleComboBox* CreateSample(wxWindow* parent);
|
||||
};
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
<property name="name">MyProject</property>
|
||||
<property name="namespace"></property>
|
||||
<property name="path">.</property>
|
||||
<property name="precompiled_header">// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
 #pragma hdrstop
#endif

// for all others, include the necessary headers (this file is usually all you
// need because it includes almost all "standard" wxWidgets headers)
#ifndef WX_PRECOMP
 #include "wx/wx.h"
#endif</property>
|
||||
<property name="precompiled_header">// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
 #pragma hdrstop
#endif

// for all others, include the necessary headers wxWidgets headers)
#ifndef WX_PRECOMP
 #include "wx/wx.h"
#endif

#include "bitmaps/play.xpm"
#include "bitmaps/stop.xpm"
</property>
|
||||
<property name="relative_path">1</property>
|
||||
<property name="use_enum">1</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
@ -70,7 +70,7 @@
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="wxMenuBar" expanded="0">
|
||||
<object class="wxMenuBar" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="enabled">1</property>
|
||||
@ -123,9 +123,9 @@
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help">Open the directory where the screenshots generated.</property>
|
||||
<property name="id">idMenuOpen</property>
|
||||
<property name="id">wxID_ZOOM_IN</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">See Screenshots</property>
|
||||
<property name="label">&View screenshots...</property>
|
||||
<property name="name">m_menuSeeScr</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut">Ctrl+O</property>
|
||||
@ -133,12 +133,15 @@
|
||||
<event name="OnMenuSelection">OnSeeScreenshots</event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
<object class="separator" expanded="1">
|
||||
<property name="permission">none</property>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="1">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help">Quit the application</property>
|
||||
<property name="id">idMenuQuit</property>
|
||||
<property name="id">wxID_EXIT</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">&Quit</property>
|
||||
<property name="name">m_menuFileQuit</property>
|
||||
@ -169,7 +172,7 @@
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="1">
|
||||
<property name="bitmap"></property>
|
||||
<property name="bitmap">play; Load From Icon Resource [-1; -1]</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help">Manually specify rectangular regions</property>
|
||||
@ -184,7 +187,7 @@
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="1">
|
||||
<property name="bitmap"></property>
|
||||
<property name="bitmap">stop; Load From Icon Resource [-1; -1]</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">0</property>
|
||||
<property name="help">Stop generating screenshots...</property>
|
||||
@ -199,7 +202,7 @@
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="1">
|
||||
<property name="bitmap"></property>
|
||||
<property name="bitmap">; Load From Resource</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help">Take screenshot for all controls autoly.</property>
|
||||
@ -214,7 +217,7 @@
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="wxMenu" expanded="0">
|
||||
<object class="wxMenu" expanded="1">
|
||||
<property name="label">&Help</property>
|
||||
<property name="name">helpMenu</property>
|
||||
<property name="permission">protected</property>
|
||||
@ -223,9 +226,9 @@
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help">Show info about this application</property>
|
||||
<property name="id">idMenuAbout</property>
|
||||
<property name="id">wxID_ABOUT</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">&About</property>
|
||||
<property name="label">&About...</property>
|
||||
<property name="name">m_menuHelpAbout</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut">F1</property>
|
||||
@ -293,8 +296,8 @@
|
||||
<object class="notebookpage" expanded="1">
|
||||
<property name="bitmap"></property>
|
||||
<property name="label">Tiny Controls</property>
|
||||
<property name="select">1</property>
|
||||
<object class="wxPanel" expanded="0">
|
||||
<property name="select">0</property>
|
||||
<object class="wxPanel" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="enabled">1</property>
|
||||
@ -336,7 +339,7 @@
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="wxFlexGridSizer" expanded="0">
|
||||
<object class="wxFlexGridSizer" expanded="1">
|
||||
<property name="cols">2</property>
|
||||
<property name="flexible_direction">wxBOTH</property>
|
||||
<property name="growablecols"></property>
|
||||
@ -665,7 +668,7 @@
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap">wxwin32x32.png; Load From File</property>
|
||||
<property name="bitmap">bitmaps/wxwin32x32.png; Load From File</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="disabled"></property>
|
||||
@ -722,7 +725,7 @@
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticBitmap" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap">wxwin32x32.png; Load From File</property>
|
||||
<property name="bitmap">bitmaps/wxwin32x32.png; Load From File</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
@ -765,6 +768,120 @@
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER|wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap">bitmaps/wxwin32x32.png; Load From File</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="hover"></property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">wxBitmapButton</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_bpButton12</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="selected"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxBU_AUTODRAW</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip">wxBitmapButton</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER|wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap">bitmaps/wxwin32x32.png; Load From File</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="hover"></property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">wxBitmapButton</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_bpButton11</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="selected"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxBU_AUTODRAW</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip">wxBitmapButton</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">20</property>
|
||||
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
|
||||
@ -1003,7 +1120,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="hover_color"></property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">www.wxWidgets.org</property>
|
||||
<property name="label">www.wxwidgets.org</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_hyperlink1</property>
|
||||
@ -1014,7 +1131,7 @@
|
||||
<property name="style">wxHL_DEFAULT_STYLE</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip">wxHyperlinkCtrl</property>
|
||||
<property name="url">http://www.wxWidgets.org</property>
|
||||
<property name="url">http://www.wxwidgets.org</property>
|
||||
<property name="visited_color"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
@ -1231,8 +1348,8 @@
|
||||
<object class="notebookpage" expanded="1">
|
||||
<property name="bitmap"></property>
|
||||
<property name="label">Choosing Controls</property>
|
||||
<property name="select">0</property>
|
||||
<object class="wxPanel" expanded="0">
|
||||
<property name="select">1</property>
|
||||
<object class="wxPanel" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="enabled">1</property>
|
||||
@ -1658,7 +1775,7 @@
|
||||
<property name="name">m_animationCtrl1</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="settings"> m_animationCtrl1->SetToolTip(_("wxAnimationCtrl"));
 if (m_animationCtrl1->LoadFile(wxT("throbber.gif")))
 m_animationCtrl1->Play();</property>
|
||||
<property name="settings"> m_animationCtrl1->SetToolTip(_("wxAnimationCtrl"));
 if (m_animationCtrl1->LoadFile(wxT("bitmaps/throbber.gif")))
 m_animationCtrl1->Play();</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
@ -1803,7 +1920,7 @@
|
||||
<property name="bitmap"></property>
|
||||
<property name="label">Text Richtext</property>
|
||||
<property name="select">0</property>
|
||||
<object class="wxPanel" expanded="0">
|
||||
<object class="wxPanel" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="enabled">1</property>
|
||||
@ -2039,7 +2156,7 @@
|
||||
<property name="bitmap"></property>
|
||||
<property name="label">Picker Controls</property>
|
||||
<property name="select">0</property>
|
||||
<object class="wxPanel" expanded="0">
|
||||
<object class="wxPanel" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="enabled">1</property>
|
||||
@ -2081,7 +2198,7 @@
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="wxFlexGridSizer" expanded="0">
|
||||
<object class="wxFlexGridSizer" expanded="1">
|
||||
<property name="cols">2</property>
|
||||
<property name="flexible_direction">wxBOTH</property>
|
||||
<property name="growablecols"></property>
|
||||
@ -2693,7 +2810,7 @@
|
||||
<property name="name">m_bmpComboBox1</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="settings">m_bmpComboBox1->Append(_("Item1"), wxBitmap(_T("bell.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->Append(_("Item2"), wxBitmap(_T("sound.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->Append(_("Item3"), wxBitmap(_T("bell.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->Append(_("Item4"), wxBitmap(_T("sound.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->SetToolTip(_("wxBitmapComboBox"));</property>
|
||||
<property name="settings">m_bmpComboBox1->Append(_("Item1"), wxBitmap(_T("bitmaps/bell.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->Append(_("Item2"), wxBitmap(_T("bitmaps/sound.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->Append(_("Item3"), wxBitmap(_T("bitmaps/bell.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->Append(_("Item4"), wxBitmap(_T("bitmaps/sound.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->SetToolTip(_("wxBitmapComboBox"));</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
@ -2731,16 +2848,16 @@
|
||||
<property name="proportion">1</property>
|
||||
<object class="CustomControl" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="class">wxPenStyleComboBox</property>
|
||||
<property name="construction">m_ownerDrawnComboBox1 = wxPenStyleComboBox::CreateSample(m_panel5);</property>
|
||||
<property name="class">PenStyleComboBox</property>
|
||||
<property name="construction">m_ownerDrawnComboBox1 = PenStyleComboBox::CreateSample(m_panel5);</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="declaration">wxPenStyleComboBox * m_ownerDrawnComboBox1;</property>
|
||||
<property name="declaration">PenStyleComboBox * m_ownerDrawnComboBox1;</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="include">#include "custom_combo.h"</property>
|
||||
<property name="include">#include "customcombo.h"</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_ownerDrawnComboBox1</property>
|
||||
@ -2813,13 +2930,13 @@
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="include">#include "custom_combo.h"</property>
|
||||
<property name="include">#include "customcombo.h"</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_comboCtrl1</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="settings">	m_comboCtrl1->SetText(wxT("wxComboCtrl"));
 m_comboCtrl1->SetToolTip(_("wxComboCtrl"));

	ListViewComboPopup* popupList = new ListViewComboPopup();
	m_comboCtrl1->SetPopupControl(popupList);
	m_comboCtrl1->SetPopupMaxHeight(80);

	// 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->Select(0, true);</property>
|
||||
<property name="settings"> // first of all, set the popup control!
	ListViewComboPopup* popupList = new ListViewComboPopup();
	m_comboCtrl1->SetPopupControl(popupList);
	m_comboCtrl1->SetPopupMaxHeight(80);

 m_comboCtrl1->SetText(wxT("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->Select(0, true);</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
@ -2866,13 +2983,13 @@
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="include">#include "custom_combo.h"</property>
|
||||
<property name="include">#include "customcombo.h"</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_comboCtrl2</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="settings">	m_comboCtrl2->SetText(wxT("wxComboCtrl"));
	m_comboCtrl2->SetToolTip(_("wxComboCtrl"));

	TreeCtrlComboPopup* popupTree = new TreeCtrlComboPopup();

	m_comboCtrl2->SetPopupControl(popupTree);
	m_comboCtrl2->SetPopupMaxHeight(80);

	//Add a root and some nodes using wxTreeCtrl methods
	wxTreeItemId root = popupTree->AddRoot(_("wxComboCtrl"));

	popupTree->AppendItem(root, _("with"));
	popupTree->AppendItem(root, _("wxTreeCtrl"));

	wxTreeItemId node2 = popupTree->AppendItem(root, _("popout"));
	popupTree->AppendItem(node2, _("Node1"));
	popupTree->AppendItem(node2, _("Node2"));

	popupTree->ExpandAll();</property>
|
||||
<property name="settings"> // first of all, set the popup control!
	TreeCtrlComboPopup* popupTree = new TreeCtrlComboPopup();
	m_comboCtrl2->SetPopupControl(popupTree);
	m_comboCtrl2->SetPopupMaxHeight(80);

	m_comboCtrl2->SetText(wxT("wxComboCtrl"));
	m_comboCtrl2->SetToolTip(_("wxComboCtrl"));

	//Add a root and some nodes using wxTreeCtrl methods
	wxTreeItemId root = popupTree->AddRoot(_("wxComboCtrl"));

	popupTree->AppendItem(root, _("with"));
	popupTree->AppendItem(root, _("wxTreeCtrl"));

	wxTreeItemId node2 = popupTree->AppendItem(root, _("popout"));
	popupTree->AppendItem(node2, _("Node1"));
	popupTree->AppendItem(node2, _("Node2"));

	popupTree->ExpandAll();</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 17 2008)
|
||||
// C++ code generated with wxFormBuilder (version Apr 21 2008)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
@ -16,12 +16,15 @@
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
// for all others, include the necessary headers (this file is usually all you
|
||||
// need because it includes almost all "standard" wxWidgets headers)
|
||||
// for all others, include the necessary headers wxWidgets headers)
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#include "bitmaps/play.xpm"
|
||||
#include "bitmaps/stop.xpm"
|
||||
|
||||
|
||||
#include "guiframe.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@ -33,11 +36,13 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
|
||||
mbar = new wxMenuBar( 0 );
|
||||
fileMenu = new wxMenu();
|
||||
wxMenuItem* m_menuSeeScr;
|
||||
m_menuSeeScr = new wxMenuItem( fileMenu, idMenuOpen, wxString( _("See Screenshots") ) + wxT('\t') + wxT("Ctrl+O"), _("Open the directory where the screenshots generated."), wxITEM_NORMAL );
|
||||
m_menuSeeScr = new wxMenuItem( fileMenu, wxID_ZOOM_IN, wxString( _("&View screenshots...") ) + wxT('\t') + wxT("Ctrl+O"), _("Open the directory where the screenshots generated."), wxITEM_NORMAL );
|
||||
fileMenu->Append( m_menuSeeScr );
|
||||
|
||||
fileMenu->AppendSeparator();
|
||||
|
||||
wxMenuItem* m_menuFileQuit;
|
||||
m_menuFileQuit = new wxMenuItem( fileMenu, idMenuQuit, wxString( _("&Quit") ) + wxT('\t') + wxT("Alt+F4"), _("Quit the application"), wxITEM_NORMAL );
|
||||
m_menuFileQuit = new wxMenuItem( fileMenu, wxID_EXIT, wxString( _("&Quit") ) + wxT('\t') + wxT("Alt+F4"), _("Quit the application"), wxITEM_NORMAL );
|
||||
fileMenu->Append( m_menuFileQuit );
|
||||
|
||||
mbar->Append( fileMenu, _("&File") );
|
||||
@ -49,10 +54,20 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
|
||||
|
||||
wxMenuItem* m_menuCapRect;
|
||||
m_menuCapRect = new wxMenuItem( captureMenu, idMenuCapRect, wxString( _("Regions<Begin>") ) + wxT('\t') + wxT("Ctrl+Alt+R"), _("Manually specify rectangular regions"), wxITEM_NORMAL );
|
||||
#ifdef __WXMSW__
|
||||
m_menuCapRect->SetBitmaps( wxICON( play ) );
|
||||
#elif defined( __WXGTK__ )
|
||||
m_menuCapRect->SetBitmap( wxICON( play ) );
|
||||
#endif
|
||||
captureMenu->Append( m_menuCapRect );
|
||||
|
||||
wxMenuItem* m_menuEndCapRect;
|
||||
m_menuEndCapRect = new wxMenuItem( captureMenu, idMenuEndCapRect, wxString( _("Regions<End>") ) + wxT('\t') + wxT("Ctrl+Alt+E"), _("Stop generating screenshots..."), wxITEM_NORMAL );
|
||||
#ifdef __WXMSW__
|
||||
m_menuEndCapRect->SetBitmaps( wxICON( stop ) );
|
||||
#elif defined( __WXGTK__ )
|
||||
m_menuEndCapRect->SetBitmap( wxICON( stop ) );
|
||||
#endif
|
||||
captureMenu->Append( m_menuEndCapRect );
|
||||
m_menuEndCapRect->Enable( false );
|
||||
|
||||
@ -64,7 +79,7 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
|
||||
|
||||
helpMenu = new wxMenu();
|
||||
wxMenuItem* m_menuHelpAbout;
|
||||
m_menuHelpAbout = new wxMenuItem( helpMenu, idMenuAbout, wxString( _("&About") ) + wxT('\t') + wxT("F1"), _("Show info about this application"), wxITEM_NORMAL );
|
||||
m_menuHelpAbout = new wxMenuItem( helpMenu, wxID_ABOUT, wxString( _("&About...") ) + wxT('\t') + wxT("F1"), _("Show info about this application"), wxITEM_NORMAL );
|
||||
helpMenu->Append( m_menuHelpAbout );
|
||||
|
||||
mbar->Append( helpMenu, _("&Help") );
|
||||
@ -112,18 +127,32 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
|
||||
|
||||
fgSizer1->Add( m_radioBtn2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
|
||||
|
||||
m_bpButton1 = new wxBitmapButton( m_panel1, wxID_ANY, wxBitmap( wxT("wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
|
||||
m_bpButton1 = new wxBitmapButton( m_panel1, wxID_ANY, wxBitmap( wxT("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("wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_bitmap1 = new wxStaticBitmap( m_panel1, wxID_ANY, wxBitmap( wxT("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_bpButton12 = new wxBitmapButton( m_panel1, wxID_ANY, wxBitmap( wxT("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
|
||||
m_bpButton12->SetToolTip( _("wxBitmapButton") );
|
||||
|
||||
m_bpButton12->SetToolTip( _("wxBitmapButton") );
|
||||
|
||||
fgSizer1->Add( m_bpButton12, 0, wxALIGN_CENTER|wxALL, 5 );
|
||||
|
||||
m_bpButton11 = new wxBitmapButton( m_panel1, wxID_ANY, wxBitmap( wxT("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
|
||||
m_bpButton11->SetToolTip( _("wxBitmapButton") );
|
||||
|
||||
m_bpButton11->SetToolTip( _("wxBitmapButton") );
|
||||
|
||||
fgSizer1->Add( m_bpButton11, 0, wxALIGN_CENTER|wxALL, 5 );
|
||||
|
||||
m_gauge1 = new wxGauge( m_panel1, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL, wxDefaultValidator, wxT("_Gauge") );
|
||||
m_gauge1->SetValue( 50 );
|
||||
m_gauge1->SetToolTip( _("wxGauge") );
|
||||
@ -146,7 +175,7 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
|
||||
|
||||
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"), wxT("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 );
|
||||
@ -169,7 +198,7 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
|
||||
m_panel1->SetSizer( fgSizer1 );
|
||||
m_panel1->Layout();
|
||||
fgSizer1->Fit( m_panel1 );
|
||||
m_notebook1->AddPage( m_panel1, _("Tiny Controls"), true );
|
||||
m_notebook1->AddPage( m_panel1, _("Tiny Controls"), false );
|
||||
m_panel2 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxFlexGridSizer* fgSizer2;
|
||||
fgSizer2 = new wxFlexGridSizer( 5, 2, 0, 0 );
|
||||
@ -208,7 +237,7 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
|
||||
|
||||
m_animationCtrl1 = new wxAnimationCtrl(m_panel2, wxID_ANY);
|
||||
m_animationCtrl1->SetToolTip(_("wxAnimationCtrl"));
|
||||
if (m_animationCtrl1->LoadFile(wxT("throbber.gif")))
|
||||
if (m_animationCtrl1->LoadFile(wxT("bitmaps/throbber.gif")))
|
||||
m_animationCtrl1->Play();
|
||||
fgSizer2->Add( m_animationCtrl1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
|
||||
|
||||
@ -245,7 +274,7 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
|
||||
m_panel2->SetSizer( fgSizer2 );
|
||||
m_panel2->Layout();
|
||||
fgSizer2->Fit( m_panel2 );
|
||||
m_notebook1->AddPage( m_panel2, _("Choosing Controls"), false );
|
||||
m_notebook1->AddPage( m_panel2, _("Choosing Controls"), true );
|
||||
m_panel3 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* bSizer2;
|
||||
bSizer2 = new wxBoxSizer( wxVERTICAL );
|
||||
@ -352,14 +381,14 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
|
||||
fgSizer4->Add( 0, 120, 1, wxEXPAND, 5 );
|
||||
|
||||
m_bmpComboBox1 = new wxBitmapComboBox(m_panel5, wxID_ANY,_("Item1"));
|
||||
m_bmpComboBox1->Append(_("Item1"), wxBitmap(_T("bell.png"),wxBITMAP_TYPE_PNG));
|
||||
m_bmpComboBox1->Append(_("Item2"), wxBitmap(_T("sound.png"),wxBITMAP_TYPE_PNG));
|
||||
m_bmpComboBox1->Append(_("Item3"), wxBitmap(_T("bell.png"),wxBITMAP_TYPE_PNG));
|
||||
m_bmpComboBox1->Append(_("Item4"), wxBitmap(_T("sound.png"),wxBITMAP_TYPE_PNG));
|
||||
m_bmpComboBox1->Append(_("Item1"), wxBitmap(_T("bitmaps/bell.png"),wxBITMAP_TYPE_PNG));
|
||||
m_bmpComboBox1->Append(_("Item2"), wxBitmap(_T("bitmaps/sound.png"),wxBITMAP_TYPE_PNG));
|
||||
m_bmpComboBox1->Append(_("Item3"), wxBitmap(_T("bitmaps/bell.png"),wxBITMAP_TYPE_PNG));
|
||||
m_bmpComboBox1->Append(_("Item4"), wxBitmap(_T("bitmaps/sound.png"),wxBITMAP_TYPE_PNG));
|
||||
m_bmpComboBox1->SetToolTip(_("wxBitmapComboBox"));
|
||||
fgSizer4->Add( m_bmpComboBox1, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 20 );
|
||||
|
||||
m_ownerDrawnComboBox1 = wxPenStyleComboBox::CreateSample(m_panel5);
|
||||
m_ownerDrawnComboBox1 = PenStyleComboBox::CreateSample(m_panel5);
|
||||
m_ownerDrawnComboBox1->SetToolTip(_("wxOwnerDrawnComboBox"));
|
||||
fgSizer4->Add( m_ownerDrawnComboBox1, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
|
||||
|
||||
@ -370,13 +399,14 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
|
||||
fgSizer4->Add( 0, 90, 1, wxEXPAND, 5 );
|
||||
|
||||
m_comboCtrl1 = new wxComboCtrl(m_panel5,wxID_ANY,wxEmptyString);
|
||||
m_comboCtrl1->SetText(wxT("wxComboCtrl"));
|
||||
m_comboCtrl1->SetToolTip(_("wxComboCtrl"));
|
||||
|
||||
// first of all, set the popup control!
|
||||
ListViewComboPopup* popupList = new ListViewComboPopup();
|
||||
m_comboCtrl1->SetPopupControl(popupList);
|
||||
m_comboCtrl1->SetPopupMaxHeight(80);
|
||||
|
||||
m_comboCtrl1->SetText(wxT("wxComboCtrl"));
|
||||
m_comboCtrl1->SetToolTip(_("wxComboCtrl"));
|
||||
|
||||
// Populate using wxListView methods
|
||||
popupList->InsertItem(popupList->GetItemCount(),wxT("wxComboCtrl"));
|
||||
popupList->InsertItem(popupList->GetItemCount(),wxT("with"));
|
||||
@ -390,14 +420,14 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
|
||||
fgSizer4->Add( m_comboCtrl1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 20 );
|
||||
|
||||
m_comboCtrl2 = new wxComboCtrl(m_panel5,wxID_ANY,wxEmptyString);
|
||||
m_comboCtrl2->SetText(wxT("wxComboCtrl"));
|
||||
m_comboCtrl2->SetToolTip(_("wxComboCtrl"));
|
||||
|
||||
// first of all, set the popup control!
|
||||
TreeCtrlComboPopup* popupTree = new TreeCtrlComboPopup();
|
||||
|
||||
m_comboCtrl2->SetPopupControl(popupTree);
|
||||
m_comboCtrl2->SetPopupMaxHeight(80);
|
||||
|
||||
m_comboCtrl2->SetText(wxT("wxComboCtrl"));
|
||||
m_comboCtrl2->SetToolTip(_("wxComboCtrl"));
|
||||
|
||||
//Add a root and some nodes using wxTreeCtrl methods
|
||||
wxTreeItemId root = popupTree->AddRoot(_("wxComboCtrl"));
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 17 2008)
|
||||
// C++ code generated with wxFormBuilder (version Apr 21 2008)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
@ -64,22 +64,19 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class GUIFrame
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class GUIFrame : public wxFrame
|
||||
class GUIFrame : public wxFrame
|
||||
{
|
||||
private:
|
||||
|
||||
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
idMenuOpen = 1000,
|
||||
idMenuQuit,
|
||||
idMenuCapFullScreen,
|
||||
idMenuCapFullScreen = 1000,
|
||||
idMenuCapRect,
|
||||
idMenuEndCapRect,
|
||||
idMenuCapAll,
|
||||
idMenuAbout,
|
||||
};
|
||||
|
||||
|
||||
wxMenuBar* mbar;
|
||||
wxMenu* fileMenu;
|
||||
wxMenu* captureMenu;
|
||||
@ -94,6 +91,8 @@ class GUIFrame : public wxFrame
|
||||
wxRadioButton* m_radioBtn2;
|
||||
wxBitmapButton* m_bpButton1;
|
||||
wxStaticBitmap* m_bitmap1;
|
||||
wxBitmapButton* m_bpButton12;
|
||||
wxBitmapButton* m_bpButton11;
|
||||
wxGauge* m_gauge1;
|
||||
wxSlider* m_slider1;
|
||||
wxToggleButton* m_toggleBtn1;
|
||||
@ -114,14 +113,14 @@ class GUIFrame : public wxFrame
|
||||
wxCollapsiblePane *m_collPane2;
|
||||
wxPanel* m_panel3;
|
||||
wxTextCtrl* m_textCtrl1;
|
||||
|
||||
|
||||
wxTextCtrl* m_textCtrl2;
|
||||
wxRichTextCtrl* m_richText1;
|
||||
wxPanel* m_panel4;
|
||||
wxColourPickerCtrl* m_colourPicker1;
|
||||
wxFontPickerCtrl* m_fontPicker1;
|
||||
wxFilePickerCtrl* m_filePicker1;
|
||||
|
||||
|
||||
wxCalendarCtrl* m_calendar1;
|
||||
wxDatePickerCtrl* m_datePicker1;
|
||||
wxGenericDirCtrl* m_genericDirCtrl1;
|
||||
@ -129,16 +128,16 @@ class GUIFrame : public wxFrame
|
||||
wxPanel* m_panel5;
|
||||
wxChoice* m_choice1;
|
||||
wxComboBox* m_comboBox1;
|
||||
|
||||
|
||||
|
||||
|
||||
wxBitmapComboBox * m_bmpComboBox1;
|
||||
wxPenStyleComboBox * m_ownerDrawnComboBox1;
|
||||
|
||||
|
||||
PenStyleComboBox * m_ownerDrawnComboBox1;
|
||||
|
||||
|
||||
wxComboCtrl * m_comboCtrl1;
|
||||
wxComboCtrl * m_comboCtrl2;
|
||||
wxStatusBar* statusBar;
|
||||
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnClose( wxCloseEvent& event ){ event.Skip(); }
|
||||
virtual void OnSeeScreenshots( wxCommandEvent& event ){ event.Skip(); }
|
||||
@ -150,12 +149,12 @@ class GUIFrame : public wxFrame
|
||||
virtual void OnAbout( wxCommandEvent& event ){ event.Skip(); }
|
||||
virtual void OnNotebookPageChanged( wxNotebookEvent& event ){ event.Skip(); }
|
||||
virtual void OnNotebookPageChanging( wxNotebookEvent& event ){ event.Skip(); }
|
||||
|
||||
|
||||
|
||||
|
||||
public:
|
||||
GUIFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("wxWidgets Control Screenshot Generator"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
|
||||
~GUIFrame();
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif //__guiframe__
|
||||
|
@ -260,7 +260,7 @@ $(OBJS)\screenshotgen.exe: $(SCREENSHOTGEN_OBJECTS) $(OBJS)\screenshotgen_scree
|
||||
|
||||
data:
|
||||
if not exist $(OBJS) mkdir $(OBJS)
|
||||
for %f in (richtext.xml bitmaps/wxwin32x32.png bitmaps/bell.png bitmaps/info.png bitmaps/sound.png bitmaps/dropbuth.png bitmaps/dropbutn.png bitmaps/dropbutp.png bitmaps/throbber.gif) do if not exist $(OBJS)\%f copy .\%f $(OBJS)
|
||||
for %f in (richtext.xml bitmaps/wxwin32x32.png bitmaps/bell.png bitmaps/sound.png bitmaps/dropbuth.png bitmaps/dropbutn.png bitmaps/dropbutp.png bitmaps/throbber.gif) do if not exist $(OBJS)\%f copy .\%f $(OBJS)
|
||||
|
||||
$(OBJS)\screenshotgen_screenshot_app.obj: .\screenshot_app.cpp
|
||||
$(CXX) -q -c -P -o$@ $(SCREENSHOTGEN_CXXFLAGS) .\screenshot_app.cpp
|
||||
|
@ -253,7 +253,7 @@ $(OBJS)\screenshotgen.exe: $(SCREENSHOTGEN_OBJECTS) $(OBJS)\screenshotgen_screen
|
||||
|
||||
data:
|
||||
if not exist $(OBJS) mkdir $(OBJS)
|
||||
for %%f in (richtext.xml bitmaps/wxwin32x32.png bitmaps/bell.png bitmaps/info.png bitmaps/sound.png bitmaps/dropbuth.png bitmaps/dropbutn.png bitmaps/dropbutp.png bitmaps/throbber.gif) do if not exist $(OBJS)\%%f copy .\%%f $(OBJS)
|
||||
for %%f in (richtext.xml bitmaps/wxwin32x32.png bitmaps/bell.png bitmaps/sound.png bitmaps/dropbuth.png bitmaps/dropbutn.png bitmaps/dropbutp.png bitmaps/throbber.gif) do if not exist $(OBJS)\%%f copy .\%%f $(OBJS)
|
||||
|
||||
$(OBJS)\screenshotgen_screenshot_app.o: ./screenshot_app.cpp
|
||||
$(CXX) -c -o $@ $(SCREENSHOTGEN_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
@ -336,7 +336,7 @@ $(OBJS)\screenshotgen.exe: $(SCREENSHOTGEN_OBJECTS) $(OBJS)\screenshotgen_screen
|
||||
|
||||
data:
|
||||
if not exist $(OBJS) mkdir $(OBJS)
|
||||
for %f in (richtext.xml bitmaps/wxwin32x32.png bitmaps/bell.png bitmaps/info.png bitmaps/sound.png bitmaps/dropbuth.png bitmaps/dropbutn.png bitmaps/dropbutp.png bitmaps/throbber.gif) do if not exist $(OBJS)\%f copy .\%f $(OBJS)
|
||||
for %f in (richtext.xml bitmaps/wxwin32x32.png bitmaps/bell.png bitmaps/sound.png bitmaps/dropbuth.png bitmaps/dropbutn.png bitmaps/dropbutp.png bitmaps/throbber.gif) do if not exist $(OBJS)\%f copy .\%f $(OBJS)
|
||||
|
||||
$(OBJS)\screenshotgen_screenshot_app.obj: .\screenshot_app.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(SCREENSHOTGEN_CXXFLAGS) .\screenshot_app.cpp
|
||||
|
@ -290,7 +290,7 @@ $(OBJS)\screenshotgen.exe : $(SCREENSHOTGEN_OBJECTS) $(OBJS)\screenshotgen_scre
|
||||
|
||||
data : .SYMBOLIC
|
||||
if not exist $(OBJS) mkdir $(OBJS)
|
||||
for %f in (richtext.xml bitmaps/wxwin32x32.png bitmaps/bell.png bitmaps/info.png bitmaps/sound.png bitmaps/dropbuth.png bitmaps/dropbutn.png bitmaps/dropbutp.png bitmaps/throbber.gif) do if not exist $(OBJS)\%f copy .\%f $(OBJS)
|
||||
for %f in (richtext.xml bitmaps/wxwin32x32.png bitmaps/bell.png bitmaps/sound.png bitmaps/dropbuth.png bitmaps/dropbutn.png bitmaps/dropbutp.png bitmaps/throbber.gif) do if not exist $(OBJS)\%f copy .\%f $(OBJS)
|
||||
|
||||
$(OBJS)\screenshotgen_screenshot_app.obj : .AUTODEPEND .\screenshot_app.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(SCREENSHOTGEN_CXXFLAGS) $<
|
||||
|
@ -25,12 +25,12 @@
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxScreenshotApp
|
||||
// ScreenshotApp
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_APP(wxScreenshotApp);
|
||||
IMPLEMENT_APP(ScreenshotApp);
|
||||
|
||||
bool wxScreenshotApp::OnInit()
|
||||
bool ScreenshotApp::OnInit()
|
||||
{
|
||||
// Init all Image handlers
|
||||
wxInitAllImageHandlers();
|
||||
@ -38,7 +38,7 @@ bool wxScreenshotApp::OnInit()
|
||||
// Add richtext extra handlers (plain text is automatically added)
|
||||
wxRichTextBuffer::AddHandler(new wxRichTextXMLHandler);
|
||||
|
||||
wxScreenshotFrame* frame = new wxScreenshotFrame(0L);
|
||||
ScreenshotFrame* frame = new ScreenshotFrame(0L);
|
||||
frame->Show();
|
||||
|
||||
return true;
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include <wx/app.h>
|
||||
|
||||
class wxScreenshotApp : public wxApp
|
||||
class ScreenshotApp : public wxApp
|
||||
{
|
||||
public:
|
||||
virtual bool OnInit();
|
||||
|
@ -24,11 +24,13 @@
|
||||
#endif
|
||||
|
||||
#include <wx/dir.h>
|
||||
#include <wx/aboutdlg.h>
|
||||
|
||||
#include "screenshot_main.h"
|
||||
#include "ctrlmaskout.h"
|
||||
#include "autocapture.h"
|
||||
|
||||
|
||||
/*
|
||||
// Global helper functions
|
||||
enum wxBuildInfoFormat
|
||||
{
|
||||
@ -58,14 +60,14 @@ wxString wxbuildinfo(wxBuildInfoFormat format)
|
||||
}
|
||||
|
||||
return wxbuild;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxScreenshotFrame
|
||||
// ScreenshotFrame
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxScreenshotFrame::wxScreenshotFrame(wxFrame *frame)
|
||||
ScreenshotFrame::ScreenshotFrame(wxFrame *frame)
|
||||
#if SCREENSHOTGEN_USE_AUI
|
||||
: AuiGUIFrame(frame)
|
||||
#else
|
||||
@ -78,7 +80,7 @@ wxScreenshotFrame::wxScreenshotFrame(wxFrame *frame)
|
||||
#endif
|
||||
|
||||
// We will hold one during the whole life time of the main frame
|
||||
m_maskout = new wxCtrlMaskOut();
|
||||
m_maskout = new CtrlMaskOut();
|
||||
|
||||
// At the begining, we are not specifying the rect region
|
||||
capturingRect = false;
|
||||
@ -92,7 +94,7 @@ wxScreenshotFrame::wxScreenshotFrame(wxFrame *frame)
|
||||
#endif
|
||||
}
|
||||
|
||||
wxScreenshotFrame::~wxScreenshotFrame()
|
||||
ScreenshotFrame::~ScreenshotFrame()
|
||||
{
|
||||
delete m_maskout;
|
||||
}
|
||||
@ -106,7 +108,7 @@ wxScreenshotFrame::~wxScreenshotFrame()
|
||||
|
||||
Those customizations will be done here.
|
||||
*/
|
||||
void wxScreenshotFrame::InitFBControls()
|
||||
void ScreenshotFrame::InitFBControls()
|
||||
{
|
||||
// Do the default selection for wxComboBox
|
||||
m_comboBox1->Select(0);
|
||||
@ -141,20 +143,20 @@ void wxScreenshotFrame::InitFBControls()
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxScreenshotFrame - event handlers
|
||||
// ScreenshotFrame - event handlers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxScreenshotFrame::OnClose(wxCloseEvent& WXUNUSED(event))
|
||||
void ScreenshotFrame::OnClose(wxCloseEvent& WXUNUSED(event))
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void wxScreenshotFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
void ScreenshotFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void wxScreenshotFrame::OnSeeScreenshots(wxCommandEvent& WXUNUSED(event))
|
||||
void ScreenshotFrame::OnSeeScreenshots(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString defaultDir = m_maskout->GetDefaultDirectory();
|
||||
|
||||
@ -176,13 +178,18 @@ void wxScreenshotFrame::OnSeeScreenshots(wxCommandEvent& WXUNUSED(event))
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxScreenshotFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||
void ScreenshotFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString msg = wxbuildinfo(long_f);
|
||||
wxMessageBox(msg, _("Welcome to..."));
|
||||
wxAboutDialogInfo info;
|
||||
info.SetName(_("Automatic Screenshot Generator"));
|
||||
info.SetVersion(_("1.0"));
|
||||
info.SetDescription(_("This utility automatically creates screenshots of wxWidgets controls for ues in wxWidgets documentation."));
|
||||
info.SetCopyright(_T("(C) 2008 Utensil Candel"));
|
||||
|
||||
wxAboutBox(info);
|
||||
}
|
||||
|
||||
void wxScreenshotFrame::OnCaptureFullScreen(wxCommandEvent& WXUNUSED(event))
|
||||
void ScreenshotFrame::OnCaptureFullScreen(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
// Create a DC for the whole screen area
|
||||
wxScreenDC dcScreen;
|
||||
@ -194,7 +201,7 @@ void wxScreenshotFrame::OnCaptureFullScreen(wxCommandEvent& WXUNUSED(event))
|
||||
m_maskout->Capture(0, 0, screenWidth, screenHeight, _T("fullscreen"));
|
||||
}
|
||||
|
||||
void wxScreenshotFrame::OnCaptureRect(wxCommandEvent& WXUNUSED(event))
|
||||
void ScreenshotFrame::OnCaptureRect(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
capturingRect = true;
|
||||
wxMenuBar * menubar = this->GetMenuBar();
|
||||
@ -203,12 +210,12 @@ void wxScreenshotFrame::OnCaptureRect(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
wxWindow * thePage = m_notebook1->GetPage(m_notebook1->GetSelection());
|
||||
|
||||
thePage->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( wxCtrlMaskOut::OnLeftButtonDown ), NULL, m_maskout);
|
||||
thePage->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( wxCtrlMaskOut::OnLeftButtonUp ), NULL, m_maskout);
|
||||
thePage->Connect( wxEVT_MOTION, wxMouseEventHandler( wxCtrlMaskOut::OnMouseMoving ), NULL, m_maskout);
|
||||
thePage->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( CtrlMaskOut::OnLeftButtonDown ), NULL, m_maskout);
|
||||
thePage->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( CtrlMaskOut::OnLeftButtonUp ), NULL, m_maskout);
|
||||
thePage->Connect( wxEVT_MOTION, wxMouseEventHandler( CtrlMaskOut::OnMouseMoving ), NULL, m_maskout);
|
||||
}
|
||||
|
||||
void wxScreenshotFrame::OnEndCaptureRect(wxCommandEvent& WXUNUSED(event))
|
||||
void ScreenshotFrame::OnEndCaptureRect(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
capturingRect = false;
|
||||
wxMenuBar * menubar = this->GetMenuBar();
|
||||
@ -217,12 +224,12 @@ void wxScreenshotFrame::OnEndCaptureRect(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
wxWindow * thePage = m_notebook1->GetPage(m_notebook1->GetSelection());
|
||||
|
||||
thePage->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( wxCtrlMaskOut::OnLeftButtonDown ), NULL, m_maskout);
|
||||
thePage->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( wxCtrlMaskOut::OnLeftButtonUp ), NULL, m_maskout);
|
||||
thePage->Disconnect( wxEVT_MOTION, wxMouseEventHandler( wxCtrlMaskOut::OnMouseMoving ), NULL, m_maskout);
|
||||
thePage->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( CtrlMaskOut::OnLeftButtonDown ), NULL, m_maskout);
|
||||
thePage->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( CtrlMaskOut::OnLeftButtonUp ), NULL, m_maskout);
|
||||
thePage->Disconnect( wxEVT_MOTION, wxMouseEventHandler( CtrlMaskOut::OnMouseMoving ), NULL, m_maskout);
|
||||
}
|
||||
|
||||
void wxScreenshotFrame::OnNotebookPageChanging(
|
||||
void ScreenshotFrame::OnNotebookPageChanging(
|
||||
#if SCREENSHOTGEN_USE_AUI
|
||||
wxAuiNotebookEvent& event
|
||||
#else
|
||||
@ -238,14 +245,14 @@ wxNotebookEvent& event
|
||||
|
||||
wxWindow * thePage = m_notebook1->GetPage(event.GetOldSelection());
|
||||
|
||||
thePage->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( wxCtrlMaskOut::OnLeftButtonDown ), NULL, m_maskout);
|
||||
thePage->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( wxCtrlMaskOut::OnLeftButtonUp ), NULL, m_maskout);
|
||||
thePage->Disconnect( wxEVT_MOTION, wxMouseEventHandler( wxCtrlMaskOut::OnMouseMoving ), NULL, m_maskout);
|
||||
thePage->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( CtrlMaskOut::OnLeftButtonDown ), NULL, m_maskout);
|
||||
thePage->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( CtrlMaskOut::OnLeftButtonUp ), NULL, m_maskout);
|
||||
thePage->Disconnect( wxEVT_MOTION, wxMouseEventHandler( CtrlMaskOut::OnMouseMoving ), NULL, m_maskout);
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void wxScreenshotFrame::OnNotebookPageChanged(
|
||||
void ScreenshotFrame::OnNotebookPageChanged(
|
||||
#if SCREENSHOTGEN_USE_AUI
|
||||
wxAuiNotebookEvent& event
|
||||
#else
|
||||
@ -261,14 +268,14 @@ wxNotebookEvent& event
|
||||
|
||||
wxWindow *thePage = m_notebook1->GetPage(event.GetSelection());
|
||||
|
||||
thePage->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( wxCtrlMaskOut::OnLeftButtonDown ), NULL, m_maskout);
|
||||
thePage->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( wxCtrlMaskOut::OnLeftButtonUp ), NULL, m_maskout);
|
||||
thePage->Connect( wxEVT_MOTION, wxMouseEventHandler( wxCtrlMaskOut::OnMouseMoving ), NULL, m_maskout);
|
||||
thePage->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( CtrlMaskOut::OnLeftButtonDown ), NULL, m_maskout);
|
||||
thePage->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( CtrlMaskOut::OnLeftButtonUp ), NULL, m_maskout);
|
||||
thePage->Connect( wxEVT_MOTION, wxMouseEventHandler( CtrlMaskOut::OnMouseMoving ), NULL, m_maskout);
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void wxScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event))
|
||||
void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString dir = wxT("screenshots");
|
||||
|
||||
|
@ -15,10 +15,10 @@
|
||||
#define SCREENSHOTGEN_USE_AUI 0
|
||||
|
||||
|
||||
class wxCtrlMaskOut;
|
||||
class CtrlMaskOut;
|
||||
|
||||
|
||||
class wxScreenshotFrame
|
||||
class ScreenshotFrame
|
||||
#if SCREENSHOTGEN_USE_AUI
|
||||
: public AuiGUIFrame
|
||||
#else
|
||||
@ -26,8 +26,8 @@ class wxScreenshotFrame
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
wxScreenshotFrame(wxFrame *frame);
|
||||
~wxScreenshotFrame();
|
||||
ScreenshotFrame(wxFrame *frame);
|
||||
~ScreenshotFrame();
|
||||
|
||||
protected: // event handlers
|
||||
|
||||
@ -55,7 +55,7 @@ private:
|
||||
|
||||
// Data members
|
||||
bool capturingRect;
|
||||
wxCtrlMaskOut * m_maskout;
|
||||
CtrlMaskOut * m_maskout;
|
||||
};
|
||||
|
||||
#endif // WXSCREENSHOTMAIN_H
|
||||
|
@ -47,7 +47,6 @@
|
||||
richtext.xml
|
||||
bitmaps/wxwin32x32.png
|
||||
bitmaps/bell.png
|
||||
bitmaps/info.png
|
||||
bitmaps/sound.png
|
||||
bitmaps/dropbuth.png
|
||||
bitmaps/dropbutn.png
|
||||
|
Loading…
Reference in New Issue
Block a user