BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

XPDesign & buttons

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
Bob Richardson
Guest





PostPosted: Tue Dec 09, 2003 6:35 pm    Post subject: XPDesign & buttons Reply with quote



XPDesigns sure was easy to implement, but I've notice some anomalies.
(That's a 50 cent word for "issues")

All my TButtons have the new XP look, but my TBitBtns don't. This
inconsistency isn't the best. Anyone know how to get the XP look on
TBitBtns?


Back to top
Rob Kennedy
Guest





PostPosted: Tue Dec 09, 2003 8:02 pm    Post subject: Re: XPDesign & buttons Reply with quote



Bob Richardson wrote:
Quote:
XPDesigns sure was easy to implement, but I've notice some anomalies.
(That's a 50 cent word for "issues")

All my TButtons have the new XP look, but my TBitBtns don't. This
inconsistency isn't the best. Anyone know how to get the XP look on
TBitBtns?

TBitBtn is a component implemented entirely within the VCL, and so the
manifest that XPDesign includes in your program (which is the *only*
thing that unit actually does) doesn't do any good. What the manifest
does is tell Windows XP which version of the common-control library to
link with your program. Version 6 of that library uses different drawing
routines than prior versions. Since TBitBtn isn't implemented by that
library, it doesn't matter which library is linked.

Visit Delphi Gems (http://www.delphi-gems.com/) and get Mike Lischke's
TThemeManager component. It will subclass most VCL classes to ensure
everything gets drawn properly. It comes with a demonstration program
that lets you experiment with other controls, too.

XPDesign just includes a manifest resource in your program. You can get
the same effect without that unit simply by including a manifest file in
the same directory as your program.

--
Rob

Back to top
Bob Richardson
Guest





PostPosted: Wed Dec 10, 2003 1:04 am    Post subject: Re: XPDesign & buttons Reply with quote




"Rob Kennedy" <.> wrote

Quote:
Visit Delphi Gems (http://www.delphi-gems.com/) and get Mike Lischke's
TThemeManager component. It will subclass most VCL classes to ensure
everything gets drawn properly. It comes with a demonstration program
that lets you experiment with other controls, too.

Yes, TThemeManager changes the look of a lot more controls than XPDesign,
and it's very easy to use. Unfortunately, it radically changes the look of
all TGroupBoxes, which doesn't work for me. Do you know if there's a way to
inhibit the XPification Smile of specific controls, like TGroupBox?



Back to top
Bob Richardson
Guest





PostPosted: Wed Dec 10, 2003 3:49 am    Post subject: Re: XPDesign & buttons Reply with quote


"Bob Richardson" <bobr (AT) whidbey (DOT) com> wrote

Quote:

"Rob Kennedy" <.> wrote

Visit Delphi Gems (http://www.delphi-gems.com/) and get Mike Lischke's
TThemeManager component. It will subclass most VCL classes to ensure
everything gets drawn properly. It comes with a demonstration program
that lets you experiment with other controls, too.

Yes, TThemeManager changes the look of a lot more controls than XPDesign,
and it's very easy to use. Unfortunately, it radically changes the look of
all TGroupBoxes, which doesn't work for me. Do you know if there's a way
to
inhibit the XPification Smile of specific controls, like TGroupBox?

With very little snooping, I found where to set the GroupBox XPification to
FALSE. This component works perfectly for my needs. Thanks a lot Rob.



Back to top
Rob Kennedy
Guest





PostPosted: Wed Dec 10, 2003 3:45 pm    Post subject: Re: XPDesign & buttons Reply with quote

Bob Richardson wrote:
Quote:
Do you know if there's a way to inhibit the XPification Smile of
specific controls, like TGroupBox?

With very little snooping, I found where to set the GroupBox
XPification to FALSE. This component works perfectly for my needs.
Thanks a lot Rob.

Just for the record, you can tell a TThemeManager component to not theme
a TGrouBox by excluding the toSubclassGroupBox flag from the Options
property. For finer-grained control, you can handle the
OnAllowSubclassing event on a per-control basis.

--
Rob

Back to top
Bob Richardson
Guest





PostPosted: Wed Dec 10, 2003 5:46 pm    Post subject: Re: XPDesign & buttons Reply with quote

Playing with TThemeManager, I discovered that I must include XPDesign, but I
didn't see the need for this in any documentation.

Also, it seems I do not have control (in the OnAllowSubclassing event) over
those components that are themed by XPDesign. When I place

if Control.name = 'Button7' then
Allow := false;

in OnAllowSubclassing, nothing happens. This is a control themed by
XPDesign.

But when I put

if Control.name = 'BitBtn1' then
Allow := false;


in OnAllowSubclassing, that BitBtn is not themed, while the other BitBtns
are (this is what I expected).

I'm just trying to figure out what's going on. Why must I include XPDesign?
I presume that my TButtons and some other components are getting themed by
XPDesign, while the BitBtn components (and others) are being themed by
ThemeManager.


Back to top
Rob Kennedy
Guest





PostPosted: Wed Dec 10, 2003 6:35 pm    Post subject: Re: XPDesign & buttons Reply with quote

Bob Richardson wrote:
Quote:
Playing with TThemeManager, I discovered that I must include XPDesign, but I
didn't see the need for this in any documentation.

They perform two separate but related tasks.

XPDesign causes a manifest resource to be linked to your application. It
adds absolutely *no* code to your program. It just notifies Windows that
your program wants to use the new XP version of CommCtrl.dll. The
controls implemented by that library are sensitive to the OS theme
settings. Controls implemented by the previous version of that library
are ignorant of the OS settings.

TThemeManager makes other controls sensitive to the theme settings. In
particular, it subclasses certain VCL controls that paint themselves,
including TSpeedButton, TBitBtn, and TGroupBox. It also subclasses some
Windows controls that require special handling because they're wrapped
by VCL classes, including TListView, TStatusBar, and TTrackBar.

An alternative to XPDesign is to use a standalone manifest file in the
same directory as your program. You can see an example of this technique
in the Theme Explorer same program. ThemeExplorer.exe.manifest is the
name of the file. The pattern for naming a manifest file should be obvious.

Quote:
Also, it seems I do not have control (in the OnAllowSubclassing event) over
those components that are themed by XPDesign. When I place

if Control.name = 'Button7' then
Allow := false;

in OnAllowSubclassing, nothing happens.

It seems you're right. I've never used that event before; I've never
wanted partial theming.

Quote:
This is a control themed by XPDesign.

The control is themed by the OS. It's themed by virtue of having the
XPDesign unit used by the program.

Quote:
I'm just trying to figure out what's going on. Why must I include XPDesign?
I presume that my TButtons and some other components are getting themed by
XPDesign, while the BitBtn components (and others) are being themed by
ThemeManager.

I was able to stop a button from being themed by calling the
SetWindowTheme API function, from the UxTheme unit, in my form's OnShow
event. There's probably a better place than OnShow to call it, but I was
just seeing whether it could be done.

SetWindowTheme(Button1.Handle, nil, '');

If you can figure out how to incorporate that into TThemeManager to make
OnAllowSubclassing more effective, the component's author might be
interested in your findings.

--
Rob

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.