.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Autocad 2006 & StatusBarItem

1 REPLY 1
Reply
Message 1 of 2
Anonymous
305 Views, 1 Reply

Autocad 2006 & StatusBarItem

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
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost