Stuck with list control.. (1 Viewer)

Tomato

Portal Member
March 5, 2007
32
2
Hamburg, die schönste Stadt der Welt
Home Country
Germany Germany
Hi there.

Im trying to add just a "simple" list to my plugin containing some buddies.

I added the follogin code to my skinfile:
Code:
<window>
  <id>4788</id>
  <defaultcontrol>2</defaultcontrol>
  <allowoverlay>yes</allowoverlay>
  <controls>

    <control>
      <description>BackGround</description>
      <type>image</type>
      <id>1</id>
      <posX>0</posX>
      <posY>0</posY>
      <width>720</width>
      <height>576</height>
      <texture>background.png</texture>
    </control>

    <control>
      <description>an Image</description>
      <type>image</type>
      <id>1</id>
      <posX>75</posX>
      <posY>370</posY>
      <texture>hover_my videos.png</texture>
    </control>

    <control>
      <description>text label</description>
      <type>label</type>
      <id>1</id>
      <posX>250</posX>
      <posY>70</posY>
      <label>Some text</label>
      <font>font16</font>
      <align>right</align>
      <textcolor>ffffffff</textcolor>
    </control>

    <control>
      <description>Connect to ICQ</description>
      <type>button</type>
      <id>2</id>
      <posX>60</posX>
      <posY>97</posY>
      <label>Connect</label>
      <onleft>2</onleft>
      <onright>2</onright>
      <onup>2</onup>
      <ondown>3</ondown>
    </control>

    <control>
      <description>Setup</description>
      <type>button</type>
      <id>3</id>
      <posX>60</posX>
      <posY>131</posY>
      <label>Setup</label>
      <onleft>2</onleft>
      <onright>2</onright>
      <onup>2</onup>
      <ondown>4</ondown>
    </control>

    <control>
      <description>doof</description>
      <type>listcontrol</type>
      <id>3</id>
      <posX>60</posX>
      <posY>151</posY>
      <label>doof</label>
      <onleft>2</onleft>
      <onright>2</onright>
      <onup>2</onup>
      <ondown>4</ondown>
    </control>


[B]<control>
  <description>listcontrol</description>
  <type>listcontrol</type>
  <id>50</id>
  <width>50</width>
  <height>60</height>
  <onleft>2</onleft>
  <onright>51</onright>
  <onup>2</onup>
  <ondown>2</ondown>
  <textcolor>FFFFFFFF</textcolor>
</control>[/B]





  </controls>
</window>

To be honest nearly just copy/paste from the example in wiki

After that I inserted the following code into my c#-project:
Code:
[SkinControlAttribute(50)]
        protected GUIListControl ListControl = null;
[...]

function dontcare() {
ListControl.Add(new GUIListItem("HOWDIE!"));
}

But nothing seems to happen. (I cant see any ListControl). Im quite sure this is something relly stupid but I just don't get it (and didn't find an answer here either).

So: Wheres my mistake?

:confused:
 

CyberDannen

Portal Member
May 31, 2006
46
1
Berlin
Home Country
Germany Germany
Goog Morning,
i will be going the First steps in Plugin Delepoment, but I have the same problem. Can someone helps us ?
Thx
Christian
 

Doodles

Portal Pro
September 9, 2006
84
14
Home Country
United Kingdom United Kingdom
Hi! I'm no expert, but I've had some experience which may help.

Every control type is pre-specified in the file reference.xml. So, whenever you use a control in your skin file, it presets the parameters to those specified in reference.xml and then overrides any you specify with the values you define. So, if you don't specify <posX> and <posY> in your skin file, it will use those give for listcontrol in reference.xml. I recommend you review reference.xml to see which parameters you need to override.

It does look like the height and width specified are too small. The number of items displayed in a listcontrol is given roughly by <height>/(<textureheight> + <spacebetweenitems>). So, in the example above, if <contexheight> + <spacebetweenitems> (from reference.xml) is larger than 60, no items will appear, so the list appears blank.

Hope this helps.
 

Users who are viewing this thread

Top Bottom