Author Topic: GuiScrollCtrl & GuiTextList Are Whack, Help.  (Read 1180 times)

bbs

So, i used Guiscrollctrl as a parent for guitextlist and i get rows on my list but the rows are limited to 24, is this because of the size of my gui?

Code: [Select]
        };
         new GuiScrollCtrl() {
            profile = "GuiScrollProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "40 83";
            extent = "271 271";
            minExtent = "8 2";
            enabled = "1";
            visible = "1";
            clipToParent = "1";
            willFirstRespond = "0";
            hScrollBar = "alwaysOff";
            vScrollBar = "alwaysOn";
            constantThumbHeight = "0";
            childMargin = "0 0";
            rowHeight = "40";
            columnWidth = "30";

            new GuiTextListCtrl(Crpg_jobselectList) {
               profile = "GuiTextListProfile";
               horizSizing = "right";
               vertSizing = "bottom";
               position = "1 1";
               extent = "259 2";
               minExtent = "8 2";
               enabled = "1";
               visible = "1";
               clipToParent = "1";
               enumerate = "0";
               resizeCell = "1";
               columns = "0";
               fitParentWidth = "1";
               clipColumnText = "1";
            };
         };
%list = Crpg_JobselectList
%string = "a b c d e f g h i j k l m o p q r s t u v w x y z abc asd gre asd weq trg daw"; // y would be the 24th row
%c = getWordCount(%string) + 1;
for(%i=0;%i < %c;%i++)
{
%letter = getWord(%string,%i);
%list.addRow(%i,%letter);
}


in the end i would only get up to y because it's the 24th row, z would not show. and it seems that is the limit for me, and ideas on how to change it
« Last Edit: June 19, 2013, 09:13:02 PM by bbs »


Post the part of your code where you are adding rows to it.

bbs

So, i  was thinking that maybe, it was the string is there any other ways of adding rows from a string or an array, without having to unpack and pack the array.

That is a very bad idea, NEVER directly use local variables in scripts, always create a function first
Code: [Select]
function blah(){
%list = Crpg_JobselectList
%string = "a b c d e f g h i j k l m o p q r s t u v w x y z abc asd gre asd weq trg daw";
%c = getWordCount(%string);
for(%i=0;%i < %c;%i++)
{
%letter = getWord(%string,%i);
%list.addRow(%i,%letter);
}
}
blah();

bbs

It originally was.
Code: [Select]
function clientCmdCrpg_addJobToList(%String, %count)
{
%o = Crpg_jobselectList;
%o.clear();
%count +=1;

for(%i=1;%i< %count;%i++)
{
%w = getWord(%String,%i);
%o.addRow(%i,%w);
}
}

i just wanted to show how i made the list, and if there is a reason for my list to be capped at 24 rows, although the 24th row is always cut off, the text in the row i mean.

It originally was.
Code: [Select]
function clientCmdCrpg_addJobToList(%String, %count)
{
%o = Crpg_jobselectList;
%o.clear();
%count +=1;

for(%i=1;%i< %count;%i++)
{
%w = getWord(%String,%i);
%o.addRow(%i,%w);
}
}

i just wanted to show how i made the list, and if there is a reason for my list to be capped at 24 rows, although the 24th row is always cut off, the text in the row i mean.

That is not well written. Optimally, your function should do one task, and one task only. If the name is "addJobToList", I would expect it to add a single job to the list, not to clear the list and then add a bunch of jobs.

bbs

That is not well written. Optimally, your function should do one task, and one task only. If the name is "addJobToList", I would expect it to add a single job to the list, not to clear the list and then add a bunch of jobs.

so if i changed the name of the function to addJobsToList it would be much more well written?