KiCad PCB EDA Suite
DIALOG_IMAGE_EDITOR_BASE Class Reference

Class DIALOG_IMAGE_EDITOR_BASE. More...

#include <dialog_image_editor_base.h>

Inheritance diagram for DIALOG_IMAGE_EDITOR_BASE:
DIALOG_IMAGE_EDITOR

Public Member Functions

 DIALOG_IMAGE_EDITOR_BASE (wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Image Editor"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(340, 299), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
 
 ~DIALOG_IMAGE_EDITOR_BASE ()
 

Protected Member Functions

virtual void OnRedrawPanel (wxPaintEvent &event)
 
virtual void OnMirrorX_click (wxCommandEvent &event)
 
virtual void OnMirrorY_click (wxCommandEvent &event)
 
virtual void OnRotateClick (wxCommandEvent &event)
 
virtual void OnGreyScaleConvert (wxCommandEvent &event)
 
virtual void OnHalfSize (wxCommandEvent &event)
 
virtual void OnUndoLastChange (wxCommandEvent &event)
 
virtual void OnCancel_Button (wxCommandEvent &event)
 
virtual void OnOK_Button (wxCommandEvent &event)
 

Protected Attributes

wxPanel * m_panelDraw
 
wxButton * m_buttonMirrorX
 
wxButton * m_buttonMirrorY
 
wxButton * m_buttonRotate
 
wxButton * m_buttonGrey
 
wxButton * m_buttonHalfSize
 
wxButton * m_buttonUndoLast
 
wxStaticText * m_staticTextScale
 
wxTextCtrl * m_textCtrlScale
 
wxStdDialogButtonSizer * m_sdbSizer1
 
wxButton * m_sdbSizer1OK
 
wxButton * m_sdbSizer1Cancel
 

Detailed Description

Class DIALOG_IMAGE_EDITOR_BASE.

Definition at line 32 of file dialog_image_editor_base.h.

Constructor & Destructor Documentation

DIALOG_IMAGE_EDITOR_BASE::DIALOG_IMAGE_EDITOR_BASE ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxString &  title = _("Image Editor"),
const wxPoint pos = wxDefaultPosition,
const wxSize &  size = wxSize( 340,299 ),
long  style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER 
)

Definition at line 12 of file dialog_image_editor_base.cpp.

References m_buttonGrey, m_buttonHalfSize, m_buttonMirrorX, m_buttonMirrorY, m_buttonRotate, m_buttonUndoLast, m_panelDraw, m_sdbSizer1, m_sdbSizer1Cancel, m_sdbSizer1OK, m_staticTextScale, m_textCtrlScale, OnCancel_Button(), OnGreyScaleConvert(), OnHalfSize(), OnMirrorX_click(), OnMirrorY_click(), OnOK_Button(), OnRedrawPanel(), OnRotateClick(), and OnUndoLastChange().

12  : wxDialog( parent, id, title, pos, size, style )
13 {
14  this->SetSizeHints( wxDefaultSize, wxDefaultSize );
15 
16  wxBoxSizer* bSizerMain;
17  bSizerMain = new wxBoxSizer( wxVERTICAL );
18 
19  wxBoxSizer* bUpperSizer;
20  bUpperSizer = new wxBoxSizer( wxVERTICAL );
21 
22  wxBoxSizer* bSizerLeft;
23  bSizerLeft = new wxBoxSizer( wxHORIZONTAL );
24 
25  m_panelDraw = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE|wxSIMPLE_BORDER|wxTAB_TRAVERSAL );
26  m_panelDraw->SetMinSize( wxSize( 256,256 ) );
27 
28  bSizerLeft->Add( m_panelDraw, 1, wxEXPAND | wxALL, 5 );
29 
30  wxBoxSizer* bSizerRight;
31  bSizerRight = new wxBoxSizer( wxVERTICAL );
32 
33  m_buttonMirrorX = new wxButton( this, wxID_ANY, _("Mirror X"), wxDefaultPosition, wxDefaultSize, 0 );
34  bSizerRight->Add( m_buttonMirrorX, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
35 
36  m_buttonMirrorY = new wxButton( this, wxID_ANY, _("Mirror Y"), wxDefaultPosition, wxDefaultSize, 0 );
37  bSizerRight->Add( m_buttonMirrorY, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
38 
39  m_buttonRotate = new wxButton( this, wxID_ANY, _("Rotate"), wxDefaultPosition, wxDefaultSize, 0 );
40  bSizerRight->Add( m_buttonRotate, 0, wxEXPAND|wxALL, 5 );
41 
42  m_buttonGrey = new wxButton( this, wxID_ANY, _("Grey"), wxDefaultPosition, wxDefaultSize, 0 );
43  bSizerRight->Add( m_buttonGrey, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
44 
45  m_buttonHalfSize = new wxButton( this, wxID_ANY, _("Half Size"), wxDefaultPosition, wxDefaultSize, 0 );
46  m_buttonHalfSize->SetDefault();
47  bSizerRight->Add( m_buttonHalfSize, 0, wxALL|wxEXPAND, 5 );
48 
49  m_buttonUndoLast = new wxButton( this, wxID_ANY, _("Undo Last"), wxDefaultPosition, wxDefaultSize, 0 );
50  bSizerRight->Add( m_buttonUndoLast, 0, wxALL|wxEXPAND, 5 );
51 
52  m_staticTextScale = new wxStaticText( this, wxID_ANY, _("Image Scale:"), wxDefaultPosition, wxDefaultSize, 0 );
53  m_staticTextScale->Wrap( -1 );
54  bSizerRight->Add( m_staticTextScale, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
55 
56  m_textCtrlScale = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
57  bSizerRight->Add( m_textCtrlScale, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
58 
59  bSizerLeft->Add( bSizerRight, 0, wxEXPAND, 5 );
60 
61  bUpperSizer->Add( bSizerLeft, 1, wxEXPAND, 5 );
62 
63  bSizerMain->Add( bUpperSizer, 1, wxEXPAND, 5 );
64 
65  m_sdbSizer1 = new wxStdDialogButtonSizer();
66  m_sdbSizer1OK = new wxButton( this, wxID_OK );
67  m_sdbSizer1->AddButton( m_sdbSizer1OK );
68  m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
69  m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
70  m_sdbSizer1->Realize();
71  bSizerMain->Add( m_sdbSizer1, 0, wxALIGN_RIGHT, 5 );
72 
73  this->SetSizer( bSizerMain );
74  this->Layout();
75 
76  this->Centre( wxBOTH );
77 
78  // Connect Events
79  m_panelDraw->Connect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnRedrawPanel ), NULL, this );
80  m_buttonMirrorX->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnMirrorX_click ), NULL, this );
81  m_buttonMirrorY->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnMirrorY_click ), NULL, this );
82  m_buttonRotate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnRotateClick ), NULL, this );
83  m_buttonGrey->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnGreyScaleConvert ), NULL, this );
84  m_buttonHalfSize->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnHalfSize ), NULL, this );
85  m_buttonUndoLast->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnUndoLastChange ), NULL, this );
86  m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnCancel_Button ), NULL, this );
87  m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnOK_Button ), NULL, this );
88 }
virtual void OnOK_Button(wxCommandEvent &event)
virtual void OnRotateClick(wxCommandEvent &event)
virtual void OnMirrorY_click(wxCommandEvent &event)
wxStdDialogButtonSizer * m_sdbSizer1
virtual void OnCancel_Button(wxCommandEvent &event)
virtual void OnMirrorX_click(wxCommandEvent &event)
virtual void OnUndoLastChange(wxCommandEvent &event)
virtual void OnRedrawPanel(wxPaintEvent &event)
virtual void OnHalfSize(wxCommandEvent &event)
virtual void OnGreyScaleConvert(wxCommandEvent &event)
DIALOG_IMAGE_EDITOR_BASE::~DIALOG_IMAGE_EDITOR_BASE ( )

Definition at line 90 of file dialog_image_editor_base.cpp.

References m_buttonGrey, m_buttonHalfSize, m_buttonMirrorX, m_buttonMirrorY, m_buttonRotate, m_buttonUndoLast, m_panelDraw, m_sdbSizer1Cancel, m_sdbSizer1OK, OnCancel_Button(), OnGreyScaleConvert(), OnHalfSize(), OnMirrorX_click(), OnMirrorY_click(), OnOK_Button(), OnRedrawPanel(), OnRotateClick(), and OnUndoLastChange().

91 {
92  // Disconnect Events
93  m_panelDraw->Disconnect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnRedrawPanel ), NULL, this );
94  m_buttonMirrorX->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnMirrorX_click ), NULL, this );
95  m_buttonMirrorY->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnMirrorY_click ), NULL, this );
96  m_buttonRotate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnRotateClick ), NULL, this );
97  m_buttonGrey->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnGreyScaleConvert ), NULL, this );
98  m_buttonHalfSize->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnHalfSize ), NULL, this );
99  m_buttonUndoLast->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnUndoLastChange ), NULL, this );
100  m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnCancel_Button ), NULL, this );
101  m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnOK_Button ), NULL, this );
102 
103 }
virtual void OnOK_Button(wxCommandEvent &event)
virtual void OnRotateClick(wxCommandEvent &event)
virtual void OnMirrorY_click(wxCommandEvent &event)
virtual void OnCancel_Button(wxCommandEvent &event)
virtual void OnMirrorX_click(wxCommandEvent &event)
virtual void OnUndoLastChange(wxCommandEvent &event)
virtual void OnRedrawPanel(wxPaintEvent &event)
virtual void OnHalfSize(wxCommandEvent &event)
virtual void OnGreyScaleConvert(wxCommandEvent &event)

Member Function Documentation

virtual void DIALOG_IMAGE_EDITOR_BASE::OnCancel_Button ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in DIALOG_IMAGE_EDITOR.

Definition at line 58 of file dialog_image_editor_base.h.

Referenced by DIALOG_IMAGE_EDITOR_BASE(), and ~DIALOG_IMAGE_EDITOR_BASE().

58 { event.Skip(); }
virtual void DIALOG_IMAGE_EDITOR_BASE::OnGreyScaleConvert ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in DIALOG_IMAGE_EDITOR.

Definition at line 55 of file dialog_image_editor_base.h.

Referenced by DIALOG_IMAGE_EDITOR_BASE(), and ~DIALOG_IMAGE_EDITOR_BASE().

55 { event.Skip(); }
virtual void DIALOG_IMAGE_EDITOR_BASE::OnHalfSize ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in DIALOG_IMAGE_EDITOR.

Definition at line 56 of file dialog_image_editor_base.h.

Referenced by DIALOG_IMAGE_EDITOR_BASE(), and ~DIALOG_IMAGE_EDITOR_BASE().

56 { event.Skip(); }
virtual void DIALOG_IMAGE_EDITOR_BASE::OnMirrorX_click ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in DIALOG_IMAGE_EDITOR.

Definition at line 52 of file dialog_image_editor_base.h.

Referenced by DIALOG_IMAGE_EDITOR_BASE(), and ~DIALOG_IMAGE_EDITOR_BASE().

52 { event.Skip(); }
virtual void DIALOG_IMAGE_EDITOR_BASE::OnMirrorY_click ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in DIALOG_IMAGE_EDITOR.

Definition at line 53 of file dialog_image_editor_base.h.

Referenced by DIALOG_IMAGE_EDITOR_BASE(), and ~DIALOG_IMAGE_EDITOR_BASE().

53 { event.Skip(); }
virtual void DIALOG_IMAGE_EDITOR_BASE::OnOK_Button ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in DIALOG_IMAGE_EDITOR.

Definition at line 59 of file dialog_image_editor_base.h.

Referenced by DIALOG_IMAGE_EDITOR_BASE(), and ~DIALOG_IMAGE_EDITOR_BASE().

59 { event.Skip(); }
virtual void DIALOG_IMAGE_EDITOR_BASE::OnRedrawPanel ( wxPaintEvent &  event)
inlineprotectedvirtual

Reimplemented in DIALOG_IMAGE_EDITOR.

Definition at line 51 of file dialog_image_editor_base.h.

Referenced by DIALOG_IMAGE_EDITOR_BASE(), and ~DIALOG_IMAGE_EDITOR_BASE().

51 { event.Skip(); }
virtual void DIALOG_IMAGE_EDITOR_BASE::OnRotateClick ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in DIALOG_IMAGE_EDITOR.

Definition at line 54 of file dialog_image_editor_base.h.

Referenced by DIALOG_IMAGE_EDITOR_BASE(), and ~DIALOG_IMAGE_EDITOR_BASE().

54 { event.Skip(); }
virtual void DIALOG_IMAGE_EDITOR_BASE::OnUndoLastChange ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in DIALOG_IMAGE_EDITOR.

Definition at line 57 of file dialog_image_editor_base.h.

Referenced by DIALOG_IMAGE_EDITOR_BASE(), and ~DIALOG_IMAGE_EDITOR_BASE().

57 { event.Skip(); }

Member Data Documentation

wxButton* DIALOG_IMAGE_EDITOR_BASE::m_buttonGrey
protected
wxButton* DIALOG_IMAGE_EDITOR_BASE::m_buttonHalfSize
protected
wxButton* DIALOG_IMAGE_EDITOR_BASE::m_buttonMirrorX
protected
wxButton* DIALOG_IMAGE_EDITOR_BASE::m_buttonMirrorY
protected
wxButton* DIALOG_IMAGE_EDITOR_BASE::m_buttonRotate
protected
wxStdDialogButtonSizer* DIALOG_IMAGE_EDITOR_BASE::m_sdbSizer1
protected

Definition at line 46 of file dialog_image_editor_base.h.

Referenced by DIALOG_IMAGE_EDITOR_BASE().

wxButton* DIALOG_IMAGE_EDITOR_BASE::m_sdbSizer1Cancel
protected
wxButton* DIALOG_IMAGE_EDITOR_BASE::m_sdbSizer1OK
protected
wxStaticText* DIALOG_IMAGE_EDITOR_BASE::m_staticTextScale
protected

Definition at line 44 of file dialog_image_editor_base.h.

Referenced by DIALOG_IMAGE_EDITOR_BASE().

wxTextCtrl* DIALOG_IMAGE_EDITOR_BASE::m_textCtrlScale
protected

The documentation for this class was generated from the following files: