PDA

View Full Version : [preview] thinICE



ReneMiner
18-11-2015, 20:32
thinICE

Inconvenient Coding Environment
for
thinBasic written in thinBasic

#MINVERSION 1.9.16.16 !!!

Default it creates a new, empty script because there was none to load...
The filename to save you can write somewhere into the script as a comment like


' #FILENAME "myScript.tBasic"

then right-click into codefield to choose actions as "Save as ...".

If you want to include more files, just write something like


#Include "myNewUnit.tBasicU"

and Tokenize again (CTRL-T or right-click the CodeTree) or select existing units in the bottom list on "Explorer"-Tab to include them to your current script. (insert "ONCE" if desired)

If you save a new project you may create a new folder for this (right-click into pathview) and/or select an existing path here before you exit.


• expand Nodes on a tree using the middle mouse-button,
• use mouse-wheel to scroll on anything, hold Shift|CTRL|Menu-key to change scroll-speed

Check out the Tabstrip on the left of the editor:

• see all your "Code" listed in a codetree that tells you all about your projects structure
• you'll have a "Globals" tree that tells you all about used modules, global variables & constants
• "Explorer" that allows you to (re-)load projects or to include files to your project at the current codeline
The pathview on explorer-tab shows by default this projects folder,
if you load thinIce.tBasic itself it'll take a while like 10 to 20 seconds.
Smaller projects without this many units will load faster and work faster
- since tUI will create more than 260 controls to handle thinICE within itself.
• set thinICE-"Options" as you like
• "Help" will provide you with important information about thinICE
and allow to access all with thinBasic shipped helpfiles

advice: study "Help" before you start, it's not that much...

• F11-key to toggle the size of Tab-Area or use the splitbar right aligned at Tab-area
• F12-key or double-click {into empty area | onto statusbar} to toggle the window-size to 90% of the screen
• see { first attached image | Help\Codewindows\Shortcuts } for a shortcuts-overview

try out the Autocomplete-feature when you type into a code-window:

• Use Arrow-keys (up/down)
• Tab-key to insert and to continue on the same line
• Return-key if want to continue to write on the next line
• or use mouse

click onto line-numbers of codefields to
• toggle breakpoints
• duplicate current line (CTRL+D)
• insert code-blocks



Careful:

when running thinICE.tBasic from thinAir
If you have any scripts open in thinAir that you already changed using thinICE before
- close these scripts in thinAir before launching any scripts again
- else thinAir will overwrite your changes

Check out the TBGL-UI-Project behind the curtain and have a look at the sample-scripts.
To use tUI you can use one of the templates to get started.

Have fun, keep on coding.

Updated regularly

ErosOlmi
18-11-2015, 21:45
I will check better next day looking at the source but looking at images ... what a f..uck!
Wow, incredible work you have done.

Petr Schreiber
18-11-2015, 22:28
Yes, exactly my reaction :)

Rene is silent for a while and then... whoa :) Miracles happen.

I like the code completion / code whisperer, how it reduces the options in real time without problem.

There is just a minor functionality problem with using arrow keys on my PC, but it could be something rare. I am investigating...


Petr

ErosOlmi
18-11-2015, 22:49
I'm checking a little your code.
I'm astonished Renι, really impressed to what level you have taken thinBasic sources.

I feel a little guilty not being able to give you more execution speed. A so complex code for an interpreter is a real challenge.
I will study better your sources in order to see if I can get you more speed in creating new native thinBasic features.
Your code is a mine of discovery.

ReneMiner
20-11-2015, 14:45
...

I will study better your sources in order to see if I can get you more speed in creating new native thinBasic features.
...


one thing you'll find very often is something as this:



' some array of something stored at heap-memory like:
Dword pArray = Heap_AllocByStr(MKL$(1, 2, 3, 4,...))



Local vVariable As Long At pArray ' place a virtual variable of fitting type onto first position

If GetAt(vVariable) Then
' ( = if Heap exists at all )

While GetAt(vVariable) <= Heap_End(pArray)
' ( = For Each vVariable In Heap_Memory(pArray) )

'<<< iterateCount = 1 + (pArray - GetAt(vVariable)) / SizeOf(vVariable) >>>

' do something with vVariable

' always last before Wend: move the surfing variable onto next element:

SetAt( vVariable, GetAt(vVariable) + SizeOf(vVariable) )
Wend
' ( = Next )
EndIf


this does not require any local variables allocation all is virtual - as you see even the iterate-count can be calculated if desired quite simple.

For the always repeating line in the end of all these while-wend-loops


SetAt( vVariable, GetAt(vVariable) + SizeOf(vVariable) )


i tried to create a Sub SetAtNext - but it sadly does not work this way because it does not affect a virtual variable of another function:



Sub SetAtNext(ByRef v)

SetAt( v, GetAt(v) + SizeOf(v) )

End Sub

but maybe thinBasic can make it possible...

For the speed: i wait for upcoming tokenizer-class - i hope it makes it possible to store information on user-tokens ( space for a Dword/Ptr would serve).

Petr Schreiber
20-11-2015, 15:02
Hi Rene,

could you please adjust the settings so pressing Home will goto beginning of line and End to end of line? I am using it very much when editing and now it takes me to beginning/end of the file :)
I also wanted to ask what is the correct keyboard shortcut to use code completion - I choose something via arrows, but when I press Enter, it also creates new line, which is not what I need.


Petr

ReneMiner
20-11-2015, 15:21
to insert and continue on same line use TAB-Key ;)

regarding Home/End for autocomplete: both work as PageUp, PageDown also do and affect the autocomplete only but not the codewindow.
Or did I get you wrong?

Petr Schreiber
20-11-2015, 15:38
Thanks for the TAB tip, works great :)

The note regarding Home/End is not related to autocomplete - it is related to general editing. For example, I am writing this and want to add #1 at the beginning of line. In thinAir, I just press Home and it takes me to first character in line. In thinIce, it makes the cursor jump to the beginning of file.


Petr

ReneMiner
20-11-2015, 15:59
I changed something - so you can use %VK_Left or %VK_Right when you hold CTRL and it will jump to start or end of current codeline for the meantime.

Check the attachement on first post of thread (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92308#top).

Also with the updated download:

Revealing another secret : this is 2 projects: TBGL-UI and thinICE as first project that makes use of my TBGL-UI.

So for the nosy ones there are included some test-projects that demonstrate (test) a few controls and some empty UI_Template to get started very quickly.

UI is not completed by now.
Do not use the tControl_Textfield unless for display- i paid currently more attention on the codefield. Also the tControl_ListPopup is just a study when i developed the autocomplete-control which is - as the codefield - a specialized control for the thinICE-project.

@Eros, have a look at post #5 (above) please
http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92304&viewfull=1#post92304

ReneMiner
21-11-2015, 19:25
a new improved version, click here for the download (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281#post92281).

Some new controls added as a simple progressbar so it seems not that frozen when loading,
new features as Find & Replace,
CTRL+Left/Right, Home/End in codefields now work the same way as in thinAir
CTRL+Up/Down will place the cursor at the start of the next function/sub/callback

clicking a file in the includes-list (bottom of explorer-tab) will add this file to the project by
inserting it into the current codewindow.
If the file is not located on an included path nor at the standard-locations as thinBasic-installpath nor thinBasic\Inc then it will get copied to the projects mainfiles sourcepath.
and a little more finetuning. Forgot what it was :comp5:

have fun

Petr Schreiber
21-11-2015, 23:46
Perfect, thank you :)

ReneMiner
23-11-2015, 13:54
new version!

latest features:

Autocomplete now also detects local & global udts and the types they extend - so autocomplete will show you a list of all properties of the currently typed variable if its an udt that is part of the project, so if you type the dot you'll have them all present.

Autocomplete now gives you list of all possible global variables, functionnames and declarations.

For new Globals, Functions, UDTs & Const to appear in the list you'll have to refresh the codetree for the script where you added them.

Local variables will get detected on the fly.

as usual download here (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281#post92281)

Petr Schreiber
23-11-2015, 15:31
What kind of magic is this :excited:

Well done, Rene! It works great!

If I may, now I would like to create new file and save it under name I specify somehow - then I can use it for daily work :)


Petr

ReneMiner
23-11-2015, 16:11
What kind of magic is this :excited:

the magic of thinBasic :)

well, the idea was to have thinICE as a thinAIR-utility- to work with a previously selected file/project,

i wanted help & execute( F5 )/debug( F8 ), bundle etc. still to be done via thinAIR

the current possibility to load a new project (*.tBasic or *.tBasicC-file) is just because thinAir-utilities-ability still under construction.

There is some bug that makes thinICE crash when loading another project sometimes - not always, still investigating why. It was not intended to work with more than 1 project at the same time but was a good practice to clean up
allocated memory.

At the moment you may delete the USER\FILE-key in thinAir.ini to have a new, empty project on startup.
change the commented line


' #Filename "here_your_filename.tBasic"

before you save (CTRL+S or on Exit).
Make sure all needed #Include-files are in place/ select the appropriate path in pathview-tree

Copy & Paste desired code into the window and refresh the code-tree.

still brainstorming about Undo/Redo...

ReneMiner
23-11-2015, 23:20
for latest version, see first page,
#Minversion 1.9.16.4

I changed to skip the initial load of the last file, so you now always can start a new project

Also - if you create a new folder in the explorer-pathview (right-click) it will be automatic your projects folder
if the file has no filename yet it will scan the code for a comment as


' #Filename "myProject.tBasic"


a new shortcut: CTRL+T in codewindow to tokenize the currently edited scriptunit
= refresh vartree and the current branch of the codetree.

1 unit of code less now- because don't need no own Invert-drawing-function any more. TBGL now has
TBGL_PushLogicOp...

Petr Schreiber
24-11-2015, 19:34
Great,

CTRL-T is nice helper - and I just discovered F12, very nice for "focus coding"!


Petr

ReneMiner
25-11-2015, 00:34
I tinkered aound a little bit.

+
you may rightclick into codefield now and select "Save As..."
but to enter the filename you have to enter it in the codewinow as


' #filename "myNewName.tBasic"


If the file you save with another name is an included unit, then the filename will be updated in all projects scripts that refer to it.

+
Right-click into codewindow to select another font-size

+
rightclick the pathview in explorer-tab :
you may create a subfolder to the currently selected folder
and you can move your whole project to a selected folder.

The Selected path gets displayed in the pathview-tooltip and is highlighted: red.
The currents APP_Sourcepath is highlighted now in pathview too: green.

To create additional units, just write something as


#Include [Once] "myNewUnit.tBasicU"

and refresh the code-tree (ctrl+T)
If "myNewUnit.tBasicU" does not exist it will get created, else it'll get loaded if found.

You also can select an existing unit from the include-list at the bottom on explorer-tab. It will be inserted at Cursorposition of current script. Add "ONCE" manually if desired.


A list of keyboard shortcuts you can find in help-tab about codewindow.

+ thinICE is now aware of Alias-names :)

Michael Hartlef
26-11-2015, 15:42
Avira blocks TBGL_Requester.exe. It says something about HEUR/APC (Cloud) virus.

ReneMiner
26-11-2015, 16:30
Hi Michael,
you might skip the requester by substituting the path of thinICE with the inifile below



[thinBasic]
InstallPath=C:\thinBasic\
[Keyboard]
Layout=Keyboard_Deutsch.ini
[Window]
Fullscreen= 0
Width= 1024
Height= 768
Depth= 32


save as thinICE.Ini at the scriptpath

there are 4 keyboard-layouts currently, select the one you need if not Deutsch

Keyboard_Czech.ini
Keyboard_EnglishUS.ini
Keyboard_Francais.ini

Michael Hartlef
26-11-2015, 17:39
Have to figure out first how to use it. I thought it was an extention/plugin for the IDE.

ReneMiner
26-11-2015, 17:49
No- do not run the requester- it gets started by thinICE only if no settings available.

just run thinIce.tBasic from thinAir :)

ReneMiner
26-11-2015, 21:10
Latest:

Undo/Redo implemented. (CTRL+ Z/CTRL+W)

Up to 50 steps per codewindow...

if you want more then change the setting UndoMax in thinICE.ini to your desired number of possible undo.

Powered by ZLib :D

ReneMiner
27-11-2015, 19:56
A few more tweaks,

+
at codewindows you can read now where exactly you are typing into - if within a function, declarations-section or type-definition...

+
i don't know... bug fixes, tuning....



as usual find the download at first post (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE) of this thread.

ReneMiner
29-11-2015, 15:44
Help implemented. You can access all thinBasic & thinBasic-User-help-files.

Point a keyword in current codewindow and press F1 for help on that keyword.

Also works without to point if cursorposition is within a keyword
(but don't point with the mouse into codewindow in that case)

Sad news:
in order to work correct there's no more fullscreen-mode-toggle via F12,
but a maximize-button at the TBGL-window now

+ improved Textview-control to automatic wrap if textview-size changes
+ added save on exit via window-closebutton

ReneMiner
01-12-2015, 22:40
latest changes:

no more window-close-box nor maximize-buttons

F12 toggles window-size now to almost fullscreen & back to normal,
exit only on esc-key

some fixes & makeover, pointed tokens get highlighted so now you know what you pressed the help (f1) for.

As always, see post #1 of this thread (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE#top) for the download

ErosOlmi
02-12-2015, 12:47
I feel embarrassed not having in thinAir similar features.
Maybe because I do not use Tokenizer module to scan sources but an ancient method.

I will stole some code from your sources ;)
You have done a wonderful job.

ReneMiner
02-12-2015, 14:45
mentioning thinAir:

maybe you can fix the thinAir-GUI-crashes with a workaround.

It happens on these actions:
• via click on the filename-tabs above client area
• click on a file in explorer
• when double-click some #Include in codetree.

Not always but within seconds if you like to try: Load a few script-units like 10 or more, keep the codewindows maximized
switch between them, using one of the methods above. you won't need more than 2 minutes until thinAir will crash.

suggested Fix/Workaround:
Close all other codewindows while one codewindow within client-area is maximized
(do not unload the code)
Do not resize (normalize & maximize again as currently does) codewindows when the user clicks another file.

So there's only one codewindow at once for Windows to handle.

I'm pretty sure the cause for the crash it's related to "weak grandpa windows filled with memories of the good ol' times" since it's the windows-controls & menus that start to behave weird.

Maybe it will help if only one codewindow has to be handled at once

+ Latest addition to thinICE/UI: treeview now returns text ,
you may right-click into codetree to copy the whole tree onto clipboard

ReneMiner
03-12-2015, 14:56
new feature:

each codewindow now has a small button up-left that you either can click or access from within code (hold CTRL and press ^ - the button above Tab-key on my keyboard)

It opens a tControl_ListPopup (yes i finally got it almost done) where you may select a function of the current script to edit. The good thing about this is- you don't need to grab for the mouse...

ReneMiner
07-12-2015, 09:03
thinICE now smart enough to know that keywords as AS & Extends are followed by a type-name, on keyword ARRAY something like Scan, Sum, Extract etc will follow

+ fixes & more

Petr Schreiber
07-12-2015, 19:04
Cool, Rene!

ReneMiner
08-12-2015, 14:45
Every day some news:
today i added "UI_3dTemplate.tBasic" that demonstrates how to combine TBGL-UI and scene+entity-system.

Therefore some additional "tScene.tBasicU" in the download which handles easy setup of generic scenes with 1 lit camera.

Also minor changes to the TBGL_Requester.exe:
now it's mandatory to locate it next to the app to start (same path).
This prevents from too long subfolder-names which OS_Command can not handle.

And of course fixes etc. to thinICE and tUI

Petr Schreiber
08-12-2015, 20:44
Amazing! Rene, I need to find a way to make it easier to enter characters - the keyboard profiles are okay, but I noticed some unusual behavior on different PCs, such as right arrow behaving as constantly pressed on one specific PC. If you have any hints or ideas, let me know.


Petr

P.S. Cool 3D demo!

ReneMiner
09-12-2015, 11:13
Strange, i have no idea what the cause is.

%VK_Right is of Keyboard.KeyTypeEdit which gets treated like Keyboard.KeyTypeChar.

If you like, you may have a look at unit tKeyboard.IsInput().
There's nothing special about any key- all are treated the same - except Shift/CTRL/Menu-keys

KeyDown-events get repeated on KeyHold after a while -
therefore some Static RepeatDown in that method -

IsInput() gets called from tUI.ProceedInput() where the results of IsInput (tMouse + tKeyboard) get passed to the control that is supposed to receive the input.

However, you may test the whole thing without periodic function.
Goto TBMain()



' -- comment these 2 lines:

' >>> TBGL_PeriodicBindFunction( Win.hWnd, "TBMain_Period", %PeriodicInterval )

' >>> TBGL_PeriodicProcessFunction(Win.hWnd)

' -- then paste this as classic main-loop here:
' (between "AllControlsCreate()" and " TBGL_ShowCursor( On )")

While All( TBGL_IsWindow( Win.hWnd ), keepRunning )

Win.NewInfo()
UI.ProceedInput()
TBGL_ClearFrame
UI.Render()
Mouse.DrawPointer()
TBGL_DrawFrame

Wend

ReneMiner
10-12-2015, 21:02
autocomplete now smart enough to suggest correct enclosure when you type something like "End ".

ReneMiner
16-12-2015, 15:21
Need thinBasic v 1.9.16.7 now - added a little For Next When -tuning to speed up whatever possible :)

ErosOlmi
16-12-2015, 19:11
Hi Renι,

few problems I found:


typing some code into thinICE seems Y and Z keyboard keys are inverted. When I press Y I get Z and the other way round.
runtime error when typing TYPE and then END TYPE: openType variable is not defined in TokenFindStart fucntion source tControl_Codefield.tBasicU


Ciao
Eros

ReneMiner
16-12-2015, 19:35
thanks for the hint- i really forgot to dim a variable that i used. Uploaded fixed version

For the y/z-keyboard-thing:

In the beginning you get prompted for screen-resolution/window-size and keyboard-layout.
Currently i have only the layouts for 4 kinds of keyboards. There are files as "keyboard_[language].ini" which just hold the %VK-equates and the char to print for this key,
depending on no shift (lower) shift(upper) or right menu-key (AltGr)

Sadly not an "keyboard_italian.ini", but czech, french, german and english(US).

(Maybe i find the thread were Petr was so kind to make a czech version some time ago, there i had some script that makes it easier to create a keyboard-layout-ini-file...)

Delete the thinICE.ini-file to change the layout again on next startup or replace the setting in thinICE.ini with your desired layout-file.

ErosOlmi
16-12-2015, 19:51
Thanks.

I'm using English keyboard and fixed those lines in Keyboard_EnglishUS.ini:

VK_Y_Lower=z
VK_Y_Upper=Z
VK_Z_Lower=y
VK_Z_Upper=Y

Now typing is fine.


I tried to push at 1920x1080x32 resolution and thinICE crash just after opening the main TBGL window

Ciao
Eros

ReneMiner
16-12-2015, 20:36
strange... i'm investigating this...

use smaller resolution & windowed - the TBGL-window is sizeable anyway.
(you also can use F12-key or double-click on statusbar to toggle window-size)

ErosOlmi
16-12-2015, 21:17
Yes, yes.
Mine was just a ... push to the limit test :)

ErosOlmi
17-12-2015, 09:07
Hi Renι,

I spent some time on code of thinICE.
I cannot say how happy I was to see such a great code. Never thought we could get so complex in the positive sense.
I mean, your code is so great and full of complexity that I cannot believe thinBasic is able to execute.

It is really a piece of code I will study for long long time as a source of inspiration!

Based on that, yesterday I added a kind of rudimentary profile in thinCore.
It is activated by adding #TRACE (in next thinBasic version it will be called #PROFILE) at the beginning of the code.
When you will execute your script, if #TRACE is ON, you will have a profile text file with all the functions present in you code and for each: how many times it has been executed and for how long (ms)
It can be opened with a spreadsheet in order to sort by execution time or by number of executions (see image)

It is quite rudimentary and numbers (especially timing) are still not perfect but can give an idea where a script spent most of the time and maybe it can help to improve the script or, for me, improve thinBasic.

Ciao and a big thanks.
Eros

ReneMiner
17-12-2015, 15:50
fixed US-keyboard-layout to print correct Y & Z
fixed displaying last line in codefield.

ReneMiner
18-12-2015, 15:33
replaced previous tControl_Textfield -an editeable textfield- with a new version derived from codefield
- it has Undo+Redo built in - see testProject_009 for an example

+ a few fixes to tUI

still unsolved mystery why it crashes when starting thinICE in max resolution - obviously other tUI-projects don't have this issue so it must be something with thinICE.

ReneMiner
19-12-2015, 11:55
todays main-improvement:

I made use of #Trace-directive and optimized rendering-speed of syntax-highlighting for codefield.
Guess you'll feel it, especially on slower engines.


Download as usual at first post of this thread (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281&viewfull=1#post92281).

ReneMiner
21-12-2015, 14:17
New #Minversion 1.9.16.9

made use of new keyword App_Inifile to both projects ("thinICE" & "tUI" where thinICE is based on)

further speed improvement to tControl_Basetype.Render & new resizing-routines for tUI due to new #PROFILE-analizing

extended tUI: now can have timers , added new Type tTimer to be included in tUI-unit
- see demo testProject_009 how to create and use, look for "Notes" in code-browser-tree to find a list of all controls.

ReneMiner
22-12-2015, 15:37
thinICE now able to execute scripts, either F5 or F8 - same as in thinAir.


Astonishing:
It will even work if you run thinICE from thinAir. thinICE is not required to be bundled before.
thinBasic.exe seems able to interpret more than just one script at once!

New function: tCodefield.CheckParens()
Before a script gets executed, thinICE will check the script and all included units for balanced parenthesis.
So it might take a while before it runs.
I don't know if I'm gonna keep it that way,
(if you dont like it comment line 392 in thinICE.tBasic, Sub ScriptExecute)


lLine = cf.CheckParens(sCheck)


You also may check for parenthesis in the current scriptunit if you right-click into codefield and select "check script" or just press CTRL+P.
It does not show the exact line where the parenthesis are unbalanced but it goes for keywords & newline-char ":" that can not be within parenthesis and shows the line where the last parenthesis were found.

+ fixed some crashing-issue of thinICE
+ added the forgotten UNIONs to the project.
Codetree will now also list Unions and autocomplete of course will know them if you type something like "Dim myVar(123) As "

Petr Schreiber
22-12-2015, 22:49
Thank you Rene,

pretty impressive...


Petr

ReneMiner
28-12-2015, 12:13
another last new version for the year 2015.
Mostly fixes of some crashing-issues - now also largest resolution will work fine.
New function to tControl_Treeview to kill nodes that have a certain user-value allows correct refreshing - a renamed/removed or in another way changed global now gets removed or replaced instead of keeping the outdated information.

Download at first post of this thread (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281&viewfull=1#post92281).

I think i will re-write thinICE with a few changes.
mainly to make use of new cTokenizer (urging for overview/documentation)

Look forward to the year 2016 and await the unexpected.

ErosOlmi
29-12-2015, 10:51
It is becoming faster and faster every version.

I have still some issues with keyboard. I have a full keyboard in my laptop with full numeric keyboard on the right and separated arrows in the center.
Arrows are not recognized while if I use arrows on numeric keyboard while numbers are de-activated, it works.
This should not be related to keyboard nationality but mapped extended keys.

I will work on tokenizer module class help by the next thinBasic version.

ReneMiner
29-12-2015, 11:02
Petr already reported similar issues on some keyboards using %VK_Right.
I don't know what to do since i use the equates for that - is it possible the numbers of keyboard-keys are outside the range of Byte (1 to 255) ? Is there some %VK-equate higher than 255?
Is it possible to read keyboard-nationality from OS (windows) so my script knows what char to print if the user presses a key?

ErosOlmi
29-12-2015, 12:43
When there are some TBGL script that rotate I usually can use arrows keys.

They use TBGL_GetwindowKeyState where hWnd is the handle of TBGL window created using TBGL_CreateWindowex

Example:

if TBGL_GetwindowKeyState( hWnd, %VK_UP) then ...
if TBGL_GetwindowKeyState( hWnd, %VK_DOWN) then ...
if TBGL_GetwindowKeyState( hWnd, %VK_LEFT) then ...
if TBGL_GetwindowKeyState( hWnd, %VK_RIGHT) then ...

ReneMiner
30-12-2015, 11:14
this exactly what i do in tKeyboard.IsInput(). (called by tUI.ProceedInput)

I'm really clueless and i urge for a way to proceed input "international" without the need of keyboard_<language>.ini-files and my script knows what char to print if the user presses a key.
I'm certain that windows has some information about the user-keyboard stored somewhere, but i don't know where it's located nor how to read the information

Petr Schreiber
30-12-2015, 22:11
This seems like kind of clue, investigating how to bring it to TB in easy to use manner:
http://stackoverflow.com/questions/6929275/how-to-convert-a-virtual-key-code-to-a-character-according-to-the-current-keyboa


Petr

ReneMiner
02-01-2016, 17:43
yes, reads as if it were a connection but i have no idea how to bring this to work in thinBasic.

ReneMiner
03-01-2016, 14:33
not much changed.
I disabled the functions-list which was accessible via CTRL+^ or click onto the small button up-left in codewindows.
(too slow and was not working correct in all cases)

Autocomplete now behaves little different when if using Up+Down-keys.
( if for example the top line was selected, key-Up now selects the bottom line etc.)

As usual download at first post (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281&viewfull=1#post92281).

ReneMiner
04-01-2016, 14:02
CTRL+^ is back again... but in another way:

I added keyboard-input to tControl_Treeview.
If you check out the Sub Codefield_KeyDown, Case Else... you'll find one more reason to have another way of retrieving keyboard-input since the char "^" is not to achieve the same way on all keyboards. I hope this works on all layouts using CTRL + the key where you have the "^" without to interfere in something else.

So if you press CTRL+^ in codewindow, thinICE will set focus on the codetree where you may
• select nodes via up- & down-keys now
• expand & collapse nodes on a tree using left- or right-keys
• call _Click() on a node using the Return-key.

ErosOlmi
05-01-2016, 08:03
Renι,

is it possible to change vertical scroll speed of editor windows when using mouse central wheel?
Actually (in my case) it just scroll up/down of few lines only.
I would like to have vertical scroll moving more lines.

Thanks
Eros

ReneMiner
05-01-2016, 10:56
Yes you can. Hold shift to scroll mousewheel * 10 ^1, Ctrl to scroll mousewheel * 10 ^2, hold menukey * 10 ^4 or any combination of these
This applies to all tUi-controls that react on mousewheel ;-)
For codefield you also may hold Ctrl+Vk_up or vk_down to go to the next function

ps. Posted via smartphone, so excuse if not matches usual style ;)

ReneMiner
09-01-2016, 13:20
another -unexpected- update.

To load included files in correct order I added 2 new functions to tControl_Treeview that allow to Get & Set a nodes position within their parents child-list.
See the effect if you load thinICE into thinICE: tControl_Codefield & tControl_Autocomplete are now correctly listed below the type they extend (tControl_Multiline)

Download here (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281&viewfull=1#post92281).

EDIT:
added deleting of log-file on Runtime-Errors
added reload of current project (click file-list on Explorer-Tab)
fixed UCASE of udt-subelements, now Mcase (as defined) again in Codetree & Autocomplete

ReneMiner
10-01-2016, 10:59
Latest change:

thinICE does not run in periodic intervals by default any more, but in a straight loop.
Except YOU want it periodic, then enter a time for periodic intervals (in ms) in thinICE.ini,
Section:


[Run]
Periodic=0


If you want to set any value, simply divide 1000 by desired number of frames per second

Periodic=16
then it's around 60Hz

Periodic=10
should be 100Hz

etc.

You may as well change this in thinICE.tBasic before you run it, go to line 45


%PeriodicInterval = Val(INI_GetKey(APP_IniFIle, "Run", "Periodic", "0"))

replace 0 with whatever you want,
example 60 Hz:


%PeriodicInterval = Val(INI_GetKey(APP_IniFIle, "Run", "Periodic", TStr$(Int(1000/60)) ))

Petr Schreiber
10-01-2016, 11:39
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

ReneMiner
10-01-2016, 11:43
In general you are right. I'll think about how to achieve.

ReneMiner
11-01-2016, 12:12
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.

Petr Schreiber
11-01-2016, 20:54
You are the best!

ErosOlmi
11-01-2016, 23:08
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 :)


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


Another think that let the application seems to work much faster is mouse middle wheel scrolling.
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

ReneMiner
11-01-2016, 23:20
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

ErosOlmi
11-01-2016, 23:35
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

ReneMiner
12-01-2016, 12:55
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 (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281&viewfull=1#post92281) 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


#INCLUDE Once "tUI\tUI.tBasicU"

ReneMiner
13-01-2016, 13:11
Autocomplete (thinICE (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281&viewfull=1#post92281)) 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

ReneMiner
13-01-2016, 16:08
...
Another think that let the application seems to work much faster is mouse middle wheel scrolling.
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.

...
Ciao
Eros

Still not done, I'm unsure about the speed.

but you can have this, go to
tControl_Codefield.InputMouse()
go to line 2220:
originally:


Me.FirstLine = MinMax(Me.FirstLine - Mouse.Wheel * Pow(10, Keyboard.lShift), 1, HEAP_Size(Me.pText)/4 - Me.Pageheight + 1)

for very fast scrolling (100 lines)
you can change this to:



Me.FirstLine = MinMax(Me.FirstLine - Mouse.Wheel * Pow(10, Keyboard.lShift Xor Keyboard.CTRLKey), 1, HEAP_Size(Me.pText)/4 - Me.Pageheight + 1)

for medium speed (10 lines) which I'd prefer:


Me.FirstLine = MinMax(Me.FirstLine - Mouse.Wheel * Pow(10, Keyboard.lShift Xor Keyboard.ShiftKey), 1, HEAP_Size(Me.pText)/4 - Me.Pageheight + 1)

ErosOlmi
13-01-2016, 22:31
Autocomplete (thinICE (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281&viewfull=1#post92281)) 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


Better and better.
As soon as I will be in Scontilla I will for sure copy from thinIce.

IMPORTANT:
In the meantime I advice you that I made a change in #INCLUDE statement in next thinBasic version
Reading you code I just discover that #INCLUDE has a wrong logic in the calculation of the BasePath to consider for calculating the full include path.

Current logic is that BasePath is always the path of the main script.
Instead, every #INCLUDE files should have as BasePath the path of the source file having #INCLUDE inside it.

Reading your tUI.tBasicU I saw that you are oblidge to include sub files using base path tUI\
#INCLUDE Once "tUI\Type_Functions.tBasicU"


But this is not the way to do because tUI.tBasicU is already in the tUI\ directory.

ReneMiner
14-01-2016, 13:51
I considered the new way of #Include - so should work both ways in thinICE... it will check at the parent-file-path first...

for thinICE itself to work both ways, i changed from


#INCLUDE Once "tUI\tUI.tBasicU"
' etc.

to


#INCLUDEDIR "%app_sourcepath%\tUI"
#INCLUDE Once "tUI.tBasicU"

+fixes (typos) in tScript.Load()

On typing "Redim [Preserve] " now we also have all global arrays in autocomplete-list...
thinICE.tBasic, VariableListGlobal() picks them from Vartree...

...and did the Shift-thing. Now you scroll in codefield as if Shift is pressed (10 lines). Press Shift to scroll single lines,
Shift + CTRL to scroll 100 lines, CTRL to scroll 1000 lines...
try other combinations of shift/ctrl/menu-keys to see what they do.
Other controls still scroll single lines without any shifting keys

re-structured the DOWNLOAD (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281&viewfull=1#post92281) again to be more clear.

I also added some readme.txt- files that explain the content of each folder.

ReneMiner
14-01-2016, 17:00
+ another improvement today:

Insert code-blocks or toggle breakpoints at the current scriptline
- just click onto the linenumbers of the codefield...

PS. seems i forgot to comment Uses "console"...


and once again mentioned, in case someone reads it:
tControl_Treeview is able to return text...

try:
load any project,
right-click on codetree and select to "copy tree to clipboard".
paste into something that is able to receive text from clipboard
and you'll have your project-overview - ready to document...

ReneMiner
15-01-2016, 12:34
today

thinICE:

finetuning tControl_Codefield
-> highlight line-number of current codeline so you'll know where codeblocks get inserted when you click onto the line-numbers

finetuning tControl_Autocomplete
-> faster now
-> list of suggestions reduces automatic instead of creating complete new list of suggests each time
-> list persists now when typing chars...
-> detects more situations when array-variables will follow and suggests them

tUI:

added tControl_Multiline.TextGetArray()
-> enable all controls that Extends tControl_Multiline to retrieve textlines into byref passed dynamic string-array
fixed tUI.ProceedInput() since the tooltip-timer kept the function to return TRUE
-> typing faster again


> Download latest thinICE (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281&viewfull=1#post92281) at first post of this thread, as usual.

ReneMiner
15-01-2016, 21:27
more added to

autocomplete:

• suggesting the correct Do/For/While in case user types "Exit " or "Iterate "
• lots of auto-completing for UI-module, so if you type stuff as "Control "
it will suggest "Add","Append", "AppendToTop", "Disable" etc.
if you type "Set ", you'll get suggestions, depending on what's previous "Set ",
for example
if "Declare Set " it will suggest "Address" and "At"
if "Dialog Set " then suggests "Client", "Color", "Gradient" etc.
• autocomplete also knows "With" and what it means
• autocomplete knows many more situations and what to suggest

codefield:

• known global names (functions, variables, udts etc.) are printed bold now
• fixed missing horizontal scroll when maximizing codewindows
• fixed horizontal movement when typing in codefield
• fixed duplicate creation of file-node at codetree when #Include of a not existing file

PS. for a while i will leave an older version attached to hunt some bug in tb

Image:
remember to press CTRL+T once in a while to update the tree...
right-click into codefield to access the context-menu as shown
left-click onto line-numbers to insert code-blocks.
to "write" the scripts as shown was a matter of a few seconds only...

ReneMiner
16-01-2016, 15:10
More tuning again... how fast can we get...?


+ added & fixed lots of small things
+ added one more tab, allows you to set Options,

Download as usual from first post (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281&viewfull=1#post92281) of this thread.

If you check out the image you'll see a yellow highlight in the numeric textbox where the mouse is over.
Numeric textboxes value can change by using the mousewheel as long as the textbox does not have input-focus ;)

ErosOlmi
18-01-2016, 11:55
Typing is now much more fluent, no delays and no keys seems lost.
Auto completion: really great.

ReneMiner
18-01-2016, 14:41
new version of today

- fixed bug when editing text after selecting token via doubleclick in codefield

Download here (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281&viewfull=1#post92281), as always.

ReneMiner
21-01-2016, 13:32
todays new feature:

mouse-wheel-scroll-speed customizeable. Check the boxes according to your likes.
If for example "Xor Shift-Key" is checked then you'll scroll as if Shift-Key were pressed and you have to press Shift-Key to scroll single lines.

fixed:
missing properties of local udt-variables now back in autocomplete
invalid fontID at treeview on initial load
autocomplete covered cursor / current codeline in some cases

Download here (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281#post92281)

...

Petr Schreiber
21-01-2016, 21:46
Huhuuu,

really, superfluent typing! I need to study more deeply how we can avoid those keyboardmaps...


Petr

ReneMiner
31-01-2016, 12:27
small addition today:

+ rightclick into pathview on Explorer-Tab to fast access some special folders as thinBasic-installpath and user-documents\thinBasic-path,
sadly I was not able to detect the location of os-user-downloads folder yet

because i'm short on time currently
- my girlfriend is demanding too much of it
:blush:

+ 2 more functions to tUI that allow to get & set userdata to any tControl_Basetype-extension without having to declare additional variables

#Minversion now 1.9.16.15


Download here (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281&viewfull=1#post92281)

...

ReneMiner
02-02-2016, 13:13
today i had time:

now also fast-navigate to %User%\Downloads\-folder if available. (right-click into pathview on explorer-tab)

changed:

duplicating current codeline (CTRL+D) now moved to the popup that opens if you click onto a line-number

Download here (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281#post92281), as usual

ReneMiner
06-02-2016, 13:11
todays news:

not any real changes that you'd see - except some syntax-fixes concerning exiting functions before statics are declared -

see here (http://www.thinbasic.com/community/showthread.php?12600-thinBASIC-1-9-16-X&p=92665#post92665) for details.

download here (http://www.thinbasic.com/community/showthread.php?12611-preview-thinICE&p=92281#post92281).

caffey
15-01-2018, 20:13
but I'd really like to try thinICE... can't figure it out but I'm having problems running thinICE in thinAIR

I was wondering if someone wouldn't mind sending me a compiled version??

Thanks

ReneMiner
19-01-2020, 17:47
I found the reason why it will not work as is in the download... Some problem with the requester in the beginning. Somehow old TBGL is not capable of detecting available screen resolutions on new systems. So all you have to do:
Save the .initial next to the script which contains TBMain. Use App_inifile to build the name or type the scripts name again when you save it.
It requires
keyboard layout, screen witdh and height only.
You. Might as well use some %equates - just search for Os_shell (TBGL_Requester.exe and remove/ replace it or use the within the download included .ini-file from the Ui- samples

Petr Schreiber
19-01-2020, 22:49
Hi Rene,

could you please elaborate more on "somehow old TBGL is not capable of detecting available screen resolutions on new systems."?

I ran the example in the latest beta and it runs just fine on the latest patched Windows 10.

Caffey - could you please give more details regarding your configuration (PC details + installed thinBASIC)? Could you please let me know what does the following code do on your PC?


uses "tbgl", "console"


printl tbgl_getFullscreenModes


waitkey



Petr