How to set style of buttons

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

How to set style of buttons

#1 Post 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:

Image

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.

User avatar
Tom
Posts: 1234
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: How to set style of buttons

#2 Post 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.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to set style of buttons

#3 Post 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"

User avatar
Tom
Posts: 1234
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: How to set style of buttons

#4 Post 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.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to set style of buttons

#5 Post 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

Post Reply