Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ParamGUISample2.cpp
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003, 2004 (see file CONTACTS for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 
26 /**
27  @example ParamGUISample2.cpp
28  @relates ParamGUI
29  @brief Example for using the parameter gui classes
30  @ingroup g_examples
31  @author MIP
32 */
33 #include <Base/Common/W32Compat.hh>
34 
35 #include <wx/wx.h>
36 
37 #include <Gui/ParamGUI.hh>
38 #include <Gui/StringConv.hh>
39 #include <Utils/Param.hh>
40 #include <iostream>
41 
42 using namespace BIAS;
43 using namespace std;
44 
45 // classes
46 /** \cond HIDDEN_SYMBOLS */
47 class MyApp : public wxApp
48 {
49  public:
50  virtual bool OnInit();
51 };
52 
53 DECLARE_APP(MyApp)
54 
55 // implementation
56 
57 IMPLEMENT_APP(MyApp)
58 
59 bool MyApp::OnInit()
60 {
61  ParamGUI param_;
62  param_.AddParamInt("SampleInt1","Hilfetext zu SampleInt1",0,-100,100,0,1);
63  param_.AddParamInt("SampleInt2","Hilfetext zu SampleInt2");
64  param_.AddParamBool("SampleBool1","Hilfetext zu SampleBool1",false,0,1);
65  param_.AddParamBool("SampleBool2","Hilfetext zu SampleBool2");
66  param_.AddParamDouble("SampleDouble1","Hilfetext zu SampleDouble1");
67  param_.AddParamString("SampleString1","Hilfetext zu SampleString1");
68 
69  param_.ParseCommandLine(wxTheApp->argc,WxToAsciiArray(wxTheApp->argv,wxTheApp->argc));
70 
71  wxFrame *frame = param_.GetFrame(NULL);
72  frame->Show(TRUE);
73  SetTopWindow(frame);
74  return true;
75 }
76 /** \endcond */
The main Parameter Gui interface, derived from BIAS::Param and extends this class.
Definition: ParamGUI.hh:88
bool * AddParamBool(const std::string &name, const std::string &help, bool deflt=false, char cmdshort=0, int Group=GRP_NOSHOW)
Definition: Param.cpp:305
double * AddParamDouble(const std::string &name, const std::string &help, double deflt=0.0, double min=-DBL_MAX, double max=DBL_MAX, char cmdshort=0, int Group=GRP_NOSHOW)
Definition: Param.cpp:351
int ParseCommandLine(int &argc, char *argv[])
scan command line arguments for valid parameters
Definition: Param.cpp:1028
wxFrame * GetFrame(wxWindow *parent)
Builds up a standalone wxFrame with a notebook embedded in it.
Definition: ParamGUI.cpp:118
Class for converting an array of wxStrings to an array of non-const ASCII strings.
Definition: StringConv.hh:60
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:
Definition: Param.cpp:276
std::string * AddParamString(const std::string &name, const std::string &help, std::string deflt="", char cmdshort=0, int Group=GRP_NOSHOW)
Definition: Param.cpp:327