CGUIButton_Impl::CGUIButton_Impl ( CGUI_Impl* pGUI, CGUIElement* pParent, const char* szCaption ) { m_pManager = pGUI; // Get an unique identifier for CEGUI (gah, there's gotta be an another way) char szUnique [CGUI_CHAR_SIZE]; pGUI->GetUniqueName ( szUnique ); // Create the window and set default settings m_pWindow = pGUI->GetWindowManager ()->createWindow ( CGUIBUTTON_NAME, szUnique ); m_pWindow->setDestroyedByParent ( false ); m_pWindow->setText ( CGUI_Impl::GetUTFString(szCaption) ); m_pWindow->setSize ( CEGUI::Absolute, CEGUI::Size ( 128.0f, 24.0f ) ); m_pWindow->setVisible ( true ); // Store the pointer to this CGUI element in the CEGUI element m_pWindow->setUserData ( reinterpret_cast < void* > ( this ) ); AddEvents (); // If a parent is specified, add it to it's children list, if not, add it as a child to the pManager if ( pParent ) { SetParent ( pParent ); } else { pGUI->AddChild ( this ); SetParent ( NULL ); } }
CGUIScrollPane_Impl::CGUIScrollPane_Impl( CGUI_Impl * pGUI, CGUIElement_Impl * pParent ) { // Store the manager instance m_pManager = pGUI; // Get a unique name for cegui String strName = pGUI->GetUniqueName(); // Create the window and set default settings m_pWindow = pGUI->GetWindowManager()->createWindow( "CGUI/ScrollablePane", strName.Get() ); m_pWindow->setDestroyedByParent( false ); m_pWindow->setRect( CEGUI::Relative, CEGUI::Rect( 0.9f, 0.9f, 0.9f, 0.9f ) ); m_pWindow->setVisible( true ); // Store the pointer to this element m_pWindow->setUserData( (void *)this ); // Register our events AddEvents(); // If a parent is set, add it to it's childs list, if not add it as a child to the gui manager if( pParent ) SetParent( pParent ); else { pGUI->AddChild( this ); SetParent( NULL ); } // Set defaults SetHorizontalScrollStepSize( 100.0f ); SetVerticalScrollStepSize( 100.0f ); }
CGUIScrollPane_Impl::CGUIScrollPane_Impl ( CGUI_Impl* pGUI, CGUIElement* pParent ) { m_pManager = pGUI; // Initialize m_pGUI = pGUI; // Get an unique identifier for CEGUI (gah, there's gotta be an another way) char szUnique [CGUI_CHAR_SIZE]; pGUI->GetUniqueName ( szUnique ); // Create the window and set default settings m_pWindow = pGUI->GetWindowManager ()->createWindow ( CGUISCROLLPANE_NAME, szUnique ); m_pWindow->setDestroyedByParent ( false ); m_pWindow->setRect ( CEGUI::Relative, CEGUI::Rect (0.9f, 0.9f, 0.9f, 0.9f) ); // Store the pointer to this CGUI element in the CEGUI element m_pWindow->setUserData ( reinterpret_cast < void* > ( this ) ); AddEvents (); // If a parent is specified, add it to it's children list, if not, add it as a child to the m_pManager if ( pParent ) { SetParent ( pParent ); } else { pGUI->AddChild ( this ); SetParent ( NULL ); } SetHorizontalScrollStepSize ( 100.0f ); SetVerticalScrollStepSize ( 100.0f ); }
CGUITab_Impl::CGUITab_Impl ( CGUI_Impl* pGUI, CGUIElement_Impl* pParent, const char* szCaption ) { m_pManager = pGUI; // Get an unique identifier for CEGUI char szUnique [CGUI_CHAR_SIZE]; pGUI->GetUniqueName ( szUnique ); // Create the window and set default settings m_pWindow = pGUI->GetWindowManager ()->createWindow ( "DefaultWindow", szUnique ); m_pWindow->setDestroyedByParent ( false ); m_pWindow->setText ( szCaption ); // Store the pointer to this CGUI element in the CEGUI element m_pWindow->setUserData ( reinterpret_cast < void* > ( this ) ); AddEvents (); // If a parent is specified, add it to it's children list, if not, add it as a child to the pManager if ( pParent ) { SetParent ( pParent ); // Adjust the tab button (pParent should be a TabControl!) reinterpret_cast < CEGUI::TabControl* > ( ((CGUITabPanel_Impl*)pParent)->m_pWindow ) -> setAbsoluteTabHeight ( 24.0f ); } else { pGUI->AddChild ( this ); SetParent ( NULL ); } }
CGUITabPanel_Impl::CGUITabPanel_Impl ( CGUI_Impl* pGUI, CGUIElement* pParent ) { m_pManager = pGUI; // Initialize m_pGUI = pGUI; // Get an unique identifier for CEGUI (gah, there's gotta be an another way) char szUnique [CGUI_CHAR_SIZE]; pGUI->GetUniqueName ( szUnique ); // Create the window and set default settings m_pWindow = pGUI->GetWindowManager ()->createWindow ( CGUITABPANEL_NAME, szUnique ); m_pWindow->setDestroyedByParent ( false ); m_pWindow->setRect ( CEGUI::Relative, CEGUI::Rect (0.9f, 0.9f, 0.9f, 0.9f) ); reinterpret_cast < CEGUI::TabControl* > ( m_pWindow ) -> setAbsoluteTabTextPadding ( 10.0f ); // Store the pointer to this CGUI element in the CEGUI element m_pWindow->setUserData ( reinterpret_cast < void* > ( this ) ); m_pWindow->subscribeEvent ( CEGUI::TabControl::EventSelectionChanged, CEGUI::Event::Subscriber ( &CGUITabPanel_Impl::Event_OnSelectionChanged, this ) ); AddEvents (); // If a parent is specified, add it to it's children list, if not, add it as a child to the m_pManager if ( pParent ) { SetParent ( pParent ); } else { pGUI->AddChild ( this ); SetParent ( NULL ); } }
CGUIButton_Impl::CGUIButton_Impl( CGUI_Impl * pGUI, String strCaption, CGUIElement_Impl * pParent ) { // Store the manager instance m_pManager = pGUI; // Get a unique name for cegui String strName = pGUI->GetUniqueName(); // Create the window and set default settings m_pWindow = pGUI->GetWindowManager()->createWindow( "CGUI/Button", strName.Get() ); m_pWindow->setDestroyedByParent( false ); SetText( strCaption ); m_pWindow->setSize( CEGUI::Absolute, CEGUI::Size( 128.0f, 24.0f ) ); m_pWindow->setVisible( true ); // Store the pointer to this element m_pWindow->setUserData( (void *)this ); // Register our events AddEvents(); // If a parent is set, add it to it's childs list, if not add it as a child to the gui manager if( pParent ) SetParent( pParent ); else { pGUI->AddChild( this ); SetParent( NULL ); } }
CGUIWindow_Impl::CGUIWindow_Impl ( CGUI_Impl* pGUI, CGUIElement* pParent, const char* szCaption, const SString& strLayoutFile ) { m_pManager = pGUI; // Get an unique identifier for CEGUI char szUnique [CGUI_CHAR_SIZE]; pGUI->GetUniqueName ( szUnique ); // Create the window and set default settings if ( !strLayoutFile.empty () ) { // Load from XML file m_pWindow = pGUI->GetWindowManager ()->loadWindowLayout ( strLayoutFile ); } if ( !m_pWindow ) { // Create new here m_pWindow = pGUI->GetWindowManager ()->createWindow ( CGUIWINDOW_NAME, szUnique ); m_pWindow->setRect ( CEGUI::Relative, CEGUI::Rect (0.10f, 0.10f, 0.60f, 0.90f) ); m_pWindow->setAlpha ( 0.8f ); // Give the window a caption m_pWindow->setText ( CGUI_Impl::GetUTFString(szCaption) ); } m_pWindow->setDestroyedByParent ( false ); // Store the pointer to this CGUI element in the CEGUI element m_pWindow->setUserData ( reinterpret_cast < void* > ( this ) ); // Set fixed minimum size to 96x48 m_pWindow->setMetricsMode ( CEGUI::Absolute ); m_pWindow->setMinimumSize ( CEGUI::Size ( 96.0f, 48.0f ) ); // Some window specific style options reinterpret_cast < CEGUI::FrameWindow* > ( m_pWindow ) -> setTitlebarFont ( "default-bold-small" ); // Register our events m_pWindow->subscribeEvent ( CEGUI::FrameWindow::EventCloseClicked, CEGUI::Event::Subscriber ( &CGUIWindow_Impl::Event_OnCloseClick, this ) ); m_pWindow->subscribeEvent ( CEGUI::FrameWindow::EventKeyDown, CEGUI::Event::Subscriber ( &CGUIWindow_Impl::Event_OnKeyDown, this ) ); AddEvents (); // Disable rolling up, because we don't need it and it causes a freeze reinterpret_cast < CEGUI::FrameWindow* > ( m_pWindow ) -> setRollupEnabled ( false ); // If a parent is specified, add it to it's children list, if not, add it as a child to the pManager if ( pParent ) { SetParent ( pParent ); } else { pGUI->AddChild ( this ); SetParent ( NULL ); } }
CGUIGridList_Impl::CGUIGridList_Impl ( CGUI_Impl* pGUI, CGUIElement* pParent, bool bFrame ) { m_pManager = pGUI; // Initialize m_hUniqueHandle = 0; m_iIndex = 0; m_bIgnoreTextSpacer = false; // Get an unique identifier for CEGUI (gah, there's gotta be an another way) char szUnique [CGUI_CHAR_SIZE]; pGUI->GetUniqueName ( szUnique ); // Create the window and set default settings if ( bFrame ) m_pWindow = pGUI->GetWindowManager ()->createWindow ( CGUIGRIDLIST_NAME, szUnique ); else m_pWindow = pGUI->GetWindowManager ()->createWindow ( CGUIGRIDLISTNOFRAME_NAME, szUnique ); m_pWindow->setDestroyedByParent ( false ); m_pWindow->setRect ( CEGUI::Relative, CEGUI::Rect (0.00f, 0.00f, 0.40f, 0.40f ) ); reinterpret_cast < CEGUI::MultiColumnList* > ( m_pWindow ) -> setUserColumnDraggingEnabled ( false ); reinterpret_cast < CEGUI::MultiColumnList* > ( m_pWindow ) -> setShowHorzScrollbar ( false ); reinterpret_cast < CEGUI::MultiColumnList* > ( m_pWindow ) -> setSelectionMode ( CEGUI::MultiColumnList::RowSingle ); reinterpret_cast < CEGUI::MultiColumnList* > ( m_pWindow ) -> setSortDirection( CEGUI::ListHeaderSegment::None ); // Store the pointer to this CGUI element in the CEGUI element m_pWindow->setUserData ( reinterpret_cast < void* > ( this ) ); // Register our events m_pWindow->subscribeEvent ( CEGUI::MultiColumnList::EventSortColumnChanged, CEGUI::Event::Subscriber ( &CGUIGridList_Impl::Event_OnSortColumn, this ) ); AddEvents (); // If a parent is specified, add it to it's children list, if not, add it as a child to the pManager if ( pParent ) { SetParent ( pParent ); } else { pGUI->AddChild ( this ); SetParent ( NULL ); } }
CGUIWebBrowser_Impl::CGUIWebBrowser_Impl(CGUI_Impl* pGUI, CGUIElement* pParent) { // Initialize m_pImagesetManager = pGUI->GetImageSetManager(); m_pImageset = nullptr; m_pImage = nullptr; m_pGUI = pGUI; m_pManager = pGUI; m_pWebView = nullptr; // Get an unique identifier for CEGUI char szUnique[CGUI_CHAR_SIZE]; pGUI->GetUniqueName(szUnique); // Create the control and set default properties m_pWindow = pGUI->GetWindowManager()->createWindow(CGUIWEBBROWSER_NAME, szUnique); m_pWindow->setDestroyedByParent(false); m_pWindow->setRect(CEGUI::Relative, CEGUI::Rect(0.0f, 0.0f, 1.0f, 1.0f)); reinterpret_cast<CEGUI::StaticImage*>(m_pWindow)->setBackgroundEnabled(false); // Store the pointer to this CGUI element in the CEGUI element m_pWindow->setUserData(reinterpret_cast<void*>(this)); AddEvents(); // Apply browser events m_pWindow->subscribeEvent(CEGUI::Window::EventMouseButtonDown, CEGUI::Event::Subscriber(&CGUIWebBrowser_Impl::Event_MouseButtonDown, this)); m_pWindow->subscribeEvent(CEGUI::Window::EventMouseButtonUp, CEGUI::Event::Subscriber(&CGUIWebBrowser_Impl::Event_MouseButtonUp, this)); m_pWindow->subscribeEvent(CEGUI::Window::EventMouseMove, CEGUI::Event::Subscriber(&CGUIWebBrowser_Impl::Event_MouseMove, this)); m_pWindow->subscribeEvent(CEGUI::Window::EventMouseWheel, CEGUI::Event::Subscriber(&CGUIWebBrowser_Impl::Event_MouseWheel, this)); m_pWindow->subscribeEvent(CEGUI::Window::EventActivated, CEGUI::Event::Subscriber(&CGUIWebBrowser_Impl::Event_Activated, this)); m_pWindow->subscribeEvent(CEGUI::Window::EventDeactivated, CEGUI::Event::Subscriber(&CGUIWebBrowser_Impl::Event_Deactivated, this)); // If a parent is specified, add it to it's children list, if not, add it as a child to the pManager if (pParent) { SetParent(pParent); } else { pGUI->AddChild(this); SetParent(nullptr); } }
void wxSocketEventDispatcher::RunLoop(int timeout) { struct timeval tv; tv.tv_sec = 0; tv.tv_usec = timeout; fd_set readset; fd_set writeset; int max_fd = FillSets( &readset, &writeset); if (select( max_fd+1, &readset, &writeset, NULL, &tv ) == 0) { // No socket input/output. Don't add events. return; } else { AddEvents(&readset, &writeset); } }
CGUILabel_Impl::CGUILabel_Impl ( CGUI_Impl* pGUI, CGUIElement* pParent, const char* szText ) { m_pManager = pGUI; m_pFont = pGUI->GetDefaultFont (); // Get an unique identifier for CEGUI (gah, there's gotta be an another way) char szUnique [CGUI_CHAR_SIZE]; pGUI->GetUniqueName ( szUnique ); // Create the window and set default settings m_pWindow = pGUI->GetWindowManager ()->createWindow ( CGUILABEL_NAME, szUnique ); m_pWindow->setDestroyedByParent ( false ); // Store the pointer to this CGUI element in the CEGUI element m_pWindow->setUserData ( reinterpret_cast < void* > ( this ) ); AddEvents (); // Do some hardcore disabling on the labels //m_pWindow->moveToBack ( ); //m_pWindow->disable ( ); m_pWindow->setZOrderingEnabled ( false ); //m_pWindow->setAlwaysOnTop ( true ); SetFrameEnabled ( false ); SetHorizontalAlign ( CGUI_ALIGN_LEFT ); SetVerticalAlign ( CGUI_ALIGN_TOP ); SetText ( szText ); reinterpret_cast < CEGUI::StaticText* > ( m_pWindow ) -> setBackgroundEnabled ( false ); // If a parent is specified, add it to it's children list, if not, add it as a child to the pManager if ( pParent ) { SetParent ( pParent ); } else { pGUI->AddChild ( this ); SetParent ( NULL ); } }
CGUIMemo_Impl::CGUIMemo_Impl ( CGUI_Impl* pGUI, CGUIElement* pParent, const char* szEdit ) { m_pManager = pGUI; // Get an unique identifier for CEGUI char szUnique [CGUI_CHAR_SIZE]; pGUI->GetUniqueName ( szUnique ); // Create the window and set default settings m_pWindow = pGUI->GetWindowManager ()->createWindow ( CGUIMEMO_NAME, szUnique ); m_pWindow->setDestroyedByParent ( false ); // Store the pointer to this CGUI element in the CEGUI element m_pWindow->setUserData ( reinterpret_cast < void* > ( this ) ); //m_pWindow->setRect ( CEGUI::Relative, CEGUI::Rect (0.00f, 0.00f, 0.40f, 0.40f ) ); // Register our events m_pWindow->subscribeEvent ( CEGUI::MultiLineEditbox::EventTextChanged, CEGUI::Event::Subscriber ( &CGUIMemo_Impl::Event_TextChanged, this ) ); m_pWindow->subscribeEvent ( CEGUI::MultiLineEditbox::EventKeyDown, CEGUI::Event::Subscriber ( &CGUIMemo_Impl::Event_OnKeyDown, this ) ); AddEvents (); // If a parent is specified, add it to it's children list, if not, add it as a child to the pManager if ( pParent ) { SetParent ( pParent ); if ( CGUITabList* pTabList = dynamic_cast < CGUITabList* > ( pParent ) ) { pTabList->AddItem ( this ); } } else { pGUI->AddChild ( this ); pGUI->AddItem ( this ); SetParent ( NULL ); } }
CGUIStaticImage_Impl::CGUIStaticImage_Impl ( CGUI_Impl* pGUI, CGUIElement* pParent ) { // Initialize m_pImagesetManager = pGUI->GetImageSetManager (); m_pImageset = NULL; m_pImage = NULL; m_pGUI = pGUI; m_pManager = pGUI; m_pTexture = NULL; m_bCreatedTexture = false; // Get an unique identifier for CEGUI char szUnique [CGUI_CHAR_SIZE]; pGUI->GetUniqueName ( szUnique ); // Create the control and set default properties m_pWindow = pGUI->GetWindowManager ()->createWindow ( CGUISTATICIMAGE_NAME, szUnique ); m_pWindow->setDestroyedByParent ( false ); m_pWindow->setRect ( CEGUI::Relative, CEGUI::Rect ( 0.0f, 0.0f, 1.0f, 1.0f ) ); reinterpret_cast < CEGUI::StaticImage* > ( m_pWindow ) -> setBackgroundEnabled ( false ); // Store the pointer to this CGUI element in the CEGUI element m_pWindow->setUserData ( reinterpret_cast < void* > ( this ) ); AddEvents (); // If a parent is specified, add it to it's children list, if not, add it as a child to the pManager if ( pParent ) { SetParent ( pParent ); } else { pGUI->AddChild ( this ); SetParent ( NULL ); } }
void Stage01::TipBoardOkCallBack(cocos2d::Ref* pSender) { tipboard->runAction( MoveTo::create(1, Point(winSize.width / 2, winSize.height + 150) ) ); AddEvents(); }
void GuideLayer::onEnterTransitionDidFinish() { GameStart(); AddEvents(); }