-
Notifications
You must be signed in to change notification settings - Fork 0
/
GetOrg_DLG.cpp
76 lines (75 loc) · 1.6 KB
/
GetOrg_DLG.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
#include "GetOrg_DLG.h"
GetOrg_DLG::GetOrg_DLG( wxWindow* parent )
:
cleanGetOrg_DLG( parent )
{
orgIni = wxT( "Organisation" );
ORG* org = new ORG;
dNewOrg( org );
delete org;
dLoadOrg();
}
void GetOrg_DLG::GetOrg_DLGOnClose( wxCloseEvent& event )
{
if ( isModified )
{
switch ( MB( wxT( "Do you wish to save changes?" ), wxT("List is Modified"), wxYES_NO | wxCANCEL ) )
{
case wxYES: dSaveOrg(); break;
case wxCANCEL: return;
}
}
dShowOrg();
event.Skip();
}
void GetOrg_DLG::dOrgName_LBOnSelect( wxCommandEvent& event )
{
dShowOrg();
}
void GetOrg_DLG::dLoadOrg_OnClick( wxCommandEvent& event )
{
dLoadOrg();
}
void GetOrg_DLG::dSaveOrg_OnClick( wxCommandEvent& event )
{
dSaveOrg();
}
void GetOrg_DLG::dNewOrg_OnClick( wxCommandEvent& event )
{
ORG* org = dGetOrg();
s8 index = dNewOrg( org );
delete org;
dOrgName_LB->Select( index );
dShowOrg();
isModified = true;
}
void GetOrg_DLG::dSetOrg_OnClick( wxCommandEvent& event )
{
s8 index = dOrgName_LB->GetSelection();
ORG* org = dGetOrg( index );
if ( !org->isDefault )
{
org = dGetOrg();
dSetOrg( index, org );
delete org;
dShowOrg();
isModified = true;
}
}
void GetOrg_DLG::dUseOrg_OnClick( wxCommandEvent& event )
{
gClose( this );
}
void GetOrg_DLG::dDelOrg_OnClick( wxCommandEvent& event )
{
s8 index = dOrgName_LB->GetSelection();
ORG* org = dGetOrg( index );
if ( !org->isDefault )
{
dOrgName_LB->Delete( index );
index = ( index > 0 ) ? index - 1 : 0;
dOrgName_LB->Select( index );
dShowOrg();
isModified = true;
}
}