Jump to content

Heigh of UniContainerpanel dependet on Textlengh


erich.wanker

Recommended Posts

Hi,

how can i set the heigh of a uniContainerPanel dependet on Textlengh of a uniMemo?

in UniContainerpanel2 - i have a UniImage and a TuniMemo (for Text A)

if the memotext is short - everything is OK

if the memotext is longer - the memo shows a scrollbar .. thats what i have since now..

is it possible to increase the heigh of the uniMemo AND of uniContainerPanel2 automaticaly ??

align.png.8a0fe411ea38c8131bb4179b92964b81.png

 

ThanX for help

Erich

Link to comment
Share on other sites

2 hours ago, erich.wanker said:

how can i set the heigh of a uniContainerPanel dependet on Textlengh of a uniMemo?

in UniContainerpanel2 - i have a UniImage and a TuniMemo (for Text A)

if the memotext is short - everything is OK

if the memotext is longer - the memo shows a scrollbar .. thats what i have since now..

is it possible to increase the heigh of the uniMemo AND of uniContainerPanel2 automaticaly ??

Hello,

What alignment are you using? Server side or client side?

Link to comment
Share on other sites

Please 1 question - if it´s possible:

How can i start the "resize-thing" after add some lines via code?  - if i use the keyboard for input - everything works perfect 🙂

 

if i start following code - the unimemo and the UniContainerPanel1 are not resizing:

unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');
unimemo1.Lines.Add('****');

ThanX for suggestions

Erich

Link to comment
Share on other sites

1 hour ago, erich.wanker said:

Please 1 question - if it´s possible:

How can i start the "resize-thing" after add some lines via code?  - if i use the keyboard for input - everything works perfect 🙂

if i start following code - the unimemo and the UniContainerPanel1 are not resizing:

Hello,

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  UniMemo1.JSInterface.JSAddListener('dirtychange', 'function(){this.autoSize()}');
end;

 

Link to comment
Share on other sites

Hello Sherzod,

thanx for your work  🙂

This solution works for just 1 time .. 

if i add lines (uniButton_add.onClick -> unimemo1.Lines.Add('****');   )  - the memo grows ... 

if i clear the lines (uniButton_clear.onClick  -> unimemo1.Lines.Clear; ) and click uniButton_add AGAIN - the uniMemo didnt grow again 

Thanx

Erich

Link to comment
Share on other sites

1 hour ago, erich.wanker said:

if i add lines (uniButton_add.onClick -> unimemo1.Lines.Add('****');   )  - the memo grows ... 

if i clear the lines (uniButton_clear.onClick  -> unimemo1.Lines.Clear; ) and click uniButton_add AGAIN - the uniMemo didnt grow again 

Okay, let's try this approach:

procedure TMainForm.UniButton2Click(Sender: TObject);
begin
  with UniMemo1 do
  begin
    //Clear;
    JSInterface.JSCall('setValue', []);
  end;

end;

 

  • Like 1
Link to comment
Share on other sites

  • 2 years later...

HI, solution here was probably deleted. Can someone tell me what was the solution for auto resizing memo height?

This is not enough : 

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  UniMemo1.JSInterface.JSAddListener('dirtychange', 'function(){this.autoSize()}');
end;
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...