Add icon to SampleForDoc\GacUI

This commit is contained in:
Zihan Chen
2020-11-17 10:59:10 -08:00
parent a4b0ebb89c
commit 56cf2e6993
9 changed files with 57 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
#include <GacUIReflection.h>
#include <Windows.h>
#include <GacUIWindows.h>
#include "resource.h"
using namespace vl;
using namespace vl::filesystem;
@@ -8,6 +9,20 @@ using namespace vl::presentation;
using namespace vl::presentation::controls;
using namespace vl::presentation::compositions;
/*
The code has to run before calling SetupWindowsDirect2DRenderer
But I am lazy and I don't want to create another GacUILite without WinMain
So I just do this
*/
class Initialize
{
public:
Initialize()
{
windows::SetWindowDefaultIcon(MAINICON);
}
} initialize;
void GuiMain()
{
{

Binary file not shown.

View File

@@ -154,6 +154,15 @@
<Project>{8018d622-66ba-4e65-9d03-bdac37ea9a54}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Image Include="favicon.ico" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Resource.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@@ -19,4 +19,19 @@
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Image Include="favicon.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Resource.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h">
<Filter>Resource Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

View File

@@ -0,0 +1,16 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Resource.rc
//
#define MAINICON 101
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 104
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -20,7 +20,7 @@
</InstanceStyle>
<Instance name="MainWindowResource">
<Instance ref.Class="sample::MainWindow" ref.Styles="res://MainWindow/SharedStyle">
<Window Text="kb_elements" ClientSize="x:640 y:480">
<Window Text="kb_elements" IconVisible="true" ClientSize="x:640 y:480">
<att.BoundsComposition-set PreferredMinSize="x:480 y:320"/>
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0" CellPadding="10">
<att.Rows>