PageWindow::PageWindow() { LoadResourceFile("Demo/demo01/ui_resources/test_scroller_snap.tb.txt"); // Listen to the pagers scroller if (TBWidget *pager = GetWidgetByID(TBIDC("page-scroller"))) pager->GetScroller()->SetSnapListener(this); }
ListWindow::ListWindow(TBWidget *root, TBSelectItemSource *source) : DemoWindow(root) { LoadResourceFile("Demo/demo01/ui_resources/test_select.tb.txt"); if (TBSelectList *select = GetWidgetByIDAndType<TBSelectList>("list")) { select->SetSource(source); select->GetScrollContainer()->SetScrollMode(SCROLL_MODE_Y_AUTO); } }
ScrollContainerWindow::ScrollContainerWindow() { LoadResourceFile("Demo/demo01/ui_resources/test_scrollcontainer.tb.txt"); if (TBSelectDropdown *select = GetWidgetByIDAndType<TBSelectDropdown>(TBIDC("name dropdown"))) select->SetSource(&name_source); if (TBSelectDropdown *select = GetWidgetByIDAndType<TBSelectDropdown>(TBIDC("advanced dropdown"))) select->SetSource(&advanced_source); }
AdvancedListWindow::AdvancedListWindow(AdvancedItemSource *source) : m_source(source) { LoadResourceFile("Demo/demo01/ui_resources/test_select_advanced.tb.txt"); if (TBSelectList *select = GetWidgetByIDAndType<TBSelectList>("list")) { select->SetSource(source); select->GetScrollContainer()->SetScrollMode(SCROLL_MODE_X_AUTO_Y_AUTO); } }
bool CResourceMgr::AddResource( char* szFileName,int iModuleID ) { TABLE_MODULE_ITER iterModule; iterModule = m_ResourceTable.find( iModuleID ); if( iterModule != m_ResourceTable.end() ) { char Buff[256]; sprintf( Buff,"Duplicated Image Resource Module ID:[%d]",iModuleID ); MessageBox(NULL,Buff,"Load Error",MB_OK); return false; } return LoadResourceFile( szFileName, iModuleID ); }
MeshWindow::MeshWindow( tb::TBWidget* root, std::shared_ptr<InstancedMesh> mesh) : Window(root), _mesh(mesh), _currentID(0) { Log::Debug("[MeshWindow] constructor, instance at %p", this); std::string resourcePath = PathUtil::GUIPath() + "ui_meshwindow.txt"; LoadResourceFile(resourcePath.c_str()); m_close_button.SetState(tb::WIDGET_STATE_DISABLED, true); refreshInstances(); }
AnimationsWindow::AnimationsWindow() { LoadResourceFile("Demo/demo01/ui_resources/test_animations.tb.txt"); Animate(); }
ImageWindow::ImageWindow() { LoadResourceFile("Demo/demo01/ui_resources/test_image_widget.tb.txt"); }
TabContainerWindow::TabContainerWindow(TBWidget *root) : DemoWindow(root) { LoadResourceFile("demo01/ui_resources/test_tabcontainer01.tb.txt"); }
ConnectionWindow::ConnectionWindow() { LoadResourceFile("Demo/demo01/ui_resources/test_connections.tb.txt"); }
ConnectionWindow::ConnectionWindow(TBWidget *root) : DemoWindow(root) { LoadResourceFile("demo01/ui_resources/test_connections.tb.txt"); }
LayoutWindow::LayoutWindow(const char *filename) { LoadResourceFile(filename); }
TabContainerWindow::TabContainerWindow() { LoadResourceFile("Demo/demo01/ui_resources/test_tabcontainer01.tb.txt"); }
LayoutWindow::LayoutWindow(TBWidget *root, const char *filename) : DemoWindow(root) { LoadResourceFile(filename); }
MainWindow::MainWindow() { LoadResourceFile("Demo/demo01/ui_resources/test_ui.tb.txt"); SetOpacity(0.97f); }
ImageWindow::ImageWindow(TBWidget *root) : DemoWindow(root) { LoadResourceFile("demo01/ui_resources/test_image_widget.tb.txt"); }
AnimationsWindow::AnimationsWindow(TBWidget *root) : DemoWindow(root) { LoadResourceFile("demo01/ui_resources/test_animations.tb.txt"); Animate(); }
// == MainWindow ============================================================== MainWindow::MainWindow(TBWidget *root) : DemoWindow(root) { LoadResourceFile("demo01/ui_resources/test_ui.tb.txt"); SetOpacity(0.97f); }
EditWindow() { LoadResourceFile("Demo/demo01/ui_resources/test_textwindow.tb.txt"); }
// == EditWindow ============================================================== EditWindow::EditWindow(TBWidget *root) : DemoWindow(root) { LoadResourceFile("demo01/ui_resources/test_textwindow.tb.txt"); }