| |
|

ActiveReports 6 Support
Started by leeg at 01-07-2010 7:03 AM. Topic has 8 replies.
 
 
 
|
|
Sort Posts:
|
|
|
|
01-07-2010, 7:03 AM
|
leeg
Joined on 11-26-2007
Shreveport, LA, USA
Posts 40
|
ToolStripMenuItem for Viewer control?
|
|
|
|
|
Now that the EUD uses .NET framework ToolStripMenuItems, it sure would be nice if the Viewer did as well. Are there any plans for this?
|
|
|
|
|
Report
|
|
|
|
01-09-2010, 4:00 AM
|
Sergey
Joined on 08-28-2004
Novosibirsk, Russia
Posts 3,017

|
Re: ToolStripMenuItem for Viewer control?
|
|
|
|
|
Hello, Could you please explain how exactly you would like to use the viewer and .NET toolstrip API Current AR Viewer API allows to:
- Add the existing toolstrip control in the standard viewer toolbar.
- Hide/customize the items of the standard toolbar.
- Invoke viewer functionality which is available in toolbar via API which means that the standard toolbar can be replaced with the custom implementation.
Sergey Abakumoff GrapeCity
|
|
|
|
|
Report
|
|
|
|
01-11-2010, 8:04 AM
|
leeg
Joined on 11-26-2007
Shreveport, LA, USA
Posts 40
|
Re: ToolStripMenuItem for Viewer control?
|
|
|
|
|
By your first answer, do you mean I can add .NET toolstrip controls to the Active Reports Viewer toolbar? The only thing I see that I can add are items that derive from ActiveReports' Tool class, which does not support drop down items. I want to add a ToolStripDropDownButton or ToolStripMenuItem with more items under it. Is there a way to do this?
Generally speaking, the .NET controls are a lot more flexible, so I was very pleased to see that you now use them in the Designer (especially with the .CreateToolStrips() method to generate them easily), but I was very surprised that you didn't implement the same new functionality in the Viewer.
|
|
|
|
|
Report
|
|
|
|
01-11-2010, 8:13 AM
|
Sergey
Joined on 08-28-2004
Novosibirsk, Russia
Posts 3,017

|
Re: ToolStripMenuItem for Viewer control?
|
|
|
|
|
Hello, That's correct that you can add the items that derive from Tool class. One of the derived classes is PlaceHolder. PlaceHolder class has Control property which allows to specify the hosted control. The hosted control can be ToolStrip. This was way you can add toolstrip or any other control(i.e. combobox) in the viewer toolbar: var toolStrip = new ToolStrip(); var ph = new PlaceHolder(); ph.Id = 2345; ph.Control = toolStrip; viewer1.Toolbar.Tools.Add(ph);
I can send you the running sample of that approach..
Sergey Abakumoff GrapeCity
|
|
|
|
|
Report
|
|
|
|
01-11-2010, 8:50 AM
|
leeg
Joined on 11-26-2007
Shreveport, LA, USA
Posts 40
|
Re: ToolStripMenuItem for Viewer control?
|
|
|
|
|
That's easy enough, but I just tested it and it has some problems:
- Keyboard accelerator does not work (I used "&Export", and pressing Alt-E did not open the item)
- An extra Separator is sometimes added.
- The horizontal size of the added item is not automatically adjusted, so a large amount of blank space is added after the text. (I had to adjust it by experimenting with Width values.
- Something is wrong with the vertical sizing. If I add a ToolStripMenuItem to the ToolStrip, hovering over the top level item shows a larger highlight area and the bottom of the highlight is cut off. If I add a ToolStripDropDownButton to the ToolStrip, hovering over the top item shows a smaller highlighted area than the other Active Reports items.
The important problem is the keyboard access. I can live with the cosmetic issues for now. This is all very cumbersome, though. Customizing menus in the new Designer is much nicer!
|
|
|
|
|
Report
|
|
|
|
01-11-2010, 9:47 AM
|
Sergey
Joined on 08-28-2004
Novosibirsk, Russia
Posts 3,017

|
Re: ToolStripMenuItem for Viewer control?
|
|
|
|
|
Thanks for the feedback! I brought the question of the customizing viewer toolbar using .NET toolstrip API to ActiveReports 6 Product Manager and Development Team attention. We will update this thread once the decisions are made.
Sergey Abakumoff GrapeCity
|
|
|
|
|
Report
|
|
|
|
01-11-2010, 9:53 AM
|
leeg
Joined on 11-26-2007
Shreveport, LA, USA
Posts 40
|
Re: ToolStripMenuItem for Viewer control?
|
|
|
|
|
Thank you for considering it!
|
|
|
|
|
Report
|
|
|
|
01-13-2010, 10:54 PM
|
Sergey
Joined on 08-28-2004
Novosibirsk, Russia
Posts 3,017

|
Re: ToolStripMenuItem for Viewer control?
|
|
|
|
|
Hello, I would like to provide some more thoughts. Internally the viewer's toolbar is implemented using .NET ToolStrip API. Which means that you can access to the "internal" toolbar's toolstrip. This feature is not supported. It was not designed, specified, implemented, tested, documented and shipped. It can change in further versions. You can use it at your own risk. Here is the sample of code which gets access to the toolbar's toolstrip and adds the new button: Type toolbarType = viewer.Toolbar.GetType(); BindingFlags flags = BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.NonPublic; PropertyInfo internalImpPointer = toolbarType.GetProperty("ToolStrip", flags); ToolStrip internalToolStrip = internalImpPointer.GetValue(viewer.Toolbar, new object[0]) as ToolStrip; ToolStripButton btn = new ToolStripButton("say hello", null, delegate { MessageBox.Show("Hello World"); }); internalToolStrip.Items.Add(btn); HTH
Sergey Abakumoff GrapeCity
|
|
|
|
|
Report
|
|
|
|
01-14-2010, 7:26 AM
|
leeg
Joined on 11-26-2007
Shreveport, LA, USA
Posts 40
|
Re: ToolStripMenuItem for Viewer control?
|
|
|
|
|
Thanks very much for that information, Sergey. I'd rather not use undocumented features, but I'll keep it in mind if my needs outweigh the risk (for now they don't).
|
|
|
|
|
Report
|
|
|
|
|
GrapeCity » Product Support » ActiveReports 6... » Re: ToolStripMenuItem for Viewer control?
|
|
|
|
|