3 * Config panel, used to specify parameters (for example clients, filesets... in restore)
5 * Nicolas Boichat, April 2004
10 Copyright (C) 2004-2006 Kern Sibbald
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 version 2 as amended with additional clauses defined in the
15 file LICENSE in the main source directory.
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 the file LICENSE for additional details.
24 #ifndef WXBCONFIGPANEL_H
25 #define WXBCONFIGPANEL_H
29 #include <wx/choice.h>
30 #include <wx/stattext.h>
31 #include <wx/textctrl.h>
33 #include <wx/dynarray.h>
41 class wxbConfigParam {
43 /* Create a new config parameter */
44 wxbConfigParam(wxString title, wxWindowID id, wxbConfigType type, wxString value);
45 wxbConfigParam(wxString title, wxWindowID id, wxbConfigType type, int n, wxString values[]);
48 void AddControl(wxWindow* parent, wxSizer* sizer);
51 void SetValue(wxString str);
54 void SetIndex(int ind);
57 void Add(wxString value);
74 wxStaticText* statictext;
77 WX_DECLARE_OBJARRAY(wxbConfigParam, wxbConfig);
79 class wxbConfigPanel : public wxPanel {
81 /* Creates a new config panel, config must be allocated with new */
82 wxbConfigPanel(wxWindow* parent, wxbConfig* config, wxString title, wxWindowID ok, wxWindowID cancel, wxWindowID apply = -1);
85 void SetRowString(const wxChar* title, wxString value);
86 wxString GetRowString(const wxChar* title);
87 int GetRowSelection(const wxChar* title);
88 void SetRowSelection(const wxChar* title, int ind);
90 void ClearRowChoices(const wxChar* title);
91 void AddRowChoice(const wxChar* title, wxString value);
93 /* If enable is true, enables apply button, and disables ok button */
94 void EnableApply(bool enable = true);
97 /* Keep the last index accessed, for optimization */
105 int FindRow(const wxChar* title);