Page 1 of 2

Theme support for tToolbar

Posted: Tue Aug 21, 2007 6:23 pm
by TimStone
I'm a bit puzzled. I'm using the TToolbar class, and I expected to see the theme applied to it ... but it doesn't appear to be. I can see that the toolbar background on your newly updated preview class responds to the theme.

Is there a setting I'm missing or is it not supported in 7.07 ?

Tim

Posted: Tue Aug 21, 2007 6:57 pm
by Antonio Linares
Tim,

You should have themes support on the toolbar if you are including the themes manifest file in your rc file:

1 24 "WindowsXP.Manifest"

You can find that file at samples\winxp

Toolbar

Posted: Tue Aug 21, 2007 10:32 pm
by TimStone
Antonio,

I have themes working on virtually everything else. However, I'm getting a flat color for the toolbar.

Tim

TOOLBAR theme not working !

Posted: Wed Aug 22, 2007 4:10 pm
by TimStone
http://www.masterlinksoftware.com/Files/toolbar.bmp

Here is a cut of the main menu in the program. You can see that the menu bar responds to the theme, but clearly the toolbar does not. Also, I have the same result with rpreview

If you think this is correct behavior, it is contrary to the toolbar behavior in all Microsoft applications ...

Tim

Posted: Wed Aug 22, 2007 4:29 pm
by James Bott
Tim,

Just a thought. I know you said you are using TToolbar, can you confirm that you are indeed using TToolbar and not FW's own buttonbar (TBar class)?

Also, have you tryed it under XP to see if it is a Vista issue only?

I have never used TToolbar so I don't know what the behavior is.

James

Class

Posted: Wed Aug 22, 2007 7:03 pm
by TimStone
Good morning,

Yes, I'm using tToolbar. I was advised to do this by Antonio a couple of years ago. So ...

The following is the start of the code:

// First create the ImageList object for all the bitmaps
oImageList := TImageList():New( 28, 28 ) // width and height of bitmaps
// Now create the toolbar object for adding the buttons
oToolBar := TToolBar():New( oWnd, 30, 32, oImageList )

From here I actually add the buttons with the following lines:

oImageList:AddMasked( TBitmap():Define( "CLIP", , oWnd ), nRGB( 255, 255, 255 ) )
oToolBar:AddButton( { || PRO100M( )}, "Workorders", ) // "Work" )

Yes, the same result is seen in XP

Posted: Wed Aug 22, 2007 7:50 pm
by Antonio Linares
Tim,

Please try samples\rebars.prg. It should look ok with themes.

It seems that higher toolbars don't get the theme look. If you build samples\ToolBar1.prg you'll see that it looks like yours.

Rebars

Posted: Wed Aug 22, 2007 8:03 pm
by TimStone
So toolbars doesn't work properly...

Tim

Posted: Wed Aug 22, 2007 8:07 pm
by Antonio Linares
Tim,

It looks as a standard Windows behavior: Themes are seen only on small height toolbars.

Anyhow when you move the mouse over a toolbar button, you should see the themed button
Image

Small height toolbar ?

Posted: Wed Aug 22, 2007 8:31 pm
by TimStone
OK ... resolved the problem by putting it onto a tReBar with oPanel ... but is there a way to set the baloon style like what you used ?

Posted: Wed Aug 22, 2007 10:01 pm
by Antonio Linares
Tim,

Use the BALLOON clause when creating the toolbar:

DEFINE TOOLBAR oToolBar OF oWnd SIZE 50, 58 ; // 50, 50 ;
IMAGELIST oImageList BALLOON

Balloon

Posted: Wed Aug 22, 2007 11:19 pm
by TimStone
Got it ... thanks ... all is now working well ! :D

Posted: Thu Aug 23, 2007 8:38 am
by Richard Chidiak
Antonio

Is there a way of setting "BALLOON" as default tooltip style ?

Richard

Posted: Thu Aug 23, 2007 9:03 am
by Antonio Linares
For the toolbars, you need to modify the class in this line:

::lTTBalloon := lTTBalloon // change this into .T.

For other tooltips, modify Class TWindow here:

hWnd = CreateToolTip( Self:hWnd, cToolTip ) // , .t. ) for ballon tooltips !

Separator

Posted: Thu Aug 23, 2007 11:09 pm
by TimStone
Antonio ...
The sample has a vertical doted line ... how is that formed.

Also, you have a dark, full height, separator but the XP format is a shorter, lighter, line vertically centered. Is there a fix or setting to attain that capability.