#include <Midad/Gui/GuiMainWindow.h>#include <Midad/Gui/GuiBox.h>#include <Midad/Gui/GuiButton.h>#include <Midad/Base/RegistryGui.h>#include <Registry/Registry.h>#include <TROOT.h>#include <TApplication.h>#include <sigc++/sigc++.h>#include <iostream>Go to the source code of this file.
Functions | |
| void | get_and_spew (RegistryGui *rg) |
| void | add_option_reg (RegistryGui *rg) |
| int | main (int argc, char *argv[]) |
|
|
Definition at line 23 of file test-RegistryGui.cxx. References reg, Registry::Set(), and RegistryGui::SetPossibles(). Referenced by main(). 00024 {
00025 Registry int_reg;
00026 int_reg.SetName("Possible values for 'an integer'");
00027 int_reg.Set("The answer",42);
00028 int_reg.Set("A palindromic number",12321);
00029 int_reg.Set("Nothingness",0);
00030
00031 Registry double_reg;
00032 double_reg.SetName("Possible values for 'a double'");
00033 double_reg.Set("Yin Yang",6.9);
00034 double_reg.Set("Proton lifetime",3.0e34);
00035 double_reg.Set("Minos baseline",735.340);
00036
00037 Registry char_reg;
00038 char_reg.SetName("Possible values for 'a char'");
00039 char_reg.Set("Ordinate",'x');
00040 char_reg.Set("Coordinate",'y');
00041 char_reg.Set("Snoring",'z');
00042
00043 Registry string_reg;
00044 string_reg.SetName("Possible values for 'a string'");
00045 string_reg.Set("Verse 1","Ring around the rosey");
00046 string_reg.Set("Verse 2","A pocket full of posey");
00047 string_reg.Set("Verse 3","Ashes ashes we all fall down");
00048
00049 Registry reg;
00050 reg.Set("an integer",int_reg);
00051 reg.Set("a double",double_reg);
00052 reg.Set("a char",char_reg);
00053 reg.Set("a string",string_reg);
00054
00055 Registry reg_reg = reg;
00056 reg.Set("a registry",reg_reg);
00057
00058 rg->SetPossibles(reg);
00059 }
|
|
|
Definition at line 17 of file test-RegistryGui.cxx. References RegistryGui::GetRegistry(), and reg. Referenced by main(). 00018 {
00019 const Registry reg = rg->GetRegistry();
00020 cerr << reg << endl;
00021 }
|
|
||||||||||||
|
Definition at line 61 of file test-RegistryGui.cxx. References GuiCompositeFrameBase::Add(), add_option_reg(), GuiButtonBase::clicked, GuiMainWindow::ConnectClose(), get_and_spew(), reg, Registry::Set(), GuiBase::SetLayoutHints(), RegistryGui::SetRegistry(), and GuiMainWindow::ShowAll(). 00062 {
00063 TApplication theApp("App", &argc, argv);
00064
00065 GuiMainWindow mw(100,300);
00066
00067 RegistryGui rg(mw);
00068 mw.Add(rg);
00069
00070 GuiBox buttonbox(mw,kHorizontalFrame);
00071 buttonbox.SetLayoutHints(kLHintsExpandX);
00072 mw.Add(buttonbox);
00073
00074 GuiTextButton spew(buttonbox,"Get and print contents");
00075 buttonbox.Add(spew);
00076 spew.clicked.connect(bind(slot(get_and_spew),&rg));
00077
00078 GuiTextButton add_options(buttonbox,"Add option menus");
00079 buttonbox.Add(add_options);
00080 add_options.clicked.connect(bind(slot(add_option_reg),&rg));
00081
00082 Registry reg;
00083 reg.SetName("Main Registry");
00084 reg.Set("an integer",42);
00085 reg.Set("a double",6.9);
00086 reg.Set("a char",'x');
00087 reg.Set("a string","Ring around the rosey");
00088
00089 Registry subreg = reg;
00090 subreg.SetName("A sub Registry");
00091 reg.Set("a registry",subreg);
00092
00093 rg.SetRegistry(reg);
00094
00095
00096 mw.ShowAll();
00097 mw.ConnectClose(true);
00098 mw.Resize(mw.GetDefaultWidth(),mw.GetDefaultHeight());
00099
00100 theApp.Run();
00101
00102 return 0;
00103 } // end of main()
|
1.3.9.1