UBBFriend: Email This Page to Someone!
  Computer Workshop User Forums
  General Questions about EZGUI
  Scratching my head

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   Scratching my head
Russ Srole
Member
posted 03-06-2008 12:50 AM     Click Here to See the Profile for Russ Srole     Edit/Delete Message Reply w/Quote
Chris,

I'm very confused. I have a couple of different projects I'm working on. One that's been around for a year and a half or so and the other is brand new. On the old one when I click on %ez_ownerdraw for a button in the designer, it generates Ez_ODButton as we would expect. In the new project it generates the Ez_Button instead. I must be missing something, but I can't figure it out. There's no pre-processing used in the new project.

TIA,
Russ

Chris Boss
Administrator
posted 03-06-2008 09:12 AM     Click Here to See the Profile for Chris Boss     Edit/Delete Message Reply w/Quote
Make sure you select a color in the control properties dialog. This will force the control to ownerdraw.

If the problem does not disappear after that, email me a copy of the problem form so I can check it.

chrisboss@naxs.bet

Russ Srole
Member
posted 03-06-2008 09:57 AM     Click Here to See the Profile for Russ Srole     Edit/Delete Message Reply w/Quote
That was it. Simple operator head space on my part. I didn't think it was an ezgui problem.

On another subject, I am experimenting with using the standard xp theme on a project. Themes don't seem to allow a control like a radio box to have the invisible attribute. Is that what you have found as well? Is there a way to beat it? I like the look of some of the themed controls, but it would still be nice to draw my own background.

Thanks,
Russ

Chris Boss
Administrator
posted 03-06-2008 10:16 AM     Click Here to See the Profile for Chris Boss     Edit/Delete Message Reply w/Quote
Themes, work differently than normal windows so you will need to test each control type out to see how they are effected by the themes.

Personally, I don't like the themes because of this.

As an example, when a progressbar is themed, you can no longer select a color for it.

If you do plan to use themes, the easiest way is to create a theme header file for your resource file. Header files have the .h file extension. Create a file (ie. mstheme.h ) and put the theme XML code in it. Then in the project properties dialog, select this as a user resource header. This will add your user header file to the projects resource file using the include directive.

Frank Kelley
Member
posted 03-06-2008 08:24 PM     Click Here to See the Profile for Frank Kelley     Edit/Delete Message Reply w/Quote
Russ:

I don't know if this will help you directly, but I ran into a version of this problem when using a theme and the tab control in WinXP. With a theme, XP uses a gradient background on the tab control. Setting a radio button or check box control to transparent (invisible) background produces a nice black box in place of a transparent control. Not satisfactory.

My first solution was to determine a "middle" color that was a close match to the gradient color and simply re-color the control to match. However, someone using XP with the classic Windows interface (or using Windows 2000) gets a control with a white background on an otherwise gray tab control.

Here's the fix I used that worked for me:

First, create a custom color that matches the background color of your themed parent control or form (I made this color for the gradient tab control one of the permanent custom controls in the EZGUI Designer).

code:



EZ_DefColorL 36, &HF8F8F8

(This is an off-white that closely matches the background of the themed tab control in XP.)

Next, create a global variable to hold information about the O/S on the user's machine and initialize it as follows:

code:



gOS& = EZ_GETOS(0)
IF gOS& > 500 THEN
gOS& = VAL(ReadRegistryString$(%HKEY_CURRENT_USER, _
"Software\Microsoft\Windows\CurrentVersion\ThemeManager", _
"ThemeActive"))
ELSE
gOS& = 0
END IF

This segment determines if the user has Windows XP (or a different O/S) and if the user has XP whether themes are enabled or not. If the classic interface is being used, no re-coloring of the control will take place.

Next, in the %EZ_Loading event for each of your problem controls (such as the check box or radio button), add this:

code:



CASE %EZ_Loading
LoadColor(gOS&)

And finally, include this macro:

code:



MACRO LoadColor(x)
IF x > 0 THEN
EZ_COLOR 0, 36
ELSE
EZ_COLOR -1, -1
END IF
END MACRO

Just substitute the color number (36 in my example) for the custom color you need for drawing your background. If themes are being used, you'll get your themed color, otherwise, you get Windows' famous battleship gray.

One additional step: you could modify the macro as follows:

code:



MACRO LoadColor(fg, bg)
IF gOS& > 0 THEN
EZ_COLOR fg, bg
ELSE
EZ_COLOR -1, -1
END IF
END MACRO

This will let you set both the foreground and background of each "problem" control specifically for whatever color scheme you decide on. You would only have to define the colors you want to use in your initialization code.

Whew! It looks like a lot of work (but it's really not). Maybe it will help resolve your problem.

All times are EST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Computer Workshop ( EZGUI ) Home Page

Copyright 2000 to 2007 Christopher R. Boss

Powered by: Ultimate Bulletin Board, Version 5.44
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.