Page 1 of 1

color of folder dialogs

Posted: Mon Feb 11, 2008 6:43 pm
by Detlef Hoefner
Hi All,

i would like to change the background color of a folder's subdialogs.
The default color is not suitable for the color of my TsButtons.

Here a picture to see that the button color doesn't harmonize with the background.

Image

I tried with

Code: Select all

ACTIVATE DIALOG oDlg;
      ON INIT aEval( oFold:aDialogs, { | oD | oD:SetColor( GetSysColor( COLOR_BTNTEXT ), GetSysColor( COLOR_BTNFACE ) ) } )
But no success.

The use of WindowsXP.Manifest seems to be the cause of not changing colors.
But without this theme all other buttons look very 'vintage' :? .

Is there a way to get other background colors?

Thanks for every idea in advance.
Detlef

Posted: Mon Feb 11, 2008 7:17 pm
by James Bott
Detlef,

Changing the dialog color to gray will also look vintage and it won't change the fact that the current buttons and icons look vintage.

I would suggest changing to standard text only buttons. These will inherit the theme and look much better.

James

Posted: Mon Feb 11, 2008 7:32 pm
by Detlef Hoefner
James,

i'll think about your suggest.

Do yo know a way to add a menu to a button like in my picture?
This was very easy with TsButton.

Regards,
Detlef

Posted: Mon Feb 11, 2008 7:38 pm
by James Bott
Detlef,

>Do yo know a way to add a menu to a button like in my picture?
>This was very easy with TsButton.

Hmm. You can do it with a buttonbar button, but I have not tried it with a regular button. I do use TSButton myself--it is a nice class.

How many menu items do you have? If not too many, perhaps you could use a separate button for each instead.

Note that buttons calling menus are not common except on toolbars so maybe it is better to avoid it if you can.

Another option would be a group box containing a combobox and a Print button.

James

Posted: Mon Feb 11, 2008 9:46 pm
by Antonio Linares
Detlef,

If you are using themes in your dialogboxes, then you could use FWH TButtonBmp buttons that use themes and show bitmaps too.

If you want to keep using those buttons, and change the dialogs colors, then you need to change this:

oFolder:aDialogs[ n ]:bEraseBkGnd = nil

or create a function DrawPBack() in your main PRG that fills the dialog the way you want. Please note how it is used from Class TFolder:

oDlg:bEraseBkGnd = { | hDC | DrawPBack( oDlg:hWnd, hDC ), 1 }

Posted: Mon Feb 11, 2008 10:05 pm
by Detlef Hoefner
Antonio,

your solution works fine.
Thanks a lot,
Detlef

Posted: Mon Feb 11, 2008 10:14 pm
by Detlef Hoefner
James,

as usual you are right concerning the design rules of developing Window applications.
But ( as usual too ) my boss wants the screens as they were before under 16bit FW except all other themed controls.

If i had time i would follow your direction and Antonio's advices about TButtonBmp to create a proper ui design.

Thanks and regards,
Detlef

Posted: Mon Feb 11, 2008 10:25 pm
by James Bott
Detlef,

Those pesky bosses...

James

Posted: Tue Feb 12, 2008 7:53 am
by Detlef Hoefner
James,
James Bott wrote:Detlef,

Those pesky bosses...

James
yeah, i would like them to read some of your guides :wink: ...

Detlef