TRzToolBar

Components on the Raize Panels palette: panels, group bars, page controls, splitters, toolbars, status bars, group boxes, etc.

TRzToolBar

Postby rhcarpenter » Mon Mar 30, 2015 9:52 pm

Is the TRzToolBar not compatible with Delphi Styles. I'm using a TRzToolBar immediately below a TMainMenu. When I try to use a style, the TRzToolBar displays up into the TMainMenu.

Randall H. Carpenter
rhcarpenter
 
Posts: 28
Joined:
Thu Apr 14, 2011 12:49 pm

Re: TRzToolBar

Postby Raize Support » Tue Mar 31, 2015 2:18 am

Hi Randall,

The TRzToolbar does indeed support VCL Styles and working with applications that have a TMainMenu. The RCDemo that comes with Raize Components supports VCL Styles and has a TRzToolbar and TMainMenu.

Can you duplicate the problem in a test project? If so, please send the source code (no executables) to support@raize.com and we'll take a look.

Ray
Raize Software Support
Raize Software
http://www.raize.com
Raize Support
 
Posts: 604
Joined:
Fri Mar 25, 2011 9:04 pm

Re: TRzToolBar

Postby rhcarpenter » Tue Mar 31, 2015 2:34 pm

OK. Since you indicated it works with Styles, I created a test project. I coded it line for line from my main project in which the problem occurred.

After adding a few lines of code I would compile and run to make sure all was good. And the TRzToolBar did behave as expected even when using styles. But I finally found the line of code causing the issue. After adding the following line of code, the TRzToolBar appears to slide up under the TMainMenu when using Styles.

Screen.OnActiveFormChange := UpdateMenuItems;

The UpdateMenuItems method contains only the following lines of code:

begin
CodeSite.EnterMethod('MainForm.UpdateMenuItems');

TMDaily.Enabled := True;
TMMonthly.Enabled := True;
TMYearly.Enabled := True;
LoginAction.Enabled := True;
OpenRemindersAction.Enabled := True;
FMInterfaceOptions.Enabled := LoginAction.Caption = '&Logout';

MMCCreateAPlusHistoryFile.Enabled := EnableAPlusHistoryMenu;

Application.ProcessMessages;
CodeSite.ExitMethod('MainForm.UpdateMenuItems');
end;


As I mentioned, after adding

Screen.OnActiveFormChange := UpdateMenuItems;

the TRzToolBar appears to slide up under the TMainMenu. When I hover the mouse over the menu, the TRzToolBtns appear, overwriting the menu items.

If I use the standard Windows style, the issue is not present.

Is this a bug? Or is there something else I need to do such as set some property to a particular value?

Your help is always appreciated.

Thanks,
Randall H. Carpenter
rhcarpenter
 
Posts: 28
Joined:
Thu Apr 14, 2011 12:49 pm

Re: TRzToolBar

Postby Raize Support » Wed Apr 01, 2015 12:31 am

Hi Randall,

Thanks for the detailed information. I was able to duplicate the effect you are seeing. The problem occurs only when you add the Application.ProcessMessages call in the UpdateMenuItems event handler.

Why do you need call ProcessMessages in this situation?

I suspect that the display problem is occurring because the ProcessMessages call is interfering with the VCL Style Hook classes that are registered to handle custom styling of the main menu.

Also, the same display problem occurs if you use a regular TPanel instead of a TRzToolbar.

Ray
Raize Software Support
Raize Software
http://www.raize.com
Raize Support
 
Posts: 604
Joined:
Fri Mar 25, 2011 9:04 pm


Return to Panels

Who is online

Users browsing this forum: No registered users and 2 guests

cron