Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Menu screen
Message
From
24/06/2001 23:18:30
 
 
To
24/06/2001 09:29:07
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Title:
Miscellaneous
Thread ID:
00521285
Message ID:
00522933
Views:
10
>Mike,
>
>What does the procedure oscr.resize do?
>
>TIA

It taps into the Resize event of the main VFP screen. So now, anytime you resize the main VFP window, your code fires, positioning the logo appropriately.

>
>>>I have the background picture for the menu screen and I'm going to put my Company's logo and label onto the background.
>>
>>Try this little class that uses the screen.Resize tip from Fred Taylor
>>
>>
>>* This class uses a little trick to give the _screen tappable events
>>DEFINE CLASS logo AS image
>>	oscr = _SCREEN
>>
>>	PROCEDURE Init
>>		* Find a file for this object
>>		lcFile = 'logo.bmp'
>>		if not empty(lcFile)
>>			this.Picture = lcFile
>>		else
>>			return .F.
>>		endif
>>		this.Position()
>>	ENDPROC
>>
>>	PROCEDURE oscr.Resize
>>		* This assumes the object was added to the screen as "oLogo"
>>		this.oLogo.Position()
>>	ENDPROC
>>
>>	PROCEDURE Position
>>		* Position this image where it should be
>>		with this
>>			.Left = _screen.width / 2 - .width / 2
>>			.Top = _screen.height / 2 - .Height / 2
>>		endwith
>>	ENDPROC
>>
>>ENDDEFINE
>>Then, run this code:
>>_screen.NewObject('oLogo', 'logo', 'screenimage.prg')
>>_screen.oLogo.Visible = .T.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform