0
|
1 // Filename : custom.h
|
1
|
2 // Last Change: 2019-06-09 Sun 16:57:24.
|
0
|
3 //
|
|
4 #pragma once
|
|
5
|
|
6 #include <wx/wx.h>
|
|
7 #include <wx/colour.h>
|
|
8 #include <wx/font.h>
|
|
9 #include <wx/bitmap.h>
|
|
10 #include <wx/image.h>
|
|
11 #include <wx/spinctrl.h>
|
1
|
12 #include <wx/listctrl.h>
|
|
13 #include <wx/dcclient.h>
|
|
14
|
|
15 #include "util.h"
|
0
|
16
|
|
17 class LookWindow : public wxWindow
|
|
18 {
|
|
19 DECLARE_EVENT_TABLE()
|
|
20 private:
|
|
21 int m_x0, m_y0, m_w0, m_h0; // default mask1 rect
|
|
22 int m_x1, m_y1, m_x2, m_y2; // variable mask1 rect
|
|
23
|
|
24 int m_s0, m_t0, m_u0, m_v0; // default mask2 rect
|
|
25 int m_s1, m_t1, m_s2, m_t2; // variable mask2 rect
|
|
26
|
|
27 int m_w, m_h, m_dcw, m_dch;
|
|
28 int m_scalex, m_scaley;
|
|
29
|
|
30 wxSpinCtrl *m_spnx, *m_spny, *m_spnw, *m_spnh;
|
|
31
|
|
32 wxString m_file;
|
|
33 wxBitmap m_bitmap;
|
|
34 int m_masknum = 1;
|
|
35
|
|
36 public:
|
|
37 LookWindow( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL );
|
|
38 ~LookWindow();
|
|
39
|
|
40 void OnPaint( wxPaintEvent& event );
|
|
41 void OnMotion( wxMouseEvent& event );
|
|
42 void OnLeftDown( wxMouseEvent& event );
|
|
43 void OnLeftUp( wxMouseEvent& event );
|
|
44 void OnRightDown( wxMouseEvent& event );
|
|
45 void OnRightUp( wxMouseEvent& event );
|
|
46
|
|
47 void SetDefaultParams( int i, int w, int h, int dcw, int dch );
|
|
48 void AddMask( void );
|
|
49 void SetFile( wxString file ) { m_file = file; };
|
|
50 void AssignSpinControl( wxSpinCtrl* spnx, wxSpinCtrl* spny, wxSpinCtrl* spnw, wxSpinCtrl* spnh );
|
|
51
|
|
52 void LoadImage( void );
|
|
53 void ReloadImage( void );
|
|
54 void ResetMask1( void );
|
|
55 void ResetMask2( void );
|
|
56 void DoMask1( void );
|
|
57 void DoMask2( void );
|
|
58 wxRect GetRealMask1Rect( void );
|
|
59 wxRect GetRealMask2Rect( void );
|
|
60 };
|
|
61
|
1
|
62 class ListThumbnail : public wxListView
|
|
63 {
|
|
64 DECLARE_EVENT_TABLE()
|
|
65 private:
|
|
66 FileList m_filelist;
|
|
67 wxImageList m_imageListZ1;
|
|
68 wxImageList m_imageListZ2;
|
|
69 wxImageList m_imageListZ3;
|
|
70
|
|
71 public:
|
|
72 ListThumbnail( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxLC_ICON );
|
|
73 ~ListThumbnail();
|
|
74
|
|
75 int Reload( void );
|
|
76 void SetDirectory( wxString dir ) { m_filelist.SetDirectory( dir ); };
|
|
77 //void OnDClick( wx);
|
|
78 };
|
|
79
|