no message

This commit is contained in:
ATTIOT\zhengcy 2021-09-15 17:37:26 +08:00
parent eadae2021d
commit dca8b90bc0
39 changed files with 1708 additions and 1027 deletions

View File

@ -130,13 +130,14 @@
<ProjectGuid>{8D9A6595-717A-41C8-B468-0011A72BE3D1}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>base</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
@ -149,7 +150,7 @@
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
@ -204,7 +205,7 @@
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;NOMINMAX;WITH_ENCRYPT;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;NOMINMAX;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>.\;..\</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4100;4127;4244;4245;4310;4355;4505;%(DisableSpecificWarnings)</DisableSpecificWarnings>
@ -250,7 +251,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;NOMINMAX;WITH_ENCRYPT;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;NOMINMAX;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>.\;..\</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4100;4127;4189;4244;4245;4310;4355;4505;%(DisableSpecificWarnings)</DisableSpecificWarnings>

View File

@ -70,7 +70,7 @@ private:
// The lock that protects access to target_message_loop_.
mutable NLock message_loop_lock_;
MessageLoop* target_message_loop_;
nbase::MessageLoop* target_message_loop_;
private:
// This relay class remembers the MessageLoop that it was created on, and

View File

@ -14,7 +14,6 @@
namespace nbase
{
static const wchar_t kWndClass[] = L"NeteaseMessagePumpWindow";
static const unsigned int kMsgHaveWork = WM_USER + 1;
static const int kUserTimerMinmum = 10;
@ -74,7 +73,6 @@ void WinUIMessagePump::ScheduleDelayedWork(const TimeTicks& delayed_work_time)
else
wait_time = static_cast<DWORD>(delay_msec);
// Create a WM_TIMER event that will wake us up to check for any pending
// timers (in case we are running within a nested, external sub-pump).
::SetTimer(message_hwnd_, reinterpret_cast<UINT_PTR>(this), wait_time, NULL);
@ -402,8 +400,6 @@ void WinUIMessagePump::PostProcessMessage(const MSG& msg)
observer->PostProcessMessage(msg);
}
}
} // namespace nbase
#endif // OS_WIN

View File

@ -12,7 +12,7 @@
</HBox>
<Box>
<VBox margin="0,0,0,0" valign="center" halign="center" width="auto" height="auto">
<Label name="tooltip" text="一个简单窗口,带有标题栏和常规按钮。"/>
<Label name="tooltip" text="dfasdfasd"/>
</VBox>
</Box>
</VBox>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Window>
<Window caption="0,0,180,30" roundcorner="5,5" sizebox="10,10,10,10" mininfo="280,70" maxinfo="300,700">
<ListContainerElement class="listitem" height="auto">
<HBox height="auto" mouse="false" padding="10,5,10,5">
<Control name="control_img" width="auto" height="auto" margin="0,0,10" mouse="false"/>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0"?>
<Window size="1200,800" caption="0,0,0,35">
<VBox bkcolor="bk_wnd_darkcolor">
<HBox width="stretch" height="35" bkcolor="bk_wnd_lightcolor">
@ -21,11 +21,10 @@
<Event type="unselect" receiver="box_column_op" applyattribute="visible=&quot;false&quot;" />
</Option>
</HBox>
<HBox name="box_column_op" height="30" childmargin="10" visible="false">
<Control width="45" />
<Box bordersize="1" bordercolor="splitline_level1" width="80" height="26">
<RichEdit name="edit_column" margin="10,0,10,0" font="system_14" width="stretch" height="auto" valign="center" normaltextcolor="black" multiline="false" promptmode="true" prompttext="列数" align="vcenter,hcenter" text="3" promptcolor="splitline_level1" autohscroll="true" />
<RichEdit name="edit_column" margin="10,0,10,0" font="system_14" width="stretch" height="auto" valign="center" normaltextcolor="black" promptmode="true" prompttext="列数" align="vcenter,hcenter" text="3" promptcolor="splitline_level1" autohscroll="true" />
</Box>
<CheckBox class="checkbox_font12" name="checkbox_item_center" text="列表居中" margin="0,5,0,10" selected="true" />
</HBox>
@ -33,56 +32,44 @@
<HBox height="30" childmargin="10">
<Label font="system_bold_14" text="子项间隙:" width="auto" height="auto" valign="center" />
<Box bordersize="1" bordercolor="splitline_level1" width="80" height="26">
<RichEdit name="edit_child_margin" margin="10,0,10,0" font="system_14" width="stretch" height="auto" valign="center" normaltextcolor="black" multiline="false" promptmode="true" prompttext="子项间隙" align="vcenter,hcenter" text="" promptcolor="splitline_level1" autohscroll="true" />
<RichEdit name="edit_child_margin" margin="10,0,10,0" font="system_14" width="stretch" height="auto" valign="center" normaltextcolor="black" promptmode="true" prompttext="子项间隙" align="vcenter,hcenter" text="" promptcolor="splitline_level1" autohscroll="true" />
</Box>
</HBox>
<HBox height="30" childmargin="10">
<Label font="system_bold_14" text="总数据:" width="auto" height="auto" valign="center" />
<Box bordersize="1" bordercolor="splitline_level1" width="180">
<RichEdit name="edit_total" margin="10,0,10,0" font="system_14" width="stretch" height="auto" valign="center" normaltextcolor="black" multiline="false" promptmode="true" prompttext="总数据" promptcolor="splitline_level1" autohscroll="true" />
<RichEdit name="edit_total" margin="10,0,10,0" font="system_14" width="stretch" height="auto" valign="center" normaltextcolor="black" promptmode="true" prompttext="总数据" promptcolor="splitline_level1" autohscroll="true" />
</Box>
</HBox>
<Box height="30" childmargin="10" width="stretch">
<Button class="btn_global_blue_80x30" halign="center" valign="center" name="btn_set_total" text="更改/设置" />
</Box>
<Control height="1" bkcolor="splitline_level2" />
<HBox height="30" childmargin="10">
<Label font="system_bold_14" text="改变数据:" width="auto" height="auto" valign="center" />
<Box bordersize="1" bordercolor="splitline_level1" height="26">
<RichEdit name="edit_update" margin="10,0,10,0" font="system_14" width="stretch" height="auto" valign="center" normaltextcolor="black" multiline="false" promptmode="true" prompttext="序号(下标1)" promptcolor="splitline_level1" autohscroll="true" align="vcenter,hcenter" />
<RichEdit name="edit_update" margin="10,0,10,0" font="system_14" width="stretch" height="auto" valign="center" normaltextcolor="black" promptmode="true" prompttext="序号(下标1)" promptcolor="splitline_level1" autohscroll="true" align="vcenter,hcenter" />
</Box>
<Box bordersize="1" bordercolor="splitline_level1" height="26">
<RichEdit name="edit_task_name" margin="10,0,10,0" font="system_14" width="stretch" height="auto" valign="center" normaltextcolor="black" multiline="false" promptmode="true" prompttext="新的任务名称" promptcolor="splitline_level1" autohscroll="true" />
<RichEdit name="edit_task_name" margin="10,0,10,0" font="system_14" width="stretch" height="auto" valign="center" normaltextcolor="black" promptmode="true" prompttext="新的任务名称" promptcolor="splitline_level1" autohscroll="true" />
</Box>
</HBox>
<Box height="30" childmargin="10" width="stretch">
<Button class="btn_global_blue_80x30" halign="center" valign="center" name="btn_update" text="更新数据" />
</Box>
<Control height="1" bkcolor="splitline_level2" />
<HBox height="30" childmargin="10">
<Label font="system_bold_14" text="删除数据:" width="auto" height="auto" valign="center" />
<Box bordersize="1" bordercolor="splitline_level1">
<RichEdit name="edit_delete" margin="10,0,10,0" font="system_14" width="stretch" height="auto" valign="center" normaltextcolor="black" multiline="false" promptmode="true" prompttext="序号(下标1)" promptcolor="splitline_level1" autohscroll="true" align="vcenter,hcenter" />
<RichEdit name="edit_delete" margin="10,0,10,0" font="system_14" width="stretch" height="auto" valign="center" normaltextcolor="black" promptmode="true" prompttext="序号(下标1)" promptcolor="splitline_level1" autohscroll="true" align="vcenter,hcenter" />
</Box>
<Button class="btn_global_red_80x30" halign="center" valign="center" name="btn_delete" text="删除数据" />
</HBox>
</VBox>
<!--column="3" width="auto" halign="center" childmargin="10" -->
<Box>
<VirtualTileBox class="list" name="list" vscrollunit="70" itemsize="220,60" bordersize="1" bordercolor="splitline_level2" padding="1,1,1,1">
</VirtualTileBox>
<VirtualTileBox class="list" name="list" vscrollunit="70" itemsize="220,60" bordersize="1" bordercolor="splitline_level2" padding="1,1,1,1" />
</Box>
</HBox>
</VBox>
</Window>

View File

@ -2,16 +2,12 @@
namespace ui
{
WindowImplBase::WindowImplBase()
{
}
WindowImplBase::~WindowImplBase()
{
}
void WindowImplBase::OnFinalMessage(HWND hWnd)
@ -277,7 +273,6 @@ LRESULT WindowImplBase::OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BO
LRESULT lRes = Window::HandleMessage(uMsg, wParam, lParam);
if (::IsZoomed(GetHWND()) != bZoomed)
{
}
return lRes;
@ -453,7 +448,6 @@ bool WindowImplBase::OnButtonClick(EventArgs* msg)
return true;
}
void WindowImplBase::ActiveWindow()
{
if (::IsWindow(m_hWnd))
@ -476,7 +470,6 @@ void WindowImplBase::SetTaskbarTitle(const std::wstring &title)
::SetWindowTextW(m_hWnd, title.c_str());
}
void WindowImplBase::ToTopMost(bool forever)
{
ASSERT(::IsWindow(m_hWnd));

View File

@ -21,13 +21,14 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}</ProjectGuid>
<RootNamespace>duilib</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
@ -39,13 +40,13 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@ -232,6 +233,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DisableSpecificWarnings>4100;4121;4127;4244;4310;4355;4481;4505;4512;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<LanguageStandard>stdcpp14</LanguageStandard>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@ -23,13 +23,13 @@
<ProjectGuid>{F1A9371F-9A34-45A0-98EB-83FF371F067F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>basic</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@ -42,7 +42,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
@ -107,7 +107,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>

View File

@ -7,7 +7,6 @@ BasicForm::BasicForm()
{
}
BasicForm::~BasicForm()
{
}
@ -27,9 +26,13 @@ std::wstring BasicForm::GetWindowClassName() const
return kClassName;
}
LRESULT BasicForm::OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
return WindowImplBase::OnNcHitTest(uMsg, wParam, lParam, bHandled);
}
void BasicForm::InitWindow()
{
}
LRESULT BasicForm::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)

View File

@ -15,6 +15,7 @@ public:
virtual std::wstring GetSkinFolder() override;
virtual std::wstring GetSkinFile() override;
virtual std::wstring GetWindowClassName() const override;
virtual LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
/**
* WM_CREATE
@ -28,4 +29,3 @@ public:
static const std::wstring kClassName;
};

View File

@ -15,6 +15,9 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
AllocConsole();
freopen("CONOUT$", "w", stdout);
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
@ -40,12 +43,13 @@ void MainThread::Init()
// 如需修改请指定 Startup 最后两个参数
ui::GlobalManager::Startup(theme_dir + L"resources\\", ui::CreateControlCallback(), false);
#else
// Release 模式下使用资源中的压缩包作为资源
// 资源被导入到资源列表分类为 THEME资源名称为 IDR_THEME
// 如果资源使用的是本地的 zip 文件而非资源中的 zip 压缩包
// 可以使用 OpenResZip 另一个重载函数打开本地的资源压缩包
ui::GlobalManager::OpenResZip(MAKEINTRESOURCE(IDR_THEME), L"THEME", "");
// ui::GlobalManager::OpenResZip(L"resources.zip", "");
//ui::GlobalManager::OpenResZip(MAKEINTRESOURCE(IDR_THEME), L"THEME", "");
ui::GlobalManager::OpenResZip(L"resources.zip", "");
ui::GlobalManager::Startup(L"resources\\", ui::CreateControlCallback(), false);
#endif

View File

@ -23,13 +23,13 @@
<ProjectGuid>{B8588C07-9CE2-456C-83B1-86E4B65D4108}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>cef</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

View File

@ -23,19 +23,19 @@
<ProjectGuid>{8BD95440-9000-4745-8011-27DD553EF06F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>controls</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
@ -75,7 +75,7 @@
<IntDir>$(ProjectDir)..\..\tmp\$(PlatformName)\$(ProjectName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_d</TargetName>
<OutDir>..\..\bin\</OutDir>
<IncludePath>..\..\;$(IncludePath)</IncludePath>
<IncludePath>..\..\;$(ProjectDir)..\..\duilib;$(IncludePath)</IncludePath>
<LibraryPath>$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@ -107,7 +107,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>

View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "controls_form.h"
#include "Utils\DpiManager.h"
#include <fstream>
@ -9,7 +10,6 @@ ControlForm::ControlForm()
{
}
ControlForm::~ControlForm()
{
}
@ -29,6 +29,16 @@ std::wstring ControlForm::GetWindowClassName() const
return kClassName;
}
bool ComboChange(ui::EventArgs* ev) {
if (nullptr != ev) {
printf("%d\r\n", ev->Type);
auto p = static_cast<ui::Combo*>(ev->pSender);
auto text = p->GetText();
wprintf(L"%s\r\n", text.c_str());
}
return true;
}
void ControlForm::InitWindow()
{
/**
@ -82,7 +92,7 @@ void ControlForm::InitWindow()
element->SetText(nbase::StringPrintf(L"Combo element %d", i));
combo->Add(element);
}
combo->AttachAllEvents(ComboChange);
/* Load xml file content in global misc thread, and post update RichEdit task to UI thread */
StdClosure closure = [this]() {
std::streamoff length = 0;
@ -103,7 +113,9 @@ void ControlForm::InitWindow()
}
// Post task to UI thread
nbase::ThreadManager::PostTask(kThreadUI, nbase::Bind(&ControlForm::OnLoadedResourceFile, this, xml)); // or Post2UI(nbase::Bind(&ControlForm::OnLoadedResourceFile, this, xml));
nbase::ThreadManager::PostTask(kThreadUI,
nbase::Bind(&ControlForm::OnLoadedResourceFile, this, xml));
// or Post2UI(nbase::Bind(&ControlForm::OnLoadedResourceFile, this, xml));
};
// Using ToWeakCallback to protect closure when if [ControlForm] was destoryed
nbase::ThreadManager::PostTask(kThreadGlobalMisc, ToWeakCallback(closure)); // or Post2GlobalMisc(ToWeakCallback(closure));
@ -111,9 +123,11 @@ void ControlForm::InitWindow()
/* Post repeat task to update progress value 200 milliseconds once */
StdClosure repeat_task = [this]() {
nbase::TimeDelta time_delta = nbase::TimeDelta::FromMicroseconds(nbase::Time::Now().ToInternalValue());
nbase::ThreadManager::PostTask(kThreadUI, nbase::Bind(&ControlForm::OnProgressValueChagned, this, time_delta.ToMilliseconds() % 100));
nbase::ThreadManager::PostTask(kThreadUI,
nbase::Bind(&ControlForm::OnProgressValueChagned, this, time_delta.ToMilliseconds() % 100));
};
nbase::ThreadManager::PostRepeatedTask(kThreadGlobalMisc, ToWeakCallback(repeat_task), nbase::TimeDelta::FromMilliseconds(200));
nbase::ThreadManager::PostRepeatedTask(kThreadGlobalMisc,
ToWeakCallback(repeat_task), nbase::TimeDelta::FromMilliseconds(200));
/* Show settings menu */
ui::Button* settings = dynamic_cast<ui::Button*>(FindControl(L"settings"));

View File

@ -4,12 +4,21 @@
#include "stdafx.h"
#include "main.h"
#include "controls_form.h"
#include "Utils\DpiManager.h"
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
AllocConsole();
freopen("CONOUT$", "w", stdout);
auto dpiManager = ui::DpiManager::GetInstance();
dpiManager->SetAdaptDPI(); // 设置适配自动dpi
printf("dpi is %d\r\n",dpiManager->GetDPIFromRegistry());
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);

View File

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
# Visual Studio Version 16
VisualStudioVersion = 16.0.31229.75
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{B2087994-3DF6-4A57-B8C6-6F744520D7FA}"
EndProject
@ -29,6 +29,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "duilib", "..\duilib\duilib.
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ui_components", "..\ui_components\ui_components.vcxproj", "{0149BA6E-3C0A-426D-AA0A-0B9EC7742F19}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "proto_debuger", "proto_debuger\proto_debuger.vcxproj", "{6D78D8B7-1617-4ED4-B155-94369FC3E73C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "catch_test", "catch_test\catch_test.vcxproj", "{91850193-0E5E-4983-9D11-F9875805D91E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -123,6 +127,22 @@ Global
{0149BA6E-3C0A-426D-AA0A-0B9EC7742F19}.Release|Win32.Build.0 = Release|Win32
{0149BA6E-3C0A-426D-AA0A-0B9EC7742F19}.Release|x64.ActiveCfg = Release|x64
{0149BA6E-3C0A-426D-AA0A-0B9EC7742F19}.Release|x64.Build.0 = Release|x64
{6D78D8B7-1617-4ED4-B155-94369FC3E73C}.Debug|Win32.ActiveCfg = Debug|Win32
{6D78D8B7-1617-4ED4-B155-94369FC3E73C}.Debug|Win32.Build.0 = Debug|Win32
{6D78D8B7-1617-4ED4-B155-94369FC3E73C}.Debug|x64.ActiveCfg = Debug|x64
{6D78D8B7-1617-4ED4-B155-94369FC3E73C}.Debug|x64.Build.0 = Debug|x64
{6D78D8B7-1617-4ED4-B155-94369FC3E73C}.Release|Win32.ActiveCfg = Release|Win32
{6D78D8B7-1617-4ED4-B155-94369FC3E73C}.Release|Win32.Build.0 = Release|Win32
{6D78D8B7-1617-4ED4-B155-94369FC3E73C}.Release|x64.ActiveCfg = Release|x64
{6D78D8B7-1617-4ED4-B155-94369FC3E73C}.Release|x64.Build.0 = Release|x64
{91850193-0E5E-4983-9D11-F9875805D91E}.Debug|Win32.ActiveCfg = Debug|Win32
{91850193-0E5E-4983-9D11-F9875805D91E}.Debug|Win32.Build.0 = Debug|Win32
{91850193-0E5E-4983-9D11-F9875805D91E}.Debug|x64.ActiveCfg = Debug|x64
{91850193-0E5E-4983-9D11-F9875805D91E}.Debug|x64.Build.0 = Debug|x64
{91850193-0E5E-4983-9D11-F9875805D91E}.Release|Win32.ActiveCfg = Release|Win32
{91850193-0E5E-4983-9D11-F9875805D91E}.Release|Win32.Build.0 = Release|Win32
{91850193-0E5E-4983-9D11-F9875805D91E}.Release|x64.ActiveCfg = Release|x64
{91850193-0E5E-4983-9D11-F9875805D91E}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -136,6 +156,7 @@ Global
{A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} = {1DA0A8E2-5832-42FC-83F7-2CDCAD379C90}
{8BD95440-9000-4745-8011-27DD553EF06F} = {B2087994-3DF6-4A57-B8C6-6F744520D7FA}
{E35589C6-9509-4116-996F-1D045C2DACAE} = {B2087994-3DF6-4A57-B8C6-6F744520D7FA}
{91850193-0E5E-4983-9D11-F9875805D91E} = {B2087994-3DF6-4A57-B8C6-6F744520D7FA}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {68CA0970-4242-4E4F-94D2-C19760FCA05D}

View File

@ -23,13 +23,13 @@
<ProjectGuid>{2BFFA1EE-039D-479E-9BCC-2D12F8AEDD16}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>layouts</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

View File

@ -22,12 +22,13 @@
<ProjectGuid>{FDB5539F-1060-4975-B603-B66454C8C897}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>multi_browser</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

View File

@ -0,0 +1,86 @@
#include "base_form.h"
#include "new_monitor_form.h"
const std::wstring BasicForm::kClassName = L"Basic";
#define WM_USER_POS_CHANGED (WM_USER + 2)
BasicForm::BasicForm()
{
}
BasicForm::~BasicForm()
{
}
std::wstring BasicForm::GetSkinFolder()
{
return L"basic";
}
std::wstring BasicForm::GetSkinFile()
{
return L"basic.xml";
}
std::wstring BasicForm::GetWindowClassName() const
{
return kClassName;
}
LRESULT BasicForm::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == WM_USER_POS_CHANGED) {
NewMonitorForm* window = new NewMonitorForm();
window->Create(NULL, NewMonitorForm::kClassName.c_str(), WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX & WS_SIZEBOX, 0);
window->CenterWindow();
window->ShowModalFake(this->m_hWnd);
nim_comp::Toast::ShowToast(L"×Ô¶¨ÒåÏûÏ¢±»µ÷ÓÃ", 1000, this->GetHWND());
}
return WindowImplBase::HandleMessage(uMsg, wParam, lParam);
}
void BasicForm::InitWindow()
{
/* Show settings menu */
ui::Button* settings = dynamic_cast<ui::Button*>(FindControl(L"test_customize"));
if (nullptr != settings) {
settings->AttachClick([this](ui::EventArgs* args) {
printf("%d\r\n", ::PostMessage(this->GetHWND(), WM_USER_POS_CHANGED, 0, 0));
return true;
});
}
ui::TreeView* tree = dynamic_cast<ui::TreeView*>(FindControl(L"tree"));
if (nullptr != tree) {
ui::TreeNode* parent_node = nullptr;
for (auto j = 0; j < 8; j++)
{
ui::TreeNode* node = new ui::TreeNode;
node->SetClass(L"listitem");
node->SetFixedHeight(20);
if (parent_node)
{
node->SetText(nbase::StringPrintf(L"Child node %d", j));
node->SetMargin({ 10, 0, 0, 0 });
parent_node->AddChildNode(node);
}
else
{
node->SetText(nbase::StringPrintf(L"Parent node", j));
tree->GetRootNode()->AddChildNode(node);
parent_node = node;
parent_node->AttachClick([this](ui::EventArgs* args) {
printf("%d\r\n", ::PostMessage(this->GetHWND(), WM_USER_POS_CHANGED, 0, 0));
return true;
});
}
}
}
}
LRESULT BasicForm::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
PostQuitMessage(0L);
return __super::OnClose(uMsg, wParam, lParam, bHandled);
}

View File

@ -0,0 +1,46 @@
#pragma once
// C runtime header
#ifdef __cplusplus
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#endif
// base header
#include "base/base.h"
// duilib
#include "duilib/UIlib.h"
#include "ui_components/ui_components.h"
class BasicForm : public ui::WindowImplBase
{
public:
BasicForm();
~BasicForm();
/**
*
* GetSkinFolder
* GetSkinFile xml
* GetWindowClassName
*/
virtual std::wstring GetSkinFolder() override;
virtual std::wstring GetSkinFile() override;
virtual std::wstring GetWindowClassName() const override;
virtual LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) override;
/**
* WM_CREATE
*/
void InitWindow() override;
/**
* WM_CLOSE
*/
virtual LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
static const std::wstring kClassName;
};

View File

@ -0,0 +1,67 @@
// basic.cpp : 定义应用程序的入口点。
//
#include "main.h"
#include "base_form.h"
#include"resource1.h"
#include <math.h>
enum ThreadId
{
kThreadUI
};
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
AllocConsole();
freopen("CONOUT$", "w", stdout);
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// 创建主线程
MainThread thread;
// 执行主线程循环
thread.RunOnCurrentThreadWithLoop(nbase::MessageLoop::kUIMessageLoop);
return 0;
}
void MainThread::Init()
{
nbase::ThreadManager::RegisterThread(kThreadUI);
// 获取资源路径,初始化全局参数
std::wstring theme_dir = nbase::win32::GetCurrentModuleDirectory();
wprintf(L"%s\r\n", theme_dir);
#if 1
// Debug 模式下使用本地文件夹作为资源
// 默认皮肤使用 resources\\themes\\default
// 默认语言使用 resources\\lang\\zh_CN
// 如需修改请指定 Startup 最后两个参数
ui::GlobalManager::Startup(theme_dir + L"resources\\", ui::CreateControlCallback(), false);
#else
// Release 模式下使用资源中的压缩包作为资源
// 资源被导入到资源列表分类为 THEME资源名称为 IDR_THEME
// 如果资源使用的是本地的 zip 文件而非资源中的 zip 压缩包
// 可以使用 OpenResZip 另一个重载函数打开本地的资源压缩包
ui::GlobalManager::OpenResZip(MAKEINTRESOURCE(IDR_THEME2), L"THEME", "");
//ui::GlobalManager::OpenResZip(L"resources.zip", "");
ui::GlobalManager::Startup(L"resources\\", ui::CreateControlCallback(), false);
#endif
// 创建一个默认带有阴影的居中窗口
BasicForm* window = new BasicForm();
window->Create(NULL, BasicForm::kClassName.c_str(), WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX & WS_SIZEBOX, 0);
window->CenterWindow();
window->ShowWindow();
}
void MainThread::Cleanup()
{
ui::GlobalManager::Shutdown();
SetThreadWasQuitProperly(true);
nbase::ThreadManager::UnregisterThread();
}

View File

@ -0,0 +1,40 @@
#pragma once
// C runtime header
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
// base header
#include "base/base.h"
// duilib
#include "duilib/UIlib.h"
/** @class MainThread
* @brief 线UI线程 nbase::FrameworkThread
* @copyright (c) 2015, NetEase Inc. All rights reserved
* @author towik
* @date 2015/1/1
*/
class MainThread : public nbase::FrameworkThread
{
public:
MainThread() : nbase::FrameworkThread("MainThread") {}
virtual ~MainThread() {}
private:
/**
* 线
* @return void
*/
virtual void Init() override;
/**
* 线退
* @return void
*/
virtual void Cleanup() override;
};

View File

@ -0,0 +1,41 @@
#include "new_monitor_form.h"
const std::wstring NewMonitorForm::kClassName = L"Basic";
NewMonitorForm::NewMonitorForm()
{
}
NewMonitorForm::~NewMonitorForm()
{
}
std::wstring NewMonitorForm::GetSkinFolder()
{
return L"basic";
}
std::wstring NewMonitorForm::GetSkinFile()
{
return L"newmonitor.xml";
}
std::wstring NewMonitorForm::GetWindowClassName() const
{
return kClassName;
}
LRESULT NewMonitorForm::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
return WindowImplBase::HandleMessage(uMsg, wParam, lParam);
}
void NewMonitorForm::InitWindow()
{
}
LRESULT NewMonitorForm::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
PostQuitMessage(0L);
return __super::OnClose(uMsg, wParam, lParam, bHandled);
}

View File

@ -0,0 +1,46 @@
#pragma once
// C runtime header
#ifdef __cplusplus
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#endif
// base header
#include "base/base.h"
// duilib
#include "duilib/UIlib.h"
#include "ui_components/ui_components.h"
class NewMonitorForm : public ui::WindowImplBase
{
public:
NewMonitorForm();
~NewMonitorForm();
/**
*
* GetSkinFolder
* GetSkinFile xml
* GetWindowClassName
*/
virtual std::wstring GetSkinFolder() override;
virtual std::wstring GetSkinFile() override;
virtual std::wstring GetWindowClassName() const override;
virtual LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) override;
/**
* WM_CREATE
*/
void InitWindow() override;
/**
* WM_CLOSE
*/
virtual LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
static const std::wstring kClassName;
};

View File

@ -0,0 +1,76 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource1.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// 中文(简体,中国) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
#pragma code_page(936)
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource1.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
/////////////////////////////////////////////////////////////////////////////
//
// THEME
//
IDR_THEME2 THEME "E:\\NIM_Duilib_Framework\\examples\\proto_debuger\\Release\\resources.zip"
#endif // 中文(简体,中国) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{6d78d8b7-1617-4ed4-b155-94369fc3e73c}</ProjectGuid>
<RootNamespace>protodebuger</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<ReferencePath>$(VC_ReferencesPath_x86);</ReferencePath>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);..\..\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>../../;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ShowProgress>LinkVerbose</ShowProgress>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\base\base.vcxproj">
<Project>{8d9a6595-717a-41c8-b468-0011a72be3d1}</Project>
</ProjectReference>
<ProjectReference Include="..\..\duilib\duilib.vcxproj">
<Project>{e106acd7-4e53-4aee-942b-d0dd426db34e}</Project>
</ProjectReference>
<ProjectReference Include="..\..\ui_components\ui_components.vcxproj">
<Project>{0149ba6e-3c0a-426d-aa0a-0b9ec7742f19}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="base_form.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="new_monitor_form.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="base_form.h" />
<ClInclude Include="main.h" />
<ClInclude Include="new_monitor_form.h" />
<ClInclude Include="resource1.h" />
</ItemGroup>
<ItemGroup>
<Xml Include="..\Debug\resources\themes\default\global.xml" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="proto_debuger.rc" />
</ItemGroup>
<ItemGroup>
<None Include="..\Release\resources.zip" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<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>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="base_form.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="new_monitor_form.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="main.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="base_form.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="resource1.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="new_monitor_form.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Xml Include="..\Debug\resources\themes\default\global.xml">
<Filter>资源文件</Filter>
</Xml>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="proto_debuger.rc">
<Filter>资源文件</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\Release\resources.zip" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,17 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ 生成的包含文件。
// 供 proto_debuger.rc 使用
//
#define IDR_ACCELERATOR1 101
#define IDR_THEME2 103
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 104
#define _APS_NEXT_COMMAND_VALUE 40002
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@ -23,13 +23,13 @@
<ProjectGuid>{878F5BF0-652A-4FDB-992B-BB7F26D62F0D}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>richlist</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

View File

@ -43,7 +43,7 @@ void MainThread::Init()
// 获取资源路径,初始化全局参数
std::wstring theme_dir = nbase::win32::GetCurrentModuleDirectory();
ui::GlobalManager::Startup(theme_dir + L"resources\\", MyCreateControlCallback, false);
ui::GlobalManager::Startup(theme_dir + L"resources\\", MyCreateControlCallback, true);
// 创建一个默认带有阴影的居中窗口
MainForm* window = new MainForm();

View File

@ -46,8 +46,6 @@ void MainForm::InitWindow()
m_DataProvider = new Provider;
m_pTileList->SetDataProvider(m_DataProvider);
}
LRESULT MainForm::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
@ -72,7 +70,7 @@ bool MainForm::OnClicked(ui::EventArgs* args)
if (m_CheckBoxItemCenter->IsSelected())
{
m_pTileList->SetAttribute(L"width", L"auto");
m_pTileList->SetAttribute(L"halign", L"center");
m_pTileList->SetAttribute(L"halign", L"left");
}
else {
m_pTileList->SetAttribute(L"width", L"stretch");

View File

@ -15,12 +15,13 @@
<Keyword>Win32Proj</Keyword>
<RootNamespace>VirtualBox</RootNamespace>
<ProjectName>virtualbox</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

View File

@ -23,13 +23,14 @@
<Keyword>Win32Proj</Keyword>
<Platform>Win32</Platform>
<ProjectName>libcef_dll_wrapper</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
@ -41,7 +42,7 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>

View File

@ -35,10 +35,12 @@ public:
// the ownership of the dialog
bool DoModal(ModalWndBase *dlg);
void CancelModalThenExit();
template<class _Ty>
friend class Ref_count_obj;
private:
template<class _Ty>
friend class std::_Ref_count_obj;
friend class AsyncModalRunnerManager;
friend class std::shared_ptr<AsyncModalRunner>;

View File

@ -23,19 +23,19 @@
<ProjectGuid>{0149BA6E-3C0A-426D-AA0A-0B9EC7742F19}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>uicomponents</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
@ -100,6 +100,7 @@
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>.\;..\;..\third_party\cef_wrapper\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -200,7 +201,6 @@
<ClInclude Include="cef_control\util\util.h" />
<ClInclude Include="menu\ui_menu.h" />
<ClInclude Include="modal_wnd\async_do_modal.h" />
<ClInclude Include="modal_wnd\async_modal_runner.h" />
<ClInclude Include="modal_wnd\file_dialog_ex.h" />
<ClInclude Include="modal_wnd\modal_wnd_base.h" />
<ClInclude Include="msgbox\msgbox.h" />
@ -228,7 +228,6 @@
<ClCompile Include="cef_control\util\memory_dc.cpp" />
<ClCompile Include="menu\ui_menu.cpp" />
<ClCompile Include="modal_wnd\async_do_modal.cpp" />
<ClCompile Include="modal_wnd\async_modal_runner.cpp" />
<ClCompile Include="modal_wnd\file_dialog_ex.cpp" />
<ClCompile Include="msgbox\msgbox.cpp" />
<ClCompile Include="shadow_wnd\shadow_wnd.cpp" />

View File

@ -66,9 +66,6 @@
<ClInclude Include="modal_wnd\async_do_modal.h">
<Filter>modal_wnd</Filter>
</ClInclude>
<ClInclude Include="modal_wnd\async_modal_runner.h">
<Filter>modal_wnd</Filter>
</ClInclude>
<ClInclude Include="modal_wnd\file_dialog_ex.h">
<Filter>modal_wnd</Filter>
</ClInclude>
@ -149,9 +146,6 @@
<ClCompile Include="modal_wnd\async_do_modal.cpp">
<Filter>modal_wnd</Filter>
</ClCompile>
<ClCompile Include="modal_wnd\async_modal_runner.cpp">
<Filter>modal_wnd</Filter>
</ClCompile>
<ClCompile Include="modal_wnd\file_dialog_ex.cpp">
<Filter>modal_wnd</Filter>
</ClCompile>

View File

@ -32,7 +32,8 @@ public:
* @param[in] uMsg
* @param[in] wParam
* @param[in] lParam
* @param[out] bHandled
* @param[out] b
d
* @return LRESULT
*/
virtual LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
@ -84,5 +85,4 @@ private:
* @return POINT
*/
POINT GetPopupWindowPos(WindowEx* window);
}