IDE: Split-view on the same file
IDE: Split-view on the same file
My wish for the next version of PB is a split-view like in Excel or Open Office calc.
Sometimes I have to jump from top to bottom of the same source, only to check how I have solved a similar problem in another procedure.
Actually I write a network application and I often jump from the send routine to the receive routine. A multiple split-view would be a very big assistance.
Sometimes I have to jump from top to bottom of the same source, only to check how I have solved a similar problem in another procedure.
Actually I write a network application and I often jump from the send routine to the receive routine. A multiple split-view would be a very big assistance.
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
Re: IDE: Split-view on the same file
That's what I have CodeCaddy for
But yes, that may be useful... (Don't ignore the power of F2 / Ctrl+L but you probably already know...)
But yes, that may be useful... (Don't ignore the power of F2 / Ctrl+L but you probably already know...)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
Re: IDE: Split-view on the same file
It's a cool feature supported by Scintilla.
but the main thing to update is the code parser. Perhaps it's complex to manage two views.
:roll: I haven't found some tutorials about this problem yet.
Here is an example. I modified the demo from Srod...
but the main thing to update is the code parser. Perhaps it's complex to manage two views.
:roll: I haven't found some tutorials about this problem yet.
Here is an example. I modified the demo from Srod...
Last edited by eddy on Wed Dec 16, 2009 12:06 am, edited 1 time in total.
win10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
Re: IDE: Split-view on the same file
jaPBe allows a second view in the right hand panel, where lists of variables and other stuff can also be shown.eddy wrote:Scintilla supports this feature.
but the main thing to update is the code parser. Perhaps it's complex to manage two views.
Re: IDE: Split-view on the same file
It's Good to know.jaPBe allows a second view in the right hand panel, where lists of variables and other stuff can also be shown.
Argh! Japbe source code is big and coded in PB~3.94, it will be harsh to read.
win10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
Re: IDE: Split-view on the same file
A dual view is nice, but to increase productivity, it should provide some things like a good search function, you don't want to scroll around looking for some code.
Also, dual screen users might appreciate a second window as opposed to a second view. A second window could then be placed opn the second monitor. If you have the screen real estate, then use it!
Also, dual screen users might appreciate a second window as opposed to a second view. A second window could then be placed opn the second monitor. If you have the screen real estate, then use it!
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
Re: IDE: Split-view on the same file
I do, the IDE in one monitor, and the app in the other monitor, when stepping through, it's h-h-h-heaven!
- DoubleDutch
- Addict
- Posts: 3219
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Re: IDE: Split-view on the same file
blueznl: I think Scintilla can also do the second window stuff too.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
Re: IDE: Split-view on the same file
I want to re-activate my feature request, because it is IMHO a really helpful feature with a minimum of codechanges (I guess).
Scintilla is able to handle one document in multiple Editorgadgets. Scintilla handles text and the Gadget, which displays the text, separately. One can connect one Document instance to any number of scintilla gadgets. I tried to "hack" the IDE to connect the current document (sourcecode) to a own Scintilla Gadget, but unfortunately it is not possible due to memory accessvialoation. I can read the documentpointer, but the IDE and my program are separate processes, so it is not allowed for my Scintilla gadget to handle the document of the IDE.
So this will only work if you (Freak or Fred) open a second view (Scintialla Gadget) in the IDE panel and connect the current document (sourcecode) to this second view in the same process.
I have no idea if this second view interferes with existing functions of the PB-IDE, or whether there is to write additional code, but in principle it looks very very simple.
- Open second view
- Get the documentpointer of the current sourcecode
- Connect the document to the second view
For more informations see this section in the Scintilla docs please: http://www.scintilla.org/ScintillaDoc.h ... tipleViews
Here is a very simple example how it works (I exdented the Scintilla example):
Compile this code and enter some new text in one of the two Scintilla Gadgets. You will see that both Gadgets are handling the same document instance in realtime.
Because this feature has not been implemented for many years I would pay for it!
Scintilla is able to handle one document in multiple Editorgadgets. Scintilla handles text and the Gadget, which displays the text, separately. One can connect one Document instance to any number of scintilla gadgets. I tried to "hack" the IDE to connect the current document (sourcecode) to a own Scintilla Gadget, but unfortunately it is not possible due to memory accessvialoation. I can read the documentpointer, but the IDE and my program are separate processes, so it is not allowed for my Scintilla gadget to handle the document of the IDE.
So this will only work if you (Freak or Fred) open a second view (Scintialla Gadget) in the IDE panel and connect the current document (sourcecode) to this second view in the same process.
I have no idea if this second view interferes with existing functions of the PB-IDE, or whether there is to write additional code, but in principle it looks very very simple.
- Open second view
- Get the documentpointer of the current sourcecode
- Connect the document to the second view
For more informations see this section in the Scintilla docs please: http://www.scintilla.org/ScintillaDoc.h ... tipleViews
Here is a very simple example how it works (I exdented the Scintilla example):
Compile this code and enter some new text in one of the two Scintilla Gadgets. You will see that both Gadgets are handling the same document instance in realtime.
Code: Select all
EnableExplicit
Procedure MakeScintillaText(text.s)
Static sciText.s
CompilerIf #PB_Compiler_Unicode
sciText = Space(StringByteLength(text, #PB_UTF8))
PokeS(@sciText, text, -1, #PB_UTF8)
CompilerElse
sciText = text
CompilerEndIf
ProcedureReturn @sciText
EndProcedure
If OpenWindow(0, 0, 0, 320, 180, "ScintillaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If InitScintilla()
ScintillaGadget(0, 10, 10, 300, 70, 0)
ScintillaGadget(1, 10, 100, 300, 70, 0)
; Ausgabe auf rote Farbe setzen
ScintillaSendMessage(0, #SCI_STYLESETFORE, 0, RGB(255, 0, 0))
; Anfänglichen Text des ScintillaGadgets festlegen
ScintillaSendMessage(0, #SCI_SETTEXT, 0, MakeScintillaText("Please type in some text in the top Scintilla Gadget"))
; Hinzufügen einer zweiten Zeile mit einem vorherigen Zeilenumbruch
Define Text$
Define *DocPointer
ScintillaSendMessage(0, #SCI_APPENDTEXT, Len(Text$), MakeScintillaText(Text$))
*DocPointer = ScintillaSendMessage(0, #SCI_GETDOCPOINTER, 0, 0)
Debug *DocPointer
ScintillaSendMessage(1, #SCI_SETDOCPOINTER, 0, *DocPointer)
EndIf
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Because this feature has not been implemented for many years I would pay for it!
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
Re: IDE: Split-view on the same file
+1
An uncomplicated way to do this (speaking from experience) is to add the secondary window to a tab in the Tools panel. Putting it there would allow any window to be duplicated, be it the one with focus or not.
An uncomplicated way to do this (speaking from experience) is to add the secondary window to a tab in the Tools panel. Putting it there would allow any window to be duplicated, be it the one with focus or not.
Re: IDE: Split-view on the same file
Why can't you just open the same source twice? One for editing, one for looking?
Re: IDE: Split-view on the same file
For several reasons:
- The IDE does not allow to open the same source twice. If you try to load an already opened fiel thi IDE will bring the existing TAB in foreground instead of loading the file into a new TAB.
- If the problem above does not exists and I have a second TAB with my code, I have to switch every time between the TABs to have a look.
- I could load the source into an external editor and place this editor on top if the PB IDE (maybe in sticky mode). But then I have no syntax highlightning, the external editor covers a part of the IDE, I cannot edit the code in the extern editor because its not always the current version of the code - so if I want to edit the line which is shown in the external editor I have to switch to the PB IDE and have to scroll at this position and then I am able to edit the source at this line. It is not much flexible like in a split view solution with only one source instance.
Of cource, I have survived the last 6 years without this feature, but in my opinion it is a valuable feature and I guess the work to implement it is not to difficult. But this can judge only Freak or Fred.
- The IDE does not allow to open the same source twice. If you try to load an already opened fiel thi IDE will bring the existing TAB in foreground instead of loading the file into a new TAB.
- If the problem above does not exists and I have a second TAB with my code, I have to switch every time between the TABs to have a look.
- I could load the source into an external editor and place this editor on top if the PB IDE (maybe in sticky mode). But then I have no syntax highlightning, the external editor covers a part of the IDE, I cannot edit the code in the extern editor because its not always the current version of the code - so if I want to edit the line which is shown in the external editor I have to switch to the PB IDE and have to scroll at this position and then I am able to edit the source at this line. It is not much flexible like in a split view solution with only one source instance.
Of cource, I have survived the last 6 years without this feature, but in my opinion it is a valuable feature and I guess the work to implement it is not to difficult. But this can judge only Freak or Fred.
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
Re: IDE: Split-view on the same file
I meant in two different IDE instances. I do this all the time, so I can refer to the same source with full syntax highlighting.kurzer wrote:The IDE does not allow to open the same source twice.
But I admit that doing it from one source would be nicer, yes. So: +1
Re: IDE: Split-view on the same file
One of the "problems" with doing it this way is the line numbers do not match up. If you are working on data, asm, or repetitive code, it is critical that the line numbers match between windows.Dude wrote:Why can't you just open the same source twice? One for editing, one for looking?