Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Check if Box is a member of a Group (Read 2023 times)
andrewsando1973
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Feb 14th, 2010
Check if Box is a member of a Group
Oct 11th, 2010 at 7:42pm
Print Post  
Hi Stoyo,

1) How can i check if the box is a member of a Group (whether it is the main object or not)?

2) Also, how to get if the box is placed into a container, then get its parent container?

3) sometimes, when i move the boxes placed in container of a distance more than 300, the container is not resized even if the AutoResize is set to true?

4) Is it possible to add a group to a container, as when i add individual boxes to container the group is destroyed, also when i try to re-create the group, it doesn't work?

Thanks in advance
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Check if Box is a member of a Group
Reply #1 - Oct 12th, 2010 at 4:23am
Print Post  
Hi,

1) Use the SubordinateGroup and MasterGroup properties:
Code
Select All
If (Not box.SubordinateGroup Is Nothing) Or (Not box.MasterGroup Is Nothing) Then
	MsgBox ("in group")
End If 



2) You can get it through MasterGroup too:
Code
Select All
Function GetContainer(ByVal child As box) As box
	If child.MasterGroup Is Nothing Then Exit Function
	If Not TypeOf child.MasterGroup.MainObject Is box Then Exit Function
	Dim b As box
	Set b = child.MasterGroup.MainObject
	If b.Style = bsContainer Then Set GetContainer = b
End Function 



3) Do you move them out of the container, or they stay inside? If the former, the child nodes will be detached from the container.

4) That seems to work in my test, and also adding boxes interactively does not destroy the group:
Code
Select All
\Dim ctr As box
Set ctr = fcx.CreateBox(30, 30, 400, 200)
ctr.Style = bsContainer
ctr.AutoResizeContainer = True
ctr.LayoutStyle = lsCustom

Dim g2 As group
Set g2 = fcx.CreateGroup(ctr)
Dim bb As box
Set bb = fcx.CreateBox(50, 260, 50, 50)
g2.AttachToCorner bb, 0

fcx.CreateBox(60, 60, 30, 30).PutInContainer ctr 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint