OpenDCL Forums

OpenDCL => Show and Tell => Topic started by: jb on June 06, 2008, 11:02:08 AM

Title: OpenDCL 5.0.0.17 - Custom "Tray" form template
Post by: jb on June 06, 2008, 11:02:08 AM
Please take Note:
The following will only work on Alpha 17 and later!!!

The latest Alpha build of OpenDCL includes two new form events: MouseEntered and MouseMovedOff.  Well I've taken these two events and created "expandable" forms - kinda like palettes but more toolbar like - horizontal.  I actually like them better than palettes: mine sit "rolled-up" just under my toolbars and expand when needed, take a look:

Rolled-up

(http://i283.photobucket.com/albums/kk302/bothetraveler/RolledUp.jpg?t=1208199789)

when the mouse moves over; Rolled-down

(http://i283.photobucket.com/albums/kk302/bothetraveler/RolledDown.jpg?t=1208199341)

when the mouse moves off; Rolled-up

(http://i283.photobucket.com/albums/kk302/bothetraveler/RolledUp.jpg?t=1208199789)

Ok, so what I have for you guys today is a container template.  It already has all the code necessary to control the resizing, doc events, and command line entry stuff needed to control the form.  All you have to do is add whatever other controls to the form, and manage their events, as you would with a normal modeless form.  Don't change the names or pictures of the 3 "tray" controls - if you do you'll need to coordinate the lisp to match.

jb000.lsp is machine code that the OpenDCL editor creates to be wrapped in a fas or vlx file.  The method I employ here is best for a fas file (which is what use).

jb000.odcl is the OpenDCL form definition file that gets edited in the OpenDCL editor.

jb000-odclControl.LSP is a standard AutoLISP file where all the support and form control subs are found.  This is where you'll add all the additional controls code that are added to the form in jb000.odcl.

So, basically jb000-odclControl.LSP is already to go.  Drag and drop into AutoCAD and type "test" at the command line.  The form shows initially rolled up.  Move the mouse over and off the form to see it roll up and down.  Use the "Tray" button - the one with the little arrow on it - to "pin" the form down, and then to restore it to mouse event mode.  The little button with the x is to close the form.  Note that a registry entry will be made to save the expanded state of the form so the form will expand the same in all opened documents.

Well, let me know what you think.  I think all the support subs are there - but ya know I might have missed a couple.  :lol:

Code assumes OpenDCL is already loaded - and it doesn't check version info (prolly should)
Title: Re: OpenDCL 5.0.0.17 - Custom "Tray" form template
Post by: BazzaCAD on June 06, 2008, 11:10:31 AM
Wow, looks great JB. Thx for the template. Maybe we should add it to the samples folder.
Can you add an animated GIF in this post to show the roll-up & roll-down working?
Title: Re: OpenDCL 5.0.0.17 - Custom "Tray" form template
Post by: jb on June 06, 2008, 01:06:50 PM
Download it and make sure everything works and then heck yeah - throw it in the samples folder!!

I've never made an animated GIF before  :-[  maybe someone with that nifty movie software can make a short for us???
Title: Re: OpenDCL 5.0.0.17 - Custom "Tray" form template
Post by: Fred Tomke on June 06, 2008, 01:40:57 PM
Hello, I tried it. A bit fast, maybe.

Fred
Title: Re: OpenDCL 5.0.0.17 - Custom "Tray" form template
Post by: BazzaCAD on June 06, 2008, 03:32:51 PM
Cool, looks good. thx Fred.