ControlSliderBox-classDerived from: public BBoxDeclared in: Controls.h
OverviewThis class unifies the NumberControl- and ControlSlider-classes and puts them into a single BBox. Although this class works well, it is a little bit hard to use so it might be better to roll up your own class to do a similar thing. |
||
Constructor |
||
ControlSliderBox()ControlSliderBox(BRect frame, const char* name, const char* label, const char* text, BMessage *message, int32 rangeMin, int32 rangeMax, border_style border=B_PLAIN_BORDER, bool continuos=TRUE, thumb_style knob=B_TRIANGLE_THUMB)This creates the BBox, NumberControl and ControlSlider according to parameters. The parameter message will be sent from here to the assigned target. The message that will be sent to target contains and int32 named "value" that has the current value of the control. If parameter continuos is TRUE, a message will be sent whenever the slider is adjusted, otherwise a message will only be sent when the number control is invoked or slider adjusting is finished. The sent message contains a bool named "final" which indicates whether or not the adjusting is finished. |
||
Member Functions |
||
Divider() see SetDivider() |
||
SetDivider(), Divider()void SetDivider(float divider, bool resize_text_field) float Divider()SetDivider sets the x-coordinate where the number control and slider meet. This value will be taken from divider. If resize_text_field is TRUE, the text-field in number control will be resized to maximum possible value. Otherwise it will remain as it is or will be shrinked if required. Divider returns the value of the x-coordinate where the controls meet. The value is in the coordinate-space of this box. |
||
SetMessage()void SetMessage(BMessage* message)Changes the message that is sent from this control to the target. The message will be copied and it remains the property of the calling function. |
||
SetTarget()void SetTarget(BMessenger* target)Changes the target where the message will be sent to target. The messenger will be copied and it remains the property of the calling function. |
||
setValue()void setValue(int32 value)Changes the value of this control to value. |
||