Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Randomly Moving Controls
Message
 
À
21/09/2000 14:16:18
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00418697
Message ID:
00419225
Vues:
32
>Matt,
>
>I have my container shuffleing the controls. Now the container is a 4 x 4 and has 15 controls in it which leaves a space empty. I am tring to get the code right that will move a control into the empty space when clicked only if the button is adjacent to the empty space. I am having trouble testing for a button residing to the left, top, bottom, right of a clicked button.

Steven,

You have to think outside the box. He's my stab.. but don't forget, there are dozens of ways to skin a cat..

Each position for a button should have an address: 1 through 16. Create a validation lookup table:
Btn_Address N(2), Valid_near N(2)
1,2
1,5
2,1
2,3
2,6
3,2
3,7
etc.....

Each button should have a position property. (HINT: create a new button class) Each time a button gets moved, the position property should be updated. Prior to moving a button, valididate the destination by doing a seek:
SELECT Add_Valid
SET ORDER TO Adr_Validate  &&  [Btn_Address*100+Valid_near]

lnCurrent = 5
lnTarget = 6

IF SEEK(lnCurrent*100+lnTarget)

  * button move code here (use the array as stated in the previous post)

ENDIF
HTH
I try to stay online, to get better information.
I try to get away from the office once in a while..
But they KEEP... PULLING.. ME.. BACK.. IN!!!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform