Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can i create Navigatebtn class like Delphi's DBNavigator
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How can i create Navigatebtn class like Delphi's DBNavigator
Miscellaneous
Thread ID:
00717597
Message ID:
00717597
Views:
41
Hi All,

I have grid clas (specially Thanks from here for Nancy Folsom,Ed Rauh and Nadya Nosovosky for that class built) like behavior Delphi's DBGrid.(It uses Getfldstate() also TableUpdate(.t.) etc.. ) when presses DownArrow its adding new row to the grid and if Getfldstate(-1) anything changed deletes row or others situation.

Now i want to do this. i wantto use this actions with save,new buttons like Delphi's DBNavigator but how ? for eg.
when i press the DownArrow; SaveButton should be enabled and if I entered some data after Press UpArrow or DownArrow table should updated via TableUpdate(.t.) or if not changed anythings on at the new row and UpArrow Pressed ,TableRevert(.t.) routine should run and SaveButton should be disabled . And also this class can be use with textboxes not only with grid ... Sory if my explain was not complicated .I need some help if possible some samples about this matter...

TIA
* Grid InitEvent Code
FOR EACH oColumn IN this.Columns
   WITH oColumn
      .RemoveObject('Text1')
      .NewObject('text1','GrdAddNew','sdbgrid.vcx') 
     .CurrentControl='Text1'
     .text1.visible=.t. 
     ENDWITH
ENDFOR
* GrdAddnew textbox class KeyPressEvent Code
LOCAL lcAlias
		lcAlias = THIS.PARENT.PARENT.RECORDSOURCE
		DO CASE
			CASE nKeyCode = 24 && '{DNARROW}'
				* 3 Field in an appended record has not been
				* edited or deletion status has not changed for
				* the appended record.
				IF GETFLDSTATE(-1) = REPLICATE("3",FCOUNT(lcAlias)+1)
					NODEFAULT
				ENDIF
			CASE nKeyCode = 5 && '{UPARROW}'
				IF GETFLDSTATE(-1) = REPLICATE("3",FCOUNT(lcAlias)+1)
					TABLEREVERT(.F., lcAlias)
					THIS.PARENT.PARENT.REFRESH
				ENDIF
		ENDCASE
Next
Reply
Map
View

Click here to load this message in the networking platform