diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-04 18:51:53 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-04 18:51:53 +0000 |
commit | ecb177cadbcff850a16c4b9e306beb15f61ac6f9 (patch) | |
tree | da36e3107747a5f37dbd078197d584054057609f /plugins/Clist_nicer/src/clcopts.cpp | |
parent | 808f3b5e0fefeb560ce5393bf8311927d0927411 (diff) |
kernel extraicons, part II
git-svn-id: http://svn.miranda-ng.org/main/trunk@2188 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer/src/clcopts.cpp')
-rw-r--r-- | plugins/Clist_nicer/src/clcopts.cpp | 222 |
1 files changed, 0 insertions, 222 deletions
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 0ab595a853..7555aacb94 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -805,218 +805,6 @@ static INT_PTR CALLBACK DlgProcDspAdvanced(HWND hwndDlg, UINT msg, WPARAM wParam return FALSE;
}
-ORDERTREEDATA OrderTreeData[]=
-{
- {EXTRA_ICON_RES0, _T("Reserved, unused"), 9, TRUE, 0},
- {EXTRA_ICON_EMAIL, _T("E-mail"), 0, TRUE, 0},
- {EXTRA_ICON_RES1, _T("Reserved #1"), 7, TRUE, 0},
- {EXTRA_ICON_SMS, _T("Telephone"), 2, TRUE, 0},
- {EXTRA_ICON_ADV1, _T("Advanced #1 (ICQ X-Status)"), 3, TRUE, 0},
- {EXTRA_ICON_ADV2, _T("Advanced #2"), 4, TRUE, 0},
- {EXTRA_ICON_WEB, _T("Homepage"), 1, TRUE, 0},
- {EXTRA_ICON_CLIENT, _T("Client (fingerprint required)"), 10, TRUE, 0},
- {EXTRA_ICON_RES2, _T("Reserved #2"), 8, TRUE, 0},
- {EXTRA_ICON_ADV3, _T("Advanced #3"), 5, TRUE, 0},
- {EXTRA_ICON_ADV4, _T("Advanced #4"), 6, TRUE, 0},
-};
-
-static int dragging=0;
-static HTREEITEM hDragItem=NULL;
-
-static int FillOrderTree(HWND hwndDlg, HWND hwndTree, BYTE *exIconOrder, unsigned dwExtraImageMask)
-{
- TVINSERTSTRUCT tvis = {0};
- TreeView_DeleteAllItems(hwndTree);
- tvis.hInsertAfter = TVI_LAST;
- tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
-
- for (int i = 0; i < EXICON_COUNT; i++) {
- int iIndex = (int)(exIconOrder[i] - 1);
- tvis.item.lParam=(LPARAM)(&(OrderTreeData[iIndex]));
- tvis.item.pszText = TranslateTS(OrderTreeData[iIndex].Name);
- OrderTreeData[iIndex].Visible = (dwExtraImageMask & (1 << OrderTreeData[iIndex].ID)) != 0;
- tvis.item.iImage = tvis.item.iSelectedImage = OrderTreeData[iIndex].Visible;
- TreeView_InsertItem(hwndTree, &tvis);
- }
-
- return 0;
-}
-
-static int SaveOrderTree(HWND hwndDlg, HWND hwndTree, DISPLAYPROFILE *p)
-{
- TVITEM tvi = {0};
- tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
-
- p->dwExtraImageMask = 0;
-
- HTREEITEM ht = TreeView_GetRoot(hwndTree);
- for (int iIndex = 0; ht != NULL; iIndex++) {
- tvi.hItem = ht;
- TreeView_GetItem(hwndTree, &tvi);
-
- ORDERTREEDATA *it = (ORDERTREEDATA *)(tvi.lParam);
- p->exIconOrder[iIndex] = it->ID + 1;
- p->dwExtraImageMask |= (it->Visible ? (1 << it->ID) : 0);
- ht = TreeView_GetNextSibling(hwndTree, ht);
- }
-
- return 0;
-}
-
-static INT_PTR CALLBACK DlgProcXIcons(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- DISPLAYPROFILE *p;
-
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_EXTRAORDER), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_EXTRAORDER),GWL_STYLE)|TVS_NOHSCROLL);
-
- if (himlCheckBoxes == 0)
- CreateStateImageList();
-
- TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_EXTRAORDER), himlCheckBoxes, TVSIL_NORMAL);
- return TRUE;
-
- case WM_COMMAND:
- if ((LOWORD(wParam) == IDC_EXICONSCALE) && (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus()))
- return 0;
-
- if (IDC_RESETXICONS == LOWORD(wParam)) {
- BYTE exIconOrder[EXICON_COUNT];
- for (int i = 0; i < EXICON_COUNT; i++) {
- OrderTreeData[i].Visible = TRUE;
- exIconOrder[i] = i + 1;
- }
- FillOrderTree(hwndDlg, GetDlgItem(hwndDlg, IDC_EXTRAORDER), exIconOrder, 0xffffffff);
- }
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
-
- case WM_USER + 100:
- p = (DISPLAYPROFILE *)lParam;
- if (p) {
- SendDlgItemMessage(hwndDlg, IDC_EXICONSCALESPIN, UDM_SETRANGE, 0, MAKELONG(20, 8));
- SendDlgItemMessage(hwndDlg, IDC_EXICONSCALESPIN, UDM_SETPOS, 0, (LPARAM)p->exIconScale);
- FillOrderTree(hwndDlg, GetDlgItem(hwndDlg, IDC_EXTRAORDER), p->exIconOrder, p->dwExtraImageMask);
- }
- return 0;
-
- case WM_USER + 200:
- p = (DISPLAYPROFILE *)lParam;
- if (p) {
- SaveOrderTree(hwndDlg, GetDlgItem(hwndDlg, IDC_EXTRAORDER), p);
-
- p->exIconScale = SendDlgItemMessage(hwndDlg, IDC_EXICONSCALESPIN, UDM_GETPOS, 0, 0);
- p->exIconScale = (p->exIconScale < 8 || p->exIconScale > 20) ? 16 : p->exIconScale;
- }
- return 0;
-
- case WM_NOTIFY:
- if (((LPNMHDR) lParam)->idFrom == IDC_EXTRAORDER) {
- switch (((LPNMHDR)lParam)->code) {
- case TVN_BEGINDRAGA:
- case TVN_BEGINDRAGW:
- SetCapture(hwndDlg);
- dragging=1;
- hDragItem=((LPNMTREEVIEWA)lParam)->itemNew.hItem;
- TreeView_SelectItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hDragItem);
- break;
- case NM_CLICK:
- {
- TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
- ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
- if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
- if (hti.flags&TVHT_ONITEMICON)
- {
- TVITEMA tvi;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvi.hItem=hti.hItem;
- TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
- tvi.iImage=tvi.iSelectedImage=!tvi.iImage;
- ((ORDERTREEDATA *)tvi.lParam)->Visible=tvi.iImage;
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
- SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- }
- }
- }
- break;
- }
- switch (((LPNMHDR) lParam)->code) {
- case PSN_APPLY:
- return TRUE;
- }
- break;
-
- case WM_MOUSEMOVE:
- if (dragging) {
- TVHITTESTINFO hti;
- hti.pt.x = (short)LOWORD(lParam);
- hti.pt.y = (short)HIWORD(lParam);
- ClientToScreen(hwndDlg, &hti.pt);
- ScreenToClient(GetDlgItem(hwndDlg, IDC_EXTRAORDER), &hti.pt);
- TreeView_HitTest(GetDlgItem(hwndDlg,IDC_EXTRAORDER), &hti);
- if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT)) {
- HTREEITEM it = hti.hItem;
- hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg, IDC_EXTRAORDER)) / 2;
- TreeView_HitTest(GetDlgItem(hwndDlg, IDC_EXTRAORDER), &hti);
- //TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hti.hItem,1);
- if (!(hti.flags & TVHT_ABOVE))
- TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_EXTRAORDER), hti.hItem, 1);
- else
- TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_EXTRAORDER), it, 0);
- }
- else {
- if (hti.flags & TVHT_ABOVE) SendDlgItemMessage(hwndDlg,IDC_EXTRAORDER, WM_VSCROLL, MAKEWPARAM(SB_LINEUP, 0), 0);
- if (hti.flags & TVHT_BELOW) SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, WM_VSCROLL, MAKEWPARAM(SB_LINEDOWN, 0), 0);
- TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_EXTRAORDER), NULL, 0);
- }
- }
- break;
-
- case WM_LBUTTONUP:
- if (dragging) {
- TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),NULL,0);
- dragging=0;
- ReleaseCapture();
-
- TVHITTESTINFO hti;
- TVITEM tvi;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
- ClientToScreen(hwndDlg,&hti.pt);
- ScreenToClient(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&hti.pt);
- hti.pt.y-=TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_EXTRAORDER))/2;
- TreeView_HitTest(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&hti);
- if (hDragItem==hti.hItem) break;
- if (hti.flags&TVHT_ABOVE) hti.hItem=TVI_FIRST;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=hDragItem;
- TreeView_GetItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&tvi);
- if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT)||(hti.hItem==TVI_FIRST)) {
- TVINSERTSTRUCT tvis;
- TCHAR name[128];
- tvis.item.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvis.item.stateMask=0xFFFFFFFF;
- tvis.item.pszText=name;
- tvis.item.cchTextMax=sizeof(name);
- tvis.item.hItem=hDragItem;
- tvis.item.iImage=tvis.item.iSelectedImage=((ORDERTREEDATA *)tvi.lParam)->Visible;
- TreeView_GetItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&tvis.item);
- TreeView_DeleteItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hDragItem);
- tvis.hParent=NULL;
- tvis.hInsertAfter=hti.hItem;
- TreeView_SelectItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),TreeView_InsertItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&tvis));
- SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- }
- }
- break;
- }
- return FALSE;
-}
-
static INT_PTR CALLBACK DlgProcIcons(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
DISPLAYPROFILE *p;
@@ -1145,16 +933,6 @@ static INT_PTR CALLBACK DlgProcDspProfiles(HWND hwnd, UINT msg, WPARAM wParam, L if (IS_THEMED)
API::pfnEnableThemeDialogTexture((HWND)tci.lParam, ETDT_ENABLETAB);
- if ( !ServiceExists(MS_EXTRAICON_REGISTER)) {
- tci.lParam = (LPARAM)CreateDialog(g_hInst,MAKEINTRESOURCE(IDD_OPT_XICONS), hwnd, DlgProcXIcons);
- tci.pszText = TranslateT("Extra Icons");
- TabCtrl_InsertItem(hwndTab, ++iOrder, &tci);
- MoveWindow((HWND)tci.lParam,64,25,rcClient.right-128,rcClient.bottom-67,1);
- ShowWindow((HWND)tci.lParam, oPage == iOrder ? SW_SHOW : SW_HIDE);
- if (IS_THEMED)
- API::pfnEnableThemeDialogTexture((HWND)tci.lParam, ETDT_ENABLETAB);
- }
-
tci.lParam = (LPARAM)CreateDialog(g_hInst,MAKEINTRESOURCE(IDD_OPT_DSPADVANCED), hwnd, DlgProcDspAdvanced);
tci.pszText = TranslateT("Advanced");
TabCtrl_InsertItem(hwndTab, ++iOrder, &tci);
|