Modeless form works but I have some issues-Please help

Started by Mak, December 25, 2008, 11:43:51 PM

Previous topic - Next topic

Mak


Barry - Owen , I was in in your class in LV
I need some help to reveal some questions as a new user
1) why i get several different results  when I use the (Setq rValue (dcl_Form_GetHwnd MakPalette)) ?
2) would bepossible if I provided the class AFX: for the form and the Autocad any chance someone with C++ could help hide and top most the .Odcl form with the right click event?
3) is in the near new release will be possible to resize the control, and  form proportional by grap the form, and write .ini so the last change will be preset.
4) is in the new release we will have an index in the properties of the OpenDcl ?
5) did any one have a luck to MoveTablet or palette to follow the last click or position of mousepos.x and mousepos.y on autocad?

6) Does this looks okay, it works but not with every bottun?
(defun c:MakPalette_MakPalette_GraphicButton4_OnClicked ()
(dcl_Form_hide MakPalette)
(command "._ddinsert")
(dcl_Form_show MakPalette))

these all my question in version 4 , any help will be appreciated, sorry for my broken English.

owenwengerd

Here's a quick reply to some of your questions:

1) Different results means different windows.
2) Not sure I understand what you're after.
3) Resizable forms are easy in OpenDCL, and sizing changes are remembered automatically.
4) I don't understand the question.
5) I don't know.
6) The last line should be (dcl_Form_Hide MakPalette NIL) to unhide the form. What you have now just creates a new one instead (which explains question 1).
Owen Wengerd (Outside The Box) / ManuSoft

Mak

Hello Owen, thanks for your comments
regarding #2) if Opendcl supports a external hook, with AutoCad class & form class a dll will allow Hwnd the form on top of autocad with mouse right click.
             #3) Okay I noticed I can resize the form, I want to be able to re size the controls during the run time, which I did not see in version 4.2 -so is it possible in the next version?
             #4) in Microsoft visual basic properties has an index for every controls, I was wondering if this available?
              #1, #6) thanks but what is the disadvantage of using (dcl_Form_hide MakPalette 1) instead of Nil, I want to be able to hide the form once button clicked, and Show once action completed? Though still very nice software for the short time I'm using it. any help will be appreciated.

Mak

 ;) :)
Owen, I found a quick & dirty way to do what I need , I may change it later to a function of callback_button
I'm posting it for calling back the opendcl, I test it with 80 buttons so far & not failed yet. here it is
Please let me know if this may cause any disadvantage or problem which I may not see!!!!!!

(defun c:MakPalette_MakPalette_GraphicButton80_OnClicked ( / ql)
(dcl_Form_hide MakPalette 1)      ;;to hide the form
(command "_quickcalc" "")           ;; get the calculator for autocad
(princ)
(if (ql "makpalette.lsp")(c:makpalette)(princ))  ;;get back the opendcl subject to find the path.
);end of button 80


owenwengerd

Mak, I still don't understand what you're after. I think Barry's class handout covers control resizing in OpenDCL. You just have to set the resizing properties in OpenDCL Studio.

With regard to hiding, you should unhide your form after you hide it, otherwise you create a new instance of your form every time you display it. If you want to create a new instance every time, then you should close the form instead of hiding it.

For what it's worth, I recommend to use OpenDCL 5 beta, as it has fixed a lot of problems since version 4. I think form hiding was flaky in version 4.
Owen Wengerd (Outside The Box) / ManuSoft

Mak

Owen, Wish you happy New year
I'm after the following :
1) once project loaded and click a button then;
2) Hide the project not to unload it;
3) Once action button on autocad is completed then;
4) The form will be show;
Though looking on the help file could not find DCL_form_unhide function?

Also I'm after resize the form with each control on the form proportion when I drag any corner of the form.
write *.ini to the folder for the last set set up

You were correct I found out I was creating several instance which I do not want to.

owenwengerd

You use the (dcl_form_hide) function to hide *and* unhide a form, depending on the boolean argument. The control resizing is just a matter of setting the position and size properties relative to the form edges. Right click on a control in the editor and select Properties, then look at the options on the Geometry tab. You can also play with the Methods sample (Manipulation tab) to see how resizing works.
Owen Wengerd (Outside The Box) / ManuSoft

BazzaCAD

Hi Mak,
Sorry for the delayed replay.
Yes as Owen mentioned, you should upgrade to version 5 or ODCL.
Just because it says experimental doesn't mean it's unstable.
It's very stable now & version 4 did have some resizing issues at run-time.
After you get v5 installed have a look at the "Selections" project in the "Samples" folder.
Unfortunately this sample needs to be updated, because it's still using (DCL_FORM_CLOSE) and should be changed to (DCL_FORM_HIDE).

And also as Owen said, use the Geometry tab to make the controls resize as the form gets resized. You don't need to save the forms info to an .INI as they will be saved in the registry and will be re-shown in the same location & size. This also may have been broken in version 4.

a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

Mak

 :D ;)
Owen - Barry , Appreciated, & my regards to both of you, and Happy new year to both of you!!!
I will download V5, and play with it, I do like 4 though I have some problem with it-hope 5 will be easy for me.

One more questions, If I already keeping my icons in a *.dll file, 
How to refernce any grapgic to those buttons pictures?
Does the dll Name must be the same as the project name or the form name?
your help will be appreciated

So Long

BazzaCAD

I don't think ODCL can currently import images from DLL's. Owen can correct me if I'm wrong. I use this old program called Resource Hacker to extract images from DLL's if I don't have the originals. Here's a link: http://www.angusj.com/resourcehacker/
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

Mak

Barry
version 5 works fine appreciated.

I have Resource Hacker, & "eXeScope " if I want to get information or edit dll, Exescope will powerfull.
however I create my dll using VB6 with Resource, and add all my images to it, and compile it as dll.
I name the dll and the menu toolbar the same name, put it in the same path for autocad and works great
this will avoid smily faces, and not worried about collect all images .

I was just hoping that this could be referenced in case you may add it to your project,
http://www.softpedia.com/get/Programming/File-Editors/eXeScope.shtml

best regards

Mak

Barry
I noticed one thing in version 5, under the properties /picture <non> and pictures, however <add> which was in version 4 was gone?
is this is intential?

best regards