Page 1 of 1

Button and Toolbar iconsize

Posted: Tue Jun 07, 2011 1:52 pm
by l3whmg
I found (I hope, the tests have given a positive answer) how to set the size of icons used for buttons and the toolbar.

Caution: as described in the documentation of the Qt library, you can only reduce the size.
Little brief from Nokia: "... the icons used must be at least of this size as the icons are only scaled down".
Here you can find more information http://doc.qt.nokia.com/4.7/qabstractit ... nSize-prop.

To achieve this goal, I had to move some pieces of source code from the "toolbar.prg" to "control.prg" to allow the same functionality as the definition of the dimension. Also, I removed some definitions (eg "cPicture") that were defined in both "toolbar.prg" and "toolbutton.prg" but already defined in "control.prg".

You can find these two new examples, which illustrate my update: "samples\button\demo_4.prg" and "samples\toolbar\demo_5.prg".

In particular, for the command "DEFINE BUTTON" I had to add a new command in the source "hmg.ch".
It is "IMAGESIZE w, h" which allows you (in the style HMG3/CLIPPER) to define the size of the icon in the button, with OOP you can use <:ImageWidth> AND <ImageHeight>.

ATTENTION: you must define both Width and Height of the icon ELSE the QT default management is used.

My commit is 632 and 633 (I loose the examples: I'm sorry).
Best regards

Re: Button and Toolbar iconsize

Posted: Tue Jun 07, 2011 5:04 pm
by esgici
Thanks Luigi :)

Regards

--

Esgici

Re: Button and Toolbar iconsize

Posted: Tue Jun 07, 2011 6:39 pm
by l3whmg
Hi Esgici :D
how are you? It's a lot of time that I don't write to you: I'm sorry.
It's my pleasure to contribute to this project 8-)

Ciaooo!

Re: Button and Toolbar iconsize

Posted: Tue Jun 07, 2011 8:49 pm
by esgici
Ciao Luigi

Thanks a lot, I'm fine and I wish you too are fine :D

I'm not a contributor for HMG4 for now, only follower ;)

Ciaooo!

--

Esgici