Not getting PaneClick event? |
Post Reply |
Author | ||
blazej
Groupie Joined: 09 February 2005 Location: Canada Status: Offline Points: 53 |
Post Options
Thanks(0)
Posted: 22 April 2010 at 3:03pm |
|
Hi,
I'm adding a pane to my status bar:
And then I have:
The pane gets added and all, but I never get the PaneClick event... I'm using C#, .NET 2.0, VS 2008, CommandBars v 13.1, Win XP 64 bit but my app is 32 bit. Best, Michal |
||
blazej
Groupie Joined: 09 February 2005 Location: Canada Status: Offline Points: 53 |
Post Options
Thanks(0)
|
|
Seriously, no one is going to answer this question?
So why exactly have we renewed our license recently??? Best, Michal |
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Hi,
I'm not familiar with C# but I looked at a sample (C# StatusBar sample)
StatusBar = CommandBars.StatusBar; //using Commandbars statusbar?
StatusBar.PaneClick += new XtremeCommandBars.IStatusBarEvents_PaneClickEventHandler(this.StatusBar_PaneClickEvent);
private void StatusBar_PaneClickEvent(XtremeCommandBars.StatusBarPane e)
{ .....}
I'm also disappointed that no one replied on this, looks like an easy question (if you are using C#) You better look at the StatusBar sample that comes with the install
|
||
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
||
blazej
Groupie Joined: 09 February 2005 Location: Canada Status: Offline Points: 53 |
Post Options
Thanks(0)
|
|
Yeah, actually I tried it again, and it works. The only thing I changed, I think, was the ID of the pane...
Anyway, thanks Aaron! Michal |
||
blazej
Groupie Joined: 09 February 2005 Location: Canada Status: Offline Points: 53 |
Post Options
Thanks(0)
|
|
Hi again,
Actually, it still doesn't work. I get the event immediately after the application loads, but once I load some data, the event stops being fired. I've searched through my code, but the only thing the action of loading data does is to change the text of another status bar pane. Even if I comment out the code that changes the text, the event still does not get fired. Help, anyone? What could be causing the event to stop firing? Michal |
||
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
|
If this is MDI, be sure you do this:
foreach (Control ctrl in this.Controls) { if (ctrl is MdiClient) { CommandBars.SetMDIClient(ctrl.Handle.ToInt32()); } } Then add status bar: public XtremeCommandBars.StatusBar StatusBar; StatusBar = CommandBars.StatusBar; StatusBar.PaneClick += new XtremeCommandBars.IStatusBarEvents_PaneClickEventHandler(this.StatusBar_PaneClickEvent); StatusBar.PaneDblClick += new XtremeCommandBars.IStatusBarEvents_PaneDblClickEventHandler(this.StatusBar_PaneDblClickEvent); StatusBar.MouseDown += new XtremeCommandBars.IStatusBarEvents_MouseDownEventHandler(this.StatusBar_MouseDownEvent); CommandBars.StatusBar.Visible = true; Then add some pane: XtremeCommandBars.StatusBarPane Pane; Pane = StatusBar.AddPane(0); Pane.Style = XtremeCommandBars.XTPStatusPaneStyle.SBPS_STRETCH | XtremeCommandBars.XTPStatusPaneStyle.SBPS_NOBORDERS; Pane.Text = "Ready"; Pane.Width = 0; //Auto Size private void StatusBar_PaneClickEvent(XtremeCommandBars.StatusBarPane e) { System.Diagnostics.Debug.WriteLine ("PaneClick. Id = " + e.Id); } ....................... |
||
blazej
Groupie Joined: 09 February 2005 Location: Canada Status: Offline Points: 53 |
Post Options
Thanks(0)
|
|
Hi,
No, it's not MDI. We are using DockingPane with a single document window (and many additional panes). Also, we load the command bars like this: _commandBars.LoadDesignerBars( null, null ); Best, Michal |
||
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
|
DesignerBars should make no difference, so you have all the code I posted in that same order, except the for each?
Do you have this set after you add your status bar? Do you create the panes after the commandbars? DockingPaneManager.SetCommandBars (CommandBars.GetDispatch()); |
||
blazej
Groupie Joined: 09 February 2005 Location: Canada Status: Offline Points: 53 |
Post Options
Thanks(0)
|
|
My order is different:
_commandBars.LoadDesignerBars( null, null ); _commandBars.StatusBar.Visible = true; _commandBars.StatusBar.AddPane( 0 ); _commandBars.StatusBar.PaneClick += OnStatusBarPaneClick; If I move the event assignment up (before setting Visible) it is even worse, i.e. the event doesn't get fired even before a document is loaded. My panes are created and initialized AFTER the bars. Best, Michal |
||
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
|
Please add code exactly as I put in previous threads and in this order:
public XtremeCommandBars.StatusBar StatusBar; _CommandBars.LoadDesignerBars( null, null ); StatusBar = _CommandBars.StatusBar; StatusBar.PaneClick += new XtremeCommandBars.IStatusBarEvents_PaneClickEventHandler(this.StatusBar_PaneClickEvent); _CommandBars.StatusBar.Visible = true; XtremeCommandBars.StatusBarPane Pane; Pane = _commandBars.StatusBar.AddPane( 0 ); private void StatusBar_PaneClickEvent(XtremeCommandBars.StatusBarPane e) { System.Diagnostics.Debug.WriteLine ("PaneClick. Id = " + e.Id); } |
||
blazej
Groupie Joined: 09 February 2005 Location: Canada Status: Offline Points: 53 |
Post Options
Thanks(0)
|
|
No luck.
Here's my code: _commandBars.LoadDesignerBars( null, null ); // Status bar setup. StatusBar statusBar = _commandBars.StatusBar; statusBar.PaneClick += OnStatusBarPaneClick; statusBar.Visible = true; statusBar.AddPane( 0 ); StatusBarPane pane = statusBar.AddPane( ID.PANE_DATA_TYPE ); pane.Width = mainForm.StatusBarInfoPaneWidth; pane.Alignment = XTPTextAlignment.xtpAlignmentRight; pane.Text = string.Empty; statusBar.AddPane( ID.PANE_INDICATOR_CAPS ); statusBar.AddPane( ID.PANE_INDICATOR_NUM ); statusBar.AddPane( ID.PANE_INDICATOR_SCRL ); StatusBarPane plotCreationPane = statusBar.AddPane( ID.PANE_DEBUG_PLOT_CREATION ); plotCreationPane.IconIndex = ID.CMD_DEBUG_PLOT_CREATION; plotCreationPane.Button = true; StatusBarPane dumpBeforePane = statusBar.AddPane( ID.PANE_DEBUG_DUMP_BEFORE ); dumpBeforePane.IconIndex = ID.CMD_DEBUG_DUMP_BEFORE; dumpBeforePane.Button = true; StatusBarPane dumpAfterPane = statusBar.AddPane( ID.PANE_DEBUG_DUMP_AFTER ); dumpAfterPane.IconIndex = ID.CMD_DEBUG_DUMP_AFTER; dumpAfterPane.Button = true; SetChecked( ID.CMD_VIEW_STATUS_BAR, true ); SetChecked( ID.CMD_VIEW_TOOLBAR, true ); commandBars.GlobalSettings.App = mainForm; And then: void OnStatusBarPaneClick( StatusBarPane pane ) { pane.Checked = !pane.Checked; if( pane.Id == ID.PANE_DEBUG_PLOT_CREATION ) { // ... } } |
||
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
|
Actually, that still isn't my code ;)
Notice where I declare Statusbar....I assumed the Public keyword would have given that away. You are re-declaring locally so it can't work. public class frmMain : System.Windows.Forms.Form { public AxXtremeCommandBars.AxCommandBars CommandBars; private AxXtremeCommandBars.AxImageManager ImageManager; static public frmMain Instance; public XtremeCommandBars.StatusBar StatusBar; ...... Also the pane click handler is not as I wrote: StatusBar.PaneClick += new XtremeCommandBars.IStatusBarEvents_PaneClickEventHandler(this.StatusBar_PaneClickEvent); If you can't figure it out just attach the project and I'll fix it for you. |
||
blazej
Groupie Joined: 09 February 2005 Location: Canada Status: Offline Points: 53 |
Post Options
Thanks(0)
|
|
Hi,
StatusBar.PaneClick += new XtremeCommandBars.IStatusBarEvents_PaneClickEventHandler(this.StatusBar_PaneClickEvent); and StatusBar.PaneClick += StatusBar_PaneClickEvent; are the same in C#. But the trick with using a class member instead of a local variable worked! Can you explain this to me? Normally it should matter at all if it is one or the other... But maybe OCX are special... Best, Michal |
||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |