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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Statusbar in the defaul VFP screen

Status
Not open for further replies.

madhatter2002

Programmer
Joined
Nov 6, 2002
Messages
73
Location
PH
does anybody know how to add a status bar to the default vfp screen using no forms but just the default scree (_screen)?

 
not sure what your trying to do but to enable/disable the status bar: SET STATUS BAR ON/OFF

kilroy [trooper]
 
hi torturedmind... regarding that fact.. yup! know that one.. but what i was trying to accomplish is to add panels in the status bar of vfp.. i just dont know if it is being achieved the same way as in activex controls of statusbar.
 
Hi Ramani,

hmmm.. maybe, what i want wasnt clear enough. Let me re-phrase it.

What I actually want is actually a status bar with 3 panels or 4. And these panels I can control on what it will display or contain. I am able to do a form with a status bar, no problem with that... but what I want is to make the default VFP screen to have a modified status bar that will contain 4 panels and display only the things that I want.

is this possible??
 
madhatter2002

See faq184-3155

If you add a .Resize() method to _SCREEN you can use that to trigger the resize event in the statusbar or directly resize the panels in the statusbar.

FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
Hi Chris, about the code in this FAQ, i am encountering an error (syntax error) whenever i start to instatiate the ofooter object
 
madhatter2002

You can't run the code as it is - it's there to show you how it all goes together and what the various properties are.

FI

ADD OBJECT footer.cntpanel3.oleaviplayer AS olecontrol WITH ;
Top = 2, ;
Left = 2, ;
Height = 16, ;
Width = 16, ;
Name = "oleAviPlayer"

will fail as you won't have the required olecontrol.

What I would suggest is that you create a new form and work through the example code adding controls and altering your new form's controls properties to match those in the code.

FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
I use a status bar class based on toolbar class and docked to bottom in Init method .

I've created the following procedure to be called in Paint event to clear the toolbar mover (so it really looks like a status bar)

Code:
PROCEDURE ClearToolbarMover
LPARAMETERS toToolbarRef, tnParenthWnd
*toToolbarRef		toolbar reference
*tnParenthWnd		_VFP or top level form(if toolbar is docked there) hwnd property
IF toToolbarRef.DockPosition = -1		
	RETURN
ENDIF
LOCAL i,j
DeclareAPI()
lnToolbarHwnd = GetToolbarHwnd(toToolbarRef, tnParenthWnd)	&&get toolbar hWnd
thDC = GetWindowDC(lnToolbarHwnd)							&&get toolbar DC
DO case
CASE INLIST(toToolbarRef.DockPosition,0,3)
	FOR i=2 TO 6
		FOR j=2 TO toToolbarRef.height - 4
			setpixel(thDC,i,j,toToolbarRef.backcolor)
		NEXT
	NEXT
CASE INLIST(toToolbarRef.DockPosition,1,2)
	FOR i=2 TO toToolbarRef.width - 4
		FOR j=2 TO 6
			setpixel(thDC,i,j,toToolbarRef.backcolor)
		NEXT
	NEXT
ENDCASE
ReleaseDC(thDC,lnToolbarHwnd)
CLEAR DLLS "GetWindow","GetWindowText","GetWindowDC","SetPixel","ReleaseDC"
RETURN


PROCEDURE GetToolbarHwnd
PARAMETERS toToolbarRef, tnParenthWnd
lcToolbarCaption = toToolbarRef.Caption
IF VARTYPE(tnParenthWnd) = 'L'
	lnVFPHnd = _VFP.hWnd 
ELSE
	lnVFPHnd = tnParenthWnd 
ENDIF
lnToolbarWhnd = 0
GetWindows(lnVFPHnd, 0,0)
RETURN lnToolbarWhnd


PROCEDURE GetWindows
LPARAMETERS lnHandle,lnParent,lnLevel
#DEFINE GW_HWNDNEXT   2 
#DEFINE GW_CHILD      5 
LOCAL WinCaption, hWindow, hParent, lvl
LOCAL hChild, oChild, hNext, oNext 
WinCaption = ''
hWindow = 0
hParent = 0
lvl = 0
IF lnHandle = 0 
	RETURN .F. 
ENDIF 
lvl = lnLevel 
hWindow = lnHandle 
hParent = lnParent 
WinCaption = GetWinText(lnHandle)
IF TRIM(WinCaption) = TRIM(lcToolbarCaption)
   	lnToolbarWhnd = hWindow
endif
hChild = GetWindow(hWindow, GW_CHILD) 
oChild = GetWindows( hChild, hWindow, lvl+1)
IF lnParent <> 0 
    hNext = GetWindow(hWindow, GW_HWNDNEXT) 
    oNext = GetWindows(hNext, hParent, lvl) 
ENDIF 


FUNCTION  GetWinText(hWindow) 
    LOCAL lcBuffer, lnResult 
    lcBuffer = Space(250) 
    lnResult = GetWindowText(hWindow, @lcBuffer, Len(lcBuffer)) 
RETURN Left(lcBuffer, lnResult) 



FUNCTION DeclareAPI
DECLARE INTEGER GetWindow IN user32 INTEGER hwnd, INTEGER wFlag 
DECLARE INTEGER GetWindowText IN user32; 
	INTEGER hwnd, STRING @lpString, INTEGER cch 
DECLARE INTEGER SetPixel IN gdi32 integer hDc, INTEGER x, INTEGER y, INTEGER nColor
DECLARE INTEGER GetWindowDC IN user32 INTEGER hwnd 
DECLARE INTEGER ReleaseDC IN user32 INTEGER hwnd, INTEGER hdc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top