Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Windows START menu style
Message
From
28/01/2012 11:15:34
 
 
To
28/01/2012 06:51:46
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01533962
Message ID:
01533968
Views:
116
>i want to change the GUI of my app and i have decided to mimic the windows
>i have 2 problems
>1-what king of object do i need for the menu that appears and desappears when mouse is out


As alternative, you can use DEFINE POPUP, check in VFP help how to do that.


>2-how to put the task bar at bottom of screen ?


This is simple demo with very simple class, you can extend it to fit your needs
SET TALK OFF
CLEAR

oApp = CREATEOBJECT("My_Application")
IF VARTYPE(m.oApp) == "O"
	m.oApp.Run()
ENDIF
oApp = NULL

PROCEDURE OnShutdown
	CLEAR EVENTS
ENDPROC


*!*
*!* simple application class
*!*
DEFINE CLASS MY_Application AS Custom
	PROCEDURE Init
		ON SHUTDOWN DO OnShutdown
		SET STATUS BAR OFF
		SET SYSMENU OFF
		this.HideToolbars()
	ENDPROC
	
	PROCEDURE Destroy
		_SCREEN.RemoveObject("oTaskbar")
		IF _VFP.StartMode = 0
			SET SYSMENU ON
			SET STATUS BAR ON
			this.ShowToolbars()
		ENDIF
		ON SHUTDOWN
	ENDPROC
	
	PROCEDURE Run
		_SCREEN.AddObject("oTaskbar", "My_Taskbar")
		READ EVENTS
	ENDPROC
	
	PROCEDURE HideToolbars
		IF _VFP.StartMode = 0
			ADDPROPERTY(this, "aToolbars[1,2]")
			DIMENSION this.aToolbars[14,2]
			this.aToolbars[ 1,1] = [Standard]
			this.aToolbars[ 2,1] = [Form Designer]
			this.aToolbars[ 3,1] = [Layout]
			this.aToolbars[ 4,1] = [Query Designer]
			this.aToolbars[ 5,1] = [View Designer]
			this.aToolbars[ 6,1] = [Color Palette]
			this.aToolbars[ 7,1] = [Form Controls]
			this.aToolbars[ 8,1] = [Database Designer]
			this.aToolbars[ 9,1] = [Report Designer]
			this.aToolbars[10,1] = [Report Controls]
			this.aToolbars[11,1] = [Print Preview]
			this.aToolbars[12,1] = [Command]
			this.aToolbars[13,1] = [Properties]
			this.aToolbars[14,1] = [Project Manager]
			_SCREEN.Visible = .T.
			FOR m.i = 1 TO ALEN(this.aToolBars, 1)
				this.aToolBars[i, 2] = WVISIBLE(this.aToolBars[i,1])
				IF this.aToolBars[m.i, 2]
					HIDE WINDOW (this.aToolBars[i, 1])
				ENDIF
			ENDFOR
		ENDIF
	ENDPROC
	
	PROCEDURE ShowToolbars
		IF PEMSTATUS(this, [aToolbars], 5)
			FOR m.i = 1 TO ALEN(this.aToolBars, 1)
				IF this.aToolBars[m.i, 2]
					SHOW WINDOW (this.aToolBars[m.i, 1])
				ENDIF
			ENDFOR
		ENDIF
	ENDPROC
ENDDEFINE

*!*
*!* simple taskbar class
*!*
DEFINE CLASS MY_Taskbar AS Container
	Height = 32
	
	ADD OBJECT cmdStart AS CommandButton WITH ;
		Left = 1, ;
		Top = 1, ;
		Width = 100, ;
		Height = 30, ;
		Caption = "Start" 
	
	PROCEDURE Init
		this.Move(0, _SCREEN.Height - this.Height, _SCREEN.Width)
		this.Anchor = 14
		this.Visible = .T.
	ENDPROC
ENDDEFINE
Regards,
Ony
Previous
Reply
Map
View

Click here to load this message in the networking platform