Author Topic: Custom Drawing Tabs Interface... Where to Begin?  (Read 3761 times)

0 Members and 1 Guest are viewing this topic.

BlackBox

  • King Gator
  • Posts: 3770
Custom Drawing Tabs Interface... Where to Begin?
« on: May 24, 2012, 09:59:17 AM »
I know that one can host multiple WPF User Controls in an AutoCAD Palette, but I am not sure where to start in order to create a custom drawing tabs interface.

My initial thought was that an Event Monitor would create a new Tab, for each document opened (Tab Factory?), and populate the tab name by extracting the Document name.

A quick test, of setting the UserControl() to a height of 23, and width of Autosize, relegating the resultant Palette to:

Code - C#: [Select]
  1. *.DockEnabled = (DockSides)Convert.ToInt32(DockSides.Top) + Convert.ToInt32(DockSides.Bottom);

Sadly, did not do what I wanted.

** Edit - Am I doing with the code behind, what I should be doing with an XAML Style?

... Any tips on where to start reading, source code examples, etc.?

TIA
"How we think determines what we do, and what we do determines what we get."

BlackBox

  • King Gator
  • Posts: 3770
Re: Custom Drawing Tabs Interface... Where to Begin?
« Reply #1 on: May 24, 2012, 12:27:03 PM »
Okay, found an old (and ugly) thread about another popular and no longer available Tab application, that had one potential nugget of gold:

Quote from: Luis Esquivel
I end up using an implementation from this project in codeproject.com

Automatic Tab Bar for MDI Frameworks
http://www.codeproject.com/KB/docview/mditab.aspx?print=true

Attached is an image of a preview of the tabs... can be dock on top or bottom by moving the control.



Unfortunately, the source code available in the above quoted link is not only old (2003), but also in C++. I am new to C#.NET - Can anyone clarify if .NET is even capable of doing this task, or *must* I use ARX?

No wonder others used to charge for this kind of functionality, if, after these many years, there's *still* almost no documentation (that I can find on my lunch break).

Any help, guidance, pointing in the right direction, etc. would be greatly appreciated.
"How we think determines what we do, and what we do determines what we get."

TheMaster

  • Guest
Re: Custom Drawing Tabs Interface... Where to Begin?
« Reply #2 on: May 24, 2012, 01:16:12 PM »
Code - C#: [Select]
  1. *.DockEnabled = (DockSides)Convert.ToInt32(DockSides.Top) + Convert.ToInt32(DockSides.Bottom);

Enums that represent boolean true/false states (e.g., have the [Flags] attribute)
are manipulated using boolean operators like | (or), & (and), ^ (xor), and ~ (not):

Code - C#: [Select]
  1.  .DockEnabled = DockSides.Top | DocSides.Bottom;

Quote
... Any tips on where to start reading, source code examples, etc.?

putting tabs directly on the AutoCAD window requires C++ and MFC.

Though I won't say it'd be impossible with C#, it certainly wouldn't be
very easy, as it requires a lot of native API calls and handling private MFC
window messages.  It's not an easy endeavor if you've never used C++.
« Last Edit: May 25, 2012, 09:24:32 AM by TheMaster »

BlackBox

  • King Gator
  • Posts: 3770
Re: Custom Drawing Tabs Interface... Where to Begin?
« Reply #3 on: May 24, 2012, 01:20:47 PM »

putting tabs directly on the AutoCAD window requires C++ and MFC.

While I wouldn't say it would be impossible with C#, it certainly wouldn't be
very easy, as it requires a lot of native API calls and handling private MFC
window messages.  It's not an easy endeavor if you've never used C++.

... I 'spose I've got a bit of learning to do first. In the mean time, thanks for the clarification, Tony.

*tips hat*
"How we think determines what we do, and what we do determines what we get."

huiz

  • Swamp Rat
  • Posts: 917
  • Certified Prof C3D
Re: Custom Drawing Tabs Interface... Where to Begin?
« Reply #4 on: May 24, 2012, 01:37:28 PM »
There is a free Tabs application available, already one for the 2013 version.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

BlackBox

  • King Gator
  • Posts: 3770
Re: Custom Drawing Tabs Interface... Where to Begin?
« Reply #5 on: May 24, 2012, 02:34:14 PM »
There is a free Tabs application available, already one for the 2013 version.

Yes, I have been using Autodesk's free MdiTab plug-in for years.

Unfortunately, it is both bug-prone, and lacking in functionality.

Specifically, one can 'Save All' then 'Close All [Except this doc]' and will *still* be presented with a prompt to actually Save each drawing-one-at-a-time. Also, the interface should be able to be docked top & bottom, etc.
"How we think determines what we do, and what we do determines what we get."

LE3

  • Guest
Re: Custom Drawing Tabs Interface... Where to Begin?
« Reply #6 on: July 11, 2012, 11:23:27 AM »
Okay, found an old (and ugly) thread about another popular and no longer available Tab application, that had one potential nugget of gold:

Just curios - do you have the url link to that post (appears to be my aka or alias or old name of me - in there) ?

BlackBox

  • King Gator
  • Posts: 3770
Re: Custom Drawing Tabs Interface... Where to Begin?
« Reply #7 on: July 11, 2012, 11:32:14 AM »
Okay, found an old (and ugly) thread about another popular and no longer available Tab application, that had one potential nugget of gold:

Just curios - do you have the url link to that post (appears to be my aka or alias or old name of me - in there) ?

PM sent, as that tread contained a lot of personal attacks (from back in 2004) that have no place in this thread.

Cheers! :beer:
"How we think determines what we do, and what we do determines what we get."