Combine DCL Dialog

Combine DCL Dialog

Kh.mbkh
Advocate Advocate
1,040 Views
11 Replies
Message 1 of 12

Combine DCL Dialog

Kh.mbkh
Advocate
Advocate

 

(setq Path (getvar "dwgprefix"))
(setq DCLFile (strcat Path "FicDCL" ".dcl"))
(defun c:StartDCL ()
  (setq dcl_id (load_dialog (strcat Path "Combine.dcl")))
  (if (not (new_dialog "Main" dcl_id))
    (exit))
  (action_tile
    "cancel"  "(done_dialog)" )
  (action_tile
    "accept" "(done_dialog)" )
  (start_dialog)
  (unload_dialog dcl_id)
);defun

 

This function (StartDCL) aims to start a dialog named "main" , it looks like this :

 

main.PNG

In the dcl file (named "Combine.dcl") there're two other dialog definitions "hello" and "OtherDialog" :

dcl1.PNGdcl2.PNG

 

 

 

 

My objectif is:

If radio button "Description On/Off" is selected : show "hello" Dialog

Otherwise : show "OtherDialog" Dialog.

 

N.B: the new dialog to be shown (hello or OtherDialog) should be in the same "main" dialog ; Just bellow "ok" button (NOT A CHILD DIALOG)

 

Thanks !

 

0 Likes
Accepted solutions (1)
1,041 Views
11 Replies
Replies (11)
Message 2 of 12

john.uhden
Mentor
Mentor

@Kh.mbkh 

If you want to show 2 out of 3 in one dialog, I think you're going to have to add 2 more definitions to your DCL file.

Right now you have plain Main.  (Yes, I talk in rhyme all the time)

You need to add, say, a Main_Hello and a Main_OK, adding to each the tiles from plain Main.

So when they toggle that magic button, you will have to close one and open another, repopulating tiles that are common to all of them.  You don't have to unload and reload as you can have many different dialogs in the same DCL file.  You just can't open multiple dialogs at the same time (I'm pretty sure).  One thing you can do which is handy sometimes is to be able to call the alert function while a dialog is open.

Don't forget to disable tiles that would not be applicable to a given situation based on the other tiles.

 

BTW, I have never seen the contraction "there're" before.  I wonder if it's legit.  It does save 1 character.

John F. Uhden

0 Likes
Message 3 of 12

Sea-Haven
Mentor
Mentor

If you change your description to 2 toggle buttons a on and off then may be able to call the correct Child dcl. Once selected its deselected after running Child so both are un ticked again. 

0 Likes
Message 4 of 12

diagodose2009
Collaborator
Collaborator

You can enable or disabled the "OtherDialog"

   with key = "other";

 

 

Message 5 of 12

diagodose2009
Collaborator
Collaborator

untitled.JPGOther method not found. 

0 Likes
Message 6 of 12

john.uhden
Mentor
Mentor
I don't think you need two toggles. A toggle is either ON or OFF, so he
just needs to save its state as a symbol and set the tile accordingly when
switching dialogs.

John F. Uhden

0 Likes
Message 7 of 12

Sea-Haven
Mentor
Mentor

Understand a toggle is not right button but would still have 2 buttons as per this image click button child appears. This dcl has like 12 children.

 

SeaHaven_0-1639954931202.png

 

0 Likes
Message 8 of 12

Kh.mbkh
Advocate
Advocate

'there're" Yeah there're some expressions with 'there're" .. And we do it on purpose, because we don't play by the rules we don't understand 😇

0 Likes
Message 9 of 12

Kh.mbkh
Advocate
Advocate

222.GIF

NOT A CHILD DIALOG !

 

To have the clair concep : what I main exactly is the analogy of "Multipage" in VBA. like this:

333.GIF

 3333.GIF

 

 

 

 

 

 

it turned out that this is not possible with DCL. Thanks anyway!

0 Likes
Message 10 of 12

Sea-Haven
Mentor
Mentor
Accepted solution

OPENDCL ???

0 Likes
Message 11 of 12

Kh.mbkh
Advocate
Advocate

That was a good Track! I started.. but cannot show my Form; Any idea ?

(command "OPENDCL")
(defun c:ThereRe ()
(setq A (dcl_Project_Load "es.odcl" T))
(dcl_Form_Show Formulaire1)
)

The error:

Capture.GIF

 

 

0 Likes
Message 12 of 12

Sea-Haven
Mentor
Mentor

Post at Opendcl forum I do not use Opendcl 1 more add external program that ends users have to load so stay with old fashioned DCL's.

0 Likes