Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need 2 Navbars
Message
From
11/01/1999 17:41:01
 
 
To
11/01/1999 09:13:10
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00173500
Message ID:
00174878
Views:
39
>Thanks guys!! That's what I did (with some help here at work). I might take a look at that class sometime, though, David. Sounds a lot better than re-inventing the wheel each time I do this.

Whoops HTML problem. Try this....

There's really not much to it Denise. I use the border of the command group (which gets set to invisible at runtime) to define the run-time size of the buttons. So you can visually set up the border at design time without worrying about the appearance of the buttons. Here's the code
**************************************************
*-- Class:        vsadegrp (c:\dev\common\classes\vs.vcx)
*-- ParentClass:  vsgrp (c:\dev\common\classes\vs.vcx)
*-- BaseClass:    commandgroup
*-- Time Stamp:   06/05/98 10:50:05 AM
*
DEFINE CLASS vsadegrp AS vsgrp && use your own base comandgroup class here
	ButtonCount = 3
	Height = 25
	Width = 160
	Name = "adegrp"
	Command1.Top = 0
	Command1.Left = 0
	Command1.Height = 19
	Command1.Width = 48
	Command1.Caption = "Add"
	Command1.Name = "Command1"
	Command2.Top = 0
	Command2.Left = 49
	Command2.Height = 19
	Command2.Width = 48
	Command2.Caption = "Delete"
	Command2.Name = "Command2"
	Command3.Top = 0
	Command3.Left = 98
	Command3.Height = 19
	Command3.Width = 48
	Command3.FontSize = 8
	Command3.Caption = "Edit"
	Command3.Name = "Command3"


	PROCEDURE Init
		DoDefault()
		LOCAL n, nCnt
		n= 0
		nCnt= 0
		* only allow for visible buttons in layout
this way you can turn buttons off simply by making them visible= .F. You can also add other buttons at design time.
		FOR EACH oCmd IN THIS.Buttons
			IF m.oCmd.visible
				nCnt= m.nCnt + 1
			ENDIF
		ENDFOR

		FOR EACH oCmd IN THIS.Buttons
			IF oCmd.visible
				oCmd.Top= 0
				oCmd.Height= THIS.Height
				ocmd.Width= INT((THIS.width-m.nCnt)/m.nCnt)
				oCmd.Left= (oCmd.width+1) * m.n
				n= m.n + 1
			ENDIF
		ENDFOR
		THIS.borderStyle= 0
	ENDPROC


ENDDEFINE
*
*-- EndDefine: vsadegrp
**************************************************
Regards
Previous
Reply
Map
View

Click here to load this message in the networking platform