How have the same unit in two tabs? lazarus / 9-Editor ---------------------------------------------------------------------- Arthurus · 2015-09-12 21:49 hola, ¿como tener la misma unit en dos pestañas en el ide? gracias. ------------ translated by google: Hello, How have the same unit in two tabs in the IDE? ---------------------------------------------------------------------- Martin_fr · 2015-09-12 21:59 By having 2 windows. - right click on TAB => popup-menu - choose "clone to new window" ---------------------------------------------------------------------- Arthurus · 2015-09-12 22:04 no, I do not want two windows. I want two tabs. thanks. ---------------------------------------------------------------------- Martin_fr · 2015-09-12 22:56 Not possible. The same unit, can only be in one tab, in each window. But you can use AnchorDocking (install package), and combine windows http://wiki.lazarus.freepascal.org/New_IDE_features_since#Docked_IDE If you open same unit twice, then edit in one tab, other tab will always change too. How would you want to use 1 unit in 2 tabs? You can always only see one tab at a time. ---------------------------------------------------------------------- Jurassic Pork · 2015-09-12 23:13 hello Arthurus, may be you can use TFrame in your tabs to do this ? QuoteFrames are named containers for components and very similar to forms. Their unique ability is that they can be embedded into forms or other frames in the designer. As forms they are stored in two files: the code is stored in .pas file and the design in the .lfm file. They are needed when you have a group of components that you want to reuse on multiple forms. The group should have the same set of controls and logic between them at different windows (forms) of your application. You can group that repeated controls and logic into one frame and use that frame in different places. Therefore you don't need to repeat the work of control layouting and writing their logic. ---------------------------------------------------------------------- Arthurus · 2015-09-12 23:51 @ Jurassic Pork: the tabs is in IDE, no in program. @ Martin_fr: Resulta que tengo un proyecto que tiene 2 unit1 en 2 pestañas. A mí me va muy bien y me es muy cómodo para comparar trozos de código de un sitio a otro. El problema de tener 2 ventanas es que trabajas con una y luego no sabes dónde está la otra ventana. Para mí es más cómodo las 2 pestañas. Y el problema es que no sé cómo he conseguido poner las 2 pestañas de la misma unit en el mismo proyecto. Por eso lo pregunto, a ver si alguien lo sabe. (Perdón por no escribir en inglés). ---------------------------------------------------------------------- Martin_fr · 2015-09-13 00:16 "que tiene 2 unit1" "That has 2 unit1." If that is   c:\path\to\some\unit1.pas and   c:\path\to\OTHER\unit1.pas then you can open them both. They will both be called unit1. But they are different files. If you compile a project like that, there can be big problems. But you can open it. You can open c:\path\to\CURRENT_PROJECT\unit1.pas c:\path\to\OTHER_PROJECT\unit1.pas  // will not be part of compile. Look at the status-bar to see the full path. ---------- Also there is a bug in the IDE, if the project file becomes corrupt the IDE may open the same file in 2 tabs in one window. But that can not be done intentional. (I have seen it happen, but I was never able to force it happen) ---------- With anchordocking, you can have both windows docked into tabs. (so total you have one window) So you would have 2 tabs:   tab-window-1  | tab-window-2 and if you select one of the 2 tab, you have a 2nd row of tabs with all the units. ---------- If you don't like anchordocking: I have NOT tested, but this should give you what you want. edit ide/SourceEditor.pp find Code: [Select]procedure TSourceNotebook.NotebookDragOverEx(Sender, Source: TObject;   OldIndex, NewIndex: Integer; CopyDrag: Boolean; var Accept: Boolean); in that procedure line 8040 Code: [Select]  if CopyDrag then     Accept := (NewIndex >= 0) and (Source <> Sender) and (not NBHasSharedEditor) change it to Code: [Select]  if CopyDrag then     Accept := (NewIndex >= 0) Recompile the IDE. Then drag (hold with left button of mouse and move) the tab while holding CTRL key ---------------------------------------------------------------------- Arthurus · 2015-09-13 00:37 Hola de nuevo, Es el mismo archivo. La ruta es la misma en ambos casos y el programa funciona perfectamente. ¿Un error en el IDE?.... pues es posible, pero no recuerdo ninguno grave. No obstante este es un proyecto que llevo desarrollandolo desde hace unos 10 años y empecé con Delphi3. Si hubo alguna vez un error grave, siempre tengo copias de seguridad. En fin, un misterio. ---------------------------------------------------------------------- Martin_fr · 2015-09-13 00:52 1) It be nice, if you do the google translate. Because now I have extra work.... 2) I wrote that code. It is not allowed. See the edit instructions in my lsat post. 3) - Close IDE - Find your projects lpi or lps file It contains Code: [Select]                                                                                    Important: IsPartOfProject Value="True" Digits/numbers can be different CHange/add Code: [Select]                                                                                                                                use number+1           Use same number, as already in xml           Now open the project ---------------------------------------------------------------------- Arthurus · 2015-09-13 07:58 OK. And thank you, that's it with your code. It could possibly be an error to pass a version of Lazarus to another. Something like that had 2 windows and pass another version of Lazarus became two tabs. (It is a supposition). (I'm sorry. I always write in English from today). Mystery solved. a greeting.