From: William A. Rowe Jr Date: Thu, 23 Apr 2009 06:48:55 +0000 (+0000) Subject: Escape should simply close the dialog; Enter should perform the X-Git-Tag: 2.3.3~698 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4c1dac5e3a45fe0db524cd68a818d7b3feab8392;p=thirdparty%2Fapache%2Fhttpd.git Escape should simply close the dialog; Enter should perform the appropriate button, or within the list, start and stop. (also clear up the transitions between the list focus and nonfocus). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@767819 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/support/win32/ApacheMonitor.c b/support/win32/ApacheMonitor.c index 1cdb17971d1..96beb17b289 100644 --- a/support/win32/ApacheMonitor.c +++ b/support/win32/ApacheMonitor.c @@ -970,8 +970,8 @@ LRESULT CALLBACK ServiceDlgProc(HWND hDlg, UINT message, g_lpMsg[IDS_MSG_SERVICES - IDS_MSG_FIRST]); SetWindowText(GetDlgItem(hDlg, IDC_SCONNECT), g_lpMsg[IDS_MSG_CONNECT - IDS_MSG_FIRST]); - SetWindowText(GetDlgItem(hDlg, IDC_SEXIT), - g_lpMsg[IDS_MSG_MNUEXIT - IDS_MSG_FIRST]); + SetWindowText(GetDlgItem(hDlg, IDCANCEL), + g_lpMsg[IDS_MSG_OK - IDS_MSG_FIRST]); hListBox = GetDlgItem(hDlg, IDL_SERVICES); g_hwndStdoutList = GetDlgItem(hDlg, IDL_STDOUT); hStatusBar = CreateStatusWindow(0x0800 /* SBT_TOOLTIPS */ @@ -1050,6 +1050,7 @@ LRESULT CALLBACK ServiceDlgProc(HWND hDlg, UINT message, } switch (lpdis->itemAction) { + case ODA_FOCUS: case ODA_SELECT: case ODA_DRAWENTIRE: g_hBmpPicture = (HBITMAP)SendMessage(lpdis->hwndItem, @@ -1082,6 +1083,7 @@ LRESULT CALLBACK ServiceDlgProc(HWND hDlg, UINT message, if (g_hBmpPicture == g_hBmpStop) { Button_Enable(GetDlgItem(hDlg, IDC_SSTART), TRUE); + Button_SetStyle(GetDlgItem(hDlg, IDC_SSTART), BS_DEFPUSHBUTTON, TRUE); Button_Enable(GetDlgItem(hDlg, IDC_SSTOP), FALSE); Button_Enable(GetDlgItem(hDlg, IDC_SRESTART), FALSE); } @@ -1089,6 +1091,7 @@ LRESULT CALLBACK ServiceDlgProc(HWND hDlg, UINT message, { Button_Enable(GetDlgItem(hDlg, IDC_SSTART), FALSE); Button_Enable(GetDlgItem(hDlg, IDC_SSTOP), TRUE); + Button_SetStyle(GetDlgItem(hDlg, IDC_SSTOP), BS_DEFPUSHBUTTON, TRUE); Button_Enable(GetDlgItem(hDlg, IDC_SRESTART), TRUE); } else { @@ -1111,9 +1114,16 @@ LRESULT CALLBACK ServiceDlgProc(HWND hDlg, UINT message, else { SendMessage(hStatusBar, SB_SETTEXT, 0, (LPARAM)_T("")); } - SetTextColor(lpdis->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT)); - SetBkColor(lpdis->hDC, GetSysColor(COLOR_HIGHLIGHT)); - FillRect(lpdis->hDC, &rcBitmap, (HBRUSH)(COLOR_HIGHLIGHTTEXT)); + if (lpdis->itemState & ODS_FOCUS) { + SetTextColor(lpdis->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT)); + SetBkColor(lpdis->hDC, GetSysColor(COLOR_HIGHLIGHT)); + FillRect(lpdis->hDC, &rcBitmap, (HBRUSH)(COLOR_HIGHLIGHT+1)); + } + else { + SetTextColor(lpdis->hDC, GetSysColor(COLOR_INACTIVECAPTIONTEXT)); + SetBkColor(lpdis->hDC, GetSysColor(COLOR_INACTIVECAPTION)); + FillRect(lpdis->hDC, &rcBitmap, (HBRUSH)(COLOR_INACTIVECAPTION+1)); + } } else { @@ -1123,9 +1133,6 @@ LRESULT CALLBACK ServiceDlgProc(HWND hDlg, UINT message, } TextOut(lpdis->hDC, XBITMAP + 6, y, szBuf, (int)_tcslen(szBuf)); break; - - case ODA_FOCUS: - break; } return TRUE; case WM_COMMAND: @@ -1157,7 +1164,7 @@ LRESULT CALLBACK ServiceDlgProc(HWND hDlg, UINT message, } break; - case IDOK: + case IDCANCEL: EndDialog(hDlg, TRUE); return TRUE; @@ -1204,11 +1211,6 @@ LRESULT CALLBACK ServiceDlgProc(HWND hDlg, UINT message, } return TRUE; - case IDC_SEXIT: - EndDialog(hDlg, TRUE); - SendMessage(g_hwndMain, WM_COMMAND, (WPARAM)IDM_EXIT, 0); - return TRUE; - case IDC_SCONNECT: DialogBox(g_hInstance, MAKEINTRESOURCE(IDD_DLGCONNECT), hDlg, (DLGPROC)ConnectDlgProc); diff --git a/support/win32/ApacheMonitor.h b/support/win32/ApacheMonitor.h index 085c45f8dde..87109aaacb1 100644 --- a/support/win32/ApacheMonitor.h +++ b/support/win32/ApacheMonitor.h @@ -38,7 +38,6 @@ #define IDC_SSTART 117 #define IDC_SSTOP 118 #define IDC_SRESTART 119 -#define IDC_SEXIT 120 #define IDC_SMANAGER 121 #define IDD_DLGCONNECT 122 #define IDC_LREMOTE 123 @@ -69,7 +68,8 @@ #define IDS_MSG_SERVICES 275 #define IDS_MSG_CONNECT 276 #define IDS_MSG_ECONNECT 277 -#define IDS_MSG_LAST 277 +#define IDS_MSG_OK 278 +#define IDS_MSG_LAST 278 #define IDM_SM_SERVICE 0x1100 #define IDM_SM_START 0x1200 #define IDM_SM_STOP 0x1400 diff --git a/support/win32/ApacheMonitor.rc b/support/win32/ApacheMonitor.rc index 3d675ff14df..0ef419bd2c3 100644 --- a/support/win32/ApacheMonitor.rc +++ b/support/win32/ApacheMonitor.rc @@ -34,21 +34,20 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Apache Service Monitor" FONT 8, "MS Sans Serif" BEGIN - DEFPUSHBUTTON "&OK",IDOK,298,49,50,14 + PUSHBUTTON "OK",IDCANCEL,298,161,50,14 + CONTROL IDB_BMPHEADER,IDC_STATIC,"Static",SS_BITMAP,0,0,349,38 LTEXT "Service St&atus :",IDC_SSTATUS,3,40,272,8 LISTBOX IDL_SERVICES,2,49,285,73,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP LISTBOX IDL_STDOUT,2,124,285,51,LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | LBS_NOSEL | WS_VSCROLL - PUSHBUTTON "&Start",IDC_SSTART,298,65,50,14 - PUSHBUTTON "S&top",IDC_SSTOP,298,81,50,14 - PUSHBUTTON "&Restart",IDC_SRESTART,298,97,50,14 - PUSHBUTTON "Ser&vices",IDC_SMANAGER,298,113,50,14 - CONTROL IDB_BMPHEADER,IDC_STATIC,"Static",SS_BITMAP,0,0,349,38 - PUSHBUTTON "&Connect",IDC_SCONNECT,298,129,50,14 - PUSHBUTTON "&Disconnect",IDC_SDISCONN,298,145,50,14 - PUSHBUTTON "E&xit",IDC_SEXIT,298,161,50,14 + PUSHBUTTON "&Start",IDC_SSTART,298,49,50,14 + PUSHBUTTON "S&top",IDC_SSTOP,298,65,50,14 + PUSHBUTTON "&Restart",IDC_SRESTART,298,81,50,14 + PUSHBUTTON "Ser&vices",IDC_SMANAGER,298,97,50,14 + PUSHBUTTON "&Connect",IDC_SCONNECT,298,113,50,14 + PUSHBUTTON "&Disconnect",IDC_SDISCONN,298,129,50,14 END IDD_DLGCONNECT DIALOGEX 0, 0, 240, 54 @@ -86,6 +85,7 @@ BEGIN IDS_MSG_MNUSERVICES "Open &Services" IDS_MSG_MNUSHOW "&Open Apache Monitor" IDS_MSG_MNUEXIT "E&xit" + IDS_MSG_OK "OK" IDS_MSG_SRVSTART "The %s service is starting." IDS_MSG_SRVSTARTED "The %s service has started." IDS_MSG_SRVSTOP "The %s service is stopping."