From 1cb3b05ada3fd764c721b80aa977d9c94750900f Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Sun, 17 Jun 2007 02:51:11 +0000 Subject: [PATCH] Fixed issues with close buttons. Originally committed to SVN as r1231. --- aegisub/dialog_attachments.cpp | 13 ++----------- aegisub/dialog_attachments.h | 2 -- aegisub/dialog_automation.cpp | 9 +-------- aegisub/dialog_automation.h | 1 - 4 files changed, 3 insertions(+), 22 deletions(-) diff --git a/aegisub/dialog_attachments.cpp b/aegisub/dialog_attachments.cpp index 3ee759ad2..c5e893608 100644 --- a/aegisub/dialog_attachments.cpp +++ b/aegisub/dialog_attachments.cpp @@ -50,7 +50,7 @@ /////////////// // Constructor DialogAttachments::DialogAttachments(wxWindow *parent) -: wxDialog(parent,-1,_("Attachment List"),wxDefaultPosition,wxDefaultSize) +: wxDialog(parent,-1,_("Attachment List"),wxDefaultPosition,wxDefaultSize,wxDEFAULT_DIALOG_STYLE) { // List view listView = new wxListView(this,ATTACHMENT_LIST,wxDefaultPosition,wxSize(500,200)); @@ -68,8 +68,7 @@ DialogAttachments::DialogAttachments(wxWindow *parent) buttonSizer->Add(new wxButton(this,BUTTON_ATTACH_GRAPHICS,_("Attach &Graphics")),1,0,0); buttonSizer->Add(extractButton,1,0,0); buttonSizer->Add(deleteButton,1,0,0); - buttonSizer->Add(new wxButton(this,BUTTON_CLOSE,_("&Close")),1,wxLEFT,5); - SetEscapeId(BUTTON_CLOSE); + buttonSizer->Add(new wxButton(this,wxID_CANCEL,_("&Close")),1,wxLEFT,5); // Main sizer wxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); @@ -120,7 +119,6 @@ BEGIN_EVENT_TABLE(DialogAttachments,wxDialog) EVT_BUTTON(BUTTON_ATTACH_GRAPHICS,DialogAttachments::OnAttachGraphics) EVT_BUTTON(BUTTON_EXTRACT,DialogAttachments::OnExtract) EVT_BUTTON(BUTTON_DELETE,DialogAttachments::OnDelete) - EVT_BUTTON(BUTTON_CLOSE,DialogAttachments::OnClose) EVT_LIST_ITEM_SELECTED(ATTACHMENT_LIST,DialogAttachments::OnListClick) EVT_LIST_ITEM_DESELECTED(ATTACHMENT_LIST,DialogAttachments::OnListClick) EVT_LIST_ITEM_FOCUSED(ATTACHMENT_LIST,DialogAttachments::OnListClick) @@ -241,13 +239,6 @@ void DialogAttachments::OnDelete(wxCommandEvent &event) { } -///////// -// Close -void DialogAttachments::OnClose(wxCommandEvent &event) { - EndModal(0); -} - - ////////////////////////// // List selection changed void DialogAttachments::OnListClick(wxListEvent &event) { diff --git a/aegisub/dialog_attachments.h b/aegisub/dialog_attachments.h index a7296601c..db7ae0b44 100644 --- a/aegisub/dialog_attachments.h +++ b/aegisub/dialog_attachments.h @@ -60,7 +60,6 @@ private: void OnAttachGraphics(wxCommandEvent &event); void OnExtract(wxCommandEvent &event); void OnDelete(wxCommandEvent &event); - void OnClose(wxCommandEvent &event); void OnListClick(wxListEvent &event); void UpdateList(); @@ -80,6 +79,5 @@ enum { BUTTON_ATTACH_GRAPHICS, BUTTON_EXTRACT, BUTTON_DELETE, - BUTTON_CLOSE, ATTACHMENT_LIST }; diff --git a/aegisub/dialog_automation.cpp b/aegisub/dialog_automation.cpp index d2c15fa43..1faa98bfc 100644 --- a/aegisub/dialog_automation.cpp +++ b/aegisub/dialog_automation.cpp @@ -54,7 +54,7 @@ DialogAutomation::DialogAutomation(wxWindow *parent, Automation4::ScriptManager reload_button = new wxButton(this, Automation_Reload_Script, _("Re&load")); info_button = new wxButton(this, Automation_Show_Info, _("Show &Info")); reload_autoload_button = new wxButton(this, Automation_Reload_Autoload, _("Re&scan Autoload Dir")); - close_button = new wxButton(this, wxID_CLOSE); + close_button = new wxButton(this, wxID_CANCEL, _("&Close")); // add headers to list view list->InsertColumn(0, _T(""), wxLIST_FORMAT_CENTER, 20); @@ -75,7 +75,6 @@ DialogAutomation::DialogAutomation(wxWindow *parent, Automation4::ScriptManager button_box->AddSpacer(10); button_box->Add(close_button, 0); button_box->AddStretchSpacer(2); - SetEscapeId(wxID_CLOSE); // main layout wxSizer *main_box = new wxBoxSizer(wxVERTICAL); @@ -160,7 +159,6 @@ BEGIN_EVENT_TABLE(DialogAutomation, wxDialog) EVT_BUTTON(Automation_Reload_Script,DialogAutomation::OnReload) EVT_BUTTON(Automation_Show_Info,DialogAutomation::OnInfo) EVT_BUTTON(Automation_Reload_Autoload,DialogAutomation::OnReloadAutoload) - EVT_BUTTON(wxID_CLOSE,DialogAutomation::OnClose) EVT_LIST_ITEM_SELECTED(Automation_List_Box,DialogAutomation::OnSelectionChange) EVT_LIST_ITEM_DESELECTED(Automation_List_Box,DialogAutomation::OnSelectionChange) END_EVENT_TABLE() @@ -292,11 +290,6 @@ void DialogAutomation::OnReloadAutoload(wxCommandEvent &evt) UpdateDisplay(); } -void DialogAutomation::OnClose(wxCommandEvent &evt) -{ - EndModal(0); -} - void DialogAutomation::OnSelectionChange(wxListEvent &evt) { UpdateDisplay(); diff --git a/aegisub/dialog_automation.h b/aegisub/dialog_automation.h index bc1964b9c..2e51b3e4a 100644 --- a/aegisub/dialog_automation.h +++ b/aegisub/dialog_automation.h @@ -72,7 +72,6 @@ private: void OnRemove(wxCommandEvent &evt); void OnReload(wxCommandEvent &evt); void OnInfo(wxCommandEvent &evt); - void OnClose(wxCommandEvent &evt); void OnReloadAutoload(wxCommandEvent &evt); void OnSelectionChange(wxListEvent &evt);