Grouping Gadgets
Posted: Mon Jun 06, 2005 8:24 am
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
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