Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing Parameters
Message
De
17/02/1999 13:38:32
 
 
À
17/02/1999 13:23:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00188484
Message ID:
00188539
Vues:
23
>****************************************************
>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 init
this.SetTable("aqui es donde va el nombre de la tabla")
* en este o en cualquier otro metodo puedes pasar el valor de tu
* parametro al metodo que lo va a usar
ENDPROC

>PROCEDURE SetTable
LPARAMTERS;
pcTableAlias && recibe el parametro

PRIVATE;
cTableAlias && creas la varable para guardar el valor

cTableAlias = pcTableAlias && Assignas el valor a la variable

> 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
>************************************************
An Intelligent fool can make things bigger and more complex... It takes a touch of a genius -and a lot of courage- to move in the opposite direction".
-Albert Einstein
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform