StatusBar Panes

StatusBar Panes

Anonymous
Not applicable
642 Views
2 Replies
Message 1 of 3

StatusBar Panes

Anonymous
Not applicable
Hey everyone,

I'm adding in a Pane to the Application statusbar and everything is good.

I then tried looking for some method/function call to display a context menu
when my pane is right clicked.
In ARX I would have called DisplayPopupPaneMenu off a pointer to the
statusbar. I might be being particularly blind today,
but try as I might, I cannot find anything similar in the managed
wrappers...except for a reference in the Managed Function to ARX Map in the
help. The funny thing is, this supposedly wraps MaximumWidth which takes an
Int...obviously cleverly disguised.

So has anybody got a context menu to work for a pane click event and would
care to share?

Cheers,
Glenn.
0 Likes
643 Views
2 Replies
Replies (2)
Message 2 of 3

cgay
Enthusiast
Enthusiast
Glenn,
The documentation appears to be incorrect.
From the AutoCAD Managed Class Reference:
"MaximumWidth (Read/write)
Type
System.Int32

AcPane::DisplayPopupPaneMenu "
"virtual UINT

DisplayPopupPaneMenu(CMenu& menu);

menu Input menu object representing the context menu that will be displayed

This function displays a context menu above the pane. The context menu is aligned with the upper-left edge of the pane instead of being displayed where the user has clicked on the pane. This function should be used when displaying context menus for ACSB_POPUP style panes.

Returns an unsigned integer representing the ID of the menu item the user selected, or 0 if no menu item was selected
"
In .NET "Public Property MaximumWidth() As Integer", so i believe that this won't work.
But the 'Pane' class inherits from the 'StatusBarItem' class which exposes the event 'Public Event MouseDown(ByVal sender As Object, ByVal e As Autodesk.AutoCAD.Windows.StatusBarMouseDownEventArgs)'. I believe that you could use this event to catch the click then display your context menu.

Good Luck,
CG
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thanks for the reply.

Catching the click is not a problem...I am already doing that, however,
displaying the menu is eluding me.

I created a context menu in code, then when I try to use the show method of
the context menu, it wants a CONTROL object as one of arguments (the control
that owns the menu) and I can't see how to tie this back to the pane I
added.......

Any other suggestions?


wrote in message news:5005503@discussion.autodesk.com...
Glenn,
The documentation appears to be incorrect.
From the AutoCAD Managed Class Reference:
"MaximumWidth (Read/write)
Type
System.Int32

AcPane::DisplayPopupPaneMenu "
"virtual UINT

DisplayPopupPaneMenu(CMenu& menu);

menu Input menu object representing the context menu that will be displayed

This function displays a context menu above the pane. The context menu is
aligned with the upper-left edge of the pane instead of being displayed
where the user has clicked on the pane. This function should be used when
displaying context menus for ACSB_POPUP style panes.

Returns an unsigned integer representing the ID of the menu item the user
selected, or 0 if no menu item was selected
"
In .NET "Public Property MaximumWidth() As Integer", so i believe that this
won't work.
But the 'Pane' class inherits from the 'StatusBarItem' class which exposes
the event 'Public Event MouseDown(ByVal sender As Object, ByVal e As
Autodesk.AutoCAD.Windows.StatusBarMouseDownEventArgs)'. I believe that you
could use this event to catch the click then display your context menu.

Good Luck,
CG
0 Likes