my useful and useless
PureBasic stuff


a quine :)
s$="s$= : Debug Mid(s$,1,3)+Chr(34)+s$+Chr(34)+Mid(s$,4,100)" : Debug Mid(s$,1,3)+Chr(34)+s$+Chr(34)+Mid(s$,4,100) (what's this?)


sgx 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
[pic] [german forum] [english forum]


keyboardEdit.pbi an includefile for text-editing under (full)screen. there is an example at the end.
plus.pbi a bunch of basic functions and macros.
boxXY.pbi wrapper for the PB command Box()
rgb.pbi get a color where R = G = B with gray(), or change brightness of a color with fade().
getAngle.pbi get the angle of a line from one point to another
polygon.pbi some polygon macros. (uncludes getAngle.pbi)
lineXYthick.pbi drawing lines with 3 pix thickness
fps.pbi calculates the frames per seconds from the elapsed milliseconds (call it once per frame).
drawTextLF.pbi a multiline drawtext. you can choose the newline character, inquire the final drawing position after a call, and you can let following lines wrap to a different x-position than the x-start.
dirIsEmpty.pbi check if a directory is empty
allocInfo.pbi wrapping the PB commands AllocateMemory() and FreeMemory() to be always able to inquire the amount of currently allocated bytes for all allocations together.
rotateSprite.pbi simple procedure to rotate a sprite on any angle.