[Bug]two issue after resizing application window

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

Cloudage
Not too shy to talk
Not too shy to talk
Posts: 27
Joined: Thu May 28, 2009 11:37

[Bug]two issue after resizing application window

Postby Cloudage » Tue Nov 17, 2009 09:59

before i resize the application window,everything just fine.but after i did it...
1.the titlebar of a framewindow become strange when i drag it to different position,like this:
Image
Image
Image

2.after i drag the framewindow a little,the editbox on it will not receive my typing anymore.

i created this window via code:

Code: Select all

   using namespace CEGUI;

   WindowManager &mgr = WindowManager::getSingleton();   
   ConsoleWindow = (FrameWindow*)mgr.createWindow(GUISTYLENAME"/FrameWindow","Console");   
   ConsoleWindow->getTitlebar()->setText("Console");      
   ConsoleWindow->setWidth(UDim(0,LAYOUT_FRAMEWIDTH));
   ConsoleWindow->setHeight(UDim(0,LAYOUT_FRAMEHEIGHT));   
   ConsoleWindow->setHorizontalAlignment(HA_CENTRE);
   ConsoleWindow->setVerticalAlignment(VA_CENTRE);   
   ConsoleWindow->setAlwaysOnTop(true);
   ConsoleWindow->setSizingEnabled(false);
      
   ConsoleWindow_Editbox = (Editbox*)mgr.createWindow(GUISTYLENAME"/Editbox","Console/Editbox");
   ConsoleWindow_Editbox->setHeight(UDim(0,LAYOUT_INPUTBOXHEIGHT));
   ConsoleWindow_Editbox->setWidth(UDim(0,LAYOUT_FRAMEWIDTH-LAYOUT_MARGIN*2));
   ConsoleWindow_Editbox->setXPosition(UDim(0,LAYOUT_MARGIN));
   ConsoleWindow_Editbox->setYPosition(UDim(0,LAYOUT_FRAMEHEIGHT-LAYOUT_INPUTBOXHEIGHT-LAYOUT_MARGIN));

   float titlebarHeight = ConsoleWindow->getTitlebar()->getPixelSize().d_height;

   ConsoleWindow_MultiLineEditbox = (MultiLineEditbox*)mgr.createWindow(GUISTYLENAME"/MultiLineEditbox","Console/MultiLineEditbox");
   ConsoleWindow_MultiLineEditbox->setXPosition(UDim(0,LAYOUT_MARGIN));
   ConsoleWindow_MultiLineEditbox->setYPosition(UDim(0,titlebarHeight+LAYOUT_MARGIN));
   ConsoleWindow_MultiLineEditbox->setWidth(UDim(0,LAYOUT_FRAMEWIDTH-LAYOUT_MARGIN*2));
   ConsoleWindow_MultiLineEditbox->setHeight(UDim(0,LAYOUT_FRAMEHEIGHT-titlebarHeight-LAYOUT_INPUTBOXHEIGHT-LAYOUT_MARGIN*3));   
   ConsoleWindow_MultiLineEditbox->setReadOnly(true);


   ConsoleWindow->addChildWindow(ConsoleWindow_MultiLineEditbox);
   ConsoleWindow->addChildWindow(ConsoleWindow_Editbox);


   ConsoleWindow->subscribeEvent(FrameWindow::EventCloseClicked,Event::Subscriber(&ConsoleWindow_OnCloseClicked));   
   ConsoleWindow_Editbox->subscribeEvent(Editbox::EventTextAccepted,Event::Subscriber(&ConsoleWindowEditbox_OnTextAccepted));
   System::getSingleton().getGUISheet()->addChildWindow(ConsoleWindow);

   ConsoleWindow_Editbox->activate();


and when my application window size changed,i did these:

Code: Select all

   if(renderer==0)return;
   CEGUI::Size sz = CEGUI::Size(w,h);
   //renderer->setDisplaySize(sz);
   CEGUI::System::getSingleton().notifyDisplaySizeChanged(sz);
   CEGUI::FontManager::getSingleton().notifyDisplaySizeChanged(sz);
   CEGUI::ImagesetManager::getSingleton().notifyDisplaySizeChanged(sz);
   CEGUI::MouseCursor::getSingleton().notifyDisplaySizeChanged(sz);


is it a bug or i just made some mistake?
Thanks.

ps: i use 'QuadraticLook'.
Last edited by Cloudage on Thu Dec 10, 2009 10:22, edited 1 time in total.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Bug?two issue after resizing application window

Postby CrazyEddie » Thu Dec 03, 2009 10:10

Could be something broken in CEGUI as regards to the window alignment in use, not sure.

Post your version info, please.

CE.

Cloudage
Not too shy to talk
Not too shy to talk
Posts: 27
Joined: Thu May 28, 2009 11:37

Re: Bug?two issue after resizing application window

Postby Cloudage » Sat Dec 05, 2009 06:17

hi CE,nice to see you back.

i use CEGUI 0.7.1 from the download page on the wiki.

and i also tried the TaharezLook,it have the same problem,but WindowsLook will cause a error as below:

Code: Select all

05/12/2009 14:13:43 (Std)    Started creation of Scheme from XML specification:
05/12/2009 14:13:43 (Std)    ---- CEGUI GUIScheme name: WindowsLookSkin
05/12/2009 14:13:43 (Std)    Started creation of Imageset from XML specification:
05/12/2009 14:13:43 (Std)    ---- CEGUI Imageset name: WindowsLook
05/12/2009 14:13:43 (Std)    ---- Source texture file: WindowsLook.tga in resource group: (Default)
05/12/2009 14:13:43 (Std)    Started creation of Font from XML specification:
05/12/2009 14:13:43 (Std)    ---- CEGUI font name: MSYH_10
05/12/2009 14:13:43 (Std)    ----       Font type: Pixmap
05/12/2009 14:13:43 (Std)    ----     Source file: MSYH_10.imageset in resource group: (Default)
05/12/2009 14:13:43 (Std)    Started creation of Imageset from XML specification:
05/12/2009 14:13:43 (Std)    ---- CEGUI Imageset name: MSYH_10
05/12/2009 14:13:43 (Std)    ---- Source texture file: MSYH_10.png in resource group: (Default)
05/12/2009 14:14:08 (Std)    ===== Falagard 'root' element: look and feel parsing begins =====
05/12/2009 14:14:09 (Std)    ===== Look and feel parsing completed =====
05/12/2009 14:14:09 (Std)    No window factories specified for module 'CEGUIFalagardWRBase' - adding all available factories...
05/12/2009 14:14:09 (Error)   CEGUI::InvalidRequestException in file d:\dev\src\cegui-0.7.1\cegui\src\ceguifactorymodule.cpp(116) : FactoryModule::registerAllFactories - Required function export 'uint registerAllFactories(void)' was not found in module 'CEGUIFalagardWRBase_d'.


hope these can help you figure out something.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Bug?two issue after resizing application window

Postby CrazyEddie » Sat Dec 05, 2009 14:22

hi CE,nice to see you back.

Hi, and thanks :)

I think the issue is with pre-0.7.x datafiles. Both QuadraticLook and the files from Ogre(?) will have certain issues when used with the newer 0.7.x code. The main reason for this is due to the fact I finally fixed the inner/client rect support so that content is positioned, sized and clipped according to the inner rect area defined for a window. What this means is that - for example with frame window - position (0, 0) is now the top-left of the inner rect area and not the top-left of the outer rect area, to mitigate this we added distinction between client and non-client content, so things such as the title bar and close button need the property "NonClient" set to "True" in the looknfeel.

Ok. That's what I think is causing the issue. The only thing I can't explain is why it looks normal to start with!

HTH

CE.

Cloudage
Not too shy to talk
Not too shy to talk
Posts: 27
Joined: Thu May 28, 2009 11:37

Re: Bug?two issue after resizing application window

Postby Cloudage » Sun Dec 06, 2009 06:00

hi CE.
bad news,i tried the WindowsLookSkin distributed with the 0.7.1 source,the titlebar is okay after i resize render window,but seems there are some new problems:

Image
picture 1

Image
picture 2

Image
picture 3

1.)at the first,everything is okay,but when i drag the right edge of the render window a little,the gui just become a little dot,as in picture 2.and then i continue draging the edge,the gui will changes between dot and normally displayed,depends on how much the size be changed.if i disable the imageset`s 'AutoScale',gui will always be a dot after resize,and never come back.

2.)when i once resized the render window,if i use system cursor,the mouse focus position will have a vertical offset from the correct position.as in picture 3,it become a I-beam at the position inside the red circle.but if i use cegui cursor,the problem will gone,however the cursor will have a wrong scale after resizing the render window.

3.)after resizing,the close button will be scaled to a wrong scale,just like the cegui cursor image.as in picture 3,it looks more bigger than its correct resolution in picture 1.


update: no more problem#2,it`s my fault.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Bug?two issue after resizing application window

Postby CrazyEddie » Mon Dec 07, 2009 09:30

Hmmm. Seems like it could be an issue of notifying the CEGUI system of the change in rendering window size - how are you doing that?

CE.

Cloudage
Not too shy to talk
Not too shy to talk
Posts: 27
Joined: Thu May 28, 2009 11:37

Re: Bug?two issue after resizing application window

Postby Cloudage » Mon Dec 07, 2009 09:55

i did these:

Code: Select all

   unsigned int w,h,cd;
   int x,y;
   Enviroment::RenderWindow->getMetrics(w,h,cd,x,y);//this is a call to the ogre render window
   CEGUI::Size sz = CEGUI::Size(w,h);   
   renderer->setDisplaySize(sz);
   CEGUI::System::getSingleton().notifyDisplaySizeChanged(sz);
   CEGUI::FontManager::getSingleton().notifyDisplaySizeChanged(sz);
   CEGUI::ImagesetManager::getSingleton().notifyDisplaySizeChanged(sz);
   CEGUI::MouseCursor::getSingleton().notifyDisplaySizeChanged(sz);

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Bug?two issue after resizing application window

Postby CrazyEddie » Mon Dec 07, 2009 14:42

Yeah, that's totally OTT :)

This is the correct way (your same code, just dropped the unrequired parts):

Code: Select all

unsigned int w,h,cd;
int x,y;
Enviroment::RenderWindow->getMetrics(w,h,cd,x,y);//this is a call to the ogre render window
CEGUI::Size sz = CEGUI::Size(w,h);   
CEGUI::System::getSingleton().notifyDisplaySizeChanged(sz);


It used to be that you just notify the renderer, though that was always non-standard and per-implementation specific, So we changed it to a more standardised and streamlined approach whereby you notify CEGUI::System, and it will then ensure that everybody else who cares also gets informed.

HTH

CE.

Cloudage
Not too shy to talk
Not too shy to talk
Posts: 27
Joined: Thu May 28, 2009 11:37

Re: Bug?two issue after resizing application window

Postby Cloudage » Tue Dec 08, 2009 13:24

hi CE,
i followed your suggestion,but unfortunately,the problem of icon wrong scaled and gui randomly disappear still happens after the resizing...

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Bug?two issue after resizing application window

Postby CrazyEddie » Tue Dec 08, 2009 14:52

I'm not sure what else to suggest since it all works fine for me (well, last time I tested it anyway).

What values are getting logged in CEGUI.log - you should see some entries every time you resize (IIRC) - do these values correspond to what you think should be passed? Are there any values that look wrong (such as something very big or very small)?

CE.

Cloudage
Not too shy to talk
Not too shy to talk
Posts: 27
Joined: Thu May 28, 2009 11:37

Re: Bug?two issue after resizing application window

Postby Cloudage » Wed Dec 09, 2009 09:19

hi CE,
here`s my cegui.log:

Code: Select all

09/12/2009 16:03:39 (Std)    Display resize: w=1010 h=730
09/12/2009 16:03:39 (Std)    Display resize: w=1011 h=730
09/12/2009 16:03:39 (Std)    Display resize: w=1012 h=730
09/12/2009 16:03:39 (Std)    Display resize: w=1016 h=730
09/12/2009 16:03:39 (Std)    Display resize: w=1018 h=730
09/12/2009 16:03:39 (Std)    Display resize: w=1023 h=730
09/12/2009 16:03:39 (Std)    Display resize: w=1024 h=730
09/12/2009 16:03:39 (Std)    Display resize: w=1025 h=730
09/12/2009 16:03:39 (Std)    Display resize: w=1026 h=730
09/12/2009 16:03:39 (Std)    Display resize: w=1027 h=730
09/12/2009 16:03:39 (Std)    Display resize: w=1030 h=730
09/12/2009 16:03:39 (Std)    Display resize: w=1032 h=730
09/12/2009 16:03:39 (Std)    Display resize: w=1033 h=730
09/12/2009 16:03:39 (Std)    Display resize: w=1034 h=730


and here`s the Ogre.log

Code: Select all

16:03:39: !!! Direct3D Device Lost!
16:03:39: !!! Direct3D Device Lost!
16:03:39: !!! Direct3D Device Lost!
16:03:39: !!! Direct3D Device Lost!
16:03:39: !!! Direct3D Device Lost!
16:03:39: !!! Direct3D Device Lost!
16:03:39: !!! Direct3D Device Lost!
16:03:39: !!! Direct3D Device Lost!
16:03:39: !!! Direct3D Device Lost!
16:03:39: !!! Direct3D Device Lost!
16:03:39: !!! Direct3D Device Lost!
16:03:39: !!! Direct3D Device Lost!
16:03:39: !!! Direct3D Device Lost!
16:03:39: !!! Direct3D Device Lost!
16:03:39: Releasing D3D9 default pool texture: _cegui_ogre_4
16:03:39: Released D3D9 default pool texture: _cegui_ogre_4
16:03:39: D3D9TextureManager released:
16:03:39: 1 unmanaged textures
16:03:39: D3D9HardwareBufferManager released:
16:03:39: 16 unmanaged vertex buffers
16:03:39: 0 unmanaged index buffers
16:03:39: Reset device ok w:1034 h:730
16:03:39: D3D9 : WARNING - disabling VSync in windowed mode can cause timing issues at lower frame rates, turn VSync on if you observe this problem.
16:03:39: Recreating D3D9 default pool texture: _cegui_ogre_4
16:03:39: Recreated D3D9 default pool texture: _cegui_ogre_4
16:03:39: D3D9TextureManager recreated:
16:03:39: 1 unmanaged textures
16:03:39: D3D9HardwareBufferManager recreated:
16:03:39: 16 unmanaged vertex buffers
16:03:39: 0 unmanaged index buffers
16:03:39: !!! Direct3D Device successfully restored.


i use a external window created myself as render window,fires window resized events on WM_SIZE and WM_DISPLAYCHANGE...
but it just still randomly disappears randomly comebacks even i did everything directly copy form the source of ogre and cegui...
i think i`d better just make the window unsizeable,if we have no more idea about this...

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Bug?two issue after resizing application window

Postby CrazyEddie » Wed Dec 09, 2009 10:31

Hi,

Thanks for the info. I wonder if it's perhaps a D3D render system related issue, I'm thinking this because when I say 'it works ok here', I haven't tested the D3D driver because I'm generally not on Windows. I'll try and test it out soon and see. If you're also able to test the OpenGL render system to see if you get the same or different results, that would be great :)

CE.

Cloudage
Not too shy to talk
Not too shy to talk
Posts: 27
Joined: Thu May 28, 2009 11:37

Re: Bug?two issue after resizing application window

Postby Cloudage » Wed Dec 09, 2009 15:13

hi CE!
i tested ogre openGL renderer,and the problem was gone,but when i use D3D renderer the problem comeback again.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Bug?two issue after resizing application window

Postby CrazyEddie » Thu Dec 10, 2009 10:02

Thanks a lot for confirming that's it's only D3D with Ogre that's affected - there are now a few of these issues, so I can spend a couple of days (probably this weekend) focussing in on just this one area and try to get these addressed.

CE.

Cloudage
Not too shy to talk
Not too shy to talk
Posts: 27
Joined: Thu May 28, 2009 11:37

Re: [Bug]two issue after resizing application window

Postby Cloudage » Thu Dec 10, 2009 12:31

with my pleasure.
good luck!


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 7 guests