DosWindow vs Form

Moderator: Rathinagiri

Post Reply
User avatar
hmgchang
Posts: 273
Joined: Tue Aug 13, 2013 4:46 am
Location: Indonesia

DosWindow vs Form

Post by hmgchang »

Dear All,

Its a mixed GuiConsole program...
Entering data at console( Dos) and assign at other forms,
but lost the focus on the console. How to setfocus to the console(Dos)
back ?

SSW :

Code: Select all

#include <hmg.ch>
REQUEST HB_GT_WIN_DEFAULT  && GT_WIN OR GT_GUI


Function Main
  MEMVAR _HMG_SYSDATA
  
  DEFINE WINDOW Main ;
    AT 0,0 ;
    WIDTH 400 ;
    HEIGHT 400 ;
    TITLE "New Form" ;
    WINDOWTYPE MAIN
    
    @ 100, 100 BUTTON btnButton CAPTION "NewDosForm" ACTION NewDosForm()
  END WINDOW  
  
  NewForm()
  Main.Center
  Main.Activate

Return NIL

FUNCTION SetNewForm( cName)
  DECLARE WINDOW NewForm
  *-
  IF .NOT. IsWindowActive( NewForm)
    NewForm.SHOW
  ENDIF
  *-
  NewForm.txtTextBox.Value := "How are you : " + cName
  RETURN NIL
  
FUNCTION NewForm()
 
  DEFINE WINDOW NewForm ;
    AT 0,0 ;
    WIDTH 200 ;
    HEIGHT 200 ;
    TITLE "New Form" ;
    WINDOWTYPE CHILD
    
    @ 10, 10 TEXTBOX txtTextBox VALUE "This is New Form"
    
  END WINDOW
    
  RETURN NIL
  
  FUNCTION NewDosForm()
    LOCAL cName, cAddress
    MEMVAR _HMG_SYSDATA, GETLIST
    THISWINDOW.HIDE
    SetMode( 25, 80)
    ? "Hello World "
    
    cName := "Chang"
    @ 10, 10 SAY "Enter name :" GET cName
    READ
    
    SetNewForm( cName)
    
    cAddress := SPACE( 30)
    @ 12, 10 SAY "Returning..."
    @ 14, 10 SAY "Enter Address :" GET cAddress
    READ
    
    THISWINDOW.SHOW
    THISWINDOW.SETFOCUS
    
    
  RETURN NIL
TIA

best rgds,
Chang
Just Hmg It !
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: DosWindow vs Form

Post by Javier Tovar »

Hola Chang,

Lo que pasa es que tu al llamar a una ventana GUI, se hace un un WAIT, un estado de espera, pero como solo haces modificaciones a la Form ya existente y la haces visible el programa regresa a la Form DOS, pero no se posiciona en el GET siguiente. Al parecer por que tienes un READ antes y GETLIST Tenia nada más al "GET cName" y no puede agregar más y ahi esta el problema.

Te mando una liga donde explica lo de GetList Anidados.

http://books.google.com.mx/books?id=vrt ... er&f=false" onclick="window.open(this.href);return false;

Saludos


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Hi Chang,

What happens is that you to call a GUI window, makes a WAIT, a wait state, but only as you make modifications to the existing Form and make visible the program returns to the Form DOS, but no position in the next GET. It seems that you have a READ before and I had nothing to GetList "GET cName" and you can not add more and there is the problem.

I send you a link explaining about Nested GetList.

http://books.google.com.mx/books?id=vrt ... er&f=false" onclick="window.open(this.href);return false;

Regards
Post Reply