Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: my current GUI-project

Share/Bookmark
  1. #1
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    47
    Posts
    1,213
    Blog Entries
    1
    Rep Power
    132

    my current GUI-project

    Just to keep it interesting here I post some preview of my current project... maybe someone's nosy and has the passion to browse it for ideas...

    Its a GUI for TBGL where the TBGL-Window becomes an "MDI-Window" - means, user has a few little "windows" (i call them just "t_CTRL_Box") to move around inside client-area. Most useful for TBGL-editor-apps without the need of "UI" and resulting win32-contamination of your code

    Its not done yet and just contains a few basic controls as the base-boxes (no "common dialogs" yet) , buttons, labels, checkboxes, option-buttons, scrollbars and all the menustuff.

    The philosophy behind it is a little vb6-alike, every control gets a name (optional index if more controls with this name) and the user has only to care about which controls to create and has to write only the code for the events that occur on those controls.

    It contains an emptyProject.tBasic - a template to start with and some testProject01.tBasic which shows a few of the current possibilities and explains how to setup controls and how to read the events.

    Basically every user-defined sub to each control starts with the name that has been given to the control. Every sub has to have
    Sub myControlName_MyEvent( Byval Index as Long [,...]  )
    
    so with the index you might identify which control currently had that event.
    Ignore Index if you have none assigned (=0)... but the subs have to have this parameter.

    To request the exact control that caused the event you might place an absolute variable onto it to access its properties and methods.
    Therefor my GUI has a function that will create the fitting variable, so you send the name and the index of the control where to place a layover and it will create the layover of the fitting type at the heap where the controls data is store.
    The heap makes it possible to attach any different new Type that Extends the t_CTRL_Basetype to the GUI, so its dynamically expandeable (for example with additional user-defined controls that are not invented yet) and you can omit to include unneeded controls to your project later to save on memory.

    The download contains a lot of files and the first time you start one of the *.tBasic files you'll get prompted to select your local keyboard-layout, so just enter the number (currently 1 to 4) of your layout. If yours is not listed feel free to create one (I'll tell how on demand since its too much for this post) - anyway- there's no keyboard-input (except esc-key) since there are no controls to enter values nor strings yet.

    Have a look at the testproject01.tBasic-code and run it, move the boxes around inside the TBGL-window and enlarge the inner client by doing so. try out menus, (open additional "windows" from menu). Compare the stuff in both *.tBasic-files: the emptyProject consists of a skeleton to start with. All additional code in the second (testproject01) - mostly subs - is the code the user will write later to create controls and handle them.

    Very undone yet... and some things might change or get improved. But I think its a very good example of the opportunities the latest to tB implemented features offer.

    PS. ByPtr-functionality is implemented but not in use. Currently I prefer the way of pre-overlay to make use of great Extends-features which allow to sort out

    EDIT: updated version attached

    #MinVersion 1.9.12.0
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	gui2.jpg 
Views:	74 
Size:	159.1 KB 
ID:	9080   Click image for larger version. 

Name:	GUI0001.jpg 
Views:	63 
Size:	154.6 KB 
ID:	9081  
    Attached Files Attached Files
    Last edited by ReneMiner; 07-08-2014 at 16:56.
    Windows 10 on
    Desktop: Intel Core i5-3330 @3.0 GHz, 8 GB Ram, nVidia GeForce GT630 2 GB
    Laptop: Intel Core i3-4005U @1.7GHz, 8 GB Ram, nVidia GeForce 940M 2 GB


    The limit is Imagination

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,759
    Blog Entries
    3
    Rep Power
    688
    The demo itself is great, but what made me even more impressed was the look into code.
    Really nicely structured, well done Rene!


    Petr

    P.S. Little issue found - when moving the window really fast, the anchor point of drag can change.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  3. #3
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    47
    Posts
    1,213
    Blog Entries
    1
    Rep Power
    132
    Ok, that issue can be solved by dragging them boxes slower

    Anyway- i think there is "first-time-usage" of some stuff that were never possible before, especially through extended types- really a great feature (can't stop to ballyhoo for it) - I found some small core-issue concerning optional parameters & Call_IfExists <composing function name here> - need some more experiments into that direction... but I think there's some bug.

    I hope for some miracle to fire up some passion in a certain direction...
    Windows 10 on
    Desktop: Intel Core i5-3330 @3.0 GHz, 8 GB Ram, nVidia GeForce GT630 2 GB
    Laptop: Intel Core i3-4005U @1.7GHz, 8 GB Ram, nVidia GeForce 940M 2 GB


    The limit is Imagination

  4. #4
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    47
    Posts
    1,213
    Blog Entries
    1
    Rep Power
    132
    just to keep the nosy ones up to date - I have another snoop-in here... now already a few more controls, currently I'm creating some variable-bound listfield, i.e. grid (check out the testproject window 5 from menu - just start the script, hit "w" followed by "5")

    Another hopefully interesting one you'll find in testbox (window) 4 - its on the way to become an editeable textfield... yes and all the others, just try out type in keys or check out what you can do with your mouse to certain controls, see easy approach to get modal messageboxes to work and all the other stuff - and be sure it won't be done before 2015...

    Still no textures yet. But the keyboard-unit is in use now so if you start the first time you'll be asked to enter the number for your local keyboard-layout.

    I like to abuse the forum for online-backups of my scripts
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	GUI0001.jpg 
Views:	83 
Size:	154.6 KB 
ID:	9067  
    Last edited by ReneMiner; 07-08-2014 at 16:54.
    Windows 10 on
    Desktop: Intel Core i5-3330 @3.0 GHz, 8 GB Ram, nVidia GeForce GT630 2 GB
    Laptop: Intel Core i3-4005U @1.7GHz, 8 GB Ram, nVidia GeForce 940M 2 GB


    The limit is Imagination

  5. #5
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,759
    Blog Entries
    3
    Rep Power
    688
    This will sound weird, but... please feel free to abuse this forum Rene

    The updated example is truly fantastic, highly recommended for anyone to try out!

    Not only the visuals are impressive, but the GUI API design as well.

    Highly recommended, without exaggeration this is the best TBGL based GUI demo up to date!


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  6. #6
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    47
    Posts
    1,213
    Blog Entries
    1
    Rep Power
    132
    Eros can be really proud of his works and all of you can just be flabbergasted about what it makes possible- it's really unbelieveable.
    Await an update near the weekend.
    Windows 10 on
    Desktop: Intel Core i5-3330 @3.0 GHz, 8 GB Ram, nVidia GeForce GT630 2 GB
    Laptop: Intel Core i3-4005U @1.7GHz, 8 GB Ram, nVidia GeForce 940M 2 GB


    The limit is Imagination

  7. #7
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    50
    Posts
    8,091
    Blog Entries
    2
    Rep Power
    10
    Quote Originally Posted by Petr Schreiber View Post
    This will sound weird, but... please feel free to abuse this forum Rene

    The updated example is truly fantastic, highly recommended for anyone to try out!

    Not only the visuals are impressive, but the GUI API design as well.

    Highly recommended, without exaggeration this is the best TBGL based GUI demo up to date!


    Petr

    I cannot agree more.

    Code produced by Renι is always so clear and well organized, but at the same time it has that kind of complexity to be a great source of inspiration for new native ThinBASIC features.
    Renι, I will spend my holidays in reading back all your requests and see if I can add few of them.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  8. #8
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    47
    Posts
    1,213
    Blog Entries
    1
    Rep Power
    132
    yeah - since Eros replied and I know he had a look at it I now can not leave it like that until weekend- i probably have not time then because we have a big party here. So i uploaded a little polished and more functional version today, just to name a few

    - remember Extends makes it possible to create an extension of any existing control on top of it- and also its very simple to combine different controls to new ones. -

    the controls I already have:
    • standard-menubar that gets displayed on top of screen, with it come popups and menuitems that are ordered from top to bottom, all of them behave as common popups & menus, so popups can be attached to controls directly to popup on right-click, also tooltip can be attached - multiline of course...
    • an infinite client-area where still can a 3D-Scene be rendered in the background or while all GUI-stuff is collapsed and where the following can be placed in

    • boxes - so to say little windows, that are containers for all below

    • simple buttons
    • simple, one-lined labels
    • multiline-labels
    • horizontal scrollbars that can control other controls or be bound to variables
    • vertical scrollbars (as above)
    • checkboxes
    • option-buttons
    • progressbar
    • editeable one-line-textboxes that can be bound to variables
    • simple multiline text-display
    • editeable multiline text-display
    • simple listbox, only for check, select and display
    • choicebox - combination of a button & a listbox where user just can pick one of some predefined choices
    • and a listfield, an editeable multiline-data-grid that has to be bound to some udt to be of use...

    • almost forgot, of course timers too...

    There's only a handful of Global variables - most of them are related to Input so you have all Key(%VK_...).Current-states available and have them classified - I used .categorie for this - but i think its a wrong written german word
    Also there are a few for the Mouse as there were
    Long MousePosX,   MousePosY     ' tell current position on window-surface
    Long MouseDeltaX, MouseDeltaY   ' tell current movement
    Long MouseWheel                       ' current wheel-turn
    
    DWord MouseOver                      ' holds pointer to control where the mouse is over
    DWord MouseDrags                    ' holds pointer to control that gets dragged 
    
    '  if you need the control the mouse is over its as easy as - err- like that:
    
    Local lCtrl Like Heap_Get(Peek( DWord, MouseOver)) At MouseOver
    '...
    
    All of these should be considered read-only so all the frame works with the same values. Anyway you might delete or change them if you know what you're doing. Check genericInput.tBasicU for more information about that.

    The other 4 globals are for fonts, Screen, the Win and the GUI. All of the GUI is noded to the GUI and hidden in the depth of heap-memory somewhere. And because that were really complicated to handle all that heap gets names and indexes which the user can work with. All readeable names, controls with same name get indexed automatic meanwhile too, a couple of functions of the GUI that find pointers and type-names and help to perform common tasks to save the user having to create local overlays

    No further documentation yet- I made a lot of comments inside- but probably not enough...

    As first you should probably run the testproject and try out on that "always here"-box a little, explore menus & window-popup at the menubar- there you'll get access to all the little boxes that show a lot of the controls so one can try out and play around a little, click and turn wheel anywhere, also shift buttons (Shift,Ctrl, Alt/Menu) often increase by default the size of some change- whatever it is...

    Still no use of textures yet- i put more effort in polishing and finishing the base-works before i include that unit.

    Anyway,
    #MinVersion 1.9.12.0

    have fun

    Edit: Small bug in GUI.GetFreeIndex regarding timers, please pass indexes on create for timers with same names for the meantime...
    + another small missing parenthesis in Sub MenuFile_Save_Click() in the testproject-file...
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	gui2.jpg 
Views:	55 
Size:	159.1 KB 
ID:	9077  
    Last edited by ReneMiner; 07-08-2014 at 16:55.
    Windows 10 on
    Desktop: Intel Core i5-3330 @3.0 GHz, 8 GB Ram, nVidia GeForce GT630 2 GB
    Laptop: Intel Core i3-4005U @1.7GHz, 8 GB Ram, nVidia GeForce 940M 2 GB


    The limit is Imagination

  9. #9
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    47
    Posts
    1,213
    Blog Entries
    1
    Rep Power
    132
    Quote Originally Posted by ErosOlmi View Post
    ...
    Renι, I will spend my holidays in reading back all your requests and see if I can add few of them.

    Ciao
    Eros
    Ok, Eros. I think my most urgent request was to call type-functions on a pointer... still very cool feature that could be added - but it will of course not be possible using extends-behavior but just calling straight on a type directly... yes would be great. In the meantime I've found a workaround that you'll discover if you follow the .Render-Functions into the deeper universes: The Window renders first 3d-stuff (if some) and finally calls GUI to render/draw on top.
    The GUI.Render creates a local overlay of the basetype so it can loop through all controls in zOrder without to care about the type.
    Then GUI calls .Render() on the basetype and there in the BaseType-Function the overlay to the real type is created and .Render() gets called on it ( the real type ) eventually. So this a lot of passing forward but I won't complain, as -err- like you see it works.

    More important than that were Petrs request to have udt_elements to be private - so can only be read/set through Me / in a type function of the parenting type. That would make code-units to real "objects" then...

    A request (?) an idea were to make heap a vartype - but the first native built-in type that has functions.... have a look at the by accident shipped "console.tBasic" to get the idea. Its a little- but not much different than dynamic strings. Those could be "typed" later on- so all the current core-string functions will work on all of type string by appendig it with a dot like Len(myString) becomes myString.Len...

    And one more- Heap_AllocByStr(s) should not allocate memory if StrPtrLen(Strptr(s)) = 0 !
    Last edited by ReneMiner; 07-08-2014 at 17:42.
    Windows 10 on
    Desktop: Intel Core i5-3330 @3.0 GHz, 8 GB Ram, nVidia GeForce GT630 2 GB
    Laptop: Intel Core i3-4005U @1.7GHz, 8 GB Ram, nVidia GeForce 940M 2 GB


    The limit is Imagination

  10. #10
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    47
    Posts
    1,213
    Blog Entries
    1
    Rep Power
    132

    Lightbulb

    Just because it reads so nice & short... and not to interfere with already occupied keyword private...
    i would appreciate if tB would go its Own way instead of following others rules in the own backyard - compatibility is not a reason since tB is smart enough to differ own and foreign...


    Type
    t_Type
    A As Long
    Own B As Byte
    C As Function
    End Type


    ... B now only accessable inside t_Type.C() - and other functions of that type.... how to achieve this... im certain it's quite cumbersome to flag all variables from within a tB-script... but if there were a flag deeper below like some unused far left bit in the vartypes-table...

    ...however I'm in party-mode now... on the way to get loaded... this is the last backup before the big black-out

    ps. a few functions added to GUI for getting lbound and ubound of "control-arrays" , fixed timer-indexing etc. added a filelistbox (start testproject, hit "w" followed by "7" and click a file... or change the filter) + a little polishing, new mousepointer... more to come... on try out remember to hold shift-keys (shift, ctrl, menu/alt) when wheeling something...

    (as usual just for backup-purposes since my HD is short on space )


    I'm just doing it because I'm having fun doing it

    may i invite you to listen a GREAT TRACK: that's what i listen while i'm coding
    Attached Files Attached Files
    Last edited by ReneMiner; 07-08-2014 at 18:15.
    Windows 10 on
    Desktop: Intel Core i5-3330 @3.0 GHz, 8 GB Ram, nVidia GeForce GT630 2 GB
    Laptop: Intel Core i3-4005U @1.7GHz, 8 GB Ram, nVidia GeForce 940M 2 GB


    The limit is Imagination

Page 1 of 3 123 LastLast

Similar Threads

  1. Current module development possibilities?
    By Michael Hartlef in forum thinBasic SDK
    Replies: 0
    Last Post: 17-09-2013, 20:12
  2. current thinAir very unstable?
    By Michael Hartlef in forum thinAir General
    Replies: 5
    Last Post: 09-02-2008, 07:35
  3. Current TAB player seems not working here
    By ErosOlmi in forum T.A.B. (ThinBasic Adventure Builder)
    Replies: 10
    Last Post: 21-04-2007, 12:41
  4. thinBundle: current status
    By ErosOlmi in forum thinBundle
    Replies: 0
    Last Post: 02-04-2007, 15:15
  5. Current development
    By ErosOlmi in forum thinBasic General
    Replies: 1
    Last Post: 31-08-2006, 22:33

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •