-
Notifications
You must be signed in to change notification settings - Fork 0
/
OptionsDialog.cpp
249 lines (182 loc) · 7.4 KB
/
OptionsDialog.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
/* ----------------------------------------------------------------------------
OptionsDialog.cpp
MIView - Medical Image Viewer
Copyright (C) 2009-2011 Gregory Book
MIView is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------- */
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "OptionsDialog.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include "OptionsDialog.h"
////@begin XPM images
////@end XPM images
/*!
* OptionsDialog type definition
*/
IMPLEMENT_DYNAMIC_CLASS( OptionsDialog, wxDialog )
/*!
* OptionsDialog event table definition
*/
BEGIN_EVENT_TABLE( OptionsDialog, wxDialog )
////@begin OptionsDialog event table entries
////@end OptionsDialog event table entries
END_EVENT_TABLE()
/*!
* OptionsDialog constructors
*/
OptionsDialog::OptionsDialog()
{
Init();
}
OptionsDialog::OptionsDialog( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
Init();
Create(parent, id, caption, pos, size, style);
}
/*!
* OptionsDialog creator
*/
bool OptionsDialog::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin OptionsDialog creation
SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
Centre();
////@end OptionsDialog creation
return true;
}
/*!
* OptionsDialog destructor
*/
OptionsDialog::~OptionsDialog()
{
////@begin OptionsDialog destruction
////@end OptionsDialog destruction
}
/*!
* Member initialisation
*/
void OptionsDialog::Init()
{
////@begin OptionsDialog member initialisation
nbkOptions = NULL;
pnlGeneral = NULL;
chkUseSI = NULL;
radOpenSingle = NULL;
radOpenAll = NULL;
radOpenPrefix = NULL;
pnlFileAssoc = NULL;
chkDicom = NULL;
chkAnalyze = NULL;
chkNifti = NULL;
////@end OptionsDialog member initialisation
}
/*!
* Control creation for OptionsDialog
*/
void OptionsDialog::CreateControls()
{
////@begin OptionsDialog content construction
OptionsDialog* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
itemDialog1->SetSizer(itemBoxSizer2);
nbkOptions = new wxNotebook( itemDialog1, ID_NOTEBOOK_OPTIONS, wxDefaultPosition, wxDefaultSize, wxNB_DEFAULT|wxNB_TOP );
pnlGeneral = new wxPanel( nbkOptions, ID_PANEL_GENERAL, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
pnlGeneral->SetSizer(itemBoxSizer5);
chkUseSI = new wxCheckBox( pnlGeneral, ID_CHECK_USE_SI, _("Use S,I (Superior/Inferior) orientation labels instead of H,F (Head/Feet)"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
chkUseSI->SetValue(false);
itemBoxSizer5->Add(chkUseSI, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
itemBoxSizer5->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxStaticBox* itemStaticBoxSizer8Static = new wxStaticBox(pnlGeneral, wxID_ANY, _("Default Action for Opening Files"));
wxStaticBoxSizer* itemStaticBoxSizer8 = new wxStaticBoxSizer(itemStaticBoxSizer8Static, wxVERTICAL);
itemBoxSizer5->Add(itemStaticBoxSizer8, 0, wxALIGN_LEFT|wxALL, 5);
radOpenSingle = new wxRadioButton( pnlGeneral, ID_RADIO_OPENSINGLE, _("Open single image"), wxDefaultPosition, wxDefaultSize, 0 );
radOpenSingle->SetValue(false);
itemStaticBoxSizer8->Add(radOpenSingle, 0, wxALIGN_LEFT|wxALL, 5);
radOpenAll = new wxRadioButton( pnlGeneral, ID_RADIO_OPENALLIMAGES, _("Open all images"), wxDefaultPosition, wxDefaultSize, 0 );
radOpenAll->SetValue(false);
itemStaticBoxSizer8->Add(radOpenAll, 0, wxALIGN_LEFT|wxALL, 5);
radOpenPrefix = new wxRadioButton( pnlGeneral, ID_RADIO_OPENPREFIX, _("Open all images with closest prefix"), wxDefaultPosition, wxDefaultSize, 0 );
radOpenPrefix->SetValue(false);
itemStaticBoxSizer8->Add(radOpenPrefix, 0, wxALIGN_LEFT|wxALL, 5);
nbkOptions->AddPage(pnlGeneral, _("General"));
pnlFileAssoc = new wxPanel( nbkOptions, ID_PANEL_FILE_ASSOC, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
pnlFileAssoc->SetSizer(itemBoxSizer13);
wxStaticText* itemStaticText14 = new wxStaticText( pnlFileAssoc, wxID_STATIC, _("Associate MIView with the following filetypes"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText14->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma")));
itemBoxSizer13->Add(itemStaticText14, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5);
chkDicom = new wxCheckBox( pnlFileAssoc, ID_CHECK_DICOM, _(".dcm .acr (Dicom)"), wxDefaultPosition, wxDefaultSize, 0 );
chkDicom->SetValue(false);
itemBoxSizer13->Add(chkDicom, 0, wxALIGN_LEFT|wxALL, 5);
chkAnalyze = new wxCheckBox( pnlFileAssoc, ID_CHECK_ANALYZE, _(".img .hdr (Analyze)"), wxDefaultPosition, wxDefaultSize, 0 );
chkAnalyze->SetValue(false);
itemBoxSizer13->Add(chkAnalyze, 0, wxALIGN_LEFT|wxALL, 5);
chkNifti = new wxCheckBox( pnlFileAssoc, ID_CHECK_NIFTI, _(".nii (Nifti)"), wxDefaultPosition, wxDefaultSize, 0 );
chkNifti->SetValue(false);
itemBoxSizer13->Add(chkNifti, 0, wxALIGN_LEFT|wxALL, 5);
nbkOptions->AddPage(pnlFileAssoc, _("File Associations"));
itemBoxSizer2->Add(nbkOptions, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxStdDialogButtonSizer* itemStdDialogButtonSizer18 = new wxStdDialogButtonSizer;
itemBoxSizer2->Add(itemStdDialogButtonSizer18, 0, wxALIGN_RIGHT|wxALL, 5);
wxButton* itemButton19 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
itemStdDialogButtonSizer18->AddButton(itemButton19);
wxButton* itemButton20 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemStdDialogButtonSizer18->AddButton(itemButton20);
itemStdDialogButtonSizer18->Realize();
////@end OptionsDialog content construction
}
/*!
* Should we show tooltips?
*/
bool OptionsDialog::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap OptionsDialog::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin OptionsDialog bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end OptionsDialog bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon OptionsDialog::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin OptionsDialog icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end OptionsDialog icon retrieval
}