Modeless Dialog - Wait until I've Hit a Button

Started by vosey, October 23, 2008, 08:03:49 AM

Previous topic - Next topic

vosey

Hi... First post so Hello to all..

I'm not sure how to get OpenDCL show a dialog and wait for me to click something on the dialog, and then show the second dialog?.  My feeble attempt is shown below, the idea is to get a response from the first, and if it's true, go on to the second, but what actually happens is that the first flashes on and off and goes straight to the second before I've had a chance to click in it.  I guess the answer may be to use Modal Dialogs instead of Modeless, but would appreciate the advice of an expert.

Thanks
Pete

(defun c:GetStartandEnd ()
   (if (setq usc (getstartchain))
      (if (setq dsc (getendchain))
         (addsingletemplate usc dsc)
      )
   )
)

(defun getstartchain ()
   (Odcl_LoadProject "manualtemplate.odc" T)
   (Odcl_Form_Show manualtemplate_Form1)
)

(defun getendchain ()
   (Odcl_Form_Show manualtemplate_Form2)
)

owenwengerd

Which version of OpenDCL are you using?

The reason your code fails is because (Odcl_Form_Show manualtemplate_Form1) returns immediately. Making manualtemplate_Form1 a modal dialog would be one way to get your current code working. Better is to handle the OnClicked event for your button and show the second dialog from that event handler.
Owen Wengerd (Outside The Box) / ManuSoft

vosey

Thanks Owen, Seems obvious when someone's pointed it out!! - Thanks.   I'm using v4.0.1.6  - The program's great!!.

BazzaCAD

v4.0.1.6 is really old. You should at lease upgrade to the most correct stable version: 4.1.2.2
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

vosey

Finally got round to upgrading (a case of having to as we are now using Acad 2007 (was 2004)). Seem to be hitting a load of problems though (first one is that 'odcl_loadproject' is not recognised as a command.  I'm assuming I need to update my lisp files to suit the latest 'opendcl' format.  Is there some kind of migration tips file or help I could get to help me on my way?  Thanks for any help.  Pete

owenwengerd

The "Help File" link on the OpenDCL main page should have some information.  To migrate, you can start by globally searching for and replacing "odcl_" with "dcl_".  That should get you 95% of the way there.
Owen Wengerd (Outside The Box) / ManuSoft