It is currently Sun Dec 16, 2018 4:39 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: sgx - includefile for screen gagdets
PostPosted: Fri Feb 29, 2008 1:10 am 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 870
Location: right here
sgx is a library for creating simple GUI stuff in a screen..

Quote:
sgx is a screen-gadget library for PureBasic programmers to create and manage simple GUI-elements in a fullscreen or windowed screen.

it's available as sourcecode to be included in your projects. it's currently only available for Windows Operating Systems (though the code is pretty straight PB code). there are two versions: a single-file version that only contains the necessary files to just use sgx and a multi-file version in case you want to make changes to the sgx code, including the gimp files for the image files and some tools to build a single-file version from that.

with this library you can create simple GUI objects statically or dynamically of different type and appearance, modify them, display them easily, examine user actions and process events. sgx elements are accessed by ID (index-like, starting with index 1). the appearance is defined by designs, whereas you can create own designs with sets of images (there is also an instant design "lowbudget" which does not need any image files). currently there is no event queue, you will recognize events by checking for fields of your sgx elements.

currently available gadget types:
- sgxCursor
- sgxButton (including toggle buttons and buttons with a user sprite)
- sgxText
- sgxCheckbox
- sgxCombo
- sgxScrollbar
- sgxTrackbar
- sgxEdit
- sgxWin
- sgxTable
- sgxSpriteGadget
- sgxArea
- option gadgets / radio buttons are available through grouping


the documentation includes
- a quick start (sgxDoc\sgx.html)
- a full reference (sgxDoc\sgxDocFull.html)
- a smaller reference (sgxDoc\sgxDoc.html) without sgx internals (some links to sgx internals may not work in that document thought!)
- examples in the directory 'sgxDoc\'
- _README.TXT contains further informations

[...]
thanks to the PureBasic team and the community / the forums.

for the last update see this post

<screenshot>

<download> (1,3mb) ..you should start with the introduction 'sgxDoc\sgx.html'


Last edited by #NULL on Tue Jun 21, 2016 5:21 pm, edited 6 times in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Feb 29, 2008 1:20 am 
Offline
PureBasic Fanatic
PureBasic Fanatic

Joined: Fri Dec 09, 2005 12:15 pm
Posts: 2236
Location: Elbonia
Excellent code! This will be very usefull!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Feb 29, 2008 1:41 am 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 870
Location: right here
thanks, you're welcome!
btw: if someone is interested further into the code, i could also make a devel-package, where sgx comes in multiple sources as i'm coding it myself.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Feb 29, 2008 3:01 am 
Offline
Addict
Addict

Joined: Mon May 29, 2006 1:01 am
Posts: 1965
Location: Outback
Very nice. Thank you.

_________________
Dare2 cut down to size


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Feb 29, 2008 7:19 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Dec 25, 2004 2:37 pm
Posts: 218
Very great code !
Quote:
it's only available for Windows


Do you think add Linux and MacOsX support ?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Feb 29, 2008 10:44 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 10456
Location: Beyond the pale...
Excellent. Thank you.

_________________
I may look like a mule, but I'm not a complete ass.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Feb 29, 2008 12:10 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Fri Apr 25, 2003 4:51 pm
Posts: 2808
Location: Portugal, Lisbon
Found a small bug in the sxeditor... When you press capslock, and type, it repeats twice the capitalized letter...

Code:
Ii there


BRILLIANT STUFF btw :D

_________________
Software: http://xipa.org
Elevator Maintenance: http://central-elevadores.pt
Good web hosting!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Feb 29, 2008 4:56 pm 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 870
Location: right here
thank you guys.
@num3
that edit issue should work now. (updated)
@thyphoon
i have no MacOsX programming experience at all neither that OS, so i cannot do something about that.
i could compile and run it under linux already after taking out some things, but performance was quite bad, some colors were distored, and there is a pb TextHeight() bug. so alltogether it wasn't nice to look at :P .
i never got 2dddrawing/screen stuff working under linux without problems or loss of performance, but i have only humble linux expierence i must admid.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Feb 29, 2008 4:58 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
Very impressive, thanks !

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Feb 29, 2008 5:14 pm 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 870
Location: right here
thanks, you're welcome too!

i forgot to say:
i just changed the order of parameters for sgxCellAssign(). i/k comes first now.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 05, 2008 4:19 pm 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 870
Location: right here
added some infos to the quickstart (sgx.html) about useful functions / variables :)
Quote:
- you can use sgxSetGroup() to goup togglebuttons and/or checkboxes, so that only one element of that group will be toggled/checked at a time:
[...]
- sgxTipDelay defines the delay (in milliseconds) for showing tooltips
- sgxWinAnimSpeed defines the speed of min/maximizing windows ect.
- sgxHoldDelay defines the delay (in milliseconds) until hold events occur
- sgxHoldStep defines the interval (in frames) for hold events.
- iterate through all valid sgx-IDs with EACHSGX()
[...]
- get the ID of a table cell with sgxCellID()
- free elements with sgxFree() and sgxFreeChildsOf()
- move elements with sgxMove()
- bring up windows and elements in z-order with sgxMoveOnTop()
- refresh elements with sgxRefresh()
- use sgxSetText() and sgxSetState() for field-modifications that need a refresh to be visible (type dependent)
- let sgx access your general timer-variable using sgxSetEmsContainer()


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Jun 14, 2008 5:42 pm 
Offline
User
User
User avatar

Joined: Mon Apr 30, 2007 7:02 am
Posts: 54
Hey there, I chose to pick this screengadgetry for the game I have been working on. I had it planned I write something like this (although alot simpler) by myself but I can skip that part :)

Very nice code.

What I have already changed to better implement this code in my game UI is how sgxExamine() returns hovering information which I can use to avoid making mouse actions within the game field when user is clicking gadgets instead. It was just addinitonal variable which sgxExamine() returns as true/false if mouse is over a gadget.

I will list any bugs I come up with instead of just dirty fixing them ;)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Aug 13, 2008 10:20 pm 
Offline
Enthusiast
Enthusiast

Joined: Tue Apr 04, 2006 6:27 am
Posts: 311
This was linked to from the other GUI thread ...

To the poster above ... could you post your changes here? That would be nice ..

Also, to the person who created this. Have you made any chances since posting this code? How is the devel-package coming along?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Aug 14, 2008 10:25 am 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 870
Location: right here
i think it schould be enough to add this line at the end of the procedure sgxExamine:
Code:
Procedure sgxExamine(...
 
  ; [...]
 
  ProcedureReturn topID
EndProcedure
so it will return the gadget-id under the mouse, or -1 if none is there. you could also adapt it to return 0 for no hover istead of -1 if that suits you more.

besides there is the function sgxGetTopWindow(), which is used in sgxExamine() to get the value for 'topID' anyway.

i will see how i can make the devel-package. (i need to include tools, change *.bat scripts and tidy up the directory a bit..)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Aug 14, 2008 11:03 pm 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 870
Location: right here
i added a download for the complete project directory (see first post).
also some changes (some where possibly uploaded already undocumented):
Quote:
- sgxCloseLevel() got a parameter to close all levels.
- sgxExamine() returns hover information like sgxGetTopWindow().
- sgxSpriteGadget() added.
- (toggle)buttons can have an additional user sprite to be displayed.


there is also one more design, but it's only slightly different from 'outdoor'.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye