Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing Parameters
Message
From
17/02/1999 13:23:07
 
 
To
17/02/1999 13:11:20
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00188484
Message ID:
00188522
Views:
21
OK, este codigo no es ni mas ni menos que el mismo "vcr class" wue figura en el manual de visual foxpro. Si te fijas en el final del codigo veras el objeto "vcr" como contenedor...con el metodo SetTable.
La funciojn de este metodo es definir el valor de la propiedad TableAlias de cada uno de los botones de navegacion para saber, en caso de tener mas de una tabal abierta, a cual afectan.
Sin esta propiedad, navegaria por la tabal seleccionada que no siempre sera justo la que yo quiero navegar (en caso de que tenga varias a biertas)


Este codigo es para un .PRG...pero estoy adaptandolo para programarlo en forma visual....es mucho mas dinamico....que al viejo estilo....

Aqui va el codigo...lo puse todo para que no te queden dudas...pero el problema esta maracaod al final...

****************************************************
DEFINE CLASS Navbutton AS COMMANDBUTTON
Height = 25
Width = 25
TableAlias = ""
PROCEDURE Click
IF NOT EMPTY(This.TableAlias)
SELECT (This.TableAlias)
ENDIF
ENDPROC

PROCEDURE RefreshForm
_SCREEN.ActiveForm.Refresh
ENDPROC


********************

DEFINE CLASS navTop AS Navbutton
Caption = "|<"
PROCEDURE Click
DODEFAULT()
GO TOP
THIS.RefreshForm
ENDPROC
ENDDEFINE


DEFINE CLASS navNext AS Navbutton
Caption = ">"
PROCEDURE Click
DODEFAULT()
SKIP 1
IF EOF()
GOTO BOTTOM
ENDIF
THIS.RefreshForm
ENDPROC
ENDDEFINE


DEFINE CLASS navPrior AS Navbutton
Caption = "<"
PROCEDURE Click
DODEFAULT()
SKIP -1
IF BOF()
GO TOP
ENDIF
THIS.RefreshForm
ENDPROC
ENDDEFINE


DEFINE CLASS navBottom AS Navbutton
Caption = ">|"
PROCEDURE Click
DODEFAULT()
GO BOTTOM
THIS.RefreshForm
ENDPROC
ENDDEFINE


*******************************************

DEFINE CLASS vcr AS CONTAINER
Height = 25
Width = 100
Left = 3
Top = 3

ADD OBJECT cmdTop AS navTop WITH Left = 0
ADD OBJECT cmdPrior AS navPrior WITH Left = 25
ADD OBJECT cmdNext AS navNext WITH Left = 50
ADD OBJECT cmdBot AS navBottom WITH Left = 75

PROCEDURE SetTable(cTableAlias) //este es el problema, no se como definir //esta variable ctableAlias
IF TYPE("cTableAlias") = 'C'
THIS.cmdTop.TableAlias = cTableAlias
THIS.cmdPrior.TableAlias = cTableAlias
THIS.cmdNext.TableAlias = cTableAlias
THIS.cmdBot.TableAlias = cTableAlias
ENDIF
ENDPROC
ENDDEFINE

DEFINE CLASS NavForm AS Form
ADD OBJECT oVCR AS vcr
ENDDEFINE
************************************************
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform