[Scummvm-cvs-logs] SF.net SVN: scummvm:[48946] tools/trunk/gui

criezy at users.sourceforge.net criezy at users.sourceforge.net
Tue May 4 23:01:29 CEST 2010


Revision: 48946
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48946&view=rev
Author:   criezy
Date:     2010-05-04 21:01:29 +0000 (Tue, 04 May 2010)

Log Message:
-----------
Rename 'Default Settings' button into 'Settings'. This fixes an issue on some platforms where there was not enough place for the Cancel button and it was therefore partially outside the window (it depended on the default font used for the button text).
Also in the last page the inactive buttons are now hidden instead of being disabled.

Modified Paths:
--------------
    tools/trunk/gui/main.cpp
    tools/trunk/gui/main.h
    tools/trunk/gui/pages.cpp
    tools/trunk/gui/pages.h

Modified: tools/trunk/gui/main.cpp
===================================================================
--- tools/trunk/gui/main.cpp	2010-05-04 20:14:05 UTC (rev 48945)
+++ tools/trunk/gui/main.cpp	2010-05-04 21:01:29 UTC (rev 48946)
@@ -399,7 +399,7 @@
 
 	sizer->AddSpacer(10);
 
-	_prefs= new wxButton(this, ID_ADVANCED, wxT("Default Settings"));
+	_prefs= new wxButton(this, ID_ADVANCED, wxT("Settings"));
 	_prefs->SetSize(80, -1);
 	sizer->Add(_prefs, wxSizerFlags().Left().ReserveSpaceEvenIfHidden());
 
@@ -471,15 +471,11 @@
 	_prev->Enable(enable);
 }
 
-void WizardButtons::enableCancel(bool enable) {
-	_cancel->Enable(enable);
-}
-
 void WizardButtons::showFinish(bool show) {
 	if (show)
-		_next->SetLabel(wxT("Finish!"));
+		_cancel->SetLabel(wxT("Finish!"));
 	else
-		_next->SetLabel(wxT("Next >"));
+		_cancel->SetLabel(wxT("Cancel"));
 }
 
 void WizardButtons::showAbort(bool show) {

Modified: tools/trunk/gui/main.h
===================================================================
--- tools/trunk/gui/main.h	2010-05-04 20:14:05 UTC (rev 48945)
+++ tools/trunk/gui/main.h	2010-05-04 21:01:29 UTC (rev 48946)
@@ -179,11 +179,6 @@
 	void enablePrevious(bool enable);
 
 	/**
-	 * Enables the cancel button.
-	 */
-	void enableCancel(bool enable);
-
-	/**
 	 * Display the previous/next button.
 	 */
 	void showNavigation(bool show);

Modified: tools/trunk/gui/pages.cpp
===================================================================
--- tools/trunk/gui/pages.cpp	2010-05-04 20:14:05 UTC (rev 48945)
+++ tools/trunk/gui/pages.cpp	2010-05-04 21:01:29 UTC (rev 48946)
@@ -192,7 +192,6 @@
 	buttons->setLineLabel(wxT("ScummVM Tools"));
 
 	buttons->showNavigation(false);
-	buttons->enableCancel(true);
 
 	WizardPage::updateButtons(panel, buttons);
 }
@@ -1526,6 +1525,8 @@
 		0, wxDefaultValidator, wxT("DisplayOutput"));
 	displayOut->SetValue(true);
 	sizer->Add(displayOut);
+	
+	sizer->AddSpacer(10);
 
 	wxCheckBox *processOther = new wxCheckBox(panel, wxID_ANY, wxT("Process another file"), wxDefaultPosition, wxDefaultSize,
 		0, wxDefaultValidator, wxT("ProcessOther"));
@@ -1537,7 +1538,8 @@
 	return panel;
 }
 
-void FinishPage::onNext(wxWindow *panel) {
+bool FinishPage::onCancel(wxWindow *panel) {
+	// On that page, that's the Finish button
 	wxCheckBox *display = static_cast<wxCheckBox *>(panel->FindWindowByName(wxT("DisplayOutput")));
 	if (display->GetValue()) {
 		// There is no standard way to do this
@@ -1551,10 +1553,13 @@
 	}
 
 	wxCheckBox *restart = static_cast<wxCheckBox *>(panel->FindWindowByName(wxT("ProcessOther")));
-	if (restart->GetValue())
+	if (restart->GetValue()) {
 		_topframe->switchToFirstPage();
-	else
+		return false;
+	} else {
 		_topframe->Close(true);
+		return true;
+	}
 }
 
 wxString FinishPage::getHelp() {
@@ -1562,9 +1567,8 @@
 }
 
 void FinishPage::updateButtons(wxWindow *panel, WizardButtons *buttons) {
-	buttons->enablePrevious(false);
+	buttons->showNavigation(false);
 	buttons->showFinish(true);
-	buttons->enableCancel(false);
 
 	WizardPage::updateButtons(panel, buttons);
 }
@@ -1598,18 +1602,21 @@
 	return panel;
 }
 
-void FailurePage::onNext(wxWindow *panel) {
+bool FailurePage::onCancel(wxWindow *panel) {
+	// On that page, that's the Finish button
 	wxCheckBox *restart = static_cast<wxCheckBox *>(panel->FindWindowByName(wxT("ProcessOther")));
-	if (restart->GetValue())
+	if (restart->GetValue()) {
 		_topframe->switchToFirstPage();
-	else
+		return false;
+	} else {
 		_topframe->Close(true);
+		return true;
+	}
 }
 
 void FailurePage::updateButtons(wxWindow *panel, WizardButtons *buttons) {
-	buttons->enablePrevious(false);
+	buttons->showNavigation(false);
 	buttons->showFinish(true);
-	buttons->enableCancel(false);
 
 	WizardPage::updateButtons(panel, buttons);
 }

Modified: tools/trunk/gui/pages.h
===================================================================
--- tools/trunk/gui/pages.h	2010-05-04 20:14:05 UTC (rev 48945)
+++ tools/trunk/gui/pages.h	2010-05-04 21:01:29 UTC (rev 48946)
@@ -492,7 +492,7 @@
 
 	wxString getHelp();
 
-	void onNext(wxWindow *panel);
+	bool onCancel(wxWindow *panel);
 
 	void updateButtons(wxWindow *panel, WizardButtons *buttons);
 };
@@ -508,7 +508,7 @@
 
 	wxWindow *CreatePanel(wxWindow *parent);
 
-	void onNext(wxWindow *panel);
+	bool onCancel(wxWindow *panel);
 
 	void updateButtons(wxWindow *panel, WizardButtons *buttons);
 };


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list