Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Anchor use for the rest of us
Message
From
02/03/2008 13:27:29
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01298048
Message ID:
01298051
Views:
26
>Hello friends,
>
>I have read the VFP help on Anchor property, searched here on UT for some messages on Anchor. The VFP Help goes over my head. The few messages that I read suggest some numbers to use. Like in one message a guru suggest to set anchor value to 768, 45, 135; but no explanation on how these numbers derived. So I am wondering, is there an article on the web or on UT that has an explanation of use of Anchors for Dummies <g>
>
>Thank you in advance for your help.

In every case, the anchor value should be the sum of some of the powers of two that appear in the help.

E.g. 768 = 512 + 256, that is, vertical fixed size and horizontal fixed size.

In this example, I first determined the highest power of two that fits (512), and then subtracted to see how much was missing. Then, obtain the next power of two.

Another example, showing all the steps:
45 = 32 + 23
45 = 32 + 16 + 7
45 = 32 + 16 + 4 + 3
45 = 32 + 16 + 4 + 2 + 1

Now, look up in the help, what every one of these values does.

When writing this value in code, instead of writing:
SomeObject.Anchor = 768
better change it to something like this, which makes the result more readable:
#define ANCHOR_HORIZONTAL_FIXED_SIZE 512
#define ANCHOR_VERTICAL_FIXED_SIZE 256
...
SomeObject.Anchor = ANCHOR_HORIZONTAL_FIXED_SIZE + ANCHOR_VERTICAL_FIXED_SIZE
The #define commands would be placed in an include file.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform