Hi Rene,
I was actually thinking about opposite direction for thinICE - to render only when you attempt to change something on screen. It could save up GPU resources and improve battery time on notebooks. What do you think about it?
Petr
Printable View
Hi Rene,
I was actually thinking about opposite direction for thinICE - to render only when you attempt to change something on screen. It could save up GPU resources and improve battery time on notebooks. What do you think about it?
Petr
In general you are right. I'll think about how to achieve.
Done. I changed thinICE only to render a new frame if something changes.
Also added by Eros announced future hex-expression like "0x0000abc" to syntax-highlight as numbers already.
You are the best!
Yes, Petr is right: you are the best!
In order to test thinBasic speed, I use thinICE and load thinICE.tBasic inside the editor.
It is really a complex task because it scan thinICE source and all included files!
A lot of work.
I was getting mad why scanning was a bit slow and discovered that you are drawing UI interface every 32l microseconds that means every 30 or so times per seconds inside CodeRefresh_Click function
I changed it to have UI drawn every 100000 microseconds so it will be drawn around 10 times per seconds.
Loading of source and tokenizing all is much much quicker now :)
Another think that let the application seems to work much faster is mouse middle wheel scrolling.Code:If qTime < HiResTimer_Get - 100000 Then '---From -32000 to -100000
' redraw window to show progress
ui.orderinfront(GetAt(pb))
qTime = HiResTimer_Get
Ui.DrawFrame()
EndIf
To me default scrolling of one line it TOOOO much slow letting the user the impression code window scrolling is slow.
Instead it is really fast.
It should have default scroll like CTRL + Scroll.
A personal idea: you have done more than HUGE work on this source code library.
It could be used by others for their TBGL script like TBGL UI.
As you have mentioned, maybe UI can be extracted from the code editor and become a UI lib able to be be used by other in a simple way hiding all the code editor needs.
Maybe some examples not based on a code editor but to some basic TBGL needs can help.
Just an idea in order to take the change to use your great work.
Ciao
Eros
tUI can be used away from thinICE already. Therefor i included 2 testprojects showing how to create and use controls. Only thing that currently mixes is Settings.tBasicU because it holds colors for syntax highlighting.
The other stuff as timing rendering of progressbar i will check tomorrow when I'm at home.
Pvp (posted via phone) :D
Huu, sorry, just got examples: UI_3DTEMPLATE.tbasic
Maybe a better file organization with all sources of UI library in one subdir and only main examples in main dir could simplify user comprehension of the lib.
Anyway WOW
OK, i did...
tUI now all with what belongs to it in one seperate subfolder, named tUI...
timing in CodeRefresh_Click() changed as suggested above
Color-Settings now divided:
tUI-colors user-defineable now in App_Inifile for each app seperate,
the colors for syntax-highlight are part of the codefield-control now
(check initial tControl_Codefield.TextSet() to edit syntax-colors as you like)
The main-folder of the DOWNLOAD now contains
thinICE.tBasic
+ included units (tKeyword, tScript)
+ specialized tUI-controls (tControl_Codefield & tControl_Autocomplete)
+ subfolder \PT_Mono that contains the monospaced font i used for thinICE
testproject_007.tBasic & testproject_009.tBasic
that basically show how to use tUI-controls, menus & timers
i will add more of these in future.
UI_Template.tBasic
provides a template to start a new tUI-project
i will add more of these, providing different ways of main-loop
UI_3dTemplate.tBasic
+ included unit (tScene)
demonstrates how to combine tUI and TBGL-3d-scenes.
Subfolder \tUI
contains everything of my TBGL-UI. To use it just
Code:#INCLUDE Once "tUI\tUI.tBasicU"
Autocomplete (thinICE) now also knows & suggests local variables inside functions.
See attached images.
Some more speed gained in CodeRefresh_Click
(it was not necessary to order the progressbar in front each time a frame gets drawn)
for tUI:
re-odered once more and added 2 more tUI-templates.
re-named testscripts to be "UI_Samples"
added example tControl_Box (window-alike container) to the second sample-script
Still not done, I'm unsure about the speed.
but you can have this, go to
tControl_Codefield.InputMouse()
go to line 2220:
originally:
for very fast scrolling (100 lines)Code:Me.FirstLine = MinMax(Me.FirstLine - Mouse.Wheel * Pow(10, Keyboard.lShift), 1, HEAP_Size(Me.pText)/4 - Me.Pageheight + 1)
you can change this to:
for medium speed (10 lines) which I'd prefer:Code:Me.FirstLine = MinMax(Me.FirstLine - Mouse.Wheel * Pow(10, Keyboard.lShift Xor Keyboard.CTRLKey), 1, HEAP_Size(Me.pText)/4 - Me.Pageheight + 1)
Code:Me.FirstLine = MinMax(Me.FirstLine - Mouse.Wheel * Pow(10, Keyboard.lShift Xor Keyboard.ShiftKey), 1, HEAP_Size(Me.pText)/4 - Me.Pageheight + 1)