#include "MainFram.h" #include "Dialogs.h" #include "stdio.h" #define SCROLLCODE(w, l) LOWORD(w) #define SCROLLPOS(w, l) ((L_INT16) HIWORD(w)) #define CTLID(w, l) LOWORD(w) #define NOTIFYCODE(w, l) HIWORD(w) L_INT ValidateZoomFactor(HWND hDlg, L_INT nOldValue) { L_INT nValue; nValue = (L_INT)GetDlgItemInt(hDlg, IDEDT_ZOOMVIEW_ZOOMFACTOR, NULL, FALSE); if(nValue < 100) { nValue = nOldValue; SetDlgItemInt(hDlg, IDEDT_ZOOMVIEW_ZOOMFACTOR, nOldValue, FALSE); return nValue; } else if(nValue > 800) { nValue = nOldValue; SetDlgItemInt(hDlg, IDEDT_ZOOMVIEW_ZOOMFACTOR, nOldValue, FALSE); return nValue; } return nValue; } COLORREF ShowColorDlg ( HWND hWndOwner ,COLORREF crInitial) { COLORDLGPARAMS DlgParams ; L_INT nRet; memset ( &DlgParams, 0, sizeof ( COLORDLGPARAMS ) ) ; DlgParams.uStructSize = sizeof ( COLORDLGPARAMS ) ; DlgParams.uDlgFlags = DLG_COLOR_SHOW_OLDCOLOR | DLG_COLOR_SHOW_NEWCOLOR | DLG_COLOR_SHOW_NAME | DLG_COLOR_COLORSPACE_SHOW_HUE | DLG_COLOR_COLORSPACE_SHOW_BRIGHTNESS | DLG_COLOR_COLORSPACE_SHOW_WHEEL | DLG_COLOR_COLORSPACE_SHOW_RGB | DLG_COLOR_COLORSPACE_SHOW_CMY | DLG_COLOR_COLORSPACE_SHOW_CMYK | DLG_COLOR_COLORSPACE_SHOW_LAB | DLG_COLOR_COLORMODEL_SHOW_RGB | DLG_COLOR_COLORMODEL_SHOW_HSB | DLG_COLOR_COLORMODEL_SHOW_HLS | DLG_COLOR_COLORMODEL_SHOW_CMY | DLG_COLOR_COLORMODEL_SHOW_CMYK | DLG_COLOR_COLORMODEL_SHOW_LAB ; DlgParams.crColor = crInitial; DlgParams.hpalCustom = NULL ; nRet = L_DlgColor( hWndOwner, &DlgParams ) ; if(nRet == SUCCESS_DLG_OK) { crInitial = DlgParams.crColor; } return DlgParams.crColor; } L_VOID RepaintButton(HWND hDlg, L_INT id ,COLORREF ColorRef) { HBRUSH hNewBrush,hOldBrush; HDC hdc; RECT rect; HWND hWnd; BOOL bEnable; hWnd = GetDlgItem(hDlg, id); bEnable = IsWindowEnabled(hWnd); hdc=GetDC (hWnd); GetClientRect(hWnd, &rect); hNewBrush = CreateSolidBrush (bEnable ? ColorRef : GetSysColor(COLOR_BTNFACE)); hOldBrush = (HBRUSH) SelectObject (hdc, hNewBrush); Rectangle (hdc, rect.left, rect.top, rect.right, rect.bottom); SelectObject(hdc, hOldBrush); DeleteObject (hNewBrush); ReleaseDC (hWnd, hdc); } void FillPenCombo(HWND hDlg, L_INT id, L_INT nPen) { HWND hCtl; hCtl = GetDlgItem(hDlg,id); ComboBox_AddString(hCtl, (LPARAM)TEXT("0 - Solid")); ComboBox_AddString(hCtl, (LPARAM)TEXT("1 - Dash")); ComboBox_AddString(hCtl, (LPARAM)TEXT("2 - Dot")); ComboBox_AddString(hCtl, (LPARAM)TEXT("3 - DashDot")); ComboBox_AddString(hCtl, (LPARAM)TEXT("4 - DashDotDot")); ComboBox_SetItemData(hCtl, 0, PS_SOLID); ComboBox_SetItemData(hCtl, 1, PS_DASH); ComboBox_SetItemData(hCtl, 2, PS_DOT); ComboBox_SetItemData(hCtl, 3, PS_DASHDOT); ComboBox_SetItemData(hCtl, 4, PS_DASHDOTDOT); ComboBox_SetCurSel(hCtl, nPen); } void FillBorderStyleCombo(HWND hDlg, L_INT id, L_UINT uZoomViewBorderStyle) { HWND hCtl; BOOL bSimpleZoomView; hCtl = GetDlgItem(hDlg,id); ComboBox_AddString(hCtl, (LPARAM)TEXT("0 - None")); ComboBox_AddString(hCtl, (LPARAM)TEXT("1 - Fixed Single")); ComboBox_SetItemData(hCtl, 0, ZOOMVIEWBORDERSTYLE_NONE); ComboBox_SetItemData(hCtl, 1, ZOOMVIEWBORDERSTYLE_SIMPLE); bSimpleZoomView = uZoomViewBorderStyle & ZOOMVIEWBORDERSTYLE_SIMPLE; ComboBox_SetCurSel(hCtl, bSimpleZoomView ? ZOOMVIEWBORDERSTYLE_SIMPLE : ZOOMVIEWBORDERSTYLE_NONE); } void FillSrcAppearanceCombo(HWND hDlg, L_INT id, L_UINT uZoomViewBorderStyle) { HWND hCtl; BOOL b3D; hCtl = GetDlgItem(hDlg,id); ComboBox_AddString(hCtl, (LPARAM)TEXT("0 - Flat")); ComboBox_AddString(hCtl, (LPARAM)TEXT("1 - 3D")); ComboBox_SetItemData(hCtl, 0, SOURCEBORDERSTYLE_SIMPLE); ComboBox_SetItemData(hCtl, 1, SOURCEBORDERSTYLE_3D); b3D = uZoomViewBorderStyle & SOURCEBORDERSTYLE_3D; ComboBox_SetCurSel(hCtl, b3D ? SOURCEBORDERSTYLE_3D : SOURCEBORDERSTYLE_SIMPLE); } void FillDstAppearanceCombo(HWND hDlg, L_INT id, L_UINT uZoomViewBorderStyle) { HWND hCtl; BOOL b3D; hCtl = GetDlgItem(hDlg,id); ComboBox_AddString(hCtl, (LPARAM)TEXT("0 - Flat")); ComboBox_AddString(hCtl, (LPARAM)TEXT("2 - 3D")); ComboBox_SetItemData(hCtl, 0, ZOOMVIEWBORDERSTYLE_NONE); ComboBox_SetItemData(hCtl, 1, ZOOMVIEWBORDERSTYLE_3D); b3D = uZoomViewBorderStyle & ZOOMVIEWBORDERSTYLE_3D; ComboBox_SetCurSel(hCtl, b3D ? 1 : 0); } void FillShapeCombo(HWND hDlg, L_INT id, L_UINT uZoomViewBorderStyle) { HWND hCtl; hCtl = GetDlgItem(hDlg,id); ComboBox_AddString(hCtl, (LPARAM)TEXT("0 - Rectangle")); ComboBox_AddString(hCtl, (LPARAM)TEXT("4 - Tear Out")); ComboBox_AddString(hCtl, (LPARAM)TEXT("8 - Rounded Rectangle")); ComboBox_SetItemData(hCtl, 0, ZOOMVIEWBORDERSTYLE_NONE); ComboBox_SetItemData(hCtl, 1, ZOOMVIEWBORDERSTYLE_TEAROUT); ComboBox_SetItemData(hCtl, 2, ZOOMVIEWBORDERSTYLE_ROUNDED); ComboBox_SetCurSel(hCtl, 0); if(uZoomViewBorderStyle & ZOOMVIEWBORDERSTYLE_TEAROUT) ComboBox_SetCurSel(hCtl, 1); if(uZoomViewBorderStyle & ZOOMVIEWBORDERSTYLE_ROUNDED) ComboBox_SetCurSel(hCtl, 2); } L_INT GetCurSelValue(HWND hDlg, L_INT id) { L_INT nCurSel; nCurSel = ComboBox_GetCurSel(GetDlgItem(hDlg, id)); return ComboBox_GetItemData(GetDlgItem(hDlg, id), nCurSel); } L_BOOL CALLBACK ZoomViewWHDlgProc(HWND hDlg,UINT msg,WPARAM wparam,LPARAM lparam) { static ZOOMVIEWPROPS DlgData; static pZOOMVIEWPROPS pDlgData; switch (msg) { case WM_INITDIALOG : pDlgData=(pZOOMVIEWPROPS)lparam; DlgData=*pDlgData; FillPenCombo(hDlg, IDCMB_ZOOMVIEW_SRCPEN, DlgData.nSrcPenStyle); FillSrcAppearanceCombo(hDlg,IDCMB_ZOOMVIEW_SRCAPPEARANCE,DlgData.uSrcBorderStyle); FillPenCombo(hDlg, IDCMB_ZOOMVIEW_DSTPEN, DlgData.nZoomViewPenStyle); FillDstAppearanceCombo(hDlg, IDCMB_ZOOMVIEW_DSTAPPEARANCE, DlgData.uZoomViewBorderStyle); FillBorderStyleCombo(hDlg, IDCMB_ZOOMVIEW_DSTBORDERSTYLE, DlgData.uZoomViewBorderStyle); FillShapeCombo(hDlg, IDCMB_ZOOMVIEW_DSTSHAPE, DlgData.uZoomViewBorderStyle); FillPenCombo(hDlg, IDCMB_ZOOMVIEW_CALLOUTPEN, DlgData.nCalloutPenStyle); SetDlgItemInt(hDlg, IDEDT_ZOOMVIEW_ZOOMFACTOR, DlgData.nZoom, FALSE); if(DlgData.uSrcBorderStyle == SOURCEBORDERSTYLE_3D) { EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_SRCPEN),FALSE); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_SRCPEN),FALSE); EnableWindow(GetDlgItem(hDlg, IDBTN_ZOOMVIEW_SRCCOLOR),FALSE); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_SRCCOLOR),FALSE); } if(DlgData.bCallouts) { Button_SetCheck(GetDlgItem(hDlg, IDCHK_ZOOMVIEW_CALLOUTS), BM_SETCHECK); } EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_CALLOUTPEN),DlgData.bCallouts); EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_CALLOUTPEN),DlgData.bCallouts); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_CALLOUTCOLOR),DlgData.bCallouts); EnableWindow(GetDlgItem(hDlg, IDBTN_ZOOMVIEW_CALLOUTCOLOR),DlgData.bCallouts); InitDstCombo(hDlg); break; case WM_DRAWITEM: RepaintButton(hDlg, IDBTN_ZOOMVIEW_SRCCOLOR, DlgData.crSrcBorder); RepaintButton(hDlg, IDBTN_ZOOMVIEW_DSTCOLOR, DlgData.crZoomViewBorder); RepaintButton(hDlg, IDBTN_ZOOMVIEW_CALLOUTCOLOR, DlgData.crCallout); return TRUE; case WM_COMMAND: switch(LOWORD(wparam)) { case IDBTN_ZOOMVIEW_SRCCOLOR: DlgData.crSrcBorder = ShowColorDlg(hDlg,DlgData.crSrcBorder); RepaintButton(hDlg, IDBTN_ZOOMVIEW_SRCCOLOR, DlgData.crSrcBorder); break; case IDBTN_ZOOMVIEW_DSTCOLOR: DlgData.crZoomViewBorder = ShowColorDlg(hDlg,DlgData.crZoomViewBorder); RepaintButton(hDlg, IDBTN_ZOOMVIEW_DSTCOLOR, DlgData.crZoomViewBorder); break; case IDBTN_ZOOMVIEW_CALLOUTCOLOR: DlgData.crCallout = ShowColorDlg(hDlg,DlgData.crCallout); RepaintButton(hDlg, IDBTN_ZOOMVIEW_CALLOUTCOLOR, DlgData.crCallout); break; case IDCMB_ZOOMVIEW_SRCPEN: { DlgData.nSrcPenStyle = GetCurSelValue(hDlg, IDCMB_ZOOMVIEW_SRCPEN); break; } case IDCMB_ZOOMVIEW_DSTPEN: { DlgData.nZoomViewPenStyle = GetCurSelValue(hDlg, IDCMB_ZOOMVIEW_DSTPEN); break; } case IDCMB_ZOOMVIEW_CALLOUTPEN: { DlgData.nCalloutPenStyle = GetCurSelValue(hDlg, IDCMB_ZOOMVIEW_CALLOUTPEN); break; } case IDCMB_ZOOMVIEW_SRCAPPEARANCE: { DlgData.uSrcBorderStyle = GetCurSelValue(hDlg, IDCMB_ZOOMVIEW_SRCAPPEARANCE); if(DlgData.uSrcBorderStyle == SOURCEBORDERSTYLE_3D) { EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_SRCPEN),FALSE); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_SRCPEN),FALSE); EnableWindow(GetDlgItem(hDlg, IDBTN_ZOOMVIEW_SRCCOLOR),FALSE); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_SRCCOLOR),FALSE); } else { EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_SRCPEN),TRUE); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_SRCPEN),TRUE); EnableWindow(GetDlgItem(hDlg, IDBTN_ZOOMVIEW_SRCCOLOR),TRUE); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_SRCCOLOR),TRUE); } break; } case IDCHK_ZOOMVIEW_CALLOUTS: DlgData.bCallouts = Button_GetCheck(GetDlgItem(hDlg, IDCHK_ZOOMVIEW_CALLOUTS)); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_CALLOUTPEN),DlgData.bCallouts); EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_CALLOUTPEN),DlgData.bCallouts); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_CALLOUTCOLOR),DlgData.bCallouts); EnableWindow(GetDlgItem(hDlg, IDBTN_ZOOMVIEW_CALLOUTCOLOR),DlgData.bCallouts); break; case IDCMB_ZOOMVIEW_DSTAPPEARANCE: case IDCMB_ZOOMVIEW_DSTBORDERSTYLE: case IDCMB_ZOOMVIEW_DSTSHAPE: InitDstCombo(hDlg); break; case IDEDT_ZOOMVIEW_ZOOMFACTOR: if(HIWORD(wparam) == EN_KILLFOCUS) { ValidateZoomFactor(hDlg, DlgData.nZoom); } break; case IDOK: { L_UINT uZoomViewBorderStyle = 0; DlgData.nZoom = ValidateZoomFactor(hDlg, DlgData.nZoom); uZoomViewBorderStyle |= GetCurSelValue(hDlg, IDCMB_ZOOMVIEW_DSTAPPEARANCE); uZoomViewBorderStyle |= GetCurSelValue(hDlg, IDCMB_ZOOMVIEW_DSTBORDERSTYLE); uZoomViewBorderStyle |= GetCurSelValue(hDlg, IDCMB_ZOOMVIEW_DSTSHAPE); DlgData.uZoomViewBorderStyle = uZoomViewBorderStyle; *pDlgData = DlgData; EndDialog(hDlg, TRUE); } break; case IDCANCEL: EndDialog(hDlg,FALSE); break; } } return 0; } /*======[AboutDlgProc]=============================================== Syntax: L_BOOL CALLBACK AboutDlgProc(HWND hDlg,UINT msg,WPARAM wparam,LPARAM lparam); =========================================================================*/ L_BOOL CALLBACK AboutDlgProc(HWND hDlg,UINT msg,WPARAM wparam,LPARAM lparam) { L_CHAR szText[_MAX_PATH]; VERSIONINFO VersionInfo; L_VersionInfo(&VersionInfo,sizeof(VersionInfo)); switch (msg) { case WM_INITDIALOG: /* Get the Product name */ strcpy(szText, (LPSTR)VersionInfo.Product); /* Get the Toolkit level */ if(VersionInfo.Level == TOOLKIT_LEVEL_DOCUMENT) strcat(szText, (LPSTR)"\nExpress Edition."); else if(VersionInfo.Level == TOOLKIT_LEVEL_MEDICAL) strcat(szText, (LPSTR)"\nMedical Express Edition."); else strcat(szText, (LPSTR)"\nProfessional Edition."); /* Get Version Major and Minor numbers */ sprintf(szText, "%s\nVersion %d.%d\n", szText, VersionInfo.MajorNumber, VersionInfo.MinorNumber); /* Get Date of building toolkit */ sprintf(szText, "%sDate: %s\n", szText, (LPSTR)VersionInfo.Date); /* Get Time of building toolkit */ sprintf(szText, "%sTime: %s\n", szText, (LPSTR)VersionInfo.Time); /* Displaying the toolkit info */ SetDlgItemTextA(hDlg, IDC_STATIC_VERSIONINFO, szText); return TRUE; case WM_COMMAND : switch(LOWORD(wparam)) { case IDOK: case IDCANCEL: EndDialog(hDlg,FALSE); return TRUE; } } return FALSE; } L_BOOL CALLBACK L_EXPORT RangeDlgProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { static LPRANGEPARM pParm; L_INT n; BOOL fTranslated; switch (message) { case WM_INITDIALOG: pParm = (LPRANGEPARM) lParam; SetWindowText (hDlg, pParm->szTitle); SetDlgItemText (hDlg, IDC_RANGELABEL, pParm->szLabel); SetScrollRange (GetDlgItem (hDlg, IDC_RANGESCROLL), SB_CTL, pParm->nMin, pParm->nMax, FALSE); SetScrollPos (GetDlgItem (hDlg, IDC_RANGESCROLL), SB_CTL, pParm->nValue, TRUE); SetDlgItemInt (hDlg, IDC_RANGEEDIT, pParm->nValue, TRUE); return (TRUE); case WM_HSCROLL: n = GetDlgItemInt (hDlg, IDC_RANGEEDIT, &fTranslated, TRUE); if (!(!fTranslated || n < pParm->nMin || n > pParm->nMax)) pParm->nValue = n; switch (SCROLLCODE(wParam, lParam)) { case SB_LEFT: pParm->nValue = pParm->nMin; break; case SB_RIGHT: pParm->nValue = pParm->nMax; break; case SB_THUMBPOSITION: case SB_THUMBTRACK: pParm->nValue = SCROLLPOS(wParam, lParam); break; case SB_LINELEFT: pParm->nValue = max (pParm->nValue - pParm->nStep, pParm->nMin); break; case SB_LINERIGHT: pParm->nValue = min (pParm->nValue + pParm->nStep, pParm->nMax); break; case SB_PAGELEFT: pParm->nValue = max (pParm->nValue - pParm->nPage, pParm->nMin); break; case SB_PAGERIGHT: pParm->nValue = min (pParm->nValue + pParm->nPage, pParm->nMax); break; } SetDlgItemInt (hDlg, IDC_RANGEEDIT, pParm->nValue, TRUE); SetScrollPos (GetDlgItem (hDlg, IDC_RANGESCROLL), SB_CTL, pParm->nValue, TRUE); return (TRUE); case WM_COMMAND: switch (CTLID(wParam, lParam)) { case IDC_RANGEEDIT: switch (NOTIFYCODE(wParam, lParam)) { case EN_CHANGE: n = GetDlgItemInt (hDlg, IDC_RANGEEDIT, &fTranslated, TRUE); if (!(!fTranslated || n < pParm->nMin || n > pParm->nMax)) { pParm->nValue = n; SetScrollPos (GetDlgItem (hDlg, IDC_RANGESCROLL), SB_CTL, pParm->nValue, TRUE); } break; } return (TRUE); case IDOK: n = GetDlgItemInt (hDlg, IDC_RANGEEDIT, &fTranslated, TRUE); if (!fTranslated || n < pParm->nMin || n > pParm->nMax) { MessageBeep (0); SetFocus (GetDlgItem (hDlg, IDC_RANGEEDIT)); SendDlgItemMessage(hDlg, IDC_RANGEEDIT, EM_SETSEL, TRUE, MAKELPARAM(0, -1)); } else { pParm->nValue = n; EndDialog (hDlg, IDOK); } return (TRUE); case IDCANCEL: EndDialog (hDlg, IDCANCEL); return (TRUE); } } return (FALSE); } /*====(GetZoomFactor)====================================================== Description: Gets the zoom factor for the image. Syntax : L_INT GetZoomFactor (HWND hWnd, L_INT nInit) Prototype : demo.h Parameters : hWnd Handle of a window. nInit Initial value of the control. Return Value: Zoom Factor. ==========================================================================*/ L_INT GetZoomFactor (HWND hWnd, L_INT nInit) { RANGEPARM Parm; L_INT nRet; HINSTANCE hInst=(HINSTANCE)GetWindowLong(hWnd,GWL_HINSTANCE); lstrcpy (Parm.szTitle, TEXT("Zoom Factor")); lstrcpy (Parm.szLabel, TEXT("&Percentage")); Parm.nValue = nInit; Parm.nMin = 1; Parm.nMax = 800; Parm.nStep = 1; Parm.nPage = 100; nRet = DialogBoxParam(hInst,MAKEINTRESOURCE(IDD_RANGE),hWnd,(DLGPROC)RangeDlgProc,(LONG)&Parm); switch (nRet) { case IDOK: break; case IDCANCEL: default: Parm.nValue = nInit; break; } return (Parm.nValue); } L_VOID InitDstCombo(HWND hDlg) { EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_DSTBORDERSTYLE),TRUE); EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_DSTAPPEARANCE),TRUE); EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_DSTPEN),TRUE); EnableWindow(GetDlgItem(hDlg, IDBTN_ZOOMVIEW_DSTCOLOR),TRUE); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_DSTCOLOR),TRUE); switch (GetCurSelValue(hDlg, IDCMB_ZOOMVIEW_DSTSHAPE)) { case ZOOMVIEWBORDERSTYLE_TEAROUT: EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_DSTBORDERSTYLE),FALSE); EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_DSTAPPEARANCE),FALSE); EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_DSTPEN),FALSE); EnableWindow(GetDlgItem(hDlg, IDBTN_ZOOMVIEW_DSTCOLOR),FALSE); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_DSTCOLOR),FALSE); break; case ZOOMVIEWBORDERSTYLE_ROUNDED: EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_DSTAPPEARANCE),FALSE); if(GetCurSelValue(hDlg, IDCMB_ZOOMVIEW_DSTBORDERSTYLE) == ZOOMVIEWBORDERSTYLE_NONE) { EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_DSTPEN),FALSE); EnableWindow(GetDlgItem(hDlg, IDBTN_ZOOMVIEW_DSTCOLOR),FALSE); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_DSTCOLOR),FALSE); } else { EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_DSTPEN),TRUE); EnableWindow(GetDlgItem(hDlg, IDBTN_ZOOMVIEW_DSTCOLOR),TRUE); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_DSTCOLOR),TRUE); } break; case 0: if(GetCurSelValue(hDlg, IDCMB_ZOOMVIEW_DSTAPPEARANCE) == ZOOMVIEWBORDERSTYLE_3D) { EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_DSTBORDERSTYLE),FALSE); EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_DSTPEN),FALSE); EnableWindow(GetDlgItem(hDlg, IDBTN_ZOOMVIEW_DSTCOLOR),FALSE); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_DSTCOLOR),FALSE); } else { if(GetCurSelValue(hDlg, IDCMB_ZOOMVIEW_DSTBORDERSTYLE) == ZOOMVIEWBORDERSTYLE_SIMPLE) { EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_DSTPEN), TRUE); EnableWindow(GetDlgItem(hDlg, IDBTN_ZOOMVIEW_DSTCOLOR), TRUE); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_DSTCOLOR),TRUE); } else { EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_DSTPEN), FALSE); EnableWindow(GetDlgItem(hDlg, IDBTN_ZOOMVIEW_DSTCOLOR), FALSE); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_DSTCOLOR),FALSE); } } break; default: EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_DSTBORDERSTYLE), TRUE); EnableWindow(GetDlgItem(hDlg, IDCMB_ZOOMVIEW_DSTPEN), TRUE); EnableWindow(GetDlgItem(hDlg, IDBTN_ZOOMVIEW_DSTCOLOR), TRUE); EnableWindow(GetDlgItem(hDlg, IDSTC_ZOOMVIEW_DSTCOLOR),TRUE); break; } }