Dialog don't behave like a dialog

Post Reply
JoaquimC
Posts: 16
Joined: Fri Feb 09, 2007 6:43 pm
Location: Porto - Portugal

Dialog don't behave like a dialog

Post by JoaquimC »

I have a form, and on that form i call a dialog.
But if i click on the form, the dialog goes back of the original form, unlike a dialog should act.

The code for the dialogue is:

Code: Select all | Expand

    DEFINE dialog oDlg title titulo size 237,268
   @ 02, 03 GET oNome_servico var _nome_servico SIZE 65, 10 PIXEL READONLY FONT oFont
   @ 02, 70 GET oData var _data SIZE 45, 10 PIXEL READONLY FONT oFont
   @ 13, 03 GET oNome_quarto var _nome_quarto SIZE 65, 10 PIXEL READONLY FONT oFont
   @ 13, 70 GET oNome_refeicao var _nome_refeicao SIZE 45, 10 PIXEL READONLY FONT oFont   
   @ 24, 03 GET oNome_cama var _nome_cama SIZE 65, 10 PIXEL READONLY FONT oFont

   @ 38, 03 say "Qtd: " size 45, 10 pixel
   @ 38, 33 GET oQtd var _qtd SIZE 65, 10 PIXEL FONT oFont

   
   @ 110, 23 button "&Gravar" size 35, 20 PIXEL action m_detalhe_gravar(oDlg, estado)
   @ 110, 63 button "&Cancelar" size 35, 20 PIXEL action m_detalhe_cancelar(oDlg, estado)

      ACTIVATE dialog oDlg


What am i doing wrong?

TIA,
Joaquim
User avatar
Antonio Linares
Site Admin
Posts: 42511
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Post by Antonio Linares »

Joaquim,

Define the dialog this way:

DEFINE dialog oDlg title titulo size 237,268 OF oWnd

where oWnd is the previous window or dialog
regards, saludos

Antonio Linares
www.fivetechsoft.com
JoaquimC
Posts: 16
Joined: Fri Feb 09, 2007 6:43 pm
Location: Porto - Portugal

Post by JoaquimC »

Antonio,

Thank you for answering so fast, but it didn't solve the problem.
When i select the back form it still gets in front of the dialog and i don't see the dialog anymore.

Joaquim
User avatar
Antonio Linares
Site Admin
Posts: 42511
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Post by Antonio Linares »

Joaquim,

Here you have a working sample:

Code: Select all | Expand

#include "FWCE.ch"

function Main()

   local oWnd
   
   DEFINE WINDOW oWnd TITLE "Main"
   
   @ 9, 2 BUTTON "Dialog" ;
      SIZE 210, 30 ACTION BuildDlg( oWnd )

   ACTIVATE WINDOW oWnd
   
return nil   

function BuildDlg( oWnd )

   local oDlg
   
   DEFINE DIALOG oDlg TITLE "Test" ;
      SIZE 200, 80 OF oWnd
   
   ACTIVATE DIALOG oDlg ;
      ON CLICK MsgInfo( "dialog click!" )
   
return nil   
regards, saludos

Antonio Linares
www.fivetechsoft.com
JoaquimC
Posts: 16
Joined: Fri Feb 09, 2007 6:43 pm
Location: Porto - Portugal

Post by JoaquimC »

Thank you Antonio: problem solved...
Joaquim
Post Reply