Set focus on last open dialog

Started by cadplayer, August 10, 2016, 10:28:12 AM

Previous topic - Next topic

cadplayer

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

roy_043



roy_043

To achieve the behavior you want the dialogs must be modal.

cadplayer

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

roy_043

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?

cadplayer

#6
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


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 ?!

cadplayer

Sorry my misstake, I found it - it´s working now