]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/wx-console/wxbconfigpanel.cpp
- Put Dmsg() on inside if() to avoid calling subroutine.
[bacula/bacula] / bacula / src / wx-console / wxbconfigpanel.cpp
index b57530e34920305d2e9b5ae09e9555e12f587164..80c039a489717263c3901aa420de323a9343f433 100644 (file)
@@ -4,6 +4,7 @@
  *
  *    Nicolas Boichat, April 2004
  *
+ *    Version $Id$
  */
 /*
    Copyright (C) 2004 Kern Sibbald and John Walker
@@ -64,7 +65,7 @@ wxbConfigParam::~wxbConfigParam() {
 }
   
 void wxbConfigParam::AddControl(wxWindow* parent, wxSizer* sizer) {
-   sizer->Add(new wxStaticText(parent, -1, title + ": ", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT), 0, wxEXPAND | wxALIGN_CENTER_HORIZONTAL);
+   sizer->Add(new wxStaticText(parent, -1, title + wxT(": "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT), 0, wxALIGN_CENTER_VERTICAL);
    switch (type) {
    case text:
       statictext = new wxStaticText(parent, -1, value, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
@@ -75,7 +76,12 @@ void wxbConfigParam::AddControl(wxWindow* parent, wxSizer* sizer) {
       sizer->Add(textctrl, 1, wxEXPAND | wxADJUST_MINSIZE);
       break;
    case choice:
-      choicectrl = new wxChoice(parent, id, wxDefaultPosition, wxSize(150, 20), nvalues, values);
+#if defined __WXGTK20__ /* Choices are taller under GTK+-2.0 */
+      wxSize size = wxSize(150, 25);
+#else
+      wxSize size = wxSize(150, 20);
+#endif
+      choicectrl = new wxChoice(parent, id, wxDefaultPosition, size, nvalues, values);
       sizer->Add(choicectrl, 1, wxEXPAND);
       break;
    }
@@ -88,16 +94,16 @@ wxString wxbConfigParam::GetTitle() {
 wxString wxbConfigParam::GetValue() {
    switch (type) {
    case text:
-      return (statictext != NULL) ? statictext->GetLabel() : wxString("");
+      return (statictext != NULL) ? statictext->GetLabel() : wxString(wxT(""));
       break;
    case modifiableText:
-      return (textctrl != NULL) ? textctrl->GetValue() : wxString("");      
+      return (textctrl != NULL) ? textctrl->GetValue() : wxString(wxT(""));      
       break;
    case choice:
-      return (choicectrl != NULL) ? choicectrl->GetStringSelection() : wxString("");
+      return (choicectrl != NULL) ? choicectrl->GetStringSelection() : wxString(wxT(""));
       break;      
    }
-   return "";
+   return wxT("");
 }
 
 void wxbConfigParam::SetValue(wxString str) {
@@ -174,18 +180,18 @@ wxbConfigPanel::wxbConfigPanel(wxWindow* parent, wxbConfig* config, wxString tit
    
    wxBoxSizer* restoreBottomSizer = new wxBoxSizer(wxHORIZONTAL);
    
-   cfgOk = new wxButton(this, ok, "OK", wxDefaultPosition, wxSize(70, 25));
+   cfgOk = new wxButton(this, ok, wxT("OK"), wxDefaultPosition, wxSize(70, 25));
    restoreBottomSizer->Add(cfgOk, 1, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
 
    if (apply != -1) {
-      cfgApply = new wxButton(this, apply, "Apply", wxDefaultPosition, wxSize(70, 25));
+      cfgApply = new wxButton(this, apply, wxT("Apply"), wxDefaultPosition, wxSize(70, 25));
       restoreBottomSizer->Add(cfgApply, 1, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 10);
    }
    else {
       cfgApply = NULL;
    }
 
-   cfgCancel = new wxButton(this, cancel, "Cancel", wxDefaultPosition, wxSize(70, 25));
+   cfgCancel = new wxButton(this, cancel, wxT("Cancel"), wxDefaultPosition, wxSize(70, 25));
    restoreBottomSizer->Add(cfgCancel, 1, wxALIGN_CENTER_VERTICAL | wxLEFT, 10);
    
    mainSizer->Add(restoreBottomSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL, 5);
@@ -200,29 +206,29 @@ wxbConfigPanel::~wxbConfigPanel() {
    delete config;
 }
    
-void wxbConfigPanel::SetRowString(const char* title, wxString value) {
+void wxbConfigPanel::SetRowString(const wxChar* title, wxString value) {
    int i;
    if ((i = FindRow(title)) > -1) {
       (*config)[i].SetValue(value);
    }
 }
 
-wxString wxbConfigPanel::GetRowString(const char* title) {
+wxString wxbConfigPanel::GetRowString(const wxChar* title) {
    int i;
    if ((i = FindRow(title)) > -1) {
       return (*config)[i].GetValue();
    }
-   return "";
+   return wxT("");
 }
 
-void wxbConfigPanel::SetRowSelection(const char* title, int ind) {
+void wxbConfigPanel::SetRowSelection(const wxChar* title, int ind) {
    int i;
    if ((i = FindRow(title)) > -1) {
       (*config)[i].SetIndex(ind);
    }
 }
 
-int wxbConfigPanel::GetRowSelection(const char* title) {
+int wxbConfigPanel::GetRowSelection(const wxChar* title) {
    int i;
    if ((i = FindRow(title)) > -1) {
       return (*config)[i].GetIndex();
@@ -230,21 +236,21 @@ int wxbConfigPanel::GetRowSelection(const char* title) {
    return -1;
 }
 
-void wxbConfigPanel::ClearRowChoices(const char* title) {
+void wxbConfigPanel::ClearRowChoices(const wxChar* title) {
    int i;
    if ((i = FindRow(title)) > -1) {
       (*config)[i].Clear();
    }  
 }
 
-void wxbConfigPanel::AddRowChoice(const char* title, wxString value) {
+void wxbConfigPanel::AddRowChoice(const wxChar* title, wxString value) {
    int i;
    if ((i = FindRow(title)) > -1) {
       (*config)[i].Add(value);
    }  
 }
 
-int wxbConfigPanel::FindRow(const char* title) {
+int wxbConfigPanel::FindRow(const wxChar* title) {
    unsigned int i;
    
    for (i = last; i < config->GetCount(); i++) {