-
Notifications
You must be signed in to change notification settings - Fork 1
/
wxMirror.cpp
103 lines (91 loc) · 4.31 KB
/
wxMirror.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/***************************************************************
* Plugin: XPMEditor for Code::Blocks
* Name: wxMirror.cpp
* Purpose: A dialog box for flipping the Image or the selection - code
* Author: Seb ([email protected])
* Created: 2010-05-19
* Copyright: Seb ()
* License: GPL 3.0
**************************************************************/
#include "wxMirror.h"
//(*InternalHeaders(wxMirror)
#include <wx/intl.h>
#include <wx/string.h>
//*)
//(*IdInit(wxMirror)
const long wxMirror::ID_STATICTEXT1 = wxNewId();
const long wxMirror::ID_RADIOBUTTON1 = wxNewId();
const long wxMirror::ID_RADIOBUTTON2 = wxNewId();
const long wxMirror::ID_RADIOBUTTON3 = wxNewId();
const long wxMirror::ID_RADIOBUTTON4 = wxNewId();
const long wxMirror::ID_BUTTON1 = wxNewId();
const long wxMirror::ID_BUTTON2 = wxNewId();
//*)
BEGIN_EVENT_TABLE(wxMirror,wxDialog)
//(*EventTable(wxMirror)
//*)
END_EVENT_TABLE()
wxMirror::wxMirror(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
{
//(*Initialize(wxMirror)
wxBoxSizer* BoxSizer4;
wxBoxSizer* BoxSizer5;
wxBoxSizer* BoxSizer2;
wxBoxSizer* BoxSizer1;
wxBoxSizer* BoxSizer3;
Create(parent, id, _("ORIENTATION"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER, _T("id"));
SetClientSize(wxDefaultSize);
Move(wxDefaultPosition);
BoxSizer1 = new wxBoxSizer(wxVERTICAL);
StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("Please select the mirror orientation: horizontal or vertical."), wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER, _T("ID_STATICTEXT1"));
BoxSizer1->Add(StaticText1, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
BoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
BoxSizer4 = new wxBoxSizer(wxVERTICAL);
RadioButton1 = new wxRadioButton(this, ID_RADIOBUTTON1, _("Horizontal Mirror"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP, wxDefaultValidator, _T("ID_RADIOBUTTON1"));
RadioButton1->SetValue(true);
BoxSizer4->Add(RadioButton1, 0, wxALL|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
RadioButton2 = new wxRadioButton(this, ID_RADIOBUTTON2, _("Vertical Mirror"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_RADIOBUTTON2"));
BoxSizer4->Add(RadioButton2, 0, wxALL|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
BoxSizer3->Add(BoxSizer4, 0, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 0);
BoxSizer3->Add(-1,-1,1, wxALL|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
BoxSizer5 = new wxBoxSizer(wxVERTICAL);
RadioButton3 = new wxRadioButton(this, ID_RADIOBUTTON3, _("Image"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP, wxDefaultValidator, _T("ID_RADIOBUTTON3"));
RadioButton3->SetValue(true);
BoxSizer5->Add(RadioButton3, 1, wxALL|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
RadioButton4 = new wxRadioButton(this, ID_RADIOBUTTON4, _("Selection"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_RADIOBUTTON4"));
BoxSizer5->Add(RadioButton4, 1, wxALL|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
BoxSizer3->Add(BoxSizer5, 0, wxALL|wxEXPAND|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 0);
BoxSizer1->Add(BoxSizer3, 0, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 0);
BoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
Button1 = new wxButton(this, ID_BUTTON1, _("OK"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
BoxSizer2->Add(Button1, 1, wxALL|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
BoxSizer2->Add(-1,-1,1, wxALL|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
Button2 = new wxButton(this, ID_BUTTON2, _("CANCEL"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON2"));
BoxSizer2->Add(Button2, 1, wxALL|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
BoxSizer1->Add(BoxSizer2, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 0);
SetSizer(BoxSizer1);
BoxSizer1->Fit(this);
BoxSizer1->SetSizeHints(this);
Center();
Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&wxMirror::OnButtonOKClick);
Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&wxMirror::OnCancelButton);
Connect(wxID_ANY,wxEVT_CLOSE_WINDOW,(wxObjectEventFunction)&wxMirror::OnClose);
//*)
}
wxMirror::~wxMirror()
{
//(*Destroy(wxMirror)
//*)
}
void wxMirror::OnCancelButton(wxCommandEvent& event)
{
EndModal(1);
}
void wxMirror::OnButtonOKClick(wxCommandEvent& event)
{
EndModal(0);
}
void wxMirror::OnClose(wxCloseEvent& event)
{
EndModal(1);
}