Composit Forms

Started by jb, August 11, 2008, 07:13:48 AM

Previous topic - Next topic

jb

I posted this over at theSwamp.org and thought I might post here:

Composit Forms, what the heck is that you ask.  Well, unlike DCL, OpenDCL forms can be displayed anywhere on the monitor.  Now this is nice when you have "floating" modeless forms: you can show them at a specific location.  What I've done in the following example is use that ability to "transform" a floating modeless form to a toolbar like form.  I got the idea on one of my larger projects.  The idea came about when I realized that once a user "learns" the intricacies of a program, some of the more informative controls are no longer needed.  Or, if a program is used intermittently, it would be nice to switch back and forth between a tool bar like form to one with more information.

The too projects of mine that I switched over to take advantage of this ability are too large and focused to make good examples.  But what did make a perfect example is Tim Spangler's BrickWorx program that CAB and I collaborated on:

http://www.theswamp.org/index.php?topic=23425.0

I realized that once you got to know what the heck a JackArch with a Keystone was, you really didn't need the big floating Palette:



So really all you need is a nifty toolbar with a drop-down control that lists the different BrickWorx options.  So hit the "Roll-up" button on the form above and instead of just a lifeless bar you get this: (or you can call it with the command "BrickWorxTB")



The "Roll-down" button on the far left will show the larger floating form with the tree control and preview.  The drop-down lists the different options and to the right is the draw button.  Now if your unsure about that jackarch because you haven't used BrickWorx in a while, just hit the preview button to the right of the draw button.



The slim gray bar to the right of the preview button is the close button for the toolbar.

Now, these forms will all follow each other as you move them around the screen (except the tool bar's preview - but it will follow once it's closed and then reopened.)  Use the space to the left of the "roll-up" button to move the tool bar form around.

The drop-down control has an event enabled: OnSelectionChanged:

(defun c:BW001_01_ComboBox_OnSelChanged (nSelection sSelText /)
  (bw:ToolBarDraw) ;<-- option 1: run the draw command
  ;(bw:Preview) ;<-- option 2: show the preview
  ;(princ (strcat "\n" sSelText)) ;<-- option 3: print to the command line
  (princ)
)


I have it set to draw the brick when a selection is changed.  Option 2 is to show the preview, and 3 do nothing but echo the brick option to the command line.

Well, have a look and use this example to play around with OpenDCL - the possibilities are really astounding!

:wink:

jb
James Buzbee
Managing Memeber
Black Horse Development, LLC

BazzaCAD

Very nice work, as always JB.
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

jb

Thanks Barry, just trying to get this thing "out there"!

Owen has done such a fantastic job - to think that a program this profound could go open source.  I hope this year see's Chad in a better place.
James Buzbee
Managing Memeber
Black Horse Development, LLC