Jump to content

TUniFrame does not expand to the TUniTabSheet client area


MarcoZC

Recommended Posts

Good Morning. I'm having a problem that I do not understand why it happens. I'm making a WEB application with a structure almost identical to the UniGUI demo, the main screen has a menu on the left and a UnipageControl on the rest of the screen. According to the selected menu option, a UniTabSheet is created and the TUniFrameClass is created and assigned to the previously created UniTabSheet. In all cases when the Tabsheet shows the application run, the TabSheet occupies the entire client area of the PageControl but the Frame does not allow it to expand to the entire client area. The effect I want to achieve is the same as shown in FormControlsFieldSet in the UniGUI demo. As I did not get it, I copied the .pas and the .dfm of FormControlsFieldSet from the demo and added it to my project by assigning it a menu option. What is my surprise that it is exactly the same as the rest of the frames in my application, that is, it only occupies part of the tabsheet area and unlike the demo, it has lost the capacity to resize the controls shown there.
What I can be doing wrong?

Link to comment
Share on other sites

Hello again. The first thing is to thank you for your response. Yesterday I was not in the office and I could not prove your solution. Today I'm at work and I do not quite understand which component you assign the property alignment = fit to. In the UniTabSheet that property exists but I can not find the way to apply 'fit' because that property inherits it from uniPanel and only accepts taLeftJustify, taRightJustify, taCenter. The TabSheet is created dynamically just like in the UniGUI demo. Forgive my ignorance but I am starting to use UniGUI and I am quite lost.
Thanks again.

Link to comment
Share on other sites

Hello,

this is the code I use to create tabsheets on the fly and align a unicontainerpanel al client.

This is all done using client side alignment. The layout of the panel is border in my case.

This is how I create a contacts tab:

procedure TJournalFrm.Show_contacts(Module_id: integer; Master_datasource: TDataSource);
var ContactsFrame: TUniFrame;
    ContactsTabSheet: TUniTabSheet;
begin
  ContactsTabSheet := TUniTabSheet.Create(Self);
  ContactsTabSheet.PageControl := PageControlJournal;
  ContactsTabSheet.AlignmentControl := uniAlignmentClient;
  ContactsTabSheet.Layout  := 'fit';
  ContactsTabSheet.Caption := str_relations;
  ContactsTabSheet.ImageIndex := 18;
  ContactsFrame := TContactsPanelFrm.Create(Self);
  With (ContactsFrame as TContactsPanelFrm)
  do begin
       Start_contacts(Module_id, Master_datasource);
       Parent := ContactsTabSheet;
     end;
end;

This is the result (bottom part).

Screenshot.thumb.PNG.499bb8d095726c1cda89a2caf7e68a72.PNG

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...