From 3a674681a74840f60e46ccafa05b3d945838797c Mon Sep 17 00:00:00 2001 From: luca Date: Thu, 15 Apr 2010 08:27:21 +0000 Subject: [PATCH] Patch level :10.0 Files correlati : Ricompilazione Demo : [ ] Commento : aggiunti i tasti "si tutti" "no tutti"; in attesa del "forse tutti" git-svn-id: svn://10.65.10.50/trunk@20337 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- xvaga/xvtdm.cpp | 68 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 16 deletions(-) diff --git a/xvaga/xvtdm.cpp b/xvaga/xvtdm.cpp index 303b8c2bb..1268d7349 100755 --- a/xvaga/xvtdm.cpp +++ b/xvaga/xvtdm.cpp @@ -67,7 +67,18 @@ void TMessageBox::OnTimeout(wxTimerEvent& WXUNUSED(evt)) void TMessageBox::AddButton(wxSizer* sz, wxWindowID id) { const wxSize szButt(64,-1); - sz->Add(new wxButton(this, id, wxEmptyString, wxDefaultPosition, szButt), 0, wxALL, 4); + switch (id) + { + case 0x20: + sz->Add(new wxButton(this, id, "Si Tutti", wxDefaultPosition, szButt), 0, wxALL, 4); + break; + case 0x40: + sz->Add(new wxButton(this, id, "No Tutti", wxDefaultPosition, szButt), 0, wxALL, 4); + break; + default: + sz->Add(new wxButton(this, id, wxEmptyString, wxDefaultPosition, szButt), 0, wxALL, 4); + break; + } } TMessageBox::TMessageBox(wxWindow* pParent, const wxString& msg, int nStyle, int nTimeout) @@ -129,19 +140,41 @@ TMessageBox::TMessageBox(wxWindow* pParent, const wxString& msg, int nStyle, int sizer->Add(sz2, 0, wxALIGN_CENTER); if (nStyle & wxYES_NO) { - if (nStyle & wxNO_DEFAULT) + if (nStyle & 0x60) // Yes,No,*All { - SetAffirmativeId(wxID_NO); - SetEscapeId(wxID_YES); - AddButton(sz2, wxID_NO); - AddButton(sz2, wxID_YES); + if (nStyle & 0x20) // No, Yes, Yes All + { + SetAffirmativeId(wxID_YES); + SetEscapeId(wxID_NO); + AddButton(sz2, wxID_NO); + AddButton(sz2, wxID_YES); + AddButton(sz2, 0x20); + } + else // Yes, No, No All + { + SetAffirmativeId(wxID_NO); + SetEscapeId(wxID_YES); + AddButton(sz2, wxID_YES); + AddButton(sz2, wxID_NO); + AddButton(sz2, 0x40); + } } else { - SetAffirmativeId(wxID_YES); - SetEscapeId(wxID_NO); - AddButton(sz2, wxID_YES); - AddButton(sz2, wxID_NO); + if (nStyle & wxNO_DEFAULT) + { + SetAffirmativeId(wxID_NO); + SetEscapeId(wxID_YES); + AddButton(sz2, wxID_NO); + AddButton(sz2, wxID_YES); + } + else + { + SetAffirmativeId(wxID_YES); + SetEscapeId(wxID_NO); + AddButton(sz2, wxID_YES); + AddButton(sz2, wxID_NO); + } } } if (nStyle & wxOK) @@ -154,7 +187,6 @@ TMessageBox::TMessageBox(wxWindow* pParent, const wxString& msg, int nStyle, int SetEscapeId(wxID_CANCEL); AddButton(sz2, wxID_CANCEL); } - SetSizerAndFit(sizer); CentreOnParent(); @@ -523,13 +555,17 @@ BOOLEAN xvt_dm_post_speech(const char* text, int priority, BOOLEAN async) ASK_RESPONSE xvt_dm_post_ask(const char* Btn1, const char* WXUNUSED(Btn2), const char* Btn3, const char* fmt) { int nFlags = wxICON_QUESTION | wxYES_NO; - if (Btn3 == NULL) + if (wxStricmp(Btn1, "no") == 0) + nFlags |= wxNO_DEFAULT; + if (Btn3 != NULL) //il Btn3 è presente sulla maschera (es. noyesall_box, yesnocancel_box) { - if (wxStricmp(Btn1, "no") == 0) - nFlags |= wxNO_DEFAULT; + if (wxStricmp(Btn3, "Si Tutti") == 0) + nFlags |= 0x20; else + if (wxStricmp(Btn3, "No Tutti") == 0) + nFlags |= 0x40; + else + nFlags |= wxCANCEL; } - else - nFlags |= wxCANCEL; const int answer = _MessageBox(fmt, nFlags); return answer == wxYES ? RESP_DEFAULT : (answer == wxNO ? RESP_2 : RESP_3);