-
Notifications
You must be signed in to change notification settings - Fork 4
/
wxCrafterSettingsDlg.cpp
40 lines (34 loc) · 1.06 KB
/
wxCrafterSettingsDlg.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
#include "wxCrafterSettingsDlg.h"
#include "wxCrafterCBSettings.h"
wxCrafterSettingsDlg::wxCrafterSettingsDlg(wxWindow* parent)
: wxCrafterSettingsDlgBase(parent)
{
m_settings.Load();
m_textCtrlPath->ChangeValue( m_settings.GetWxcPath() );
if ( !m_settings.GetSettingsDialogRect().IsEmpty() ) {
SetSize( m_settings.GetSettingsDialogRect() );
}
}
wxCrafterSettingsDlg::~wxCrafterSettingsDlg()
{
m_settings.SetSettingsDialogRect( GetRect() );
m_settings.Save();
}
void wxCrafterSettingsDlg::OnOKUI(wxUpdateUIEvent& event)
{
event.Enable( !m_textCtrlPath->IsEmpty() && wxFileExists( m_textCtrlPath->GetValue() ) );
}
void wxCrafterSettingsDlg::OnOK(wxCommandEvent& event)
{
wxUnusedVar( event );
m_settings.SetWxcPath( m_textCtrlPath->GetValue() );
m_settings.Save();
EndModal( wxID_OK );
}
void wxCrafterSettingsDlg::OnBrowse(wxCommandEvent& event)
{
wxString filename = ::wxFileSelector(_("Select wxCrafter executable"));
if ( !filename.IsEmpty() ) {
m_textCtrlPath->ChangeValue( filename );
}
}