]>
Commit | Line | Data |
---|---|---|
0d5eda9c FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: ctrlmaskout.h | |
4bae10bd | 3 | // Purpose: Defines the CtrlMaskOut class |
0d5eda9c FM |
4 | // Author: Utensil Candel (UtensilCandel@@gmail.com) |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | #ifndef WX_CTRL_MASK_OUT | |
10 | #define WX_CTRL_MASK_OUT | |
11 | ||
12 | #include <wx/frame.h> | |
13 | ||
14 | ||
15 | // ---------------------------------------------------------------------------- | |
4bae10bd | 16 | // class CtrlMaskOut |
0d5eda9c FM |
17 | // ---------------------------------------------------------------------------- |
18 | ||
4bae10bd | 19 | class CtrlMaskOut : public wxEvtHandler |
0d5eda9c FM |
20 | { |
21 | public: | |
4bae10bd FM |
22 | CtrlMaskOut(); |
23 | ~CtrlMaskOut(); | |
0d5eda9c FM |
24 | |
25 | public: | |
26 | void OnLeftButtonDown(wxMouseEvent& event); | |
27 | void OnLeftButtonUp(wxMouseEvent& event); | |
28 | void OnMouseMoving(wxMouseEvent& event); | |
29 | ||
30 | void Capture(wxRect rect, wxString fileName); | |
31 | void Capture(int x, int y, int width, int height, wxString fileName); | |
32 | ||
60a2264d FM |
33 | wxString GetDefaultDirectory() const |
34 | { return m_defaultDir; } | |
35 | wxString GetDefaultDirectoryAbsPath() const | |
36 | { | |
37 | wxFileName output = wxFileName::DirName(GetDefaultDirectory()); | |
38 | output.MakeAbsolute(); | |
39 | return output.GetFullPath(); | |
40 | } | |
0d5eda9c FM |
41 | |
42 | private: | |
43 | // Helper functions | |
44 | void CreateMask(wxWindow* parent); | |
45 | void DestroyMask(); | |
46 | void DetermineCtrlNameAndRect(); | |
47 | ||
48 | void OnTimingFinished(wxTimerEvent& event); | |
49 | ||
50 | ||
51 | // Data members | |
52 | wxString m_defaultDir; | |
53 | ||
54 | wxString m_controlName; | |
55 | wxRect m_currentRect; | |
56 | wxCoord m_inflateBorder; | |
57 | ||
58 | wxFrame * m_mask; | |
59 | ||
60 | bool m_isTiming; | |
61 | }; | |
62 | ||
63 | #endif // WX_CTRL_MASK_OUT | |
64 | ||
65 |