Page 1 of 1
How to set style of buttons
Posted: Sat Aug 11, 2012 12:36 am
by Eugene Lutsenko
In the program xdemo.exe for which I am extremely grateful to Roger, there is an example of 6 (XSample_6). This example deduces a window with different types of buttons:
As to me to set programmno style of buttons, as on the "Next" buttons and "-$$$-". In general I would like to use style of buttons, standard for the established operating system.
Using teams:
Code: Select all
oConfig := DC_XbpPushButtonXPConfig():new()
* oConfig:radius := 20
* oConfig:bgColor := GRA_CLR_CYAN
DC_PushButtonStyle( oConfig )
at me it is to "descent" it did not turn out, and the buttonxp program gives very large number of various options, but among them isn't present standard for Windows.
Re: How to set style of buttons
Posted: Mon Aug 13, 2012 2:08 am
by Tom
Hi, Eugene.
DCPUSHBUTTONsXP or buttons using the DC_XbpPushButtonXPConfig configuration object (legacy buttons automatically transformed) are OWNERDRAWING buttons. That means, those buttons are painted "manually" by eXpress++ using the GRA engine. They don't care about visual styles or OS settings. Advantage #1: They always look the same, no matter what OS is used. Advantage #2: They support mixed captions like text AND graphics. Standard API buttons do not support this.
If you want to have pushbuttons reflecting the OS settings, you need to:
a) use buttons with text captions only
b) create a manifest file for your app (and/or link it) to enable visual styles if switched on
c) have visual styles enabled for the OS if wanted
The "bott" and "top" buttons in the sample are buttons having bitmap captions only. Without ownerdrawing, those buttons always look like Windows 95 is running.
Re: How to set style of buttons
Posted: Mon Aug 13, 2012 4:54 am
by Eugene Lutsenko
I thank you, Tom, for an explanation. It seems to me, I understood you. It, of course, only my personal opinion:). But a question in that as concretely to make it. You couldn't give the program code providing use in the program on Alaska with "standard API buttons"
Re: How to set style of buttons
Posted: Mon Aug 13, 2012 5:17 am
by Tom
Code: Select all
#include 'dcdialog.ch'
FUNCTION Main()
@ 1,1 DCPUSHBUTTON CAPTION 'My Button' SIZE 10,1
DCREAD GUI ADDBUTTONS FIT
RETURN NIL
This will show a standard button. If your create a manifest file, it will use visual styles.
Re: How to set style of buttons
Posted: Mon Aug 13, 2012 5:50 am
by Eugene Lutsenko
Thanks. Like it I also use something. But it doesn't give a type of the button, such as "Next" in an example from xdemo.exe