OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: cadplayer on August 10, 2016, 10:28:12 AM

Title: Set focus on last open dialog
Post by: cadplayer on August 10, 2016, 10:28:12 AM
Hello!
Have somebody an explanation how I can get or stand last open (viewed) dialog in front not behind first open dialog ("Layout tab manager...").
Se picture!
-> dialog "Find and Replace" should be in front as long as not pressed button Done

Thanx for help! /D
Title: Re: Set focus on last open dialog
Post by: roy_043 on August 10, 2016, 10:54:30 AM
Are the dialogs modal?
Title: Re: Set focus on last open dialog
Post by: cadplayer on August 10, 2016, 11:41:56 AM
no unmodal
Title: Re: Set focus on last open dialog
Post by: roy_043 on August 11, 2016, 01:18:36 AM
To achieve the behavior you want the dialogs must be modal.
Title: Re: Set focus on last open dialog
Post by: cadplayer on August 11, 2016, 01:40:23 AM
Hi Roy!
I see not change after your reason, sending dialog as attachment.

unmodal Dialog_Option is main-dialog wherefrom can open it modal-dialogs Dialog_Rename and Dialog_RenSimple

Thank you
Title: Re: Set focus on last open dialog
Post by: roy_043 on August 11, 2016, 05:56:17 AM
A test shows that even calling a modal dialog from a modeless one, as in your example, works as expected. Maybe you were changing the .odcl file during a CAD session and forgot to supply the ForceReload argument of the dcl-Project-Load function?
Title: Re: Set focus on last open dialog
Post by: cadplayer on August 11, 2016, 11:45:27 AM
Thank you so much - yes you´re right I get it. The next problem I get: suddenly it don´t work some subroutines when start Rename_Dialog and push all 3 button (se movy https://dl.dropboxusercontent.com/u/174474939/PICTURE/ModalDialogButtonNotWorking.mp4 (https://dl.dropboxusercontent.com/u/174474939/PICTURE/ModalDialogButtonNotWorking.mp4)


Code (autolisp) Select
(defun c:xx ()

  (setq cmdecho (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)
  (command "_OPENDCL")
  (setvar "CMDECHO" cmdecho)

  (if (= (atoi (substr (getvar "acadver") 1 2)) 20)
    (setvar "EPDFSHX" 0)) ; Acad2016 take off textframes in pdf-file

  (cd:Subroutines)
  (cd:OpenDCLfuntions)

  (setq acdoc (vla-get-activedocument (vlax-get-acad-object))
        aclay (vla-get-layouts acdoc)
  )
  (setq dclst  (mapcar 'vla-get-Name (cd:GetLayouts aclay))
        resLst dclst
  )

  (setq result nil error nil)
  (setq form (dcl-project-load "H:\\Dropbox\\2014\\AF-Infrastructure-Tools\\ViewportManager\\Form1.odcl"))
  (setq returnResult (dcl-Form-Show Form1/Dialog_Option))

  )



(cd:Subroutines) there are all my subroutines which loaded by start command with xx
The program is doing so here:
Type command xx [ok]
1) Dialog "Layout Tab Manager 1.0" showing [ok]
2) Push "Find" button ->Dialog "Find and Replace" starts [ok]
3) 3 Button "Find" - "Replace" - "Replace all"  there pushevents are working, but subroutines (cd:Subroutines) are not found definition [false]

Do I run command xx second one it suddenly works, why
Do you have an answer to this behaviour ?!
Title: Re: Set focus on last open dialog
Post by: cadplayer on August 11, 2016, 11:53:08 AM
Sorry my misstake, I found it - it´s working now