.NET

Reply
Valued Contributor
mrevelli
Posts: 84
Registered: ‎10-21-2003
Message 1 of 2 (99 Views)

Autocad 2006 & StatusBarItem

99 Views, 1 Replies
01-31-2006 01:12 AM
Hey all,
I need to add a Pane to the Application statusbar
Any example to use class Autodesk.AutoCAD.Windows.StatusBarItem ?
Thanks a lot in advance
Max
*Bobby C. Jones
Message 2 of 2 (99 Views)

Re: Autocad 2006 & StatusBarItem

01-31-2006 06:05 AM in reply to: mrevelli
Here is an example of adding panes to both the application and the document
status bars.

using System;

using Autodesk.AutoCAD.Runtime;

using Autodesk.AutoCAD.ApplicationServices;

using acadApp = Autodesk.AutoCAD.ApplicationServices.Application;

using Autodesk.AutoCAD.Windows;

namespace AU2005.AcadApi

{

//Pages 7 & 8

public class PaneButtonsExample

{

#region Application Pane

[CommandMethod("CreateAppPane")]

public static void AddApplicationPane()

{

Pane au2005AppPaneButton = new Pane();

//Set the buttons properties

au2005AppPaneButton.Enabled = true;

au2005AppPaneButton.Visible = true;

au2005AppPaneButton.Style = PaneStyles.Normal;

au2005AppPaneButton.Text = "AU2005 App. Pane";

au2005AppPaneButton.ToolTipText = "Welcome to Autodesk University 2005!";

//Hook into the MouseDown event to run code when the button is pressed.

au2005AppPaneButton.MouseDown += new
StatusBarMouseDownEventHandler(OnAppMouseDown);

//Add the button to the applications status bar

//Items can also be added to the tray area

acadApp.StatusBar.Panes.Add(au2005AppPaneButton);

}



private static void OnAppMouseDown(object sender,
StatusBarMouseDownEventArgs e)

{

Pane paneButton = (Pane) sender;

string alertMessage;

if (paneButton.Style == PaneStyles.PopOut)

{

paneButton.Style = PaneStyles.Normal;

alertMessage = "The application button is activated.";

}

else

{

paneButton.Style = PaneStyles.PopOut;

alertMessage = "The application button is de-activated.";

}

acadApp.StatusBar.Update();

acadApp.ShowAlertDialog(alertMessage);

}

#endregion



//Document pane code not shown in the handout

#region Document Pane

[CommandMethod("CreateDocPane")]

public static void AddDocumentPane()

{

Pane au2005DocPaneButton = new Pane();

//Set the buttons properties

au2005DocPaneButton.Enabled = true;

au2005DocPaneButton.Visible = true;

au2005DocPaneButton.Style = PaneStyles.Normal;

au2005DocPaneButton.Text = "AU2005 Doc. Pane";

au2005DocPaneButton.ToolTipText = "Welcome to Autodesk University 2005!";

//Hook into the MouseDown event to run code when the button is pressed.

au2005DocPaneButton.MouseDown += new
StatusBarMouseDownEventHandler(OnDocMouseDown);

//Add the button to the documents status bar

acadApp.DocumentManager.MdiActiveDocument.StatusBar.Panes.Add(au2005DocPaneButton);

}



private static void OnDocMouseDown(object sender,
StatusBarMouseDownEventArgs e)

{

Pane paneButton = (Pane) sender;

string alertMessage;

if (paneButton.Style == PaneStyles.PopOut)

{

paneButton.Style = PaneStyles.Normal;

alertMessage = "The document button is activated.";

}

else

{

paneButton.Style = PaneStyles.PopOut;

alertMessage = "The document button is de-activated.";

}

acadApp.DocumentManager.MdiActiveDocument.StatusBar.Update();

acadApp.ShowAlertDialog(alertMessage);

}

#endregion

}

}
--
Bobby C. Jones
http://www.acadx.com

wrote in message news:5072891@discussion.autodesk.com...
Hey all,
I need to add a Pane to the Application statusbar
Any example to use class Autodesk.AutoCAD.Windows.StatusBarItem ?
Thanks a lot in advance
Max
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.