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"
16 bbwx::Slider::Pointer slider = bbwx::Slider::New("slider");
17 // slider->bbGetHelp();
18 slider->bbSetInputWinDialog(true); // mandatory
20 std::cout << "Slider Output = "<< slider->bbGetOutputOut() << std::endl;
22 catch (bbtk::Exception e)
27 //=========================================================================
29 //=========================================================================
30 void SliderOutputTextWithoutFactory()
32 std::cout << "============== Slider->OutputText without Factory"
36 bbwx::Slider::Pointer slider = bbwx::Slider::New("slider");
37 bbwx::OutputText::Pointer text = bbwx::OutputText::New("text");
38 bbtk::Connection::Pointer s2t = bbtk::Connection::New(slider,"Out",
42 catch (bbtk::Exception e)
44 bbtk::MessageManager::SetMessageLevel("Error",1);
48 //=========================================================================
51 //=========================================================================
52 #include <bbtkFactory.h>
53 #include <bbwxLayoutLine.h>
54 void SliderOutputTextWithFactory()
56 std::cout << "============== Slider->OutputText **WITH** Factory"
60 bbtk::Factory::Pointer factory = bbtk::Factory::New();
62 factory->LoadPackage("std");
64 bbwx::Slider::Pointer slider = bbwx::Slider::New("slider");
65 bbwx::OutputText::Pointer text = bbwx::OutputText::New("text");
66 bbtk::Connection::Pointer s2t = bbtk::Connection::New(slider,"Out",
69 bbwx::LayoutLine::Pointer layout = bbwx::LayoutLine::New("layout");
70 bbtk::Connection::Pointer c1 = bbtk::Connection::New(slider,"Widget",
72 bbtk::Connection::Pointer c2 = bbtk::Connection::New(text,"Widget",
75 bbtk::Connection::Pointer c3 = bbtk::Connection::New(slider,"BoxChange",
78 // text->bbSetInputBoxProcessMode("Reactive");
80 layout->bbSetInputWinDialog(true);
83 catch (bbtk::Exception e)
85 bbtk::MessageManager::SetMessageLevel("Error",1);
89 //=========================================================================
91 //=========================================================================
92 int main(int argv, char* argc[])
95 // bbtk::MessageManager::SetMessageLevel("all",9);
98 SliderOutputTextWithoutFactory();
99 SliderOutputTextWithFactory();
101 // To get the list of bbtk object still allocated after main ends
102 // bbtk::StaticInitTime::PrintObjectListInfo = true;
103 // bbtk::MessageManager::SetMessageLevel("object",1);
105 //=========================================================================