I've recently been playing around with gui's and came across something that no matter how much trial and error i attempt i cannot get this to work.
Basically it's a gui with a dynamic number of tabs depending on a string being set. With a pane for each of these tabs, but for the life of me I cannot get the pane to show.
Any help would be greatly appreciated:
NPC Code:
function onSetup()
{
new GuiWindowCtrl("testWindow")
{
profile = "GuiBlueWindowProfile";
useownprofile = true;
extent = "400 600";
position = "30 30";
text = "testWindow";
destroyonhide = false;
canmaximize = false;
canresize = false;
new GuiTextCtrl("testTitle")
{
profile = "GuiBlueTextProfile";
useownprofile = true;
position = "120 25";
profile.fontsize = 20;
profile.fontcolor = {255,255,255};
profile.fontType = "Verdana";
text = "Dynamic Tabbing";
}
frameInd=1;
while(clientr.("imgstore"@frameInd))
{
new GuiFrameSetCtrl("mainFrame"@frameInd)
{
position = "20 80";
extent = "350 400";
rowcount = 5;
columncount = 4;
visible=false;
bordermovable="alwaysOff";
totalcount = rowcount*columncount;
for(imgInd=0;imgInd<totalcount;imgInd++)
{
new GuiControl("imgBox"@imgInd)
{
profile = "GuiBlueScrollProfile";
useownprofile = true;
hscrollbar = "dynamic";
vscrollbar = "dynamic";
new GuiShowImgCtrl("img"@imgInd)
{
position = "15 10";
extent = "48 48";
image = clientr.("imgstore"@frameInd)[imgInd]@".png";
offsetx = "-96";
thiso.catchevent(name,"onMouseDown","onImgSelect") ;
}
}
}
frameInd++;
}
}
new GuiTabCtrl("testTab")
{
profile = "GuiBlueTabProfile";
useownprofile = true;
position = "20 60";
extent = "380 20";
tabwidth = "70";
clearrows();
tabInd=1;
while(clientr.("imgstore"@tabInd))
{
with(addrow(tabInd-1,"Set " @tabInd))
{
this.pane="mainFrame"@tabInd;
}
tabInd++;
}
thiso.catchevent(name, "onSelect", "onTabSelect");
}
}
testTab.setSelectedById(0);
graalControl.addControl(testWindow);
}
function onTabSelect(tabs)
{
tabs.selected.pane.show();
}