SciTE-GUI: GUI Extensions for SciTE Lua

1,439 views
Skip to first unread message

SteveD

unread,
Aug 4, 2008, 7:33:19 AM8/4/08
to scite-interest
SciTE-GUI is a binary extension for SciTE Lua written in C++ which
gives Lua scripts the ability to interact with the user with GUI
elements like lists, file and colour dialogs, message boxes, prompt
for string, etc. It also provides a few useful utility functions like
gui.run(), which can launch an arbitrary program or document without
blocking, etc. There's an example showing a context-sensitive floating
toolbar, as previously promised.

It's possible to attach these GUI elements to the main frame of SciTE
itself:

http://mysite.mweb.co.za/residents/sdonovan/SciTE/scite.png

(Note well that this required _no changes_ to SciTE itself; it is all
done with window subclassing voodoo.)

Here is the documentation, source and binary dll (MSVC6):

http://mysite.mweb.co.za/residents/sdonovan/SciTE/gui_ext.zip

Put gui.dll next to your SciTE.exe and call require("gui") in your
scripts; things should then just work.

Most of the C++ is quite old and sloppy (it is based on a library I
wrote when I was young and foolish, plus VC6 is very tolerant) but I
hope to have a mingw buildable version out soon.

steve d.



Vladislav Vorobyev

unread,
Aug 4, 2008, 10:32:46 AM8/4/08
to scite-i...@googlegroups.com
This sounds very interesting.
Thank you Steve.
We'll wait for MinGW version.

--
With best regards,
Vladislav V. Vorobyev

Larry Wang

unread,
Aug 5, 2008, 3:19:36 AM8/5/08
to scite-interest
This is just the GUI extension I have been waiting for so long!! Thank you
Steve! I have already played around with it for a few hours. One question
though:
Is it possible to not print any statements in console output when switching
between tabs? I usually minimize my console output window, it's kinda
annoying every time I switch tabs then it pops up.

Thanks,
Nessus

--------------------------------------------------
From: "SteveD" <steve.j...@gmail.com>
Sent: Monday, August 04, 2008 4:33 AM
To: "scite-interest" <scite-i...@googlegroups.com>
Subject: [scite] SciTE-GUI: GUI Extensions for SciTE Lua

SteveD

unread,
Aug 7, 2008, 4:15:13 AM8/7/08
to scite-interest
On Aug 5, 9:19 am, "Larry Wang" <lwa...@gmail.com> wrote:
> Is it possible to not print any statements in console output when switching
> between tabs? I usually minimize my console output window, it's kinda
> annoying every time I switch tabs then it pops up.

Fortunately, this is an easy one! In the gui-test.lua example (which
I assume is the one you're using), there is the following code:

t:on_select(function(idx)
print('tab',idx)
end)

Just comment out the print statement! There's no actual printing going
on within the DLL itself.

steve d.

DB

unread,
Aug 7, 2008, 6:02:38 AM8/7/08
to scite-interest
On Aug 4, 1:33 pm, SteveD <steve.j.dono...@gmail.com> wrote:
> SciTE-GUI is a binary extension for SciTE Lua written in C++ which
> gives Lua scripts the ability to interact with the user with GUI
> elements like lists, file and colour dialogs, message boxes, prompt
> for string, etc.  It also provides a few useful utility functions like
> gui.run(), which can launch an arbitrary program or document without
> blocking, etc. There's an example showing a context-sensitive floating
> toolbar, as previously promised.

This is really great :)
However after adding require("gui") to startup lua something goes
wrong with codepage - I cant use anymore national letters. My
settings:
code.page=1250
character.set=238
chars.accented=ĄąĆćĘꣳŃńÓ󌜯żŹź
OS: WinXP PL

instanton

unread,
Aug 7, 2008, 6:57:00 AM8/7/08
to scite-interest
While trying files.lua I encountered some minor problem: double clicking on while spaces in the panel, SciTE crashes. Looking into the lua code, I got a solution: it is better not to check if file/dir/pos is not nil, but check if idx is not -1 instead. This way no crash will occur while double clicking on while spaces.
 
Many thanks to Steve for this execlent GUI component. 
 
instanton,soft_...@126.com
2008-08-07
----- Original Message -----
From: SteveD
Sent: 2008-08-04, 19:33:19
Subject: [scite] SciTE-GUI: GUI Extensions for SciTE Lua

DB

unread,
Aug 7, 2008, 8:07:40 AM8/7/08
to scite-interest
On Aug 7, 12:57 pm, "instanton"<soft_sh...@126.com> wrote:
> While trying files.lua I encountered some minor problem: double clicking on while spaces in the panel, SciTE crashes. Looking into the lua code, I got a solution: it is better not to check if file/dir/pos is not nil, but check if idx is not -1 instead. This way no crash will occur while double clicking on while spaces.

Could you please post exact needed changes?

instanton

unread,
Aug 7, 2008, 8:13:34 AM8/7/08
to scite-interest
Modified files.lua:

##--------- code begin ------------------------

-- Demonstrates a Useful Side Bar for SciTE
-- you can choose to make it a stand-alone window; just uncomment the two lines
-- involving 'gui.window' and comment out the 'w = gui.panel' line.

local append = table.insert
local current_path = props['FileDir']
local ext = props['FileExt']

-- w = gui.window "Files"
-- w:size(width,400)
local width = 120;
local w = gui.panel(width)
local ls = gui.list(true)
local dirs = gui.list(true)
local bookmarks = gui.list(true)
gui.set_panel(w,"right")
ls:size(width,width)
ls:add_column("Files",width);
dirs:add_column("Directories",width)
-- bookmarks:add_column("Bookmarks",width)
w:add(dirs,"top",200)
-- w:add(bookmarks,"top",150)
w:client(ls)
w:show()

function name_of (f)
return f:match('([^\\]+)%.%w+$')
end

local dirsep = '\\'

local function makepath (f)
return current_path..dirsep..f
end

function fill ()
local mask_base = makepath('*.')
local mask = mask_base..current_ext
local files = gui.files(mask)
local same_ext = true
ls:clear()
-- note that gui.files will not return a table if there were no contents!
if not files then
files = gui.files(mask_base..'*')
same_ext = false
end
if files then
for i,f in ipairs(files) do
local name = f
if same_ext then name = name_of(name) end
ls:add_item(name,f)
end
end
local dirlist = gui.files(makepath('*'),true)
dirs:clear()
dirs:add_item ('[..]','..')
for i,d in ipairs(dirlist) do
dirs:add_item('['..d..']',d)
end
end

ls:on_double_click(function(idx)
if not (idx == -1) then
local file = ls:get_item_data(idx)
scite.Open(makepath(file))
end
end)

dirs:on_double_click(function(idx)
if not (idx == -1) then
local dir = dirs:get_item_data(idx)
gui.chdir(dir)
current_path = current_path..dirsep..dir
fill()
end
end)

function OnCommand (id)
if id == IDM_BOOKMARK_TOGGLE then
local line = editor:GetCurLine()
-- is this line already in the list?
local inserting = true
for i = 0,bookmarks:count() - 1 do
if bookmarks:get_item_text(i) == line then
bookmarks:delete_item(i)
inserting = false
break
end
end
if inserting then
local lno = editor:LineFromPosition(editor.CurrentPos)
bookmarks:add_item(line,{props['FilePath'],lno})
end
end
end

bookmarks:on_double_click(function(idx)
if not (idx == -1) then
local pos = bookmarks:get_item_data(idx)
scite.Open(pos[1])
editor:GotoLine(pos[2])
end
end)

local function on_switch ()
local path = props['FileDir']
local ext = props['FileExt']
if path == '' then return end
if path ~= current_path or ext ~= current_ext then
current_path = path
current_ext = ext
fill()
end
end

local oldOnSwitchFile = OnSwitchFile
local oldOnOpen = OnOpen

function OnSwitchFile(file)
on_switch()
if oldOnSwitchFile then oldOnSwitchFile(file) end
end

function OnOpen(file)
on_switch()
if oldOnOpen then oldOnOpen(file) end
end

## ------------- Code End -----------------------------------


instanton,soft_...@126.com
2008-08-07
----- Original Message -----

DB

unread,
Aug 7, 2008, 8:21:06 AM8/7/08
to scite-interest


On Aug 7, 2:13 pm, "instanton"<soft_sh...@126.com> wrote:
> Modified files.lua:

Thank you.
I also changed 2 lines to disable horizontal scroll on xp:
ls:add_column("Files",width-17);
dirs:add_column("Directories",width-17)

instanton

unread,
Aug 7, 2008, 8:57:34 AM8/7/08
to scite-interest
I'm playing with SciTE-GUI and hope to be able to input some words into the editor pane by double clicking on a list shown in a GUI window. For example, with the following code,
 
##-------Code begin-----------
w2 = gui.window "MyList"
w2:size(200,369)
w2:position(1025,368)
wls = gui.list()
wls:add_item('stuff')
wls:add_item('nonsense')
w2:client(wls)
w2:show()
 
wls:on_double_click(function(idx)

 if not (idx == -1) then
  local item = wls:get_item_data(idx)
  editor:append(item)
 end
end)
 
##---------Code end-------------
 
I expact that by double clicking on the item "stuff" shown in the window "MyList", the word "stuff" will be inserted to the editor pane. However instead of the expected behavior, I got a SciTE crash. Changing the line editor:append(item) into print(item), I got "nil" printed in the output pane. Can anyone please tell what I am doing wrong? (Steve, please?)
 
Thanks.
 
instanton,soft_...@126.com
2008-08-07

SteveD

unread,
Aug 7, 2008, 10:05:48 AM8/7/08
to scite-interest
On Aug 7, 2:57 pm, "instanton"<soft_sh...@126.com> wrote:
> wls:add_item('stuff')
> wls:add_item('nonsense')
> ...
> local item = wls:get_item_data(idx)

If you had said wls:get_item_text(idx), things would work as you
expected...

item data is any old Lua value which can be associated with an item.
To add such data, use 2nd arg of add_item:

wls:add_item("stuff","STUFF")
wls:add_item("nonsense","NONSENSE")

BTW, guys, the thing I MUST sort out is this instability. Usual bad
habit of not checking that input values are sane ;)

steve d.



Larry Wang

unread,
Aug 7, 2008, 1:37:15 PM8/7/08
to scite-i...@googlegroups.com
thanks Steve. should have read the source code more carefully ;)

instanton

unread,
Aug 8, 2008, 9:55:51 AM8/8/08
to scite-interest
Hi, Steve,
 
Many thanks.
 
Now I have several more questions in configuring SciTE-GUI.
 
1) I wish to define more than one panels, is this pissible at all? If not, I would prefer to write several Lua functions, each defines a panel, and call one of them at a time. The question is then: is there an operation control which closes the currently openning panel?
 
2) I like the panel organization defined in files.lua very much. I would like to make similar horizontal separations to a tabbed gui window by columns (i.e. like Directories, Bookmarks and Files columns), but it seems that when tab changes only the last column can change with the tab, while the first columns appears to be fixed regardless of the tab switching. Is there a way to separate a tabbed window horizontally and let each part switch with the tab?
 
 
instanton,soft_...@126.com
2008-08-08
----- Original Message -----
From: SteveD
Sent: 2008-08-07, 22:05:48
Subject: [scite] Re: SciTE-GUI: GUI Extensions for SciTE Lua

SteveD

unread,
Aug 12, 2008, 2:00:13 AM8/12/08
to scite-interest
On Aug 8, 3:55 pm, "instanton"<soft_sh...@126.com> wrote:
> 1) I wish to define more than one panels, is this pissible at all? If not, I would prefer to write several Lua >functions, each defines a panel, and call one of them at a time. The question is then: is there an operation >control which closes the currently openning panel?

You can control the visibility of forms with the show()/hide()
methods. But you are talking about the embedded panels. Currently,
there's just one 'slot' for a panel, on the right; we could make all
positions available for panels.

> 2) I like the panel organization defined in files.lua very much. I would like to make similar horizontal separations >to a tabbed gui window by columns (i.e. like Directories, Bookmarks and Files columns), but it seems that when >tab changes only the last column can change with the tab, while the first columns appears to be fixed regardless >of the tab switching.

It can be done! The trick is to put the controls into a panel object,
then put this panel into a tab, and finally put the tab into another
panel, which is attached to the side. For instance, here is the GUI
setup for files.lua, generalized to add a tab:

local w = gui.panel(100)
local ls = gui.list(true)
local dirs = gui.list(true)
local bookmarks = gui.list(true)
ls:add_column("Files",100);
dirs:add_column("Directories",100)
bookmarks:add_column("Bookmarks",100)
w:add(dirs,"top",150)
w:add(bookmarks,"top",150)
w:client(ls)
w:show()
local panel = gui.panel(100)
local extras = gui.list()
extras:add_item 'hello'
extras:add_item 'dolly'
local tabs = gui.tabbar(panel)
tabs:add_tab("files",w)
tabs:add_tab("extras",extras)
panel:client(w)
gui.set_panel(panel,"right")

The window hierarchy now looks like this:

panel
-- tabs
-- files
-- ls
-- dirs
-- bookmarks
-- extras

Note that when using a tab you have to explicitly show the active tab
'panel:client(w)' afterwards. I mention this because I forgot to do it
at first and was puzzled at the grey empty tab ;)

steve d.

SteveD

unread,
Aug 12, 2008, 7:20:04 AM8/12/08
to scite-interest
>Here is the documentation, source and binary dll (MSVC6):
>
> http://mysite.mweb.co.za/residents/sdonovan/SciTE/gui_ext.zip

This fresh version brings two things to the party:
- it can be built using MinGW - there is a makefile. This mostly
involved bringing some old C++ code into the 21st century.
- it has a lot more API checks, so it is less likely to crash SciTE.

I am interested in what new features people have strong feelings
about. I'd like to add a tree view, since I've done the hard part of
wrapping it in C++. Also, people may like to attach panels to any
side (top,left,right,bottom) of the editor pane; may not be my cup of
tea, but if there's demand I'll generalize the sizing code.

I am going to come out with a new version of SciTE-Debug which uses
this extension to show watches, inspect variables, etc.

It would be cool to have a version which implemented the same API for
GTK versions. The best candidate so far has been lua-gtk, but it is a
real bitch to compile; I may go for a direct port.

I still don't understand why this DLL would mess with the code page
settings, but I will continue to try track this one down.

steve d.


Doyle Whisenant

unread,
Aug 12, 2008, 8:42:33 PM8/12/08
to scite-i...@googlegroups.com
SteveD wrote:
>> Here is the documentation, source and binary dll (MSVC6):
>>
>> http://mysite.mweb.co.za/residents/sdonovan/SciTE/gui_ext.zip
>>
>
>

Hi Steve, is this not the same version as before? I tried the first
release but it didn't work with SciTE 1.74. Is this version of SciTE to old?

> This fresh version brings two things to the party:
> - it can be built using MinGW - there is a makefile. This mostly
> involved bringing some old C++ code into the 21st century.
> - it has a lot more API checks, so it is less likely to crash SciTE.
>
>

I see no makefile in the download above. Sorry, am I missing something?

Thanks,
Doyle

instanton

unread,
Aug 13, 2008, 12:06:33 AM8/13/08
to scite-interest
>Here is the documentation, source and binary dll (MSVC6):
>
> http://mysite.mweb.co.za/residents/sdonovan/SciTE/gui_ext.zip

Hi, Steve,
As someone has already pointed out, the link above is the same old version. I saw no changes to either the source code or the comopiled binary.

> This fresh version brings two things to the party:
> - it can be built using MinGW - there is a makefile. This mostly
> involved bringing some old C++ code into the 21st century.
> - it has a lot more API checks, so it is less likely to crash SciTE.

That sounds teriffic.

> I am interested in what new features people have strong feelings
> about. I'd like to add a tree view, since I've done the hard part of
> wrapping it in C++. Also, people may like to attach panels to any
> side (top,left,right,bottom) of the editor pane; may not be my cup of
> tea, but if there's demand I'll generalize the sizing code.

I'll vote for the tree view panel and a tabbed view in place of the output pane. Meanwhile, I strongly suggest to implement a docking property for the floating toolbar, i.e. if placing the floating toolbar on top of the built-in toolbar or next to it, it should appear as a second toolbar attached to the main window. Moreover, it would become more useful if one can use command IDs rather than the lua function names or built-in function names while configuring the toolbar (command IDs can be asigned to any user defined tools, for instance, not only restricted to the ones defined via lua script).

Regards

instanton


SteveD

unread,
Aug 13, 2008, 3:25:17 AM8/13/08
to scite-interest
Sorry about that; case-sensitive file systems bite again!

http://mysite.mweb.co.za/residents/sdonovan/scite/gui_ext.zip

The last link was definitely the old version.

I've been testing with 1.75. I think that was the point where the Lua
symbols got exported, which is necessary for this DLL to work.

steve d.

instanton

unread,
Aug 13, 2008, 5:26:31 AM8/13/08
to scite-interest
> It can be done! The trick is to put the controls into a panel object,
> then put this panel into a tab, and finally put the tab into another
> panel, which is attached to the side. For instance, here is the GUI
> setup for files.lua, generalized to add a tab: ...

Works perfectly. Thank you very much Steve.

I have another feature request: is it possible to enable styling for the panel(s)? I ask this because many SciTE users use dark scheme settings but the default panel background is white which looks inconsistent with the overall colour scheme.

Regards

instanton


SteveD

unread,
Aug 14, 2008, 5:13:52 AM8/14/08
to scite-interest
On Aug 13, 11:26 am, "instanton"<soft_sh...@126.com> wrote:
> I have another feature request: is it possible to enable styling for the panel(s)? I ask this because many SciTE users use dark scheme settings but the default panel background is white which looks inconsistent with the overall colour scheme.

This seems like a good feature, since white panels are very harsh if
you like working in the dark ;)

I shall expose methods to set foreground and background colours.

steve d.

lenin

unread,
Aug 14, 2008, 9:03:41 AM8/14/08
to scite-interest
I put "require("gui")" in my startup script , no other code added .
When I restart SciTE , it crashed .
Then I add a line "gui.message("Hello World","message")" , when I
start the application
again , the message dialog appeared , but after that , SciTE crashed
again .

SteveD

unread,
Aug 14, 2008, 9:16:37 AM8/14/08
to scite-interest
What version of SciTE and what version of Windows?

trotsky

lenin

unread,
Aug 14, 2008, 11:51:14 AM8/14/08
to scite-interest
SciTE's version : 1.76
Windows XP SP2
I have installed TigerMilk v3.5.1 to simulate MacOS , does it matter ?

PeterW

unread,
Aug 17, 2008, 5:56:36 PM8/17/08
to scite-interest
On Aug 14, 5:51 pm, lenin <lenin....@gmail.com> wrote:
> > > I put "require("gui")" in my startup script , no other code added .
> > > When I restart SciTE , it crashed .

This is exactly what happens on my system, and with both versions of
gui.dll.
Same setup; i.e. SciTE 1.76, Windows XP professional SP2, no Tigermilk
or other emulators/virtual machines installed.

SteveD

unread,
Aug 18, 2008, 3:46:27 AM8/18/08
to scite-interest
On Aug 17, 11:56 pm, PeterW <werbungfuer...@googlemail.com> wrote:
> This is exactly what happens on my system, and with both versions of
> gui.dll.
> Same setup; i.e. SciTE 1.76, Windows XP professional SP2, no Tigermilk
> or other emulators/virtual machines installed.

That is worrying. What I shall do is release a version which doesn't
do the subclassing, just to see if that's the problem. You won't be
able to attach panels to the side, but it will be a useful data point
in discovering what the real problem is.

steve d.

SteveD

unread,
Aug 19, 2008, 9:34:29 AM8/19/08
to scite-interest
http://mysite.mweb.co.za/residents/sdonovan/scite/gui_ext.zip

The new thing this brings to the party is the ability to change the
colours of the list and text views.

ls:set_list_colour("#FFFFFF","#000000") -- foreground, background!
txt:set_memo_colour("#FFFFFF","#000000")

Note a limitation of list custom draw: the selection colours can't be
changed, which is a bit of a bummer.

This zip also contains ngui.dll, which doesn't attempt to subclass
Scite (just say require 'ngui' instead of require 'gui'); I've put
this in because I'm curious to see if people still get SciTE crashes
with this one.

In any case, gui.dll is now more careful when it subclasses, and may
be able to detect when it can't - it will then pop up an error message
but shouldn't bring SciTE down.

The dodgy part of the subclassing is that it assumes that the
currently active window is actually the SciTE main frame window. From
there it works from the expected structure of SciTE's windows; the
first child is the content pane, the first child of that is the main
editor Scintilla, etc. This does strike me as being rather
trusting ;) In fact what I need to do is to enumerate all SciTE top-
level windows (by class) and find the one that belongs to the current
iinstance.

Anyway, give it a bash and tell me what the errors are now...

steve d.

SteveD

unread,
Aug 19, 2008, 9:39:55 AM8/19/08
to scite-interest
A second thought: the thing about 'ngui.dll' is that it cannot put the
panel down the side, but you can create separate windows. It's really
there until we have this subclassing problem sorted - if it has to do
with subclassing!

steve d.

instanton

unread,
Aug 19, 2008, 8:28:24 PM8/19/08
to scite-interest
> The new thing this brings to the party is the ability to change the
> colours of the list and text views.

Thanks Steve, that works great here.

> The dodgy part of the subclassing is that it assumes that the
> currently active window is actually the SciTE main frame window. From
> there it works from the expected structure of SciTE's windows; the
> first child is the content pane, the first child of that is the main
> editor Scintilla, etc. This does strike me as being rather
> trusting ;) In fact what I need to do is to enumerate all SciTE top-
> level windows (by class) and find the one that belongs to the current
> iinstance.

I don't have the crash problem, and I don't quite understand the subclassing. But I suggest that the side panels should be attached to the SciTE main frame, not just to the editor pane, i.e. if the panel appears at the right, its height should be roughly the sum of that of the editor pane and of the output pane.

One further feature request: I hope that when double clicking on the panel seperator, the corresponding content could be maxmized (i.e. takes up most of the panel space) while the contents under other seperators should be minimized, leaving only the seperator bar visible. If I didn't describe the requested effect well enough, please see the side panel of TeXMaker.

A last question is: is it possible to change the fonts used for tabbars, horizontal seperators etc?

Bests,

instanton


SteveD

unread,
Aug 20, 2008, 5:19:42 AM8/20/08
to scite-interest
On Aug 20, 2:28 am, "instanton"<soft_sh...@126.com> wrote:
> I suggest that the side panels should be attached to the SciTE main frame, not just to the editor pane, i.e. if the panel appears at the right, its height should be roughly the sum of that of the editor pane and of the output pane.
>

I'll look at that possibility.

> One further feature request: I hope that when double clicking on the panel seperator, the corresponding content could be maxmized (i.e. takes up most of the panel space) while the contents under other seperators should be minimized, leaving only the seperator bar visible. If I didn't describe the requested effect well enough, please see the side panel of TeXMaker.

The sidepanels of Visual Studio work something like that - I like this
idea. Would we also need to have 'restored' panes as well? If
there's just minimized/maximized, it's basically a kind of vertical
tab page.

> A last question is: is it possible to change the fonts used for tabbars, horizontal seperators etc?

The custom draw framework allows for this - I used it just to change
the drawing colours, but you can actually substitute your own font
using this technique. So this is very doable.

steve d.

instanton

unread,
Aug 21, 2008, 11:28:46 PM8/21/08
to scite-interest, SteveD
Hello Steve,
 
Thanks for your reply.

> The custom draw framework allows for this - I used it just to change
> the drawing colours, but you can actually substitute your own font
> using this technique. So this is very doable.

Could you please give am example on this? I ask this feature because the font used for tabbar is different from the one on menubar and other places. I attach a schreenshot of my configuration.
 
Regards
 
instanton
scite.png

PeterW

unread,
Aug 22, 2008, 12:40:59 AM8/22/08
to scite-interest
ngui.dll works for me - no more crashes :-)
I haven't played around with it much yet, but it does run gui-test.lua.

SteveD

unread,
Aug 22, 2008, 3:12:48 AM8/22/08
to scite-interest
Cool - so it's bad subclassing - that should be a solveable problem!

SteveD

unread,
Aug 22, 2008, 3:17:23 AM8/22/08
to scite-interest
I see your problem - I have noticed the different font, although it
was just slightly irritating. But if you're getting a completely
different character set, then we have an issue ;)

I will have to add a method to change the font, and make some changes
to the custom draw handler. You're welcome to mess with the source, if
you feel you can handle a little C++.

Unfortunately, this is going to have to wait, because I have to be out
of the country for 2 weeks, conferences and things, and will be away
from my beloved computer. This is probably a good idea for my mental
health anyway.

steve d.
> scite.png
> 21KViewDownload

Frank Wunderlich

unread,
Aug 22, 2008, 4:48:34 PM8/22/08
to scite-i...@googlegroups.com
i changed funcProcList from SciteRu a little bit to work with Scite-GUI.
maybe its useful for anybody:

local findRegExp = {
['cxx']="([^.,<>=\n]-[ :][^.,<>=\n%s]+[(][^.<>=)]-[)])[%s\/}]-%b{}",
['h']="([^.,<>=\n]-[ :][^.,<>=\n%s]+[(][^.<>=)]-[)])[%s\/}]-%b{}",
['js']="(\n[^,<>\n]-function[^(]-%b())[^{]-%b{}",
['vbs']="(\n[SsFf][Uu][BbNn][^\r]-)\r",
['css']="([%w.#-_]+)[%s}]-%b{}",
['pas']="\n([pPff][rRuU][oOnN][cC][eEtT][dDiI][uUoO][rRnN].-%b().-)\n",
['py']="\n%s-([dc][el][fa]%s-.-):"
}

local oldOnSwitchFile = OnSwitchFile
function OnSwitchFile(file)
if oldOnSwitchFile then oldOnSwitchFile(file) end
if ls then
-- first clear the list
c=ls:count()-1;
for i=c,0,-1 do
ls:delete_item(0)
end;
-- Fill the lower list with functions
ListProcedures()
end
end

ls:on_double_click(function(idx)
local pos = ls:get_item_data(idx)
--gui.message(pos[2])
if pos then
scite.Open(pos[1])
editor:GotoLine(pos[2])
editor.Focus=true
end
end)

function ListProcedures()
local textAll = editor:GetText()
local findPattern = findRegExp [props["FileExt"]]
if findPattern == nil then
findPattern = "\n[local ]*[SsFf][Uu][BbNn][^ ]* ([^(]*%b())"
end
local count=0
while true do
startPos, endPos, findString = string.find(textAll, findPattern,
startPos)
if startPos == nil then break end
findString = string.gsub (findString, "\r\n", "")
findString = string.gsub (findString, "%s+", " ")
if not IsComment(startPos) then
local line = editor:LineFromPosition(startPos)
if ls then
ls:add_item(findString,{props['FilePath'],line})
else
print(props['FileNameExt']..':'..(line+1)..':\t'..findString)
end
count = count + 1
end
startPos = endPos + 1
end
if not ls then
if count > 0 then
trace("> found "..count.." functions/procedures")
else
trace("> nothing found!")
end
end
end

regards Frank

Frank Wunderlich

unread,
Aug 22, 2008, 7:54:31 PM8/22/08
to scite-i...@googlegroups.com
i found an issue with bookmark-listing in combination with sciteRu.

"my" configuration for the GUI-Extension:

function OnCommand (id)
--if old_OnCommand then result = old_OnCommand(id) end
if id == IDM_BOOKMARK_TOGGLE then
local line = editor:GetCurLine()
line = string.gsub(line,"%c*","")
line = string.gsub(line,"^%s*","")
-- is this line already in the list?
local inserting = true
for i = 0,bookmarks:count() - 1 do
if bookmarks:get_item_text(i) == line then
bookmarks:delete_item(i)
inserting = false
break
end
end
if inserting then
local lno = editor:LineFromPosition(editor.CurrentPos)
bookmarks:add_item(line,{props['FilePath'],lno})
end
end
end

bookmarks:on_double_click(function(idx)
local pos = bookmarks:get_item_data(idx)


if pos then
scite.Open(pos[1])
editor:GotoLine(pos[2])
editor.Focus=true
end
end)

works with ctrl+f2 without problems, but sciteru has a feature to set
Bookmarks by clicking the margin. this seems not to trigger the message
to the script-handler => the bookmark is set, but not added to the list.

here the corresponding code-snippets:

scitebase.cxx:4889:
case SCN_MARGINCLICK: {
if (extender)
handled = extender->OnMarginClick();
if (!handled) {
//!-start-[SetBookmark]
if (notification->margin == 1) {
int lineClick = int(SendEditor(SCI_LINEFROMPOSITION,
notification->position));
BookmarkToggle(lineClick);
}

scitebase.cxx:2041:
void SciTEBase::BookmarkToggle(int lineno) {
if (lineno == -1)
lineno = GetCurrentLineNumber();
if (BookmarkPresent(lineno)) {
BookmarkDelete(lineno);
} else {
BookmarkAdd(lineno);
}
}

scitebase.cxx:2020:
void SciTEBase::BookmarkAdd(int lineno) {
if (lineno == -1)
lineno = GetCurrentLineNumber();
if (!BookmarkPresent(lineno))
SendEditor(SCI_MARKERADD, lineno, markerBookmark);
}

has anybody an idea to fix this?

regards Frank

mozers

unread,
Aug 24, 2008, 7:50:34 AM8/24/08
to Frank Wunderlich
Saturday, August 23, 2008, 12:48:34 AM, Frank wrote:

FW> i changed funcProcList from SciteRu a little bit to work with Scite-GUI.
FW> maybe its useful for anybody:
FW> ...

This interesting decision.
Many magnificent ideas could will be carried out if gui-ext worked well.
It is excellent library but too many bugs.
I cannot work with her till that time while the basic bugs will not be corrected.
The main thing is that in SciTE it becomes impossible to write in Russian
and that panels are displayed very much not stably.

--
mozers
<http://code.google.com/p/scite-ru/>

mozers

unread,
Aug 24, 2008, 7:34:45 AM8/24/08
to Frank Wunderlich
Saturday, August 23, 2008, 3:54:31 AM, Frank wrote:

FW> works with ctrl+f2 without problems, but sciteru has a feature to set
FW> Bookmarks by clicking the margin. this seems not to trigger the message
FW> to the script-handler => the bookmark is set, but not added to the list.
FW> ...
FW> has anybody an idea to fix this?

You are completely right.
At set of a bookmark with click on the margin do not trigger message IDM_BOOKMARK_TOGGLE.
Your decision of this problem will be considered.

--
mozers
<http://code.google.com/p/scite-ru/>

Frank Wunderlich

unread,
Aug 24, 2008, 8:47:36 AM8/24/08
to scite-i...@googlegroups.com
mozers, 24.08.2008 13:50:

> I cannot work with her till that time while the basic bugs will not be corrected.
> The main thing is that in SciTE it becomes impossible to write in Russian
> and that panels are displayed very much not stable
which bugs do you mean? the actual version seems to work stable for me
(if you do not have bugs in the scipt).

in the screen you can see, that the string is cut off after specific
length (... appended), can this be changed to show the full string?

can anybody help me to change the pas-expression so that only [p]
instead of procedure and [f] instead of function is shown?
here my current regexp:


['pas']="\n([pPff][rRuU][oOnN][cC][eEtT][dDiI][uUoO][rRnN].-%b().-)\n",

this lists like i the screenshot shown.

regards Frank

guiext.GIF

instanton

unread,
Aug 24, 2008, 8:56:53 AM8/24/08
to scite-interest
You may need to post your luascript somewhere in order that someone can help.
 
instanton,soft_...@126.com
2008-08-24

Frank Wunderlich

unread,
Aug 24, 2008, 9:13:39 AM8/24/08
to scite-i...@googlegroups.com
instanton, 24.08.2008 14:56:

> You may need to post your luascript somewhere in order that someone
> can help.
i've posted it some posts before and its nearly the funcproclist.lua
from sciteRu, but here is it again (attachment).

frank

gui_conf.lua

instanton

unread,
Aug 24, 2008, 10:08:48 AM8/24/08
to scite-interest
[snip]

> in the screen you can see, that the string is cut off after specific
> length (... appended), can this be changed to show the full string?

Sorry I cannot find a way to solve this;

> can anybody help me to change the pas-expression so that only [p]
> instead of procedure and [f] instead of function is shown?
> here my current regexp:
> ['pas']="\n([pPff][rRuU][oOnN][cC][eEtT][dDiI][uUoO][rRnN].-%b().-)\n",
> this lists like i the screenshot shown.

This may be solved by calling the string.gsub method once again before the line

ls:add_item(findString,{props['FilePath'],line})


instanton


Frank Wunderlich

unread,
Aug 24, 2008, 10:44:19 AM8/24/08
to scite-i...@googlegroups.com
i want to try tabbar, but i can't get it working...here my code:

local w = gui.panel(200)
local ls = gui.list()
local bookmarks = gui.list()

gui.set_panel(w,"right")
ls:size(100,100)

-- w:add(bookmarks,"top",100)
-- w:add(ls,"top",300)

-- tabs
t = gui.tabbar(w)
t:add_tab("column list",ls)
t:add_tab("bookmarks",bookmarks)
w:client(t)

-- end tabs

w:show()

the previous version with the 2 w:add-lines and without tabbar-code
works fine.
with tabbar, i see the tabbar, not the client of the first tab (ls), the
client-area is grey. if i switch the the tab to the second, the tabbar
dissapears and i see only client of second tab (bookmarks) and can't
switch back.
maybe i don't exactly understod the tabbar-code in the example but the
documentation says not much :)

btw. the bookmark-code also not handling linecount-change because the
line-numbers are added to the list. isn't there a way to access the
bookmarks-list from scite?

regards Frank

Frank Wunderlich

unread,
Aug 24, 2008, 12:01:16 PM8/24/08
to scite-i...@googlegroups.com
i've tried that that way, but don't know how to walk through my
replace-table to call gsub with key and value:

local replaceRegExp = {
['pas']={
['[pP][rR][oO][cC][eE][dD][uU][rR][eE]']="[p]",
['[fF][uU][nN][cC][tT][iI][oO][nN]']="[f]"
}
}

local replacePattern = replaceRegExp [props["FileExt"]]

if replacePattern~=nil then
for s,r in replacePattern do
string.gsub (line, s, r)
end
end

in the lua-documentation i also found foreach and foreahi, but it seems
that these 2 functions are not able to get the key-name.
any ideas?

frank

mozers

unread,
Aug 24, 2008, 1:28:21 PM8/24/08
to Frank Wunderlich
Sunday, August 24, 2008, 6:44:19 PM, Frank wrote:

FW> the previous version with the 2 w:add-lines and without tabbar-code
FW> works fine.
FW> with tabbar, i see the tabbar, not the client of the first tab (ls), the
FW> client-area is grey. if i switch the the tab to the second, the tabbar
FW> dissapears and i see only client of second tab (bookmarks) and can't
FW> switch back.

I see the same.
IMHO I understood where is the problem.
Scripts using windows, panels and toolbars gui.dll cannot be connected dynamically.
It is impossible to use command "dofile my_gui_script.lua". :(
That's why all scripts need to be placed only in SciTEStartup.lua. :(
For panels it is necessary to use only global variables.
It's a pity that we have to see panels constantly. :(
Commands "my_panel:show()" and "my_panel:hide()" did not work: (
Only commands "my_window:show()" and "my_window:hide()" work but I want to use panel instead of window.
That's I'm calling bugs.
I might be wrong but I cannot work in this way.

--
mozers
<http://code.google.com/p/scite-ru/>

mozers

unread,
Aug 25, 2008, 8:14:45 AM8/25/08
to Frank Wunderlich
Saturday, August 23, 2008, 12:48:34 AM, Frank wrote:

> i changed funcProcList from SciteRu a little bit to work with Scite-GUI.
> maybe its useful for anybody:

Please see my edition.
http://mozers.net.ru/scite/FuncProcList_GUI.lua
Works with the original SciTE and SciTE-Ru.

--
mozers
<http://code.google.com/p/scite-ru/>

Frank

unread,
Aug 26, 2008, 11:58:54 AM8/26/08
to scite-interest
i think the version with onKey not very good because you have to press
another key to make the linechange visible...
i see also that there was an old/wrong regex for the pas-match-string
(pPff should be pPfF)

i have now included the handling of bookmarks_clearAll, which was also
not recognized by the old script

my functions-list is now sorted by name, the only thing i can't get
working is the replacement (look for replaceRegExp/replacePattern in
my code) of procedure by [p] and function by [f] and adding result-
type (in delphi after : ) in additional column

tabs also not working now :(

for developer of Scite-GUI:
- scite crashes on doubleclick (with handler) if nothing is marked in
the list before
- can buttons be added? i found nothing in the dokumenation...

here my current configuration:

require("gui")

local my_panel_width=150



local w = gui.panel(my_panel_width)

local ls = gui.list(true)

local bookmarks = gui.list()



gui.set_panel(w,"right")

ls:size(100,100)

ls:add_column("Functions / Procedures", my_panel_width-2)



w:add(bookmarks,"top",150)

-- w:add(ls,"top",300)



w:client(ls)



-- tabs

-- t = gui.tabbar(w)

-- t:add_tab("column list",ls)

-- t:add_tab("bookmarks",bookmarks)

-- t:on_select(function(idx)

-- print('tab',idx)

-- end)

-- w:client(t)



-- end tabs



w:show()



local old_OnCommand = OnCommand

function OnCommand (id)

if old_OnCommand then result = old_OnCommand(id) end

if id == IDM_BOOKMARK_CLEARALL then

print('clear all bookmarks')

for i = bookmarks:count()-1,0,-1 do

local pos = bookmarks:get_item_data(i)

if pos then

if (pos[1]==props['FilePath']) then

bookmarks:delete_item(i)

end

end

end

elseif id == IDM_BOOKMARK_TOGGLE then

local line = editor:GetCurLine()

line = string.gsub(line,"%c*","")

line = string.gsub(line,"^%s*","")

-- is this line already in the list?

local inserting = true

for i = 0,bookmarks:count() - 1 do

if bookmarks:get_item_text(i) == line then

bookmarks:delete_item(i)

inserting = false

break

end

end

if inserting then

local lno = editor:LineFromPosition(editor.CurrentPos)

bookmarks:add_item(line,{props['FilePath'],lno})

end

end

end



bookmarks:on_double_click(function(idx)

local pos = bookmarks:get_item_data(idx)

--gui.message(pos[2])

if pos then

scite.Open(pos[1])

editor:GotoLine(pos[2])

editor.Focus=true

end

end)



local findRegExp = {

--~ ['cxx']="\n[^,.<>=\n]-([^%s,.<>=\n]+[(][^.<>=\n)]-[)])%s-%b{}",

['cxx']="([^.,<>=\n]-[ :][^.,<>=\n%s]+[(][^.<>=)]-[)])[%s\/}]-%b{}",

['h']="([^.,<>=\n]-[ :][^.,<>=\n%s]+[(][^.<>=)]-[)])[%s\/}]-%b{}",

['js']="(\n[^,<>\n]-function[^(]-%b())[^{]-%b{}",

['vbs']="(\n[SsFf][Uu][BbNn][^\r]-)\r",

['css']="([%w.#-_]+)[%s}]-%b{}",

--['pas']="\n[PpFf][RrUu][OoNn][Cc][EeTt][DdIi][UuOo][RrNn][^ ]*
([^(]*%b()[;:])",

--['pas']="\n[PpFf][RrUu][OoNn][Cc][EeTt][DdIi][UuOo][RrNn][^ ]*
([^(]*%b()[:]?%a*)",

['pas']="\n([pPfF][rRuU][oOnN][cC][eEtT][dDiI][uUoO][rRnN].-%b().-)
\n",

['py']="\n%s-([dc][el][fa]%s-.-):"

}



local replaceRegExp = {

['pas']={

['[pP][rR][oO][cC][eE][dD][uU][rR][eE]']="[p]",

['[fF][uU][nN][cC][tT][iI][oO][nN]']="[f]"

}

}



local lc --linecount used for funcproclist



local oldOnChar = OnChar

function OnChar(c)

if oldOnChar then oldOnChar(c) end

-- checking for different linecount and call listprocedures again

if (editor.LineCount ~= lc) then

ListProcedures()

lc=editor.LineCount

end

end;



local oldOnOpen = OnOpen

function OnOpen(file)

if oldOnOpen then oldOnOpen(file) end

lc=editor.LineCount

ListProcedures()

end;



local oldOnSwitchFile = OnSwitchFile

function OnSwitchFile(file)

if oldOnSwitchFile then oldOnSwitchFile(file) end

lc=editor.LineCount

ListProcedures()

end



ls:on_double_click(function(idx)

local pos = ls:get_item_data(idx)

--gui.message(pos[2])

if pos then

scite.Open(pos[1])

editor:GotoLine(pos[2])

editor.Focus=true

end

end)



function ListProcedures()

local t = {}

if ls then

c=ls:count()-1;

for i=c,0,-1 do

ls:delete_item(0)

end;

end

local textAll = editor:GetText()

local findPattern = findRegExp [props["FileExt"]]

if findPattern == nil then

findPattern = "\n[local ]*[SsFf][Uu][BbNn][^ ]* ([^(]*%b())"

end

local replacePattern = replaceRegExp [props["FileExt"]]



local count=0

while true do

startPos, endPos, findString = string.find(textAll, findPattern,
startPos)

if startPos == nil then break end



findString = string.gsub (findString, "\r\n", "")

findString = string.gsub (findString, "%s+", " ")



if not IsComment(startPos) then

local line = editor:LineFromPosition(startPos)

if replacePattern~=nil then

-- for s,r in replacePattern do

-- string.gsub (line, s, r)

-- end

-- table.foreach(replacePattern,line.gsub)

-- local t[#t + 1]= {}

end

local st={}

t[#t + 1] ={findString,props['FilePath'],line}

count = count + 1

end

startPos = endPos + 1

end

scite.MenuCommand(IDM_CLEAROUTPUT)

table.sort(t,function(a,b) return
string.upper(a[1])<string.upper(b[1]) end)

if ls then

table.foreach(t,function(i,val) ls:add_item(val[1],
{val[2],val[3]}) end)

else

table.foreach(t,function(i,val) print(val[2]..':'..(val[3]+1)..':
\t'..val[1]) end)

end

if not ls then

if count > 0 then

trace("> found "..count.." functions/procedures")

else

trace("> nothing found!")

end

end

end


whats the current state of the IDM_BOOKMARK_TOGGLE-Issue in SciteRu?

regards Frank

mozers

unread,
Aug 28, 2008, 4:44:48 AM8/28/08
to Frank
Tuesday, August 26, 2008, 7:58:54 PM, Frank wrote:
> whats the current state of the IDM_BOOKMARK_TOGGLE-Issue in SciteRu?


Try it two useful scripts:

http://mozers.net.ru/scite/FileManager.lua works with original SciTE and SciTE-Ru.
Steve Donovan could use it as an example in a gui-ext.

http://mozers.net.ru/scite/FileManagerRu.lua works only on the latest version SciTE-Ru and traces any switching bookmarks with OnSendEditor function.

--
mozers
<http://code.google.com/p/scite-ru/>

instanton

unread,
Aug 29, 2008, 5:54:05 PM8/29/08
to scite-interest
Is it possible to localize context menu items in FileManager.lua via scite.GetTranslation? I tried to do so but it seems that
 
 
my_panel:context_menu {
 'scite.GetTranslation(Show all files)|all_files',
 'scite.GetTranslation(Only current ext)|current_ext',
}
will only print the context menu items verbally as "scite.GetTranslation(Show all files)" and "scite.GetTranslation(Only current ext)" respectively.
 
 
instanton,soft_...@126.com
2008-08-30
----- Original Message -----
From: mozers
To: Frank
Sent: 2008-08-28, 16:44:48
Subject: [scite] Re: SciTE-GUI: GUI Extensions for SciTE Lua

mozers

unread,
Aug 30, 2008, 3:36:06 AM8/30/08
to instanton
Saturday, August 30, 2008, 1:54:05 AM, instanton wrote:
> Is it possible to localize context menu items in FileManager.lua
> via scite.GetTranslation?

Yes.

my_panel:context_menu {
scite.GetTranslation('Show all files')..'|all_files',
scite.GetTranslation('Only current ext')..'|current_ext',
}

--
mozers
<http://code.google.com/p/scite-ru/>

Frank Wunderlich

unread,
Aug 30, 2008, 7:03:36 PM8/30/08
to scite-i...@googlegroups.com
Hi Steve,
i've reworked your bookmarkcode with some help from mozers, so that some
special cases also catched. the only thing i currently can't solve is
that the marker is not deleted when the text is deleted, but this seems
a scintilla-"bug" (extra-thread).

problems with your code:
- line-positions are not updated (if bookmarks moved by
line-adding/deleting)
- bookmarks are not deleted if file is closed

i have my code attached, because there are some events catched, simply
add gui_conf2.luad with dofile to your startup-script (gui_functions.lua
is loaded from there).

hope its useful for anybody

scite-GUI is very useful for me, but some suggestions
is there a possibility to make the tabs multiline and
change font to a smaller one?
can you implement a method to change existing list-items? currently i
delete and insert them :)
also buttons/checkboxes/radiobuttons/labels would be useful for me, and
i think its not difficult to add them (and splitter needed, only a
onclick-handler)
can memo switched to single-line?

btw.
your panel-in-tabpage-example helps me a lot, but i wonder about this line:

panel:client(w)

w is the panel on the tabpage, why is it aligned to client on the
side-panel? the parent is the tabpage and not the side-panel...
*confused* but without this line, the tab is empty. it takes me a lot of
time to get it working by found your code :( this line was the one i missed

but again, many thanks for this extension :)

regards Frank

gui_functions.lua
gui_conf2.lua

Frank

unread,
Sep 4, 2008, 9:26:08 AM9/4/08
to scite-interest
Hi Steve,
i've tried to compile it with mingw32-make. after fixing some missing
units (lua-headers), the dll is created, but if i replace my working
(compiled by you) dll with the new one scite gives me the following
error:

error loading module 'gui' from file '.\gui.dll':
Die angegebene Prozedur wurde nicht gefunden. (the requested
procedure was not found)

>Lua: error occurred while loading startup script

any hints?

regards Frank

On 12 Aug., 13:20, SteveD <steve.j.dono...@gmail.com> wrote:
> >http://mysite.mweb.co.za/residents/sdonovan/SciTE/gui_ext.zip
>
> This fresh version brings two things to the party:
>  - it can be built using MinGW - there is a makefile. This mostly
> involved bringing some old C++ code into the 21st century.
>  - it has a lot more API checks, so it is less likely to crash SciTE.

Frank Wunderlich

unread,
Sep 4, 2008, 9:53:06 AM9/4/08
to scite-i...@googlegroups.com
I've tried to define a new window to call this by menucommand.

gui_conf2.lua:
require("gui")
win_parent = gui.window "Side Bar"
local text_path = gui.memo()
win_parent:client(text_path)

SciteUser.properties:
command.name.42.*=TestWindow
command.42.*=win_parent.show
command.mode.42.*=subsystem:lua,savebefore:no
#- command.shortcut.42.*=Alt+Shift+F

also tried with "win_parent.show()", but the window is not shown if the
menuentry is clicked, no error appers on the output pane.

what's wrong with my code?

regards Frank

mozers

unread,
Sep 4, 2008, 3:41:14 PM9/4/08
to Frank Wunderlich
Thursday, September 4, 2008, 5:53:06 PM, Frank wrote:

> I've tried to define a new window to call this by menucommand.

> what's wrong with my code?

This:
> command.42.*=win_parent.show

Correct:
command.42.*=dostring win_parent:show()

--
mozers
<http://code.google.com/p/scite-ru/>

Message has been deleted

Frank

unread,
Sep 4, 2008, 4:05:49 PM9/4/08
to scite-interest
> Correct:
> command.42.*=dostring win_parent:show()

thanks, it works
i had a problem with a "not a window"-message, but thats my fault
(using . instead of : before show)

btw. @mozers: you have a function to show hide the side-panel, but the
panel is not hidden till i click on it...maybe a refreshing problem.
is it working for you?
a useful thing were.if a tools-menuitem can be checked, so we need
only one menuitem to show/hide.

regards Frank

mozers

unread,
Sep 5, 2008, 6:38:49 AM9/5/08
to Frank
Friday, September 5, 2008, 12:05:49 AM, Frank wrote:

> btw. @mozers: you have a function to show hide the side-panel, but the
> panel is not hidden till i click on it...maybe a refreshing problem.
> is it working for you?
> a useful thing were.if a tools-menuitem can be checked, so we need
> only one menuitem to show/hide.

win:show() and win:hide() only worked for the window.
They do not work for panel.

Panel can be hidden my_panel:size(0,0).
Then you can restore the previous size.

There is no possibility to check the current state of the window or panel.

File http://mozers.net.ru/scite/ext-gui.lua I frequently updated.
In it not only what have. There also that what we wish.

--
mozers
<http://code.google.com/p/scite-ru/>

Frank Wunderlich

unread,
Sep 5, 2008, 6:46:33 AM9/5/08
to scite-i...@googlegroups.com
mozers, 05.09.2008 12:38:

> win:show() and win:hide() only worked for the window.
> They do not work for panel.
>
> Panel can be hidden my_panel:size(0,0).
> Then you can restore the previous size.
>

i use your code with size() to hide the panel, but it's not hidden in
that moment...i have to click on it, then it's hidden.

function SideBar_hide()
pnl_main:size(0, 0)
end

command.name.44.*=SideBar verstecken
command.44.*=SideBar_hide
command.mode.44.*=subsystem:lua,savebefore:no

regards Frank

mozers

unread,
Sep 5, 2008, 7:08:27 AM9/5/08
to Frank Wunderlich
Friday, September 5, 2008, 2:46:33 PM, Frank wrote:

Yes.
It works only after updating a editor's window.
I use scite.Perform("reloadproperties:") to force window update.
This is very rough decision. It is possible to find a more neutral command or ask Steve that he corrected it.

--
mozers
<http://code.google.com/p/scite-ru/>

SteveD

unread,
Sep 9, 2008, 5:24:15 AM9/9/08
to scite-interest
On Aug 31, 1:03 am, Frank Wunderlich <frank.wunderl...@gmail.com>
wrote:
> i have my code attached, because there are some events catched, simply
> add gui_conf2.luad with dofile to your startup-script (gui_functions.lua
> is loaded from there).
>
> hope its useful for anybody

Sorry for the silence, I was away for two weeks. I haven't found a new
toy!

Excellent, I shall look at it - I do want to give a good set of new
examples for the next release.

> scite-GUI is very useful for me, but some suggestions
> is there a possibility to make the tabs multiline and
> change font to a smaller one?

This can be done, and it will be possible with the next release.

> can you implement a method to change existing list-items? currently i
> delete and insert them :)

AFAIK that seems to be the standard method of doing this - could add a
fake method which does this under the hood.

> also buttons/checkboxes/radiobuttons/labels would be useful for me, and
> i think its not difficult to add them (and splitter needed, only a
> onclick-handler)

The question is whether we should wrap all the basic controls, so
people can use them as they see fit.

> can memo switched to single-line?

That's reasonable

> panel:client(w)
>
> w is the panel on the tabpage, why is it aligned to client on the
> side-panel? the parent is the tabpage and not the side-panel...

The client call is necessary when using a tabpage, which is not a
container, but a set of clickable labels. This call just sets it up
initially, thereafter clicking the tabs causes a client call
internally.

> but again, many thanks for this extension :)

My pleasure. I'm glad that people find it useful.

steve d.

phayz

unread,
Sep 18, 2008, 6:31:39 PM9/18/08
to scite-interest
On Aug 4, 9:33 pm, SteveD <steve.j.dono...@gmail.com> wrote:
> SciTE-GUIis a binary extension for SciTE Lua written in C++ which
> gives Lua scripts the ability to interact with the user with GUI
> elements like lists, file and colour dialogs, message boxes, prompt
> for string, etc.  It also provides a few useful utility functions like
> gui.run(), which can launch an arbitrary program or document without
> blocking, etc. There's an example showing a context-sensitive floating
> toolbar, as previously promised.
>
> It's possible to attach these GUI elements to the main frame of SciTE
> itself:
>
> http://mysite.mweb.co.za/residents/sdonovan/SciTE/scite.png
>
> (Note well that this required _no changes_ to SciTE itself; it is all
> done with window subclassing voodoo.)
>
> Here is the documentation, source and binary dll (MSVC6):
>
> http://mysite.mweb.co.za/residents/sdonovan/SciTE/gui_ext.zip
>
> Put gui.dll next to your SciTE.exe and call require("gui") in your
> scripts; things should then just work.
>
> Most of the C++ is quite old and sloppy (it is based on a library I
> wrote when I was young and foolish, plus VC6 is very tolerant) but I
> hope to have a mingw buildable version out soon.
>
> steve d.

Ummm... I'm a noobie when it comes to SciTE, Lua etc and I simply
don't understand how I use SciTE-GUI. It looks like a *very*
interesting addition to SciTE (which I already love).

Here's what I do understand -

To use SciTE-GUI requires that you have the associated DLL - gui.dll I
believe - in the same folder as the SciTE executable;
SciTE-GUI works only on Windows ( :( ) I run Linux at home and would
*love* to see a Linux-compatible version of SciTE-GUI;
SciTE-GUI involves "running" Lua programs.

That's the some total of my knowledge! :( Can someone please tell me
in idiots English how I get a sample SciTE-GUI program working?


Yours in admiration of SciTE and SciTE-GUI.

Pascal Guimier

unread,
Jan 19, 2016, 11:46:53 AM1/19/16
to scite-interest, russelld...@gmail.com
Is there any news on this project and portage to gtk, seven years later ?
It would be nice !
:)
Pascal

Gavin Holt

unread,
May 5, 2016, 6:39:00 AM5/5/16
to scite-interest, russelld...@gmail.com
Dear Steve

I am very grateful for this little addition to sciTE for windows. Using the examples I have a minimalist file manager side panel - not a separate window. I have a few problems:

1. "There are some irritating repaint problems with the side panel splitter." - from your help page - any chance of a fix?

2. I have tried mypanel:size(0,0) and gui.panel() to close the panel and this seems to run into the same repaint problem (if I resize my window the panel does then minimize). Is there any way of completely removing the panel?

3. Some of my folders have many files - any way to add a vertical scroll bar?

4. Lastly in (an ideal world) I would like to specify foreground, background, selected.fore and selected.back colours so the side panel matches my colour scheme. 

Kind Regards

Gavin

Thorsten Kani

unread,
Jul 16, 2016, 1:36:59 PM7/16/16
to scite-interest
Very interesting as ive seen sidebars in othet forks of scite. This one would be a nice approach.

Am Montag, 4. August 2008 13:33:19 UTC+2 schrieb SteveD:
SciTE-GUI is a binary extension for SciTE Lua written in C++ which

Gavin Holt

unread,
Nov 18, 2016, 4:29:07 AM11/18/16
to scite-interest, russelld...@gmail.com
Hi

I found a newer version with a modification of your code to provide new functionality including the ability to close the panel:

https://github.com/Konctantin/scite-ru

Reviewing the code there is a new check for the gui.set_panel() function with no arguments - which closes it!

if (! lua_isuserdata(L,1) && extra_window != NULL) {
extra_window->hide();
extra_window = NULL;
extra_window_splitter->close();
delete extra_window_splitter;
extra_window_splitter = NULL;
shake_scite_descendants();

My major problem is solved.

Kind Regards

Gavin
Reply all
Reply to author
Forward
0 new messages