Commit 4899a500 authored by Felix Nawothnig's avatar Felix Nawothnig Committed by Alexandre Julliard

Implemented WM_ENABLE.

parent 70fe39e4
...@@ -62,6 +62,7 @@ typedef struct ...@@ -62,6 +62,7 @@ typedef struct
{ {
HWND Self; HWND Self;
HWND Notify; HWND Notify;
BOOL Enabled;
IPPART_INFO Part[4]; IPPART_INFO Part[4];
} IPADDRESS_INFO; } IPADDRESS_INFO;
...@@ -127,13 +128,27 @@ static LRESULT IPADDRESS_Draw (IPADDRESS_INFO *infoPtr, HDC hdc) ...@@ -127,13 +128,27 @@ static LRESULT IPADDRESS_Draw (IPADDRESS_INFO *infoPtr, HDC hdc)
static const WCHAR dotW[] = { '.', 0 }; static const WCHAR dotW[] = { '.', 0 };
RECT rect, rcPart; RECT rect, rcPart;
POINT pt; POINT pt;
COLORREF bgCol, fgCol;
int i; int i;
TRACE("\n"); TRACE("\n");
GetClientRect (infoPtr->Self, &rect); GetClientRect (infoPtr->Self, &rect);
if (infoPtr->Enabled) {
bgCol = COLOR_WINDOW;
fgCol = COLOR_WINDOWTEXT;
} else {
bgCol = COLOR_3DFACE;
fgCol = COLOR_GRAYTEXT;
}
FillRect (hdc, &rect, (HBRUSH) (bgCol+1));
DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST); DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
SetBkColor (hdc, GetSysColor(bgCol));
SetTextColor(hdc, GetSysColor(fgCol));
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
GetWindowRect (infoPtr->Part[i].EditHwnd, &rcPart); GetWindowRect (infoPtr->Part[i].EditHwnd, &rcPart);
pt.x = rcPart.right; pt.x = rcPart.right;
...@@ -174,6 +189,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, LPCREATESTRUCTA lpCreate) ...@@ -174,6 +189,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, LPCREATESTRUCTA lpCreate)
edit.bottom = rcClient.bottom - 2; edit.bottom = rcClient.bottom - 2;
infoPtr->Self = hwnd; infoPtr->Self = hwnd;
infoPtr->Enabled = FALSE;
infoPtr->Notify = lpCreate->hwndParent; infoPtr->Notify = lpCreate->hwndParent;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
...@@ -215,6 +231,20 @@ static LRESULT IPADDRESS_Destroy (IPADDRESS_INFO *infoPtr) ...@@ -215,6 +231,20 @@ static LRESULT IPADDRESS_Destroy (IPADDRESS_INFO *infoPtr)
} }
static LRESULT IPADDRESS_Enable (IPADDRESS_INFO *infoPtr, BOOL enabled)
{
int i;
infoPtr->Enabled = enabled;
for (i = 0; i < 4; i++)
EnableWindow(infoPtr->Part[i].EditHwnd, enabled);
InvalidateRgn(infoPtr->Self, NULL, FALSE);
return 0;
}
static LRESULT IPADDRESS_Paint (IPADDRESS_INFO *infoPtr, HDC hdc) static LRESULT IPADDRESS_Paint (IPADDRESS_INFO *infoPtr, HDC hdc)
{ {
PAINTSTRUCT ps; PAINTSTRUCT ps;
...@@ -517,6 +547,10 @@ IPADDRESS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -517,6 +547,10 @@ IPADDRESS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_DESTROY: case WM_DESTROY:
return IPADDRESS_Destroy (infoPtr); return IPADDRESS_Destroy (infoPtr);
case WM_ENABLE:
return IPADDRESS_Enable (infoPtr, (BOOL)wParam);
break;
case WM_PAINT: case WM_PAINT:
return IPADDRESS_Paint (infoPtr, (HDC)wParam); return IPADDRESS_Paint (infoPtr, (HDC)wParam);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment