static void ReActiveCombo(HWND hwndDlg) { if (IsDlgButtonChecked(hwndDlg, IDC_IGNORE)) { EnableWindow(GetDlgItem(hwndDlg, IDC_GRADIENT_LR), IsDlgButtonChecked(hwndDlg, IDC_GRADIENT)); EnableWindow(GetDlgItem(hwndDlg, IDC_GRADIENT_RL), IsDlgButtonChecked(hwndDlg, IDC_GRADIENT)); EnableWindow(GetDlgItem(hwndDlg, IDC_GRADIENT_TB), IsDlgButtonChecked(hwndDlg, IDC_GRADIENT)); EnableWindow(GetDlgItem(hwndDlg, IDC_GRADIENT_BT), IsDlgButtonChecked(hwndDlg, IDC_GRADIENT)); EnableWindow(GetDlgItem(hwndDlg, IDC_BASECOLOUR2), BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_COLOR2_TRANSPARENT)); EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR2LABLE), BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_COLOR2_TRANSPARENT)); EnableWindow(GetDlgItem(hwndDlg, IDC_CORNER_TL), IsDlgButtonChecked(hwndDlg, IDC_CORNER)); EnableWindow(GetDlgItem(hwndDlg, IDC_CORNER_TR), IsDlgButtonChecked(hwndDlg, IDC_CORNER)); EnableWindow(GetDlgItem(hwndDlg, IDC_CORNER_BR), IsDlgButtonChecked(hwndDlg, IDC_CORNER)); EnableWindow(GetDlgItem(hwndDlg, IDC_CORNER_BL), IsDlgButtonChecked(hwndDlg, IDC_CORNER)); ChangeControlItems(hwndDlg, BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_IGNORE), IDC_IGNORE); } else { ChangeControlItems(hwndDlg, BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_IGNORE), IDC_IGNORE); EnableWindow(GetDlgItem(hwndDlg, IDC_GRADIENT_LR), IsDlgButtonChecked(hwndDlg, IDC_GRADIENT)); EnableWindow(GetDlgItem(hwndDlg, IDC_GRADIENT_RL), IsDlgButtonChecked(hwndDlg, IDC_GRADIENT)); EnableWindow(GetDlgItem(hwndDlg, IDC_GRADIENT_TB), IsDlgButtonChecked(hwndDlg, IDC_GRADIENT)); EnableWindow(GetDlgItem(hwndDlg, IDC_GRADIENT_BT), IsDlgButtonChecked(hwndDlg, IDC_GRADIENT)); EnableWindow(GetDlgItem(hwndDlg, IDC_BASECOLOUR2), BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_COLOR2_TRANSPARENT)); EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR2LABLE), BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_COLOR2_TRANSPARENT)); EnableWindow(GetDlgItem(hwndDlg, IDC_CORNER_TL), IsDlgButtonChecked(hwndDlg, IDC_CORNER)); EnableWindow(GetDlgItem(hwndDlg, IDC_CORNER_TR), IsDlgButtonChecked(hwndDlg, IDC_CORNER)); EnableWindow(GetDlgItem(hwndDlg, IDC_CORNER_BR), IsDlgButtonChecked(hwndDlg, IDC_CORNER)); EnableWindow(GetDlgItem(hwndDlg, IDC_CORNER_BL), IsDlgButtonChecked(hwndDlg, IDC_CORNER)); } }
static void ReActiveCombo(HWND hwndDlg) { if (IsDlgButtonChecked(hwndDlg, IDC_IGNORE)) { Utils::enableDlgControl(hwndDlg, IDC_GRADIENT_LR, IsDlgButtonChecked(hwndDlg, IDC_GRADIENT)); Utils::enableDlgControl(hwndDlg, IDC_GRADIENT_RL, IsDlgButtonChecked(hwndDlg, IDC_GRADIENT)); Utils::enableDlgControl(hwndDlg, IDC_GRADIENT_TB, IsDlgButtonChecked(hwndDlg, IDC_GRADIENT)); Utils::enableDlgControl(hwndDlg, IDC_GRADIENT_BT, IsDlgButtonChecked(hwndDlg, IDC_GRADIENT)); Utils::enableDlgControl(hwndDlg, IDC_CORNER_TL, IsDlgButtonChecked(hwndDlg, IDC_CORNER)); Utils::enableDlgControl(hwndDlg, IDC_CORNER_TR, IsDlgButtonChecked(hwndDlg, IDC_CORNER)); Utils::enableDlgControl(hwndDlg, IDC_CORNER_BR, IsDlgButtonChecked(hwndDlg, IDC_CORNER)); Utils::enableDlgControl(hwndDlg, IDC_CORNER_BL, IsDlgButtonChecked(hwndDlg, IDC_CORNER)); ChangeControlItems(hwndDlg, !IsDlgButtonChecked(hwndDlg, IDC_IGNORE), IDC_IGNORE); } else { ChangeControlItems(hwndDlg, !IsDlgButtonChecked(hwndDlg, IDC_IGNORE), IDC_IGNORE); Utils::enableDlgControl(hwndDlg, IDC_GRADIENT_LR, IsDlgButtonChecked(hwndDlg, IDC_GRADIENT)); Utils::enableDlgControl(hwndDlg, IDC_GRADIENT_RL, IsDlgButtonChecked(hwndDlg, IDC_GRADIENT)); Utils::enableDlgControl(hwndDlg, IDC_GRADIENT_TB, IsDlgButtonChecked(hwndDlg, IDC_GRADIENT)); Utils::enableDlgControl(hwndDlg, IDC_GRADIENT_BT, IsDlgButtonChecked(hwndDlg, IDC_GRADIENT)); Utils::enableDlgControl(hwndDlg, IDC_CORNER_TL, IsDlgButtonChecked(hwndDlg, IDC_CORNER)); Utils::enableDlgControl(hwndDlg, IDC_CORNER_TR, IsDlgButtonChecked(hwndDlg, IDC_CORNER)); Utils::enableDlgControl(hwndDlg, IDC_CORNER_BR, IsDlgButtonChecked(hwndDlg, IDC_CORNER)); Utils::enableDlgControl(hwndDlg, IDC_CORNER_BL, IsDlgButtonChecked(hwndDlg, IDC_CORNER)); } }
// enabled all status controls if the selected item is a separator static BOOL CheckItem(int item, HWND hwndDlg) { if (StatusItems[item]->statusID == ID_EXTBKSEPARATOR) { ChangeControlItems(hwndDlg, 0, 0); return FALSE; } else { ChangeControlItems(hwndDlg, 1, 0); return TRUE; } }
// wenn die listbox geändert wurde static void OnListItemsChange(HWND hwndDlg) { SendMessage(hwndDlg, WM_SETREDRAW, FALSE, 0); SaveLatestChanges(hwndDlg); // set new selection last_selcount = SendDlgItemMessage(hwndDlg, IDC_ITEMS, LB_GETSELCOUNT, 0, 0); if (last_selcount > 0) { int n, itemData, first_item; // get selected indizes SendDlgItemMessage(hwndDlg, IDC_ITEMS, LB_GETSELITEMS, 64, (LPARAM) last_indizes); // initialize with first items value first_item = SendDlgItemMessage(hwndDlg, IDC_ITEMS, LB_GETITEMDATA, last_indizes[0], 0) - ID_EXTBK_FIRST; StatusItems_t *pFirst = StatusItems[first_item]; StatusItems_t DialogSettingForMultiSel = *StatusItems[first_item]; for (n = 0; n < last_selcount; n++) { itemData = SendDlgItemMessage(hwndDlg, IDC_ITEMS, LB_GETITEMDATA, last_indizes[n], 0); if (itemData == ID_EXTBKSEPARATOR) continue; StatusItems_t *p = StatusItems[itemData - ID_EXTBK_FIRST]; if (p->ALPHA != pFirst->ALPHA) DialogSettingForMultiSel.ALPHA = -1; if (p->COLOR != pFirst->COLOR) DialogSettingForMultiSel.COLOR = CLCDEFAULT_COLOR; if (p->COLOR2 != pFirst->COLOR2) DialogSettingForMultiSel.COLOR2 = CLCDEFAULT_COLOR2; if (p->COLOR2_TRANSPARENT != pFirst->COLOR2_TRANSPARENT) DialogSettingForMultiSel.COLOR2_TRANSPARENT = CLCDEFAULT_COLOR2_TRANSPARENT; if (p->TEXTCOLOR != pFirst->TEXTCOLOR) DialogSettingForMultiSel.TEXTCOLOR = CLCDEFAULT_TEXTCOLOR; if (p->CORNER != pFirst->CORNER) DialogSettingForMultiSel.CORNER = CLCDEFAULT_CORNER; if (p->GRADIENT != pFirst->GRADIENT) DialogSettingForMultiSel.GRADIENT = CLCDEFAULT_GRADIENT; if (p->IGNORED != pFirst->IGNORED) DialogSettingForMultiSel.IGNORED = CLCDEFAULT_IGNORE; if (p->MARGIN_BOTTOM != pFirst->MARGIN_BOTTOM) DialogSettingForMultiSel.MARGIN_BOTTOM = -1; if (p->MARGIN_LEFT != pFirst->MARGIN_LEFT) DialogSettingForMultiSel.MARGIN_LEFT = -1; if (p->MARGIN_RIGHT != pFirst->MARGIN_RIGHT) DialogSettingForMultiSel.MARGIN_RIGHT = -1; if (p->MARGIN_TOP != pFirst->MARGIN_TOP) DialogSettingForMultiSel.MARGIN_TOP = -1; if (p->BORDERSTYLE != pFirst->BORDERSTYLE) DialogSettingForMultiSel.BORDERSTYLE = -1; } if (last_selcount == 1 && pFirst->statusID == ID_EXTBKSEPARATOR) { ChangeControlItems(hwndDlg, 0, 0); last_selcount = 0; } else ChangeControlItems(hwndDlg, 1, 0); FillOptionDialogByStatusItem(hwndDlg, &DialogSettingForMultiSel); InvalidateRect(GetDlgItem(hwndDlg, IDC_ITEMS), NULL, FALSE); } SendMessage(hwndDlg, WM_SETREDRAW, TRUE, 0); RefreshControls(hwndDlg); }
static void OnListItemsChange(HWND hwndDlg) { SendMessage(hwndDlg, WM_SETREDRAW, FALSE, 0); SaveLatestChanges(hwndDlg); // set new selection last_selcount = SendMessage(GetDlgItem(hwndDlg, IDC_ITEMS), LB_GETSELCOUNT, 0, 0); if (last_selcount > 0) { int n, real_index, itemData, first_item; TStatusItem DialogSettingForMultiSel; // get selected indizes SendMessage(GetDlgItem(hwndDlg, IDC_ITEMS), LB_GETSELITEMS, 64, (LPARAM) last_indizes); // initialize with first items value first_item = SendDlgItemMessage(hwndDlg, IDC_ITEMS, LB_GETITEMDATA, last_indizes[0], 0) - ID_EXTBK_FIRST; DialogSettingForMultiSel = StatusItems[first_item]; for (n = 0; n < last_selcount; n++) { itemData = SendDlgItemMessage(hwndDlg, IDC_ITEMS, LB_GETITEMDATA, last_indizes[n], 0); if (itemData != ID_EXTBKSEPARATOR) { real_index = itemData - ID_EXTBK_FIRST; if (StatusItems[real_index].ALPHA != StatusItems[first_item].ALPHA) DialogSettingForMultiSel.ALPHA = -1; if (StatusItems[real_index].COLOR != StatusItems[first_item].COLOR) DialogSettingForMultiSel.COLOR = CLCDEFAULT_COLOR; if (StatusItems[real_index].COLOR2 != StatusItems[first_item].COLOR2) DialogSettingForMultiSel.COLOR2 = CLCDEFAULT_COLOR2; if (StatusItems[real_index].ALPHA2 != StatusItems[first_item].ALPHA2) DialogSettingForMultiSel.ALPHA2 = -1; if (StatusItems[real_index].TEXTCOLOR != StatusItems[first_item].TEXTCOLOR) DialogSettingForMultiSel.TEXTCOLOR = CLCDEFAULT_TEXTCOLOR; if (StatusItems[real_index].CORNER != StatusItems[first_item].CORNER) DialogSettingForMultiSel.CORNER = CLCDEFAULT_CORNER; if (StatusItems[real_index].GRADIENT != StatusItems[first_item].GRADIENT) DialogSettingForMultiSel.GRADIENT = CLCDEFAULT_GRADIENT; if (StatusItems[real_index].IGNORED != StatusItems[first_item].IGNORED) DialogSettingForMultiSel.IGNORED = CLCDEFAULT_IGNORE; if (StatusItems[real_index].MARGIN_BOTTOM != StatusItems[first_item].MARGIN_BOTTOM) DialogSettingForMultiSel.MARGIN_BOTTOM = -1; if (StatusItems[real_index].MARGIN_LEFT != StatusItems[first_item].MARGIN_LEFT) DialogSettingForMultiSel.MARGIN_LEFT = -1; if (StatusItems[real_index].MARGIN_RIGHT != StatusItems[first_item].MARGIN_RIGHT) DialogSettingForMultiSel.MARGIN_RIGHT = -1; if (StatusItems[real_index].MARGIN_TOP != StatusItems[first_item].MARGIN_TOP) DialogSettingForMultiSel.MARGIN_TOP = -1; if (StatusItems[real_index].dwFlags != StatusItems[first_item].dwFlags) DialogSettingForMultiSel.dwFlags = -1; } } if (last_selcount == 1 && StatusItems[first_item].statusID == ID_EXTBKSEPARATOR) { ChangeControlItems(hwndDlg, 0, 0); last_selcount = 0; } else { ChangeControlItems(hwndDlg, 1, 0); } FillOptionDialogByStatusItem(hwndDlg, &DialogSettingForMultiSel); InvalidateRect(GetDlgItem(hwndDlg, IDC_ITEMS), NULL, FALSE); } SendMessage(hwndDlg, WM_SETREDRAW, TRUE, 0); RefreshControls(hwndDlg); }