Announcement

Collapse
No announcement yet.

[UT2k4] GUIs & Tabs question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [UT2k4] GUIs & Tabs question

    Hello all,

    I'm having a problem with tabs in UT2K4, I was hoping someone can help me out. At the moment I'm just trying to get a very basic setup working ... nothing spectacular yet. I just want one tab with a simple label in it, but nothing is showing all I get is a black screen. I' According to the logs everything should be fine and ok.

    This is more or less what I'm doing, I'm using three classes a panel to hold the tab content, a tabcontrol and a GUIPage. More specifically:

    class SomeTab extends GUITabPanel;

    function initComponent(GUIController myController,
    GUIComponent myOwner) {
    local GUILabel aLabel;

    super.initComponent(myController, myOwner);

    aLabel = new class 'GUILabel';
    // ... some code to set the label params here ...
    appendComponent(aLabel);
    }
    class HUDTabControl extends GUITabControl;

    function initComponent(GUIController myController,
    GUIComponent myOwner) {

    super.initComponent(myController, myOwner);
    addTab("Foo", "aPackage.SomeTab");
    }
    class SomePage extends UT2K4GUIPage;

    function initComponent(GUIController myController, GUIComponent myOwner) {

    super.initComponent(myController, myOwner);
    appendComponent(new class 'HUDTabControl');
    }
    Any help is appreciated ,

    Best Regards
    Mrk

    #2
    Everything seems in order. Do your TabPanel and TabControl classes have Styles?

    Comment


      #3
      Hello Ron, thanks for the reply ...

      I don't set the styles (explicitely) ... so in short no; this is pretty much what the code looks like at this point.

      Comment


        #4
        Ah, I see - few of things to try:
        1. verify that your tabcontrol actually has a size (that is, its WinWidth & WinHeight are greater than zero)
        2. set your TabControl's bDockPanels property to true
        3. give the TabControl a style (you can use the "NoBackground" style if you don't want your tabcontrol to have a background)


        Out of the three, I thiunk #2 is the prime suspect, since you're seeing nothing but black. bDockPanels docks the panels to the tab control, but it also resizes the panels to fill the GUITabControl's bounds (minus the space for the TabButtons, of course). Unless this GUIPage is the only one open, the black is probably your GUITabControl being drawn.

        Comment


          #5
          Checked 1: doesn't have any influence, still don't see anything
          Checked 2: It shows the tab button ( yay !) but still I don't see my label
          Checked 3: Still doesn't show my label

          sigh ... ok here goes; the complete code so far. There's probably a user error somewhere but I can't spot it

          class testGUIPage extends UT2K4GUIPage;

          function initComponent(GUIController myController, GUIComponent myOwner) {

          super.initComponent(myController, myOwner);
          appendComponent(new class 'testTabPane');

          }
          class testTabPane extends GUITabControl;

          function initComponent(GUIController myController, GUIComponent myOwner) {


          super.initComponent(myController, myOwner);
          addTab("Foo", "Hud.testTabPaneContent");
          }

          defaultproperties {
          winWidth = 1.0
          winHeight = 1.0
          bDockPanels = true
          styleName="NoBackground"
          }
          class testTabPaneContent extends GUITabPanel;

          function initComponent(GUIController myController, GUIComponent myOwner) {
          local GUILabel aLabel;

          super.initComponent(myController, myOwner);

          aLabel = new class 'GUILabel';
          aLabel.caption= "bla";
          aLabel.textColor.r = 255;
          aLabel.textColor.g = 255;
          aLabel.textColor.b = 255;
          aLabel.textColor.a = 255;
          aLabel.winWidth = 0.2;
          aLabel.winHeight = 0.2;
          aLabel.winTop = 0.3;
          aLabel.winLeft = 0.3;

          appendComponent(aLabel, true);
          }

          Comment

          Working...
          X