From 811893c250d1301eec42028cf6a1c43a346a6043 Mon Sep 17 00:00:00 2001 From: skidau Date: Tue, 26 May 2015 02:09:28 +0000 Subject: [PATCH] Made the dialogs resizeable. --- src/wx/cmdevents.cpp | 7 +++++++ src/wx/guiinit.cpp | 3 +++ src/wx/sys.cpp | 2 ++ src/wx/viewers.cpp | 2 ++ src/wx/viewsupt.h | 5 +++-- src/wx/wxvbam.cpp | 2 ++ 6 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/wx/cmdevents.cpp b/src/wx/cmdevents.cpp index 857b6915..63b9ab39 100644 --- a/src/wx/cmdevents.cpp +++ b/src/wx/cmdevents.cpp @@ -1956,6 +1956,13 @@ EVT_HANDLER_MASK(Disassemble, "Disassemble...", CMDEN_GB | CMDEN_GBA) EVT_HANDLER_MASK(Logging, "Logging...", CMDEN_GBA) { wxDialog* dlg = wxGetApp().frame->logdlg; + dlg->SetWindowStyle(wxCAPTION | wxRESIZE_BORDER); + + if (gopts.keep_on_top) + dlg->SetWindowStyle(dlg->GetWindowStyle() | wxSTAY_ON_TOP); + else + dlg->SetWindowStyle(dlg->GetWindowStyle() & ~wxSTAY_ON_TOP); + dlg->Show(); dlg->Raise(); } diff --git a/src/wx/guiinit.cpp b/src/wx/guiinit.cpp index 103f8650..e2223684 100644 --- a/src/wx/guiinit.cpp +++ b/src/wx/guiinit.cpp @@ -321,6 +321,7 @@ public: int ncheats = isgb ? gbCheatNumber : cheatsNumber; ce_codes = wxEmptyString; wxDialog* subdlg = GetXRCDialog("CheatEdit"); + dlg->SetWindowStyle(wxCAPTION | wxRESIZE_BORDER); if (gopts.keep_on_top) subdlg->SetWindowStyle(subdlg->GetWindowStyle() | wxSTAY_ON_TOP); @@ -586,6 +587,7 @@ public: } wxDialog* subdlg = GetXRCDialog("CheatEdit"); + dlg->SetWindowStyle(wxCAPTION | wxRESIZE_BORDER); if (gopts.keep_on_top) subdlg->SetWindowStyle(subdlg->GetWindowStyle() | wxSTAY_ON_TOP); @@ -1145,6 +1147,7 @@ public: ca_val = list->OnGetItemText(idx, 2); // sugest "New" value SetValVal(ca_val_tc); wxDialog* subdlg = GetXRCDialog("CheatAdd"); + dlg->SetWindowStyle(wxCAPTION | wxRESIZE_BORDER); if (gopts.keep_on_top) subdlg->SetWindowStyle(subdlg->GetWindowStyle() | wxSTAY_ON_TOP); diff --git a/src/wx/sys.cpp b/src/wx/sys.cpp index 163dc145..5ce74d85 100644 --- a/src/wx/sys.cpp +++ b/src/wx/sys.cpp @@ -729,6 +729,8 @@ public: ~PrintDialog(); int ShowModal() { + dlg->SetWindowStyle(wxCAPTION | wxRESIZE_BORDER); + if (gopts.keep_on_top) dlg->SetWindowStyle(dlg->GetWindowStyle() | wxSTAY_ON_TOP); else diff --git a/src/wx/viewers.cpp b/src/wx/viewers.cpp index 8f10ea58..b64af273 100644 --- a/src/wx/viewers.cpp +++ b/src/wx/viewers.cpp @@ -716,6 +716,7 @@ public: selreg_lenlab->Disable(); s.Printf(addrlen == 4 ? wxT("%04X") : wxT("%08X"), len); selreg_len->SetValue(s); + selregion->SetWindowStyle(wxCAPTION | wxRESIZE_BORDER); if (gopts.keep_on_top) selregion->SetWindowStyle(selregion->GetWindowStyle() | wxSTAY_ON_TOP); @@ -739,6 +740,7 @@ public: selreg_len->Enable(); selreg_lenlab->Enable(); selreg_len->SetValue(wxEmptyString); + selregion->SetWindowStyle(wxCAPTION | wxRESIZE_BORDER); if (gopts.keep_on_top) selregion->SetWindowStyle(selregion->GetWindowStyle() | wxSTAY_ON_TOP); diff --git a/src/wx/viewsupt.h b/src/wx/viewsupt.h index 6964716e..a9911fe4 100644 --- a/src/wx/viewsupt.h +++ b/src/wx/viewsupt.h @@ -57,8 +57,9 @@ protected: #define LoadXRCViewer(t) do { \ wxDialog *d = new Viewers::t##Viewer; \ - if(d) \ - d->Show(); \ + if(d) { \ + d->SetWindowStyle(wxCAPTION | wxRESIZE_BORDER); \ + d->Show(); } \ } while(0) // a list box with no horizontal scrollbar and a funky vertical scrollbar: diff --git a/src/wx/wxvbam.cpp b/src/wx/wxvbam.cpp index 326c3918..f2a9907e 100644 --- a/src/wx/wxvbam.cpp +++ b/src/wx/wxvbam.cpp @@ -853,6 +853,8 @@ void MainFrame::MenuPopped(wxMenuEvent &evt) // uses dialog_opened as a nesting counter int MainFrame::ShowModal(wxDialog* dlg) { + dlg->SetWindowStyle(wxCAPTION | wxRESIZE_BORDER); + if (gopts.keep_on_top) dlg->SetWindowStyle(dlg->GetWindowStyle() | wxSTAY_ON_TOP); else