-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathUiDiskFactory.cpp
620 lines (495 loc) · 20.6 KB
/
UiDiskFactory.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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "IoCardDisk.h" // disk access routines
#include "Ui.h" // emulator interface
#include "UiDiskFactory.h"
#include "UiSystem.h" // sharing info between UI_wxgui modules
#include "Wvd.h"
#include "host.h" // for Config* functions
#include "system2200.h" // disk access routines
#include <wx/notebook.h> // wxNotebook
// define to 1 to have a static box drawn around the disk properties
// define to 0 to have a heading line over the disk properties
// no functional difference, just appearance tuning
#ifdef __WXMAC__
#define STATICBOX_DISK_PROPS 1
#else
#define STATICBOX_DISK_PROPS 0
#endif
// IDs for the controls and the menu commands
enum
{
ID_BTN_Cancel = 1,
ID_BTN_Save,
ID_BTN_SaveAs,
};
static constexpr struct disk_choice_t {
const char *description;
int disk_type;
int platters;
int sectors_per_platter;
} disk_choices[] = {
// tracks*sectors*sides
{ "PCS 5.25\" floppy disk (88 KB)", Wvd::DISKTYPE_FD5, 1, 35*10 }, // = 350
{ "PCS 5.25\" DSDD floppy disk (320 KB)", Wvd::DISKTYPE_FD5_DD, 1, 40*16*2 }, // = 1280
{ "PCS 5.25\" DSHD floppy disk (1040 KB)", Wvd::DISKTYPE_FD5_HD, 1, 80*26*2 }, // = 4160
{ "2270 8\" floppy disk (260 KB)", Wvd::DISKTYPE_FD8, 1, 64*16 }, // = 1024
{ "2270A 8\" floppy disk (308 KB)", Wvd::DISKTYPE_FD8, 1, 77*16 }, // = 1232
{ "2260 5 MB disk", Wvd::DISKTYPE_HD60, 1, 816*24 }, // = 19584
{ "2260 8 MB disk", Wvd::DISKTYPE_HD60, 1, 32767 }, // damn -- partial track. 32760 would have been best
{ "2280-1 13 MB * 1 platter disk", Wvd::DISKTYPE_HD80, 1, 822*64 }, // = 52608
{ "2280-3 13 MB * 3 platter disk", Wvd::DISKTYPE_HD80, 3, 822*64 }, // = 52608
{ "2280-5 13 MB * 5 platter disk", Wvd::DISKTYPE_HD80, 5, 822*64 }, // = 52608
// these are real products described in the document "CS-2200 Ramblings.pdf", page 21:
// { "DS-20 10 MB * 2 platter disk", Wvd::DISKTYPE_HD80, 2, 640*64 }, // = 40960
// { "DS-32 16 MB * 2 platter disk", Wvd::DISKTYPE_HD80, 2, 1023*64 }, // = 65472 (65536 is too big)
// { "DS-64 16 MB * 4 platter disk", Wvd::DISKTYPE_HD80, 4, 1023*64 }, // = 65472
{ "DS-112 16 MB * 7 platter disk", Wvd::DISKTYPE_HD80, 7, 1023*64 }, // = 65472
{ "DS-140 10 MB * 14 platter disk", Wvd::DISKTYPE_HD80, 14, 640*64 }, // = 40960
// this is one I just made up -- it is the largest possible disk:
{ "DS-224 16 MB * 14 platter disk", Wvd::DISKTYPE_HD80, 14, 1023*64 }, // = 65472
};
static const int num_disk_types = sizeof(disk_choices) / sizeof(disk_choice_t);
// ------------------------------------------------------------------------
// Tab 1 -- disk properties
// ------------------------------------------------------------------------
class PropPanel : public wxPanel
{
public:
CANT_ASSIGN_OR_COPY_CLASS(PropPanel);
PropPanel(DiskFactory *df, wxWindow *parent,
const std::shared_ptr<Wvd> &diskdata);
void refresh();
private:
// callbacks
void OnDiskTypeButton(wxCommandEvent& WXUNUSED(event));
void OnWriteProt(wxCommandEvent& WXUNUSED(event));
// controls
DiskFactory *m_parent = nullptr; // owning dialog
wxStaticText *m_path = nullptr; // path to virtual disk file
wxRadioBox *m_disktype = nullptr; // which type of disk (5.25", 8", hard disk)
wxStaticText *m_st_type = nullptr; // type of drive
wxStaticText *m_st_plats = nullptr; // # platters
wxStaticText *m_st_tracks = nullptr; // # tracks/platter
wxStaticText *m_st_secttrk = nullptr; // display of sectors/track
wxStaticText *m_st_sect = nullptr; // display of # of sectors per platter
wxStaticText *m_st_steptime = nullptr; // display of time to step between tracks
wxStaticText *m_st_rpm = nullptr; // display of rotational speed
wxCheckBox *m_write_prot = nullptr; // write protect checkbox
// data
std::shared_ptr<Wvd> m_disk_data;
};
// ------------------------------------------------------------------------
// Tab 2 -- label edit
// ------------------------------------------------------------------------
class LabelPanel : public wxPanel
{
public:
CANT_ASSIGN_OR_COPY_CLASS(LabelPanel);
LabelPanel(DiskFactory *df, wxWindow *parent,
const std::shared_ptr<Wvd> &diskdata);
void refresh();
std::string getLabelString();
private:
// event handlers
void OnLabelEdit(wxCommandEvent &event);
// controls
DiskFactory * const m_parent; // owning dialog
wxTextCtrl *m_text = nullptr;
// data
std::shared_ptr<Wvd> m_disk_data;
};
// ------------------------------------------------------------------------
// back to DiskFactory
// ------------------------------------------------------------------------
DiskFactory::DiskFactory(wxFrame *parent, const std::string &filename) :
wxDialog(parent, -1, "Disk Factory",
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
const bool new_disk = filename.empty();
m_disk_data = std::make_shared<Wvd>();
if (new_disk) {
// blank disk, default type
m_disk_data->create(disk_choices[0].disk_type,
disk_choices[0].platters,
disk_choices[0].sectors_per_platter);
} else {
// existing disk
const bool ok = m_disk_data->open(filename);
assert(ok);
}
// the frame contains a panel containing a single notebook
wxPanel *panel = new wxPanel(this, -1);
wxNotebook *notebook = new wxNotebook(panel, -1, wxDefaultPosition, wxSize(400, -1));
wxBoxSizer *top_sizer = new wxBoxSizer(wxVERTICAL);
// the top part of topvbox is the notebook control; it might be the only item
top_sizer->Add(notebook, 1, wxEXPAND | wxALL, 4); // add 4px padding all around
// add tabs to the notebook
m_tab1 = new PropPanel(this, notebook, m_disk_data);
notebook->AddPage(m_tab1, "Properties", true);
m_tab2 = new LabelPanel(this, notebook, m_disk_data);
notebook->AddPage(m_tab2, "Label", true);
notebook->SetSelection(0);
// create buttons along the bottom, aligned to the right
wxBoxSizer *m_botbox = new wxBoxSizer(wxHORIZONTAL);
m_btn_cancel = new wxButton(panel, ID_BTN_Cancel, "Cancel");
m_btn_save = new wxButton(panel, new_disk ? ID_BTN_SaveAs : ID_BTN_Save,
new_disk ? "Save As" : "Save");
m_botbox->Add(1, 1, 1); // 1 pixel stretchable spacer
m_botbox->Add(m_btn_save, 0); // non-stretchable
m_botbox->Add(15, 1, 0); // 15 pixel non-stretchable spacer
m_botbox->Add(m_btn_cancel, 0); // non-stretchable
#ifdef __WXMAC__
m_botbox->Add(20, 1, 0); // make sure resizing grip doesn't overdraw cancel button
#endif
// add the buttons to the bottom of the top vbox
top_sizer->Add(m_botbox, 0, wxEXPAND | wxALL, 4); // add 4px padding all around
// make the dialog autosizing
panel->SetSizer(top_sizer);
top_sizer->Fit(this);
top_sizer->SetSizeHints(this);
const wxRect rc = GetRect(); // window size as declared by sizer
// pick up screen location and size
const std::string subgroup("ui/disk_dialog");
wxRect default_geom(rc.GetX(), rc.GetY(), rc.GetWidth(), rc.GetHeight());
host::configReadWinGeom(this, subgroup, &default_geom);
updateDlg();
// event routing table
Bind(wxEVT_BUTTON, &DiskFactory::OnButton_Cancel, this, ID_BTN_Cancel);
Bind(wxEVT_BUTTON, &DiskFactory::OnButton_Save, this, ID_BTN_Save);
Bind(wxEVT_BUTTON, &DiskFactory::OnButton_SaveAs, this, ID_BTN_SaveAs);
Bind(wxEVT_SIZE, &DiskFactory::OnSize, this);
Bind(wxEVT_CLOSE_WINDOW, &DiskFactory::OnClose, this);
}
DiskFactory::~DiskFactory()
{
const std::string subgroup("ui/disk_dialog");
host::configWriteWinGeom(this, subgroup);
m_disk_data = nullptr;
}
// ------------------------------------------------------------------------
//
// ------------------------------------------------------------------------
// refresh the dialog buttons
void
DiskFactory::updateButtons()
{
// disable the Save or SaveAs button if there have been no changes
const bool new_disk = m_disk_data->getPath().empty();
const bool modified = m_disk_data->isModified();
if (m_btn_save != nullptr) {
m_btn_save->Enable(new_disk || modified);
}
}
// update the display to reflect the current state
void
DiskFactory::updateDlg()
{
m_tab1->refresh();
m_tab2->refresh();
}
void
DiskFactory::OnButton_Save(wxCommandEvent& WXUNUSED(event))
{
std::string name(m_disk_data->getPath());
assert(!name.empty());
m_disk_data->setLabel(m_tab2->getLabelString());
m_disk_data->save();
EndModal(0);
}
void
DiskFactory::OnButton_SaveAs(wxCommandEvent& WXUNUSED(event))
{
std::string name;
if (host::fileReq(host::FILEREQ_DISK, "Virtual Disk Name", false, &name) !=
host::FILEREQ_OK) {
return;
}
assert(!name.empty());
// check if this disk is in a drive already
int drive, io_addr;
const bool in_use = system2200::findDisk(name, nullptr, &drive, &io_addr);
if (in_use) {
UI_warn("This disk is in use at /%03X, drive %d.\n\n"
"Either save to a new name or eject the disk first.",
io_addr, drive);
return;
}
m_disk_data->setLabel(m_tab2->getLabelString());
m_disk_data->save(name);
EndModal(0);
}
void
DiskFactory::OnButton_Cancel(wxCommandEvent& WXUNUSED(event))
{
EndModal(1);
}
// called when the window size changes
void
DiskFactory::OnSize(wxSizeEvent &event)
{
updateDlg();
event.Skip(); // let the rest of the processing happen
}
// before closing, if the state has changed, confirm that it really is ok
// to close up shop
void
DiskFactory::OnClose(wxCloseEvent& WXUNUSED(event))
{
bool ok = !m_disk_data->isModified();
if (!ok) {
ok = UI_confirm("You will lose unsaved changes.\n"
"Do you still want to cancel?");
}
if (ok) {
Destroy();
}
}
// ------------------------------------------------------------------------
// Tab 1 -- disk properties
// ------------------------------------------------------------------------
enum
{
PROP_CHK_WP = 1,
};
// wxBoxSizer(v) *top_sizer
// +-- wxStaticText *m_path
// +-- wxBoxSizer(h) *boxh
// | +-- wxRadioBox *m_disktype
// | +-- wxBoxSizer(v) *prop_sizer
// | +-- wxStaticText *st_heading
// | +-- wxStaticText *m_st_sect
// | +-- wxStaticText *m_st_secttrk
// | +-- wxStaticText *m_st_steptime
// | +-- wxStaticText *m_st_rpm
// +-- wxCheckBox *m_write_prot
PropPanel::PropPanel(DiskFactory *df,
wxWindow *parent,
const std::shared_ptr<Wvd> &diskdata) :
wxPanel(parent, -1),
m_parent(df),
m_disk_data(diskdata)
{
const int margin_pixels = 6;
const int margin_LRT = wxLEFT | wxRIGHT | wxTOP;
wxBoxSizer *top_sizer = new wxBoxSizer(wxVERTICAL);
// ----- row 1: path to virtual disk file, if it exists -----
bool new_disk = (m_disk_data->getPath()).empty();
if (!new_disk) {
m_path = new wxStaticText(this, -1, "../path/to/file/...");
top_sizer->Add(m_path, 0, wxEXPAND | wxALIGN_LEFT | margin_LRT, margin_pixels);
}
// ----- row 2: disk type box | disk properties -----
wxBoxSizer *boxh = new wxBoxSizer(wxHORIZONTAL);
if (new_disk) {
wxString type_choices[num_disk_types];
for (int i=0; i < num_disk_types; i++) {
type_choices[i] = disk_choices[i].description;
}
m_disktype = new wxRadioBox(this, -1, "Disk Type",
wxDefaultPosition, wxDefaultSize,
num_disk_types,
&type_choices[0],
0, wxRA_SPECIFY_ROWS);
boxh->Add(m_disktype, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | margin_LRT, margin_pixels);
}
{
// make a heading for the properties information
const int bottom_margin = 4;
#if !STATICBOX_DISK_PROPS
wxStaticText *st_heading = new wxStaticText(this, -1, "Disk Properties");
wxFont heading_font = st_heading->GetFont();
heading_font.SetUnderlined(true);
heading_font.SetWeight(wxFONTWEIGHT_BOLD);
st_heading->SetFont(heading_font);
#endif
// properties attribute strings
m_st_type = new wxStaticText(this, -1, wxEmptyString);
m_st_plats = new wxStaticText(this, -1, wxEmptyString);
m_st_tracks = new wxStaticText(this, -1, wxEmptyString);
m_st_secttrk = new wxStaticText(this, -1, wxEmptyString);
m_st_sect = new wxStaticText(this, -1, wxEmptyString);
m_st_steptime = new wxStaticText(this, -1, wxEmptyString);
m_st_rpm = new wxStaticText(this, -1, wxEmptyString);
#if STATICBOX_DISK_PROPS
wxStaticBox *stbox = new wxStaticBox(this, -1, "Disk Properties");
wxBoxSizer *prop_sizer = new wxStaticBoxSizer(stbox, wxVERTICAL);
#else
wxBoxSizer *prop_sizer = new wxBoxSizer(wxVERTICAL);
prop_sizer->Add( st_heading, 0, wxALIGN_LEFT | wxBOTTOM, bottom_margin);
#endif
prop_sizer->Add(m_st_type, 0, wxALIGN_LEFT | wxBOTTOM, bottom_margin);
prop_sizer->Add(m_st_plats, 0, wxALIGN_LEFT | wxBOTTOM, bottom_margin);
prop_sizer->Add(m_st_tracks, 0, wxALIGN_LEFT | wxBOTTOM, bottom_margin);
prop_sizer->Add(m_st_secttrk, 0, wxALIGN_LEFT | wxBOTTOM, bottom_margin);
prop_sizer->Add(m_st_sect, 0, wxALIGN_LEFT | wxBOTTOM, bottom_margin);
prop_sizer->Add(m_st_steptime, 0, wxALIGN_LEFT | wxBOTTOM, bottom_margin);
prop_sizer->Add(m_st_rpm, 0, wxALIGN_LEFT | wxBOTTOM, bottom_margin);
if (new_disk) {
// we don't need to show what is shown in the selection box
m_st_type->Hide();
}
const int flags = wxALIGN_LEFT | wxALIGN_TOP | wxRIGHT | wxTOP
| ((new_disk) ? wxLEFT : 0);
boxh->Add(prop_sizer, 0, flags, margin_pixels);
}
top_sizer->Add(boxh, 0, wxALIGN_LEFT | margin_LRT, margin_pixels);
// ----- spacer -----
top_sizer->AddSpacer(6);
// ----- row 3: write protect -----
m_write_prot = new wxCheckBox(this, PROP_CHK_WP, "Write Protected");
top_sizer->Add(m_write_prot, 0, wxALIGN_LEFT | wxALL, margin_pixels);
SetSizerAndFit(top_sizer);
refresh();
// event routing table
Bind(wxEVT_RADIOBOX, &PropPanel::OnDiskTypeButton, this, -1);
Bind(wxEVT_CHECKBOX, &PropPanel::OnWriteProt, this, PROP_CHK_WP);
}
void
PropPanel::refresh()
{
assert(m_disk_data);
const bool new_disk = (m_disk_data->getPath()).empty();
const bool modified = m_disk_data->isModified();
// update path to disk
if (!new_disk) {
std::string label = "Path: " + m_disk_data->getPath();
m_path->SetLabel(label);
}
// based on the disk type, print some other information
const int num_platters = m_disk_data->getNumPlatters();
const int num_sectors = m_disk_data->getNumSectors();
const int disk_type = m_disk_data->getDiskType();
int spt, step, rpm;
IoCardDisk::getDiskGeometry(disk_type, &spt, &step, &rpm, nullptr);
// scan the disk_choices[] table to find a match
if (new_disk) {
int radio_sel = -1;
for (int i=0; i < num_disk_types; i++) {
if ((disk_type == disk_choices[i].disk_type) &&
(num_platters == disk_choices[i].platters) &&
(num_sectors == disk_choices[i].sectors_per_platter)) {
radio_sel = i;
break;
}
}
assert(radio_sel >= 0);
m_disktype->SetSelection(radio_sel);
}
std::string type;
switch (disk_type) {
case Wvd::DISKTYPE_FD5: type = "PCS 5.25\" floppy"; break;
case Wvd::DISKTYPE_FD5_DD: type = "PCS 5.25\" DSDD floppy"; break;
case Wvd::DISKTYPE_FD5_HD: type = "PCS 5.25\" DSHD floppy"; break;
case Wvd::DISKTYPE_FD8: type = "2270(A) 8\" floppy"; break;
case Wvd::DISKTYPE_HD60: type = "2260 hard disk"; break;
case Wvd::DISKTYPE_HD80: type = "2280 hard disk"; break;
default: assert(false);
}
m_st_type->SetLabel(type);
std::string label;
label = std::to_string(num_platters) + " platter" + ((num_platters>1) ? "s" : "");
m_st_plats->SetLabel(label);
const int num_tracks = (num_sectors / spt);
const std::string per_platter = (num_platters > 1) ? "/platter" : "";
label = std::to_string(num_tracks) + " tracks" + per_platter;
m_st_tracks->SetLabel(label);
label = std::to_string(spt) + " sectors/track";
m_st_secttrk->SetLabel(label);
label = std::to_string(num_sectors) + " sectors" + per_platter;
m_st_sect->SetLabel(label);
label = std::to_string(step) + " ms step time";
m_st_steptime->SetLabel(label);
label = std::to_string(rpm) + " RPM";
m_st_rpm->SetLabel(label);
m_write_prot->SetValue(m_disk_data->getWriteProtect());
// refreshing the # of sectors triggers the EVT_TEXT action,
// which set the modified bit. since we just did an update,
// set it back to what it was before the update.
m_disk_data->setModified(modified);
m_parent->updateButtons();
}
// used for all dialog button presses
void
PropPanel::OnDiskTypeButton(wxCommandEvent& WXUNUSED(event))
{
const int choice = m_disktype->GetSelection();
assert(choice < num_disk_types);
m_disk_data->setDiskType (disk_choices[choice].disk_type);
m_disk_data->setNumPlatters(disk_choices[choice].platters);
m_disk_data->setNumSectors (disk_choices[choice].sectors_per_platter);
refresh();
}
// used for all dialog button presses
void
PropPanel::OnWriteProt(wxCommandEvent& WXUNUSED(event))
{
m_disk_data->setWriteProtect(m_write_prot->GetValue());
refresh();
}
// ------------------------------------------------------------------------
// Tab 2 -- label edit
// ------------------------------------------------------------------------
enum
{
LABEL_EDIT_LABEL = 1,
};
LabelPanel::LabelPanel(DiskFactory *df,
wxWindow *parent,
const std::shared_ptr<Wvd> &diskdata) :
wxPanel(parent, -1),
m_parent(df),
m_disk_data(diskdata)
{
const int style = wxTE_MULTILINE;
m_text = new wxTextCtrl(this, LABEL_EDIT_LABEL, "",
wxDefaultPosition, wxDefaultSize,
style);
wxFont fontstyle = wxFont(10, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); // fixed pitch
m_text->SetFont(fontstyle);
m_text->SetMaxLength(WVD_MAX_LABEL_LEN-1);
m_text->SetValue(m_disk_data->getLabel());
m_disk_data->setModified(false);
// put a sizer around it
wxBoxSizer *m_sizer = new wxBoxSizer(wxVERTICAL);
m_sizer->Add(m_text, 1, wxEXPAND);
SetSizerAndFit(m_sizer);
// event routing table
Bind(wxEVT_TEXT, &LabelPanel::OnLabelEdit, this, LABEL_EDIT_LABEL);
}
void
LabelPanel::refresh()
{
const bool modified = m_disk_data->isModified();
// refreshing the label triggers the EVT_TEXT action,
// which set the modified bit. since we just did an update,
// set it back to what it was before the update.
m_disk_data->setModified(modified);
// I tried doing this in the constructor, but all the text was
// always selected by default. oh, well, better than nothing.
const int last = m_text->GetLastPosition();
m_text->SetSelection(last, last);
m_parent->updateButtons();
}
std::string
LabelPanel::getLabelString()
{
return std::string(m_text->GetValue());
}
// used for all dialog button presses
void
LabelPanel::OnLabelEdit(wxCommandEvent &event)
{
switch (event.GetId()) {
case LABEL_EDIT_LABEL:
m_disk_data->setModified(true); // note that it has changed
m_parent->updateButtons();
break;
default:
assert(false);
break;
}
}
// vim: ts=8:et:sw=4:smarttab