PageControl - MenuButton TabMenu and VCL styles

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

PageControl - MenuButton TabMenu and VCL styles

Postby marekduba » Tue Nov 04, 2014 7:35 am

RzPageControl has ShowMenuButton=True

When application running with default windows style, TabMenu appears fine.
When application running with another VCL style, eg. Amethyst Kamri, TabMenu appears with China Traditional captions?

Marek
Attachments
tabs.png
tabs.png (16.95 KiB) Viewed 9613 times
marekduba
 
Posts: 6
Joined:
Fri Aug 15, 2014 9:30 am

Re: PageControl - MenuButton TabMenu and VCL styles

Postby Raize Support » Tue Nov 04, 2014 8:24 pm

Thanks for the report. What version of Delphi are you using?

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

Re: PageControl - MenuButton TabMenu and VCL styles

Postby Raize Support » Tue Nov 04, 2014 9:00 pm

Ok. I figured out that you are also using a TRzMenuController in your application. I was finally able to duplicate the problem. The problem is that the owner draw code is not being properly connected because of the way the dropdown menu is created. This will be fixed for the next build. In the meantime you can fix this by making the following modification:

Code: Select all
constructor TRzTabMenuButton.Create( AOwner: TComponent );
begin
  inherited;
  FTabControl := TRzCustomTabControl( AOwner );
  FFrameColor := clBtnShadow;
  FMenu := TPopupMenu.Create( GetParentForm( AOwner as TRzCustomTabControl ) );   //!! CHANGED LINE
end;


After making the change, you can rebuild the components by running the !Build_RC6.cmd file to rebuild the components and packages.

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

Re: PageControl - MenuButton TabMenu and VCL styles

Postby marekduba » Wed Nov 05, 2014 3:38 am

I am using XE6. TRzMenuController is not in my project.

Patch works!

Marek
marekduba
 
Posts: 6
Joined:
Fri Aug 15, 2014 9:30 am

Re: PageControl - MenuButton TabMenu and VCL styles

Postby marekduba » Wed Mar 04, 2015 4:32 pm

Hi, patch "works", but:

if I set ShowMenuButton property to True, the unnamed PopupMenu will apear on Form. And this is DFM stream of PopupMenu

object TPopupMenu
end

And if I create a descendant of that form, Delphi shows an error: Error creating form. Cannot inherit from form 'Form1'. It contains a component with a blank name property.

Marek
marekduba
 
Posts: 6
Joined:
Fri Aug 15, 2014 9:30 am

Re: PageControl - MenuButton TabMenu and VCL styles

Postby Raize Support » Wed Mar 04, 2015 5:42 pm

Hi Marek,

Are you able to duplicate the problem in a simple test project? If so, please send the source code (no executables) to support@raize.com and we would be happy to take a closer look.

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

Re: PageControl - MenuButton TabMenu and VCL styles

Postby marekduba » Thu Mar 19, 2015 11:27 am

Yes, to duplicate this, follow these steps (it is simple)
1) Rebuild and reinstall RaizeComponentsVcl and RaizeComponentsVcl_Design including patch in this thread.
2) Create a new VCL Form project
3) Put a TRzPageControl on a Main Form
4) Set ShowMenuButton property to True on PageControl
The empty name PopupMenu will appears :) Like printscreen in attachement

Marek
Attachments
PopupMenu.png
PopupMenu.png (5.99 KiB) Viewed 9277 times
marekduba
 
Posts: 6
Joined:
Fri Aug 15, 2014 9:30 am

Re: PageControl - MenuButton TabMenu and VCL styles

Postby Raize Support » Fri Mar 20, 2015 1:24 am

Okay. Now I understand the issue. Thank you for posting the detailed steps and the screen capture. We will investigate.

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

Re: PageControl - MenuButton TabMenu and VCL styles

Postby Raize Support » Sat Mar 21, 2015 5:36 pm

Hi Marek,

Just posting a follow-up to this issue. Well, actually the original issue. (The "work-around" that I posted is not really a good solution because of the problem with the popup menu showing up on the form designer. This has been removed from the code base.)

Anyway, I was able to isolate the core problem while researching another report we received that involved the TRzMenuButton and VCL Styles. The TRzMenuButton uses a TPopupMenu to display the drop down menu, much like the TRzPageControl uses a TPopupMenu to display the list of tab sheets. I won't bore you with the details of my research, but in the end the problem is rooted in the VCL, specifically in the enhancements made to VCL Styles introduced in XE6 where menus are automatically themed according to the selected VCL Style.

The problem occurs if the popup menu that is being displayed is NOT owned by the form *and* an Image List is associated with the popup menu. In this case, none of the captions of the menu items show up. In the example illustrated by your original screen shots, the popup menu is owned by the TRzPageControl and not the form, and there are images displayed because the tabs have images. In the example with the TRzMenuButton, the problem occurred because the TRzMenuButton and the TPopupMenu were on a Frame that was placed onto a form. As a result, the TPopupMenu was owned by the frame and not the form. The popup menu also used an image list.

As a result, I was able to duplicate the problem using only standard VCL controls in XE6 and XE7. We are hopeful that this will be fixed for the next release of Delphi.

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

Re: PageControl - MenuButton TabMenu and VCL styles

Postby marekduba » Mon Mar 23, 2015 7:28 am

I see.

What about something like this:

if not (csDesigning in ComponentState) then // prevents PopupMenu in IDE
FMenu := TPopupMenu.Create( GetParentForm( AOwner as TRzCustomTabControl ) );
marekduba
 
Posts: 6
Joined:
Fri Aug 15, 2014 9:30 am

Next

Return to Panels

Who is online

Users browsing this forum: No registered users and 2 guests

cron