Gallery of UIs written in MQL - page 28

 
The other colours don't work, and at the same time, the colour change that should have been on the first button is now applied to the fourth button
 
Реter Konow #:

This notation concatenates enumerated attributes so that the constructor knows they point to the same element.

The underscore should be placed after the element name.

Example: "Hello World!", W,100 ,_, H,200, _ , N_COLOR, clrWhite, _ , A_COLOR, clrBlack, ....


First we write the name, then we list the attributes and their values. The result is an element attribute string that can be copied and used as a template to replace it with a new element.


N_COLOR - Indicates the colour of the neutral state.

A_COLOR - Indicates the colour of the active state.

Why can't we default to the same element on the same line, when the element name "Hello World!" is already specified at the beginning, right?

 
hini #:
The other colours don't work, and at the same time the colour change that should have happened with the first button is now applied to the fourth button.

Forgot to add. This method only works within a group. You are listing properties and values outside the group. Then instead of _, put the name of the element:


"Hello World!", W ,100, "Hello World!", H,200 , " Hello World!", N_COLOR,clrWhite , "Hello World!", A_COLOR , clrBlack,
 
hini #:

Why can't we default to the same element on the same line if we already have the element name "Hello World!" at the beginning, right?

Those are the rules. It's easier for the constructor to interpret the markup code that way.

 
Реter Konow #:

Forgot to add. This method only works within the group. You are listing attributes and values outside the group. Then replace _ with the element name:


"Hello World!", W ,100, " Hello World! " , H ,200 , "Hello World!" , N_COLOR, clrWhite , "Hello World !", A_COLOR , clrBlack,

Modified it and the colour didn't change, it stayed black.

 
hini #:

Changed it and the colour didn't change, stayed black.

put (uint) in front of the colour name.

I usually use a different colour representation in the constructor. That's why I forgot to say that before web colours (colour names) you need to cast to uint type.

 
Реter Konow #:

Add (uint) to the colour name.

I usually use a different colour representation in the constructor. That's why I forgot to mention that the web colour (colour name) needs to be converted to a uint type before it.

"AAA", W,100, "AAA", H,100, "AAA", N_COLOR, (uint)clrWhite, "AAA", A_COLOR, (uint)clrBlack,

OK, how many colour representations can there be? Besides this way. Is "#FFFFFF" allowed for colour representation?

 
hini #:

Okay, how many representations of colour can there be? Other than that. Is "#FFFFFFFFFF" allowed for a colour representation?

In my practice I have only used two colour representations, e.g.:

A_COLOR, (uint)clrBlack

or

A_COLOR, (uint)C'223,234,12' 

Representation of colour "#FFFFFFFF" frankly speaking I have not tried. That's why I don't know. Try.

 
Реter Konow #:

In my practice I have only used two colour representations, for example

or

The colour "#FFFFFFFFF" representation, which, frankly, I haven't tried. So I don't. Try.

"AAA", W,100, "AAA", H,100, "AAA", N_COLOR, 0xffffff, "AAA", A_COLOR, (uint)clrBlue,

I tried it, and it can be set up like this, by entering the hex colour code

 
hini #:

I tried it, and it can be configured as follows by entering the hexadecimal colour code

OK, do it that way if it's convenient).