-
-
Notifications
You must be signed in to change notification settings - Fork 52
SetMedium
This function sets a medium for another widget. (A widget that will control whether another widget is unlocked or not according to it's state/value.)
This function takes std::shared_ptr<FGUI::CWidget> and a unsigned int as arguments. (Medium and Page)
List of widgets that you can use on this function
CheckBoxComboBoxListBoxSliderTabPanelItemSelector
Let's say I want to draw a number of widgets (options) when another CheckBox is checked (toggled).
// Medium
buildrPattern.Widget(MediumCheckBox).Title("Enable All").Position(15, 15).Font("Tahoma", 12).Spawn(Container);
// Options
buildrPattern.Widget(Slider).Title("Example Value").Position(15, 15).Font("Tahoma", 12, true).Medium(MediumCheckBox, true).SpawnIn(Container);
buildrPattern.Widget(KeyBinder).Title("Example Key").Position(15, 40).Font("Tahoma", 12).Medium(MediumCheckBox, true).SpawnIn(Container);
buildrPattern.Widget(CheckBox).Title("Example CheckBox").Position(15, 70).Font("Tahoma", 12).Medium(MediumCheckBox, true).SpawnIn(Container);NOTE: The second argument on the Medium function is a boolean, which means that it will only draw those widgets when the Medium (MediumCheckBox) is checked. (true)
NOTE: In this case, the widgets will only appear when "MediumCheckbox" is enabled.
NOTE: If you use another widget, lets say a ComboBox, instead of true, you put the number of the entry that you want. For instance: Medium(MediumComboBox, 2) - It will only draw the widget if the entry selected on the ComboBox is the 3rd one. (counting from 0.) Or if you want to use a Slider as a medium. You put the desired slider value, so when the slider reach this value, it will draw the widget. Medium(MediumSlider, 150.f)
Next you will learn about the SetColor function.
You can also read the library comments/functions for additional info.