3 * Config panel, used to specify parameters (for example clients, filesets... in restore)
5 * Nicolas Boichat, April 2004
10 Copyright (C) 2004 Kern Sibbald and John Walker
12 This program is free software; you can redistribute it and/or
13 modify it under the terms of the GNU General Public License
14 as published by the Free Software Foundation; either version 2
15 of the License, or (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 #ifndef WXBCONFIGPANEL_H
28 #define WXBCONFIGPANEL_H
32 #include <wx/choice.h>
33 #include <wx/stattext.h>
34 #include <wx/textctrl.h>
36 #include <wx/dynarray.h>
44 class wxbConfigParam {
46 /* Create a new config parameter */
47 wxbConfigParam(wxString title, wxWindowID id, wxbConfigType type, wxString value);
48 wxbConfigParam(wxString title, wxWindowID id, wxbConfigType type, int n, wxString values[]);
51 void AddControl(wxWindow* parent, wxSizer* sizer);
54 void SetValue(wxString str);
57 void SetIndex(int ind);
60 void Add(wxString value);
77 wxStaticText* statictext;
80 WX_DECLARE_OBJARRAY(wxbConfigParam, wxbConfig);
82 class wxbConfigPanel : public wxPanel {
84 /* Creates a new config panel, config must be allocated with new */
85 wxbConfigPanel(wxWindow* parent, wxbConfig* config, wxString title, wxWindowID ok, wxWindowID cancel, wxWindowID apply = -1);
88 void SetRowString(const char* title, wxString value);
89 wxString GetRowString(const char* title);
90 int GetRowSelection(const char* title);
91 void SetRowSelection(const char* title, int ind);
93 void ClearRowChoices(const char* title);
94 void AddRowChoice(const char* title, wxString value);
96 /* If enable is true, enables apply button, and disables ok button */
97 void EnableApply(bool enable = true);
100 /* Keep the last index accessed, for optimization */
108 int FindRow(const char* title);