Author: ekohl
Date: Sun Apr 8 20:46:35 2007
New Revision: 26284
URL:
http://svn.reactos.org/svn/reactos?rev=26284&view=rev
Log:
Add cursor blink time preview and change blink time on the fly.
Modified:
trunk/reactos/dll/cpl/main/Cz.rc
trunk/reactos/dll/cpl/main/De.rc
trunk/reactos/dll/cpl/main/En.rc
trunk/reactos/dll/cpl/main/Es.rc
trunk/reactos/dll/cpl/main/Fr.rc
trunk/reactos/dll/cpl/main/Hu.rc
trunk/reactos/dll/cpl/main/Id.rc
trunk/reactos/dll/cpl/main/Ja.rc
trunk/reactos/dll/cpl/main/Nl.rc
trunk/reactos/dll/cpl/main/Uk.rc
trunk/reactos/dll/cpl/main/it-IT.rc
trunk/reactos/dll/cpl/main/keyboard.c
trunk/reactos/dll/cpl/main/resource.h
trunk/reactos/dll/cpl/main/ru-RU.rc
Modified: trunk/reactos/dll/cpl/main/Cz.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/Cz.rc?rev=262…
==============================================================================
--- trunk/reactos/dll/cpl/main/Cz.rc (original)
+++ trunk/reactos/dll/cpl/main/Cz.rc Sun Apr 8 20:46:35 2007
@@ -19,6 +19,7 @@
LTEXT "Zde mùete vyzkouet rychlost opakování:", -1, 15, 105, 150, 10
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
GROUPBOX "Rychlost &blikání kurzoru:", -1, 5, 145, 230, 50
+ LTEXT "", IDC_TEXT_CURSOR_BLINK, 20, 165, 1, 8
LTEXT "ádná", -1, 40, 165, 30, 10
LTEXT "Velká", -1, 200, 165, 30, 10
CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
Modified: trunk/reactos/dll/cpl/main/De.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/De.rc?rev=262…
==============================================================================
--- trunk/reactos/dll/cpl/main/De.rc (original)
+++ trunk/reactos/dll/cpl/main/De.rc Sun Apr 8 20:46:35 2007
@@ -12,18 +12,19 @@
LTEXT "&Verzögerung:", -1, 40, 15, 50, 10
LTEXT "Lang", -1, 40, 30, 24, 10
LTEXT "Kurz", -1, 200, 30, 24, 10
- CONTROL "",IDC_SLIDER_REPEAT_DELAY, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 30, 130, 17
+ CONTROL "", IDC_SLIDER_REPEAT_DELAY, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 30, 130, 17
ICON -1, IDC_ICON_REPEAT_RATE, 15, 70, 15, 15
LTEXT "&Wiederholrate:", -1, 40, 70, 50, 10
LTEXT "Niedrig", -1, 40, 85, 24, 10
LTEXT "Hoch", -1, 200, 85, 24, 10
- CONTROL "",IDC_SLIDER_REPEAT_RATE, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 85, 130, 17
+ CONTROL "", IDC_SLIDER_REPEAT_RATE, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 85, 130, 17
LTEXT "&Klicken Sie hier, und drücken Sie zum Testen eine Taste:", -1,
15, 105, 180, 10
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
GROUPBOX "&Cursorblinkgeschwindgkeit", -1, 5, 145, 230, 50
+ LTEXT "", IDC_TEXT_CURSOR_BLINK, 20, 165, 1, 8
LTEXT "Langsam", -1, 35, 165, 33, 10
LTEXT "Schnell", -1, 200, 165, 33, 10
- CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
+ CONTROL "", IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
END
IDD_HARDWARE DIALOGEX 0, 0, 246, 228
Modified: trunk/reactos/dll/cpl/main/En.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/En.rc?rev=262…
==============================================================================
--- trunk/reactos/dll/cpl/main/En.rc (original)
+++ trunk/reactos/dll/cpl/main/En.rc Sun Apr 8 20:46:35 2007
@@ -19,6 +19,7 @@
LTEXT "Click here and hold down a key to &test repeat rate:", -1, 15,
105, 150, 10
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
GROUPBOX "Cursor &blink rate:", -1, 5, 145, 230, 50
+ LTEXT "", IDC_TEXT_CURSOR_BLINK, 20, 165, 1, 8
LTEXT "None", -1, 40, 165, 30, 10
LTEXT "Fast", -1, 200, 165, 30, 10
CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
Modified: trunk/reactos/dll/cpl/main/Es.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/Es.rc?rev=262…
==============================================================================
--- trunk/reactos/dll/cpl/main/Es.rc (original)
+++ trunk/reactos/dll/cpl/main/Es.rc Sun Apr 8 20:46:35 2007
@@ -19,6 +19,7 @@
LTEXT "Click here and hold down a key to &test repeat rate:", -1, 15,
105, 150, 10
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
GROUPBOX "Cursor &blink rate:", -1, 5, 145, 230, 50
+ LTEXT "", IDC_TEXT_CURSOR_BLINK, 20, 165, 1, 8
LTEXT "None", -1, 40, 165, 30, 10
LTEXT "Fast", -1, 200, 165, 30, 10
CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
Modified: trunk/reactos/dll/cpl/main/Fr.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/Fr.rc?rev=262…
==============================================================================
--- trunk/reactos/dll/cpl/main/Fr.rc (original)
+++ trunk/reactos/dll/cpl/main/Fr.rc Sun Apr 8 20:46:35 2007
@@ -19,6 +19,7 @@
LTEXT "Cliquer ici et enfoncer une touche pour &tester le délai de
répétition:", -1, 15, 105, 150, 10
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
GROUPBOX "Taux de &clignotement du curseur:", -1, 5, 145, 230, 50
+ LTEXT "", IDC_TEXT_CURSOR_BLINK, 20, 165, 1, 8
LTEXT "Aucun", -1, 40, 165, 30, 10
LTEXT "Rapide", -1, 200, 165, 30, 10
CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
Modified: trunk/reactos/dll/cpl/main/Hu.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/Hu.rc?rev=262…
==============================================================================
--- trunk/reactos/dll/cpl/main/Hu.rc (original)
+++ trunk/reactos/dll/cpl/main/Hu.rc Sun Apr 8 20:46:35 2007
@@ -19,6 +19,7 @@
LTEXT "Click here and hold down a key to &test repeat rate:", -1, 15,
105, 150, 10
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
GROUPBOX "Cursor &blink rate:", -1, 5, 145, 230, 50
+ LTEXT "", IDC_TEXT_CURSOR_BLINK, 20, 165, 1, 8
LTEXT "None", -1, 40, 165, 30, 10
LTEXT "Fast", -1, 200, 165, 30, 10
CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
Modified: trunk/reactos/dll/cpl/main/Id.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/Id.rc?rev=262…
==============================================================================
--- trunk/reactos/dll/cpl/main/Id.rc (original)
+++ trunk/reactos/dll/cpl/main/Id.rc Sun Apr 8 20:46:35 2007
@@ -19,6 +19,7 @@
LTEXT "Klik di sini dan tekan tombol untuk mengu&ji rata-rata
pengulangan:", -1, 15, 105, 150, 10
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
GROUPBOX "Rata-rata &kedip kursor:", -1, 5, 145, 230, 50
+ LTEXT "", IDC_TEXT_CURSOR_BLINK, 20, 165, 1, 8
LTEXT "Tidak ada", -1, 40, 165, 30, 10
LTEXT "Cepat", -1, 200, 165, 30, 10
CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
Modified: trunk/reactos/dll/cpl/main/Ja.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/Ja.rc?rev=262…
==============================================================================
--- trunk/reactos/dll/cpl/main/Ja.rc (original)
+++ trunk/reactos/dll/cpl/main/Ja.rc Sun Apr 8 20:46:35 2007
@@ -19,6 +19,7 @@
LTEXT "Click here and hold down a key to &test repeat rate:", -1, 15,
105, 150, 10
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
GROUPBOX "Cursor &blink rate:", -1, 5, 145, 230, 50
+ LTEXT "", IDC_TEXT_CURSOR_BLINK, 20, 165, 1, 8
LTEXT "None", -1, 40, 165, 30, 10
LTEXT "Fast", -1, 200, 165, 30, 10
CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
Modified: trunk/reactos/dll/cpl/main/Nl.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/Nl.rc?rev=262…
==============================================================================
--- trunk/reactos/dll/cpl/main/Nl.rc (original)
+++ trunk/reactos/dll/cpl/main/Nl.rc Sun Apr 8 20:46:35 2007
@@ -18,6 +18,7 @@
LTEXT "Click here and hold down a key to &test repeat rate:", -1, 15,
105, 150, 10
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
GROUPBOX "Cursor &blink rate:", -1, 5, 145, 230, 50
+ LTEXT "", IDC_TEXT_CURSOR_BLINK, 20, 165, 1, 8
LTEXT "None", -1, 40, 165, 30, 10
LTEXT "Fast", -1, 200, 165, 30, 10
CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
Modified: trunk/reactos/dll/cpl/main/Uk.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/Uk.rc?rev=262…
==============================================================================
--- trunk/reactos/dll/cpl/main/Uk.rc (original)
+++ trunk/reactos/dll/cpl/main/Uk.rc Sun Apr 8 20:46:35 2007
@@ -27,6 +27,7 @@
LTEXT "Çàòèñí³òü êëàâ³øó â ïîë³ äëÿ &ïåðåâ³ðêè øâèäêîñò³ ïîâòîðó:", -1,
15, 105, 150, 10
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
GROUPBOX "×àñòîòà ì&åðåõò³ííÿ êóðñîðà:", -1, 5, 145, 230, 50
+ LTEXT "", IDC_TEXT_CURSOR_BLINK, 20, 165, 1, 8
LTEXT "Íåìàº", -1, 40, 165, 30, 10
LTEXT "Øâèäêî", -1, 200, 165, 30, 10
CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
Modified: trunk/reactos/dll/cpl/main/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/it-IT.rc?rev=…
==============================================================================
--- trunk/reactos/dll/cpl/main/it-IT.rc (original)
+++ trunk/reactos/dll/cpl/main/it-IT.rc Sun Apr 8 20:46:35 2007
@@ -21,6 +21,7 @@
LTEXT "Clicca qui e tieni premuto un tasto per provare la frequenza di
ripetizione:", -1, 15, 105, 150, 10
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
GROUPBOX "Frequenza di lampeggio del Cursore:", -1, 5, 145, 230, 50
+ LTEXT "", IDC_TEXT_CURSOR_BLINK, 20, 165, 1, 8
LTEXT "Nessuna", -1, 40, 165, 30, 10
LTEXT "Veloce", -1, 200, 165, 30, 10
CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
Modified: trunk/reactos/dll/cpl/main/keyboard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/keyboard.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/main/keyboard.c (original)
+++ trunk/reactos/dll/cpl/main/keyboard.c Sun Apr 8 20:46:35 2007
@@ -1,6 +1,6 @@
/*
* ReactOS
- * Copyright (C) 2004 ReactOS Team
+ * Copyright (C) 2004, 2007 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -33,12 +33,17 @@
#include "main.h"
#include "resource.h"
+#define ID_BLINK_TIMER 345
+
+
typedef struct _SPEED_DATA
{
INT nKeyboardDelay;
DWORD dwKeyboardSpeed;
UINT uCaretBlinkTime;
-
+ UINT uOrigCaretBlinkTime;
+ BOOL fShowCursor;
+ RECT rcCursor;
} SPEED_DATA, *PSPEED_DATA;
@@ -77,8 +82,14 @@
pSpeedData->dwKeyboardSpeed = 31;
}
- /* Get the caret blink time */
- pSpeedData->uCaretBlinkTime = GetCaretBlinkTime();
+ pSpeedData->fShowCursor = TRUE;
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_TEXT_CURSOR_BLINK),
&pSpeedData->rcCursor);
+ ScreenToClient(hwndDlg, (LPPOINT)&pSpeedData->rcCursor.left);
+ ScreenToClient(hwndDlg, (LPPOINT)&pSpeedData->rcCursor.right);
+
+ /* Get the caret blink time and save its original value */
+ pSpeedData->uOrigCaretBlinkTime = GetCaretBlinkTime();
+ pSpeedData->uCaretBlinkTime = pSpeedData->uOrigCaretBlinkTime;
SendDlgItemMessage(hwndDlg, IDC_SLIDER_REPEAT_DELAY, TBM_SETRANGE,
(WPARAM)TRUE, (LPARAM)MAKELONG(0, 3));
SendDlgItemMessage(hwndDlg, IDC_SLIDER_REPEAT_DELAY, TBM_SETPOS,
(WPARAM)TRUE, (LPARAM)(3 - pSpeedData->nKeyboardDelay));
@@ -89,6 +100,8 @@
SendDlgItemMessage(hwndDlg, IDC_SLIDER_CURSOR_BLINK, TBM_SETRANGE,
(WPARAM)TRUE, (LPARAM)MAKELONG(0, 10));
SendDlgItemMessage(hwndDlg, IDC_SLIDER_CURSOR_BLINK, TBM_SETPOS,
(WPARAM)TRUE, (LPARAM)(12 - (pSpeedData->uCaretBlinkTime / 100)));
+ /* Start the blink timer */
+ SetTimer(hwndDlg, ID_BLINK_TIMER, pSpeedData->uCaretBlinkTime, NULL);
break;
case WM_HSCROLL:
@@ -146,14 +159,40 @@
case TB_BOTTOM:
case TB_ENDTRACK:
pSpeedData->uCaretBlinkTime = (12 -
(UINT)SendDlgItemMessage(hwndDlg, IDC_SLIDER_CURSOR_BLINK, TBM_GETPOS, 0, 0)) * 100;
+ KillTimer(hwndDlg, ID_BLINK_TIMER);
+ SetTimer(hwndDlg, ID_BLINK_TIMER,
pSpeedData->uCaretBlinkTime, NULL);
+ SetCaretBlinkTime(pSpeedData->uCaretBlinkTime);
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
break;
case TB_THUMBTRACK:
pSpeedData->uCaretBlinkTime = (12 - (UINT)HIWORD(wParam))
* 100;
- PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
- break;
- }
+ KillTimer(hwndDlg, ID_BLINK_TIMER);
+ SetTimer(hwndDlg, ID_BLINK_TIMER,
pSpeedData->uCaretBlinkTime, NULL);
+ SetCaretBlinkTime(pSpeedData->uCaretBlinkTime);
+ PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
+ break;
+ }
+ }
+ break;
+
+ case WM_TIMER:
+ if (wParam == ID_BLINK_TIMER)
+ {
+ if (pSpeedData->fShowCursor)
+ {
+ HDC hDC = GetDC(hwndDlg);
+ HBRUSH hBrush = GetSysColorBrush(COLOR_BTNTEXT);
+ FillRect(hDC, &pSpeedData->rcCursor, hBrush);
+ DeleteObject(hBrush);
+ ReleaseDC(hwndDlg, hDC);
+ }
+ else
+ {
+ InvalidateRect(hwndDlg, &pSpeedData->rcCursor, TRUE);
+ }
+
+ pSpeedData->fShowCursor = !pSpeedData->fShowCursor;
}
break;
@@ -164,8 +203,6 @@
switch(lpnm->code)
{
case PSN_APPLY:
- SetCaretBlinkTime(pSpeedData->uCaretBlinkTime);
-
SystemParametersInfo(SPI_SETKEYBOARDDELAY,
pSpeedData->nKeyboardDelay,
0,
@@ -177,6 +214,10 @@
SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);
return TRUE;
+ case PSN_RESET:
+ SetCaretBlinkTime(pSpeedData->uOrigCaretBlinkTime);
+ break;
+
default:
break;
}
@@ -184,6 +225,7 @@
break;
case WM_DESTROY:
+ KillTimer(hwndDlg, ID_BLINK_TIMER);
HeapFree(GetProcessHeap(), 0, pSpeedData);
break;
}
Modified: trunk/reactos/dll/cpl/main/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/resource.h?re…
==============================================================================
--- trunk/reactos/dll/cpl/main/resource.h (original)
+++ trunk/reactos/dll/cpl/main/resource.h Sun Apr 8 20:46:35 2007
@@ -76,7 +76,7 @@
#define IDC_SLIDER_REPEAT_RATE 2053
#define IDC_EDIT_REPEAT_RATE 2054
#define IDC_SLIDER_CURSOR_BLINK 2055
-
+#define IDC_TEXT_CURSOR_BLINK 2056
#endif /* __CPL_RESOURCE_H */
Modified: trunk/reactos/dll/cpl/main/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/ru-RU.rc?rev=…
==============================================================================
--- trunk/reactos/dll/cpl/main/ru-RU.rc (original)
+++ trunk/reactos/dll/cpl/main/ru-RU.rc Sun Apr 8 20:46:35 2007
@@ -19,6 +19,7 @@
LTEXT "Click here and hold down a key to &test repeat rate:", -1, 15,
105, 150, 10
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
GROUPBOX "Cursor &blink rate:", -1, 5, 145, 230, 50
+ LTEXT "", IDC_TEXT_CURSOR_BLINK, 20, 165, 1, 8
LTEXT "None", -1, 40, 165, 30, 10
LTEXT "Fast", -1, 200, 165, 30, 10
CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17