Max3073 Posted September 8, 2021 Share Posted September 8, 2021 Hi, I have some panels (TUniContainerPanels) stacked one on the other (Align := alTop). Inside these panels I have a TUnilabel (and some other components). The UniLabel is aligned left and has a fixed width. Of course the label caption may vary and eventually it will be wrapped. Here comes my problem. when the text is wrapped I would like to resize the heigth of the container so that the text can be fully visible. In general i would like to set the height of the parent panel to the exact height of the wrapped text. Is there a way to do it? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 8, 2021 Share Posted September 8, 2021 11 minutes ago, Max3073 said: I have some panels (TUniContainerPanels) stacked one on the other (Align := alTop) Hello, Are you using server-side alignment? Quote Link to comment Share on other sites More sharing options...
Max3073 Posted September 8, 2021 Author Share Posted September 8, 2021 Yes. But switching to client side alignment is also an option if it will solve my problem. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 8, 2021 Share Posted September 8, 2021 1 hour ago, Max3073 said: But switching to client side alignment is also an option if it will solve my problem. Hello, Do you have a simple testcase to check your case!? Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted September 8, 2021 Share Posted September 8, 2021 2 hours ago, Max3073 said: Yes. But switching to client side alignment is also an option if it will solve my problem. Hello, 1. Switch all to client side alignment (form, frame, ...) 2. unicontainer layout Height : auto. you can see : http://forums.unigui.com/index.php?/topic/15007-mobile-centering-text/ Quote Link to comment Share on other sites More sharing options...
Max3073 Posted September 8, 2021 Author Share Posted September 8, 2021 13 hours ago, Sherzod said: Hello, Do you have a simple testcase to check your case!? Yes I'm attaching my simple test project. TestProject.zip Quote Link to comment Share on other sites More sharing options...
Max3073 Posted September 8, 2021 Author Share Posted September 8, 2021 13 hours ago, Abaksoft said: Hello, 1. Switch all to client side alignment (form, frame, ...) 2. unicontainer layout Height : auto. you can see : http://forums.unigui.com/index.php?/topic/15007-mobile-centering-text/ I'm afraid this won't work (at least this is what i think). My final goal is to simulate what you could do in a delphi desktop application with the TVirtualStringTree component: a tree view where each line can contain different components and different editors. I'm a attaching a simple picture since I don't know if my description is understandable. I also need components on a "line" to be vertically centered and the "line" to have the right size to show the content (each line can have different height). As you might see from the test project attached in the other message, I thought that a simple approach would be to create a frame containing components to simulate a single treeview item (or record). But I have no idea how to resize the height (neighter how to center everything vertically). I'm stuck Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 9, 2021 Share Posted September 9, 2021 5 hours ago, Max3073 said: But I have no idea how to resize the height Hello, This post may help you: Quote Link to comment Share on other sites More sharing options...
Max3073 Posted September 9, 2021 Author Share Posted September 9, 2021 10 hours ago, Sherzod said: Hello, This post may help you: Great!!! Thank you! it looks like it's exactly what I'm looking for... But I switched to TUniFrame (instead og TUniContainerPanel) and it's not working when I'm trying to resize the height this is the code I'm using: UniMemo1.ClientEvents.ExtEvents.Values['resize']:= 'function resize(sender, width, height, oldWidth, oldHeight, eOpts) {'+ Name+'.form.setHeight((height+80));'+ '}'; ("Name" is the name of the Frame assigned at runtime after creation) Sorry I have much to learn about UniGui Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.