The RadHBoxLayout class automatically groups RadWidgets in a horizontal plane within the available space. The RadHBoxLayout relieves the Lisp programmer of the arduous task of placing the controls at exact locations as the RadHBoxLayout automatically places the controls which are added to it.
Overview
The new function creates a new RadHBoxLayout object and returns a pointer to the newly created object. The RadHBoxLayout is one of the class key words accepted by the qt new: function. There can be many RadHBoxLayout objects. Each RadHBoxLayout object is used to automatically positions the controls add to it.
Syntax
(qt new: RadHBoxLayout:)
Arguments
Returns | Always returns a pointer to the newly created RadHBoxLayout object. |
Example1
;; Build a dialog window with an Okay button and a Sick button. (setq radDialog (qt new: RadDialog: "Dialog Window with an Okay Button")) (setq okayButton (qt new: RadPushButton: "Okay" (lambda(...) (writeln "You pressed Okay") (qt radDialog done: 0)))) (setq sickButton (qt new: RadPushButton: "Sick" (lambda(...) (writeln "You pressed Sick") (qt radDialog done: 1)))) (setq mainLayout (qt new: RadHBoxLayout:)) ;; Here we create the main horizontal layout control. (qt mainLayout addWidget: okayButton) ;; Here we add the Okay button to the main horizontal layout control. (qt mainLayout addWidget: sickButton) ;; Here we add the Sick button to the main horizontal layout control. (qt radDialog setLayout: mainLayout) ;; Here we add the main layout to the dialog window. ;; Display the dialog window and wait for the user to press the Okay or the Sick button. (setq result (qt radDialog exec:)) ;; Display the dialog window and return the code for the button pressed.
Overview
The addLayout adds a RadLayout (RadHBoxLayout or RadVBoxLayout) to the current RadHBoxLayout object. As controls are added to the RadHBoxLayout, they are automatically positioned in asthetic proportion to each other.
Syntax
(qt RadHBoxLayoutPtr addLayout: RadLayoutPtr)
Arguments
RadLayoutPtr | The RadLayout (RadHBoxLayout or RadVBoxLayout) to be added to the current RadHBoxLayout object. |
Returns | Always returns a #void value. |
Example1
;; Build a dialog window with an Okay button and a Sick button. (setq mainLayout (qt new: RadHBoxLayout:)) ;; Here we create the main horizontal layout control. (setq subLayout (qt new: RadVBoxLayout:)) ;; Here we create the main horizontal layout control. (qt subLayout addWidget: okayButton) (qt subLayout addWidget: sickButton) (qt mainLayout setLayout: subLayout) ;; Here we add the sub layout to the main layout.
Overview
The addWidget adds a RadWidget control to the current RadHBoxLayout object. As controls are added to the RadHBoxLayout, they are automatically positioned in asthetic proportion to each other.
Syntax
(qt RadHBoxLayoutPtr addWidget: RadWidgetPtr)
Arguments
RadWidgetPtr | The RadWidget to be added to the current RadHBoxLayout object. |
Returns | Always returns a #void value. |
Example1
;; Build a dialog window with an Okay button and a Sick button. (setq mainLayout (qt new: RadHBoxLayout:)) ;; Here we create the main horizontal layout control. (qt mainLayout addWidget: okayButton) ;; Here we add the Okay button to the main layout (qt mainLayout addWidget: sickButton) ;; Here we add the Sick button to the main layout
Overview
The setStretchFactor set the stretch factor for the specified RadWidget control already added to the RadHBoxLayout object. As controls are added to the RadHBoxLayout, they are automatically positioned in asthetic proportion to each other. Setting the stretch factor for a RadWidget helps control the amount of space the control takes up relative to other controls added.
Syntax
(qt RadHBoxLayoutPtr setStretchFactor: RadWidgetPtr factor)
Arguments
RadWidgetPtr | The RadWidget to stretched in the current RadHBoxLayout object. |
factor | The amount to stretch the specified RadWidget control in the current RadHBoxLayout object. |
Returns | Always returns a #void value. |
Example1
;; Build a dialog window with an Okay button and a Sick button. (setq mainLayout (qt new: RadHBoxLayout:)) ;; Here we create the main horizontal layout control. (qt mainLayout addWidget: okayButton) ;; Here we add the Okay button to the main layout (qt mainLayout addWidget: sickButton) ;; Here we add the Sick button to the main layout (qt mainLayout setStretchFactor: sickButton 2) ;; Here we give the Sick button more space
Overview
The delete function destroys a RadHBoxLayout object and returns a null pointer.
Syntax
(qt delete: RadHBoxLayoutPtr)
Arguments
RadHBoxLayoutPtr | The pointer to the RadHBoxLayout object to be destroyed. |
Returns | Always returns a null pointer. |
Example1
(setq RadHBoxLayoutPtr (qt new: RadHBoxLayout:)) ;; Create a RadHBoxLayout object. (setq RadHBoxLayoutPtr (qt delete: RadHBoxLayoutPtr)) ;; Destroy the RadHBoxLayout object.