PDA

View Full Version : Controls


killerogue
08-04-2007, 10:35 PM
temp.ainfo = System.serverFunction(this.name, "getAbilities", player.account);
temp.i = 1;
with (Mal_Main) {
new GuiScrollCtrl(Mal_Ability_Scroll) {
position = {32, 44};
extent = {143, 225};
image = null;
//red = green = blue = alpha = 0;
hScrollBar = vScrollBar = "alwaysOff";
new GuiTextListCtrl(Mal_Abilities_Scroll) {
x = y = 0;
width = 200;
fitparentwidth = true;

clearrows();
for (a : temp.ainfo) {
echo(a);
addrow(temp.i, a[0]);
temp.i++;
}
setSelectedRow(1);
}
}
}


This is pretty weird. So far, when I have two problems. When I put the text list ctrl inside the scroll control, the text lister isn't shown. But when I put it outside of the scroll ctrl and take away the scroll altogether I can't make make the text list as long as I need to.

zokemon
08-05-2007, 01:03 AM
What objecttype() is Mal_Main?
I experienced once (it was back in v4 though) where the width of a textlist and treeview would be set to 8 regardless of any width I had set or if fitparentwidth was on or off. This would only happen when I had the scroll control in a certain type of GUI but I don't remember which one, sorry :(

killerogue
08-05-2007, 05:12 AM
Mal_Main is a Regular GuiControl.

DustyPorViva
08-05-2007, 05:33 AM
Have you tried putting the for outside of the control?

for (a : temp.ainfo) {
echo(a);
Mal_Abilities_Scroll.addrow(temp.i, a[0]);
temp.i++;
}

killerogue
08-05-2007, 05:45 AM
Didn't make any difference. We ARE talking about the text list control width tho dusty :p

DustyPorViva
08-05-2007, 06:01 AM
Ah, no idea what really was the problem :x

zokemon
08-05-2007, 06:37 AM
Hmm. When I had this problem, addrow() refused to work for me also just so you know.

Trying changing the GuiTextListCtrl to GuiTreeViewCtrl and change the addrow's to addnode's
(Just so you can see if it works. Infact, you can even use a treeviewctrl as a textlist if you have to.. Just remove the first line and don't add any child nodes to any root node. Then it should look identical (but this is only incase GuiTextListCtrl just refuses to work)

Also try changing it to a simple control like a GuiBitmapCtrl and set the image just so you know that controls are being placed in the container and actually take up your specified size.

killerogue
08-05-2007, 06:57 AM
I know it's working when I use it outside of the Scroll ctrl. I just can't get it to the right size. But when I put the text list inside the scroll it refuses to show or work.

Thanks Zero, I may have to end up using a tree view ctrl. :P But thanks for your help. <3

xXziroXx
08-05-2007, 12:37 PM
Stan, check my posts in this thread:

http://forums.graalonline.com/forums/showthread.php?t=75724&page=2

The problem lies in the GuiScroll profile, I have yet to test my way to which var is causing it.