Hello All,
We are currently in the process of getting some very old dBase code running in a VFP8 environment. Things are going fairly well. The following code is a short sample of how we're are going about it.
Basically, create and activate a window and let the old code populate the window, which works just fine. What I'd like to have happen while in the old READ, is to press a function key and a command button popup on that screen. I get that to work fine, but previously @SAY text disappears and the screen backcolor goes to the default color.
The following code sample illustrates my problem. The first time I run it and hit F2 the labels disappear. If I run it again it works just fine. It seems that the _screen.Themes=.f. isn't working the first time through. If prior to running this code, for the first time, I set this property to .f., it works..
I'm running XP-Pro & VFP8.
Also when I run this on W2K it works..
Any help would be great appreciated.
Thanks
Chet
** disable XP themes
SYS(2700,0)
_screen.Themes=.f.
** define hotkey that pops up button
ON KEY LABEL F2 do butt
** create test form
PUBLIC ox
ox=CREATEOBJECT("xform")
ox.name='test'
ox.themes=0
ox.show()
ox.refresh()
ACTIVATE WINDOW test
*** set colors of test form
SET COLOR TO R/G,W/B
*** paint test form
cx=IIF(_screen.Themes,'on ','off')
cx1=IIF(ox.Themes,'on ','off')
@0,0 clear
@1,1 say 'Screen Themes:' get cx
@2,1 say ' Form Themes:' get cx1
READ
** close test form
RELEASE ox
*WAIT 'Done' WINDOW TIMEOUT 2
*** Popup button
PROCEDURE butt
IF TYPE('ox.cmdx')='U' then
ox.addobject('cmdx','xbutt')
ox.cmdx.top=ox.height-50
ox.cmdx.left=5
ox.cmdx.visible=.t.
READ events
ox.removeobject('cmdx')
ELSE
CLEAR EVENTS
ENDIF
ENDPROC
DEFINE CLASS xbutt as CommandButton
width=20
height=20
caption='X'
PROCEDURE click
CLEAR EVENTS
ENDPROC
ENDDEFINE
DEFINE CLASS xform as Form
showwindow=2
width=200
height=300
autocenter=.t.
ENDDEFINE
We are currently in the process of getting some very old dBase code running in a VFP8 environment. Things are going fairly well. The following code is a short sample of how we're are going about it.
Basically, create and activate a window and let the old code populate the window, which works just fine. What I'd like to have happen while in the old READ, is to press a function key and a command button popup on that screen. I get that to work fine, but previously @SAY text disappears and the screen backcolor goes to the default color.
The following code sample illustrates my problem. The first time I run it and hit F2 the labels disappear. If I run it again it works just fine. It seems that the _screen.Themes=.f. isn't working the first time through. If prior to running this code, for the first time, I set this property to .f., it works..
I'm running XP-Pro & VFP8.
Also when I run this on W2K it works..
Any help would be great appreciated.
Thanks
Chet
** disable XP themes
SYS(2700,0)
_screen.Themes=.f.
** define hotkey that pops up button
ON KEY LABEL F2 do butt
** create test form
PUBLIC ox
ox=CREATEOBJECT("xform")
ox.name='test'
ox.themes=0
ox.show()
ox.refresh()
ACTIVATE WINDOW test
*** set colors of test form
SET COLOR TO R/G,W/B
*** paint test form
cx=IIF(_screen.Themes,'on ','off')
cx1=IIF(ox.Themes,'on ','off')
@0,0 clear
@1,1 say 'Screen Themes:' get cx
@2,1 say ' Form Themes:' get cx1
READ
** close test form
RELEASE ox
*WAIT 'Done' WINDOW TIMEOUT 2
*** Popup button
PROCEDURE butt
IF TYPE('ox.cmdx')='U' then
ox.addobject('cmdx','xbutt')
ox.cmdx.top=ox.height-50
ox.cmdx.left=5
ox.cmdx.visible=.t.
READ events
ox.removeobject('cmdx')
ELSE
CLEAR EVENTS
ENDIF
ENDPROC
DEFINE CLASS xbutt as CommandButton
width=20
height=20
caption='X'
PROCEDURE click
CLEAR EVENTS
ENDPROC
ENDDEFINE
DEFINE CLASS xform as Form
showwindow=2
width=200
height=300
autocenter=.t.
ENDDEFINE