[SDK][INCLUDE] Strengthen and improve layout.h

- Refreshing STATIC controls.
- In LayoutInit function, if cLayouts parameter was negative, then don't use size grip.
This commit is contained in:
Katayama Hirofumi MZ 2021-02-25 09:12:47 +09:00
parent 633ece9025
commit 0efd7b9764
4 changed files with 120 additions and 5 deletions

View file

@ -0,0 +1,34 @@
# Install script for directory: C:/Users/katahiromz/reactos-1/sdk/include/host
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/REACTOS")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()

View file

@ -0,0 +1,25 @@
/* Do not edit - Machine generated */
#ifndef _INC_REACTOS_BUILDNO
#define _INC_REACTOS_BUILDNO
#define KERNEL_VERSION_BUILD 20210222
#define KERNEL_VERSION_BUILD_STR "20210222-0.4.15-dev-2073-ga6e3e8a"
#define KERNEL_VERSION_BUILD_RC "20210222-0.4.15-dev-2073-ga6e3e8a\0"
#define KERNEL_VERSION_RC "0.4.15-x86-dev\0"
#define KERNEL_VERSION_STR "0.4.15-x86-dev"
#define KERNEL_VERSION_REVISION_RC "0.4.15-dev-2073-ga6e3e8a\0"
#define KERNEL_VERSION_REVISION_STR "0.4.15-dev-2073-ga6e3e8a"
#define KERNEL_VERSION_COMMIT_HASH "a6e3e8adf0ff581390dafc0bcf8f615c93d8c8b1"
#define REACTOS_DLL_VERSION_MAJOR 42
#define REACTOS_DLL_VERSION_RC "42.4.15-dev\0"
#define REACTOS_DLL_VERSION_STR "42.4.15-dev"
#define REACTOS_COMPILER_NAME "GNU"
#define REACTOS_COMPILER_VERSION "8.4.0"
#endif
/* EOF */

View file

@ -2,7 +2,7 @@
* PROJECT: ReactOS headers
* LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
* PURPOSE: The layout engine of resizable dialog boxes / windows
* COPYRIGHT: Copyright 2020 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
* COPYRIGHT: Copyright 2020-2021 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
*/
#pragma once
#include <assert.h>
@ -41,6 +41,9 @@ _layout_ModifySystemMenu(LAYOUT_DATA *pData, BOOL bEnableResize)
static __inline HDWP
_layout_MoveGrip(LAYOUT_DATA *pData, HDWP hDwp OPTIONAL)
{
if (!IsWindowVisible(pData->m_hwndGrip))
return hDwp;
SIZE size = { GetSystemMetrics(SM_CXVSCROLL), GetSystemMetrics(SM_CYHSCROLL) };
const UINT uFlags = SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER;
RECT rcClient;
@ -62,7 +65,7 @@ _layout_MoveGrip(LAYOUT_DATA *pData, HDWP hDwp OPTIONAL)
}
static __inline void
_layout_ShowGrip(LAYOUT_DATA *pData, BOOL bShow)
LayoutShowGrip(LAYOUT_DATA *pData, BOOL bShow)
{
if (!bShow)
{
@ -135,6 +138,18 @@ _layout_ArrangeLayout(LAYOUT_DATA *pData)
hDwp = _layout_MoveGrip(pData, hDwp);
EndDeferWindowPos(hDwp);
/* STATIC controls need refreshing. */
for (iItem = 0; iItem < pData->m_cLayouts; ++iItem)
{
HWND hwndCtrl = pData->m_pLayouts[iItem].m_hwndCtrl;
WCHAR szClass[8];
GetClassNameW(hwndCtrl, szClass, _countof(szClass));
if (lstrcmpiW(szClass, L"STATIC") == 0)
{
InvalidateRect(hwndCtrl, NULL, TRUE);
}
}
}
static __inline void
@ -185,13 +200,14 @@ LayoutUpdate(HWND ignored1, LAYOUT_DATA *pData, LPCVOID ignored2, UINT ignored3)
static __inline void
LayoutEnableResize(LAYOUT_DATA *pData, BOOL bEnable)
{
_layout_ShowGrip(pData, bEnable);
LayoutShowGrip(pData, bEnable);
_layout_ModifySystemMenu(pData, bEnable);
}
static __inline LAYOUT_DATA *
LayoutInit(HWND hwndParent, const LAYOUT_INFO *pLayouts, UINT cLayouts)
LayoutInit(HWND hwndParent, const LAYOUT_INFO *pLayouts, INT cLayouts)
{
BOOL bShowGrip;
SIZE_T cb;
LAYOUT_DATA *pData = (LAYOUT_DATA *)HeapAlloc(GetProcessHeap(), 0, sizeof(LAYOUT_DATA));
if (pData == NULL)
@ -200,6 +216,16 @@ LayoutInit(HWND hwndParent, const LAYOUT_INFO *pLayouts, UINT cLayouts)
return NULL;
}
if (cLayouts < 0) /* NOTE: If cLayouts was negative, then don't show size grip */
{
cLayouts = -cLayouts;
bShowGrip = FALSE;
}
else
{
bShowGrip = TRUE;
}
cb = cLayouts * sizeof(LAYOUT_INFO);
pData->m_cLayouts = cLayouts;
pData->m_pLayouts = (LAYOUT_INFO *)HeapAlloc(GetProcessHeap(), 0, cb);
@ -216,8 +242,11 @@ LayoutInit(HWND hwndParent, const LAYOUT_INFO *pLayouts, UINT cLayouts)
assert(GetWindowLongPtrW(hwndParent, GWL_STYLE) & WS_SIZEBOX);
pData->m_hwndParent = hwndParent;
pData->m_hwndGrip = NULL;
LayoutEnableResize(pData, TRUE);
if (bShowGrip)
LayoutShowGrip(pData, bShowGrip);
_layout_InitLayouts(pData);
return pData;
}

View file

@ -0,0 +1,27 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: include/reactos/version.h.cmake
* PURPOSE: Defines the current version
* PROGRAMMER: David Welch (welch@mcmail.com)
* REVISIONS:
* 1999-11-06 (ea)
* Moved from include/internal in include/reactos
* to be used by buildno.
* 2002-01-17 (ea)
* KERNEL_VERSION removed. Use
* reactos/buildno.h:KERNEL_VERSION_STR instead.
*/
#ifndef __VERSION_H
#define __VERSION_H
#define KERNEL_VERSION_MAJOR 0
#define KERNEL_VERSION_MINOR 4
#define KERNEL_VERSION_PATCH_LEVEL 15
#define COPYRIGHT_YEAR "2021"
#endif
/* EOF */