| 16 | } |
| 17 | |
| 18 | void DemoKeeper::createScene() |
| 19 | { |
| 20 | base::BaseDemoManager::createScene(); |
| 21 | MyGUI::ResourceManager::getInstance().load("Fonts.xml"); |
| 22 | MyGUI::ResourceManager::getInstance().load("HyperTextSkins.xml"); |
| 23 | |
| 24 | const std::string& category = MyGUI::WidgetManager::getInstance().getCategoryName(); |
| 25 | MyGUI::FactoryManager::getInstance().registerFactory<MyGUI::WrapPanel>(category); |
| 26 | MyGUI::FactoryManager::getInstance().registerFactory<MyGUI::StackPanel>(category); |
| 27 | MyGUI::FactoryManager::getInstance().registerFactory<MyGUI::ScrollViewPanel>(category); |
| 28 | MyGUI::FactoryManager::getInstance().registerFactory<MyGUI::HyperTextBox>(category); |
| 29 | |
| 30 | MyGUI::Window* window = MyGUI::Gui::getInstance().createWidget<MyGUI::Window>( |
| 31 | "WindowCSX", |
| 32 | MyGUI::IntCoord(10, 10, 500, 500), |
| 33 | MyGUI::Align::Default, |
| 34 | "Main"); |
| 35 | MyGUI::IntCoord coord = window->getClientCoord(); |
| 36 | |
| 37 | MyGUI::HyperTextBox* hyperText = window->createWidget<MyGUI::HyperTextBox>( |
| 38 | "HyperTextBox", |
| 39 | MyGUI::IntCoord(0, 0, coord.width, coord.height), |
| 40 | MyGUI::Align::Stretch); |
| 41 | hyperText->eventUrlClick += MyGUI::newDelegate(this, &DemoKeeper::OnClickUrl); |
| 42 | |
| 43 | hyperText->setCaption( |
| 44 | "<p align='left'><h1>Caption1 left</h1></p>\n" |
| 45 | "<p align='center'><h2>Caption2 center</h2></p>\n" |
| 46 | "<p align='right'><h3>Caption3 right</h3></p>\n" |
| 47 | "<p><s>This is strike.</s></p>\n" |
| 48 | "<p><s><color value='#FF00FF'>This is strike and colour.</color></s></p>\n" |
| 49 | "<p><u>This is under.</u></p>\n" |
| 50 | "<p><color value='#FFFFFF'>This is color.</color></p>\n" |
| 51 | "<br/>\n" |
| 52 | "<p><url value='url_text1'>http://www.mygui.info</url></p>\n" |
| 53 | "<p><i><b><url value='url_text2'>http://www.mygui.info</url></b></i></p>\n" |
| 54 | "<p>This is image.<img>HandPointerImage</img></p>\n" |
| 55 | "<p>This is linked image.<url value='url_img'><img>HandPointerImage</img></url></p>\n" |
| 56 | "<p><b>This is bold text.</b></p>\n" |
| 57 | "<p><i>This is italic text.</i></p>\n" |
| 58 | "<p><t/><i><b>This is bold and italic text.</b></i></p>\n" |
| 59 | "<p><i><b><s><u>This is bold and italic and under and strike text.</u></s></b></i></p>\n" |
| 60 | "<p float='left'><img width='48' height='48'>HandPointerImage</img>text1 texttext2 text3 text4 texttext5 " |
| 61 | "texttexttexttext6 text7 text8 texttext9 text10 texttext11 text12</p>\n" |
| 62 | "<p float='right' align='right'><img width='48' height='48'>HandPointerImage</img>text1 texttext2 text3 " |
| 63 | "text4 texttext5 texttexttexttext6 text7 text8 texttext9 text10 texttext11 text12</p>"); |
| 64 | |
| 65 | hyperText->updateContent(); |
| 66 | } |
| 67 | |
| 68 | void DemoKeeper::destroyScene() |
| 69 | { |
nothing calls this directly
no test coverage detected