Alaska Software Inc. - CRT Window - GUI Window and back
Username: Password:
AuthorTopic: CRT Window - GUI Window and back
WolfgangCRT Window - GUI Window and back
on Sat, 16 Feb 2008 13:49:45 +0100
Hello,
I transfered all my clipper  programs an they run in CRT Windows. Now I want 
to start changing to GUI Windows step by step.
From a CRT Window  (Objekt oCRT) I go to this function:

function Dialog
LOCAL nEvent, mp1, mp2, oDlg
 Dialogfenster versteckt erzeugen
oDlg := XbpDialog():new( oCRT,,{10,10}, {600,400},, .F. )
oDlg:icon := -1
oDlg:taskList := .f.
oDlg:title := "Titel"
oDlg:titlebar := .t.
oDlg:maxbutton:= .F.
oDlg:minbutton:= .F.
oDlg:border:= XBPDLG_DLGBORDER
oDlg:drawingArea:setFontCompoundName( "8.Helv" )
oDlg:create()
 Pushbutton erzeugen
butt1:= XbpPushButton():new( oDlg ,, {10,10}, {100,30})
butt1:caption := "Abbruch"
butt1:create( , , {10,20}, {100,40} )
butt1:activate := {|| PostAppEvent( xbeP_Close) }
oDlg:show()
SetAppFocus( oDlg )
 Event loop
nEvent := 0
DO WHILE nEvent <> xbeP_Close
    nEvent := AppEvent( @mp1, @mp2, @oDlg )
    oDlg:HandleEvent( nEvent, mp1, mp2 )
ENDDO
oCrt:show()
SetAppFocus( oCRT )
SetAppWindow ( oCrt )
oDlg:Destroy()
return .t.

The GUI Window has no problem and I can use the pushbutton  "Abbruch". After 
I use the pushbutton, the programm quiets.I think the way  back to the CRT 
window is wrong.
What is my problem?
Thanks
Wolfgang
AUGE_OHRRe: CRT Window - GUI Window and back
on Sat, 16 Feb 2008 17:15:46 +0100
hi,

> butt1:activate := {|| PostAppEvent( xbeP_Close) }
> DO WHILE nEvent <> xbeP_Close
>
> After I use the pushbutton, the programm quiets.
>
> What is my problem?

xbeP_Close will "quit" your Application !

try :
   butt1:activate := {|| lExit  :=  .T. }
   lExit  :=  .F.
   DO WHILE .NOT. lExit

greetings by OHR
Jimmy
Rodd Graham Re: CRT Window - GUI Window and back
on Sun, 17 Feb 2008 05:38:25 +0000
Hello Wolfgang,

I recommend leveraging either TopDown or eXpress++ as you transition.  A 
wealth of debugged code at a reasonable price.

You can jumpstart your GUI development while learning from their source code.

Regards,

Rodd Graham, Consultant
Graham Automation Systems, LLC