Demo: GacUI_Xml\Binding_Uri

This commit is contained in:
vczh
2016-04-14 00:30:17 -07:00
parent d2e5c3926f
commit 205867b7a3
4 changed files with 59 additions and 4 deletions
+49 -4
View File
@@ -12,14 +12,59 @@
<Text name="PrecompiledBinary">Binding_Uri.bin</Text> <Text name="PrecompiledBinary">Binding_Uri.bin</Text>
</Folder> </Folder>
</Folder> </Folder>
<Folder name="Data">
<Text name="Title">Binding_Uri</Text>
<Image name="Logo" content="File">..\..\..\GacUI_Layout\RichTextEmbedding\UI\Gaclib.png</Image>
<Doc name="Document">
<Doc>
<Content>
<p align="Center">
<div style="Title">
<b>Binding_Uri</b>
</div>
</p>
<p>
<div style="Body">
<nop>Welcome to the demo!</nop>
</div>
</p>
</Content>
<Styles>
<Style name="Content">
<face>Segoe UI</face>
</Style>
<Style name="Title" parent="Content">
<size>24</size>
<b>true</b>
</Style>
<Style name="Body" parent="Content">
<size>14</size>
</Style>
</Styles>
</Doc>
</Doc>
</Folder>
<Folder name="MainWindow"> <Folder name="MainWindow">
<Instance name="MainWindowResource"> <Instance name="MainWindowResource">
<Instance ref.CodeBehind="false" ref.Class="demo::MainWindow"> <Instance ref.CodeBehind="false" ref.Class="demo::MainWindow">
<Window Text="Binding_Uri" ClientSize="x:480 y:320"> <Window Text-uri="res://Data/Title" ClientSize="x:480 y:320">
<att.BoundsComposition-set PreferredMinSize="x:480 y:320"/> <att.BoundsComposition-set PreferredMinSize="x:480 y:320"/>
<Label Text="This is a window!"> <Tab>
<att.Font>fontFamily:{Segoe UI} size:32 antialias:true</att.Font> <att.BoundsComposition-set AlignmentToParent="left:5 top:5 right:5 bottom:5"/>
</Label>
<TabPage Text="Image">
<Bounds MinSizeLimitation="LimitToElement">
<ImageFrameElement Image-uri="res://Data/Logo"/>
</Bounds>
</TabPage>
<TabPage Text="Document">
<DocumentLabel ref.Name="documentLabel" Document-uri="res://Data/Document">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<ev.ActiveHyperlinkExecuted>documentLabel_ActiveHyperlinkExecuted</ev.ActiveHyperlinkExecuted>
</DocumentLabel>
</TabPage>
</Tab>
</Window> </Window>
</Instance> </Instance>
</Instance> </Instance>
@@ -14,6 +14,10 @@ namespace demo
{ {
// #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.) // #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.)
void MainWindow::documentLabel_ActiveHyperlinkExecuted(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments)
{
}
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER // #endregion CLASS_MEMBER_GUIEVENT_HANDLER
MainWindow::MainWindow() MainWindow::MainWindow()
@@ -40,6 +44,8 @@ namespace vl
BEGIN_CLASS_MEMBER(demo::MainWindow) BEGIN_CLASS_MEMBER(demo::MainWindow)
CLASS_MEMBER_BASE(vl::presentation::controls::GuiWindow) CLASS_MEMBER_BASE(vl::presentation::controls::GuiWindow)
CLASS_MEMBER_CONSTRUCTOR(demo::MainWindow*(), NO_PARAMETER) CLASS_MEMBER_CONSTRUCTOR(demo::MainWindow*(), NO_PARAMETER)
CLASS_MEMBER_GUIEVENT_HANDLER(documentLabel_ActiveHyperlinkExecuted, vl::presentation::compositions::GuiEventArgs)
END_CLASS_MEMBER(demo::MainWindow) END_CLASS_MEMBER(demo::MainWindow)
#undef _ #undef _
@@ -23,11 +23,13 @@ namespace demo
friend struct vl::reflection::description::CustomTypeDescriptorSelector<TImpl>; friend struct vl::reflection::description::CustomTypeDescriptorSelector<TImpl>;
private: private:
protected: protected:
vl::presentation::controls::GuiDocumentLabel* documentLabel;
void InitializeComponents() void InitializeComponents()
{ {
if (InitializeFromResource()) if (InitializeFromResource())
{ {
GUI_INSTANCE_REFERENCE(documentLabel);
} }
else else
{ {
@@ -37,6 +39,7 @@ namespace demo
MainWindow_() MainWindow_()
:vl::presentation::GuiInstancePartialClass<vl::presentation::controls::GuiWindow>(L"demo::MainWindow") :vl::presentation::GuiInstancePartialClass<vl::presentation::controls::GuiWindow>(L"demo::MainWindow")
,vl::presentation::controls::GuiWindow(vl::presentation::theme::GetCurrentTheme()->CreateWindowStyle()) ,vl::presentation::controls::GuiWindow(vl::presentation::theme::GetCurrentTheme()->CreateWindowStyle())
,documentLabel(0)
{ {
} }
}; };
@@ -62,6 +65,7 @@ namespace demo
protected: protected:
// #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.) // #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.)
void documentLabel_ActiveHyperlinkExecuted(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments);
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER // #endregion CLASS_MEMBER_GUIEVENT_HANDLER
public: public:
MainWindow(); MainWindow();
Binary file not shown.