Button and Toolbar iconsize

Moderator: Rathinagiri

Post Reply
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Button and Toolbar iconsize

Post 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
Luigi from Italy
www.L3W.it
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Button and Toolbar iconsize

Post by esgici »

Thanks Luigi :)

Regards

--

Esgici
Viva INTERNATIONAL HMG :D
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Button and Toolbar iconsize

Post 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!
Luigi from Italy
www.L3W.it
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Button and Toolbar iconsize

Post 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
Viva INTERNATIONAL HMG :D
Post Reply