Update Release
@@ -81,47 +81,19 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Main.cpp" />
|
||||
<ClCompile Include="UI\Source\DemoPartialClasses.cpp">
|
||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Xml Include="UI\Images\Folder.xml" />
|
||||
<Xml Include="UI\MainWindow.xml" />
|
||||
<Xml Include="UI\Resource.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</Xml>
|
||||
<Xml Include="UI\Skin.xml" />
|
||||
<Xml Include="UI\XmlDocDemo.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="UI\Images\OfficeExcel.ico" />
|
||||
<Image Include="UI\Images\OfficeOneNote.ico" />
|
||||
<Image Include="UI\Images\OfficeOutlook.ico" />
|
||||
<Image Include="UI\Images\OfficePowerPoint.ico" />
|
||||
<Image Include="UI\Images\OfficeWord.ico" />
|
||||
<Image Include="UI\Images\_Copy.png" />
|
||||
<Image Include="UI\Images\_Cut.png" />
|
||||
<Image Include="UI\Images\_Delete.png" />
|
||||
<Image Include="UI\Images\_New.png" />
|
||||
<Image Include="UI\Images\_Open.png" />
|
||||
<Image Include="UI\Images\_Paste.png" />
|
||||
<Image Include="UI\Images\_Print.png" />
|
||||
<Image Include="UI\Images\_Redo.png" />
|
||||
<Image Include="UI\Images\_Save.png" />
|
||||
<Image Include="UI\Images\_SaveAs.png" />
|
||||
<Image Include="UI\Images\_Undo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="UI\Source\Demo.h" />
|
||||
<ClInclude Include="UI\Source\DemoPartialClasses.h" />
|
||||
<ClCompile Include="UI\FullControlTest\Source\DemoPartialClasses.cpp" />
|
||||
<ClCompile Include="UI\FullControlTest\Source\MainWindow.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Lib\GacUILite\GacUILite.vcxproj">
|
||||
<Project>{96c559ca-9718-4bec-a053-28a0ab6a8ca2}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="UI\FullControlTest\Source\Demo.h" />
|
||||
<ClInclude Include="UI\FullControlTest\Source\DemoPartialClasses.h" />
|
||||
<ClInclude Include="UI\FullControlTest\Source\MainWindow.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
|
||||
@@ -13,9 +13,6 @@
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files\Images">
|
||||
<UniqueIdentifier>{a38b2626-b0ce-452b-8f55-bc3a2d7508ac}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="UI">
|
||||
<UniqueIdentifier>{9cdd5d13-56a2-41f5-90bf-e0f5d147d766}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -24,82 +21,21 @@
|
||||
<ClCompile Include="Main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="UI\Source\DemoPartialClasses.cpp">
|
||||
<ClCompile Include="UI\FullControlTest\Source\DemoPartialClasses.cpp">
|
||||
<Filter>UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="UI\FullControlTest\Source\MainWindow.cpp">
|
||||
<Filter>UI</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Xml Include="UI\MainWindow.xml">
|
||||
<Filter>Resource Files</Filter>
|
||||
</Xml>
|
||||
<Xml Include="UI\Resource.xml">
|
||||
<Filter>Resource Files</Filter>
|
||||
</Xml>
|
||||
<Xml Include="UI\Skin.xml">
|
||||
<Filter>Resource Files</Filter>
|
||||
</Xml>
|
||||
<Xml Include="UI\XmlDocDemo.xml">
|
||||
<Filter>Resource Files</Filter>
|
||||
</Xml>
|
||||
<Xml Include="UI\Images\Folder.xml">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Xml>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="UI\Images\_Copy.png">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
<Image Include="UI\Images\_Cut.png">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
<Image Include="UI\Images\_Delete.png">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
<Image Include="UI\Images\_New.png">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
<Image Include="UI\Images\_Open.png">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
<Image Include="UI\Images\_Paste.png">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
<Image Include="UI\Images\_Print.png">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
<Image Include="UI\Images\_Redo.png">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
<Image Include="UI\Images\_Save.png">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
<Image Include="UI\Images\_SaveAs.png">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
<Image Include="UI\Images\_Undo.png">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
<Image Include="UI\Images\OfficeExcel.ico">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
<Image Include="UI\Images\OfficeOneNote.ico">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
<Image Include="UI\Images\OfficeOutlook.ico">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
<Image Include="UI\Images\OfficePowerPoint.ico">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
<Image Include="UI\Images\OfficeWord.ico">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="UI\Source\Demo.h">
|
||||
<ClInclude Include="UI\FullControlTest\Source\Demo.h">
|
||||
<Filter>UI</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="UI\Source\DemoPartialClasses.h">
|
||||
<ClInclude Include="UI\FullControlTest\Source\DemoPartialClasses.h">
|
||||
<Filter>UI</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="UI\FullControlTest\Source\MainWindow.h">
|
||||
<Filter>UI</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "UI/Source/Demo.h"
|
||||
#include "UI/FullControlTest/Source/Demo.h"
|
||||
#include <Windows.h>
|
||||
|
||||
using namespace vl;
|
||||
@@ -6,6 +6,8 @@ using namespace vl::collections;
|
||||
using namespace vl::stream;
|
||||
using namespace vl::reflection::description;
|
||||
using namespace vl::presentation;
|
||||
using namespace vl::presentation::templates;
|
||||
using namespace vl::presentation::elements;
|
||||
using namespace vl::presentation::controls;
|
||||
|
||||
#pragma comment(linker,"\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||
@@ -15,6 +17,233 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
||||
return SetupWindowsDirect2DRenderer();
|
||||
}
|
||||
|
||||
#define SP(NAME, CLASS)\
|
||||
new NAME##_StyleProvider([](auto _)\
|
||||
{\
|
||||
return new darkskin::CLASS;\
|
||||
})\
|
||||
|
||||
#define NOTIMPL throw "NOT-USED-IN-THIS-TUTORIAL"
|
||||
|
||||
class DarkSkin : public Object, public virtual theme::ITheme
|
||||
{
|
||||
public:
|
||||
GuiWindow::IStyleController* CreateWindowStyle()override
|
||||
{
|
||||
return SP(GuiWindowTemplate, WindowTemplate);
|
||||
}
|
||||
|
||||
GuiCustomControl::IStyleController* CreateCustomControlStyle()override
|
||||
{
|
||||
return new GuiControl::EmptyStyleController;
|
||||
}
|
||||
|
||||
GuiTooltip::IStyleController* CreateTooltipStyle()override
|
||||
{
|
||||
return SP(GuiWindowTemplate, TooltipTemplate);
|
||||
}
|
||||
|
||||
GuiLabel::IStyleController* CreateLabelStyle()override
|
||||
{
|
||||
return SP(GuiLabelTemplate, LabelTemplate);
|
||||
}
|
||||
|
||||
GuiLabel::IStyleController* CreateShortcutKeyStyle()override
|
||||
{
|
||||
return SP(GuiLabelTemplate, ShortcutKeyTemplate);
|
||||
}
|
||||
|
||||
GuiScrollContainer::IStyleProvider* CreateScrollContainerStyle()override
|
||||
{
|
||||
return SP(GuiScrollViewTemplate, ScrollViewTemplate);
|
||||
}
|
||||
|
||||
GuiControl::IStyleController* CreateGroupBoxStyle()override
|
||||
{
|
||||
return SP(GuiControlTemplate, GroupBoxTemplate);
|
||||
}
|
||||
|
||||
GuiTab::IStyleController* CreateTabStyle()override
|
||||
{
|
||||
return SP(GuiTabTemplate, TabTemplate);
|
||||
}
|
||||
|
||||
GuiComboBoxListControl::IStyleController* CreateComboBoxStyle()override
|
||||
{
|
||||
return SP(GuiComboBoxTemplate, ComboBoxTemplate);
|
||||
}
|
||||
|
||||
GuiScrollView::IStyleProvider* CreateMultilineTextBoxStyle()override
|
||||
{
|
||||
return SP(GuiMultilineTextBoxTemplate, MultilineTextBoxTemplate);
|
||||
}
|
||||
|
||||
GuiSinglelineTextBox::IStyleProvider* CreateTextBoxStyle()override
|
||||
{
|
||||
return SP(GuiSinglelineTextBoxTemplate, SinglelineTextBoxTemplate);
|
||||
}
|
||||
|
||||
text::ColorEntry GetDefaultTextBoxColorEntry()override
|
||||
{
|
||||
NOTIMPL;
|
||||
}
|
||||
|
||||
GuiDocumentViewer::IStyleProvider* CreateDocumentViewerStyle()override
|
||||
{
|
||||
return SP(GuiDocumentViewerTemplate, DocumentViewerTemplate);
|
||||
}
|
||||
|
||||
GuiDocumentLabel::IStyleController* CreateDocumentLabelStyle()override
|
||||
{
|
||||
return SP(GuiDocumentLabelTemplate, DocumentLabelTemplate);
|
||||
}
|
||||
|
||||
GuiDocumentLabel::IStyleController* CreateDocumentTextBoxStyle()override
|
||||
{
|
||||
return SP(GuiDocumentLabelTemplate, DocumentTextBoxTemplate);
|
||||
}
|
||||
|
||||
GuiListView::IStyleProvider* CreateListViewStyle()override
|
||||
{
|
||||
return SP(GuiListViewTemplate, ListViewTemplate);
|
||||
}
|
||||
|
||||
GuiTreeView::IStyleProvider* CreateTreeViewStyle()override
|
||||
{
|
||||
return SP(GuiTreeViewTemplate, TreeViewTemplate);
|
||||
}
|
||||
|
||||
GuiSelectableButton::IStyleController* CreateListItemBackgroundStyle()override
|
||||
{
|
||||
NOTIMPL;
|
||||
}
|
||||
|
||||
GuiSelectableButton::IStyleController* CreateTreeItemExpanderStyle()override
|
||||
{
|
||||
NOTIMPL;
|
||||
}
|
||||
|
||||
GuiToolstripMenu::IStyleController* CreateMenuStyle()override
|
||||
{
|
||||
return SP(GuiMenuTemplate, ToolstripMenuTemplate);
|
||||
}
|
||||
|
||||
GuiToolstripMenuBar::IStyleController* CreateMenuBarStyle()override
|
||||
{
|
||||
return SP(GuiControlTemplate, ToolstripTemplate);
|
||||
}
|
||||
|
||||
GuiControl::IStyleController* CreateMenuSplitterStyle()override
|
||||
{
|
||||
return SP(GuiControlTemplate, MenuSplitterTemplate);
|
||||
}
|
||||
|
||||
GuiToolstripButton::IStyleController* CreateMenuBarButtonStyle()override
|
||||
{
|
||||
return SP(GuiToolstripButtonTemplate, MenuBarButtonTemplate);
|
||||
}
|
||||
|
||||
GuiToolstripButton::IStyleController* CreateMenuItemButtonStyle()override
|
||||
{
|
||||
return SP(GuiToolstripButtonTemplate, MenuItemButtonTemplate);
|
||||
}
|
||||
|
||||
GuiToolstripToolBar::IStyleController* CreateToolBarStyle()override
|
||||
{
|
||||
return SP(GuiControlTemplate, ToolstripTemplate);
|
||||
}
|
||||
|
||||
GuiToolstripButton::IStyleController* CreateToolBarButtonStyle()override
|
||||
{
|
||||
return SP(GuiToolstripButtonTemplate, ToolstripButtonTemplate);
|
||||
}
|
||||
|
||||
GuiToolstripButton::IStyleController* CreateToolBarDropdownButtonStyle()override
|
||||
{
|
||||
return SP(GuiToolstripButtonTemplate, ToolstripDropdownButtonTemplate);
|
||||
}
|
||||
|
||||
GuiToolstripButton::IStyleController* CreateToolBarSplitButtonStyle()override
|
||||
{
|
||||
return SP(GuiToolstripButtonTemplate, ToolstripSplitButtonTemplate);
|
||||
}
|
||||
|
||||
GuiControl::IStyleController* CreateToolBarSplitterStyle()override
|
||||
{
|
||||
return SP(GuiControlTemplate, ToolstripSplitterTemplate);
|
||||
}
|
||||
|
||||
GuiButton::IStyleController* CreateButtonStyle()override
|
||||
{
|
||||
return SP(GuiButtonTemplate, ButtonTemplate);
|
||||
}
|
||||
|
||||
GuiSelectableButton::IStyleController* CreateCheckBoxStyle()override
|
||||
{
|
||||
return SP(GuiSelectableButtonTemplate, CheckBoxTemplate);
|
||||
}
|
||||
|
||||
GuiSelectableButton::IStyleController* CreateRadioButtonStyle()override
|
||||
{
|
||||
return SP(GuiSelectableButtonTemplate, RadioButtonTemplate);
|
||||
}
|
||||
|
||||
GuiDatePicker::IStyleProvider* CreateDatePickerStyle()override
|
||||
{
|
||||
return SP(GuiDatePickerTemplate, DatePickerTemplate);
|
||||
}
|
||||
|
||||
GuiScroll::IStyleController* CreateHScrollStyle()override
|
||||
{
|
||||
return SP(GuiScrollTemplate, HScrollTemplate);
|
||||
}
|
||||
|
||||
GuiScroll::IStyleController* CreateVScrollStyle()override
|
||||
{
|
||||
return SP(GuiScrollTemplate, VScrollTemplate);
|
||||
}
|
||||
|
||||
GuiScroll::IStyleController* CreateHTrackerStyle()override
|
||||
{
|
||||
return SP(GuiScrollTemplate, HTrackerTemplate);
|
||||
}
|
||||
|
||||
GuiScroll::IStyleController* CreateVTrackerStyle()override
|
||||
{
|
||||
return SP(GuiScrollTemplate, VTrackerTemplate);
|
||||
}
|
||||
|
||||
GuiScroll::IStyleController* CreateProgressBarStyle()override
|
||||
{
|
||||
return SP(GuiScrollTemplate, ProgressBarTemplate);
|
||||
}
|
||||
|
||||
vint GetScrollDefaultSize()override
|
||||
{
|
||||
NOTIMPL;
|
||||
}
|
||||
|
||||
vint GetTrackerDefaultSize()override
|
||||
{
|
||||
NOTIMPL;
|
||||
}
|
||||
|
||||
GuiVirtualTextList::IStyleProvider* CreateTextListStyle()override
|
||||
{
|
||||
return SP(GuiTextListTemplate, TextListTemplate);
|
||||
}
|
||||
|
||||
GuiSelectableButton::IStyleController* CreateCheckTextListItemStyle()override
|
||||
{
|
||||
NOTIMPL;
|
||||
}
|
||||
|
||||
GuiSelectableButton::IStyleController* CreateRadioTextListItemStyle()override
|
||||
{
|
||||
NOTIMPL;
|
||||
}
|
||||
};
|
||||
|
||||
void GuiMain()
|
||||
{
|
||||
LoadDemoTypes();
|
||||
@@ -23,7 +252,16 @@ void GuiMain()
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
|
||||
GetResourceManager()->SetResource(L"Resource", resource);
|
||||
}
|
||||
demo::MainWindow window;
|
||||
window.MoveToScreenCenter();
|
||||
GetApplication()->Run(&window);
|
||||
{
|
||||
DarkSkin darkSkin;
|
||||
auto oldTheme = theme::GetCurrentTheme();
|
||||
theme::SetCurrentTheme(&darkSkin);
|
||||
{
|
||||
demo::MainWindow window;
|
||||
window.ForceCalculateSizeImmediately();
|
||||
window.MoveToScreenCenter();
|
||||
GetApplication()->Run(&window);
|
||||
}
|
||||
theme::SetCurrentTheme(oldTheme);
|
||||
}
|
||||
}
|
||||
@@ -1 +1,3 @@
|
||||
..\..\..\..\Tools\GacGen.exe Resource.xml
|
||||
del /Q FullControlTest
|
||||
robocopy ..\..\..\..\..\GacUI\Test\GacUISrc\Host\Resources\FullControlTest FullControlTest /E
|
||||
..\..\..\..\Tools\GacGen.exe FullControlTest\Resource.xml
|
||||
@@ -0,0 +1,252 @@
|
||||
<Folder>
|
||||
<Folder name="GenderComponents">
|
||||
<Instance name="GenderDisplayerResource">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::GenderDisplayer">
|
||||
<ref.Members>
|
||||
<![CDATA[
|
||||
prop Gender : MyGender = Male {}
|
||||
]]>
|
||||
</ref.Members>
|
||||
<CustomControl ref.Name="self">
|
||||
<Bounds AlignmentToParent="left:2 top:2 right:2 bottom:2" MinSizeLimitation="LimitToElement">
|
||||
<ImageFrame HorizontalAlignment="Left" VerticalAlignment="Center">
|
||||
<att.Image-bind>(cast (GuiImageData^) self.ResolveResource("res", $"MiscImages/$(ToString(self.Gender))", true)).Image</att.Image-bind>
|
||||
</ImageFrame>
|
||||
</Bounds>
|
||||
</CustomControl>
|
||||
</Instance>
|
||||
</Instance>
|
||||
|
||||
<Instance name="GenderVisualizerResource">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::GenderVisualizer" xmlns:demo="demo::*">
|
||||
<GridVisualizerTemplate ref.Name="self">
|
||||
<demo:GenderDisplayer Gender-bind="(cast MyGender self.CellValue) ?? MyGender::Male">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
</demo:GenderDisplayer>
|
||||
</GridVisualizerTemplate>
|
||||
</Instance>
|
||||
</Instance>
|
||||
|
||||
<Instance name="GenderItemTemplateResource">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::GenderItemTemplate" xmlns:demo="demo::*">
|
||||
<ref.Parameter Name="SelectedGender" Class="demo::MyGender"/>
|
||||
<TextListItemTemplate MinSizeLimitation="LimitToElementAndChildren">
|
||||
<demo:GenderDisplayer Gender-eval="SelectedGender">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
</demo:GenderDisplayer>
|
||||
</TextListItemTemplate>
|
||||
</Instance>
|
||||
</Instance>
|
||||
|
||||
<Instance name="GenderEditorResource">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::GenderEditor" xmlns:demo="demo::*">
|
||||
<ref.Members>
|
||||
<![CDATA[
|
||||
var items : MyGender[] =
|
||||
{
|
||||
Male of MyGender
|
||||
Female of MyGender
|
||||
};
|
||||
]]>
|
||||
</ref.Members>
|
||||
<GridEditorTemplate ref.Name="self" CellValue-bind="comboBox.SelectedItem">
|
||||
<ComboBox ref.Name="comboBox" ItemTemplate="demo:GenderItemTemplate" SelectedIndex-bind="self.items.IndexOf(self.CellValue)">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
<att.ListControl>
|
||||
<BindableTextList ItemSource-eval="self.items" ItemTemplate="demo:GenderItemTemplate" HorizontalAlwaysVisible="false" VerticalAlwaysVisible="false"/>
|
||||
</att.ListControl>
|
||||
</ComboBox>
|
||||
</GridEditorTemplate>
|
||||
</Instance>
|
||||
</Instance>
|
||||
</Folder>
|
||||
|
||||
<Folder name="CategoryComponents">
|
||||
<Instance name="CategoryDisplayerResource">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::CategoryDisplayer">
|
||||
<ref.Members>
|
||||
<![CDATA[
|
||||
prop Category : MyCategory = Black {}
|
||||
]]>
|
||||
</ref.Members>
|
||||
<CustomControl ref.Name="self">
|
||||
<Table AlignmentToParent="left:2 top:2 right:2 bottom:2" MinSizeLimitation="LimitToElementAndChildren">
|
||||
<att.Rows>
|
||||
<_>composeType:Percentage percentage:0.5</_>
|
||||
<_>composeType:Absolute absolute:16</_>
|
||||
<_>composeType:Percentage percentage:0.5</_>
|
||||
</att.Rows>
|
||||
<att.Columns>
|
||||
<_>composeType:Absolute absolute:2</_>
|
||||
<_>composeType:Absolute absolute:16</_>
|
||||
<_>composeType:Absolute absolute:2</_>
|
||||
<_>composeType:Percentage percentage:1.0</_>
|
||||
</att.Columns>
|
||||
|
||||
<Cell Site="row:1 column:1">
|
||||
<SolidBorder Color="#000000"/>
|
||||
<Bounds AlignmentToParent="left:1 top:1 right:1 bottom:1">
|
||||
<SolidBackground Color-bind="ToColor(self.Category)"/>
|
||||
</Bounds>
|
||||
</Cell>
|
||||
|
||||
<Cell Site="row:0 column:3 rowSpan:3">
|
||||
<SolidLabel Color="#FF8000" Text-bind="ToString(self.Category)" Font-bind="self.Font" HorizontalAlignment="Left" VerticalAlignment="Center" Ellipse="true"/>
|
||||
</Cell>
|
||||
</Table>
|
||||
</CustomControl>
|
||||
</Instance>
|
||||
</Instance>
|
||||
|
||||
<Instance name="CategoryVisualizerResource">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::CategoryVisualizer" xmlns:demo="demo::*">
|
||||
<GridVisualizerTemplate ref.Name="self">
|
||||
<demo:CategoryDisplayer Category-bind="(cast MyCategory self.CellValue) ?? MyCategory::Black" Font-bind="self.Font">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
</demo:CategoryDisplayer>
|
||||
</GridVisualizerTemplate>
|
||||
</Instance>
|
||||
</Instance>
|
||||
|
||||
<Instance name="CategoryItemTemplateResource">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::CategoryItemTemplate" xmlns:demo="demo::*">
|
||||
<ref.Parameter Name="SelectedCategory" Class="demo::MyCategory"/>
|
||||
<TextListItemTemplate ref.Name="self" MinSizeLimitation="LimitToElementAndChildren">
|
||||
<demo:CategoryDisplayer Category-eval="SelectedCategory" Font-bind="self.Font">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
</demo:CategoryDisplayer>
|
||||
</TextListItemTemplate>
|
||||
</Instance>
|
||||
</Instance>
|
||||
|
||||
<Instance name="CategoryEditorResource">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::CategoryEditor" xmlns:demo="demo::*">
|
||||
<ref.Members>
|
||||
<![CDATA[
|
||||
var items : MyCategory[] =
|
||||
{
|
||||
Black of MyCategory
|
||||
Red of MyCategory
|
||||
Lime of MyCategory
|
||||
Blue of MyCategory
|
||||
White of MyCategory
|
||||
};
|
||||
]]>
|
||||
</ref.Members>
|
||||
<GridEditorTemplate ref.Name="self" CellValue-bind="comboBox.SelectedItem">
|
||||
<ComboBox ref.Name="comboBox" ItemTemplate="demo:CategoryItemTemplate" SelectedIndex-bind="self.items.IndexOf(self.CellValue)">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
<att.ListControl>
|
||||
<BindableTextList ItemSource-eval="self.items" ItemTemplate="demo:CategoryItemTemplate" HorizontalAlwaysVisible="false" VerticalAlwaysVisible="false"/>
|
||||
</att.ListControl>
|
||||
</ComboBox>
|
||||
</GridEditorTemplate>
|
||||
</Instance>
|
||||
</Instance>
|
||||
</Folder>
|
||||
|
||||
<Instance name="TextEditorResource">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::TextEditor">
|
||||
<GridEditorTemplate ref.Name="self" CellValue-bind="textBox.Text" FocusControl-ref="textBox">
|
||||
<SinglelineTextBox ref.Name="textBox" Text-bind="(cast string self.CellValue) ?? ''">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
</SinglelineTextBox>
|
||||
</GridEditorTemplate>
|
||||
</Instance>
|
||||
</Instance>
|
||||
|
||||
<Instance name="DateEditorResource">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::DateEditor">
|
||||
<GridEditorTemplate ref.Name="self" CellValue-bind="comboBox.SelectedDate" FocusControl-ref="comboBox">
|
||||
<DateComboBox ref.Name="comboBox" SelectedDate-bind="(cast DateTime self.CellValue) ?? (cast DateTime '2000-01-01 00:00:00.000')">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
</DateComboBox>
|
||||
</GridEditorTemplate>
|
||||
</Instance>
|
||||
</Instance>
|
||||
|
||||
<Instance name="DateFilterResource">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::DateFilter">
|
||||
<ref.Members>
|
||||
<![CDATA[
|
||||
@cpp:Private
|
||||
var callback : IDataProcessorCallback* = null;
|
||||
|
||||
@cpp:Private
|
||||
func UpdateFilter() : void
|
||||
{
|
||||
if (callback is not null)
|
||||
{
|
||||
callback.OnProcessorChanged();
|
||||
}
|
||||
}
|
||||
|
||||
prop Filter : IDataFilter^ = null {const, not observe}
|
||||
]]>
|
||||
</ref.Members>
|
||||
<ref.Ctor>
|
||||
<![CDATA[
|
||||
SetFilter(
|
||||
new IDataFilter^
|
||||
{
|
||||
override func SetCallback(value : IDataProcessorCallback*) : void
|
||||
{
|
||||
callback = value;
|
||||
}
|
||||
|
||||
override func Filter(row : object) : bool
|
||||
{
|
||||
var date = (cast (MyDataItem^) row).Birthday;
|
||||
if (checkFrom.Selected)
|
||||
{
|
||||
if (Sys::CompareDateTime(date, dateFrom.SelectedDate) < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (checkTo.Selected)
|
||||
{
|
||||
if (Sys::CompareDateTime(date, dateTo.SelectedDate) > 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
);
|
||||
]]>
|
||||
</ref.Ctor>
|
||||
<CustomControl ref.Name="self">
|
||||
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0" CellPadding="5" MinSizeLimitation="LimitToElementAndChildren">
|
||||
<att.Rows>
|
||||
<_>composeType:MinSize</_>
|
||||
<_>composeType:MinSize</_>
|
||||
</att.Rows>
|
||||
<att.Columns>
|
||||
<_>composeType:MinSize</_>
|
||||
<_>composeType:MinSize</_>
|
||||
</att.Columns>
|
||||
|
||||
<Cell Site="row:0 column:0">
|
||||
<CheckBox ref.Name="checkFrom" Text="From:" ev.SelectedChanged-eval="self.UpdateFilter();"/>
|
||||
</Cell>
|
||||
<Cell Site="row:0 column:1">
|
||||
<DateComboBox ref.Name="dateFrom" Enabled-bind="checkFrom.Selected" SelectedDate="1988-01-01 00:00:00.000" ev.SelectedDateChanged-eval="self.UpdateFilter();">
|
||||
<att.BoundsComposition-set PreferredMinSize="x:120"/>
|
||||
</DateComboBox>
|
||||
</Cell>
|
||||
|
||||
<Cell Site="row:1 column:0">
|
||||
<CheckBox ref.Name="checkTo" Text="To:" ev.SelectedChanged-eval="self.UpdateFilter();"/>
|
||||
</Cell>
|
||||
<Cell Site="row:1 column:1">
|
||||
<DateComboBox ref.Name="dateTo" Enabled-bind="checkTo.Selected" SelectedDate="2000-01-01 00:00:00.000" ev.SelectedDateChanged-eval="self.UpdateFilter();">
|
||||
<att.BoundsComposition-set PreferredMinSize="x:120"/>
|
||||
</DateComboBox>
|
||||
</Cell>
|
||||
</Table>
|
||||
</CustomControl>
|
||||
</Instance>
|
||||
</Instance>
|
||||
</Folder>
|
||||
@@ -0,0 +1,152 @@
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::DataGridTabPage" xmlns:demo="demo::*">
|
||||
<ref.Ctor>
|
||||
<![CDATA[
|
||||
{
|
||||
var tempData : observe MyDataItem^[] =
|
||||
{
|
||||
new MyDataItem^("涼宮 春日", Female, Lime, (cast DateTime "1988-08-08 00:00:00.000"), "http://www.haruhi.tv/")
|
||||
new MyDataItem^("キョン", Male, Black, (cast DateTime "1988-08-08 00:00:00.000"), "http://www.haruhi.tv/")
|
||||
new MyDataItem^("长门 有希", Female, White, (cast DateTime "2000-08-06 00:00:00.000"), "http://www.haruhi.tv/")
|
||||
new MyDataItem^("朝比奈 实玖瑠", Female, Red, (cast DateTime "1987-08-30 00:00:00.000"), "http://www.haruhi.tv/")
|
||||
new MyDataItem^("古泉 一树", Male, Blue, (cast DateTime "1986-08-12 00:00:00.000"), "http://www.haruhi.tv/")
|
||||
};
|
||||
|
||||
var largeImage = cast (GuiImageData^) (ResolveResource("res", "LargeImages/Task", true));
|
||||
var smallImage = cast (GuiImageData^) (ResolveResource("res", "SmallImages/Task", true));
|
||||
for(item in tempData)
|
||||
{
|
||||
item.LargeImage = largeImage;
|
||||
item.SmallImage = smallImage;
|
||||
}
|
||||
dataGrid.ItemSource = tempData;
|
||||
}
|
||||
]]>
|
||||
</ref.Ctor>
|
||||
<TabPage ref.Name="self" Text="BindableDataGrid">
|
||||
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0" CellPadding="5">
|
||||
<att.Rows>
|
||||
<_>composeType:MinSize</_>
|
||||
<_>composeType:Percentage percentage:1.0</_>
|
||||
</att.Rows>
|
||||
<att.Columns>
|
||||
<_>composeType:Percentage percentage:1.0</_>
|
||||
</att.Columns>
|
||||
|
||||
<Cell Site="row:0 column:0">
|
||||
<ComboBox ref.Name="comboView" Alt="V" SelectedIndex="6">
|
||||
<att.BoundsComposition-set PreferredMinSize="x:120"/>
|
||||
<att.ListControl>
|
||||
<TextList HorizontalAlwaysVisible="false" VerticalAlwaysVisible="false">
|
||||
<att.Items>
|
||||
<TextItem Text="BigIcon"/>
|
||||
<TextItem Text="SmallIcon"/>
|
||||
<TextItem Text="List"/>
|
||||
<TextItem Text="Tile"/>
|
||||
<TextItem Text="Information"/>
|
||||
<TextItem Text="Detail"/>
|
||||
<TextItem Text="DataGrid"/>
|
||||
</att.Items>
|
||||
</TextList>
|
||||
</att.ListControl>
|
||||
<ev.SelectedIndexChanged-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
switch (comboView.SelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
dataGrid.View = BigIcon;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
dataGrid.View = SmallIcon;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
dataGrid.View = ListViewView::List;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
dataGrid.View = Tile;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
dataGrid.View = Information;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
dataGrid.View = Detail;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
dataGrid.SetViewToDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</ev.SelectedIndexChanged-eval>
|
||||
</ComboBox>
|
||||
</Cell>
|
||||
|
||||
<Cell Site="row:1 column:0">
|
||||
<BindableDataGrid ref.Name="dataGrid" Alt="L" env.ItemType="demo::MyDataItem^" env.ItemName="itemToBind" HorizontalAlwaysVisible="false" VerticalAlwaysVisible="false">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
<att.LargeImageProperty>LargeImage</att.LargeImageProperty>
|
||||
<att.SmallImageProperty>SmallImage</att.SmallImageProperty>
|
||||
|
||||
<att.Columns>
|
||||
<DataColumn Text="Name" Size="120">
|
||||
<att.TextProperty>Name</att.TextProperty>
|
||||
<att.ValueProperty>Name</att.ValueProperty>
|
||||
<att.EditorFactory>demo:TextEditor</att.EditorFactory>
|
||||
<att.Sorter>[Sys::CompareString($1.Name, $2.Name)]</att.Sorter>
|
||||
</DataColumn>
|
||||
|
||||
<DataColumn Text="Gender" Size="80">
|
||||
<att.TextProperty>demo::ToString(itemToBind.Gender)</att.TextProperty>
|
||||
<att.ValueProperty>Gender</att.ValueProperty>
|
||||
<att.VisualizerFactory>demo:GenderVisualizer;CellBorderVisualizerTemplate</att.VisualizerFactory>
|
||||
<att.EditorFactory>demo:GenderEditor</att.EditorFactory>
|
||||
<att.Sorter>[Sys::CompareUInt64(cast UInt64 ($1.Gender), cast UInt64 ($2.Gender))]</att.Sorter>
|
||||
</DataColumn>
|
||||
|
||||
<DataColumn Text="Category" Size="80">
|
||||
<att.TextProperty>demo::ToString(itemToBind.Category)</att.TextProperty>
|
||||
<att.ValueProperty>Category</att.ValueProperty>
|
||||
<att.VisualizerFactory>demo:CategoryVisualizer;CellBorderVisualizerTemplate</att.VisualizerFactory>
|
||||
<att.EditorFactory>demo:CategoryEditor</att.EditorFactory>
|
||||
<att.Sorter>[Sys::CompareUInt64(cast UInt64 ($1.Category), cast UInt64 ($2.Category))]</att.Sorter>
|
||||
</DataColumn>
|
||||
|
||||
<DataColumn Text="Birthday" Size="80">
|
||||
<att.TextProperty>demo::ToString(itemToBind.Birthday)</att.TextProperty>
|
||||
<att.ValueProperty>Birthday</att.ValueProperty>
|
||||
<att.EditorFactory>demo:DateEditor</att.EditorFactory>
|
||||
<att.Sorter>[Sys::CompareDateTime($1.Birthday, $2.Birthday)]</att.Sorter>
|
||||
<att.Filter-eval>dateFilter.Filter</att.Filter-eval>
|
||||
<att.Popup>
|
||||
<ToolstripMenu>
|
||||
<demo:DateFilter ref.Name="dateFilter">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
</demo:DateFilter>
|
||||
</ToolstripMenu>
|
||||
</att.Popup>
|
||||
</DataColumn>
|
||||
|
||||
<DataColumn Text="Website" Size="160">
|
||||
<att.TextProperty>Website</att.TextProperty>
|
||||
<att.ValueProperty>Website</att.ValueProperty>
|
||||
<att.VisualizerFactory>HyperlinkVisualizerTemplate;CellBorderVisualizerTemplate</att.VisualizerFactory>
|
||||
<att.EditorFactory>demo:TextEditor</att.EditorFactory>
|
||||
<att.Sorter>[Sys::CompareString($1.Website, $2.Website)]</att.Sorter>
|
||||
</DataColumn>
|
||||
</att.Columns>
|
||||
|
||||
<att.DataColumns>
|
||||
<_>0</_>
|
||||
</att.DataColumns>
|
||||
</BindableDataGrid>
|
||||
</Cell>
|
||||
</Table>
|
||||
</TabPage>
|
||||
</Instance>
|
||||
@@ -0,0 +1,65 @@
|
||||
<Folder>
|
||||
<Instance name="HyperlinkWindowResource">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::HyperlinkWindow">
|
||||
<ref.Members>
|
||||
<![CDATA[
|
||||
prop Url : string? = null {}
|
||||
]]>
|
||||
</ref.Members>
|
||||
<Window ref.Name="self" Text="Hyperlink" ClientSize="x:320 y:80" SizeBox="false" MinimizedBox="false" MaximizedBox="false" ShowInTaskBar="false">
|
||||
<att.BoundsComposition-set PreferredMinSize="x:320 y:80"/>
|
||||
<Table CellPadding="5" BorderVisible="true" AlignmentToParent="left:0 top:0 right:0 bottom:0">
|
||||
<att.Rows>
|
||||
<_>composeType:MinSize</_>
|
||||
<_>composeType:Percentage percentage:1.0</_>
|
||||
<_>composeType:MinSize</_>
|
||||
</att.Rows>
|
||||
<att.Columns>
|
||||
<_>composeType:MinSize</_>
|
||||
<_>composeType:Percentage percentage:1.0</_>
|
||||
<_>composeType:MinSize</_>
|
||||
<_>composeType:MinSize</_>
|
||||
</att.Columns>
|
||||
|
||||
<Cell Site="row:0 column:0">
|
||||
<SolidLabel Text="Url: " HorizontalAlignment="Center"/>
|
||||
</Cell>
|
||||
|
||||
<Cell Site="row:0 column:1 columnSpan:3">
|
||||
<SinglelineTextBox ref.Name="textUrl">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
</SinglelineTextBox>
|
||||
</Cell>
|
||||
|
||||
<Cell Site="row:2 column:2">
|
||||
<Button Text="OK">
|
||||
<att.BoundsComposition-set PreferredMinSize="x:100"/>
|
||||
<ev.Clicked-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
self.Url = textUrl.Text;
|
||||
self.Close();
|
||||
}
|
||||
]]>
|
||||
</ev.Clicked-eval>
|
||||
</Button>
|
||||
</Cell>
|
||||
|
||||
<Cell Site="row:2 column:3">
|
||||
<Button Text="Cancel">
|
||||
<att.BoundsComposition-set PreferredMinSize="x:100"/>
|
||||
<ev.Clicked-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
self.Url = null;
|
||||
self.Close();
|
||||
}
|
||||
]]>
|
||||
</ev.Clicked-eval>
|
||||
</Button>
|
||||
</Cell>
|
||||
</Table>
|
||||
</Window>
|
||||
</Instance>
|
||||
</Instance>
|
||||
</Folder>
|
||||
@@ -0,0 +1,479 @@
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::DocumentTabPage" xmlns:demo="demo::*">
|
||||
<ref.Members>
|
||||
<![CDATA[
|
||||
@cpp:Private
|
||||
func SetEditMode(editMode: DocumentCommonInterface::EditMode) : void
|
||||
{
|
||||
var command =
|
||||
editMode == DocumentCommonInterface::EditMode::ViewOnly ? commandViewOnly :
|
||||
editMode == DocumentCommonInterface::EditMode::Selectable ? commandSelectable :
|
||||
commandEditable;
|
||||
|
||||
document.EditMode = editMode;
|
||||
commandViewOnly.Selected = (command == commandViewOnly);
|
||||
commandSelectable.Selected = (command == commandSelectable);
|
||||
commandEditable.Selected = (command == commandEditable);
|
||||
buttonView.Image = command.Image;
|
||||
self.UpdateSubscriptions();
|
||||
}
|
||||
|
||||
@cpp:Private
|
||||
func SelectAlignmentCommand() : ToolstripCommand*
|
||||
{
|
||||
var alignment = document.SummarizeParagraphAlignment(document.CaretBegin, document.CaretEnd);
|
||||
return
|
||||
alignment == Alignment::Left ? commandAlignLeft :
|
||||
alignment == Alignment::Center ? commandAlignCenter :
|
||||
alignment == Alignment::Right ? commandAlignRight :
|
||||
commandAlignDefault;
|
||||
}
|
||||
|
||||
@cpp:Private
|
||||
func SetAlignment(alignment : Alignment?) : void
|
||||
{
|
||||
document.SetParagraphAlignment(document.CaretBegin, document.CaretEnd, alignment);
|
||||
self.UpdateSubscriptions();
|
||||
}
|
||||
|
||||
@cpp:Private
|
||||
prop HasEditableSelection : bool = false {}
|
||||
|
||||
@cpp:Private
|
||||
prop HasEditableSelectionInSingleParagraph : bool = false {}
|
||||
|
||||
@cpp:Private
|
||||
func HasEditableCursor() : bool
|
||||
{
|
||||
return document.EditMode == DocumentCommonInterface::EditMode::Editable;
|
||||
}
|
||||
|
||||
@cpp:Private
|
||||
func HasEditableHyperlink(forEdit : bool) : bool
|
||||
{
|
||||
var a = document.CaretBegin;
|
||||
var b = document.CaretEnd;
|
||||
return a.row == b.row and a.column != b.column;
|
||||
}
|
||||
]]>
|
||||
</ref.Members>
|
||||
<ref.Ctor>
|
||||
<![CDATA[
|
||||
{
|
||||
SetEditMode(Editable);
|
||||
}
|
||||
]]>
|
||||
</ref.Ctor>
|
||||
<TabPage ref.Name="self" Text="Document Editor">
|
||||
<att.HasEditableSelection-bind>document.observe as _(_.CanCut() on _.SelectionChanged)</att.HasEditableSelection-bind>
|
||||
<MessageDialog ref.Name="dialogMessage" Title="You Clicked a Hyperlink!"/>
|
||||
<OpenFileDialog ref.Name="dialogOpen" Title="Select an Image" Filter="Image Files (*.jpg;*.png;*.bmp)|*.jpg;*.png;*.bmp" EnabledPreview="true" Options="FileDialogFileMustExist|FileDialogDereferenceLinks"/>
|
||||
|
||||
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0">
|
||||
<att.Rows>
|
||||
<_>composeType:MinSize</_>
|
||||
<_>composeType:MinSize</_>
|
||||
<_>composeType:Percentage percentage:1.0</_>
|
||||
</att.Rows>
|
||||
<att.Columns>
|
||||
<_>composeType:Percentage percentage:1.0</_>
|
||||
</att.Columns>
|
||||
|
||||
<Cell Site="row:0 column:0">
|
||||
<ToolstripMenuBar>
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
<MenuBarButton Text="Edit" Alt="E">
|
||||
<att.SubMenu-set>
|
||||
<MenuItemButton Command-ref="commandUndo" Alt="U"/>
|
||||
<MenuItemButton Command-ref="commandRedo" Alt="R"/>
|
||||
<MenuSplitter/>
|
||||
<MenuItemButton Command-ref="commandCopy" Alt="C"/>
|
||||
<MenuItemButton Command-ref="commandCut" Alt="X"/>
|
||||
<MenuItemButton Command-ref="commandPaste" Alt="P"/>
|
||||
<MenuSplitter/>
|
||||
<MenuItemButton Command-ref="commandDelete" Alt="D"/>
|
||||
<MenuSplitter/>
|
||||
<MenuItemButton Command-ref="commandSelect" Alt="A"/>
|
||||
<MenuItemButton Text="Object" Alt="O">
|
||||
<att.SubMenu-set>
|
||||
<MenuItemButton Command-ref="commandInsertImage" Alt="I"/>
|
||||
<MenuItemButton Command-ref="commandEditHyperlink" Alt="L"/>
|
||||
<MenuItemButton Command-ref="commandRemoveHyperlink" Alt="R"/>
|
||||
</att.SubMenu-set>
|
||||
</MenuItemButton>
|
||||
<MenuItemButton Text="Paragram Alignment" Alt="P">
|
||||
<att.SubMenu-set>
|
||||
<MenuItemButton Command-ref="commandAlignDefault" Alt="D"/>
|
||||
<MenuItemButton Command-ref="commandAlignLeft" Alt="L"/>
|
||||
<MenuItemButton Command-ref="commandAlignCenter" Alt="C"/>
|
||||
<MenuItemButton Command-ref="commandAlignRight" Alt="R"/>
|
||||
</att.SubMenu-set>
|
||||
</MenuItemButton>
|
||||
</att.SubMenu-set>
|
||||
</MenuBarButton>
|
||||
<MenuBarButton Text="View" Alt="V">
|
||||
<att.SubMenu-set>
|
||||
<MenuItemButton Command-ref="commandViewOnly" Alt="V"/>
|
||||
<MenuItemButton Command-ref="commandSelectable" Alt="S"/>
|
||||
<MenuItemButton Command-ref="commandEditable" Alt="E"/>
|
||||
</att.SubMenu-set>
|
||||
</MenuBarButton>
|
||||
</ToolstripMenuBar>
|
||||
</Cell>
|
||||
|
||||
<Cell Site="row:1 column:0">
|
||||
<ToolstripToolBar>
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
<ToolstripDropdownButton ref.Name="buttonView" Alt="V">
|
||||
<att.SubMenu-set>
|
||||
<MenuItemButton Command-ref="commandViewOnly" Alt="V"/>
|
||||
<MenuItemButton Command-ref="commandSelectable" Alt="S"/>
|
||||
<MenuItemButton Command-ref="commandEditable" Alt="E"/>
|
||||
</att.SubMenu-set>
|
||||
</ToolstripDropdownButton>
|
||||
<ToolstripDropdownButton ref.Name="buttonAlignment" Alt="P">
|
||||
<att.Image-bind>document.observe as _(self.SelectAlignmentCommand().Image on _.SelectionChanged)</att.Image-bind>
|
||||
<att.SubMenu-set>
|
||||
<MenuItemButton Command-ref="commandAlignDefault" Alt="D"/>
|
||||
<MenuItemButton Command-ref="commandAlignLeft" Alt="L"/>
|
||||
<MenuItemButton Command-ref="commandAlignCenter" Alt="C"/>
|
||||
<MenuItemButton Command-ref="commandAlignRight" Alt="R"/>
|
||||
</att.SubMenu-set>
|
||||
</ToolstripDropdownButton>
|
||||
<ToolstripSplitter/>
|
||||
<ToolstripButton Command-ref="commandUndo" Alt="U"/>
|
||||
<ToolstripButton Command-ref="commandRedo" Alt="R"/>
|
||||
<ToolstripSplitter/>
|
||||
<ToolstripButton Command-ref="commandCopy" Alt="C"/>
|
||||
<ToolstripButton Command-ref="commandCut" Alt="X"/>
|
||||
<ToolstripButton Command-ref="commandPaste" Alt="P"/>
|
||||
<ToolstripSplitter/>
|
||||
<ToolstripButton Command-ref="commandDelete" Alt="D"/>
|
||||
<ToolstripSplitter/>
|
||||
<ToolstripSplitButton Command-ref="commandInsertImage" Alt="I">
|
||||
<att.SubMenu-set>
|
||||
<MenuItemButton Command-ref="commandInsertImage" Alt="I"/>
|
||||
<MenuItemButton Command-ref="commandEditHyperlink" Alt="L"/>
|
||||
<MenuItemButton Command-ref="commandRemoveHyperlink" Alt="R"/>
|
||||
</att.SubMenu-set>
|
||||
</ToolstripSplitButton>
|
||||
<ToolstripButton Command-ref="commandBold" Alt="B"/>
|
||||
<ToolstripButton Command-ref="commandItalic" Alt="I"/>
|
||||
<ToolstripButton Command-ref="commandUnderline" Alt="U"/>
|
||||
<ToolstripButton Command-ref="commandStrike" Alt="S"/>
|
||||
<ToolstripButton Command-ref="commandFont" Alt="F"/>
|
||||
<ToolstripButton Command-ref="commandColor" Alt="C"/>
|
||||
<ToolstripButton Command-ref="commandBackColor" Alt="K"/>
|
||||
</ToolstripToolBar>
|
||||
</Cell>
|
||||
|
||||
<Cell Site="row:2 column:0">
|
||||
<DocumentViewer ref.Name="document" EditMode="Editable">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
<ev.ActiveHyperlinkExecuted-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
dialogMessage.Text = document.ActiveHyperlinkReference;
|
||||
dialogMessage.ShowDialog();
|
||||
}
|
||||
]]>
|
||||
</ev.ActiveHyperlinkExecuted-eval>
|
||||
</DocumentViewer>
|
||||
</Cell>
|
||||
</Table>
|
||||
|
||||
<ToolstripCommand ref.Name="commandUndo" Text="Undo" Image-uri="res://ToolbarImages/Undo" ShortcutBuilder="Ctrl+Z">
|
||||
<att.Enabled-bind>document.observe as _(_.CanUndo() on _.UndoRedoChanged)</att.Enabled-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[document.Undo();]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandRedo" Text="Redo" Image-uri="res://ToolbarImages/Redo" ShortcutBuilder="Ctrl+Y">
|
||||
<att.Enabled-bind>document.observe as _(_.CanRedo() on _.UndoRedoChanged)</att.Enabled-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[document.Redo();]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandCopy" Text="Copy" Image-uri="res://ToolbarImages/Copy" ShortcutBuilder="Ctrl+C">
|
||||
<att.Enabled-bind>document.observe as _(_.CanCopy() on _.SelectionChanged)</att.Enabled-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[document.Copy();]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandCut" Text="Cut" Image-uri="res://ToolbarImages/Cut" ShortcutBuilder="Ctrl+X">
|
||||
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[document.Cut();]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandPaste" Text="Paste" Image-uri="res://ToolbarImages/Paste" ShortcutBuilder="Ctrl+V">
|
||||
<att.Enabled-bind>self.observe as _(document.CanPaste() on _.BoundsComposition.clipboardNotify)</att.Enabled-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[document.Paste();]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandDelete" Text="Delete" Image-uri="res://ToolbarImages/Delete">
|
||||
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[document.SetSelectionText("");]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandSelect" Text="Select All" ShortcutBuilder="Ctrl+A">
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[document.SelectAll();]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandInsertImage" Text="Insert Image ..." Image-uri="res://ToolbarImages/Image">
|
||||
<att.Enabled-bind>self.HasEditableCursor()</att.Enabled-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
if (dialogOpen.ShowDialog())
|
||||
{
|
||||
var imageService = INativeController::GetCurrentController().ImageService();
|
||||
var image = imageService.CreateImageFromFile(dialogOpen.FileName);
|
||||
var imageData = new ImageData^(image, 0);
|
||||
document.EditImage(document.CaretBegin, document.CaretEnd, imageData);
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandEditHyperlink" Text="Edit Hyperlink ..." Image-uri="res://ToolbarImages/Link">
|
||||
<att.Enabled-bind>document.observe as _(self.HasEditableHyperlink(true) on _.SelectionChanged)</att.Enabled-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[
|
||||
$Async{
|
||||
var mainWindow = self.RelatedControlHost as controls::GuiWindow*;
|
||||
|
||||
var window = new HyperlinkWindow*();
|
||||
window.MoveToScreenCenter(mainWindow.RelatedScreen);
|
||||
$Await window.ShowModalAsync(mainWindow);
|
||||
|
||||
if (window.Url is not null)
|
||||
{
|
||||
var row = document.CaretBegin.row;
|
||||
var begin = document.CaretBegin.column;
|
||||
var end = document.CaretEnd.column;
|
||||
document.EditHyperlink(row, begin, end, cast string window.Url, "#NormalLink", "#ActiveLink");
|
||||
}
|
||||
delete window;
|
||||
}
|
||||
]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandRemoveHyperlink" Text="Remove Hyperlink" Image-uri="res://ToolbarImages/RemoveLink">
|
||||
<att.Enabled-bind>document.observe as _(self.HasEditableHyperlink(false) on _.SelectionChanged)</att.Enabled-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
var row = document.CaretBegin.row;
|
||||
var begin = document.CaretBegin.column;
|
||||
var end = document.CaretEnd.column;
|
||||
document.RemoveHyperlink(row, begin, end);
|
||||
}
|
||||
]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandBold" Text="Bold" Image-uri="res://ToolbarImages/Bold">
|
||||
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
|
||||
<att.Selected-bind>document.observe as _(_.SummarizeStyle(_.CaretBegin, _.CaretEnd).bold == true on _.SelectionChanged, _.ModifiedChanged)</att.Selected-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
var style = new DocumentStyleProperties^();
|
||||
style.bold = not commandBold.Selected;
|
||||
document.EditStyle(document.CaretBegin, document.CaretEnd, style);
|
||||
}
|
||||
]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandItalic" Text="Italic" Image-uri="res://ToolbarImages/Italic">
|
||||
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
|
||||
<att.Selected-bind>document.observe as _(_.SummarizeStyle(_.CaretBegin, _.CaretEnd).italic == true on _.SelectionChanged, _.ModifiedChanged)</att.Selected-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
var style = new DocumentStyleProperties^();
|
||||
style.italic = not commandItalic.Selected;
|
||||
document.EditStyle(document.CaretBegin, document.CaretEnd, style);
|
||||
}
|
||||
]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandUnderline" Text="Underline" Image-uri="res://ToolbarImages/Underline">
|
||||
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
|
||||
<att.Selected-bind>document.observe as _(_.SummarizeStyle(_.CaretBegin, _.CaretEnd).underline == true on _.SelectionChanged, _.ModifiedChanged)</att.Selected-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
var style = new DocumentStyleProperties^();
|
||||
style.underline = not commandUnderline.Selected;
|
||||
document.EditStyle(document.CaretBegin, document.CaretEnd, style);
|
||||
}
|
||||
]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandStrike" Text="Strike" Image-uri="res://ToolbarImages/Strike">
|
||||
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
|
||||
<att.Selected-bind>document.observe as _(_.SummarizeStyle(_.CaretBegin, _.CaretEnd).strikeline == true on _.SelectionChanged, _.ModifiedChanged)</att.Selected-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
var style = new DocumentStyleProperties^();
|
||||
style.strikeline = not commandStrike.Selected;
|
||||
document.EditStyle(document.CaretBegin, document.CaretEnd, style);
|
||||
}
|
||||
]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ColorDialog ref.Name="dialogColor" EnabledCustomColor="false"/>
|
||||
<FontDialog ref.Name="dialogFont" ShowEffect="false" ShowSelection="true" ForceFontExist="true"/>
|
||||
|
||||
<ToolstripCommand ref.Name="commandFont" Text="Set Font ..." Image-uri="res://ToolbarImages/Font">
|
||||
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
var begin = document.CaretBegin;
|
||||
var end = document.CaretEnd;
|
||||
var style = document.SummarizeStyle(begin, end);
|
||||
|
||||
var baselineFont = document.Font;
|
||||
dialogFont.SelectedFont =
|
||||
{
|
||||
fontFamily: ( style.face is null ? baselineFont.fontFamily : cast string style.face )
|
||||
size: ( style.size is null ? baselineFont.size : cast int style.size.size )
|
||||
};
|
||||
|
||||
if (dialogFont.ShowDialog())
|
||||
{
|
||||
style = new DocumentStyleProperties^();
|
||||
var selectedFont = dialogFont.SelectedFont;
|
||||
|
||||
style.face = selectedFont.fontFamily;
|
||||
style.size = {size:selectedFont.size relative:false};
|
||||
document.EditStyle(begin, end, style);
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandColor" Text="Text Color ..." Image-uri="res://ToolbarImages/Color">
|
||||
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
var begin = document.CaretBegin;
|
||||
var end = document.CaretEnd;
|
||||
var selectedColor = document.SummarizeStyle(begin, end).color;
|
||||
if (selectedColor is null)
|
||||
{
|
||||
dialogColor.SelectedColor = cast Color "#000000";
|
||||
}
|
||||
else
|
||||
{
|
||||
dialogColor.SelectedColor = cast Color selectedColor;
|
||||
}
|
||||
if (dialogColor.ShowDialog())
|
||||
{
|
||||
var style = new DocumentStyleProperties^();
|
||||
style.color = dialogColor.SelectedColor;
|
||||
document.EditStyle(begin, end, style);
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandBackColor" Text="Background Color ..." Image-uri="res://ToolbarImages/BackColor">
|
||||
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
var begin = document.CaretBegin;
|
||||
var end = document.CaretEnd;
|
||||
var selectedColor = document.SummarizeStyle(begin, end).backgroundColor;
|
||||
if (selectedColor is null)
|
||||
{
|
||||
dialogColor.SelectedColor = cast Color "#000000";
|
||||
}
|
||||
else
|
||||
{
|
||||
dialogColor.SelectedColor = cast Color selectedColor;
|
||||
}
|
||||
if (dialogColor.ShowDialog())
|
||||
{
|
||||
var style = new DocumentStyleProperties^();
|
||||
style.backgroundColor = dialogColor.SelectedColor;
|
||||
document.EditStyle(begin, end, style);
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandViewOnly" Text="Preview" Image-uri="res://ToolbarImages/ViewOnly">
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[self.SetEditMode(ViewOnly);]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandSelectable" Text="Selectable" Image-uri="res://ToolbarImages/Selectable">
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[self.SetEditMode(Selectable);]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandEditable" Text="Editable" Image-uri="res://ToolbarImages/Editable">
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[self.SetEditMode(Editable);]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandAlignDefault" Text="Set Alignment to Default (Left)" Image-uri="res://ToolbarImages/TextAlign">
|
||||
<att.Enabled-bind>self.HasEditableCursor()</att.Enabled-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[self.SetAlignment(null);]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandAlignLeft" Text="Set Alignment to Left" Image-uri="res://ToolbarImages/TextAlignLeft">
|
||||
<att.Enabled-bind>self.HasEditableCursor()</att.Enabled-bind>
|
||||
<att.Selected-bind>document.observe as _(self.SelectAlignmentCommand() == commandAlignLeft on _.SelectionChanged)</att.Selected-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[self.SetAlignment(Left);]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandAlignCenter" Text="Set Alignment to Center" Image-uri="res://ToolbarImages/TextAlignCenter">
|
||||
<att.Enabled-bind>self.HasEditableCursor()</att.Enabled-bind>
|
||||
<att.Selected-bind>document.observe as _(self.SelectAlignmentCommand() == commandAlignCenter on _.SelectionChanged)</att.Selected-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[self.SetAlignment(Center);]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
|
||||
<ToolstripCommand ref.Name="commandAlignRight" Text="Set Alignment to Right" Image-uri="res://ToolbarImages/TextAlignRight">
|
||||
<att.Enabled-bind>self.HasEditableCursor()</att.Enabled-bind>
|
||||
<att.Selected-bind>document.observe as _(self.SelectAlignmentCommand() == commandAlignRight on _.SelectionChanged)</att.Selected-bind>
|
||||
<ev.Executed-eval>
|
||||
<![CDATA[self.SetAlignment(Right);]]>
|
||||
</ev.Executed-eval>
|
||||
</ToolstripCommand>
|
||||
</TabPage>
|
||||
</Instance>
|
||||
|
After Width: | Height: | Size: 585 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 800 B |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 811 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 715 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 722 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 544 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 532 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 508 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 474 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 523 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 490 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 431 B |
|
After Width: | Height: | Size: 994 B |
|
After Width: | Height: | Size: 484 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 379 B |
|
After Width: | Height: | Size: 728 B |
|
After Width: | Height: | Size: 394 B |
|
After Width: | Height: | Size: 831 B |
|
After Width: | Height: | Size: 355 B |
|
After Width: | Height: | Size: 536 B |
|
After Width: | Height: | Size: 361 B |
|
After Width: | Height: | Size: 687 B |
|
After Width: | Height: | Size: 550 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 595 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 498 B |
|
After Width: | Height: | Size: 803 B |
|
After Width: | Height: | Size: 538 B |