New ScuiLib version?

Discuss any general programming issues here
User avatar
Allanon
Posts: 461
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: New ScuiLib version?

Post by Allanon » Sun Feb 27, 2011 12:02 pm

Hello all,
I'd like to share with you a brief doc showing all supported tags for the rewritten Button class, please let me know what do you think and feel free to suggest any idea :D


FUNCTION scui.Button.Add(Info)

Code: Select all

; INPUT                [F]=Funcs, [T]=Table, [S]=String, [N]=Number, [B]=Boolean
;  • [T]Info                                 Table used to define the new button
;     • [S]Name                  Button's Name, cannot be NIL and must be unique
;     • [T]Position                                            Button's Position
;        • [N]x                                              Horizontal position
;        • [N]y                                                Vertical position
;     • [T]Size                                                    Button's Size
;        • [N]w                                                            Width
;        • [N]h                                                           Height
;     • [T]Look                   Table used to describe the button's appearance
;        • [T]Borders                                               Skin borders
;           • [N]Top                                                  Top border
;           • [N]Bottom                                            Bottom border
;           • [N]Left                                                Left border
;           • [N]Right                                              Right border
;        • [T]NSkin                               Skin for normal button's state
;           • [T]Levels        Table with multiple skin levels (or at least one)
;                                      Each level must have the following fields
;              • [T]Area         Table with corrections to the current skin area
;                 • [N]x                 Value to add to the button's position X
;                 • [N]y                 Value to add to the button's position Y
;                 • [N]w                      Value to add to the button's width
;                 • [N]h                    Value to add to the button's  height
;              • [N]Type                                Skin type for this level
;              • [T]Params                   Table used to define the level skin
;                 • ...depends on the skin type...
;        • [T]HSkin                            Skin for hilighted button's state
;           • ...see NSkin field...
;        • [T]PSkin                               Skin for pushed button's state
;           • ...see NSkin field...
;        • [T]DSkin                             Skin for disabled button's state
;           • ...see NSkin field...
;        • [T]NText                               Text for normal button's state
;           • ...see TextStruct...
;        • [T]HText                            Text for hilighted button's state
;           • ...see TextStruct...
;        • [T]PText                               Text for pushed button's state
;           • ...see TextStruct...
;        • [T]DText                             Text for disabled button's state
;           • ...see TextStruct...
;     • [T]Caption             Table with all text lines for all button's states
;     • [N]Visible    Sets if the button is visible or hidden, set this tag with
;                                                    #IFO_VISIBLE or #IFO_HIDDEN
;     • [N]Enabled  Sets if the button is enabled or disabled, set this tag with
;                                                  #IFO_ENABLED or #IFO_DISABLED
;     • [S]Shortcut                           Set a key shortcut for this button
;     • [B]UseCache         Set to True to enable button caching (using brushes)
;     • [T]Sounds          Table with samples to be played along button's events
;        • [N]OnPushed              Sample ID to be played along OnPushed events
;        • [N]OnDown                  Sample ID to be played along OnDown events
;        • [N]OnOver                  Sample ID to be played along OnOver events
;     • [T]Actions         Table with funcs to be executes along button's events
;        • [F]OnPushed                 Func to be executed along OnPushed events
;        • [F]OnDown                     Func to be executed along OnDown events
;        • [F]OnOver                     Func to be executed along OnOver events
;        • [F]OnDrop   Func to be executed when an object is dropped on this one
;        • [F]OnDropOut     Func to be called when this object is dropped out of
;                                                                     its window
;     • [S]WindowName               Window name where the button must be created
;     • [B]Background          Automatic background handling (for alpha buttons)
;     • [B]Draggable           Sets it this item can be dragged & dropped around
;     • [T]Tip          String table with the tip message to show when the mouse
;                                                     is holded over this object
;———————————————————————————————————————————————————————————————————————————————
; OUTPUT               [F]=Funcs, [T]=Table, [S]=String, [N]=Number, [B]=Boolean
;  • [N] Id                  Id of the new button or -1 if an error has occurred
;  • [T] Obj             A table to obtain direct access to the button structure
;-------------------------------------------------------------------------------

NOTES:
- The only mandatory parameter is the object Name
- Actually Objects can be dragged using a qualifier key along the left mouse click on the object, the default one is LEFT SHIFT but you can set it in the scui.Initialize() function
- This class (along with the coming ones) will use a new skinning library that allow multilevel skins: solid color, gradient, shades, stretch, fit, variuos skinning methods using brushes sectors, and so on, giving an unlimited power to the skin system. Even complex skins, with the new "UseCache" flag will be really fast!

Any comment is highly appreciated :)
----------------------------
[Allanon] Fabio Falcucci
AMC - Creative Development // Docs Site // Support Forum
Support me on Patreon for Hollywood libraries!

User avatar
Clyde
Posts: 195
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

Re: New ScuiLib version?

Post by Clyde » Sun Feb 27, 2011 2:10 pm

This looks superb and nearly overwhelming to me - great work! :-)

Great that width and height are w and h now, not x and y anymore (like I suggested "some" time ago :-))

The draggable flag is also very cool (will help me with my project a lot!

Tooltips are also great, thanks. And I am really looking forward to the skin and cache system! I am eager to know how fast it will be!

Also, the output parameters are different from latest public ScuiLib, right? Or can I already receive ID and object structure (as table) right now? I think no ... At least right now I use scui.Get() and scui.GetIFOID() right now. The new output params will make my code more slick, I guess. Great!

Can't wait for the new version! :-)
Currently using: Hollywood 8 with Windows IDE

User avatar
Allanon
Posts: 461
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: New ScuiLib version?

Post by Allanon » Sun Feb 27, 2011 9:54 pm

Hi Clyde,
no, in the old version you get only the Object ID, sorry ;)

P.S.: I've forgot to add some tags for Icon & Vectors inside the button :D
----------------------------
[Allanon] Fabio Falcucci
AMC - Creative Development // Docs Site // Support Forum
Support me on Patreon for Hollywood libraries!

User avatar
Clyde
Posts: 195
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

Re: New ScuiLib version?

Post by Clyde » Mon Feb 28, 2011 1:58 pm

No problem, I just wait for the new version, which will be released ...??? :-P

Another question: if an scui object is draggable, do you update the position structure (X, y) according to the coordinates o the screen while dragging?
Currently using: Hollywood 8 with Windows IDE

User avatar
Allanon
Posts: 461
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: New ScuiLib version?

Post by Allanon » Mon Feb 28, 2011 7:33 pm

The draggable object, when dropped over an object that has an OnDrop event will call the attached function with the dropped object id & structure and the final coordinates.
Then is up to yuou to validate and at least move your object, but take into account the automatic layout!
----------------------------
[Allanon] Fabio Falcucci
AMC - Creative Development // Docs Site // Support Forum
Support me on Patreon for Hollywood libraries!

User avatar
Clyde
Posts: 195
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

Re: New ScuiLib version?

Post by Clyde » Tue Sep 13, 2011 12:23 am

Hey Fabio,

any news here? :-)

Hope you are well!

Greetings!
Currently using: Hollywood 8 with Windows IDE

User avatar
Allanon
Posts: 461
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: New ScuiLib version?

Post by Allanon » Thu Sep 15, 2011 10:37 pm

Yes I'm fine, thanks :)
I actually workin on a new project called Emula, an universal front-end for retrogaming lovers :)
http://www.youtube.com/watch?v=lPFWiPt6ql4

I hope to release a new, faster, more OOP oriented and simpler to use, version of ScuiLib.
Unfortunatly this will not be compatible with the older version but will be very advanced compared to the old one ;)
----------------------------
[Allanon] Fabio Falcucci
AMC - Creative Development // Docs Site // Support Forum
Support me on Patreon for Hollywood libraries!

User avatar
Clyde
Posts: 195
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

Re: New ScuiLib version?

Post by Clyde » Thu Sep 15, 2011 10:47 pm

Hey,

ah, cool project! Some graphics are not my taste :-) but in general this looks superb! Completely done with (the new) ScuiLib?

Cool, looking forward to the new version. Great if you could streamline everything and make it more OOP. Do you have a small code snippet as a teaser for us? :-) Well, I don't mind if it is compatible or not. If things change fundamentally, than that's necessary. Looking forward to work with it!!!
Currently using: Hollywood 8 with Windows IDE

User avatar
Allanon
Posts: 461
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: New ScuiLib version?

Post by Allanon » Thu Sep 15, 2011 11:42 pm

Here is a simple snippet to build a gadget:

Code: Select all

mygad = HGui.Gadget:new(#HGUI_BUTTON_GADGET, { caption = { "BUTTON", "YEAH!" },            
                                               actions = { onpushed = user_function_here },
                                               window = mywin3 })                           
<mygad> is the object, no more ids

A brief list of the new features:
- Rotated text in gadgets
- New multilayered skin system
- Optional gadget buffering for lightning fast rendering & refreshes
- Speed!!
- Much power on gadget's parameters
- Simple syntax for standard gadgets
- Simple layout system (with weights like MUI)
- Heavy use of OOP, no more IDs but structures/objects (=tables)
- Floating tips
- and many more features :)

2 screenshots, windows version but the gui look will be the same for every platform:
Image
Image

And here is the code needed to make the fGUI in the first picture:
----------------------------
[Allanon] Fabio Falcucci
AMC - Creative Development // Docs Site // Support Forum
Support me on Patreon for Hollywood libraries!

jalih
Posts: 254
Joined: Fri Jun 18, 2010 8:08 pm
Location: Finland

Re: New ScuiLib version?

Post by jalih » Fri Sep 16, 2011 8:50 am

Nice work!

I have been toying on idea about creating my own user interface module too.

I have done most of my hobby programming projects for Inferno using Limbo programming language. Inferno uses it's own version of Tk and I find it simple and good enough for my purposes. My UI-module for Hollywood would probably look something like Tom Duff's old Panel Library for Plan 9 operating system.

Post Reply