Page 1 of 2
IDE: Split-view on the same file
Posted: Tue Dec 15, 2009 10:45 pm
by Kurzer
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.
Re: IDE: Split-view on the same file
Posted: Tue Dec 15, 2009 10:54 pm
by blueznl
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...)
Re: IDE: Split-view on the same file
Posted: Tue Dec 15, 2009 11:59 pm
by eddy
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...

Re: IDE: Split-view on the same file
Posted: Wed Dec 16, 2009 12:02 am
by Demivec
eddy wrote:Scintilla supports this feature.
but the main thing to update is the code parser. Perhaps it's complex to manage two views.
jaPBe allows a second view in the right hand panel, where lists of variables and other stuff can also be shown.
Re: IDE: Split-view on the same file
Posted: Wed Dec 16, 2009 12:10 am
by eddy
jaPBe allows a second view in the right hand panel, where lists of variables and other stuff can also be shown.
It's Good to know.
Argh! Japbe source code is big and coded in PB~3.94, it will be harsh to read.

Re: IDE: Split-view on the same file
Posted: Wed Dec 16, 2009 9:03 am
by blueznl
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!

Re: IDE: Split-view on the same file
Posted: Wed Dec 16, 2009 10:50 am
by Foz
I do, the IDE in one monitor, and the app in the other monitor, when stepping through, it's h-h-h-heaven!
Re: IDE: Split-view on the same file
Posted: Thu Dec 17, 2009 10:16 pm
by DoubleDutch
blueznl: I think Scintilla can also do the second window stuff too.
Re: IDE: Split-view on the same file
Posted: Thu Dec 03, 2015 11:00 pm
by Kurzer
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.
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!
Re: IDE: Split-view on the same file
Posted: Fri Dec 04, 2015 5:33 am
by Tenaja
+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.
Re: IDE: Split-view on the same file
Posted: Fri Dec 04, 2015 8:27 am
by Dude
Why can't you just open the same source twice? One for editing, one for looking?
Re: IDE: Split-view on the same file
Posted: Fri Dec 04, 2015 10:27 am
by Kurzer
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.
Re: IDE: Split-view on the same file
Posted: Fri Dec 04, 2015 1:26 pm
by Dude
kurzer wrote:The IDE does not allow to open the same source twice.
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.
But I admit that doing it from one source would be nicer, yes.

So:
+1
Re: IDE: Split-view on the same file
Posted: Fri Dec 04, 2015 3:09 pm
by Tenaja
Dude wrote:Why can't you just open the same source twice? One for editing, one for looking?
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.
Re: IDE: Split-view on the same file
Posted: Fri Dec 04, 2015 4:16 pm
by mhs
+1