[SOLVED]Custom rendering FrameWindow resize

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

Tabarn@kdeca.lis
Just popping in
Just popping in
Posts: 5
Joined: Thu Sep 21, 2006 16:56

[SOLVED]Custom rendering FrameWindow resize

Postby Tabarn@kdeca.lis » Thu Aug 30, 2012 19:34

Hi,
I want to resize with the mouse a custom FrameWindow created according to this tutorial :

http://www.cegui.org.uk/wiki/index.php/ ... right_time

I updated to CEGUI 0.7.7. My problem is the custom FrameWindow I create will never receive the FrameWindow::onMouseEvent where the border detection occur. Only the root FrameWindow will have the onMouseEvent. As I understand, the topmost child should receive the event first then decide wether or not to propagate it to it's parents.

So basically, I have the root FrameWindow :

Code: Select all

   m_pfwRoot = (CEGUI::FrameWindow*)wmgr.createWindow( "TaharezLook/FrameWindow", FRAME_WINDOW_ROOT );
   m_pfwRoot->setPosition( UVector2( UDim(0.0f, 0), UDim(0.0f, 0) ) );
   m_pfwRoot->setSize( UVector2( UDim(1.0f, 0), UDim(1.0f, 0) ) );
   m_pfwRoot->setDragMovingEnabled( FALSE );
   m_pfwRoot->setDragDropTarget( FALSE );
   m_pfwRoot->setTitleBarEnabled( FALSE );
   m_pfwRoot->setSizingEnabled( FALSE );
   m_pfwRoot->setFrameEnabled( FALSE );
   m_pfwRoot->setSizingBorderThickness( 0.0f );
   m_pfwRoot->setRollupEnabled( FALSE );

   CEGUI::System::getSingleton().setGUISheet( m_pfwRoot );


Then I create custom FrameWindow :

Code: Select all

      // register the new window type
      CEGUI::WindowFactoryManager::getSingleton().addFactory<CEGUI::TplWindowFactory<GLCEGUISpectrogram> >();
   
      // make a mapping that uses the existing TL/FrameWindow renderer.
      CEGUI::WindowFactoryManager::getSingleton().addFalagardWindowMapping(   "TaharezLook/GLCEGUISpectrogram", "GLCEGUISpectrogram", "TaharezLook/FrameWindow", "Falagard/FrameWindow"   );

...

   m_pfwSpectrogramWindow = static_cast<GLCEGUISpectrogram*>( CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/GLCEGUISpectrogram", strWindowName) );


   m_pfwSpectrogramWindow->setPosition( CEGUI::UVector2( CEGUI::UDim( fXPos, 0.0f), CEGUI::UDim( fYPos, 0) ) );
   m_pfwSpectrogramWindow->setSize( CEGUI::UVector2( CEGUI::UDim(fWinDefaultWidth, 0), CEGUI::UDim(fWinDefaultHeight, 0) ) );
   m_pfwSpectrogramWindow->setText( strTitle );
   m_pfwSpectrogramWindow->setDragMovingEnabled( TRUE );
   m_pfwSpectrogramWindow->setTitleBarEnabled( TRUE );
   m_pfwSpectrogramWindow->setSizingEnabled( TRUE );
   m_pfwSpectrogramWindow->setFrameEnabled( TRUE );
   m_pfwSpectrogramWindow->setSizingBorderThickness( 15.0f );
   m_pfwSpectrogramWindow->setZOrderingEnabled( TRUE );
   m_pfwSpectrogramWindow->setInheritsAlpha( FALSE );

   CEGUI::WindowManager::getSingleton().getWindow( GLWindowCEGUI::FRAME_WINDOW_ROOT )->addChildWindow( m_pfwSpectrogramWindow );


I wonder why only the first root FrameWindow will receive the event. The custom FrameWindow works when I drag the title bar or when I double click on the title bar to hide it's content.

Have you got any clues? I will continue to debug.

Thanks
Last edited by Tabarn@kdeca.lis on Thu Aug 30, 2012 20:54, edited 1 time in total.

Tabarn@kdeca.lis
Just popping in
Just popping in
Posts: 5
Joined: Thu Sep 21, 2006 16:56

Re: Custom rendering FrameWindow resize

Postby Tabarn@kdeca.lis » Thu Aug 30, 2012 20:18

Edit : removed log file since it was useless.
Last edited by Tabarn@kdeca.lis on Thu Aug 30, 2012 20:53, edited 1 time in total.

Tabarn@kdeca.lis
Just popping in
Just popping in
Posts: 5
Joined: Thu Sep 21, 2006 16:56

Re: Custom rendering FrameWindow resize

Postby Tabarn@kdeca.lis » Thu Aug 30, 2012 20:38

OK, I made it! My problem was that I had a bad useless implementation of isHit and onMouseMove in my custom FrameWindow.

If you have similar problems, make sure these methods are not overriden, or call the parent class method!


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 4 guests