Layout directive in DDS

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
MegumiSawada
Posts: 260
Joined: Tue Feb 19, 2013 5:18 pm

Layout directive in DDS

Post by MegumiSawada » Wed Jun 21, 2017 7:09 pm

Hi,

The customer specifies 10% for a height of row as Layout directive in DDS and put a LABEL on it ,as follows:

Code: Select all

     A                                 16  1'&&10%'
    A                                  16 10HTML('<<END>>
     A                                        Type: Label
     A                                        Text: "END"
     A                                        Color:     White
     A                                        Backcolor: &3366CC
     A                                        TextAlign: Center
     A                                        VAlign:    Middle
     A                                        OnClick:   ENDCLICK
     A                                        Border.CornerRadius: 6
     A                                      ')
The customer specifies in this way in all the screens they developes to keep the label button size the same.
However, the height of this label varies slightly between the screens.

How does LongRange calculate this height?
Isn't it based on the screen height?

Best Regards,
Megumi Sawada

tsupartono
Posts: 289
Joined: Wed Apr 18, 2012 10:21 am

Re: Layout directive in DDS

Post by tsupartono » Mon Jun 26, 2017 10:18 am

Hi,
Percentage unit is calculated based on the size of the form (not the screen).
It's not a good idea to use percentage unit to achive your desired goal (to keep label button size the same across all screens).
Can you consider if you really need to specify the element's size at all?
Consider if you can use font size, padding to control the size of the button.
The general rule is that it's best to avoid specifying any size at all and let LongRange size your elements for you (instead use other attributes such as font size, padding to control the behaviour)

Post Reply