Mercurial > mercurial > hgweb_madnm.cgi
diff include/custom.h @ 0:2f5584f0d127
first commit.
author | pyon@macmini |
---|---|
date | Sat, 08 Jun 2019 16:21:40 +0900 |
parents | |
children | f40a65687079 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/custom.h Sat Jun 08 16:21:40 2019 +0900 @@ -0,0 +1,58 @@ +// Filename : custom.h +// Last Change: 2019-06-07 ‹à 16:39:35. +// +#pragma once + +#include <wx/wx.h> +#include <wx/colour.h> +#include <wx/font.h> +#include <wx/bitmap.h> +#include <wx/image.h> +#include <wx/spinctrl.h> +#include "wx/dcclient.h" + +class LookWindow : public wxWindow +{ + DECLARE_EVENT_TABLE() + private: + int m_x0, m_y0, m_w0, m_h0; // default mask1 rect + int m_x1, m_y1, m_x2, m_y2; // variable mask1 rect + + int m_s0, m_t0, m_u0, m_v0; // default mask2 rect + int m_s1, m_t1, m_s2, m_t2; // variable mask2 rect + + int m_w, m_h, m_dcw, m_dch; + int m_scalex, m_scaley; + + wxSpinCtrl *m_spnx, *m_spny, *m_spnw, *m_spnh; + + wxString m_file; + wxBitmap m_bitmap; + int m_masknum = 1; + + public: + LookWindow( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL ); + ~LookWindow(); + + void OnPaint( wxPaintEvent& event ); + void OnMotion( wxMouseEvent& event ); + void OnLeftDown( wxMouseEvent& event ); + void OnLeftUp( wxMouseEvent& event ); + void OnRightDown( wxMouseEvent& event ); + void OnRightUp( wxMouseEvent& event ); + + void SetDefaultParams( int i, int w, int h, int dcw, int dch ); + void AddMask( void ); + void SetFile( wxString file ) { m_file = file; }; + void AssignSpinControl( wxSpinCtrl* spnx, wxSpinCtrl* spny, wxSpinCtrl* spnw, wxSpinCtrl* spnh ); + + void LoadImage( void ); + void ReloadImage( void ); + void ResetMask1( void ); + void ResetMask2( void ); + void DoMask1( void ); + void DoMask2( void ); + wxRect GetRealMask1Rect( void ); + wxRect GetRealMask2Rect( void ); +}; +