Calculate position of dropped menu EXACTLY below the icon
Posted: 11 Nov 2024 18:33
Hi, I need some help in this...
Based on my window configuration, the XYplorer window sits at x=192px... anyway...
When we click the icon, basicaly the menu drops right below the mouse pointer, so I'm trying to change the position, for just below the icon (Toolbar).
I'm trying to develop a equation, that if we click (like range) from the middle to the end of the icon, the code compensates the overflow (even if it was more 14px...)...
or the contrary... from the the middle, back where the icon starts (like, the first 16px..)
Noob skills aside...
and write some code for the popupnested() menu:
Like this:

https://ibb.co/sK5rmcJ
NOT this:

https://ibb.co/0FL8NfT
Hope get some help!
Thanks!
Lima79.
Based on my window configuration, the XYplorer window sits at x=192px... anyway...
When we click the icon, basicaly the menu drops right below the mouse pointer, so I'm trying to change the position, for just below the icon (Toolbar).
I'm trying to develop a equation, that if we click (like range) from the middle to the end of the icon, the code compensates the overflow (even if it was more 14px...)...
or the contrary... from the the middle, back where the icon starts (like, the first 16px..)
Noob skills aside...
Code: Select all
$homemenu = <<<>>>
<bla bla bla>
>>>;
$szScreen = 1920;
$szIcon = 32;
// CTB Position "X"
if ($xValue) {
$xPosition = get("cursorpos", x);
$valuePositionX = $szScreen / $xPosition;
$xDiff = $szIcon / $valuePositionX;
}
$xValue = $xPosition - $xDiff;
// CTB Position "Y"
if ($yValue) {
$yPosition = get("cursorpos", y);
if ($buttonSet) {
if (buttonset() == 1) {
$buttonSet = 93;
}
elseif (buttonset() == 2) {
$buttonSet = 58;
}
}
}
$yValue = ($yPosition - $yPosition) + $buttonSet;
$command = trim(popupnested($homemenu,$xValue,$yValue, 7:="|"));
if ($command != '') { load $command,, s; }

https://ibb.co/sK5rmcJ
NOT this:

https://ibb.co/0FL8NfT
Hope get some help!
Thanks!
Lima79.