Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XP Themes with @SAY

Status
Not open for further replies.

cheth

Programmer
Nov 6, 2001
16
US
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


 
Is there a reason not to show the button all the time and disable it when appropriate? You're really mixing apples and oranges here.

Tamar
 
Tamar,
I am mixing apples and oranges, I'm mixing READs and READ EVENTs. What I want to be able to do is popup an event driven process while in the middle of a READ.
I managed (I think) to figure out a workaround. It seems that the _screen.themes=.f. does not take effect until a READ EVENTS. So after the _screen.themes=.f. statment, I create a form with a timer object that releases the form and that sets the themes off.

Chet
 
You can use the sys command to enable and disable themes.

SYS(2700,0) disables themse. Put this code at the beginninf of your code.

SYS(2700,1) enables themes, put this code at the end of your procedure.

Don Higgins
 
>What I want to be able to do is popup an event driven process while in the middle of a READ.

That used to be called a FOUNDATION READ. ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top