Static text prevents usage of window underneath

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Rakkar
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Aug 15, 2006 02:49

Static text prevents usage of window underneath

Postby Rakkar » Thu Nov 02, 2006 22:56

I have a root window to which I have attached a child layout. The child layout has buttons. For debugging static text, I also create a window in code and attach this window to the root window. The intended behavior is that the static text is non-interactive (cannot be clicked, selected, etc) and should show up over the layout. However, when I display my static text window I am unable to interact with the layout (buttons do not highlight, cannot press buttons).

I don't know the size of the window for the static text beforehand - it may indeed take up the entire screen or may indeed block buttons under it, which should still be usable.

How do I display the static text without it interfering with other windows? It is not an option to attach the static text to the child layout.

Here is my code:

Code: Select all

FadingText *fadingText = new FadingText;
   fadingText->fadeController.Setup(fadeInTimeMS, lifeTimeMS,fadeOutTimeMS);
   fadingText->staticText=(CEGUI::Window*) CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/StaticText");
   fadingText->staticText->setText(string);
   if (font)
      fadingText->staticText->setFont(font);
   if (window==0)
      window=CEGUI::WindowManager::getSingleton().getWindow("Root_Do_Not_Delete");

   window->addChildWindow(fadingText->staticText);
   window->setText(string);

   fadingText->staticText->setXPosition(CEGUI::Absolute, drawArea.d_left);
   fadingText->staticText->setWidth(CEGUI::Absolute, drawArea.d_right-drawArea.d_left);
   fadingText->staticText->setHeight(CEGUI::Absolute, drawArea.d_bottom-drawArea.d_top);

   // Setting properties through strings is shit.
   // To see the available properties, search for public Property in CEGUI
   if (colour)
      fadingText->staticText->setProperty("TextColours", *colour); // aarrggbb in Hexadecimal
   if (horizFormatting)
   {
      CEGUI::String formatting;
      formatting.assign(horizFormatting);
      fadingText->staticText->setProperty("HorzFormatting", formatting); // LeftAligned, RightAligned, HorzCentred
   }
   if (verticalFormatting)
   {
      CEGUI::String formatting;
      formatting.assign(verticalFormatting);
      fadingText->staticText->setProperty("VertFormatting", formatting); // LeftAligned, RightAligned, HorzCentred
   }
   fadingText->staticText->setProperty("BackgroundEnabled", "false");
   fadingText->staticText->setProperty("FrameEnabled", "false");
   
   // TODO - how to set xScale and yScale
   textList.Insert(fadingText);
[/code]

Rakkar
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Aug 15, 2006 02:49

Postby Rakkar » Fri Nov 03, 2006 05:00

I figured it out myself. Just add setEnabled(false)


Return to “Help”

Who is online

Users browsing this forum: No registered users and 29 guests