-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwxInvertDialog.cpp
89 lines (77 loc) · 3.55 KB
/
wxInvertDialog.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
/***************************************************************
* Plugin: XPMEditor for Code::Blocks
* Name: wxInvertDialog.cpp
* Purpose: A dialog box for inverting the colours the Image or the selection - code
* Author: Seb ([email protected])
* Created: 2010-05-19
* Copyright: Seb ()
* License: GPL 3.0
**************************************************************/
#include "wxInvertDialog.h"
//(*InternalHeaders(wxInvertDialog)
#include <wx/intl.h>
#include <wx/string.h>
//*)
//(*IdInit(wxInvertDialog)
const long wxInvertDialog::ID_STATICTEXT1 = wxNewId();
const long wxInvertDialog::ID_RADIOBUTTON4 = wxNewId();
const long wxInvertDialog::ID_RADIOBUTTON3 = wxNewId();
const long wxInvertDialog::ID_BUTTON1 = wxNewId();
const long wxInvertDialog::ID_BUTTON2 = wxNewId();
//*)
BEGIN_EVENT_TABLE(wxInvertDialog,wxDialog)
//(*EventTable(wxInvertDialog)
//*)
END_EVENT_TABLE()
wxInvertDialog::wxInvertDialog(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
{
//(*Initialize(wxInvertDialog)
wxBoxSizer* BoxSizer2;
wxBoxSizer* BoxSizer1;
wxBoxSizer* BoxSizer3;
Create(parent, id, _("INVERT COLOURS"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER, _T("id"));
SetClientSize(wxDefaultSize);
Move(wxDefaultPosition);
BoxSizer1 = new wxBoxSizer(wxVERTICAL);
StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("The colours of the Image or of the Selection will be inverted.\nPlease indicate what should be inverted: the Selection or the whole Image."), wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER, _T("ID_STATICTEXT1"));
BoxSizer1->Add(StaticText1, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
BoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
RadioButton4 = new wxRadioButton(this, ID_RADIOBUTTON4, _("Selection"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP, wxDefaultValidator, _T("ID_RADIOBUTTON4"));
BoxSizer3->Add(RadioButton4, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
RadioButton3 = new wxRadioButton(this, ID_RADIOBUTTON3, _("Image"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_RADIOBUTTON3"));
RadioButton3->SetValue(true);
BoxSizer3->Add(RadioButton3, 1, wxALL|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
BoxSizer1->Add(BoxSizer3, 0, wxALL|wxEXPAND|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 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)&wxInvertDialog::OnButtonOKClick);
Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&wxInvertDialog::OnButtonCancelClick);
Connect(wxID_ANY,wxEVT_CLOSE_WINDOW,(wxObjectEventFunction)&wxInvertDialog::OnClose);
//*)
}
wxInvertDialog::~wxInvertDialog()
{
//(*Destroy(wxInvertDialog)
//*)
}
void wxInvertDialog::OnClose(wxCloseEvent& event)
{
EndModal(1);
}
void wxInvertDialog::OnButtonCancelClick(wxCommandEvent& event)
{
EndModal(1);
}
void wxInvertDialog::OnButtonOKClick(wxCommandEvent& event)
{
EndModal(0);
}