PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WEBDEV 2024
→
Determine whether a position on screen is occupied ?
Determine whether a position on screen is occupied ?
Started by Stef, Mar., 26 2013 1:12 PM - 2 replies
Connect yourself…
Stef
#1
Registered member
45 messages
Posted on March, 26 2013 - 1:12 PM
I use code that moves controls around on pages at runtime.
Now I want to prevent controls to be moved to an area of the page that is already taken up by another control and calculate an alternative location if the first one is taken.
Is there a command that wil 'scan' a screen area to check if it is not empty ?
I cannot find such a command in the help files, maybe one of you has a way of dealing with this ?
Thx
Report
0
0
Fabrice Harari
#2
Posted on March, 26 2013 - 3:03 PM
Hi Stef
there are several ways of doing this...
One is to use the Enumxxxx functions to go through all the controls, and
check position and size to see if there is a conflict
Another is to KEEP in an array (by example) the position and size of all
control (as YOUR code is moving them around, YOUR code can also record
what its doing) and check against that...
Finally, it MAY be possible to do it by checking the color of the pixel
on the screen BUT that would mean that it would have to be different
from the color of your controls...
Best regards
--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting
More information on
http://www.fabriceharari.com
On 3/26/2013 6:23 AM, Stef wrote:
I use code that moves controls around on pages at runtime.
Now I want to prevent controls to be moved to an area of the page that is already taken up by another control and calculate an alternative location if the first one is taken.
Is there a command that wil 'scan' a screen area to check if it is not empty ?
I cannot find such a command in the help files, maybe one of you has a way of dealing with this ?
Thx
Report
0
0
Stef
#3
Registered member
45 messages
Posted on April, 02 2013 - 10:35 AM
Hi Fabrice,
I had already been experimenting with the pixel colors but this means I have to check a large number of pixels, being width*height of the area where a control needs to be moved to, and this for multiple possible colors (text color, background color, edge color, caption color...).
As I was already using an array to store several other properties of the edit controls I expanded the array storing X and Y positions. As width and heigth are known values I can now calculate/check positions.
Thx
Report
0
0
→ Go back to WEBDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text