summaryrefslogtreecommitdiff
path: root/plugins/TopToolBar/ttbopt.cpp
diff options
context:
space:
mode:
authorAlexey Kulakov <panda75@bk.ru>2012-06-19 20:31:00 +0000
committerAlexey Kulakov <panda75@bk.ru>2012-06-19 20:31:00 +0000
commit08bf3a1d71edaaba3bc82283e92b118b1d0be0de (patch)
tree7d056e1560938978d38e6c0da80208c4348b6910 /plugins/TopToolBar/ttbopt.cpp
parent1a9e2f536e35d52aba452f6f29a81de719c5aaf8 (diff)
TopToolBar processing
git-svn-id: http://svn.miranda-ng.org/main/trunk@489 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TopToolBar/ttbopt.cpp')
-rw-r--r--plugins/TopToolBar/ttbopt.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/plugins/TopToolBar/ttbopt.cpp b/plugins/TopToolBar/ttbopt.cpp
index 4d6ab5916d..88e2124e36 100644
--- a/plugins/TopToolBar/ttbopt.cpp
+++ b/plugins/TopToolBar/ttbopt.cpp
@@ -181,15 +181,15 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
GetDlgItemText(hwndDlg, IDC_EPATH, buf, 255);
btn->program = _tcsdup(buf);
- tvi.mask = TVIF_TEXT;
- tvi.pszText = mir_a2t( btn->name );
- TreeView_SetItem(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), &tvi);
+ tvi.mask = TVIF_TEXT;
+ tvi.pszText = mir_a2t( btn->name );
+ TreeView_SetItem(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), &tvi);
}
break;
}
if (ctrlid == IDC_ADDLBUTTON) {
- InsertLBut(-1);
+ InsertLBut(0);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
}
@@ -197,7 +197,7 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
//----- Separators -----
if (ctrlid == IDC_ADDSEP) {
- InsertSeparator(-1);
+ InsertSeparator(0);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
}
@@ -212,14 +212,10 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), &tvi);
btn = (TopButtonInt*)tvi.lParam;
- if (btn->dwFlags & TTBBF_ISSEPARATOR) {
- DeleteSeparator(btn->wParamDown);
+ // if button enabled for separator and launch only, no need condition
+ // except possible service button introducing
+ if (btn->dwFlags & (TTBBF_ISSEPARATOR | TTBBF_ISLBUTTON))
TTBRemoveButton(btn->lParamDown, 0);
- }
- else if (btn->dwFlags & TTBBF_ISLBUTTON) {
- DeleteLBut(btn->wParamDown);
- TTBRemoveButton(btn->lParamDown, 0);
- }
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
@@ -283,8 +279,13 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
EnableWindow(GetDlgItem(hwndDlg, IDC_LBUTTONSET), TRUE);
if (btn->name != NULL)
SetDlgItemTextA(hwndDlg, IDC_ENAME, btn->name);
+ else
+ SetDlgItemTextA(hwndDlg, IDC_ENAME, "");
+
if (btn->program != NULL)
SetDlgItemText(hwndDlg, IDC_EPATH, btn->program);
+ else
+ SetDlgItemTextA(hwndDlg, IDC_EPATH, "");
}
else
{