Page 1 of 3
Alternate for Richedit
Posted: Sun May 04, 2003 2:08 pm
by GPI
This one could be intressting:
http://www.scintilla.org/
I don't have now a deeper look, but there is talking about folding and many more stuff.
Code: Select all
o Text retrieval and modification
o Searching and replacing
o Overtype
o Cut, copy and paste
o Error handling
o Undo and Redo
o Selection and information
o Scrolling and automatic scrolling
o White space
o Cursor
o Mouse capture
o Line endings
o Styling
o Style definition
o Caret, selection, and hotspot styles
o Margins
o Other settings
o Brace highlighting
o Tabs and Indentation Guides
o Markers
o Indicators
o Autocompletion
o User lists
o Call tips
o Keyboard commands
o Key bindings
o Popup edit menu
o Macro recording
o Printing
o Direct access
o Multiple views
o Folding
o Line wrapping
o Zooming
o Long lines
o Lexer
o Notifications
o Deprecated messages
o Edit messages never supported by Scintilla
o Building Scintilla
and the best one: For windows and linux. So it could be chance to make one editor for both versions.
Take a look
GPI
As easy as...
Posted: Fri May 09, 2003 11:09 pm
by fsw
Code: Select all
; test of using the Schintilla library for an editor
; all Scintilla commands can be used by Sendmessage_(bla,bla...
; or directly with pointers to the Scintilla commands...
Procedure SciEditGadget(hwndParent,x,y,w,h)
hmod = OpenLibrary(1, "SciLexer.dll")
If (hmod) = 0
MessageRequester( "Error loading Scintilla", "The Scintilla DLL could not be loaded.", #MB_OK | #MB_ICONERROR)
Else
hInstance = GetModuleHandle_(0)
hwndScintilla = CreateWindowEx_(0, "Scintilla"," ", #WS_CHILD|#WS_VISIBLE|#WS_TABSTOP,x,y,w,h,hwndParent,0,hInstance,0)
EndIf
ProcedureReturn hwndScintilla
EndProcedure
If OpenWindow(0, 100, 100, 320,240, #PB_Window_SystemMenu ,"PureBasic Test Window")
;create Edit Gadget
SciEditGadget(WindowID(),10,10,300,200)
Repeat
EventID.l = WaitWindowEvent()
Until EventID = #PB_EventCloseWindow
EndIf
End
Franco
Posted: Tue May 20, 2003 4:03 pm
by GPI
How can i set the Focus to the Scitella-Editor, so that the user can start to write without click in the gadget...
SerFocus_() doesn't work!
Posted: Tue May 20, 2003 5:37 pm
by fsw
GPI wrote:How can i set the Focus to the Scitella-Editor, so that the user can start to write without click in the gadget...
SerFocus_() doesn't work!
Hi GPI, SetFocus works fine for me.
What you have to do before using SetFocus is to tell Scintilla on which line he is...
For Windows use this:
Code: Select all
SendMessage_(hwndScintilla, #SCI_GOTOLINE, 0, 0)
SetFocus_(hwndScintilla)
This works for me.
I have already build an Editor with Scintilla and it works great!
The File stuff and the Edit stuff (undo,redo,cut,copy,paste etc.) was really easy to implement. Also to set the LineNumber Margin.
The only thing I have to find out now is how to initialize the Lexer for the Keywords and the other gimmicks.
If you have a tip - I would be very thankful
Franco
Posted: Tue May 20, 2003 5:53 pm
by GPI
Now SetFocus works, but it doesn't (and i had set the pos with gotopos...)
As always: Don't ask -> Acept.
Btw: Try to Tab and Shift+Tab. It doesn't work, but i found a workaround to get work this.
About Lexer: I'm read at the moment the complete doc and create functions for easier calls.
At the moment i'm at the tab-section!
(Brace-highlightning works

Posted: Tue May 20, 2003 10:02 pm
by fsw
AutoCompletition works

Posted: Thu May 22, 2003 5:03 pm
by fsw
If somebody has to much free time on his hand, he could test this:
fsw.home.attbi.com/fsw-editor.zip
Some (a lot...

) things are not yet implemented, such as:
auto highlight of keywords, tab-key, folding etc.
But it's a start...
Posted: Thu May 22, 2003 9:03 pm
by GPI
Ok, i will test.
btw: Auto-instert-Spaces at the beginning after IF, While, Repeat, Procedure,IF, etc. and remove spaces after endif, etc. For automatic formated sourcodes

Posted: Thu May 22, 2003 9:18 pm
by fsw
Posted: Thu May 22, 2003 9:22 pm
by fsw
Please be patient with me, I'm a old slow learner

Posted: Thu May 22, 2003 10:39 pm
by fsw
ARGH, tabs are really not working - hope this is the only bug in Scintilla ...
UPDATE
Got a workaround working for tabs 
Posted: Fri May 23, 2003 3:11 pm
by GPI
Create, for example, a buttongadget and try Shift+Tab
GPI
Posted: Fri May 23, 2003 5:08 pm
by fsw
GPI wrote:Create, for example, a buttongadget and try Shift+Tab
GPI
You lost me
What do you mean
Shift+Tab on the PureBasic Editor (even GPI mod 5b) and nothing happens...
Posted: Fri May 23, 2003 5:09 pm
by GPI
Btw: My very, very experimental version:
http://caosandkin.bei.t-online.de/pureb ... r-test.zip
When you past lines, these lines are also new-formated.
When you select some text and the press TAB. This will start a reformat of the beginning of the lines.
try to write something like this:
if
asdfasdf
else
asdffas
endif
GPI
Posted: Fri May 23, 2003 5:36 pm
by fsw
just downloaded it
When you past lines, these lines are also new-formated.
try to write something like this:
if
asdfasdf
else
asdffas
endif
hmm, this seems to work fine
When you select some text and the press TAB. This will start a reformat of the beginning of the lines.
nothing special happens here (Win2K)
Also pressing the test button - nothing happens.
have to take more time and look at your code...
Wenn du was erklaeren willst (kannst das aber nicht so gut in englisch) dann kannst du es auch in deutsch schreiben)
PS - sorry, aber ich kenn mich nicht aus mit der neuen rechtschreibreform.
BTW. GPI Editor 5b crashes on Win2K after some minutes