Splitview or opening the same file twice in the IDE

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 666
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Splitview or opening the same file twice in the IDE

Post by Kurzer »

Like requested in 2015 (http://www.purebasic.fr/english/viewtop ... 15&start=0)

I would prefer a splitview in the PureBasic IDE or at least the ability to open the same file in two IDE tabs.

Scintilla supports multi view of one document. See the following example code.
Run this code and edit the text. It will be changed in both views, because its internally only one document.

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
Image
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!"
User avatar
oreopa
Enthusiast
Enthusiast
Posts: 281
Joined: Sat Jun 24, 2006 3:29 am
Location: Edinburgh, Scotland.

Re: Splitview or opening the same file twice in the IDE

Post by oreopa »

+1 (for the split view... loading two documents is an ugly kludge)

Nice example also.
Proud supporter of PB! * Musician * C64/6502 Freak
User avatar
skywalk
Addict
Addict
Posts: 3996
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Splitview or opening the same file twice in the IDE

Post by skywalk »

Another +100.
I would love to have 2 sections available at the same time.
I miss this from Visual Studio way back.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Splitview or opening the same file twice in the IDE

Post by #NULL »

+1
I often wished i had that too.
Marc56us
Addict
Addict
Posts: 1479
Joined: Sat Feb 08, 2014 3:26 pm

Re: Splitview or opening the same file twice in the IDE

Post by Marc56us »

Hi,

I would like to be able to use both TAB mode and/or MDI mode.

Notepad++ (who use scintilla too) can do it: Right-click on one of the tabs and select "Move to other window" or "Clone to other window".

Then, you can even synch the movement in View > Synchonize vertical (and) horizontal scrolling.

Very useful to work on two versions of the same code

:wink:
Post Reply