Jump to content
uniGUI Discussion Forums
NelZ

Forms TDI - Tabs

Recommended Posts

This simple example show how to create a application that use a TUniPageControl to show forms inside TabSheet.

Based on examples, MegaDemo and Marlon code.

Thank you.

 

Version UniGui: 0.95.0.1046

Delphi: XE5

FormsTDI_Tabs.zip

  • Upvote 5

Share this post


Link to post
Share on other sites
good +1.
 
but, why create new panel ?
 
 
  //if not found, then create it...
  TabSheetNew              := TUniTabSheet.Create(NavPage);
  TabSheetNew.PageControl  := NavPage;
  TabSheetNew.Caption      := Titulo;
  TabSheetNew.Name         := Name;
  TabSheetNew.Closable     := True;
  TabSheetNew.OnClose      := CheckTab;
 
//  PanelTabSheetNew := TUniPanel.Create(TabSheetNew);
//  PanelTabSheetNew.Align := alClient;
//  PanelTabSheetNew.Parent := TabSheetNew;
 
//  FCurrentFrameTab := TUniFrameClass(FindClass(Name)).Create(Self);
//  FCurrentFrameTab.Parent := PanelTabSheetNew;
//  FCurrentFrameTab.Align := alClient;
 
  FCurrentFrameTab := TUniFrameClass(FindClass(Name)).Create(Self);
  FCurrentFrameTab.Parent := TabSheetNew;
  FCurrentFrameTab.Align := alClient;

 

Share this post


Link to post
Share on other sites

This panel is usefull case you need add a accordion panel left side, or reorganize frame and form, example, hide/show all frame. You wont need to put all frame components in other place.. was just thinking in future.. just this.

Share this post


Link to post
Share on other sites
I tried to use his example, but did not work when using a legacy tuniframe
 
-> TfrmBase = class (TUniFrame)
 
TfrmEscola = class (TfrmBase) - here and an inherited form of TFrmBase
 
 
InsertFrameTab ('TfrmEscola', 'school');
 
the access violation error that line
   FCurrentFrameTab: = TUniFrameClass (FindClass (Name)) Create (Self);.
 
 
 
initialization
   RegisterClasses ([
                    TfrmBase,
                    TfrmEscola
                   ]);
   RegisterAppFormClass (TFrmPrincipal);
 
-------------------------------------------------------------------------------------
 
in forms of TUniFrame type usually works

 

Share this post


Link to post
Share on other sites

×