|
Post by Roger Cabo on Nov 13, 2022 16:18:56 GMT 1
Hi everyone, does anyone can help with the real draw area of a form, excluding the borders? I searched through all the screen metrics but I didn't get the right values. Thank you.. Form_Get_InnerArea.G32 (572 B) The Frame top border is about 31 pixels, but I must subtract additional 39 to get the correct result.
Should be like this
|
|
|
Post by Roger Cabo on Nov 13, 2022 16:28:10 GMT 1
Seems it's the Screen.cyMin or Screen.cxMin values. frx1.Height = (frm1.Height / PixelsToTwipX(1)) - frx1.Top - Screen.cyMin - 1
|
|
|
Post by (X) on Nov 13, 2022 18:48:59 GMT 1
This is how I do it...
$Library "gfawinx" $Library "UpdateRT" UpdateRuntime ' Patches GfaWin23.Ocx
LoadForm frm1 // // How to fit the frx1.height exactly to the bottom of the main form? //
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' There are a few options... ' Work<Width|Height>(<Form|Win>) return the actual working size in pixels of a ' form’s workarea. ' Dim w% = WorkWidth(frm1) : Trace w Dim h% = WorkHeight(frm1) : Trace h
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' <Form|Win>.<left|top|width|height> will always be in Twips. ' ' By exception, frx metrics are specified in the units set with: ' ' <frx>.ScaleMode = <bas_Units> ' ' <Form|Win>.Scale<width|height> returns the inner work area metric of the ' Form|Win in the specified ScaleMode units. ' 'frm1.ScaleMode = basTwips frm1.ScaleMode = basPixels : Trace frm1.Height
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' To set the frx on the bottom of the main form... ' Dim Inner_Form_Height = frm1.ScaleHeight : Trace Inner_Form_Height Dim Frx_Height = frx1.Height : Trace Frx_Height frx1.Top = Inner_Form_Height - Frx_Height : Trace frx1.Height
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Just to verify OpenW behaviour... ' °OpenW 1, 0, 0, 200, 200 °Trace Win_1.Width °Trace TwipsToPixelX(Win_1.Width) °Trace TwipsToPixelY(Win_1.Height) °Trace Win_1.ScaleWidth °Trace Win_1.ScaleHeight
Do Sleep Until Me Is Nothing
|
|
|
Post by Roger Cabo on Nov 14, 2022 15:30:20 GMT 1
never know that this exist! :-) Seems in; $Library "gfawinx" $Library "UpdateRT" UpdateRuntime ' Patches GfaWin23.Ocx
|
|
|
Post by (X) on Nov 14, 2022 15:38:08 GMT 1
By the way:
WorkWidth() and WorkHeight() functions are provided by: $Library "gfawinx".
|
|