Here is my first tailbite library for Purebasic.
It allows you to create PB Gadgets in Groups and do different interations on these groups.
Doc for online-reading for those who want to know what their download:
Download here:
http://divx-station.dyndns.org/LIB_SCLGadgets.zip
EDIT: Updated the archive! Addes resident file and a example to see what happens here.

Code: Select all
Small instruction Manual for SCLGadget extension tailbite library for purebasic
Version .1 BETA BETA BETA :-)
Try it and report bugs on the forum threat or send a mail to mike.delling@secretly.de
Introduction:
-------------
I searched for a small and easy to use way of grouping gadgets. It was a hazle to reset a complete form to their standard content without having a group. So, this lib has been createt.
It is a nearly 1:1 wrapper of the original Purebasic-Gadget commands but extends them in some more possibilities.
How it works:
-------------
At first create a group by using the Command SCLCreateGroup([name.s]). It returns a GroupID >0 or a value <=0 if there is an error and the group could not be created.
Now create your gadgets using the SCLGadget-Commands like you know it from purebasic gadgets.
Supported gadgets are:
- ButtonGadget
- TextGadget
- ButtonImageGadget
- CalendarGadget
- CheckBoxGadget
- ComboBoxGadget
- ContainerGadget
- DateGadget
- EditorGadget
- ExplorerGadget
- ExplorerListGadget
- ExplorerTreeGadget
- Frame3dGadget
- HyperLinkGadget
- IPAddressGadget
- ImageGadget
- ListIconGadget
- ListViewGadget
- MDIGadget
- OptionGadget
- PanelGadget
- ProgressBarGadget
- ScrollAreaGadget
- ScrollBarGadget
- SpinGadget
- SplitterGadget
- TrackBarGadget
- TreeGadget
- WebGadget
After creating your gadgets you can use:
- SCLSetGroupAttribByName()
- SCLSetGroupAttribByID()
- SCLSetGadgetDefaultText()
- SCLSetGadgetDefaultStats()
- SCLRestoreGadgets()
- SCLClearGadgets()
Command Overview (Group Creation & Misc Stuff):
-----------------------------------------------
GroupID.l = SCLCreateGroup([name.s])
Returns a value >0 if everything went fine, otherwise a value less then 1 is returned.
[name.s] is optional and can be defined to give a more clearlier name to the group.
This command can also return #SCL_GadgetError_GroupAllreadyExists (Value -2) if the optional defined group is allready existing. In this case the group is not created.
If the returning value is zero then there is something wrong with your memory. A new element could not be added to the internal list of gadgets.
Result = SCLUseGroup(GroupID.l)
Makes the new GroupID the actual one. All SCL-Gadgets created after that command belongs to this group if no other group is specified in the syntax of the Gadget itselfe.
It returns #True if the group has been changed or #False if the group has not been found.
name.s = SCLGetGroupName(id.l)
Returns the name of the given GroupID or an empty string if GroupID does not exist.
GroupID.l = SCLGetGroupID(GroupName.s)
Returns the GroupID of the given GroupName or #SCL_GadgetError_GroupDoesNotExists if the group does not exist.
Result = SCLGetGadgetType(GadgetID.l)
Returns the type of gadget. Its usefull for common handling in window callback that belongs to one type of gadgets only. (eg ListViews) If the returning value is equal to zero then the gadget has not been found in list.
Here is a list of Results that can be returned by this command:
#PB_Gadget_Button = 1
#PB_Gadget_Text = 2
#PB_Gadget_ListIcon = 3
#PB_Gadget_ListView = 4
#PB_Gadget_ComboBox = 5
#PB_Gadget_ButtonImage = 6
#PB_Gadget_Calendar = 7
#PB_Gadget_Checkbox = 8
#PB_Gadget_Container = 9
#PB_Gadget_Date = 10
#PB_Gadget_Editor = 11
#PB_Gadget_ExplorerCombo = 12
#PB_Gadget_ExplorerList = 13
#PB_Gadget_ExplorerTree = 14
#PB_Gadget_Frame3D = 15
#PB_Gadget_HyperLink = 16
#PB_Gadget_IPAddress = 17
#PB_Gadget_Image = 18
#PB_Gadget_MDI = 19 (Not supported yet)
#PB_Gadget_Option = 20
#PB_Gadget_Panel = 21
#PB_Gadget_ProgressBar = 22
#PB_Gadget_ScrollArea = 23
#PB_Gadget_ScrollBar = 24
#PB_Gadget_Spin = 25
#PB_Gadget_Splitter = 26
#PB_Gadget_String = 27
#PB_Gadget_TrackBar = 28
#PB_Gadget_Tree = 29
#PB_Gadget_Web = 30
result = SCLCountGadgets()
Returns the number of gadgets in all Groups. This command will be extended in one of the next versions to optionaly return the number of gadgets of a group.
Gadget / Group Manipulation Commands:
-----------------------------
SCLSetGroupAttribByName(GroupName.s,flags.l) or SCLSetGroupAttribByID(GroupID.l,flags.l)
Flag could be one of the following constants:
#SCL_Gadget_Hide
#SCL_Gadget_Show
#SCL_Gadget_Disable
#SCL_Gadget_Enable
ReturnValue = SCLClearGadgets(GroupID.l)
Sets all Strings of a group to blank and all values to zero. The command returns the number of changes that has been made by it. So, if is zero no changes has been made.
ReturnValue = SCLRestoreGadgets(GroupID.l)
Resets all Gadgets to its default value set on its creation.
That means that for eg SCLTextGadgets and SCLStringGadgets will be set to its inital text set by one of the SCLgadget Commands.
As there is no optional "State" atm for listview, listicon etc. these states will be set to -1 (no item selected) as this is the inital creation value. I will add this feature later.
The following Gadgets are NOT supported to be reseted to their defaults atm:
#PB_Gadget_ButtonImage
#PB_Gadget_Container
#PB_Gadget_Image
#PB_Gadget_MDI
#PB_Gadget_Panel
#PB_Gadget_Splitter
SCLSetGadgetDefaultText(id.l,DefaultText.s)
Changes the default text after the gadget creation. Your changings will not be shown on the gadget after this command. It only sets the default text to the new default one.
SCLSetGadgetDefaultState(id.l,DefaultState.l)
Changes the default state value for the defined gadget after its creation. This State will not be shown to the gadget. It only sets the value to the new default one.
ToDo:
--------
- A real .chm file
- Support more Gadgets
- Add more specials to the gadgets (attribs etc. etc)
- Speed improvements
- maybe Bugfixes