Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Understanding ScaleMode and control coordinates
Message
 
 
To
15/09/2008 14:45:52
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01347419
Message ID:
01347744
Views:
19
>>
>>Hi Christof,
>>
>>Your approach works. Thank you very much. But I was wondering if it can be simplified. The way I understand your code works is you create (dynamically) a new commandbutton object and move it in place of the current one (where this code is executed). Then you get the position of this temporary commandbutton. What I am wondering is couldn't you just get the position of the current object position without creating a temporary one? But I am probably missing something because when I tried the following:
>>
>>
>>loPos = GetPem( Thisform, this )
>>
>>
>>I get error.
>
>The second parameter is a string, the name of the object, relative to its immediate parent. If you're in a container on a page on a pageframe, you won't get anything, because your object is not a member of a form, it's parent, or parent's parent is.
>
>getpem(thisform, this.name)
>
>may work, but only if your object is directly on the form.
>
>>The reason I wanted to avoid creating a temporary commandbutton is I am concerned that creating a new object (temporary commandbutton) every time user clicks on the button will "do something" (and I don't know what really) with memory.
>
>A simple commandbutton, i.e. a baseclass, uses few dozen bytes of memory - its definition is already in there, as it is a base class, so it's only a block of memory to hold its properties. Which is actually very cheap, considering that it's invisible. If it but flickered for one frame, it would have consumed far more memory and CPU time.

Thank you very much for explaining how GetPem() works and for alleviating my concern of memory use.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform