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
Posts: 259
Joined: Tue Feb 19, 2013 1:18 am

Layout directive in DDS

Post by MegumiSawada » Wed Jun 21, 2017 4:09 am


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

Posts: 289
Joined: Tue Apr 17, 2012 7:21 pm

Re: Layout directive in DDS

Post by tsupartono » Sun Jun 25, 2017 7:18 pm

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