Scale GUI objects in 4D?

Tim Leonard (5/16/14 2:02PM)
Bill Weale (5/22/14 1:01PM)
Bill Weale (5/22/14 1:06PM)
Ortwin Zillgen (5/23/14 9:24PM)
Chris Belanger (6/4/14 12:05AM)
Philippe Ganter (6/6/14 7:32PM)


Tim Leonard (5/16/14 2:02 PM)

Is there a way to automatically scale GUI objects in 4D? ?I use
screens of
different sizes and resolutions. When a form displays in 4D I realize
I can
make the window resizable and have objects automatically reposition
themselves if the window gets bigger, but the text size stays the same
size.
Therefore, I've been forced to create "jumbo" versions of forms to
make it
easy to read the text. ?In Windows there is a setting to globally
adjust the
dpi for a screen. ?Can 4D use this to know when to scale up the type
and
other objects? ?Has anyone found a solution to this?

Bill Weale (5/22/14 1:01 PM)

For years I've envisioned the capability of

1) keeping the current ability for the user to resize a window while
the contained objects respect the 'grow' and 'move' properties we use
Form Editor

and
2) offering the user a control like ?=A0?A ?=A0?=A0A ?=A0?=A0A
?=A0presented as
clickable links where he/she can adjust the relative sizes and spacing
of all form objects while retaining the positions they occupy based
upon 1 above

and

3) honoring any draggability settings we've configured in the Form
Editor

and

4) touching screen resolution is neither required nor prevented.

I *think* these features align with much of what Tim and Chris have
mentioned.

--Bill

On May 22, 2014, at 12:27 AM, Chris Belanger wrote:

color><param>00000,0000,DDEE/param>II would assume you are basically
looking for a ZOOM feature like, for instance, MS Office apps have, or
the CMD-+ on a mac.
I am also curious about that. I was thinking that I&iacute;d have to figure
out an algorithm for relocating / sizing all the form&iacute;s objects to get
that to happen.

I want to leave the screen at its current resolution (2560x1440) but
have my 4D App smart enough to enlarge the objects on a form when it
is displayed on a large monitor in a big form window.
I think I totally understand what you are looking for. Just in the
process of trying to figure it out myself.

&oacute; Chris

On May 16, 2014, at 12:02 PM, Tim Leonard <tfl@... wrote:

/color><color><param>8826F,0000,8219/param>IIs there a way to
automatically scale GUI objects in 4D? ?I use screens of
different sizes and resolutions. When a form displays in 4D I realize
I can
make the window resizable and have objects automatically reposition
themselves if the window gets bigger, but the text size stays the same
size.
Therefore, I've been forced to create "jumbo" versions of forms to
make it
easy to read the text. ?In Windows there is a setting to globally
adjust the
dpi for a screen. ?Can 4D use this to know when to scale up the type
and
other objects? ?Has anyone found a solution to this?
/color><color><param>00000,0000,DDEE/param>
/color>

Bill Weale (5/22/14 1:06 PM)

The user control I'm describing below is 3 underlined chr 'A's in
increasing font sizes. (It's pretty easy to do in css/html and you see
it on web pages a lot.) Emailing the styled version to myself worked,
but the email I received from the NUG server skinned off the
formatting...

--www

On May 22, 2014, at 1:01 PM, Bill Weale wrote:

color><param>00000,0000,DDEE/param>22) offering the user a control
like ?=A0?A ?=A0?=A0A ?=A0?=A0A ?=A0presented as clickable
links where he/she can
adjust the relative sizes and spacing of all form objects while
retaining the positions they occupy based upon 1 above
/color>

Ortwin Zillgen (5/23/14 9:24 PM)

color><param>00000,0000,DDEE/param>SSo you are saying if 4D developed
a similar zoom in runtime it would not be
useful?

Do you want to elaborate?
/color>
I can't use that kind of pixel-doubling, still the zoom in V14.1
<http://dddd.mettre.de/i/LBzoomV14.PNG>

Regards
O r t w i n ?Z i l l g e n
---------------------------------------------
<mailto:info@... =A0=A0<http://dddd.mettre.de?4713>
<feed://dddd.mettre.de/dddd.xml> <https://twitter.com/Ozett>
member of developer-network <http://www.die4dwerkstatt.de>

Chris Belanger (6/4/14 12:05 AM)

I did a quick &igrave;zoom&icirc; feature as a proof-of-concept and it is very
simple. I just need to improve it to automatically handle enlarging
areaList Pro features ( + row height, larger font, wider columns, et
al.)
It was easy to do for listboxes.

This is a rudimentary method but maybe it will help you guys on your
own road to implementation.

I placed a popup/drop down list at the top of my window. I defined it
as:

array longint(VIEW_SCALE;0). Then using the properties, I simply
entered 100 133 150 in as the &igrave;Default values&icirc;. Essentially, when
the
menu is pressed you get 100, 133, 150 as the options.

The script for this item (on click only) as:

EDIT_SCALE (Self)

This will work ONCE; I did not get fancy enough to re-process the
form. But you can tell that it is easy to just universally &igrave;Scale&icirc;
any
window with it.

Anyway, the project method is simply:

It scales all the objects and the listboxes in the window.

EDIT_SCALE is a project method as follows:

// EDIT_SCALE (->ScaleChooser)
C_POINTER($1) ?// scale chooser object
C_LONGINT($ScalePct)
$ScalePct:=Num($1->{$1->})
ARRAY TEXT($ObjectNames;0)
ARRAY POINTER($Variables;0)

FORM GET OBJECTS($ObjectNames;$Variables)
$ObjCnt:=Size of array($ObjectNames)
ARRAY LONGINT($Top;$ObjCnt)
ARRAY LONGINT($Bot;$ObjCnt)
ARRAY LONGINT($Right;$ObjCnt)
ARRAY LONGINT($Left;$ObjCnt)

For ($i;1;$ObjCnt)
$TheObject:=$ObjectNames{$i}
OBJECT GET COORDINATES(*;$TheObject;$L;$T;$R;$B)
$Top{$i}:=$T*$ScalePct/100
$Left{$i}:=$L*$ScalePct/100
$Bot{$i}:=$B*$ScalePct/100
$Right{$i}:=$R*$ScalePct/100
OBJECT SET
COORDINATES(*;$TheObject;$Left{$i};$Top{$i};$Right{$i};$Bot{$i})
$FontSize:=OBJECT Get font size(*;$TheObject)
OBJECT SET FONT SIZE(*;$TheObject;$FontSize*$ScalePct/100)
$ObjType:=OBJECT Get type(*;$TheObject)
If ($ObjType=Object type listbox column)

End if
If ($ObjType=Object type listbox)
If ($TheObject="Unit_LB")
ARRAY TEXT($arrColumns;0)
ARRAY TEXT($arrHeaderNames;0)
ARRAY POINTER($arrColVars;0)
ARRAY POINTER($arrHeaderVars;0)
ARRAY BOOLEAN($arrColsVisible;0)
ARRAY POINTER($arrStyles;0)
LISTBOX GET

ARRAYS(*;$TheObject;$arrColumns;$arrHeaderNames;$arrColVars;$arrHeaderVars
;$arrColsVisible;$arrStyles)
For ($thisCol;1;Size of array($arrColumns))
$thisColName:=$arrColumns{$thisCol}
$colSize:=LISTBOX Get column width(*;$thisColName)
LISTBOX SET COLUMN WIDTH(*;$thisColName;$colSize*$ScalePct/100)
End for
$LBRowHt:=LISTBOX Get rows height(*;$TheObject;Listbox pixels)
LISTBOX SET ROWS HEIGHT(*;$TheObject;$LBRowHt*$ScalePct/100;Listbox
pixels)

End if
End if
End for

GET WINDOW RECT($L;$T;$R;$B)
SET WINDOW

RECT($L*$ScalePct/100;$T*$ScalePct/100;$R*$ScalePct/100;$B*$ScalePct/100)

Philippe Ganter (6/6/14 7:32 PM)

Cc: ALP9 <alp9@...

Chris,

<heads up>

With AreaList Pro v10 you'll be able to do this with one line:

AL_SetAreaRealProperty($area;ALP_Area_Zoom;1.5)

And it will be dynamic, not static as opposed to the code below IOW to
reset the view to 100% set the ALP_Area_Zoom property to 1.0 rather
than 0.66666

</heads up>

Best regards,
--
Phil
www.e-node.net

color><param>00000,0000,DDEE/param>II did a quick &igrave;zoom&icirc; feature as
a
proof-of-concept and it is very simple. I just need to improve it to
automatically handle enlarging areaList Pro features ( + row height,
larger font, wider columns, et al.)
It was easy to do for listboxes.

This is a rudimentary method but maybe it will help you guys on your
own road to implementation.

I placed a popup/drop down list at the top of my window. I defined it
as:

array longint(VIEW_SCALE;0). Then using the properties, I simply
entered 100 133 150 in as the &igrave;Default values&icirc;. Essentially, when
the
menu is pressed you get 100, 133, 150 as the options.

The script for this item (on click only) as:

EDIT_SCALE (Self)

This will work ONCE; I did not get fancy enough to re-process the
form. But you can tell that it is easy to just universally &igrave;Scale&icirc;
any
window with it.

Anyway, the project method is simply:

It scales all the objects and the listboxes in the window.

EDIT_SCALE is a project method as follows:

// EDIT_SCALE (->ScaleChooser)
C_POINTER($1) ?// scale chooser object
C_LONGINT($ScalePct)
$ScalePct:=Num($1->{$1->})
ARRAY TEXT($ObjectNames;0)
ARRAY POINTER($Variables;0)

FORM GET OBJECTS($ObjectNames;$Variables)
$ObjCnt:=Size of array($ObjectNames)
ARRAY LONGINT($Top;$ObjCnt)
ARRAY LONGINT($Bot;$ObjCnt)
ARRAY LONGINT($Right;$ObjCnt)
ARRAY LONGINT($Left;$ObjCnt)

For ($i;1;$ObjCnt)
$TheObject:=$ObjectNames{$i}
OBJECT GET COORDINATES(*;$TheObject;$L;$T;$R;$B)
$Top{$i}:=$T*$ScalePct/100
$Left{$i}:=$L*$ScalePct/100
$Bot{$i}:=$B*$ScalePct/100
$Right{$i}:=$R*$ScalePct/100
OBJECT SET
COORDINATES(*;$TheObject;$Left{$i};$Top{$i};$Right{$i};$Bot{$i})
$FontSize:=OBJECT Get font size(*;$TheObject)
OBJECT SET FONT SIZE(*;$TheObject;$FontSize*$ScalePct/100)
$ObjType:=OBJECT Get type(*;$TheObject)
If ($ObjType=Object type listbox column)

End if
If ($ObjType=Object type listbox)
If ($TheObject="Unit_LB")
ARRAY TEXT($arrColumns;0)
ARRAY TEXT($arrHeaderNames;0)
ARRAY POINTER($arrColVars;0)
ARRAY POINTER($arrHeaderVars;0)
ARRAY BOOLEAN($arrColsVisible;0)
ARRAY POINTER($arrStyles;0)
LISTBOX GET

ARRAYS(*;$TheObject;$arrColumns;$arrHeaderNames;$arrColVars;$arrHeaderVars
;$arrColsVisible;$arrStyles)
For ($thisCol;1;Size of array($arrColumns))
$thisColName:=$arrColumns{$thisCol}
$colSize:=LISTBOX Get column width(*;$thisColName)
LISTBOX SET COLUMN WIDTH(*;$thisColName;$colSize*$ScalePct/100)
End for
$LBRowHt:=LISTBOX Get rows height(*;$TheObject;Listbox pixels)
LISTBOX SET ROWS HEIGHT(*;$TheObject;$LBRowHt*$ScalePct/100;Listbox
pixels)

End if
End if
End for

GET WINDOW RECT($L;$T;$R;$B)
SET WINDOW

RECT($L*$ScalePct/100;$T*$ScalePct/100;$R*$ScalePct/100;$B*$ScalePct/100)
/color>

Reply to this message

Summary created 6/6/14 at 7:28PM by Intellex Corporation

Comments welcome at: feedback@intellexcorp.com