begin process at 2010 02 09 18:23:10
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Formulaires

 > ALLEZ, POUR S'AMUSER... UNE CLASSE FORMULAIRE D'ATTENTE STYLE MATRIX

ALLEZ, POUR S'AMUSER... UNE CLASSE FORMULAIRE D'ATTENTE STYLE MATRIX


 Information sur la source

 Description

Bah, rien d'important...
juste comment utiliser les anciennes fonctions du foxBase à des fins ludiques

Source

  • * Basé sur un code de Olaf Doschke
  • * et transformé en classe formulaire
  • * à reserver aux traitements
  • * qui ne souffriront pas d'un peu de CPU
  • * en moins ...
  • matrix = CREATEOBJECT("oMatrix", "INKEY(.01)=27")
  • matrix.show()
  • #DEFINE screenwidth 80
  • #DEFINE screenheight 30
  • DEFINE CLASS oMatrix as Form
  • backcolor=RGB(0,0,0)
  • fontname="Courier New"
  • Caption="Reloadding..."
  • FUNCTION init
  • PARAMETERS cBreakCondition
  • SET TALK off
  • this.Width=screenwidth * FONTMETRIC(7, this.FontName, this.FontSize)
  • this.Height=screenheight * FONTMETRIC(1, this.FontName, this.FontSize)+SYSMETRIC(9)
  • this.AddProperty("BreakCondition", cBreakCondition)
  • ENDFUNC
  • FUNCTION activate
  • DIMENSION protectedpositions[screenwidth,screenheight]
  • DIMENSION trails[screenwidth,2]
  • LOCAL cBreakCondition
  • cBreakCondition = this.BreakCondition
  • FOR x = 1 TO screenwidth
  • FOR Y = 1 TO screenheight
  • protectedpositions[x,y] = CHR(0)
  • ENDFOR Y
  • ENDFOR x
  • DO WHILE .T.
  • FOR ii = 1 TO 42
  • x=INT(RAND()*screenwidth)
  • Y=INT(RAND()*screenheight)
  • IF protectedpositions[x+1,y+1] = CHR(0)
  • this.FORECOLOR = RGB(0,RAND()*208,0)
  • @Y,x SAY CHR(RAND()*224+32)
  • ENDIF
  • ENDFOR ii
  • lntrail = RAND()*screenwidth+1
  • IF EMPTY(trails[lntrail,1])
  • trails[lntrail,1] = 1.0
  • trails[lntrail,2] = RAND()*2.0+0.5
  • ENDIF
  • FOR lntrail = 1 TO screenwidth
  • IF !EMPTY(trails[lntrail,1])
  • lngreen = 255
  • lcchar = CHR(RAND()*224+32)
  • this.FORECOLOR = RGB(0,lngreen,0)
  • Y = INT(trails[lntrail,1])
  • IF Y<screenheight
  • @ Y,lntrail-1 SAY lcchar
  • protectedpositions[lntrail,y+1] = lcchar
  • ENDIF
  • FOR Y = Y-1 TO 0 STEP -1
  • lngreen = MAX(lngreen - 7,0)
  • IF lngreen >0
  • this.FORECOLOR = RGB(0,lngreen,0)
  • IF Y<screenheight
  • @ Y,lntrail -1 SAY protectedpositions[lntrail,y+1]
  • ENDIF
  • ELSE
  • IF Y<screenheight
  • protectedpositions[lntrail,y+1] = CHR(0)
  • ENDIF
  • ENDIF
  • ENDFOR Y
  • trails[lntrail,1] = trails[lntrail,1] + trails[lntrail,2]
  • IF trails[lntrail,1] > 1.5 * screenheight
  • trails[lntrail,1] = 0
  • FOR Y = 1 TO screenheight
  • protectedpositions[lntrail,y] = CHR(0)
  • this.FORECOLOR = RGB(0,0,0)
  • @ Y,lntrail-1 SAY ' '
  • ENDFOR Y
  • ENDIF
  • ENDIF
  • ENDFOR lntrail
  • cBreakCondition = this.BreakCondition
  • DOEVENTS && FORCE
  • IF &cBreakCondition
  • EXIT
  • ENDIF
  • ENDDO
  • RELEASE protectedpositions
  • RELEASE trails
  • this.release()
  • ENDFUNC
  • ENDDEFINE
* Basé sur un code de Olaf Doschke
* et transformé en classe formulaire 
* à reserver aux traitements
* qui ne souffriront pas d'un peu de CPU
* en moins ...

matrix = CREATEOBJECT("oMatrix", "INKEY(.01)=27")
matrix.show()

#DEFINE screenwidth 80
#DEFINE screenheight 30

DEFINE CLASS oMatrix as Form
backcolor=RGB(0,0,0)
fontname="Courier New"
Caption="Reloadding..."

FUNCTION init
PARAMETERS cBreakCondition
	SET TALK off
	this.Width=screenwidth * FONTMETRIC(7, this.FontName, this.FontSize)
	this.Height=screenheight * FONTMETRIC(1, this.FontName, this.FontSize)+SYSMETRIC(9)
	this.AddProperty("BreakCondition", cBreakCondition)
ENDFUNC

FUNCTION activate
DIMENSION protectedpositions[screenwidth,screenheight]
DIMENSION trails[screenwidth,2]
LOCAL cBreakCondition 
cBreakCondition = this.BreakCondition

FOR x = 1 TO screenwidth
   FOR Y = 1 TO screenheight
      protectedpositions[x,y] = CHR(0)
   ENDFOR Y
ENDFOR x

DO WHILE .T.
   FOR ii = 1 TO 42
      x=INT(RAND()*screenwidth)
      Y=INT(RAND()*screenheight)
      IF protectedpositions[x+1,y+1] = CHR(0)
         this.FORECOLOR = RGB(0,RAND()*208,0)
         @Y,x SAY CHR(RAND()*224+32) 
      ENDIF
   ENDFOR ii

   lntrail = RAND()*screenwidth+1
   IF EMPTY(trails[lntrail,1])
      trails[lntrail,1] = 1.0
      trails[lntrail,2] = RAND()*2.0+0.5
   ENDIF

   FOR lntrail = 1 TO screenwidth
      IF !EMPTY(trails[lntrail,1])
         lngreen = 255
         lcchar = CHR(RAND()*224+32)
         this.FORECOLOR = RGB(0,lngreen,0)
         Y = INT(trails[lntrail,1])
         IF Y<screenheight
            @ Y,lntrail-1 SAY lcchar
            protectedpositions[lntrail,y+1] = lcchar
         ENDIF

         FOR Y = Y-1 TO 0 STEP -1
            lngreen = MAX(lngreen - 7,0)
            IF lngreen >0
               this.FORECOLOR = RGB(0,lngreen,0)
               IF Y<screenheight
                  @ Y,lntrail -1 SAY protectedpositions[lntrail,y+1]
               ENDIF
            ELSE
               IF Y<screenheight
                  protectedpositions[lntrail,y+1] = CHR(0)
               ENDIF
            ENDIF
         ENDFOR Y

         trails[lntrail,1] = trails[lntrail,1] + trails[lntrail,2]
         IF trails[lntrail,1] > 1.5 * screenheight
            trails[lntrail,1] = 0
            FOR Y = 1 TO screenheight
               protectedpositions[lntrail,y] = CHR(0)
               this.FORECOLOR = RGB(0,0,0)
               @ Y,lntrail-1 SAY ' '
            ENDFOR Y
         ENDIF
      ENDIF
   ENDFOR lntrail
   
	cBreakCondition = this.BreakCondition
	
    DOEVENTS && FORCE
	IF &cBreakCondition
		EXIT
	ENDIF
 
ENDDO
RELEASE protectedpositions
RELEASE trails
this.release()
ENDFUNC

ENDDEFINE



 Conclusion

merci à Olaf Doschke pour la base de fonctionnement.


 Sources du même auteur

[VFP]CLASSE SYSTEMTIME
CRYPTE/DECRYPTE
Source avec Zip SPLASHSCREEN TYPE ALERTE D'OUTLOOK2003
[VFP] UTILISER UN WEB SERVICE
Source avec Zip CLASSE EDITEUR HTML

 Sources de la même categorie

Source avec Zip SAISIE GRAPHIQUE D'UN CRÉNEAU HORAIRE par leissler
CREER UNE TABLE CONTENANT LA LITES COMPLÈTE DES OBJETS CONTE... par aumeric
Source avec Zip LA GESTION D'UN SPLITTER EN NATIF FOX par delphifox
PROGRESBAR par Roland38
Source avec Zip CALCUL D'UN EMPRUNT AVEC TAUX SIMPLE OU COMPOSE par johnmary

 Sources en rapport avec celle ci

CREER UNE TABLE CONTENANT LA LITES COMPLÈTE DES OBJETS CONTE... par aumeric
FORMULAIRE ARRONDI par FredArmoni

Commentaires et avis

Commentaire de FrancisFaure le 06/10/2004 15:40:23

C'est Sympa !

Commentaire de FredArmoni le 06/10/2004 16:21:44 administrateur CS

c'est gentil
;-)

Commentaire de HENOK le 06/08/2005 14:37:18

C'est bien et mérite encouragement.
Amicalement H.D.

Commentaire de psyb le 08/12/2006 16:08:09

C'est vraiment bien!
Il faut plus de codes comme ça dans Fox ;-)

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

combobox dans un formulaire [ par brunaux ] Bonjour à tous !utilisant VFP 6.0 occasionnellement pour faire des écrans de saisie,je voudrais savoir comment l'on fait dans un combobox(donc avec un re-combobox dans formulaire [ par brunaux ] Bonjour !merci thierry et mike pour votre aide si précieuse,je vais pouvoir me débrouiller maintenant et arriver à faire quelque chose qui marche ! me formulaire ajustable [ par brunaux ] Bonjour !merci thierry pour la reponse pour ajuster automatiquement un formulaire suivant la taille de l'ecran de l'utilisateur !encore merci problème du serveur ole [ par h_adil ] j'ai inser&#233; un objet excel dabs une formulaire mais lorsque je passe du mode cr&#233;ation au moode formulaire j'ai un message qui apparait "&nbs Gestion d'objet [ par spoutnic_37 ] Salutation, &nbsp;&nbsp;&nbsp; Mon probleme est le suivant : comment faire un ensemble de formulaire grace &#224; visual foxpro 6, et g&#233;rer les Formulaire premier niveau et enfant . [ par spoutnic_37 ] aloha !!!&nbsp;&nbsp;&nbsp;Je voudrais faire apparaitre des formulaires enfants dans un formulaire parent. Je parametre donc avec showWindow et mdifor formulaire-->Excel [ par Domatreal ] Salut J'ai creer un formulaire et j'aimerais savoir si on pouvait exporter le resultat (tel qu'il&nbsp;apparait) dans un fichier excel.&nbsp;Merci bie a faire et ne pas faire en VFP [ par brunaux ] Je suis utilisateur occasionnel et en lisant une contribution dans ATOUTFOX il y a un article qui s'intitule ' a faire et ne pas faire en VFP' j'aimer pb d'exe ! [ par spoutnic_37 ] aloha ,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j'ai un probleme avec mon executable. En fait j'ai un formulaire qui possede les bonnes tables dans l Formulaire [ par Domatreal ] Salut J'aimerais savoir comment on peut creer&nbsp;(a l'aide d'un programme) un formulaire en fonction de la structure d'une table quelconque.En d'aut


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,546 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales