It is currently Mon May 25, 2020 9:25 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Splitview or opening the same file twice in the IDE
PostPosted: Sun Jan 28, 2018 12:43 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 11, 2006 12:07 am
Posts: 558
Location: Near Hamburg | Massive deflectable. Does anyone have any experience with microdosing of psylocybine?
Like requested in 2015 (viewtopic.php?f=3&t=40315&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:
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 5.71 x64, OS: Windows 7 Pro x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age: 52y
"Happiness is a pet." | "Never run a changing system!"


Top
 Profile  
Reply with quote  
 Post subject: Re: Splitview or opening the same file twice in the IDE
PostPosted: Sun Jan 28, 2018 1:38 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jun 24, 2006 3:29 am
Posts: 229
Location: Edinburgh, Scotland.
+1 (for the split view... loading two documents is an ugly kludge)

Nice example also.

_________________
Proud supporter of PB! * Musician * C64/6502 Freak


Top
 Profile  
Reply with quote  
 Post subject: Re: Splitview or opening the same file twice in the IDE
PostPosted: Sun Jan 28, 2018 2:21 am 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 3266
Location: Boston, MA
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Splitview or opening the same file twice in the IDE
PostPosted: Sun Jan 28, 2018 11:05 am 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 1238
Location: right here
+1
I often wished i had that too.


Top
 Profile  
Reply with quote  
 Post subject: Re: Splitview or opening the same file twice in the IDE
PostPosted: Sun Jan 28, 2018 11:27 am 
Offline
Addict
Addict

Joined: Sat Feb 08, 2014 3:26 pm
Posts: 839
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:

_________________
mdacme.com


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye