The
first chapter of the series was about simple and multi-functional
buttons. The second article will be dedicated to groups of
interconnected buttons that will allow the creation of elements in an
application when a user can select one of the option out of a set
(group).
Developing the Class for Creating Groups of Simple Buttons
A group of simple buttons is essentially an array of graphical objects of the OBJ_BUTTON
type. The differential characteristic of such controls is that only one
button of the group can be pressed at a time. At this stage, a class of
this control can be created in two ways:
by creating a group from already implemented control of the CSimpleButton type;
by creating a group from primitive objects of the CButton type.
The second option is simpler as it does not require the creation of an additional method for each control of the CSimpleButton type to get to the base of pointers. We are going to use this one.
Developing the Class for Creating Groups of Radio Buttons
Create the RadioButtons.mqh file with the CRadioButtons
class which must contain standard virtual methods and class members for
storing and getting the form pointer. You can see examples in the
classes of other controls above. Include the RadioButtons.mqh file in the library (WndContainer.mqh).
Each radio item will be composed of thee primitive objects:
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
New article Graphical Interfaces III: Groups of Simple and Multi-Functional Buttons (Chapter 2) has been published:
The first chapter of the series was about simple and multi-functional buttons. The second article will be dedicated to groups of interconnected buttons that will allow the creation of elements in an application when a user can select one of the option out of a set (group).
Developing the Class for Creating Groups of Simple Buttons
A group of simple buttons is essentially an array of graphical objects of the OBJ_BUTTON type. The differential characteristic of such controls is that only one button of the group can be pressed at a time. At this stage, a class of this control can be created in two ways:
The second option is simpler as it does not require the creation of an additional method for each control of the CSimpleButton type to get to the base of pointers. We are going to use this one.
Developing the Class for Creating Groups of Radio Buttons
Create the RadioButtons.mqh file with the CRadioButtons class which must contain standard virtual methods and class members for storing and getting the form pointer. You can see examples in the classes of other controls above. Include the RadioButtons.mqh file in the library (WndContainer.mqh).
Each radio item will be composed of thee primitive objects:
Fig. 3. Compound parts of radio buttons.
Author: Anatoli Kazharski