Author Topic: Document StatusBar (autocad2007)  (Read 2785 times)

0 Members and 1 Guest are viewing this topic.

itcad

  • Guest
Document StatusBar (autocad2007)
« on: May 22, 2008, 08:51:27 AM »
Am I missing something, or am I missing something? This should display a status bar with a pane just below my active drawing and just above Application's status bar:

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.
         
         //Add the button to the documents status bar
         acadApp.DocumentManager.MdiActiveDocument.StatusBar.Panes.Add(au2005DocPaneButton);
      }

But it does not. Is there some sysvar (or registry setting) preventing my document statusbar from displaying?

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8851
  • AKA Daniel
Re: Document StatusBar (autocad2007)
« Reply #1 on: May 24, 2008, 10:42:44 PM »
I dunno! I would be interested in this too, since I looked for about 20 minutes ant couldn’t find it..

Glenn R

  • Guest
Re: Document StatusBar (autocad2007)
« Reply #2 on: May 25, 2008, 01:06:14 PM »
Are you wanting to add a pane to the application's statusbar or each documents documentbar?

If it's the application, after you add the pane, call acadApp.StatusBar.Update().

If it's for each document's documentbar, then you need to turn on the display of the documentbars.

Glenn R

  • Guest
Re: Document StatusBar (autocad2007)
« Reply #3 on: May 25, 2008, 01:11:17 PM »
The arx function to wrap is:

acedShowDrawingStatusBars()

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8851
  • AKA Daniel
Re: Document StatusBar (autocad2007)
« Reply #4 on: May 28, 2008, 09:13:06 PM »
Great!  thanks Glenn  :-)

Code: [Select]
[DllImport("acad.exe",EntryPoint="?acedShowDrawingStatusBars@@YAHH@Z",
      CallingConvention = CallingConvention.Cdecl)]
    extern static private int ShowDrawingStatusBars(bool flag);

&

Code: [Select]
[CommandMethod("CreateDocPane")]
    public static void AddDocumentPane()
    {
      ShowDrawingStatusBars(true);//<---

      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
      AcAp.Application.DocumentManager.MdiActiveDocument.StatusBar.Panes.Add(au2005DocPaneButton);
    }