TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Visual DCL Programming => Topic started by: jbuzbee on July 05, 2006, 02:54:37 PM

Title: VBA Controls Project
Post by: jbuzbee on July 05, 2006, 02:54:37 PM
OK, I've started a VBA controls project for the ObjectDCL community.  Hopefully this can be a project we all can learn from -I've sure learned alot from just creating this project.  I've included most of the more common controls found in ODCL.  Most of them I've got some pretty simple programming for, the ListView and TreeView I'm going to ask the VBA community to help out with.  I'll cross post this over at the VBA forum here at the swamp and also at the AutoDesk VBA discussion group.  Here's a look at the form:

(http://www.vpiarchitecture.com/images/VBAControlsForm.jpg)

The controls are:

ListView
TreeView
TextBox - coded for saving a view
ComboBox - one each for changing the active textstyle and dimstyle
ListBox - one each single and multiple select
Command Buttons - various applications - note the relationship with AutoLISP ("command" . . .)
Labels - interactive with other controls
Toggle Buttons - coded to switch from modelspace to paperspace
Option Buttons - coded to switch ortho on and off
Tab Control - contains the Dimstyle and TextStyle controls.
Picture Control

I've labeled the dvb file for today's date.  If anyone makes changes re-name with the date of the changes and perhaps even your initials.  Again, if anyone can help in providing code for the other controls - of better / different code for any controls I think this could be a useful project for many. 

Thankyou everyone who's helped thus far!!

jb
Title: Re: VBA Controls Project
Post by: Bob Wahr on July 05, 2006, 03:26:13 PM
Looks like a good start for it.  The question begs that if you are using VBA for the form, why not for the whole project although I fully understand that the comfort level can be much higher in some languages than others.  This is definitely a nice hybridisation.  I'm pretty snowed under at work this week but will try to help fill in blanks when I can.
Title: Re: VBA Controls Project
Post by: Bob Wahr on July 05, 2006, 03:51:36 PM
changed the filename to include tim (GMT) and made a few quick changes to some of your If/Thens

Instead of saying

If something Then
Else
do something here
End If

to get a negative result, use If Not to test for a false.

Code: [Select]
Public Sub initializeListBox1()
VBAControls.ListBox1.Clear

For Each entry In ThisDrawing.Layers
If Not entry.Name Like "*|*" Then
VBAControls.ListBox1.AddItem entry.Name
End If
Next
End Sub
Title: Re: VBA Controls Project
Post by: Bob Wahr on July 06, 2006, 08:43:51 AM
Just a thought but if every time it is changed, it gets attached into this thread, it could get not only difficult to keep track of but will potentially start taking up a good chunk of server space.  I'm thinking that you and a few other ODCL people who are interested in this project could form a committee of sorts. 
Changes could be submitted to you and included if approved. 
You can discuss what, if any added functionality would be nice and post it for people to work on.
If anyone has a suggestion, it could be decided upon before the person spends time working on it.
Title: Re: VBA Controls Project
Post by: Robert_s on July 06, 2006, 10:10:17 AM
Hello JP,

This is a good start for me. Thank you for this example. I was wondering
if you could also create a "Modeless" dialog box example with the same controls.

Most  of my Odcl projects are modeless. I use them between drawings.
Do you have a solution for  Odcl's...
1. Odcl_Form_IsActive 
2. OnDocActivate

Your help will be greatly appreciated.

Thanks,
Robert
Title: Re: VBA Controls Project
Post by: Bob Wahr on July 06, 2006, 11:40:13 AM
Robert,  You can make the same form modeless.  All you have to do is bring up your VBA IDE which you can do several ways, the easiest IMO being Alt+F11.  In the Project Pane, double click on VBAControls under Forms.  This will show the form in design mode.  Click on the title bar of the form so that the whole form is selected.  Now all of the Form's Properties are shown in the Property Pane.  Simply go down the list to "ShowModal" and set it to False.  You can also change it programatically so if you wanted a button that would toggle the form between modal and modeless you could do it.
Title: Re: VBA Controls Project
Post by: Robert_s on July 06, 2006, 12:07:14 PM
Bob,

Yes! It worked. There is life after Objectdcl after all.
Thank you for your detailed explanation & illustration. 

Now is there a way I can tell my drawing/s that this form
is loaded/active when switching between drawings and/or
when I open a new drawing? Just like Odcl's.
.."Odcl_Form_Active" and "OnDocActivate"?

I hope vba via autolisp has something similar.


Much Thanks,
Robert
Title: Re: VBA Controls Project
Post by: Bob Wahr on July 06, 2006, 12:29:37 PM
I am entirely unfamiliar with ODCL so I'm not sure exactly what Odcl_Form_Active or OnDocActivate do, but I'm guessing that OnDocActivate would be basically covered if you put this into the ThisDrawing Module
Code: [Select]
Private Sub AcadDocument_Activate()
MsgBox "What's up, Doc?"
End Sub
and thatOdcl_Form_Activate could be done by putting the following into the form code, which can be done by clicking VBAControls in the Project Pane, then right click and select View Code
Code: [Select]
Private Sub UserForm_Activate()
MsgBox "Formin' at the mouth!"
End Sub
Title: Re: VBA Controls Project
Post by: LE on July 06, 2006, 01:09:15 PM
Bob;

So, in that event is where the Modeless forms are updated?
Title: Re: VBA Controls Project
Post by: Robert_s on July 06, 2006, 01:14:43 PM
Le & Bob,

Thats exactly what I was trying to ask.

Lets say I first open 2 dwgs. Then I open a 3rd one.
On the 3rd dwg I loaded "vbacontrols.lsp". The layer
listbox will populate itself with that 3rd dwg layers.
Now when I switch to the first or second dwg I want the
layer listbox to update itself too with that current dwg's
layers..I guess this is where ODCL's event "OnDocActivate"
comes into play. I want to load again "vbacontrols.lsp".

And if I open a 4th dwg, I need something in my startup
lisp routine like ODCL's "Odcl_Form_Active" that if it
sees that the form it loaded/floating it will update the
form's layer listbox too with the 4th dwg's layers.(Or
load "vbacontrols.lsp" again?).

What do you think?


Robert,
Title: Re: VBA Controls Project
Post by: Bob Wahr on July 06, 2006, 01:34:21 PM
Ahh, I see.  Change the Userform_initialize sub to
Code: [Select]
Public Sub UserForm_Initialize()
Module1.FormStart
Message.Caption = "Use this project to aid in the transition from ObjectDCL to Hybrid Apps using VBA forms with AutoLISP!"
End Sub
add this to Module 1
Code: [Select]
Public Sub FormStart()
Module1.initializeToggleButtons
Module1.initializeOptionButtons
Module1.initializeListBox1
Module1.initializeListBox2
Module1.initializeComboBox1
Module1.initializeComboBox2
End Sub
and add this to ThisDrawing
Code: [Select]
Private Sub AcadDocument_Activate()
Module1.FormStart
End Sub
Is that what you're after?
Title: Re: VBA Controls Project
Post by: Bob Wahr on July 06, 2006, 01:55:57 PM
Here's an updated dvb although I took some liberties with the form.
Title: Re: VBA Controls Project
Post by: Robert_s on July 06, 2006, 02:02:16 PM
Bob,

Yes...!!!!!!!! It's funny how this morning your instructions
was to hit Alt+F11 to start up the VBA IDE. This was the
first time I've ever seen that "vba screen". It was quite
scary & intimidating.

In a scale to 1 to 10. I'm
a 6 with autolisp
a 7 with objectdcl
a 0 with Vba


Thanks to you & JB I think I'm a little confident now to start
learning VBA. 


Thank you guys for being around!!!!!


Robert,
Title: Re: VBA Controls Project
Post by: Bob Wahr on July 06, 2006, 02:11:59 PM
I use this comparison with both the difference between Micrstation and AutoCAD and the difference between VBA and Lisp.  It's pretty much the same as the difference between a standard calculator and a RPN HP calculator.  Both will get you there, you just have to train your brain to think a little differently.  This is a good place to learn it, there are a lot of very knowledgable, very helpful people here who will help you with any problems that you run into, many of whom were instrumental in my learning it as well (although I'm sure none of them would admit it.)
Title: Re: VBA Controls Project
Post by: jbuzbee on July 06, 2006, 04:10:38 PM
Robert - sorry I've been out on a job site!  Looks like you got the help you needed - isn't this site great?  I quickly read through the posts and implimented this on all my modeless forms. One word: AWSOME!  No more refresh button!!!!

Bob - a big thanks for the direction to the AcadDocument_Activate function.  I'm really diggin this VBA stuff.  :wink:

jb
Title: Re: VBA Controls Project
Post by: Kerry on July 06, 2006, 04:21:30 PM
Nice work James.
Title: Re: VBA Controls Project
Post by: paul_s on July 06, 2006, 09:57:28 PM
Hello,

The modeless form example has almost everything I have in
my ObjectDcl projects. Does Vba have a MonthPicker too?
Can somebody please add a command button that will load
or show a monthpicker. Then maybe return the user's selection
in a lisp variable?

Thank you.

Paul

Title: Re: VBA Controls Project
Post by: Bob Wahr on July 06, 2006, 11:55:48 PM
What is a monthpicker?  I'm sure it can be done.  The returning to a lisp variable is trickier as lisp and vba don't actually communicate well with each other.
Title: Re: VBA Controls Project
Post by: CmdrDuh on July 06, 2006, 11:56:56 PM
Is that where you pick the date icon, and it loads up a scrollable list of months?
Title: Re: VBA Controls Project
Post by: Bob Wahr on July 06, 2006, 11:59:58 PM
That's what it sounds like from the name, if so, that part would be hella easy.
Title: Re: VBA Controls Project
Post by: CmdrDuh on July 07, 2006, 12:02:16 AM
i think it might be a VB thing, but if we can add the reference, it should be available
Title: Re: VBA Controls Project
Post by: Bob Wahr on July 07, 2006, 12:08:10 AM
Trying to decide if I want to fire up acad tonight and fill in some of the holes.  Magic 8-ball says "Outlook not positive."  I'm not sure what it has against outlook.  It's that or get into the crap closet for cords, cables, keyboard, etc to check out the 486.
Title: Re: VBA Controls Project
Post by: paul_s on July 07, 2006, 12:18:25 AM
Hi Guys,

This is ObjectDcl's MonthPicker.

Regards,
Paul
Title: Re: VBA Controls Project
Post by: Bob Wahr on July 07, 2006, 12:21:38 AM
What does it return to lisp when you pick a date?
Title: Re: VBA Controls Project
Post by: paul_s on July 07, 2006, 12:43:59 AM
Bob,

When you select today's date it returns.... (2006 7 7)


Paul,
P.S.
I'm going to sign out now, I got to go to work early
tomorrow (or today).  Hope to hear from
you soon. Thanks.
Title: Re: VBA Controls Project
Post by: jbuzbee on July 07, 2006, 09:32:37 AM
Paul, yes you can add that control in VBA and I'm sure with Tony's SetLISPVar function a value can be ported to lisp.  Bob, you need to check out those functions in Module1 of the project I posted - really slick way of utilizing the VL application!

Kerry - thanks.

Sorry I don't have time to help out guys - I'm enhancing my keynotes routine and having a helluva time with dictionary stuff in VBA: arrays, variants, xrecordData - argh!!!

jb
Title: Re: VBA Controls Project
Post by: GDF on July 07, 2006, 09:54:04 AM
James

Wow...I'm speechless...

Gary


Title: Re: VBA Controls Project
Post by: TimSpangler on July 07, 2006, 12:43:13 PM
ok,

I've been following this thread since it started.  I have 0 knowledge of VB/VBA and 0 knowledge of ODCL.

So my question "What is this thing sopposed to do?"  Are we using Lisp to run this if so how do they interface?

<speak to me as though I was 5 yrs old>

I have always been intrigued by VB but never took the time.

Thanks guys
Title: Re: VBA Controls Project
Post by: MP on July 07, 2006, 12:48:14 PM
<speak to me as though I was 5 yrs old>

Wrong forum, perhaps http://discussion.autodesk.com/forum.jspa?forumID=130.

Sorry, couldn't resist.

:P
Title: Re: VBA Controls Project
Post by: TimSpangler on July 07, 2006, 12:51:37 PM
That was some of the reason I don't frequent there any longer.

Well not so much the speaking as the 5 year old personalities.
Title: Re: VBA Controls Project
Post by: MP on July 07, 2006, 12:55:01 PM
(http://www.theswamp.org/screens/mp/nodding.gif)
Title: Re: VBA Controls Project
Post by: jbuzbee on July 07, 2006, 01:27:13 PM
Tim,

Back in the olden times there was AutoLISP, Diesel, and ADS for customizing AutoCAD.  Both AutoLISP and ADS used DCL to create a GUI (graphical user interface).  When Microsoft took over the world, AutoLISP became VisualLISP, ADS became ADSRX (which was later shortened to ARX), and VB became the new kid on the block.  Well, AutoCAD and it's users didn't want to throw away years of customization and development so VB graciously gave them MFC (Microsoft Forms Class).  ARX, being fully assimilated by the borg, er I mean Microsoft, had direct access to MFC - VisuaLISP, however, stubbornly maintained singularity - thus was forced to compete with the dreaded Visual Basic for Applications(VBA) to be the casual programmers language of choice.

The evil empire, with the dark lord "Darth Va", ah, I mean VB, had almost taken control of the known virtual universe but for a rag tag band of AutoLISPers who started a rebellion.  They secretly realized that the evil empire had unwittingly provided a way to control the evil VBA when they made AutoLISP "activex aware".  By utilizing the power of the VL application they were able to communicate with VBA, providing it with false information as to the where abouts of their secret base . . .. Well, you get the picture. 

So we're using VBA - which has a much more robust GUI - to create really cool dialog boxes - while still doing all the hard work in AutoLISP.  This way we're thumbing our nose at Microsoft and clinging to our aging, single purpose language: AutoLISP.

Make any sense?
Title: Re: VBA Controls Project
Post by: Bob Wahr on July 07, 2006, 02:10:16 PM
The evil empire, with the dark lord "Darth Va", ah, I mean VB,
I always wondered what DVB stood for.  Now I know it's [Flava Flav]Darth Vader Boyyyyyyy[/i][/FF]
Title: Re: VBA Controls Project
Post by: MP on July 07, 2006, 02:18:17 PM
Actually, DVB is short for Dilapidated Version of BASIC.
Title: Re: VBA Controls Project
Post by: TimSpangler on July 07, 2006, 02:43:04 PM
So let me get this straight. 
You are creating forms with VBA and controlling them with LISP? VLISP?  How do you get feedback from the form?  (Forgive me, but this is really getting ready to open some possibilities, er I think)

I played with the project for a little bit but I just haven't been able to put the pieces together, YET.
Title: Re: VBA Controls Project
Post by: TR on July 07, 2006, 02:45:17 PM
Let me prefix my post with the fact that I'm 100% unfamiliar with ObjectDCL. But from what I understand it's unsupported in 2007.

In 2007 you can create functions that that interact with lisp in .NET. With that being said...wouldn't it be a better idea to create an ObjectDCL replacement with System.Windows.Forms in .NET? System.Windows.Forms has more user controls than VBA.

It might be a good group project. However I don't have 2007 so I'm out.
Title: Re: VBA Controls Project
Post by: CmdrDuh on July 07, 2006, 02:48:45 PM
I would love to be a part of that project.  VS2005 express C# would be a perfect way (its free) to code it
Title: Re: VBA Controls Project
Post by: jbuzbee on July 07, 2006, 02:55:28 PM
Tim S.

The great Tony Tanzillo penned three VBA sub functions: GetLispVar, SetLispVar, and EvalLispExpression.  With these functions VBA can: read a lisp variable, set a lisp variable, and execute a lisp function.  So as you can see, a VBA form can communicate quite nicely with AutoLISP.  Once you have time to digest VBA you'll be able to use our VBA Controls Project to understand how it all works.

Tim R.

AutoLISP.net would be awesome - maybe that's why Chad abandoned ObjectDCL?  Can you imagine creating palettes in ,net and controlling them with AutoLISP???
Title: Re: VBA Controls Project
Post by: CmdrDuh on July 07, 2006, 02:58:06 PM
The great Tony Tanzillo...

going a little overboard you think
Title: Re: VBA Controls Project
Post by: Bob Wahr on July 07, 2006, 03:52:02 PM
JB,

In the form for the listbox todo, you say maybe xrefs.  Do you want all xrefs including nested, just the ones inserted directly, or all of them?

[edit]Wow started this post before lunch, finshed after, lots has happened since.  some .netage would be fun to tear into but for now, I'll keep going on this.[/edit]
Title: Re: VBA Controls Project
Post by: jbuzbee on July 07, 2006, 04:05:04 PM
Bob, I was thinking of mimicking the Xref Dialog List Box - report style.  So I guess yes on the nested.  Thanks for supporting this project!

Cmdr,

Tony may be obnoxious, opinionated, seriously lacking in social etiquette, but you have to agree he knows how to code.  :kewl:

jb
Title: Re: VBA Controls Project
Post by: Kerry on July 07, 2006, 06:03:50 PM
Let me prefix my post with the fact that I'm 100% unfamiliar with ObjectDCL. But from what I understand it's unsupported in 2007.

In 2007 you can create functions that that interact with lisp in .NET. With that being said...wouldn't it be a better idea to create an ObjectDCL replacement with System.Windows.Forms in .NET? System.Windows.Forms has more user controls than VBA.

It might be a good group project. However I don't have 2007 so I'm out.

Tim I'm very familiar with ODCL. .. and yes it is now unsupported.
.. and yes, Autodesk.AutoCAD.Runtime.LispFunction, allows managed applications to declare methods that may be called from AutoLISP.
I agree about the NET Forms and the Lisp , that's the way I have planned and intend  going .. just not this week  :lol:

Title: Re: VBA Controls Project
Post by: Bob Wahr on July 07, 2006, 07:37:07 PM
Bob, I was thinking of mimicking the Xref Dialog List Box - report style.  So I guess yes on the nested.  Thanks for supporting this project!

How closely are you wanting to mimic it?  Right now the only functionality you have with it is an unload button.  If that's all, seems a listbox would work fine.  If you want to include more of the info on the xref, the listview isn't nearly large enough.
Title: Re: VBA Controls Project
Post by: LE on July 07, 2006, 10:55:35 PM
Just went to the ODCL site... and again is not accessible... great that you guys are making the move, close to the dark side and maybe who knows and when the jump into a more powerful force.....
Title: Re: VBA Controls Project
Post by: Jürg Menzi on July 08, 2006, 05:00:44 AM
The great Tony Tanzillo penned three VBA sub functions: GetLispVar, SetLispVar, and EvalLispExpression.(...)
AFAIK, Frank Oquendo was the author and not his adversary... ^-^
and another point, under some circumstances, this functions doesn't work.
Title: Re: VBA Controls Project
Post by: Kerry on July 08, 2006, 06:46:30 AM
Jürg,
The VLAX.CLS by Frank Oquendo used different Function names, if I recall ..


The great Tony Tanzillo ....

I have to agree, without any reservation.
Title: Re: VBA Controls Project
Post by: Jürg Menzi on July 08, 2006, 07:37:34 AM
You could be right... I remember me to an unfriendly battle of words in the A'desk ng between Frank and Tony...
Title: Re: VBA Controls Project
Post by: LE on July 08, 2006, 10:22:15 AM
The great Tony Tanzillo penned three VBA sub functions: GetLispVar, SetLispVar, and EvalLispExpression.(...)
AFAIK, Frank Oquendo was the author and not his adversary... ^-^
and another point, under some circumstances, this functions doesn't work.

Was that happen back on between 1998 - 2000?.... anyway on that time I had access to the ADN and I got those functions from them, I even remember that FO mentioned something about it.....  :-)
Title: Re: VBA Controls Project
Post by: It's Alive! on July 08, 2006, 03:39:28 PM
This was also ported to C# so .NET can access global lisp variables via COM. I think it was called vlax.net

Jürg,
The VLAX.CLS by Frank Oquendo used different Function names, if I recall ..


Title: Re: VBA Controls Project
Post by: jbuzbee on July 10, 2006, 09:05:08 AM
Bob,

Thankyou soooo much for helping out with this project.  Remember that this is for "educational purposes" so however you want to illustrate the properties and methods of the listview will be fine.  Thanks again!

Jurg,

The functions I posted were written by non other than Tony T.  Franks' VLAX didn't work well in some situations whereas I've had no trouble with the Tony's at all.

To All,

There is a great class posted over on the AutoDESK VBA NG that uses some pretty nifty Win API stuff.  I now have a fully functional re-sizeable dialog - just like ODCL - AND transparency capabilities!  Once I've got a little project finished I'll post . . ..
Title: Re: VBA Controls Project
Post by: GDF on July 10, 2006, 09:50:55 AM
James

To All,

There is a great class posted over on the AutoDESK VBA NG that uses some pretty nifty Win API stuff.  I now have a fully functional re-sizeable dialog - just like ODCL - AND transparency capabilities!  Once I've got a little project finished I'll post . . ..

It sounds to me like this will do most of what objectdcl can do, correct? I purchased objectdcl but never got around to using it. I know nothing of
vba. I would love to see how these vba controls are put together.

This dog needs to be properly trained...am willing to learn.

Gary
Title: Re: VBA Controls Project
Post by: Tramber on July 10, 2006, 11:04:42 AM
To be honest, I understand nothing of your conversation guys.

I'm confused to say, but We are in ODCL forum !

I manage ODCL quite well with the time but I copy nothing of your conversation and feel like a stranger.

What I'd like would be a topic with tutorials so that I could follow or another sub-forum where we talk about ODCL alternative !?

Sorry  8-)
Title: Re: VBA Controls Project
Post by: Bob Wahr on July 10, 2006, 11:11:07 AM
It sounds to me like this will do most of what objectdcl can do, correct? I purchased objectdcl but never got around to using it. I know nothing of
vba. I would love to see how these vba controls are put together.

This dog needs to be properly trained...am willing to learn.

Gary
Gary and everyone else who is and/or might be interested.  CmdrDuh was running a VBA class that pretty much died out due to lack of interest.  I discussed starting it back up, using this project as the basis and he thought it sounded like a good idea.  Downside is that he's making me help :( but with everything this project is doing, everyone should learn enough about VBA to be able to use forms this way and even to bang out some VBA only routines.

If you are interested in playing along, PM CmdrDuh (http://www.theswamp.org/index.php?action=pm;sa=send;u=332) or me (http://www.theswamp.org/index.php?action=pm;sa=send;u=585) to sign up.

Unless of course, James has a problem with the project being used for the class.
Title: Re: VBA Controls Project
Post by: LE on July 10, 2006, 11:13:39 AM
To be honest, I understand nothing of your conversation guys.

I'm confused to say, but We are in ODCL forum !

I manage ODCL quite well with the time but I copy nothing of your conversation and feel like a stranger.

What I'd like would be a topic with tutorials so that I could follow or another sub-forum where we talk about ODCL alternative !?

Sorry  8-)

It is look that ODCL is D E A D... just have a look again into www.objectdcl.com and you will see, that one more time it has an access error.

What these guys are doing is the best move....
Title: Re: VBA Controls Project
Post by: CmdrDuh on July 10, 2006, 12:26:47 PM
Well I guess a quick head count is in order.  Also, based on the number of responses, do you guys want to do a self-paced class or non self-paced?  Also, I would like to know everyones comfort level with VBA so I know where we need to start.
Title: Re: VBA Controls Project
Post by: T.Willey on July 10, 2006, 12:45:43 PM
I like self-paced.  I have very little knowledge of VBA, but I use ActiveX with AutoLisp a lot, which is a little bit like VBA.
Title: Head Start
Post by: Bob Wahr on July 10, 2006, 01:22:31 PM
For those who are interested in the class, here are a couple of things to read to get a bit of a jump on things.

Autocad VBA Getting Started Guide.pdf (http://www.theswamp.org/lilly_pond/index.php?dir=cmdrduh/&file=Autocad%20VBA%20Getting%20Started%20Guide.pdf) by CmdrDuh

VBA Guide.pdf (http://www.theswamp.org/lilly_pond/index.php?dir=cmdrduh/&file=VBA%20Guide.pdf) by BAshworth
 
Title: Re: VBA Controls Project
Post by: CmdrDuh on July 10, 2006, 01:56:31 PM
And to add to that,  Here  (http://www.theswamp.org/index.php?board=30.0) is where you can post questions.
Title: Re: VBA Controls Project
Post by: jbuzbee on July 10, 2006, 03:41:32 PM
Quote
Unless of course, James has a problem with the project being used for the class.

I don't have a problem at all!  In fact I'm all for a class, self-paced or not doesn't matter to me.  I've been all over this VBA stuff - hacking away: I've got re-sizable forms, transparency, class modules, and I have no idea what I'm doing (well, not enough!)

Great job guys!

jb
Title: Re: VBA Controls Project
Post by: Tramber on July 11, 2006, 04:29:56 AM
I know that ODCL is dead....
but beleive me, nothing is clear.

Maybe those like me who ever produced only lisp would appreciate a tutorial for a simple modal form or else. Anything.

You give me links and I thank you but the VBA environnement doesn't frighten me. What I'd like is to write a beginning of a code.

I'm sorry, I'm not native english and I may seem to be unpolte but that puts me in a bad mood.
It is more and more mysterious around here.
Title: Re: VBA Controls Project
Post by: jbuzbee on July 11, 2006, 07:59:18 AM
Bert,

Download the project, and open up VBAIDE and have a look.  What I tried to do is pattern it after the way ODCL interacted with AutoLISP:  There are only two things going on: functions that control the form (dialog) and 4 functions that interact with AutoLISP: SendCommand (command . . .), EvalLispExpression (myLisp), SetLispVar (setq myVar value), and getLispVar 'myVar.  Once you get your head around the logic of VB(A) it really is very easy.  It took me a little bit to get comfortable (last weekend) and now I'm delving into the WinAPI.  I'm planning on converting as much as makes sense over to straight VBA as time allows.

The best way I learn is to dive in and start codeing - give it a whirl!

jb
Title: Re: VBA Controls Project
Post by: Tramber on July 11, 2006, 09:57:47 AM
I'll give a try in 10 tens, that's what I planned.

I hope you are right  :|
Title: Re: VBA Controls Project
Post by: jmaeding on July 12, 2006, 07:21:37 PM
uh, where do I download the source for this, I didn't see it attached anywhere, thx
Title: Re: VBA Controls Project
Post by: jmaeding on July 12, 2006, 07:23:50 PM
never mind, I see them now.  amazing how things hide until you hit the post button!
Title: Re: VBA Controls Project
Post by: jmaeding on July 12, 2006, 08:43:23 PM
after looking this code over a bit, I do not see anything where focus is passes to lisp or VBA and back.
The control callbacks end in sendcommands, which fire commands, but do not get back focus after.
ODCL did the focus transfer game really well, and I might say that was what really made it great.
I need to figure this out for VBA hybrids as it might apply to .net too.
Title: Re: VBA Controls Project
Post by: jbuzbee on July 13, 2006, 07:50:56 AM
Everybody needs to go here:

http://discussion.autodesk.com/thread.jspa?threadID=483502 (http://discussion.autodesk.com/thread.jspa?threadID=483502)

and download "UserFormSample" by A. Caddie.  I'm only just beginning to digest it, but it is a good example of the power of the Windows API.  I'll be posting some examples that use the exposed class "sVBA_FormChanger" but I've yet to fully understand it.  :ugly:

Will post something soon.
Title: Re: VBA Controls Project
Post by: Guest on July 13, 2006, 10:47:23 AM
That IS some SWEET piece of coding.  I've already implemented it into a couple of my projects.

 Matt W
Title: Re: VBA Controls Project
Post by: jbuzbee on July 13, 2006, 04:02:12 PM
Matt, have you used the transparrency function?  If so how are you graphically controlling it?  I tried the stock scroll bar but now I'm using the Microsoft Slide Control:

(http://www.vpiarchitecture.com/images/1.jpg)

I'm assuming this ships with XP and isn't a Word or Excell control??  I'm going to try a little project to mimc a palette - we'll see how well I do!  :ugly:

jb
Title: Re: VBA Controls Project
Post by: Guest on July 13, 2006, 04:09:39 PM
I'm using a popup menu class with two options 'Transparency On' & 'Transparency Off'.  I use a value of 75 when turning on the transparency and a value of 255 to turn it off.

I've modified my "Favorite OSnaps" program to use the transparency which is attached for you to disect.

Enjoy!

Nice color for the dialog.  Kinda looks like what I use!

How's your project coming along??  Got a progress you can post?

Keep up the good work.

 Matt W
Title: Re: VBA Controls Project
Post by: Guest on July 14, 2006, 10:27:21 AM
Attached is a ZIP file that uses the Slider control to control the transparency of a form.

Enjoy!

 Matt W