Page 1 of 1

Libs : scintilla gadget (beta 4) for PB3.94

Posted: Mon Nov 28, 2005 10:12 pm
by eddy
Download library : ScintillaGadget.zip ( Extract to your PB folder and restart your PB compiler. )

Features:
- init DLL library & export scintilla internal variable
- use gadget
- load source ( loading file + AppendMode )
- save source ( saving file )
- copy source ( clone gadget text )
- set popupmenu
- set tabstop mode
- set lexer
- mouse pan (intellimouse bug fix)
- new specific EventTypes ( SCI_EventType_Focus, SCI_EventType_LeftClick,... )
- ADDED : doc
- ADDED : example

Image

Posted: Tue Dec 06, 2005 8:01 pm
by mag
Hi, why tab didn't work on all default Scintilla text. I try a few program that show how to load Scintilla text using pb and all cannot use tab by default. I study tab command on Scintilla message and try all of them, nothing change.

How actually to control tab and indent? What command to use.

Thanks in advance..

Posted: Tue Dec 06, 2005 8:42 pm
by ts-soft
mag wrote:Hi, why tab didn't work on all default Scintilla text. I try a few program that show how to load Scintilla text using pb and all cannot use tab by default. I study tab command on Scintilla message and try all of them, nothing change.

How actually to control tab and indent? What command to use.

Thanks in advance..

Code: Select all

  Width = 4
  Flag = 1
  CallFunctionFast(MessagePointer,hWnd.l,#SCI_SETTABWIDTH,Width,0)
  CallFunctionFast(MessagePointer,hWnd.l,#SCI_SETUSETABS,Flag,0)

Posted: Wed Dec 07, 2005 6:07 am
by mag
Still not working. Could you see my code. where bug..

Code: Select all

#SCI_SETTABWIDTH        = 2036
#SCI_SETUSETABS         = 2124
#SCI_GETDIRECTPOINTER   = 2185
#SCI_GETDIRECTFUNCTION  = 2184
#SCI_SETTEXT            = 2181

#STYLE_DEFAULT = 32 
#SCLEX_PUREBASIC = 67 

global scilexer.l
scilexer = OpenLibrary(#PB_Any, "SciLexer.dll") 
If scilexer = 0 
    MessageRequester("Error", "Couldn't open SciLexer.dll") 
    End 
EndIf 

OpenWindow(0, 0, 0, 600, 400, #PB_Window_SystemMenu, "Scintilla test") 
GetClientRect_(WindowID(0), rect.RECT) 
scihWnd = CreateWindowEx_(#WS_EX_CLIENTEDGE, "Scintilla", "", #WS_CHILD | #WS_VISIBLE | #WS_TABSTOP, 0, 0, rect\right, rect\bottom, WindowID(0), 0, GetModuleHandle_(0), 0) 

SciEdi_WndData    = SendMessage_(scihWnd,#SCI_GETDIRECTPOINTER,0,0)
SciEdi_PtrData    = SendMessage_(scihWnd,#SCI_GETDIRECTFUNCTION,0,0)

  CallFunctionFast(SciEdi_PtrData,SciEdi_WndData,#SCI_SETTEXT,0,"Try use tab on me. Not working. why? Help me..") 

  Width = 4 
  Flag = 1 
  CallFunctionFast(SciEdi_PtrData,SciEdi_WndData,#SCI_SETTABWIDTH,Width,0) 
  CallFunctionFast(SciEdi_PtrData,SciEdi_WndData,#SCI_SETUSETABS,Flag,0)

Repeat 
    event.l = WaitWindowEvent() 
Until event = #PB_Event_CloseWindow 

DestroyWindow_(scihWnd) 
CloseLibrary(scilexer)

Posted: Wed Dec 07, 2005 10:52 am
by DoubleDutch
I have the same problem - the solutiuon didn't work for me either...

Posted: Wed Dec 07, 2005 6:49 pm
by ts-soft
Delete the Tab-Stop of the PB-Window. PB generates automatic-shortcut for tab to the window.

Code: Select all

RemoveKeyboardShortcut(#Window_frmMain, #PB_Shortcut_All)

Posted: Wed Dec 07, 2005 10:05 pm
by DoubleDutch
Thanks :)

Posted: Fri Dec 09, 2005 10:09 am
by eddy
strange ?

But the editorGadget has not this problem.

Posted: Sat Dec 10, 2005 5:35 am
by eddy
Beta 2 [ RELEASED ]
- fixed : big focus problem (flickering)
- fixed : tab emulation

Posted: Tue Dec 13, 2005 11:21 pm
by eddy
beta3 ( work in progress )

- TabStop bug : FIXED
- 'IntelliMouse pan' bug : FIXED
- SciSaveSource : FIXED

Posted: Thu Dec 15, 2005 2:53 pm
by porfirio
Cool, very good :)

Could you add basic syntax highlighter??

I can find any good sample :(

Posted: Thu Dec 15, 2005 4:18 pm
by Trond
eddy wrote:strange ?

But the editorGadget has not this problem.
Because the person who made Scintilla (or ported it to Windows) can't code or knows nothing about keyboard focus on Windows.

Posted: Sat Dec 17, 2005 4:14 am
by eddy
Could you add basic syntax highlighter??
For the moment, there's no interface to code a lexer.
I can find any good sample
Japbe is a good sample.

Posted: Sat Dec 17, 2005 4:21 am
by eddy
Beta 3 [ RELEASED ]

- Some PB EventTypes : SCI_EventType_Focus,SCI_EventType_LeftClick,..
- New parameter for SciLoadSource command : AppendMode
- New command: SciMousePan()

Posted: Thu Feb 16, 2006 4:37 am
by eddy
Beta 4 [ RELEASED ]

- support: SetGadgetText and GetGadgetText (<65000 characters)
- New command: SciSetLexer()

You can code your own lexer... :)