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