#include "TROOT.h"#include "TApplication.h"#include "Midad/Gui/GuiMainWindow.h"#include "Midad/Gui/GuiSlider.h"#include "Midad/Gui/GuiTable.h"#include "Midad/Gui/GuiLabel.h"#include "Midad/Gui/GuiButton.h"#include <sigc++/sigc++.h>#include <sigc++/bind.h>#include <sigc++/slot.h>#include <iostream>Go to the source code of this file.
Functions | |
| void | done (const char *which) |
| void | print_range (RangeDouble *r) |
| void | set_label (GuiLabel *gl, RangeDouble *range, RangeDouble *extrema) |
| int | main (int argc, char *argv[]) |
|
|
||||||||||||
|
Definition at line 38 of file test-GuiSlider.cxx. References GuiCompositeFrameBase::Add(), GuiTable::Attach(), GuiSlider::GetExtremaCtrl(), GUI_ALL, GUI_FILL, Range< TYPE >::modified, print_range(), RangeDouble, s(), RangeControl< TYPE >::Set(), set_label(), GuiMainWindow::ShowAll(), GuiSlider::UseExtrema(), and GuiSlider::UseRange(). 00039 {
00040 using namespace SigC;
00041
00042 TApplication theApp("App", &argc, argv);
00043 GuiMainWindow mw(200,200);
00044 GuiTable gt(mw,3,3);
00045 mw.Add(gt);
00046
00047 GuiLabel label(gt,"");
00048 gt.Attach(label,0,1,0,1,GUI_ALL,GUI_ALL);
00049
00050 GuiPicButton button1(gt,"full-zoom.xpm");
00051 gt.Attach(button1,1,2,1,2,0,0);
00052
00053 GuiSlider s1(gt,kHorizontalFrame);
00054 gt.Attach(s1,0,1,1,2,GUI_ALL,0);
00055 GuiSlider s2(gt,kVerticalFrame);
00056 gt.Attach(s2,1,2,0,1,0,GUI_ALL);
00057
00058 RangeDouble* range = manage(new RangeDouble(2,8));
00059 RangeDouble* extrema = manage(new RangeDouble(0,10));
00060
00061 s1.UseExtrema(*extrema);
00062 s2.UseExtrema(*extrema);
00063 s1.UseRange(*range);
00064 s2.UseRange(*range);
00065
00066 range->modified.connect(bind(slot(print_range),range));
00067
00068 Slot0<void> s = bind(bind(bind(slot(set_label),extrema),range),&label);
00069 range->modified.connect(s);
00070 extrema->modified.connect(s);
00071
00072 GuiSlider e1(gt,kHorizontalFrame);
00073 gt.Attach(e1,0,1,2,3,GUI_ALL,GUI_FILL);
00074 e1.GetExtremaCtrl().Set(0, 100);
00075 e1.UseRange(*extrema);
00076
00077 GuiSlider e2(gt,kVerticalFrame);
00078 gt.Attach(e2,2,3,0,1,GUI_FILL,GUI_ALL);
00079 e2.GetExtremaCtrl().Set(0, 100);
00080 e2.UseRange(*extrema);
00081
00082 GuiPicButton button2(gt,"full-zoom.xpm");
00083 gt.Attach(button2,2,3,2,3,0,0);
00084
00085 mw.ShowAll();
00086 theApp.Run();
00087
00088 return 0;
00089 } // end of main()
|
|
|
Definition at line 24 of file test-GuiSlider.cxx. References Range< TYPE >::Max(), Range< TYPE >::Min(), and RangeDouble.
|
|
||||||||||||||||
|
Definition at line 29 of file test-GuiSlider.cxx. References Range< TYPE >::Max(), Range< TYPE >::Min(), and RangeDouble. Referenced by main(). 00030 {
00031 char buf[1024];
00032 sprintf(buf,"%.1f < %.1f < %.1f < %.1f",
00033 extrema->Min(), range->Min(), range->Max(), extrema->Max());
00034 gl->SetText(buf);
00035 cerr << buf << endl;
00036 }
|
1.3.9.1