Tabbed document interface lazarus / 7-LCL ---------------------------------------------------------------------- TurboRascal · 2010-05-17 16:28 I've seen this topic has been addressed by several people before, but not to resurrect very old threads, I'll start a new one. It would be nice to have a MDI-like tabbed interface controls, interface that all modern browsers and editors have. As far as I'm concerned, I wouldn't even care to see "real" MDI at all, and I guess most people too would benefit more from the tabbed document interface then the windowed MDI. IMHO, having the subwindows is a real benefit only in graphics programs. So I guess it might be wise to incorporate a tabbed document interface into the LCL, and that even isn't so hard to accomplish, at least compared to MDI... ---------------------------------------------------------------------- Troodon · 2010-05-17 16:38 Like a TNotebook? ---------------------------------------------------------------------- Silvio Clécio · 2010-05-17 17:00 Nice TDI: http://www.silvioprog.com.br/downloads/PageForm.zip ---------------------------------------------------------------------- iPasha · 2010-05-18 04:25 Nice sample Thanks ---------------------------------------------------------------------- theo · 2010-05-18 04:39 Could somebody explain the difference of a TDI to a TPageControl? ---------------------------------------------------------------------- TurboRascal · 2010-05-18 09:25 @both Troodon and Theo: TDI is not just a tabbed component like the two you mentioned, it is a multi-document paradigm, similar to MDI. Probably the most popular example of TDI are most modern web browsers, where you get an interface containing several different documents, each shown within the same window and selected using tabs. Modern text editors have it too. Moreover, similar to MDI, those documents are dynamic, i.e. you create and destroy them during the program's execution. Also, each created tab can already contain controls to show or edit content, whatever the purpose of the program is. The main difference between MDI ant TDI is that TDI content uses all the main window space, while in MDI can be contained in windows within the main window, and can be similarly viewed. From what I can see, TDI has become very popular, while MDI use is dropping, remaining only in the programs that benefit from that. I believe most programs don't need MDI, but TDI instead. Having a possibility to create TDI programs similar to the option for creating MDI in Delphi would be great. If TDI becomes part of Lazarus, I for sure won't hold my breath waiting for MDI... @silvioprog: thanks for the effort! ---------------------------------------------------------------------- theo · 2010-05-18 09:49 Quote from: Turbo Rascal on May 18, 2010, 11:25:07 amHaving a possibility to create TDI programs similar to the option for creating MDI in Delphi would be great. It's still not clear to me what that should be in addition to what TPageControl/TNotebook already do? Can you explain? ---------------------------------------------------------------------- Silvio Clécio · 2010-05-18 10:45 More samples with TDI (the application not is my), but with Delphi+Jedi (I think): http://imagebin.org/97333 http://imagebin.org/97334 http://imagebin.org/97335 ---------------------------------------------------------------------- theo · 2010-05-18 10:58 Quote from: silvioprog on May 18, 2010, 12:45:12 pmMore samples with TDI (the application not is my), but with Delphi+Jedi (I think): Yes, it's great. But I still can't see the difference to what I can do with TPageControl in two minutes: ---------------------------------------------------------------------- TurboRascal · 2010-05-18 11:16 Quote from: theo on May 18, 2010, 12:58:39 pmYes, it's great. But I still can't see the difference to what I can do with TPageControl in two minutes: Well... yes, exactly that. Congratulations, you just made a TDI However, for some more complex stuff it would be useful to have some support for it already in Lazarus, similar to MDI support in other IDEs... ---------------------------------------------------------------------- Silvio Clécio · 2010-05-18 11:35 theo, I also do, even with TPanel . But the guys need it native in IDE, with a component. (TLazTDI? ) ---------------------------------------------------------------------- theo · 2010-05-18 11:56 Can you please define more precisely what you would like to see? How is TPageControl not integrated in the IDE? Just right click on the control at design-time and add a page. Place whatever you want on this page. Can you explain what more is desirable? ---------------------------------------------------------------------- Silvio Clécio · 2010-05-18 12:07 Turbo Rascal, the application (with Jedi, I think) is not mine, it's of a guy here in Brazil. I think in to do a nice themed interface(cross), something like this: (buy) http://www.devexpress.com/Products/VCL/ExLayoutControl/ (open source) http://blog.silvioprog.com.br/search/label/Skins I invited some guys in Brazil to help me to create one from scratch, but only one guy was interested, and a component with this size, need at least a 4 guys working. ---------------------------------------------------------------------- Troodon · 2010-05-18 12:24 about.com has the following description for TDI: TDI application, similar to MDI, displays child windows under a single parent window. Unlike the floating child windows of MDI, in TDI each child is displayed in its own tab... Browsers like IE8, Chrome or Firefox use tabbed user interface. I am looking at FF right now and frankly, what is about it that one cannot do with an autoresizing TNotebook, as the one shown in the attachment? The only distinction is semantic: "child window in a tab". ---------------------------------------------------------------------- TurboRascal · 2010-05-18 14:32 Quote from: Troodon on May 18, 2010, 02:24:40 pm... The only distinction is semantic: "child window in a tab". Of course, and that distinction is actually the topic here. Just as in MDI components... ---------------------------------------------------------------------- theo · 2010-05-18 15:02 Followup set to alt.sci.philosophy ---------------------------------------------------------------------- LazaruX · 2010-05-18 15:38 well, I have always used the TPageControl as Theo does, acutally I though that TDI was just a concept of using TPageControls, but as I see I was wrong ---------------------------------------------------------------------- theo · 2010-05-18 15:45 Quote from: BPsoftware on May 18, 2010, 05:38:17 pmwell, I have always used the TPageControl as Theo does, acutally I though that TDI was just a concept of using TPageControls, but as I see I was wrong Can you explain what's wrong with that? I don't get it. ---------------------------------------------------------------------- Silvio Clécio · 2010-05-18 16:24 theo, no mystery guy: Lazarus/FlameRobin/pgAdmin = SDI; Firefox/Chrome = "PageCtrl", but, TDI too; NetBeans/Delphi-2010 = TDI; PhotoShop/M$Word-2003=MDI ---------------------------------------------------------------------- theo · 2010-05-18 16:42 Quote from: silvioprog on May 18, 2010, 06:24:58 pmtheo, no mystery guy: Lazarus/FlameRobin/pgAdmin = SDI; Firefox/Chrome = "PageCtrl", but, TDI too; NetBeans/Delphi-2010 = TDI; PhotoShop/M$Word-2003=MDI Thanks. I know what SDI is, I know what MDI is but could you please please explain in simple words what the difference between Firefox and NetBeans (PageControl/TDI) is in this regard? Thank you! ---------------------------------------------------------------------- stonefull · 2010-05-18 17:09 An MDI application opens each document in a child window, such as MSWORD. TDI opens each document in a tab, such as Firefox, IE, etc. ---------------------------------------------------------------------- garlar27 · 2010-05-19 17:11 Well, IMO this topic is going in circles like a dog trying to bite his own tail... I think that what TurboRascal, Silvio, my self, and many more need is a transparent way to handle those tabs like they where forms (creating new ones, remove the ones that are no needed) ... nowadays you have to code the creation and destruction of all components you will use on each tab (even using frames you will have to create the new tab, create frame, set the parent property... the same if you need to destroy a tab ). ---------------------------------------------------------------------- Troodon · 2010-05-19 18:24 You can add all the components you need on a tab at design time and hide/show the tab ("page") at run time, just like you would do with a non-main form. ---------------------------------------------------------------------- Silvio Clécio · 2010-05-20 11:31 Sorry for my delay in responding. theo, see this: http://imagebin.org/97673 This is a complete TDI. You may say that does this with just PageContrl, but will give you much work. Hm... If it were my choice, the Lazarus IDE would be this way, similar to NetBeans IDE. ---------------------------------------------------------------------- theo · 2010-05-20 12:57 Quote from: silvioprog on May 20, 2010, 01:31:22 pmThis is a complete TDI. You may say that does this with just PageContrl, but will give you much work. Yes. But what would give you less work? This is my point from the beginning of this thread. See: http://forum.lazarus.freepascal.org/index.php/topic,9448.msg46352 .html#msg46352 What would you improve? What's wrong with TPageControl. I only understand: "we would like something better". But what? ---------------------------------------------------------------------- Silvio Clécio · 2010-05-20 13:33 Sorry, I do not know 100% of what I speak because I am using a translator. But I think that last I was clear in last post. If you think it easy to create an interface such as NetBeans only with PageControl, I do not think. For me it would be easy if there was a visual component set. And I think most do not think it easy to create as many features using only PageControl. ---------------------------------------------------------------------- Troodon · 2010-05-20 15:32 alt.sci.philosophy it is.... ---------------------------------------------------------------------- TurboRascal · 2010-05-21 15:50 Quote from: garlar27 on May 19, 2010, 07:11:25 pmI think that what TurboRascal, Silvio, my self, and many more need is a transparent way to handle those tabs like they where forms (creating new ones, remove the ones that are no needed) ... nowadays you have to code the creation and destruction of all components you will use on each tab (even using frames you will have to create the new tab, create frame, set the parent property... the same if you need to destroy a tab ). I'd say your post most accurately describes what we are looking for! Quote from: Troodon on May 19, 2010, 08:24:11 pmYou can add all the components you need on a tab at design time and hide/show the tab ("page") at run time, just like you would do with a non-main form. Yes, but there is much labor involved, especially when you dynamically create and destroy those tabs, and even more if they themselves are complex... We do need components that make it as easy as creating MDI windows in other environments. ---------------------------------------------------------------------- garlar27 · 2010-06-09 05:49 And Docking capability would be a blessing!! ---------------------------------------------------------------------- davesimplewear · 2010-06-09 18:36 TurboRascal, as Theo says you can create a tab dynamically using aTPageControl which would have the same effect as a TDI, I will include some psuedo code to demonstrate: Code: [Select]procedure TfMain.newEditMemo(aName: string); begin  Screen.Cursor := crHourGlass;    try    //create tabsheet to hold the memo , assign to the page control    newTabsheet := TTabSheet.Create(pcEditor);    newTabsheet.Parent := pcEditor;//PageControl    newTabsheet.Caption := aName;    //newTabsheet.Hint := Name;    fMain.ParentShowHint := False;    fMain.ShowHint := False;    fMain.Caption := MainCaption + newTabsheet.Caption;    newTabsheet.ImageIndex := 0;    newTabsheet.ShowHint := False;    newTabsheet.ParentShowHint := False;    newTabsheet.PageControl := pcEditor;    pcEditor.ActivePage := newTabsheet;    pcEditor.ParentShowHint := False;    // create Memo and align, set Properties    newMemo := TSynMemo.Create(newTabsheet);    newMemo.Parent := newTabsheet;    newMemo.Align := alClient;    newMemo.WantTabs := True;    newMemo.HideSelection := True;    newMemo.OnChange := @newMemoChange;    newMemo.OnDragDrop := @NewMemoDragDrop;    newMemo.OnDragOver := @NewMemoDragOver;    newMemo.ParentShowHint := False;    newMemo.ShowHint := False;    newMemo.PopupMenu := puEditor;    newMemo.Modified := False;    finally    Screen.Cursor := crDefault;    end; end; ---------------------------------------------------------------------- garlar27 · 2010-06-10 04:08 @davesimplewear: We did that allready!!! It's not enough. Sorry. ---------------------------------------------------------------------- krexon · 2010-06-14 23:52 Look at IceTabSet for Delphi (Google Chrome style tabs): http://sourceforge.net/projects/icetabset/ Features:     - Show icon in tab items     - Gradient color tab and component background     - Close icon in tab     - Rounded tab edges     - Scrollable, if have more item     - TabItems has a Modified property Required Delphi GDI+ API (http://www.progdigy.com/files/gdiplus.zip) Screenshots: http://sourceforge.net/project/screenshots.php?group_id=328834 ---------------------------------------------------------------------- Ñuño_Martínez · 2010-06-15 03:04 I'm late but, what about frames (TFrame)? You can add them easily to the TPageControl, can't you? As for the features of the IceTabSet for Delphi, I think most them are cosmetic and they depend the widget you're using (GTK+, Qt, GDI, etc.) and the functional ones can be handled by the TFrame events (except the "Show icon in tab items).