Page 1 of 1

Web Page - Fit the size of the Multi-line edit box to the text

Posted: Fri Apr 27, 2018 4:20 pm
by Taku Izumi
Hi,

To fit the height and width of the Multi-line edit box to the length of the text, I tried to use the Content unit layout.
But it does not change the size of the Multi-line edit box, I can not get the result I expected.

How should I define a layout for it?

This is my test case.

Code: Select all


Begin_Com Role(*EXTENDS #PRIM_WEB) Layoutmanager(#Layout1) Height(545) Width(897)
Define_Com Class(#PRIM_TBLO) Name(#Layout1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Column1) Displayposition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Column2) Displayposition(2) Parent(#Layout1) Units(Content) Minwidth(300) Width(300)
Define_Com Class(#PRIM_TBLO.Column) Name(#Column4) Displayposition(3) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row1) Displayposition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row2) Displayposition(2) Parent(#Layout1) Units(Content) Minheight(30) Height(30)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row3) Displayposition(3) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Item) Name(#Text1Item1) Manage(#Text1) Parent(#Layout1) Row(#Row2) Sizing(ContentWidthAndHeight) Column(#Column2) Alignment(TopLeft)
Define_Com Class(#PRIM_TEXT) Name(#Text1) Displayposition(1) Left(299) Parent(#COM_OWNER) Tabposition(1) Top(258) Width(300) Height(30)

Evtroutine Handling(#Com_owner.Initialize)
Begin_Loop To(5)
#Text1.Text += 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ' + (10).AsUnicodeString
End_Loop
Endroutine
End_Com

Regards,
Taku

Re: Web Page - Fit the size of the Multi-line edit box to the text

Posted: Sat Apr 28, 2018 2:39 am
by HamadSheikh
There must be multiple ways of doing this. Here is one possible way:

Begin_Com Role(*EXTENDS #PRIM_WEB) Layoutmanager(#Layout1) Height(545) Width(897)
Define_Com Class(#PRIM_TBLO) Name(#Layout1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Column1) Displayposition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Column2) Displayposition(2) Parent(#Layout1) Units(Content) Minwidth(300) Width(300)
Define_Com Class(#PRIM_TBLO.Column) Name(#Column4) Displayposition(3) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row1) Displayposition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row2) Displayposition(2) Parent(#Layout1) Units(Content) Minheight(30) Height(30)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row3) Displayposition(3) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Item) Name(#Text1Item1) Manage(#Text1) Parent(#Layout1) Row(#Row2) Sizing(ContentWidthAndHeight) Column(#Column2) Alignment(TopLeft)
Define_Com Class(#PRIM_TEXT) Name(#Text1) Displayposition(1) Left(299) Parent(#COM_OWNER) Tabposition(1) Top(258) Width(300) Height(30)

Evtroutine Handling(#Com_owner.Initialize)
Begin_Loop To(5)
#Text1.Text += 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ' + (10).AsUnicodeString
#std_num := #Text1.text.CurChars * 1.5
If Cond(#Text1.width < #STD_NUM)
#Text1.Width := #STD_NUM
Endif
#Text1.Height += 15
End_Loop
Endroutine
End_Com

Re: Web Page - Fit the size of the Multi-line edit box to the text

Posted: Tue May 01, 2018 3:02 pm
by Taku Izumi
That was what I expected.

Thanks,
Taku