[RESOLVED][Bug] ItemListbox redraw issue
Moderators: CEGUI MVP, CEGUI Team
Re: [Bug] ItemListbox redraw regression on 0.8.4
Screenshot? did you notify CEGUI of the window size?
CrazyEddie: "I don't like GUIs"
Re: [Bug] ItemListbox redraw regression on 0.8.4
Here's the screenshot
My initialization code looks like this (note the call to Renderer::setDisplaySize):
.My initialization code looks like this (note the call to Renderer::setDisplaySize):
Code: Select all
#define SIZE_X 1280
#define SIZE_Y 1024
int main (int argc, char **argv)
{
SDL_Surface * screen;
atexit (SDL_Quit);
SDL_Init (SDL_INIT_VIDEO);
screen = SDL_SetVideoMode (SIZE_X, SIZE_Y, 0, SDL_OPENGL);
if (screen == NULL) {
fprintf (stderr, "Video issue: %s\n", SDL_GetError ());
exit (1);
}
CEGUI::OpenGLRenderer & renderer = CEGUI::OpenGLRenderer::bootstrapSystem();
renderer.setDisplaySize(CEGUI::Sizef(SIZE_X, SIZE_Y));
SDL_ShowCursor (SDL_DISABLE);
SDL_EnableUNICODE (1);
SDL_EnableKeyRepeat (SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
Re: [Bug] ItemListbox redraw regression on 0.8.4
I know this bug. If you had posted a screenshot right away I could have just told you whats up.
2 ways to solve this:
- use a latest version from the v0-8 branch please. This is the branch for upcoming 0.8.X Releases.
- This bug popped up due to changes in glm. You can alternatively use an older version of glm.
Fore more info https://bitbucket.org/cegui/cegui/issue ... ders-cegui
2 ways to solve this:
- use a latest version from the v0-8 branch please. This is the branch for upcoming 0.8.X Releases.
- This bug popped up due to changes in glm. You can alternatively use an older version of glm.
Fore more info https://bitbucket.org/cegui/cegui/issue ... ders-cegui
CrazyEddie: "I don't like GUIs"
Re: [Bug] ItemListbox redraw regression on 0.8.4
Thanks a lot for all your help and your good memory : )
I downgraded glm to 0.9.5 as advised on the bug page.
My SDL/OpenGL renderer code now works as expected. However, I observe the same bug as with the Ogre renderer. As with Ogre, moving the linkage between the listbox and its parent to after listbox item entry addition still fixes the bug.
(I previously thought that calling onRootWindowChanged
This entails that the bug is not in Ogre, but either in CEGUI or some lower level layer (OpenGL, graphic card driver, etc.)
Here's my SDL/OpenGL Code. A screenshot is attached.
I downgraded glm to 0.9.5 as advised on the bug page.
My SDL/OpenGL renderer code now works as expected. However, I observe the same bug as with the Ogre renderer. As with Ogre, moving the linkage between the listbox and its parent to after listbox item entry addition still fixes the bug.
(I previously thought that calling onRootWindowChanged
This entails that the bug is not in Ogre, but either in CEGUI or some lower level layer (OpenGL, graphic card driver, etc.)
Here's my SDL/OpenGL Code. A screenshot is attached.
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>
#include <GL/gl.h>
#include <GL/glu.h>
// In order to access GUIContext::onRootWindowChanged
#define protected public
#include <CEGUI/CEGUI.h>
#include <CEGUI/RendererModules/OpenGL/GLRenderer.h>
std::map<SDLKey, CEGUI::Key::Scan> m_keymap;
void initializeKeyMap() {
m_keymap[SDLK_1] = CEGUI::Key::One;
m_keymap[SDLK_2] = CEGUI::Key::Two;
m_keymap[SDLK_3] = CEGUI::Key::Three;
m_keymap[SDLK_4] = CEGUI::Key::Four;
m_keymap[SDLK_5] = CEGUI::Key::Five;
m_keymap[SDLK_6] = CEGUI::Key::Six;
m_keymap[SDLK_7] = CEGUI::Key::Seven;
m_keymap[SDLK_8] = CEGUI::Key::Eight;
m_keymap[SDLK_9] = CEGUI::Key::Nine;
m_keymap[SDLK_0] = CEGUI::Key::Zero;
m_keymap[SDLK_q] = CEGUI::Key::Q;
m_keymap[SDLK_w] = CEGUI::Key::W;
m_keymap[SDLK_e] = CEGUI::Key::E;
m_keymap[SDLK_r] = CEGUI::Key::R;
m_keymap[SDLK_t] = CEGUI::Key::T;
m_keymap[SDLK_y] = CEGUI::Key::Y;
m_keymap[SDLK_u] = CEGUI::Key::U;
m_keymap[SDLK_i] = CEGUI::Key::I;
m_keymap[SDLK_o] = CEGUI::Key::O;
m_keymap[SDLK_p] = CEGUI::Key::P;
m_keymap[SDLK_a] = CEGUI::Key::A;
m_keymap[SDLK_s] = CEGUI::Key::S;
m_keymap[SDLK_d] = CEGUI::Key::D;
m_keymap[SDLK_f] = CEGUI::Key::F;
m_keymap[SDLK_g] = CEGUI::Key::G;
m_keymap[SDLK_h] = CEGUI::Key::H;
m_keymap[SDLK_j] = CEGUI::Key::J;
m_keymap[SDLK_k] = CEGUI::Key::K;
m_keymap[SDLK_l] = CEGUI::Key::L;
m_keymap[SDLK_z] = CEGUI::Key::Z;
m_keymap[SDLK_x] = CEGUI::Key::X;
m_keymap[SDLK_c] = CEGUI::Key::C;
m_keymap[SDLK_v] = CEGUI::Key::V;
m_keymap[SDLK_b] = CEGUI::Key::B;
m_keymap[SDLK_n] = CEGUI::Key::N;
m_keymap[SDLK_m] = CEGUI::Key::M;
m_keymap[SDLK_COMMA] = CEGUI::Key::Comma;
m_keymap[SDLK_PERIOD] = CEGUI::Key::Period;
m_keymap[SDLK_SLASH] = CEGUI::Key::Slash;
m_keymap[SDLK_BACKSLASH] = CEGUI::Key::Backslash;
m_keymap[SDLK_MINUS] = CEGUI::Key::Minus;
m_keymap[SDLK_EQUALS] = CEGUI::Key::Equals;
m_keymap[SDLK_SEMICOLON] = CEGUI::Key::Semicolon;
m_keymap[SDLK_LEFTBRACKET] = CEGUI::Key::LeftBracket;
m_keymap[SDLK_RIGHTBRACKET] = CEGUI::Key::RightBracket;
m_keymap[SDLK_QUOTE] = CEGUI::Key::Apostrophe;
m_keymap[SDLK_BACKQUOTE] = CEGUI::Key::Grave;
m_keymap[SDLK_RETURN] = CEGUI::Key::Return;
m_keymap[SDLK_SPACE] = CEGUI::Key::Space;
m_keymap[SDLK_BACKSPACE] = CEGUI::Key::Backspace;
m_keymap[SDLK_TAB] = CEGUI::Key::Tab;
m_keymap[SDLK_ESCAPE] = CEGUI::Key::Escape;
m_keymap[SDLK_PAUSE] = CEGUI::Key::Pause;
m_keymap[SDLK_SYSREQ] = CEGUI::Key::SysRq;
m_keymap[SDLK_POWER] = CEGUI::Key::Power;
m_keymap[SDLK_NUMLOCK] = CEGUI::Key::NumLock;
m_keymap[SDLK_SCROLLOCK] = CEGUI::Key::ScrollLock;
m_keymap[SDLK_F1] = CEGUI::Key::F1;
m_keymap[SDLK_F2] = CEGUI::Key::F2;
m_keymap[SDLK_F3] = CEGUI::Key::F3;
m_keymap[SDLK_F4] = CEGUI::Key::F4;
m_keymap[SDLK_F5] = CEGUI::Key::F5;
m_keymap[SDLK_F6] = CEGUI::Key::F6;
m_keymap[SDLK_F7] = CEGUI::Key::F7;
m_keymap[SDLK_F8] = CEGUI::Key::F8;
m_keymap[SDLK_F9] = CEGUI::Key::F9;
m_keymap[SDLK_F10] = CEGUI::Key::F10;
m_keymap[SDLK_F11] = CEGUI::Key::F11;
m_keymap[SDLK_F12] = CEGUI::Key::F12;
m_keymap[SDLK_F13] = CEGUI::Key::F13;
m_keymap[SDLK_F14] = CEGUI::Key::F14;
m_keymap[SDLK_F15] = CEGUI::Key::F15;
m_keymap[SDLK_LCTRL] = CEGUI::Key::LeftControl;
m_keymap[SDLK_LALT] = CEGUI::Key::LeftAlt;
m_keymap[SDLK_LSHIFT] = CEGUI::Key::LeftShift;
m_keymap[SDLK_LSUPER] = CEGUI::Key::LeftWindows;
m_keymap[SDLK_RCTRL] = CEGUI::Key::RightControl;
m_keymap[SDLK_RALT] = CEGUI::Key::RightAlt;
m_keymap[SDLK_RSHIFT] = CEGUI::Key::RightShift;
m_keymap[SDLK_RSUPER] = CEGUI::Key::RightWindows;
m_keymap[SDLK_MENU] = CEGUI::Key::AppMenu;
m_keymap[SDLK_KP0] = CEGUI::Key::Numpad0;
m_keymap[SDLK_KP1] = CEGUI::Key::Numpad1;
m_keymap[SDLK_KP2] = CEGUI::Key::Numpad2;
m_keymap[SDLK_KP3] = CEGUI::Key::Numpad3;
m_keymap[SDLK_KP4] = CEGUI::Key::Numpad4;
m_keymap[SDLK_KP5] = CEGUI::Key::Numpad5;
m_keymap[SDLK_KP6] = CEGUI::Key::Numpad6;
m_keymap[SDLK_KP7] = CEGUI::Key::Numpad7;
m_keymap[SDLK_KP8] = CEGUI::Key::Numpad8;
m_keymap[SDLK_KP9] = CEGUI::Key::Numpad9;
m_keymap[SDLK_KP_PERIOD] = CEGUI::Key::Decimal;
m_keymap[SDLK_KP_PLUS] = CEGUI::Key::Add;
m_keymap[SDLK_KP_MINUS] = CEGUI::Key::Subtract;
m_keymap[SDLK_KP_MULTIPLY] = CEGUI::Key::Multiply;
m_keymap[SDLK_KP_DIVIDE] = CEGUI::Key::Divide;
m_keymap[SDLK_KP_ENTER] = CEGUI::Key::NumpadEnter;
m_keymap[SDLK_UP] = CEGUI::Key::ArrowUp;
m_keymap[SDLK_LEFT] = CEGUI::Key::ArrowLeft;
m_keymap[SDLK_RIGHT] = CEGUI::Key::ArrowRight;
m_keymap[SDLK_DOWN] = CEGUI::Key::ArrowDown;
m_keymap[SDLK_HOME] = CEGUI::Key::Home;
m_keymap[SDLK_END] = CEGUI::Key::End;
m_keymap[SDLK_PAGEUP] = CEGUI::Key::PageUp;
m_keymap[SDLK_PAGEDOWN] = CEGUI::Key::PageDown;
m_keymap[SDLK_INSERT] = CEGUI::Key::Insert;
m_keymap[SDLK_DELETE] = CEGUI::Key::Delete;
}
void handle_mouse_down(Uint8 button)
{
CEGUI::GUIContext& context = CEGUI::System::getSingleton().getDefaultGUIContext();
switch ( button ) {
case SDL_BUTTON_LEFT:
context.injectMouseButtonDown(CEGUI::LeftButton);
break;
case SDL_BUTTON_MIDDLE:
context.injectMouseButtonDown(CEGUI::MiddleButton);
break;
case SDL_BUTTON_RIGHT:
context.injectMouseButtonDown(CEGUI::RightButton);
break;
case SDL_BUTTON_WHEELDOWN:
context.injectMouseWheelChange( -1 );
break;
case SDL_BUTTON_WHEELUP:
context.injectMouseWheelChange( +1 );
break;
}
}
void handle_mouse_up(Uint8 button)
{
CEGUI::GUIContext& context = CEGUI::System::getSingleton().getDefaultGUIContext();
switch ( button )
{
case SDL_BUTTON_LEFT:
context.injectMouseButtonUp(CEGUI::LeftButton);
break;
case SDL_BUTTON_MIDDLE:
context.injectMouseButtonUp(CEGUI::MiddleButton);
break;
case SDL_BUTTON_RIGHT:
context.injectMouseButtonUp(CEGUI::RightButton);
break;
}
}
void inject_input (bool & must_quit)
{
CEGUI::GUIContext& context = CEGUI::System::getSingleton().getDefaultGUIContext();
initializeKeyMap();
SDL_Event e;
/* go through all available events */
while (SDL_PollEvent(&e)) {
/* we use a switch to determine the event type */
switch (e.type) {
/* mouse motion handler */
case SDL_MOUSEMOTION:
/* we inject the mouse position directly. */
// CEGUI::System::getSingleton().injectMousePosition(static_cast<float>(e.motion.x),static_cast<float>(e.motion.y));
context.injectMousePosition( static_cast<float>(e.motion.x),static_cast<float>(e.motion.y) );
break;
/* mouse down handler */
case SDL_MOUSEBUTTONDOWN:
/* let a special function handle the mouse button down event */
handle_mouse_down (e.button.button);
break;
/* mouse up handler */
case SDL_MOUSEBUTTONUP:
/* let a special function handle the mouse button up event */
handle_mouse_up (e.button.button);
break;
/* key down */
case SDL_KEYDOWN:
/* to tell CEGUI that a key was pressed, we inject the scancode. */
//e.key.keysym.scancode
context.injectKeyDown(m_keymap[e.key.keysym.sym]);
/* as for the character it's a litte more complicated.
* we'll use for translated unicode value.
* this is described in more detail below.
*/
if ((e.key.keysym.unicode & 0xFF80) == 0) {
context.injectChar(e.key.keysym.unicode & 0x7F);
}
break;
/* key up */
case SDL_KEYUP:
/* like before we inject the scancode directly. */
//e.key.keysym.scancode
context.injectKeyUp(m_keymap[e.key.keysym.sym]);
break;
/* WM quit event occured */
case SDL_QUIT:
must_quit = true;
break;
case SDL_VIDEORESIZE:
CEGUI::System::getSingleton().notifyDisplaySizeChanged(CEGUI::Sizef(e.resize.w,e.resize.h));
break;
}
}
}
void inject_time_pulse(double& last_time_pulse)
{
/* get current "run-time" in seconds */
double t = 0.001*SDL_GetTicks();
/* inject the time that passed since the last call */
CEGUI::System::getSingleton().injectTimePulse( float(t-last_time_pulse) );
/* store the new time as the last time */
last_time_pulse = t;
}
void render_gui()
{
/* clear the colour buffer */
glClear( GL_COLOR_BUFFER_BIT );
/* render the GUI :) */
CEGUI::System::getSingleton().renderAllGUIContexts();
/* Update the screen */
SDL_GL_SwapBuffers();
}
void main_loop ()
{
bool must_quit = false;
/* get "run-time" in seconds */
double last_time_pulse = 0.001*static_cast<double>(SDL_GetTicks());
while (!must_quit) {
inject_input (must_quit);
inject_time_pulse (last_time_pulse);
render_gui ();
}
}
#define SIZE_X 1280
#define SIZE_Y 1024
int main (int argc, char **argv)
{
SDL_Surface * screen;
atexit (SDL_Quit);
SDL_Init (SDL_INIT_VIDEO);
screen = SDL_SetVideoMode (SIZE_X, SIZE_Y, 0, SDL_OPENGL);
if (screen == NULL) {
fprintf (stderr, "Video issue: %s\n", SDL_GetError ());
exit (1);
}
CEGUI::OpenGLRenderer & renderer = CEGUI::OpenGLRenderer::bootstrapSystem();
renderer.setDisplaySize(CEGUI::Sizef(SIZE_X, SIZE_Y));
SDL_ShowCursor (SDL_DISABLE);
SDL_EnableUNICODE (1);
SDL_EnableKeyRepeat (SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>
(CEGUI::System::getSingleton().getResourceProvider());
rp->setResourceGroupDirectory("schemes", "/usr/share/cegui-0/schemes/");
rp->setResourceGroupDirectory("imagesets", "/usr/share/cegui-0/imagesets/");
rp->setResourceGroupDirectory("fonts", "/usr/share/cegui-0/fonts/");
rp->setResourceGroupDirectory("layouts", "/usr/share/cegui-0/layouts/");
rp->setResourceGroupDirectory("looknfeels", "/usr/share/cegui-0/looknfeel/");
rp->setResourceGroupDirectory("lua_scripts", "/usr/share/cegui-0/lua_scripts/");
// This is only really needed if you are using Xerces and need to
// specify the schemas location
rp->setResourceGroupDirectory("schemas", "/usr/share/cegui-0/xml_schemas/");
// set the default resource groups to be used
CEGUI::ImageManager::setImagesetDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
// setup default group for validation schemas
CEGUI::XMLParser* parser = CEGUI::System::getSingleton().getXMLParser();
if (parser->isPropertyPresent("SchemaDefaultResourceGroup"))
parser->setProperty("SchemaDefaultResourceGroup", "schemas");
using namespace CEGUI;
CEGUI::SchemeManager::getSingleton().createFromFile( "TaharezLook.scheme" );
CEGUI::FontManager::getSingleton().createFromFile( "DejaVuSans-10.font" );
System::getSingleton().getDefaultGUIContext().setDefaultFont( "DejaVuSans-10" );
System::getSingleton().getDefaultGUIContext().getMouseCursor().setDefaultImage( "TaharezLook/MouseArrow" );
System::getSingleton().getDefaultGUIContext().setDefaultTooltipType( "TaharezLook/Tooltip" );
WindowManager& wmgr = WindowManager::getSingleton();
Window* myRoot = wmgr.createWindow( "DefaultWindow", "root" );
System::getSingleton().getDefaultGUIContext().setRootWindow( myRoot );
FrameWindow* fWnd = static_cast<FrameWindow*>(
wmgr.createWindow( "TaharezLook/FrameWindow", "testWindow" ));
myRoot->addChild( fWnd );
// position a quarter of the way in from the top-left of parent.
fWnd->setPosition( UVector2( UDim( 0.1f, 0.0f ), UDim( 0.1f, 0.0f ) ) );
// set size to be half the size of the parent
fWnd->setSize( USize( UDim( 0.8f, 0.0f ), UDim( 0.8f, 0.0f ) ) );
CEGUI::ItemListbox * p_list = static_cast<CEGUI::ItemListbox *>(
CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/ItemListbox", "test_listbox"));
p_list->setSize(CEGUI::USize(CEGUI::UDim(0.9f,0),CEGUI::UDim(0.9f,0)));
// Moving the line below after the loop solves the issue
fWnd->addChild(p_list);
for(unsigned i = 1; i <= 3; ++i)
{
std::ostringstream oss;
oss << i;
std::string text = oss.str();
CEGUI::ItemEntry * p_itm =
static_cast<CEGUI::ItemEntry *>(
CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/ListboxItem", text));
p_itm->setText(text);
p_list->addItem(p_itm);
}
// Moving the addChild line here solves the issue
// fWnd->addChild(p_list);
p_list->invalidate();
p_list->show();
main_loop();
}
- Attachments
-
- OpenGL_screenshot.png
- (10.35 KiB) Not downloaded yet
Re: [Bug] ItemListbox redraw regression on 0.8.4
Ok so we can now be sure it is not a bug in rendering/display.
Do you have the SampleBrowser built? Can you edit HelloWorld.cpp or .h to reconstruct the issue? If you do that, add comments what to change to make it work / not work and post the code here. If you provide this I will look into it soon, I will probably need to debug it so i would prefer to have it in this form.
As of now I have no clue why this happens, might be a CEGUI bug.
Do you have the SampleBrowser built? Can you edit HelloWorld.cpp or .h to reconstruct the issue? If you do that, add comments what to change to make it work / not work and post the code here. If you provide this I will look into it soon, I will probably need to debug it so i would prefer to have it in this form.
As of now I have no clue why this happens, might be a CEGUI bug.
CrazyEddie: "I don't like GUIs"
Re: [Bug] ItemListbox redraw regression on 0.8.4
I'd never heard of the sample browser until now. Google isn't that helpful. Would you mind sharing another of your obligatory links?
Tomorow is back to office work, so I'll take care of that, whenever possible, in the coming days or weeks.
Tomorow is back to office work, so I'll take care of that, whenever possible, in the coming days or weeks.
Re: [Bug] ItemListbox redraw regression on 0.8.4
The SampleBrowser is part of all CEGUI release and the current v0-8 repo and all other repos and should by built by default (CMake)
What do you need to know? It is true this is not part of the API docu (which wouldnt make sense since it is not part of the library itself) and not in the wiki. We should make a wiki article on this. It would be great if we could collect all info you need and make a wiki article out of it. The application templates are also yet to be documented.
What do you need to know? It is true this is not part of the API docu (which wouldnt make sense since it is not part of the library itself) and not in the wiki. We should make a wiki article on this. It would be great if we could collect all info you need and make a wiki article out of it. The application templates are also yet to be documented.
CrazyEddie: "I don't like GUIs"
Re: [Bug] ItemListbox redraw regression on 0.8.4
Ok. I'll try to build it and take a look at the source. I'll get back to you when I'm done.
Re: [Bug] ItemListbox redraw regression on 0.8.4
Was it not selected to be built by default?
CrazyEddie: "I don't like GUIs"
Re: [Bug] ItemListbox redraw regression on 0.8.4
I installed CEGUI using Gentoo's package manager, portage.
Either portage didn't build the binary or it didn't install it, but I can't find any executable (except toluapp) installed by the CEGUI package.
Ogre's sample browser is installed by Gentoo when the example use-flag is enabled.
I'll have a look into it, and may eventually start a thread on Gentoo's forums for a proper install of CEGUI's sample browser.
Either portage didn't build the binary or it didn't install it, but I can't find any executable (except toluapp) installed by the CEGUI package.
Ogre's sample browser is installed by Gentoo when the example use-flag is enabled.
I'll have a look into it, and may eventually start a thread on Gentoo's forums for a proper install of CEGUI's sample browser.
Re: [Bug] ItemListbox redraw regression on 0.8.4
So, the following problems seem to prevent a the compilation of the sample browser on Gentoo, with cmake 3.2.2:
Once I have investigated the second point, I'll post a patch for CEGUI. I'll also send it to the Gentoo package manager.
EDIT: I had installed GLFW 3 that has different header names and location than GLFW 2. This was the cause of points 2 and 3.
We still need a fix for point 1.
- portage doesn't take into account the dependency of the browser on GLFW,
- even if GLFW is installed manually, the GLFW_H_PATH cmake variable is not set (didn't look into this yet),
- cmake has an issue with the following line in the main CMakeLists.txt file:
Code: Select all
option( CEGUI_SAMPLES_ENABLED "Specifies whether to build the CEGUI sample applications" ${_CEGUI_SAMPLES_ENABLED_DEFAULT} )
cmake expects ON or OFF as a value for CEGUI_SAMPLES_ENABLED, whereas _CEGUI_SAMPLES_ENABLED_DEFAULT contains a boolean value. This means the option always evaluates to OFF thus sample browser compilation is never activated by default. (But it can be activated through the cmake GUI or command line.)
Once I have investigated the second point, I'll post a patch for CEGUI. I'll also send it to the Gentoo package manager.
EDIT: I had installed GLFW 3 that has different header names and location than GLFW 2. This was the cause of points 2 and 3.
We still need a fix for point 1.
Last edited by Alain B on Tue Aug 11, 2015 19:56, edited 1 time in total.
Re: [Bug] ItemListbox redraw regression on 0.8.4
Sounds great!
If possible, please make a on bitbucket so the patch can be attributed to you.
If possible, please make a on bitbucket so the patch can be attributed to you.
CrazyEddie: "I don't like GUIs"
Re: [Bug] ItemListbox redraw regression on 0.8.4
I got the sample brower to compile on Gentoo. I'll propose them a patch for it. Contrary to what I first thought, there's no need to change CEGUI's cmake build.
On the other front, I reproduce the bug by simply adding the following block in HellowWorld.cpp, at the end of HelloWorldDemo::initialise (just before the return true; line). Didn't seem worth a patch since it's a single block copy/paste. Whole modified file is here.
On the other front, I reproduce the bug by simply adding the following block in HellowWorld.cpp, at the end of HelloWorldDemo::initialise (just before the return true; line). Didn't seem worth a patch since it's a single block copy/paste. Whole modified file is here.
Code: Select all
CEGUI::ItemListbox * p_list = static_cast<CEGUI::ItemListbox *>(
CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/ItemListbox", "test_listbox"));
p_list->setSize(CEGUI::USize(CEGUI::UDim(0.9f,0),CEGUI::UDim(0.9f,0)));
wnd->addChild(p_list);
for(unsigned i = 0; i < 3; ++i)
{
std::ostringstream oss;
oss << i;
std::string text = oss.str();
CEGUI::ItemEntry * p_itm =
static_cast<CEGUI::ItemEntry *>(
CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/ListboxItem", text));
p_itm->setText(text);
p_list->addItem(p_itm);
}
p_list->invalidate();
p_list->show();
Re: [Bug] ItemListbox redraw regression on 0.8.4
You didn't answer two crucial questions I asked you before. Does this code now work as expected or does it not? What do I need to change to make it work/not work in the context of the bug?
CrazyEddie: "I don't like GUIs"
Re: [Bug] ItemListbox redraw regression on 0.8.4
As written, I did reproduce the bug by adding the above code block to the HelloWorld.cpp sample file.
So, it does not work as expected: I expect to see three listbox items (displaying respectively 0, 1 and 2 as text). Instead, I only see two items displaying 0 and 1.
In the context of the bug, by moving the wnd->addChild(p_list); after the for loop (both in the extract in my last post) I see the three expected items.
If it's not clear, don't hesitate to PM me.
Thanks a lot for your time.
So, it does not work as expected: I expect to see three listbox items (displaying respectively 0, 1 and 2 as text). Instead, I only see two items displaying 0 and 1.
In the context of the bug, by moving the wnd->addChild(p_list); after the for loop (both in the extract in my last post) I see the three expected items.
If it's not clear, don't hesitate to PM me.
Thanks a lot for your time.
Return to “Bug Reports, Suggestions, Feature Requests”
Who is online
Users browsing this forum: No registered users and 2 guests