Fixed issues with close buttons.

Originally committed to SVN as r1231.
This commit is contained in:
Rodrigo Braz Monteiro 2007-06-17 02:51:11 +00:00
parent 063bf22a42
commit 1cb3b05ada
4 changed files with 3 additions and 22 deletions

View File

@ -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) {

View File

@ -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
};

View File

@ -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();

View File

@ -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);