*
* Nicolas Boichat, April 2004
*
+ * Version $Id$
*/
/*
Copyright (C) 2004 Kern Sibbald and John Walker
}
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);
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;
}
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) {
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);
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();
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++) {