Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
RatinCN committed Nov 27, 2024
1 parent d499d09 commit 81f3128
Show file tree
Hide file tree
Showing 21 changed files with 512 additions and 264 deletions.
15 changes: 11 additions & 4 deletions Source/KNSoft.MakeLifeEasier/KNSoft.MakeLifeEasier.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,10 @@
<ClCompile Include="System\Library.c" />
<ClCompile Include="System\Registry.cpp" />
<ClCompile Include="Time\Time.c" />
<ClCompile Include="UI\Control.c" />
<ClCompile Include="UI\Control\ListView.c" />
<ClCompile Include="UI\Control\Menu.c" />
<ClCompile Include="UI\Control\PropSheet.c" />
<ClCompile Include="UI\Control\TreeView.c" />
<ClCompile Include="UI\DialogBox\RectEditor.c" />
<ClCompile Include="UI\DialogBox\ValueEditor.c" />
<ClCompile Include="UI\DPI.c" />
Expand Down Expand Up @@ -238,7 +241,11 @@
<ClInclude Include="System\Library.h" />
<ClInclude Include="System\Registry.h" />
<ClInclude Include="Time\Time.h" />
<ClInclude Include="UI\Control.h" />
<ClInclude Include="UI\Control\Dialog.h" />
<ClInclude Include="UI\Control\ListView.h" />
<ClInclude Include="UI\Control\Menu.h" />
<ClInclude Include="UI\Control\PropSheet.h" />
<ClInclude Include="UI\Control\TreeView.h" />
<ClInclude Include="UI\DialogBox\DialogBox.h" />
<ClInclude Include="UI\DPI.h" />
<ClInclude Include="UI\GDI.h" />
Expand All @@ -263,14 +270,14 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\KNSoft.Precomp4C.1.0.15-alpha\build\KNSoft.Precomp4C.targets" Condition="Exists('..\packages\KNSoft.Precomp4C.1.0.15-alpha\build\KNSoft.Precomp4C.targets')" />
<Import Project="..\packages\KNSoft.NDK.1.2.10-beta\build\KNSoft.NDK.targets" Condition="Exists('..\packages\KNSoft.NDK.1.2.10-beta\build\KNSoft.NDK.targets')" />
<Import Project="..\packages\KNSoft.NDK.1.2.11-beta\build\KNSoft.NDK.targets" Condition="Exists('..\packages\KNSoft.NDK.1.2.11-beta\build\KNSoft.NDK.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\KNSoft.Precomp4C.1.0.15-alpha\build\KNSoft.Precomp4C.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\KNSoft.Precomp4C.1.0.15-alpha\build\KNSoft.Precomp4C.props'))" />
<Error Condition="!Exists('..\packages\KNSoft.Precomp4C.1.0.15-alpha\build\KNSoft.Precomp4C.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\KNSoft.Precomp4C.1.0.15-alpha\build\KNSoft.Precomp4C.targets'))" />
<Error Condition="!Exists('..\packages\KNSoft.NDK.1.2.10-beta\build\KNSoft.NDK.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\KNSoft.NDK.1.2.10-beta\build\KNSoft.NDK.targets'))" />
<Error Condition="!Exists('..\packages\KNSoft.NDK.1.2.11-beta\build\KNSoft.NDK.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\KNSoft.NDK.1.2.11-beta\build\KNSoft.NDK.targets'))" />
</Target>
</Project>
36 changes: 30 additions & 6 deletions Source/KNSoft.MakeLifeEasier/KNSoft.MakeLifeEasier.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
<Filter Include="UI\DialogBox">
<UniqueIdentifier>{c33347fe-2000-4c97-bd09-132385981b94}</UniqueIdentifier>
</Filter>
<Filter Include="UI\Control">
<UniqueIdentifier>{2aeeba04-9117-436c-ab83-36a0eed7434a}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Memory\Memory.c">
Expand Down Expand Up @@ -101,9 +104,6 @@
<ClCompile Include="UI\DPI.c">
<Filter>UI</Filter>
</ClCompile>
<ClCompile Include="UI\Control.c">
<Filter>UI</Filter>
</ClCompile>
<ClCompile Include="System\Registry.cpp">
<Filter>System</Filter>
</ClCompile>
Expand Down Expand Up @@ -153,6 +153,18 @@
<ClCompile Include="Process\Environment.cpp">
<Filter>Process</Filter>
</ClCompile>
<ClCompile Include="UI\Control\Menu.c">
<Filter>UI\Control</Filter>
</ClCompile>
<ClCompile Include="UI\Control\TreeView.c">
<Filter>UI\Control</Filter>
</ClCompile>
<ClCompile Include="UI\Control\ListView.c">
<Filter>UI\Control</Filter>
</ClCompile>
<ClCompile Include="UI\Control\PropSheet.c">
<Filter>UI\Control</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="MakeLifeEasier.inl" />
Expand Down Expand Up @@ -219,9 +231,6 @@
<ClInclude Include="UI\DPI.h">
<Filter>UI</Filter>
</ClInclude>
<ClInclude Include="UI\Control.h">
<Filter>UI</Filter>
</ClInclude>
<ClInclude Include="System\Registry.h">
<Filter>System</Filter>
</ClInclude>
Expand Down Expand Up @@ -278,6 +287,21 @@
<ClInclude Include="NT\Core.h">
<Filter>NT</Filter>
</ClInclude>
<ClInclude Include="UI\Control\Menu.h">
<Filter>UI\Control</Filter>
</ClInclude>
<ClInclude Include="UI\Control\TreeView.h">
<Filter>UI\Control</Filter>
</ClInclude>
<ClInclude Include="UI\Control\ListView.h">
<Filter>UI\Control</Filter>
</ClInclude>
<ClInclude Include="UI\Control\PropSheet.h">
<Filter>UI\Control</Filter>
</ClInclude>
<ClInclude Include="UI\Control\Dialog.h">
<Filter>UI\Control</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Resource.Embedded.rc" />
Expand Down
11 changes: 2 additions & 9 deletions Source/KNSoft.MakeLifeEasier/KNSoft/DialogBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,12 @@ EXTERN_C_START

FORCEINLINE
HRESULT
KNS_DlgBox(
_In_opt_ HINSTANCE Instance,
_In_opt_ HWND Owner,
_In_ LPCDLGTEMPLATEW DialogTemplate,
_In_opt_ HACCEL Accelerator,
_In_opt_ DLGPROC DlgProc,
_In_opt_ LPARAM InitParam)
KNS_DlgMessageLoop(
_In_opt_ HACCEL Accelerator)
{
INT DlgRet;
W32ERROR Ret;

CreateDialogIndirectParamW(Instance, DialogTemplate, Owner, DlgProc, InitParam);

Ret = UI_MessageLoop(NULL, TRUE, Accelerator, &DlgRet);
return Ret == ERROR_SUCCESS ? (HRESULT)DlgRet : HRESULT_FROM_WIN32(Ret);
}
Expand Down
8 changes: 6 additions & 2 deletions Source/KNSoft.MakeLifeEasier/MakeLifeEasier.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ typedef _Return_type_success_(return == 0) ULONG W32ERROR;
#include "System/Library.h"
#include "System/Registry.h"
#include "UI/GDI.h"
#include "UI/Message.h"

/* L2 Header: No dependencies yet */
#include "Crypt/Cert.h"
Expand All @@ -61,17 +62,20 @@ typedef _Return_type_success_(return == 0) ULONG W32ERROR;
#include "String/Encoding.h"
#include "String/Hash.h"
#include "System/Info.h"
#include "UI/Control.h"
#include "UI/Control/ListView.h"
#include "UI/Control/Menu.h"
#include "UI/Control/PropSheet.h"
#include "UI/Control/TreeView.h"
#include "UI/DialogBox/DialogBox.h"
#include "UI/DPI.h"
#include "UI/Message.h"
#include "UI/Paint.h"
#include "UI/Window.h"

/* L3 Header: Depends on above headers */
#include "Error/Message.h"
#include "IO/File.h"
#include "Process/Process.h"
#include "UI/Control/Dialog.h"

/* KNSoft specification, do not use */
#if defined(_KNSOFT_)
Expand Down
194 changes: 0 additions & 194 deletions Source/KNSoft.MakeLifeEasier/UI/Control.c

This file was deleted.

24 changes: 24 additions & 0 deletions Source/KNSoft.MakeLifeEasier/UI/Control/Dialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#pragma once

#include "../../MakeLifeEasier.h"

#include "../Message.h"

EXTERN_C_START

FORCEINLINE
VOID
UI_SetDialogFont(
_In_ HWND Dialog,
_In_opt_ HFONT Font)
{
HWND hWnd = GetWindow(Dialog, GW_CHILD);
while (hWnd)
{
UI_SetWindowFont(hWnd, Font, FALSE);
hWnd = GetWindow(hWnd, GW_HWNDNEXT);
}
UI_Redraw(Dialog);
}

EXTERN_C_END
Loading

0 comments on commit 81f3128

Please sign in to comment.