Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACI0105052 #2

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Project/Sources/Methods/Compiler_Methods.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,11 @@ C_TEXT:C284(SearchPicker__SET_TEXT; $1)
C_TEXT:C284(SearchPicker__SET_TEXT; $2)
C_TEXT:C284(TimePicker APPLY DEFAULT VALUES; $1)
C_DATE:C307(DatePicker__CalculateFirstDay; $1)
C_TEXT:C284(DatePicker__CalculateFirstDay; $2)
C_TEXT:C284(DatePicker__CalculateFirstDay; $2)
C_POINTER:C301(Tool_AdjustWindowPos; $1)
C_POINTER:C301(Tool_AdjustWindowPos; $2)
C_LONGINT:C283(Tool_AdjustWindowPos; $3)
C_LONGINT:C283(Tool_AdjustWindowPos; $4)
C_OBJECT:C1216(Tool_ScreenInfoFromPoint; $0)
C_LONGINT:C283(Tool_ScreenInfoFromPoint; $1)
C_LONGINT:C283(Tool_ScreenInfoFromPoint; $2)
15 changes: 1 addition & 14 deletions Project/Sources/Methods/DatePicker Display Dialog.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,7 @@ If ($CalcXY=True:C214)

End if

Case of
: (($x1+$Width)>Screen width:C187) // Screen on MAC, MDI window on WIN
$x1:=Screen width:C187-$Width-5
: ($x1<5)
$x1:=5
End case

Case of
: (($y1+$Height)>Screen height:C188)
$y1:=Screen height:C188-$Height-10
: ($y1<5)
$y1:=5
End case

Tool_AdjustWindowPos(->$x1; ->$y1; $Width; $Height)

$form:=New object:C1471 //ACI0099621 //ACI0099964
If (Count parameters:C259>=3)
Expand Down
50 changes: 50 additions & 0 deletions Project/Sources/Methods/Tool_AdjustWindowPos.4dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//%attributes = {"invisible":true}
#DECLARE($ioPosX : Pointer; $ioPosY : Pointer; $inWidth : Integer; $inHeight : Integer)

var $applicationInfo : Object
var $inModalDialog : Boolean
var $x; $y : Integer
var $screenInfo : Object

$screenInfo:={x: 0; y: 0; width: Screen width:C187; height: Screen height:C188}

$x:=$ioPosX->
$y:=$ioPosY->

If (Is Windows:C1573)
$applicationInfo:=Application info:C1599
$inModalDialog:=(Window kind:C445(Frontmost window:C447)=Modal dialog:K27:2)

If ($applicationInfo.SDIMode=False:C215 & $inModalDialog)
CONVERT COORDINATES:C1365($x; $x; XY Main window:K27:8; XY Screen:K27:7)
End if

If ($applicationInfo.SDIMode=True:C214 | $inModalDialog)
$screenInfo:=Tool_ScreenInfoFromPoint($x; $y)
End if
Else
$screenInfo:=Tool_ScreenInfoFromPoint($x; $y)
End if

Case of
: (($x+$inWidth)>($screenInfo.x+$screenInfo.width))
$x:=($screenInfo.x+$screenInfo.width)-$inWidth-5
: ($x<($screenInfo.x+5))
$x:=$screenInfo.x+5
End case

Case of
: (($y+$inHeight)>($screenInfo.y+$screenInfo.height))
$y:=($screenInfo.y+$screenInfo.height)-$inHeight-10
: ($y<($screenInfo.y+5))
$y:=$screenInfo.y+5
End case

If (Is Windows:C1573)
If ($applicationInfo.SDIMode=False:C215 & $inModalDialog)
CONVERT COORDINATES:C1365($x; $x; XY Screen:K27:7; XY Main window:K27:8)
End if
End if

$ioPosX->:=$x
$ioPosY->:=$y
18 changes: 18 additions & 0 deletions Project/Sources/Methods/Tool_ScreenInfoFromPoint.4dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//%attributes = {"invisible":true}
#DECLARE($inPosX : Integer; $inPosY : Integer)->$result : Object
var $screenCount; $screenIndex : Integer
var $left; $top; $right; $bottom : Integer

$result:=New object:C1471("x"; 0; "y"; 0; "width"; Screen width:C187; "height"; Screen height:C188)

$screenCount:=Count screens:C437
For ($screenIndex; 1; $screenCount)
SCREEN COORDINATES:C438($left; $top; $right; $bottom; $screenIndex; Screen work area:K27:10)
If (($inPosX>=$left) & ($inPosX<$right) & ($inPosY>=$top) & ($inPosY<$bottom))
$result.x:=$left
$result.y:=$top
$result.width:=$right-$left
$result.height:=$bottom-$top
break
End if
End for
Loading