1 #include <bbwxSlider.h>
2 #include <bbwxOutputText.h>
4 //=========================================================================
5 // Different examples of using black boxes in C++
6 // Here we do not use wxWidgets however WxBlackBox work in **Dialog** mode
7 //=========================================================================
9 //=========================================================================
10 void SimpleSliderDialog()
12 std::cout << "============== Simple Slider dialog 1" << std::endl;
15 bbwx::Slider::Pointer slider = bbwx::Slider::New("slider");
16 std::cout << "============== Simple Slider dialog " << std::endl;
17 // slider->bbGetHelp();
18 slider->bbSetInputWinDialog(true); // mandatory
19 std::cout << "============== Simple Slider dialog 3" << std::endl;
21 std::cout << "Slider Output = "<< slider->bbGetOutputOut() << std::endl;
23 catch (bbtk::Exception e)
28 //=========================================================================
30 //=========================================================================
31 void SliderOutputTextWithoutFactory()
33 std::cout << "============== Slider->OutputText without Factory"
37 bbwx::Slider::Pointer slider = bbwx::Slider::New("slider");
38 bbwx::OutputText::Pointer text = bbwx::OutputText::New("text");
39 bbtk::Connection::Pointer s2t = bbtk::Connection::New(slider,"Out",
43 catch (bbtk::Exception e)
45 bbtk::MessageManager::SetMessageLevel("Error",1);
49 //=========================================================================
52 //=========================================================================
53 #include <bbtkFactory.h>
54 #include <bbwxLayoutLine.h>
55 void SliderOutputTextWithFactory()
57 std::cout << "============== Slider->OutputText **WITH** Factory"
61 bbtk::Factory::Pointer factory = bbtk::Factory::New();
63 factory->LoadPackage("std");
65 bbwx::Slider::Pointer slider = bbwx::Slider::New("slider");
66 bbwx::OutputText::Pointer text = bbwx::OutputText::New("text");
67 bbtk::Connection::Pointer s2t = bbtk::Connection::New(slider,"Out",
70 bbwx::LayoutLine::Pointer layout = bbwx::LayoutLine::New("layout");
71 bbtk::Connection::Pointer c1 = bbtk::Connection::New(slider,"Widget",
73 bbtk::Connection::Pointer c2 = bbtk::Connection::New(text,"Widget",
76 bbtk::Connection::Pointer c3 = bbtk::Connection::New(slider,"BoxChange",
79 // text->bbSetInputBoxProcessMode("Reactive");
81 layout->bbSetInputWinDialog(true);
84 catch (bbtk::Exception e)
86 bbtk::MessageManager::SetMessageLevel("Error",1);
90 //=========================================================================
92 //=========================================================================
93 int main(int argv, char* argc[])
96 // bbtk::MessageManager::SetMessageLevel("all",9);
99 SliderOutputTextWithoutFactory();
100 SliderOutputTextWithFactory();
102 // To get the list of bbtk object still allocated after main ends
103 // bbtk::StaticInitTime::PrintObjectListInfo = true;
104 // bbtk::MessageManager::SetMessageLevel("object",1);
106 //=========================================================================