Modal form back to the screen before ...

Started by velasquez, August 29, 2014, 12:09:57 PM

Previous topic - Next topic

velasquez

I have not had this problem.

Code (autolisp) Select

;;;Close the MODAL FORM

;;;The main function starts here
(defun JoyQuantificar (JoySelectionSet / ...)

  (defun c:DuctilCAD_RelacaoMateriais_BotaoTabela_OnClicked (/ JoyExportFile JoyObjTable)
;;;
;;;Close
    (dcl_form_close DuctilCAD_RelacaoMateriais)
;;;Close the form and asks the insertion point for the table
    (if (null (setq JoyTablePt (getpoint "\nIndique o ponto para o canto superior esquerdo da tabela: "))
        ) ;_ fim de null
      (progn ;_ if there is no insertion point
        (setq JoyNext T) ;_ Back to the form -> OK
        (princ "\n")
      ) ;_ fim de progn
;;;Closes the form and asks the insertion point for the table
      (setq JoyObjTable
             (JoyTabelaMaior
               JoyTablePt
               (dcl_control_gettext DuctilCAD_RelacaoMateriais_TextBoxTitulo)
             ) ;_ fim de JoyTabelaMaior
      ) ;_ fim de setq
    ) ;_ fim de if

    (if JoyObjTable ;_ Table OK
      (progn (vlax-release-object JoyObjTable)
             (princ "\nTabela gerada com sucesso!")
             (setq JoyNext T) ;_ back to the form
;;;
;;;At this point the form has been displayed but the table is not yet on the screen.
;;;It will only appear when the human form is closed.
      ) ;_ fim de progn
    ) ;_ fim de if
  ) ;_ fim de defun
;;;
;;;--------------------------------------------------------------------------
;;;Creates a table with vla-addtable
(defun JoyTabelaMaior (JoyTablePt JoyTitulo /)
;....
  (setq obj
         (vla-addtable
           (JoyGetActiveSpace)
           (vlax-3d-point (trans JoyTablePt 1 0))
           (+ 3 (length JoyListaBase)) ; acrescentei a linha do subtitulo
           (length (car JoyListaBase)) ;_ numero de colunas
           JoyAlturadoTexto
           (/ (apply '+ JoyListadasLarguras) (float 8)) ;_ media do total das larguras
         ) ;_ fim de vla-addtable
  ) ;_ fim de setq
;;;Table processes

;;;

  (vla-put-regeneratetablesuppressed obj :vlax-false)

  obj ;- If OK returns the vla-object
) ;_ fim de defun
;;;--------------------------------------------------------------------------
;;;
;;;Tudo trabalha bem aqui
(defun c:DuctilCAD_RelacaoMateriais_OnInitialize (/ JoyTitulo JoyQuantidade)
;;;Quantidade de elementos selecionados
  (setq JoyQuantidade (sslength JoySelectionSet))
;;;;
;;;
;;;Centraliza o quadro
  (dcl_form_center DuctilCAD_RelacaoMateriais)
) ;_ fim de defun
;;;

;;;This is the loop that has always worked well for me.
;;;but in this case I can always ask several points of insertion and insert blocks and then back to the form

;;;loop of the form
  (setq JoyNext T)
  (while JoyNext
    (setq JoyNext NIL)
    (dcl_form_show DuctilCAD_RelacaoMateriais)
  ) ;_ fim de while

;;;
) ;_ The main function ends here


To work around I am using (initget ..
to ask the user if he wants to return to the frame or not.
ODCL_MESSAGEBOX also does what I need.

Has anyone experienced this?

Thanks

Fred Tomke

Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

velasquez

Quote from: Fred Tomke on August 29, 2014, 01:44:59 PM
Hi, have a look here:http://www.opendcl.com/forum/index.php?topic=947.msg4759#msg4759
Greetings Fred

Hello Fred,
I'm sorry but I got confused:

Its function sends (dcl_project_load ProjectName) always before returning the form.
My form is part of a large project.
The best way is to create a different project just for this form?

I'm only using a form:
See the steps:
1 - Closed - form.
2 - I ask the point.
3 - If you create the table and then she is ready I go back to the form.
4 - If the point is NIL I go back to the form.
:(

owenwengerd

You need to move all that code from your c:DuctilCAD_RelacaoMateriais_BotaoTabela_OnClicked event handler. The event handler should contain only the call to (dcl-Form-Close). Move the other code to your main function after the (dcl-Form-Show).

velasquez

Quote from: owenwengerd on August 29, 2014, 10:28:12 PM
You need to move all that code from your c:DuctilCAD_RelacaoMateriais_BotaoTabela_OnClicked event handler. The event handler should contain only the call to (dcl-Form-Close). Move the other code to your main function after the (dcl-Form-Show).

Thanks Owen,
I'll do it now.

velasquez

Quote from: owenwengerd on August 29, 2014, 10:28:12 PM
You need to move all that code from your c:DuctilCAD_RelacaoMateriais_BotaoTabela_OnClicked event handler. The event handler should contain only the call to (dcl-Form-Close). Move the other code to your main function after the (dcl-Form-Show).


Hello Owen,
I made the changes but the code did not work.
After creating the table was not returned to the table.
Do you have any working example?

owenwengerd


velasquez

Quote from: owenwengerd on August 30, 2014, 09:12:14 AM
I don't understand the problem.

Sorry I wrote wrong.

I mean that after the form is closed the table is created, but the code does not bring the form back.

Fred Tomke

Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]