Discussion of article "Graphical Interfaces III: Groups of Simple and Multi-Functional Buttons (Chapter 2)"

 

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:

  1. by creating a group from already implemented control of the CSimpleButton type;
  2. 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:

  1. background;
  2. icon;
  3. text label.

Fig. 3. Compound parts of radio buttons.

Fig. 3. Compound parts of radio buttons.

Author: Anatoli Kazharski

 
MetaQuotes Software Corp.:

New article Graphical Interfaces III: Groups of Simple and Multi-Functional Buttons (Chapter 2) has been published:

Author: Anatoli Kazharski

Great work !


But: when trying to use the Panel as Indicator on MT4 (!) , every click on a "Icon Button" results a twice printed your
      ::Print(__FUNCTION__," > id: ",id,"; lparam: ",lparam,"; dparam: ",dparam,"; sparam: ",sparam);

So every click action like an increment or something else will be done twice :(
Is there any way to fix it ?

P.S. the curious thing is, that all works fine on MT5. Just MT4 has this Issue when using as Indicator. As Expert it works also fine.

 
marquez:

...

Is there any way to fix it ?

P.S. the curious thing is, that all works fine on MT5. Just MT4 has this Issue when using as Indicator. As Expert it works also fine.

Thank you. This error is discussed in the Service Desk. Corrected'll do after the first version of the library will be published. There will be 25 articles.
 

Hi,


I have done a quick´n´dirty solution which works for me very well. My way was to check the left button pressed bit separate at first in OnEvent and if is set to write a bool true in a helper. After that the regular if statemenet extended with helper == true , and setting inside the if just resetting the helper. Works nearly perfect. In some cases to fast clicks are not mentioned, but better slower clicking except having double results :)

BTW: would be nice, if someone could update all your current Libraries to english. Your newest one f.e. article 05 and so on are only in russian.

 

Hi,



I have a question,

how do you make the black part around your icons transparent?

thk

 

Hi.

I just downloaded the files from the article3

When I compiled it.. I got the following error

CContextMenu     *GetContextMenuPointer(void)        const { return(::GetPointer(m_drop_menu));

File = splitButton.mqh.

Does anyone know how to fix it?


I am trying to create a simple Button.

thanks

 
Kristina Suh #:

Hi.

I just downloaded the files from the article3

When I compiled it.. I got the following error

CContextMenu     *GetContextMenuPointer(void)        const { return(::GetPointer(m_drop_menu));

File = splitButton.mqh.

Does anyone know how to fix it?


I am trying to create a simple Button.

thanks

Delete "const" is OK

CContextMenu     *GetContextMenuPointer(void)        { return(::GetPointer(m_drop_menu));

Reason: