launcher: fix default values of some options,
restore "are you sure" save message when an option has been changed, remove "are you sure" save message on apply button
This commit is contained in:
@@ -178,6 +178,22 @@ public:
|
||||
|
||||
};
|
||||
|
||||
static ref class ChangeHandler
|
||||
{
|
||||
public:
|
||||
bool* changebool;
|
||||
|
||||
ChangeHandler(bool* onchangebool)
|
||||
{
|
||||
changebool = onchangebool;
|
||||
}
|
||||
|
||||
System::Void SetChanged(System::Object^ sender, System::EventArgs^ e)
|
||||
{
|
||||
*changebool = true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class ConfigOptionBase
|
||||
{
|
||||
@@ -188,8 +204,9 @@ public:
|
||||
|
||||
LPCWSTR _friendlyName;
|
||||
LPCWSTR _description;
|
||||
|
||||
|
||||
System::IntPtr mainControlHandle;
|
||||
bool* hasChanged;
|
||||
|
||||
virtual int AddToPanel(Panel^ panel, unsigned int left, unsigned int top, ToolTip^ tooltip)
|
||||
{
|
||||
@@ -242,6 +259,11 @@ public:
|
||||
|
||||
tooltip->SetToolTip(cb, gcnew String(_description));
|
||||
|
||||
if (hasChanged == nullptr)
|
||||
hasChanged = new bool;
|
||||
ChangeHandler^ changehandler = gcnew ChangeHandler(hasChanged);
|
||||
cb->CheckedChanged += gcnew System::EventHandler(changehandler, &ChangeHandler::SetChanged);
|
||||
|
||||
panel->Controls->Add(cb);
|
||||
mainControlHandle = cb->Handle;
|
||||
|
||||
@@ -312,6 +334,11 @@ public:
|
||||
tooltip->SetToolTip(label, gcnew String(_description));
|
||||
tooltip->SetToolTip(numberbox, gcnew String(_description));
|
||||
|
||||
if (hasChanged == nullptr)
|
||||
hasChanged = new bool;
|
||||
ChangeHandler^ changehandler = gcnew ChangeHandler(hasChanged);
|
||||
numberbox->ValueChanged += gcnew System::EventHandler(changehandler, &ChangeHandler::SetChanged);
|
||||
|
||||
panel->Controls->Add(label);
|
||||
panel->Controls->Add(numberbox);
|
||||
mainControlHandle = numberbox->Handle;
|
||||
@@ -391,6 +418,11 @@ public:
|
||||
tooltip->SetToolTip(label, gcnew String(_description));
|
||||
tooltip->SetToolTip(textbox, gcnew String(_description));
|
||||
|
||||
if (hasChanged == nullptr)
|
||||
hasChanged = new bool;
|
||||
ChangeHandler^ changehandler = gcnew ChangeHandler(hasChanged);
|
||||
textbox->TextChanged += gcnew System::EventHandler(changehandler, &ChangeHandler::SetChanged);
|
||||
|
||||
panel->Controls->Add(label);
|
||||
panel->Controls->Add(textbox);
|
||||
mainControlHandle = textbox->Handle;
|
||||
@@ -475,6 +507,11 @@ public:
|
||||
tooltip->SetToolTip(label, gcnew String(_description));
|
||||
tooltip->SetToolTip(combobox, gcnew String(_description));
|
||||
|
||||
if (hasChanged == nullptr)
|
||||
hasChanged = new bool;
|
||||
ChangeHandler^ changehandler = gcnew ChangeHandler(hasChanged);
|
||||
combobox->SelectedIndexChanged += gcnew System::EventHandler(changehandler, &ChangeHandler::SetChanged);
|
||||
|
||||
panel->Controls->Add(label);
|
||||
panel->Controls->Add(combobox);
|
||||
mainControlHandle = combobox->Handle;
|
||||
@@ -563,6 +600,11 @@ public:
|
||||
tooltip->SetToolTip(label, gcnew String(_description));
|
||||
tooltip->SetToolTip(combobox, gcnew String(_description));
|
||||
|
||||
if (hasChanged == nullptr)
|
||||
hasChanged = new bool;
|
||||
ChangeHandler^ changehandler = gcnew ChangeHandler(hasChanged);
|
||||
combobox->TextChanged += gcnew System::EventHandler(changehandler, &ChangeHandler::SetChanged);
|
||||
|
||||
panel->Controls->Add(label);
|
||||
panel->Controls->Add(combobox);
|
||||
mainControlHandle = combobox->Handle;
|
||||
@@ -655,6 +697,11 @@ public:
|
||||
ComboboxValidation^ validation = gcnew ComboboxValidation(combobox);
|
||||
combobox->Leave += gcnew System::EventHandler(validation, &ComboboxValidation::CheckNumberLeave);
|
||||
|
||||
if (hasChanged == nullptr)
|
||||
hasChanged = new bool;
|
||||
ChangeHandler^ changehandler = gcnew ChangeHandler(hasChanged);
|
||||
combobox->TextChanged += gcnew System::EventHandler(changehandler, &ChangeHandler::SetChanged);
|
||||
|
||||
panel->Controls->Add(label);
|
||||
panel->Controls->Add(combobox);
|
||||
mainControlHandle = combobox->Handle;
|
||||
@@ -742,6 +789,11 @@ public:
|
||||
tooltip->SetToolTip(label, gcnew String(_description));
|
||||
tooltip->SetToolTip(combobox, gcnew String(_description));
|
||||
|
||||
if (hasChanged == nullptr)
|
||||
hasChanged = new bool;
|
||||
ChangeHandler^ changehandler = gcnew ChangeHandler(hasChanged);
|
||||
combobox->TextChanged += gcnew System::EventHandler(changehandler, &ChangeHandler::SetChanged);
|
||||
|
||||
ComboboxValidation^ validation = gcnew ComboboxValidation(combobox);
|
||||
combobox->Leave += gcnew System::EventHandler(validation, &ComboboxValidation::CheckResolutionLeave);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user