mirror of
https://github.com/reactos/reactos.git
synced 2025-01-02 20:43:18 +00:00
- fix UI state handling
- by Thomas Weidenmueller svn path=/trunk/; revision=21246
This commit is contained in:
parent
5316bc7eef
commit
95558d0f30
6 changed files with 67 additions and 49 deletions
|
@ -46,9 +46,9 @@ typedef struct _MONTHCALWND
|
||||||
HBRUSH hbHeader;
|
HBRUSH hbHeader;
|
||||||
HBRUSH hbSelection;
|
HBRUSH hbSelection;
|
||||||
|
|
||||||
|
DWORD UIState;
|
||||||
BOOL Changed : 1;
|
BOOL Changed : 1;
|
||||||
BOOL DayTimerSet : 1;
|
BOOL DayTimerSet : 1;
|
||||||
BOOL HideFocus : 1;
|
|
||||||
BOOL HasFocus : 1;
|
BOOL HasFocus : 1;
|
||||||
} MONTHCALWND, *PMONTHCALWND;
|
} MONTHCALWND, *PMONTHCALWND;
|
||||||
|
|
||||||
|
@ -58,16 +58,16 @@ MonthCalNotifyControlParent(IN PMONTHCALWND infoPtr,
|
||||||
IN OUT PVOID data)
|
IN OUT PVOID data)
|
||||||
{
|
{
|
||||||
LRESULT Ret = 0;
|
LRESULT Ret = 0;
|
||||||
|
|
||||||
if (infoPtr->hNotify != NULL)
|
if (infoPtr->hNotify != NULL)
|
||||||
{
|
{
|
||||||
LPNMHDR pnmh = (LPNMHDR)data;
|
LPNMHDR pnmh = (LPNMHDR)data;
|
||||||
|
|
||||||
pnmh->hwndFrom = infoPtr->hSelf;
|
pnmh->hwndFrom = infoPtr->hSelf;
|
||||||
pnmh->idFrom = GetWindowLongPtr(infoPtr->hSelf,
|
pnmh->idFrom = GetWindowLongPtr(infoPtr->hSelf,
|
||||||
GWLP_ID);
|
GWLP_ID);
|
||||||
pnmh->code = code;
|
pnmh->code = code;
|
||||||
|
|
||||||
Ret = SendMessage(infoPtr->hNotify,
|
Ret = SendMessage(infoPtr->hNotify,
|
||||||
WM_NOTIFY,
|
WM_NOTIFY,
|
||||||
(WPARAM)pnmh->idFrom,
|
(WPARAM)pnmh->idFrom,
|
||||||
|
@ -239,6 +239,12 @@ MonthCalReload(IN PMONTHCALWND infoPtr)
|
||||||
TCHAR szBuf[64];
|
TCHAR szBuf[64];
|
||||||
UINT i;
|
UINT i;
|
||||||
|
|
||||||
|
infoPtr->UIState = SendMessage(GetAncestor(infoPtr->hSelf,
|
||||||
|
GA_PARENT),
|
||||||
|
WM_QUERYUISTATE,
|
||||||
|
0,
|
||||||
|
0);
|
||||||
|
|
||||||
/* cache the configuration */
|
/* cache the configuration */
|
||||||
infoPtr->FirstDayOfWeek = MonthCalFirstDayOfWeek();
|
infoPtr->FirstDayOfWeek = MonthCalFirstDayOfWeek();
|
||||||
|
|
||||||
|
@ -563,7 +569,7 @@ FailNoHighlight:
|
||||||
|
|
||||||
if (Day == infoPtr->Day && crOldText != CLR_INVALID)
|
if (Day == infoPtr->Day && crOldText != CLR_INVALID)
|
||||||
{
|
{
|
||||||
if (infoPtr->HasFocus && !infoPtr->HideFocus)
|
if (infoPtr->HasFocus && !(infoPtr->UIState & UISF_HIDEFOCUS))
|
||||||
{
|
{
|
||||||
COLORREF crOldBk;
|
COLORREF crOldBk;
|
||||||
|
|
||||||
|
@ -751,6 +757,7 @@ MonthCalWndProc(IN HWND hwnd,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case VK_LEFT:
|
case VK_LEFT:
|
||||||
{
|
{
|
||||||
if (infoPtr->Day > 1)
|
if (infoPtr->Day > 1)
|
||||||
|
@ -794,7 +801,7 @@ MonthCalWndProc(IN HWND hwnd,
|
||||||
{
|
{
|
||||||
/* change the UI status */
|
/* change the UI status */
|
||||||
SendMessage(GetAncestor(hwnd,
|
SendMessage(GetAncestor(hwnd,
|
||||||
GA_ROOT),
|
GA_PARENT),
|
||||||
WM_CHANGEUISTATE,
|
WM_CHANGEUISTATE,
|
||||||
MAKEWPARAM(UIS_INITIALIZE,
|
MAKEWPARAM(UIS_INITIALIZE,
|
||||||
0),
|
0),
|
||||||
|
@ -825,21 +832,19 @@ MonthCalWndProc(IN HWND hwnd,
|
||||||
|
|
||||||
case WM_UPDATEUISTATE:
|
case WM_UPDATEUISTATE:
|
||||||
{
|
{
|
||||||
BOOL OldHideFocus = infoPtr->HideFocus;
|
DWORD OldUIState = infoPtr->UIState;
|
||||||
switch (LOWORD(wParam))
|
switch (LOWORD(wParam))
|
||||||
{
|
{
|
||||||
case UIS_SET:
|
case UIS_SET:
|
||||||
if (HIWORD(wParam) & UISF_HIDEFOCUS)
|
infoPtr->UIState |= HIWORD(wParam);
|
||||||
infoPtr->HideFocus = TRUE;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UIS_CLEAR:
|
case UIS_CLEAR:
|
||||||
if (HIWORD(wParam) & UISF_HIDEFOCUS)
|
infoPtr->UIState &= ~HIWORD(wParam);
|
||||||
infoPtr->HideFocus = FALSE;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (infoPtr->HideFocus != OldHideFocus)
|
if (infoPtr->UIState != OldUIState)
|
||||||
{
|
{
|
||||||
MonthCalRepaintDay(infoPtr,
|
MonthCalRepaintDay(infoPtr,
|
||||||
infoPtr->Day);
|
infoPtr->Day);
|
||||||
|
@ -1021,7 +1026,7 @@ BOOL
|
||||||
RegisterMonthCalControl(IN HINSTANCE hInstance)
|
RegisterMonthCalControl(IN HINSTANCE hInstance)
|
||||||
{
|
{
|
||||||
WNDCLASS wc = {0};
|
WNDCLASS wc = {0};
|
||||||
|
|
||||||
wc.style = CS_DBLCLKS;
|
wc.style = CS_DBLCLKS;
|
||||||
wc.lpfnWndProc = MonthCalWndProc;
|
wc.lpfnWndProc = MonthCalWndProc;
|
||||||
wc.cbWndExtra = sizeof(PMONTHCALWND);
|
wc.cbWndExtra = sizeof(PMONTHCALWND);
|
||||||
|
@ -1030,7 +1035,7 @@ RegisterMonthCalControl(IN HINSTANCE hInstance)
|
||||||
(LPWSTR)IDC_ARROW);
|
(LPWSTR)IDC_ARROW);
|
||||||
wc.hbrBackground = (HBRUSH)(MONTHCAL_CTRLBG + 1);
|
wc.hbrBackground = (HBRUSH)(MONTHCAL_CTRLBG + 1);
|
||||||
wc.lpszClassName = szMonthCalWndClass;
|
wc.lpszClassName = szMonthCalWndClass;
|
||||||
|
|
||||||
return RegisterClass(&wc) != 0;
|
return RegisterClass(&wc) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1557,7 +1557,7 @@ DllMain(IN HINSTANCE hinstDLL,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DLL_PROCESS_DETACH:
|
case DLL_PROCESS_DETACH:
|
||||||
UnregisterCheckListControl();
|
UnregisterCheckListControl(hinstDLL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
static const WCHAR szCheckListWndClass[] = L"CHECKLIST_ACLUI";
|
||||||
|
|
||||||
#define CI_TEXT_MARGIN_WIDTH (8)
|
#define CI_TEXT_MARGIN_WIDTH (8)
|
||||||
#define CI_TEXT_MARGIN_HEIGHT (3)
|
#define CI_TEXT_MARGIN_HEIGHT (3)
|
||||||
#define CI_TEXT_SELECTIONMARGIN (1)
|
#define CI_TEXT_SELECTIONMARGIN (1)
|
||||||
|
@ -60,23 +62,20 @@ typedef struct _CHECKLISTWND
|
||||||
|
|
||||||
INT ItemHeight;
|
INT ItemHeight;
|
||||||
|
|
||||||
BOOL HasFocus;
|
|
||||||
PCHECKITEM FocusedCheckItem;
|
PCHECKITEM FocusedCheckItem;
|
||||||
UINT FocusedCheckItemBox;
|
UINT FocusedCheckItemBox;
|
||||||
BOOL FocusedPushed;
|
|
||||||
BOOL FocusVisible;
|
|
||||||
|
|
||||||
COLORREF TextColor[2];
|
COLORREF TextColor[2];
|
||||||
INT CheckBoxLeft[2];
|
INT CheckBoxLeft[2];
|
||||||
|
|
||||||
BOOL QuickSearchEnabled;
|
|
||||||
PCHECKITEM QuickSearchHitItem;
|
PCHECKITEM QuickSearchHitItem;
|
||||||
WCHAR QuickSearchText[65];
|
WCHAR QuickSearchText[65];
|
||||||
UINT QuickSearchSetFocusDelay;
|
UINT QuickSearchSetFocusDelay;
|
||||||
UINT QuickSearchResetDelay;
|
UINT QuickSearchResetDelay;
|
||||||
|
|
||||||
DWORD CaretWidth;
|
DWORD CaretWidth;
|
||||||
BOOL ShowingCaret;
|
|
||||||
|
DWORD UIState;
|
||||||
|
|
||||||
#if SUPPORT_UXTHEME
|
#if SUPPORT_UXTHEME
|
||||||
PCHECKITEM HoveredCheckItem;
|
PCHECKITEM HoveredCheckItem;
|
||||||
|
@ -85,6 +84,11 @@ typedef struct _CHECKLISTWND
|
||||||
|
|
||||||
HTHEME ThemeHandle;
|
HTHEME ThemeHandle;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
BOOL HasFocus : 1;
|
||||||
|
BOOL FocusedPushed : 1;
|
||||||
|
BOOL QuickSearchEnabled : 1;
|
||||||
|
BOOL ShowingCaret : 1;
|
||||||
} CHECKLISTWND, *PCHECKLISTWND;
|
} CHECKLISTWND, *PCHECKLISTWND;
|
||||||
|
|
||||||
static VOID EscapeQuickSearch(IN PCHECKLISTWND infoPtr);
|
static VOID EscapeQuickSearch(IN PCHECKLISTWND infoPtr);
|
||||||
|
@ -970,7 +974,7 @@ PaintControl(IN PCHECKLISTWND infoPtr,
|
||||||
((Item->State & CIS_ALLOW) ? DFCS_CHECKED : 0) |
|
((Item->State & CIS_ALLOW) ? DFCS_CHECKED : 0) |
|
||||||
(IsPushed ? DFCS_PUSHED : 0));
|
(IsPushed ? DFCS_PUSHED : 0));
|
||||||
}
|
}
|
||||||
if (Item == infoPtr->FocusedCheckItem && infoPtr->FocusVisible &&
|
if (Item == infoPtr->FocusedCheckItem && !(infoPtr->UIState & UISF_HIDEFOCUS) &&
|
||||||
infoPtr->HasFocus &&
|
infoPtr->HasFocus &&
|
||||||
infoPtr->FocusedCheckItemBox != CLB_DENY)
|
infoPtr->FocusedCheckItemBox != CLB_DENY)
|
||||||
{
|
{
|
||||||
|
@ -1025,7 +1029,7 @@ PaintControl(IN PCHECKLISTWND infoPtr,
|
||||||
((Item->State & CIS_DENY) ? DFCS_CHECKED : 0) |
|
((Item->State & CIS_DENY) ? DFCS_CHECKED : 0) |
|
||||||
(IsPushed ? DFCS_PUSHED : 0));
|
(IsPushed ? DFCS_PUSHED : 0));
|
||||||
}
|
}
|
||||||
if (infoPtr->HasFocus && infoPtr->FocusVisible &&
|
if (infoPtr->HasFocus && !(infoPtr->UIState & UISF_HIDEFOCUS) &&
|
||||||
Item == infoPtr->FocusedCheckItem &&
|
Item == infoPtr->FocusedCheckItem &&
|
||||||
infoPtr->FocusedCheckItemBox == CLB_DENY)
|
infoPtr->FocusedCheckItemBox == CLB_DENY)
|
||||||
{
|
{
|
||||||
|
@ -1865,7 +1869,7 @@ CheckListWndProc(IN HWND hwnd,
|
||||||
{
|
{
|
||||||
Ret = (LRESULT)RetChangeControlFont(infoPtr,
|
Ret = (LRESULT)RetChangeControlFont(infoPtr,
|
||||||
(HFONT)wParam,
|
(HFONT)wParam,
|
||||||
(BOOL)lParam);
|
(BOOL)LOWORD(lParam));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2204,16 +2208,13 @@ CheckListWndProc(IN HWND hwnd,
|
||||||
Shift,
|
Shift,
|
||||||
&NewFocusBox);
|
&NewFocusBox);
|
||||||
|
|
||||||
if (!infoPtr->FocusVisible)
|
/* update the UI status */
|
||||||
{
|
SendMessage(GetAncestor(hwnd,
|
||||||
/* change the UI status */
|
GA_PARENT),
|
||||||
SendMessage(GetAncestor(hwnd,
|
WM_CHANGEUISTATE,
|
||||||
GA_ROOT),
|
MAKEWPARAM(UIS_INITIALIZE,
|
||||||
WM_CHANGEUISTATE,
|
0),
|
||||||
MAKEWPARAM(UIS_INITIALIZE,
|
0);
|
||||||
UISF_HIDEFOCUS),
|
|
||||||
0);
|
|
||||||
}
|
|
||||||
|
|
||||||
ChangeCheckItemFocus(infoPtr,
|
ChangeCheckItemFocus(infoPtr,
|
||||||
NewFocus,
|
NewFocus,
|
||||||
|
@ -2394,14 +2395,22 @@ CheckListWndProc(IN HWND hwnd,
|
||||||
|
|
||||||
case WM_UPDATEUISTATE:
|
case WM_UPDATEUISTATE:
|
||||||
{
|
{
|
||||||
if (HIWORD(wParam) & UISF_HIDEFOCUS)
|
DWORD OldUIState = infoPtr->UIState;
|
||||||
{
|
|
||||||
BOOL OldFocusVisible = infoPtr->FocusVisible;
|
|
||||||
|
|
||||||
infoPtr->FocusVisible = (LOWORD(wParam) == UIS_CLEAR);
|
|
||||||
|
|
||||||
if (infoPtr->FocusVisible != OldFocusVisible &&
|
switch (LOWORD(wParam))
|
||||||
infoPtr->FocusedCheckItem != NULL)
|
{
|
||||||
|
case UIS_SET:
|
||||||
|
infoPtr->UIState |= HIWORD(wParam);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case UIS_CLEAR:
|
||||||
|
infoPtr->UIState &= ~(HIWORD(wParam));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (OldUIState != infoPtr->UIState)
|
||||||
|
{
|
||||||
|
if (infoPtr->FocusedCheckItem != NULL)
|
||||||
{
|
{
|
||||||
UpdateCheckItemBox(infoPtr,
|
UpdateCheckItemBox(infoPtr,
|
||||||
infoPtr->FocusedCheckItem,
|
infoPtr->FocusedCheckItem,
|
||||||
|
@ -2525,10 +2534,10 @@ CheckListWndProc(IN HWND hwnd,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
infoPtr->FocusVisible = !(SendMessage(hwnd,
|
infoPtr->UIState = SendMessage(hwnd,
|
||||||
WM_QUERYUISTATE,
|
WM_QUERYUISTATE,
|
||||||
0,
|
0,
|
||||||
0) & UISF_HIDEFOCUS);
|
0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2591,14 +2600,14 @@ RegisterCheckListControl(IN HINSTANCE hInstance)
|
||||||
(LPWSTR)IDC_ARROW);
|
(LPWSTR)IDC_ARROW);
|
||||||
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
|
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
|
||||||
wc.lpszMenuName = NULL;
|
wc.lpszMenuName = NULL;
|
||||||
wc.lpszClassName = L"CHECKLIST_ACLUI";
|
wc.lpszClassName = szCheckListWndClass;
|
||||||
|
|
||||||
return RegisterClass(&wc) != 0;
|
return RegisterClass(&wc) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
UnregisterCheckListControl(VOID)
|
UnregisterCheckListControl(HINSTANCE hInstance)
|
||||||
{
|
{
|
||||||
UnregisterClass(L"CHECKLIST_ACLUI",
|
UnregisterClass(szCheckListWndClass,
|
||||||
NULL);
|
hInstance);
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,7 +146,7 @@ BOOL
|
||||||
RegisterCheckListControl(HINSTANCE hInstance);
|
RegisterCheckListControl(HINSTANCE hInstance);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
UnregisterCheckListControl(VOID);
|
UnregisterCheckListControl(HINSTANCE hInstance);
|
||||||
|
|
||||||
/* DLLMAIN ********************************************************************/
|
/* DLLMAIN ********************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -417,6 +417,9 @@ InstallReactOS (HINSTANCE hInstance)
|
||||||
CreateShortcut(CSIDL_PROGRAMS, NULL, _T("ibrowser.lnk"), _T("ibrowser.exe"), IDS_CMT_IBROWSER);
|
CreateShortcut(CSIDL_PROGRAMS, NULL, _T("ibrowser.lnk"), _T("ibrowser.exe"), IDS_CMT_IBROWSER);
|
||||||
CreateShortcut(CSIDL_PROGRAMS, NULL, _T("Get Firefox.lnk"), _T("getfirefox.exe"), IDS_CMT_GETFIREFOX);
|
CreateShortcut(CSIDL_PROGRAMS, NULL, _T("Get Firefox.lnk"), _T("getfirefox.exe"), IDS_CMT_GETFIREFOX);
|
||||||
|
|
||||||
|
/* create administritive tools startmenu shortcuts */
|
||||||
|
CreateShortcut(CSIDL_ADMINTOOLS, NULL, _T("Services.lnk"), _T("servman.exe"), IDS_CMT_SERVMAN);
|
||||||
|
|
||||||
/* create and fill Accessories subfolder */
|
/* create and fill Accessories subfolder */
|
||||||
if (CreateShortcutFolder(CSIDL_PROGRAMS, IDS_ACCESSORIES, sAccessories, 256)) {
|
if (CreateShortcutFolder(CSIDL_PROGRAMS, IDS_ACCESSORIES, sAccessories, 256)) {
|
||||||
CreateShortcut(CSIDL_PROGRAMS, sAccessories, _T("Calculator.lnk"), _T("calc.exe"), IDS_CMT_CALC);
|
CreateShortcut(CSIDL_PROGRAMS, sAccessories, _T("Calculator.lnk"), _T("calc.exe"), IDS_CMT_CALC);
|
||||||
|
|
|
@ -97,6 +97,7 @@
|
||||||
#define IDS_CMT_WINEMINE 3217
|
#define IDS_CMT_WINEMINE 3217
|
||||||
#define IDS_CMT_IBROWSER 3218
|
#define IDS_CMT_IBROWSER 3218
|
||||||
#define IDS_CMT_GETFIREFOX 3219
|
#define IDS_CMT_GETFIREFOX 3219
|
||||||
|
#define IDS_CMT_SERVMAN 3220
|
||||||
|
|
||||||
#define IDS_REACTOS_SETUP 3300
|
#define IDS_REACTOS_SETUP 3300
|
||||||
#define IDS_UNKNOWN_ERROR 3301
|
#define IDS_UNKNOWN_ERROR 3301
|
||||||
|
|
Loading…
Reference in a new issue