View Full Version : Tree and Info
markstaylor
05-28-2009, 09:06 PM
What do I need to do to get the right side of the page to ack like a seperate page. See images of an example I found online.
I want to use the tree and have different information on the right. Do I need to add all the objects and hide/show for each tree node? That seems like alot of coding. Can you group items and hide/show the group. There has got to be a better way.
Do I need a seperate page for each node item?
Any example or ideas are greatly appreciated.
http://www.leadmind.com/img/screens/opt-userinfo.png
http://www.leadmind.com/img/screens/opt-sounds.png
MicroByte
05-29-2009, 05:33 AM
AMS is not exactly built for making screens like that, with the absence of a scroll area this task is made a little tricky, although that said it is possible to achive with a paragraph object, but with lots of code+math trickery
for screens without the need for a scroll area, search out RizlaUK's Group actions, you can hide/show/move/disable groups of objects with a lot less code than doing it your self
markstaylor
05-29-2009, 10:23 AM
Thanks,
but the second screenshot may not be a great example. I don't really need a scroll area just multiple screenshot 1 examples for each tree object. Each with different data and objects.
Make sense?
MicroByte
05-29-2009, 12:02 PM
Make sense?
sure, then RizlaUK's group actions are all you need
oops, found it and it was not RizlaUK but worm that made the group actions
http://www.indigorose.com/forums/showpost.php?p=119100&postcount=3
MicroByte
05-29-2009, 12:12 PM
knew i had a script somewhere, heres a extended version of the action set (im sure RizlaUK wrote this one)
--[[************************************************** ******]]--
--[[ Set up a table to reference the objects in AMS ]]--
--[[************************************************** ******]]--
tbObjectType = {}
tbObjectType[OBJECT_BUTTON] = Button;
tbObjectType[OBJECT_LABEL] = Label;
tbObjectType[OBJECT_PARAGRAPH] = Paragraph;
tbObjectType[OBJECT_IMAGE] = Image;
tbObjectType[OBJECT_FLASH] = Flash;
tbObjectType[OBJECT_VIDEO] = Video;
tbObjectType[OBJECT_WEB] = Web;
tbObjectType[OBJECT_INPUT] = Input;
tbObjectType[OBJECT_HOTSPOT] = Hotspot;
tbObjectType[OBJECT_LISTBOX] = ListBox;
tbObjectType[OBJECT_COMBOBOX] = ComboBox;
tbObjectType[OBJECT_PROGRESS] = Progress;
tbObjectType[OBJECT_TREE] = Tree;
tbObjectType[OBJECT_RADIOBUTTON] = RadioButton;
tbObjectType[OBJECT_RICHTEXT] = RichText;
tbObjectType[OBJECT_CHECKBOX] = CheckBox;
tbObjectType[OBJECT_SLIDESHOW] = SlideShow;
tbObjectType[OBJECT_GRID] = Grid;
tbObjectType[OBJECT_PLUGIN] = Plugin;
--[[************************************************** ******]]--
--[[ Group Actions ]]--
--[[************************************************** ******]]--
m_tblGroup = {};
GroupEX = {};
--################################################## #################################################
GroupEX.AddItem = function (sObjectName, sGroupName)
local nIndex = Table.Count(m_tblGroup) + 1;
Table.Insert(m_tblGroup, nIndex, {})
m_tblGroup[nIndex].Group = sGroupName;
m_tblGroup[nIndex].Object = sObjectName;
m_tblGroup[nIndex].ObjectType = Page.GetObjectType(sObjectName);
end
--################################################## #################################################
GroupEX.RemoveItem = function (sObjectName, sGroupName)
for i in m_tblGroup do
if m_tblGroup[i].Group == sGroupName and m_tblGroup[i].Object == sObjectName then
Table.Remove(m_tblGroup, i);
break;
end
end
end
--################################################## #################################################
GroupEX.SetVisible = function (sGroupName, bVisible, bRedraw = false)
Application.SetRedraw(bRedraw)
for i in m_tblGroup do
if m_tblGroup[i].Group == sGroupName then
local Object = tbObjectType[m_tblGroup[i].ObjectType];
if Object.SetVisible then
local Name = m_tblGroup[i].Object
Object.SetVisible(Name, bVisible)
end
end
end
Application.SetRedraw(true)
end
--################################################## #################################################
GroupEX.SetEnabled = function (sGroupName, bEnable, bRedraw=false)
Application.SetRedraw(bRedraw)
for i in m_tblGroup do
if m_tblGroup[i].Group == sGroupName then
local Object = tbObjectType[m_tblGroup[i].ObjectType];
if Object.SetEnabled then
local Name = m_tblGroup[i].Object
Object.SetEnabled(Name, bEnable)
end
end
end
Application.SetRedraw(true)
end
--################################################## #################################################
GroupEX.Move = function (sGroupName, xDiff, yDiff, bRedraw)
Application.SetRedraw(bRedraw)
for i in m_tblGroup do
if m_tblGroup[i].Group == sGroupName then
local Object = tbObjectType[m_tblGroup[i].ObjectType];
local Name = m_tblGroup[i].Object
if Object.SetPos then
Object.SetPos(Name, Object.GetPos(Name).X + xDiff, Object.GetPos(Name).Y + yDiff)
end
end
end
Application.SetRedraw(true)
end
--################################################## #################################################
GroupEX.IsVisible = function (sGroupName)
for i in m_tblGroup do
if m_tblGroup[i].Group == sGroupName then
local Object = tbObjectType[m_tblGroup[i].ObjectType];
if Object.IsVisible then
local Name = m_tblGroup[i].Object
return Object.IsVisible(Name)
end
end
end
end
--################################################## #################################################
GroupEX.IsEnabled = function (sGroupName)
for i in m_tblGroup do
if m_tblGroup[i].Group == sGroupName then
local Object = tbObjectType[m_tblGroup[i].ObjectType];
if Object.IsEnabled then
local Name = m_tblGroup[i].Object
return Object.IsEnabled(Name)
end
end
end
end
--################################################## #################################################
GroupEX.Count = function (sGroupName)
local nCount=0
for i in m_tblGroup do
if m_tblGroup[i].Group == sGroupName then
nCount=nCount+1
end
end
return nCount
end
--################################################## #################################################
GroupEX.CreateObject = function (sObjName,cObjType,tbObjProps,sGroupName)
Page.CreateObject(cObjType,sObjName,tbObjProps);
local error = Application.GetLastError();
if (error ~= 0) then
return error
else
Group.AddItem(sObjName, sGroupName);
return 0
end
end
--################################################## #################################################
GroupEX.DeleteObject = function (sObjName,sGroupName)
Group.RemoveItem(sObjName, sGroupName);
Page.DeleteObject(sObjName);
local error = Application.GetLastError();
if (error ~= 0) then
return error
else
return 0
end
end
--################################################## #################################################
GroupEX.IsObject = function (sObjName)
local strReturn = ""
for i, sGroup in m_tblGroup do
local strObject = m_tblGroup[i].Object
if strObject == sObjName then
strReturn = m_tblGroup[i].Group
break
end
end
return strReturn
end
--################################################## #################################################
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.