Grouping Gadgets

Got an idea for enhancing PureBasic? New command(s) you'd like to see?

Good idea or not a good idea

YES, we need that!
7
58%
Hm, intresting but not very neccassary
4
33%
We never need this shit!
1
8%
 
Total votes: 12

Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Grouping Gadgets

Post by Tranquil »

Hi All and PB-Team.

One of my bigged whishes to PB ts the ability to group gadgets. (not like the Container gadget!)

Let me explain:

ATM, I need to do thousend calls to clear a user-interface-mask like:

SetGadgetText(aaa,““)
SetGadgetText(bbb,““)

Etc.

That expands the source more often even if you create procedures for it.

So my whish in detail like this source:

CreateGadgetlist(hWnd)

GroupID = CreateGadgetGroup([Groupname.s])
IDString = StringGadget(#PB_Any,0,0,100,20,“blabla“) : SetGroupDefaultText (IDString,““)
: SetGroupDefautAttrib(IDString,#PB_Gadget_Disable)
IDCheck = CheckBoxGadget(#PB_Any,0,20,100,50,"bla") : setGroupDefaultText (IDCheck,"default for blabla")
SetGroupDefaultState(IDCHeck,1)


There two Gadgets now belong to the group created above with its default settings set by the "SetGroupDefault..." command.
It would now be nice to have the following commands to interact with these groups:


RestoreGroup(GroupID.l or GroupName.s)
Restores all the Gadgets in this Group to its default settings specified by the SetGroupDefault.... Command.

SetGroupAttrib(GroupID.l or Groupname.s,Attrib.l]
Sets the Attributes defined by Attrib.l to the specified Group. Attrib Could be:
#PB_Gadget_Hide
#PB_Gadget_Disable
#PB_Gadget_ReadOnly
...

RemoveGroupAttrib(GroupID.l or Groupname.s,Attrib.l]
Removes the Attributes defined by Attrib.l to the specified Group. Attrib Could be:
#PB_Gadget_Hide
#PB_Gadget_Disable
#PB_Gadget_ReadOnly
...

SetGroupText(GroupID.l or Groupname.s,text.s,[flags.l])
Sets the defined "Text" to all Group-Gadgets.
If flags is specified the text could ony be alligned to some sorts of gadgets:
#PB_Gadget_String
#PB_Gadget_Text
...

RemoveGroupItem(GroupID.l or Groupname.s,GadgetID)
Removed the specified Gadget from the Group.

AddGroupItem(GroupID.l or Groupname.s,GadgetID)
Adds an Gadget to a group. It should be possible to add one gadget to more groups.

FreeGadgetGroup(GroupID.l or Groupname.s)
Frees the Gadget Group. (But keep the gadgets, dont free them too!)

items.l=CountGagdetGroupItems(GroupID.l or Groupname.s)
Returns the number of items in this Group.

itemID.l=NextGadgetCroupItem(GroupID.l or Groupname.s)
Returns the next GadgetID in the Group-List. CountGadgetGroupItems() need to be called first to select the first element in the Group-List

text.s =GetGroupDefaultText(GroupID.l or Groupname.s,GadgetID)
Returns the Default Text of a Gadget specified by SetGroupDefaultText().

state.l=GetGroupDefaultState(GroupID.l or Groupname.s,GadgetID)
Returns the default Gadget-State of a gadget specified by SetGroupDefaultState().

value.l=GetGroupDefaultValue(GroupID.l or Groupname.s,GadgetID)
Returns the default Gadget-Value of a gadget specified by SetGrouüDefaultValue().



Okay, thats should be all. What do you think about this?

Mike
Tranquil
nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Post by nicolaus »

In the german board i have post a little example for a groupboxgadget but this have bugs and so i write a new version and post it.
I think a groupboxgadget we must have!!!!
here a link to the GroupBoxGadget
Post Reply