34 #include <bias_config.h>
37 #include <Gui/ParamGUI.hh>
38 #include <Gui/StringConv.hh>
39 #include <Utils/Param.hh>
50 MyAlgorithm(){coollevel = NULL;};
53 void ParamAdd(
Param &p) {
54 coollevel = p.
AddParamInt(
"coollevel",
"Really cool threshold");
56 void ParameterChanged(
const std::string &name,
const void *data){
57 cout <<
"Here is MyAlgorithm! My parameter \""<<name<<
"\" changed"<<endl;
58 if (data == coollevel)
59 cout <<
"Hey, it was \"coollevel\", new cool level is: "<<*coollevel
67 class MyApp :
public wxApp
70 virtual bool OnInit();
75 class MyFrame : public wxFrame
93 MyFrame *frame =
new MyFrame();
100 : wxFrame(NULL, -1, _T(
"ParamGUISample3"), wxDefaultPosition,
103 param_.AddParamInt(
"SampleInt1",
"Hilfetext zu SampleInt1",0,-100,100,0,1);
104 param_.AddParamInt(
"SampleInt2",
"Hilfetext zu SampleInt2");
105 param_.AddParamBool(
"SampleBool1",
"Hilfetext zu SampleBool1",
false,0,1);
106 param_.AddParamBool(
"SampleBool2",
"Hilfetext zu SampleBool2");
107 param_.AddParamDouble(
"SampleDouble1",
"Hilfetext zu SampleDouble1");
108 param_.AddParamString(
"SampleString1",
"Hilfetext zu SampleString1");
110 algo =
new MyAlgorithm();
111 algo->ParamAdd(param_);
113 param_.ParseCommandLine(wxTheApp->argc,
WxToAsciiArray(wxTheApp->argv,wxTheApp->argc));
115 wxNotebook *MyNotebook;
116 MyNotebook = param_.GetNotebook(
this);
117 #if wxCHECK_VERSION(2,5,2)
118 wxBoxSizer *nbsizer =
new wxBoxSizer(wxHORIZONTAL);
119 nbsizer->Add(MyNotebook);
121 wxNotebookSizer *nbsizer;
122 nbsizer =
new wxNotebookSizer(MyNotebook);
The main Parameter Gui interface, derived from BIAS::Param and extends this class.
int RegisterCallbackObject(const std::string &name, ParamCallbackInterface *obj)
This class provides an interface to be called if parameter changes occured.
This class Param provides generic support for parameters.
Class for converting an array of wxStrings to an array of non-const ASCII strings.
int * AddParamInt(const std::string &name, const std::string &help, int deflt=0, int min=std::numeric_limits< int >::min(), int max=std::numeric_limits< int >::max(), char cmdshort=0, int Group=GRP_NOSHOW)
For all adding routines: