diff options
author | George Hazan <george.hazan@gmail.com> | 2015-07-27 11:00:02 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-07-27 11:00:02 +0000 |
commit | 0d289371985e2d099b0de6b8150dbb74fb416e43 (patch) | |
tree | 6f458445f16db7331d3e7e64e2c0ca5685db2d31 | |
parent | 3412f466bdafa84485bb35c6913c309d315d6a4e (diff) |
fix for a crash when a pointer gets converted to int
git-svn-id: http://svn.miranda-ng.org/main/trunk@14737 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/NewAwaySysMod/src/AwayOpt.cpp | 50 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/AwaySys.cpp | 8 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/Client.cpp | 6 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/MsgTree.cpp | 48 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/MsgTree.h | 4 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/Options.cpp | 256 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/Options.h | 335 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/Properties.cpp | 40 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/Properties.h | 30 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/SetAwayMsg.cpp | 12 | ||||
-rw-r--r-- | plugins/Sessions/Src/Main.cpp | 6 |
11 files changed, 410 insertions, 385 deletions
diff --git a/plugins/NewAwaySysMod/src/AwayOpt.cpp b/plugins/NewAwaySysMod/src/AwayOpt.cpp index d34894cf92..46be9c321a 100644 --- a/plugins/NewAwaySysMod/src/AwayOpt.cpp +++ b/plugins/NewAwaySysMod/src/AwayOpt.cpp @@ -71,20 +71,20 @@ COptPage g_MessagesOptPage(MOD_NAME, NULL); void EnableMessagesOptDlgControls(CMsgTree* MsgTree)
{
- int IsNotGroup = false;
- int Selected = false;
+ bool bIsNotGroup = false;
+ bool bSelected = false;
CBaseTreeItem *TreeItem = MsgTree->GetSelection();
if (TreeItem && !(TreeItem->Flags & TIF_ROOTITEM)) {
- IsNotGroup = !(TreeItem->Flags & TIF_GROUP);
- Selected = true;
+ bIsNotGroup = !(TreeItem->Flags & TIF_GROUP);
+ bSelected = true;
}
- g_MessagesOptPage.Enable(IDC_MESSAGEDLG_DEL, Selected);
- g_MessagesOptPage.Enable(IDC_MESSAGEDLG_MSGTITLE, Selected);
+ g_MessagesOptPage.Enable(IDC_MESSAGEDLG_DEL, bSelected);
+ g_MessagesOptPage.Enable(IDC_MESSAGEDLG_MSGTITLE, bSelected);
for (int i = 0; i < g_MessagesOptPage.Items.GetSize(); i++)
if (g_MessagesOptPage.Items[i]->GetParam() == IDC_MESSAGEDLG_MSGTREE)
- g_MessagesOptPage.Items[i]->Enable(IsNotGroup);
+ g_MessagesOptPage.Items[i]->Enable(bIsNotGroup);
- SendDlgItemMessage(g_MessagesOptPage.GetWnd(), IDC_MESSAGEDLG_MSGDATA, EM_SETREADONLY, !IsNotGroup, 0);
+ SendDlgItemMessage(g_MessagesOptPage.GetWnd(), IDC_MESSAGEDLG_MSGDATA, EM_SETREADONLY, !bIsNotGroup, 0);
g_MessagesOptPage.MemToPage(true);
}
@@ -334,10 +334,10 @@ COptPage g_MoreOptPage(MOD_NAME, NULL); void EnableMoreOptDlgControls()
{
g_MoreOptPage.Enable(IDC_MOREOPTDLG_PERSTATUSPERSONAL, g_MoreOptPage.GetWndValue(IDC_MOREOPTDLG_SAVEPERSONALMSGS) != 0);
- int Enabled = g_MoreOptPage.GetWndValue(IDC_MOREOPTDLG_RECENTMSGSCOUNT) != 0;
- g_MoreOptPage.Enable(IDC_MOREOPTDLG_PERSTATUSMRM, Enabled);
- g_MoreOptPage.Enable(IDC_MOREOPTDLG_USELASTMSG, Enabled);
- g_MoreOptPage.Enable(IDC_MOREOPTDLG_USEDEFMSG, Enabled);
+ bool bEnabled = g_MoreOptPage.GetWndValue(IDC_MOREOPTDLG_RECENTMSGSCOUNT) != 0;
+ g_MoreOptPage.Enable(IDC_MOREOPTDLG_PERSTATUSMRM, bEnabled);
+ g_MoreOptPage.Enable(IDC_MOREOPTDLG_USELASTMSG, bEnabled);
+ g_MoreOptPage.Enable(IDC_MOREOPTDLG_USEDEFMSG, bEnabled);
g_MoreOptPage.Enable(IDC_MOREOPTDLG_PERSTATUSPERSONAL, g_MoreOptPage.GetWndValue(IDC_MOREOPTDLG_SAVEPERSONALMSGS) != 0);
g_MoreOptPage.Enable(IDC_MOREOPTDLG_UPDATEMSGSPERIOD, g_MoreOptPage.GetWndValue(IDC_MOREOPTDLG_UPDATEMSGS) != 0);
InvalidateRect(GetDlgItem(g_MoreOptPage.GetWnd(), IDC_MOREOPTDLG_UPDATEMSGSPERIOD_SPIN), NULL, false); // update spin control
@@ -454,15 +454,15 @@ COptPage g_AutoreplyOptPage(MOD_NAME, NULL); void EnableAutoreplyOptDlgControls()
{
g_AutoreplyOptPage.PageToMem();
- int Autoreply = g_AutoreplyOptPage.GetValue(IDC_REPLYDLG_ENABLEREPLY) != 0;
+ bool bAutoreply = g_AutoreplyOptPage.GetValue(IDC_REPLYDLG_ENABLEREPLY) != 0;
for (int i = 0; i < g_AutoreplyOptPage.Items.GetSize(); i++) {
switch (g_AutoreplyOptPage.Items[i]->GetParam()) {
case IDC_REPLYDLG_ENABLEREPLY:
- g_AutoreplyOptPage.Items[i]->Enable(Autoreply);
+ g_AutoreplyOptPage.Items[i]->Enable(bAutoreply);
break;
case IDC_REPLYDLG_SENDCOUNT:
- g_AutoreplyOptPage.Items[i]->Enable(Autoreply && g_AutoreplyOptPage.GetValue(IDC_REPLYDLG_SENDCOUNT) > 0);
+ g_AutoreplyOptPage.Items[i]->Enable(bAutoreply && g_AutoreplyOptPage.GetValue(IDC_REPLYDLG_SENDCOUNT) > 0);
break;
}
}
@@ -543,7 +543,7 @@ INT_PTR CALLBACK AutoreplyOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l // init tooltips
struct {
- int DlgItemID;
+ int m_dlgItemID;
TCHAR *Text;
}
Tooltips[] = {
@@ -558,7 +558,7 @@ INT_PTR CALLBACK AutoreplyOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
ti.hwnd = hwndDlg;
for (int i = 0; i < _countof(Tooltips); i++) {
- ti.uId = (UINT_PTR)GetDlgItem(hwndDlg, Tooltips[i].DlgItemID);
+ ti.uId = (UINT_PTR)GetDlgItem(hwndDlg, Tooltips[i].m_dlgItemID);
ti.lpszText = TranslateTS(Tooltips[i].Text);
SendMessage(hWndTooltips, TTM_ADDTOOL, 0, (LPARAM)&ti);
}
@@ -904,27 +904,27 @@ INT_PTR CALLBACK MessagesModernOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPA static WNDPROC g_OrigContactsProc;
-__inline int DBValueToIgnoreIcon(int Value)
+__inline int DBValueToIgnoreIcon(int m_value)
{
- switch (Value) {
+ switch (m_value) {
case VAL_INDEFINITE: return EXTRAICON_INDEFINITE;
case 0: return EXTRAICON_DOT;
default: return EXTRAICON_IGNORE;
}
}
-__inline int IgnoreIconToDBValue(int Value)
+__inline int IgnoreIconToDBValue(int m_value)
{
- switch (Value) {
+ switch (m_value) {
case EXTRAICON_DOT: return 0;
case EXTRAICON_IGNORE: return 1;
default: return VAL_INDEFINITE; // EXTRAICON_INDEFINITE and 0xFF
}
}
-__inline int DBValueToOptReplyIcon(int Value)
+__inline int DBValueToOptReplyIcon(int m_value)
{
- switch (Value) {
+ switch (m_value) {
case VAL_INDEFINITE: return EXTRAICON_INDEFINITE;
case VAL_USEDEFAULT: return EXTRAICON_DOT;
case 0: return EXTRAICON_AUTOREPLYOFF;
@@ -932,9 +932,9 @@ __inline int DBValueToOptReplyIcon(int Value) }
}
-__inline int ReplyIconToDBValue(int Value)
+__inline int ReplyIconToDBValue(int m_value)
{
- switch (Value) {
+ switch (m_value) {
case EXTRAICON_DOT: return VAL_USEDEFAULT;
case EXTRAICON_AUTOREPLYOFF: return 0;
case EXTRAICON_AUTOREPLYON: return 1;
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index 12ce7b1df4..06df823b98 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -232,7 +232,7 @@ int StatusChanged(WPARAM wParam, LPARAM lParam) int i;
for (i = _countof(StatusModeList) - 1; i >= 0; i--)
- if (wParam == StatusModeList[i].Status)
+ if ((int)wParam == StatusModeList[i].Status)
break;
if (i < 0)
return 0;
@@ -524,9 +524,9 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) COptItem_TreeCtrl *TreeCtrl = (COptItem_TreeCtrl*)MsgTreeData.Find(IDV_MSGTREE);
TreeCtrl->DBToMem(CString(MOD_NAME));
- for (int i = 0; i < TreeCtrl->Value.GetSize(); i++) {
- if (!(TreeCtrl->Value[i].Flags & TIF_GROUP) && !mir_tstrcmpi(TreeCtrl->Value[i].Title, ai->targv[1])) {
- Result = TreeCtrl->Value[i].User_Str1;
+ for (int i = 0; i < TreeCtrl->m_value.GetSize(); i++) {
+ if (!(TreeCtrl->m_value[i].Flags & TIF_GROUP) && !mir_tstrcmpi(TreeCtrl->m_value[i].Title, ai->targv[1])) {
+ Result = TreeCtrl->m_value[i].User_Str1;
break;
}
}
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp index adc448b232..752e004b15 100644 --- a/plugins/NewAwaySysMod/src/Client.cpp +++ b/plugins/NewAwaySysMod/src/Client.cpp @@ -146,9 +146,9 @@ int GetRecentGroupID(int iMode) if (!g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_PERSTATUSMRM))
return g_Messages_RecentRootID;
- for (int Order = 0; Order < TreeCtrl->Value.GetSize(); Order++) // find a group named accordingly to the current status
- if (TreeCtrl->Value[Order].ParentID == g_Messages_RecentRootID && TreeCtrl->Value[Order].Flags & TIF_GROUP && !mir_tstrcmpi(TreeCtrl->Value[Order].Title, iMode ? pcli->pfnGetStatusModeDescription(iMode, 0) : MSGTREE_RECENT_OTHERGROUP))
- return TreeCtrl->Value[Order].ID;
+ for (int Order = 0; Order < TreeCtrl->m_value.GetSize(); Order++) // find a group named accordingly to the current status
+ if (TreeCtrl->m_value[Order].ParentID == g_Messages_RecentRootID && TreeCtrl->m_value[Order].Flags & TIF_GROUP && !mir_tstrcmpi(TreeCtrl->m_value[Order].Title, iMode ? pcli->pfnGetStatusModeDescription(iMode, 0) : MSGTREE_RECENT_OTHERGROUP))
+ return TreeCtrl->m_value[Order].ID;
return -1;
}
diff --git a/plugins/NewAwaySysMod/src/MsgTree.cpp b/plugins/NewAwaySysMod/src/MsgTree.cpp index 7263f8a0c6..25d5fff374 100644 --- a/plugins/NewAwaySysMod/src/MsgTree.cpp +++ b/plugins/NewAwaySysMod/src/MsgTree.cpp @@ -78,7 +78,7 @@ static LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, L int Order = TreeCtrl->hItemToOrder(pnmtv->itemNew.hItem);
_ASSERT(Order != -1);
if (Order != -1) {
- nm.ItemOld = (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->Value[Order];
+ nm.ItemOld = (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->m_value[Order];
nm.hdr.code = MTN_BEGINDRAG;
nm.hdr.hwndFrom = dat->hTreeView;
nm.hdr.idFrom = GetDlgCtrlID(dat->hTreeView);
@@ -102,13 +102,13 @@ static LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, L if (pnmtv->itemOld.hItem) {
int Order = TreeCtrl->IDToOrder(pnmtv->itemOld.lParam);
if (Order != -1) {
- nm.ItemOld = (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->Value[Order];
+ nm.ItemOld = (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->m_value[Order];
}
}
if (pnmtv->itemNew.hItem) {
int Order = TreeCtrl->IDToOrder(pnmtv->itemNew.lParam);
if (Order != -1) {
- nm.ItemNew = (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->Value[Order];
+ nm.ItemNew = (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->m_value[Order];
}
}
nm.hdr.code = MTN_SELCHANGED;
@@ -132,10 +132,10 @@ static LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, L COptItem_TreeCtrl *TreeCtrl = dat->GetTreeCtrl();
int Order = TreeCtrl->IDToOrder(ptvdi->item.lParam);
if (Order >= 0) {
- TreeCtrl->Value[Order].Title = ptvdi->item.pszText;
+ TreeCtrl->m_value[Order].Title = ptvdi->item.pszText;
TreeCtrl->SetModified(true);
NMMSGTREE nm = { 0 };
- nm.ItemNew = &TreeCtrl->Value[Order];
+ nm.ItemNew = &TreeCtrl->m_value[Order];
nm.hdr.code = MTN_ITEMRENAMED;
nm.hdr.hwndFrom = dat->hTreeView;
nm.hdr.idFrom = GetDlgCtrlID(dat->hTreeView);
@@ -226,8 +226,8 @@ static LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, L int OrderOld = TreeCtrl->hItemToOrder(dat->hDragItem);
int OrderNew = TreeCtrl->hItemToOrder(hti.hItem);
_ASSERT(OrderOld != -1 && OrderNew != -1);
- nm.ItemOld = (OrderOld <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(OrderOld)] : (CBaseTreeItem*)&TreeCtrl->Value[OrderOld];
- nm.ItemNew = (OrderNew <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(OrderNew)] : (CBaseTreeItem*)&TreeCtrl->Value[OrderNew];
+ nm.ItemOld = (OrderOld <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(OrderOld)] : (CBaseTreeItem*)&TreeCtrl->m_value[OrderOld];
+ nm.ItemNew = (OrderNew <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(OrderNew)] : (CBaseTreeItem*)&TreeCtrl->m_value[OrderNew];
nm.hdr.code = MTN_ENDDRAG;
nm.hdr.hwndFrom = dat->hTreeView;
nm.hdr.idFrom = GetDlgCtrlID(dat->hTreeView);
@@ -262,9 +262,9 @@ LRESULT CALLBACK MsgTreeSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM switch (Msg) {
case UM_MSGTREE_UPDATE: // returns TRUE if updated
{
- bool Modified = dat->MsgTreePage.GetModified();
+ bool m_bModified = dat->MsgTreePage.GetModified();
TCString WndTitle;
- if (Modified) {
+ if (m_bModified) {
WndTitle.GetBuffer(256);
HWND hCurWnd = hWnd;
do {
@@ -272,12 +272,12 @@ LRESULT CALLBACK MsgTreeSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM } while (hCurWnd && !GetWindowText(hCurWnd, WndTitle, 256));
WndTitle.ReleaseBuffer();
}
- if (!Modified || MessageBox(GetParent(hWnd), TCString(TranslateT("You've made changes to multiple message trees at a time.\r\nDo you want to leave changes in \"")) + WndTitle + TranslateT("\" dialog?\r\nPress Yes to leave changes in this dialog, or No to discard its changes and save changes of the other message tree instead."), WndTitle + _T(" - ") + TranslateT("New Away System"), MB_ICONQUESTION | MB_YESNO) == IDNO) {
+ if (!m_bModified || MessageBox(GetParent(hWnd), TCString(TranslateT("You've made changes to multiple message trees at a time.\r\nDo you want to leave changes in \"")) + WndTitle + TranslateT("\" dialog?\r\nPress Yes to leave changes in this dialog, or No to discard its changes and save changes of the other message tree instead."), WndTitle + _T(" - ") + TranslateT("New Away System"), MB_ICONQUESTION | MB_YESNO) == IDNO) {
COptItem_TreeCtrl *TreeCtrl = dat->GetTreeCtrl();
TCString OldTitle, OldMsg, NewTitle, NewMsg;
int OldOrder = TreeCtrl->IDToOrder(TreeCtrl->GetSelectedItemID(GetParent(hWnd)));
if (OldOrder != -1) {
- CBaseTreeItem* ItemOld = (OldOrder <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(OldOrder)] : (CBaseTreeItem*)&TreeCtrl->Value[OldOrder];
+ CBaseTreeItem* ItemOld = (OldOrder <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(OldOrder)] : (CBaseTreeItem*)&TreeCtrl->m_value[OldOrder];
OldTitle = ItemOld->Title;
if (!(ItemOld->Flags & TIF_ROOTITEM))
OldMsg = ((CTreeItem*)ItemOld)->User_Str1;
@@ -288,7 +288,7 @@ LRESULT CALLBACK MsgTreeSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM NMMSGTREE nm = { 0 };
int Order = TreeCtrl->IDToOrder(TreeCtrl->GetSelectedItemID(GetParent(hWnd)));
if (Order != -1) {
- nm.ItemNew = (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->Value[Order];
+ nm.ItemNew = (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->m_value[Order];
NewTitle = nm.ItemNew->Title;
if (!(nm.ItemNew->Flags & TIF_ROOTITEM))
NewMsg = ((CTreeItem*)nm.ItemNew)->User_Str1;
@@ -368,7 +368,7 @@ LRESULT CALLBACK MsgTreeSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM int Order = TreeCtrl->IDToOrder(tvi.lParam);
if (Order >= 0) {
HMENU hMenu;
- if (TreeCtrl->Value[Order].Flags & TIF_GROUP)
+ if (TreeCtrl->m_value[Order].Flags & TIF_GROUP)
hMenu = LoadMenu(g_hInstance, MAKEINTRESOURCE(IDR_MSGTREE_CATEGORYMENU));
else
hMenu = LoadMenu(g_hInstance, MAKEINTRESOURCE(IDR_MSGTREE_MESSAGEMENU));
@@ -397,7 +397,7 @@ LRESULT CALLBACK MsgTreeSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM mii.fMask = MIIM_STATE;
mii.fState = MFS_CHECKED;
for (int i = 0; i < _countof(SettingsList); i++) // set checkmarks
- if (TreeCtrl->Value[Order].ID == (int)dat->MsgTreePage.GetValue(SettingsList[i].DBSetting))
+ if (TreeCtrl->m_value[Order].ID == (int)dat->MsgTreePage.GetValue(SettingsList[i].DBSetting))
SetMenuItemInfo(hPopupMenu, SettingsList[i].MenuItemID, false, &mii);
int MenuResult = TrackPopupMenu(hPopupMenu, TPM_RIGHTBUTTON | TPM_RETURNCMD, ht.pt.x, ht.pt.y, 0, hWnd, NULL);
@@ -496,7 +496,7 @@ CBaseTreeItem* CMsgTree::GetSelection() // returns NULL if there's nothing selec int Order = TreeCtrl->IDToOrder(TreeCtrl->GetSelectedItemID(GetParent(hTreeView)));
if (Order == -1)
return NULL;
- return (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->Value[Order];
+ return (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->m_value[Order];
}
bool CMsgTree::SetSelection(int ID, int Flags) // set ID = -1 to unselect; returns TRUE on unselect and on successful select
@@ -506,7 +506,7 @@ bool CMsgTree::SetSelection(int ID, int Flags) // set ID = -1 to unselect; retur if (Order == -1 && ID != -1)
return false;
- TreeView_SelectItem(hTreeView, (Order == -1) ? NULL : ((Order <= TREECTRL_ROOTORDEROFFS) ? TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)].hItem : TreeCtrl->Value[Order].hItem));
+ TreeView_SelectItem(hTreeView, (Order == -1) ? NULL : ((Order <= TREECTRL_ROOTORDEROFFS) ? TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)].hItem : TreeCtrl->m_value[Order].hItem));
return true;
}
@@ -527,19 +527,19 @@ void CMsgTree::SetDefMsg(int iMode, int ID) RECT rc;
COptItem_TreeCtrl *TreeCtrl = GetTreeCtrl();
int OrderOld = TreeCtrl->IDToOrder((int)MsgTreePage.GetValue(SettingsList[i].DBSetting));
- if (OrderOld >= 0 && TreeView_GetItemRect(hTreeView, TreeCtrl->Value[OrderOld].hItem, &rc, false))
+ if (OrderOld >= 0 && TreeView_GetItemRect(hTreeView, TreeCtrl->m_value[OrderOld].hItem, &rc, false))
InvalidateRect(hTreeView, &rc, true); // refresh icons of previous default tree item
int OrderNew = TreeCtrl->IDToOrder(ID);
- if (OrderNew >= 0 && TreeView_GetItemRect(hTreeView, TreeCtrl->Value[OrderNew].hItem, &rc, false))
+ if (OrderNew >= 0 && TreeView_GetItemRect(hTreeView, TreeCtrl->m_value[OrderNew].hItem, &rc, false))
InvalidateRect(hTreeView, &rc, true); // refresh new default item icons
MsgTreePage.SetValue(SettingsList[i].DBSetting, ID);
NMMSGTREE nm = { 0 };
if (OrderOld >= 0)
- nm.ItemOld = &TreeCtrl->Value[OrderOld];
+ nm.ItemOld = &TreeCtrl->m_value[OrderOld];
if (OrderNew >= 0)
- nm.ItemNew = &TreeCtrl->Value[OrderNew];
+ nm.ItemNew = &TreeCtrl->m_value[OrderNew];
nm.hdr.code = MTN_DEFMSGCHANGED;
nm.hdr.hwndFrom = hTreeView;
nm.hdr.idFrom = GetDlgCtrlID(hTreeView);
@@ -563,7 +563,7 @@ void CMsgTree::UpdateItem(int ID) // updates item title, and expanded/collapsed COptItem_TreeCtrl *TreeCtrl = GetTreeCtrl();
int Order = TreeCtrl->IDToOrder(ID);
if (Order != -1) {
- CBaseTreeItem* TreeItem = (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->Value[Order];
+ CBaseTreeItem* TreeItem = (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->m_value[Order];
TCString NewTitle;
TVITEM tvi;
tvi.mask = TVIF_HANDLE | TVIF_TEXT;
@@ -592,7 +592,7 @@ bool CMsgTree::DeleteSelectedItem() // returns true if the item was deleted COptItem_TreeCtrl *TreeCtrl = GetTreeCtrl();
int Order = TreeCtrl->IDToOrder(TreeCtrl->GetSelectedItemID(GetParent(hTreeView)));
_ASSERT(Order >= 0);
- CTreeItem *SelectedItem = &TreeCtrl->Value[Order];
+ CTreeItem *SelectedItem = &TreeCtrl->m_value[Order];
//NightFox: fix for langpack and fix cut char space in text
if (MessageBox(GetParent(hTreeView),
@@ -658,7 +658,7 @@ CBaseTreeItem* CMsgTree::GetNextItem(int Flags, CBaseTreeItem *Item) // Item is if (Flags & MTGN_BYID) {
int Order = TreeCtrl->IDToOrder((int)Item);
_ASSERT(Order != -1);
- TreeItem = (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->Value[Order];
+ TreeItem = (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->m_value[Order];
}
int TVFlag = 0;
@@ -675,5 +675,5 @@ CBaseTreeItem* CMsgTree::GetNextItem(int Flags, CBaseTreeItem *Item) // Item is if (Order == -1)
return NULL;
- return (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->Value[Order];
+ return (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->m_value[Order];
}
diff --git a/plugins/NewAwaySysMod/src/MsgTree.h b/plugins/NewAwaySysMod/src/MsgTree.h index 98b2f9d6cc..2462880811 100644 --- a/plugins/NewAwaySysMod/src/MsgTree.h +++ b/plugins/NewAwaySysMod/src/MsgTree.h @@ -32,14 +32,14 @@ public: int GetDefMsg(int iMode);
void SetDefMsg(int iMode, int ID);
void Save();
- void UpdateItem(int ID); // updates item title, and expanded/collapsed state for groups; set SetModified to TRUE to change Modified flag of the tree
+ void UpdateItem(int ID); // updates item title, and expanded/collapsed state for groups; set SetModified to TRUE to change m_bModified flag of the tree
bool DeleteSelectedItem(); // returns true if the item was deleted
CTreeItem* AddCategory();
CTreeItem* AddMessage();
CBaseTreeItem* GetNextItem(int Flags, CBaseTreeItem* Item); // Item is 'int ID' if MTGN_BYID flag is set; returns CBaseTreeItem* or NULL
void EnsureVisible(HTREEITEM hItem) {TreeView_EnsureVisible(hTreeView, hItem);}
bool GetModified() {return MsgTreePage.GetModified();}
- void SetModified(bool Modified) {MsgTreePage.SetModified(Modified);}
+ void SetModified(bool m_bModified) {MsgTreePage.SetModified(m_bModified);}
friend LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
friend LRESULT CALLBACK MsgTreeSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/NewAwaySysMod/src/Options.cpp b/plugins/NewAwaySysMod/src/Options.cpp index 3bdb0d2660..c6209078f9 100644 --- a/plugins/NewAwaySysMod/src/Options.cpp +++ b/plugins/NewAwaySysMod/src/Options.cpp @@ -84,17 +84,17 @@ bool COptPage::GetModified() return false;
}
-void COptPage::SetModified(bool Modified)
+void COptPage::SetModified(bool m_bModified)
{
_ASSERT(sModule != "");
for (int i = 0; i < Items.GetSize(); i++)
- Items[i]->SetModified(Modified);
+ Items[i]->SetModified(m_bModified);
}
-COptItem *COptPage::Find(int DlgItemID)
+COptItem *COptPage::Find(int m_dlgItemID)
{
for (int i = 0; i < Items.GetSize(); i++)
- if (Items[i]->GetID() == DlgItemID)
+ if (Items[i]->GetID() == m_dlgItemID)
return Items[i];
_ASSERT(0);
@@ -127,14 +127,14 @@ int COptItem::GetIntDBVal(const CString &sModule, int bSigned, CString*) return (int)GetDefValue();
}
-void COptItem::SetIntDBVal(const CString &sModule, int Value, CString*)
+void COptItem::SetIntDBVal(const CString &sModule, int m_value, CString*)
{ // default procedure for writing value to the DB; used only for integral types
- if (sDBSetting != NULL && !ReadOnly) {
+ if (sDBSetting != NULL && !m_bReadOnly) {
_ASSERT(nValueSize == DBVT_BYTE || nValueSize == DBVT_WORD || nValueSize == DBVT_DWORD);
DBVARIANT dbv;
dbv.type = nValueSize;
- dbv.dVal = Value;
+ dbv.dVal = m_value;
db_set(NULL, sModule, sDBSetting, &dbv);
}
}
@@ -150,67 +150,67 @@ TCString COptItem::GetStrDBVal(const CString &sModule, CString *sDBSettingPrefix void COptItem::SetStrDBVal(const CString &sModule, TCString &Str, CString *sDBSettingPrefix)
{
- if (sDBSetting != NULL && !ReadOnly) {
+ if (sDBSetting != NULL && !m_bReadOnly) {
db_set_ts(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting, Str);
}
}
void COptItem_Checkbox::DBToMem(const CString &sModule, CString *sDBSettingPrefix)
{
- if (ValueMask)
- Value = (GetIntDBVal(sModule, false, sDBSettingPrefix) & ValueMask) ? BST_CHECKED : BST_UNCHECKED;
+ if (m_valueMask)
+ m_value = (GetIntDBVal(sModule, false, sDBSettingPrefix) & m_valueMask) ? BST_CHECKED : BST_UNCHECKED;
else
- Value = GetIntDBVal(sModule, false, sDBSettingPrefix);
+ m_value = GetIntDBVal(sModule, false, sDBSettingPrefix);
COptItem::DBToMem(sModule, sDBSettingPrefix);
}
void COptItem_Checkbox::MemToDB(const CString &sModule, CString *sDBSettingPrefix)
{
- if (ValueMask) {
- if (Value == BST_CHECKED)
- SetIntDBVal(sModule, GetIntDBVal(sModule, false, sDBSettingPrefix) | ValueMask, sDBSettingPrefix);
+ if (m_valueMask) {
+ if (m_value == BST_CHECKED)
+ SetIntDBVal(sModule, GetIntDBVal(sModule, false, sDBSettingPrefix) | m_valueMask, sDBSettingPrefix);
else
- SetIntDBVal(sModule, GetIntDBVal(sModule, false, sDBSettingPrefix) & ~ValueMask, sDBSettingPrefix);
+ SetIntDBVal(sModule, GetIntDBVal(sModule, false, sDBSettingPrefix) & ~m_valueMask, sDBSettingPrefix);
}
- else SetIntDBVal(sModule, Value, sDBSettingPrefix);
+ else SetIntDBVal(sModule, m_value, sDBSettingPrefix);
COptItem::MemToDB(sModule, sDBSettingPrefix);
}
void COptItem_Checkbox::WndToMem(HWND hWnd)
{
- Value = IsDlgButtonChecked(hWnd, DlgItemID);
- // tri-state checkboxes in combination with ValueMask != 0 are not supported ;)
- _ASSERT(!ValueMask || Value != BST_INDETERMINATE);
+ m_value = IsDlgButtonChecked(hWnd, m_dlgItemID);
+ // tri-state checkboxes in combination with m_valueMask != 0 are not supported ;)
+ _ASSERT(!m_valueMask || m_value != BST_INDETERMINATE);
COptItem::WndToMem(hWnd);
}
void COptItem_Checkbox::MemToWnd(HWND hWnd)
{
- CheckDlgButton(hWnd, DlgItemID, Value ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, m_dlgItemID, m_value ? BST_CHECKED : BST_UNCHECKED);
COptItem::MemToWnd(hWnd);
}
void COptItem_BitDBSetting::DBToMem(const CString &sModule, CString *sDBSettingPrefix)
{
- if (ValueMask)
- Value = (GetIntDBVal(sModule, false, sDBSettingPrefix) & ValueMask) != 0;
+ if (m_valueMask)
+ m_value = (GetIntDBVal(sModule, false, sDBSettingPrefix) & m_valueMask) != 0;
else
- Value = GetIntDBVal(sModule, false, sDBSettingPrefix);
+ m_value = GetIntDBVal(sModule, false, sDBSettingPrefix);
COptItem::DBToMem(sModule, sDBSettingPrefix);
}
void COptItem_BitDBSetting::MemToDB(const CString &sModule, CString *sDBSettingPrefix)
{
- if (ValueMask) {
- if (Value)
- SetIntDBVal(sModule, GetIntDBVal(sModule, false, sDBSettingPrefix) | ValueMask, sDBSettingPrefix);
+ if (m_valueMask) {
+ if (m_value)
+ SetIntDBVal(sModule, GetIntDBVal(sModule, false, sDBSettingPrefix) | m_valueMask, sDBSettingPrefix);
else
- SetIntDBVal(sModule, GetIntDBVal(sModule, false, sDBSettingPrefix) & ~ValueMask, sDBSettingPrefix);
+ SetIntDBVal(sModule, GetIntDBVal(sModule, false, sDBSettingPrefix) & ~m_valueMask, sDBSettingPrefix);
}
- else SetIntDBVal(sModule, Value, sDBSettingPrefix);
+ else SetIntDBVal(sModule, m_value, sDBSettingPrefix);
COptItem::MemToDB(sModule, sDBSettingPrefix);
}
@@ -224,8 +224,8 @@ int COptItem_TreeCtrl::IDToOrder(int ID) if (RootItems[i].ID == ID)
return ROOT_INDEX_TO_ORDER(i);
- for (int i = 0; i < Value.GetSize(); i++)
- if (Value[i].ID == ID)
+ for (int i = 0; i < m_value.GetSize(); i++)
+ if (m_value[i].ID == ID)
return i;
return -1;
@@ -237,8 +237,8 @@ int COptItem_TreeCtrl::hItemToOrder(HTREEITEM hItem) if (RootItems[i].hItem == hItem)
return ROOT_INDEX_TO_ORDER(i);
- for (int i = 0; i < Value.GetSize(); i++)
- if (Value[i].hItem == hItem)
+ for (int i = 0; i < m_value.GetSize(); i++)
+ if (m_value[i].hItem == hItem)
return i;
return -1;
@@ -278,7 +278,7 @@ int TreeReadEnum(const char *szSetting, LPARAM lParam) char Flags = (pData->TreeCtrl->TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL && !(pData->TreeCtrl->TreeFlags & TREECTRL_FLAG_HAS_CHECKBOXES)) ? 0 : db_get_b(NULL, pData->sModule,
pData->sDBSettingPrefix + pData->TreeCtrl->sDBSetting + TREEITEM_DBSTR_FLAGS + (szSetting + Len), 0);
if (ParentID >= 0 && Order >= 0) {
- CTreeItem &pItem = pData->TreeCtrl->Value.SetAtGrow(Order);
+ CTreeItem &pItem = pData->TreeCtrl->m_value.SetAtGrow(Order);
pItem.ID = ID;
pItem.ParentID = ParentID;
pItem.Flags = Flags;
@@ -297,7 +297,7 @@ void COptItem_TreeCtrl::DBToMem(const CString &sModule, CString *sDBSettingPrefi if (!sDBSettingPrefix)
sDBSettingPrefix = &sEmptyString;
- Value.RemoveAll();
+ m_value.RemoveAll();
sTreeReadEnumData pData(this, sModule, *sDBSettingPrefix);
DBCONTACTENUMSETTINGS dbEnum;
@@ -306,13 +306,13 @@ void COptItem_TreeCtrl::DBToMem(const CString &sModule, CString *sDBSettingPrefi dbEnum.pfnEnumProc = TreeReadEnum;
dbEnum.szModule = sModule;
CallService(MS_DB_CONTACT_ENUMSETTINGS, NULL, (LPARAM)&dbEnum);
- if (!Value.GetSize()) {
- Value = DefValue;
+ if (!m_value.GetSize()) {
+ m_value = m_defValue;
}
else {
- for (int i = 0; i < Value.GetSize(); i++) {
- if (Value[i].Title == NULL) {
- Value.RemoveElem(i);
+ for (int i = 0; i < m_value.GetSize(); i++) {
+ if (m_value[i].Title == NULL) {
+ m_value.RemoveElem(i);
i--;
}
}
@@ -322,25 +322,25 @@ void COptItem_TreeCtrl::DBToMem(const CString &sModule, CString *sDBSettingPrefi void COptItem_TreeCtrl::MemToDB(const CString &sModule, CString *sDBSettingPrefix)
{
- if (!ReadOnly && Modified) {
+ if (!m_bReadOnly && m_bModified) {
if (!sDBSettingPrefix)
sDBSettingPrefix = &sEmptyString;
CleanDBSettings(sModule, sDBSettingPrefix);
- for (int i = 0; i < Value.GetSize(); i++) {
+ for (int i = 0; i < m_value.GetSize(); i++) {
CString StrID;
- _itoa(Value[i].ID, StrID.GetBuffer(64), 10);
+ _itoa(m_value[i].ID, StrID.GetBuffer(64), 10);
StrID.ReleaseBuffer();
- db_set_ts(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_TITLE + StrID, Value[i].Title);
+ db_set_ts(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_TITLE + StrID, m_value[i].Title);
if (!(TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL))
- db_set_w(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_PARENT + StrID, Value[i].ParentID);
+ db_set_w(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_PARENT + StrID, m_value[i].ParentID);
db_set_w(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_ORDER + StrID, i);
if (!(TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL) || TreeFlags & TREECTRL_FLAG_HAS_CHECKBOXES)
- db_set_b(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_FLAGS + StrID, Value[i].Flags);
+ db_set_b(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_FLAGS + StrID, m_value[i].Flags);
- if (User_Str1_DBName != NULL && Value[i].User_Str1 != NULL)
- db_set_ts(NULL, sModule, *sDBSettingPrefix + sDBSetting + User_Str1_DBName + StrID, Value[i].User_Str1);
+ if (User_Str1_DBName != NULL && m_value[i].User_Str1 != NULL)
+ db_set_ts(NULL, sModule, *sDBSettingPrefix + sDBSetting + User_Str1_DBName + StrID, m_value[i].User_Str1);
}
COptItem::MemToDB(sModule, sDBSettingPrefix);
}
@@ -348,29 +348,29 @@ void COptItem_TreeCtrl::MemToDB(const CString &sModule, CString *sDBSettingPrefi void COptItem_TreeCtrl::WndToMem(HWND hWnd)
{ // only need to gather info of items state (expanded/collapsed, checked/unchecked)
- HWND hTreeView = GetDlgItem(hWnd, DlgItemID);
- for (int i = 0; i < Value.GetSize(); i++) {
- DWORD State = TreeView_GetItemState(hTreeView, Value[i].hItem, TVIS_EXPANDED | TVIS_STATEIMAGEMASK);
- int OldFlags = Value[i].Flags;
+ HWND hTreeView = GetDlgItem(hWnd, m_dlgItemID);
+ for (int i = 0; i < m_value.GetSize(); i++) {
+ DWORD State = TreeView_GetItemState(hTreeView, m_value[i].hItem, TVIS_EXPANDED | TVIS_STATEIMAGEMASK);
+ int OldFlags = m_value[i].Flags;
if (State & TVIS_EXPANDED)
- Value[i].Flags |= TIF_EXPANDED;
+ m_value[i].Flags |= TIF_EXPANDED;
else
- Value[i].Flags &= ~TIF_EXPANDED;
+ m_value[i].Flags &= ~TIF_EXPANDED;
if (TreeFlags & TREECTRL_FLAG_HAS_CHECKBOXES && (State >> 12) - 1)
- Value[i].Flags |= TIF_ENABLED;
+ m_value[i].Flags |= TIF_ENABLED;
else
- Value[i].Flags &= ~TIF_ENABLED;
+ m_value[i].Flags &= ~TIF_ENABLED;
- if (Value[i].Flags != OldFlags)
- Modified = true;
+ if (m_value[i].Flags != OldFlags)
+ m_bModified = true;
}
COptItem::WndToMem(hWnd);
}
void COptItem_TreeCtrl::MemToWnd(HWND hWnd)
{
- HWND hTreeView = GetDlgItem(hWnd, DlgItemID);
+ HWND hTreeView = GetDlgItem(hWnd, m_dlgItemID);
if (TreeFlags & TREECTRL_FLAG_HAS_CHECKBOXES) { // have to set this in run-time as it's specified in MSDN
LONG_PTR Style = GetWindowLongPtr(hTreeView, GWL_STYLE);
SetWindowLongPtr(hTreeView, GWL_STYLE, Style & ~TVS_CHECKBOXES);
@@ -396,30 +396,30 @@ void COptItem_TreeCtrl::MemToWnd(HWND hWnd) RootItems[i].hItem = TreeView_InsertItem(hTreeView, &tvIn);
}
}
- for (int i = 0; i < Value.GetSize(); i++)
- Value[i].hItem = RootItems[0].hItem; // put an item to first group in case of some strange error
+ for (int i = 0; i < m_value.GetSize(); i++)
+ m_value[i].hItem = RootItems[0].hItem; // put an item to first group in case of some strange error
- for (int i = 0; i < Value.GetSize(); i++) {
+ for (int i = 0; i < m_value.GetSize(); i++) {
tvIn.item.mask = TVIF_TEXT | TVIF_STATE | TVIF_PARAM;
- tvIn.item.state = tvIn.item.stateMask = (Value[i].Flags & TIF_GROUP) ? (TVIS_BOLD | ((Value[i].Flags & TIF_EXPANDED) ? TVIS_EXPANDED : 0)) : 0;
+ tvIn.item.state = tvIn.item.stateMask = (m_value[i].Flags & TIF_GROUP) ? (TVIS_BOLD | ((m_value[i].Flags & TIF_EXPANDED) ? TVIS_EXPANDED : 0)) : 0;
if (TreeFlags & TREECTRL_FLAG_HAS_CHECKBOXES) {
tvIn.item.stateMask |= TVIS_STATEIMAGEMASK;
- tvIn.item.state |= INDEXTOSTATEIMAGEMASK((Value[i].Flags & TIF_ENABLED) ? 2 : 1);
+ tvIn.item.state |= INDEXTOSTATEIMAGEMASK((m_value[i].Flags & TIF_ENABLED) ? 2 : 1);
}
- tvIn.item.pszText = Value[i].Title;
- int Order = IDToOrder(Value[i].ParentID);
+ tvIn.item.pszText = m_value[i].Title;
+ int Order = IDToOrder(m_value[i].ParentID);
if (Order != -1) {
- tvIn.hParent = (Order <= TREECTRL_ROOTORDEROFFS) ? RootItems[ROOT_ORDER_TO_INDEX(Order)].hItem : Value[Order].hItem;
+ tvIn.hParent = (Order <= TREECTRL_ROOTORDEROFFS) ? RootItems[ROOT_ORDER_TO_INDEX(Order)].hItem : m_value[Order].hItem;
tvIn.hInsertAfter = TVI_LAST;
- tvIn.item.lParam = Value[i].ID;
- Value[i].hItem = TreeView_InsertItem(hTreeView, &tvIn);
+ tvIn.item.lParam = m_value[i].ID;
+ m_value[i].hItem = TreeView_InsertItem(hTreeView, &tvIn);
}
else { // found an orphan item; probably it's better just to delete it
- Value.RemoveElem(i);
+ m_value.RemoveElem(i);
i--;
}
}
- TreeView_SelectItem(hTreeView, (SelectOrder >= 0) ? Value[SelectOrder].hItem : ((SelectOrder <= TREECTRL_ROOTORDEROFFS) ? RootItems[ROOT_ORDER_TO_INDEX(SelectOrder)].hItem : NULL));
+ TreeView_SelectItem(hTreeView, (SelectOrder >= 0) ? m_value[SelectOrder].hItem : ((SelectOrder <= TREECTRL_ROOTORDEROFFS) ? RootItems[ROOT_ORDER_TO_INDEX(SelectOrder)].hItem : NULL));
SendMessage(hTreeView, WM_SETREDRAW, true, 0);
SCROLLBARINFO sbi;
sbi.cbSize = sizeof(sbi);
@@ -494,7 +494,7 @@ void COptItem_TreeCtrl::CleanDBSettings(const CString &sModule, CString *sDBSett int COptItem_TreeCtrl::GetSelectedItemID(HWND hWnd)
{
- HWND hTreeView = GetDlgItem(hWnd, DlgItemID);
+ HWND hTreeView = GetDlgItem(hWnd, m_dlgItemID);
TVITEM tvi = { 0 };
tvi.hItem = TreeView_GetSelection(hTreeView);
if (!tvi.hItem)
@@ -510,19 +510,19 @@ void COptItem_TreeCtrl::Delete(HWND hWnd, int ID) int SelectedOrder = IDToOrder(ID);
_ASSERT(SelectedOrder >= 0);
RecursiveDelete(hWnd, SelectedOrder);
- Modified = true;
+ m_bModified = true;
}
void COptItem_TreeCtrl::RecursiveDelete(HWND hWnd, int i)
{
- if (Value[i].Flags & TIF_GROUP)
- for (int j = i + 1; j < Value.GetSize(); j++)
- if (Value[j].ParentID == Value[i].ID)
+ if (m_value[i].Flags & TIF_GROUP)
+ for (int j = i + 1; j < m_value.GetSize(); j++)
+ if (m_value[j].ParentID == m_value[i].ID)
RecursiveDelete(hWnd, j--);
- HWND hTreeView = GetDlgItem(hWnd, DlgItemID);
- TreeView_DeleteItem(hTreeView, Value[i].hItem);
- Value.RemoveElem(i);
+ HWND hTreeView = GetDlgItem(hWnd, m_dlgItemID);
+ TreeView_DeleteItem(hTreeView, m_value[i].hItem);
+ m_value.RemoveElem(i);
}
CTreeItem* COptItem_TreeCtrl::InsertItem(HWND hWnd, CTreeItem &Item)
@@ -530,7 +530,7 @@ CTreeItem* COptItem_TreeCtrl::InsertItem(HWND hWnd, CTreeItem &Item) // returns a pointer to the newly inserted item info
{
_ASSERT(!(TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL) || !(Item.Flags & TIF_GROUP));
- HWND hTreeView = GetDlgItem(hWnd, DlgItemID);
+ HWND hTreeView = GetDlgItem(hWnd, m_dlgItemID);
TVITEM tvi;
int SelOrder = -1;
Item.ParentID = RootItems[0].ID;
@@ -547,15 +547,15 @@ CTreeItem* COptItem_TreeCtrl::InsertItem(HWND hWnd, CTreeItem &Item) SelOrder = -1;
}
else {
- if (Value[SelOrder].Flags & TIF_GROUP) {
- Item.ParentID = Value[SelOrder].ID;
- tvIn.hParent = Value[SelOrder].hItem;
+ if (m_value[SelOrder].Flags & TIF_GROUP) {
+ Item.ParentID = m_value[SelOrder].ID;
+ tvIn.hParent = m_value[SelOrder].hItem;
}
else {
- Item.ParentID = Value[SelOrder].ParentID;
- int Order = IDToOrder(Value[SelOrder].ParentID);
- tvIn.hParent = (Order <= TREECTRL_ROOTORDEROFFS) ? RootItems[ROOT_ORDER_TO_INDEX(Order)].hItem : Value[Order].hItem;
- tvIn.hInsertAfter = Value[SelOrder].hItem;
+ Item.ParentID = m_value[SelOrder].ParentID;
+ int Order = IDToOrder(m_value[SelOrder].ParentID);
+ tvIn.hParent = (Order <= TREECTRL_ROOTORDEROFFS) ? RootItems[ROOT_ORDER_TO_INDEX(Order)].hItem : m_value[Order].hItem;
+ tvIn.hInsertAfter = m_value[SelOrder].hItem;
}
}
}
@@ -567,11 +567,11 @@ CTreeItem* COptItem_TreeCtrl::InsertItem(HWND hWnd, CTreeItem &Item) }
tvIn.item.pszText = Item.Title;
tvIn.item.lParam = Item.ID = GenerateID();
- Value.InsertElem(Item, SelOrder + 1);
- Value[SelOrder + 1].hItem = TreeView_InsertItem(hTreeView, &tvIn);
- TreeView_SelectItem(hTreeView, Value[SelOrder + 1].hItem);
- Modified = true;
- return &Value[SelOrder + 1];
+ m_value.InsertElem(Item, SelOrder + 1);
+ m_value[SelOrder + 1].hItem = TreeView_InsertItem(hTreeView, &tvIn);
+ TreeView_SelectItem(hTreeView, m_value[SelOrder + 1].hItem);
+ m_bModified = true;
+ return &m_value[SelOrder + 1];
}
int COptItem_TreeCtrl::RecursiveMove(int ItemOrder, int ParentID, int InsertAtOrder)
@@ -579,12 +579,12 @@ int COptItem_TreeCtrl::RecursiveMove(int ItemOrder, int ParentID, int InsertAtOr // InsertAtOrder must be >= 0 too.
{
int ItemsMoved = 1;
- Value.MoveElem(ItemOrder, InsertAtOrder);
- Value[InsertAtOrder].ParentID = ParentID;
- if (Value[InsertAtOrder].Flags & TIF_GROUP) { // need to ensure that no items were left before their group by an order.
- int GroupID = Value[InsertAtOrder].ID;
+ m_value.MoveElem(ItemOrder, InsertAtOrder);
+ m_value[InsertAtOrder].ParentID = ParentID;
+ if (m_value[InsertAtOrder].Flags & TIF_GROUP) { // need to ensure that no items were left before their group by an order.
+ int GroupID = m_value[InsertAtOrder].ID;
for (int i = ItemOrder; i < InsertAtOrder; i++) { // if ItemOrder > InsertAtOrder then there is simply nothing to do
- if (Value[i].ParentID == GroupID) {
+ if (m_value[i].ParentID == GroupID) {
int CurrentItemsMoved = RecursiveMove(i, GroupID, InsertAtOrder);
ItemsMoved += CurrentItemsMoved;
InsertAtOrder -= CurrentItemsMoved;
@@ -601,7 +601,7 @@ void COptItem_TreeCtrl::MoveItem(HWND hWnd, HTREEITEM hItem, HTREEITEM hMoveTo) if (hItem == hMoveTo)
return;
- HWND hTreeView = GetDlgItem(hWnd, DlgItemID);
+ HWND hTreeView = GetDlgItem(hWnd, m_dlgItemID);
TVITEM tvi;
tvi.mask = TVIF_HANDLE | TVIF_PARAM;
tvi.hItem = hItem;
@@ -620,23 +620,23 @@ void COptItem_TreeCtrl::MoveItem(HWND hWnd, HTREEITEM hItem, HTREEITEM hMoveTo) if (ItemOrder <= TREECTRL_ROOTORDEROFFS)
return; // can't move root items
- if (Value[ItemOrder].Flags & TIF_GROUP) { // need to check for a case when trying to move a group to its own subgroup.
+ if (m_value[ItemOrder].Flags & TIF_GROUP) { // need to check for a case when trying to move a group to its own subgroup.
int Order = MoveToOrder;
while (Order >= 0) {
- Order = IDToOrder(Value[Order].ParentID);
+ Order = IDToOrder(m_value[Order].ParentID);
if (Order == ItemOrder)
return;
}
}
// well, everything is ok, we really can move that item.
WndToMem(hWnd); // save groups state (expanded/collapsed)
- if (MoveToOrder != -1 && ((MoveToOrder <= TREECTRL_ROOTORDEROFFS) ? RootItems[ROOT_ORDER_TO_INDEX(MoveToOrder)].Flags : Value[MoveToOrder].Flags) & TIF_GROUP) // if the destination is a group, then move the item to that group
- RecursiveMove(ItemOrder, (MoveToOrder <= TREECTRL_ROOTORDEROFFS) ? RootItems[ROOT_ORDER_TO_INDEX(MoveToOrder)].ID : Value[MoveToOrder].ID, (MoveToOrder >= 0) ? ((ItemOrder < MoveToOrder) ? MoveToOrder : (MoveToOrder + 1)) : 0);
+ if (MoveToOrder != -1 && ((MoveToOrder <= TREECTRL_ROOTORDEROFFS) ? RootItems[ROOT_ORDER_TO_INDEX(MoveToOrder)].Flags : m_value[MoveToOrder].Flags) & TIF_GROUP) // if the destination is a group, then move the item to that group
+ RecursiveMove(ItemOrder, (MoveToOrder <= TREECTRL_ROOTORDEROFFS) ? RootItems[ROOT_ORDER_TO_INDEX(MoveToOrder)].ID : m_value[MoveToOrder].ID, (MoveToOrder >= 0) ? ((ItemOrder < MoveToOrder) ? MoveToOrder : (MoveToOrder + 1)) : 0);
else // else place the item after the destination item
- RecursiveMove(ItemOrder, (MoveToOrder == -1) ? 0 : Value[MoveToOrder].ParentID, (ItemOrder < MoveToOrder) ? MoveToOrder : (MoveToOrder + 1)); // when TREECTRL_FLAG_IS_SINGLE_LEVEL, we always have a root item with ID = 0.
+ RecursiveMove(ItemOrder, (MoveToOrder == -1) ? 0 : m_value[MoveToOrder].ParentID, (ItemOrder < MoveToOrder) ? MoveToOrder : (MoveToOrder + 1)); // when TREECTRL_FLAG_IS_SINGLE_LEVEL, we always have a root item with ID = 0.
MemToWnd(hWnd); // update the tree
- Modified = true;
+ m_bModified = true;
}
@@ -660,7 +660,7 @@ int ListReadEnum(const char *szSetting, LPARAM lParam) int Len = pData->sDBSettingPrefix.GetLen() + pData->ListCtrl->sDBSetting.GetLen() + _countof(LISTITEM_DBSTR_TEXT) - 1;
if (!strncmp(szSetting, pData->sDBSettingPrefix + pData->ListCtrl->sDBSetting + LISTITEM_DBSTR_TEXT, Len) && isdigit(szSetting[Len])) {
int ID = atol(szSetting + Len);
- pData->ListCtrl->Value.SetAtGrow(ID).Text = db_get_s(NULL, pData->sModule, *pData->sDBSettingPrefix + szSetting, _T(""));
+ pData->ListCtrl->m_value.SetAtGrow(ID).Text = db_get_s(NULL, pData->sModule, *pData->sDBSettingPrefix + szSetting, _T(""));
}
return 0;
}
@@ -670,7 +670,7 @@ void COptItem_ListCtrl::DBToMem(const CString &sModule, CString *sDBSettingPrefi if (!sDBSettingPrefix)
sDBSettingPrefix = &sEmptyString;
- Value.RemoveAll();
+ m_value.RemoveAll();
sListReadEnumData pData(this, sModule, *sDBSettingPrefix);
DBCONTACTENUMSETTINGS dbEnum;
dbEnum.lParam = (LPARAM)&pData;
@@ -678,12 +678,12 @@ void COptItem_ListCtrl::DBToMem(const CString &sModule, CString *sDBSettingPrefi dbEnum.pfnEnumProc = ListReadEnum;
dbEnum.szModule = sModule;
CallService(MS_DB_CONTACT_ENUMSETTINGS, NULL, (LPARAM)&dbEnum);
- if (!Value.GetSize())
- Value = DefValue;
+ if (!m_value.GetSize())
+ m_value = m_defValue;
else {
- for (int i = 0; i < Value.GetSize(); i++) {
- if (Value[i].Text == NULL) {
- Value.RemoveElem(i);
+ for (int i = 0; i < m_value.GetSize(); i++) {
+ if (m_value[i].Text == NULL) {
+ m_value.RemoveElem(i);
i--;
}
}
@@ -693,17 +693,17 @@ void COptItem_ListCtrl::DBToMem(const CString &sModule, CString *sDBSettingPrefi void COptItem_ListCtrl::MemToDB(const CString &sModule, CString *sDBSettingPrefix)
{
- if (!ReadOnly && Modified) {
+ if (!m_bReadOnly && m_bModified) {
if (!sDBSettingPrefix)
sDBSettingPrefix = &sEmptyString;
CleanDBSettings(sModule, sDBSettingPrefix);
- for (int i = 0; i < Value.GetSize(); i++) {
+ for (int i = 0; i < m_value.GetSize(); i++) {
CString StrID;
_itoa(i, StrID.GetBuffer(64), 10);
StrID.ReleaseBuffer();
- db_set_ts(NULL, sModule, *sDBSettingPrefix + sDBSetting + LISTITEM_DBSTR_TEXT + StrID, Value[i].Text);
+ db_set_ts(NULL, sModule, *sDBSettingPrefix + sDBSetting + LISTITEM_DBSTR_TEXT + StrID, m_value[i].Text);
}
COptItem::MemToDB(sModule, sDBSettingPrefix);
}
@@ -717,12 +717,12 @@ void COptItem_ListCtrl::WndToMem(HWND hWnd) void COptItem_ListCtrl::MemToWnd(HWND hWnd)
{
- HWND hListView = GetDlgItem(hWnd, DlgItemID);
+ HWND hListView = GetDlgItem(hWnd, m_dlgItemID);
SendMessage(hListView, WM_SETREDRAW, false, 0);
SendMessage(hListView, LB_RESETCONTENT, 0, 0);
- for (int i = 0; i < Value.GetSize(); i++)
- SendMessage(hListView, LB_INSERTSTRING, -1, (LPARAM)(TCHAR*)Value[i].Text);
+ for (int i = 0; i < m_value.GetSize(); i++)
+ SendMessage(hListView, LB_INSERTSTRING, -1, (LPARAM)(TCHAR*)m_value[i].Text);
SendMessage(hListView, WM_SETREDRAW, true, 0);
COptItem::MemToWnd(hWnd);
@@ -765,30 +765,30 @@ void COptItem_ListCtrl::CleanDBSettings(const CString &sModule, CString *sDBSett int COptItem_ListCtrl::GetSelectedItemID(HWND hWnd)
{
- int Res = SendDlgItemMessage(hWnd, DlgItemID, LB_GETCURSEL, 0, 0);
+ int Res = SendDlgItemMessage(hWnd, m_dlgItemID, LB_GETCURSEL, 0, 0);
return (Res == LB_ERR) ? -1 : Res; // i know that LB_ERR = -1 ;)
}
int COptItem_ListCtrl::SetSelectedItemID(HWND hWnd, int ID)
{
- int Res = SendDlgItemMessage(hWnd, DlgItemID, LB_SETCURSEL, ID, 0);
+ int Res = SendDlgItemMessage(hWnd, m_dlgItemID, LB_SETCURSEL, ID, 0);
return (Res == LB_ERR) ? -1 : Res;
}
void COptItem_ListCtrl::Delete(HWND hWnd, int ID)
{
_ASSERT(ID >= 0);
- HWND hListView = GetDlgItem(hWnd, DlgItemID);
+ HWND hListView = GetDlgItem(hWnd, m_dlgItemID);
int Res = SendMessage(hListView, LB_DELETESTRING, ID, 0);
_ASSERT(Res != LB_ERR);
- Value.RemoveElem(ID);
- Modified = true;
+ m_value.RemoveElem(ID);
+ m_bModified = true;
}
void COptItem_ListCtrl::ModifyItem(HWND hWnd, int ID, CListItem &Item)
{ // changes the text of item with the specified ID
_ASSERT(ID >= 0);
- HWND hListView = GetDlgItem(hWnd, DlgItemID);
+ HWND hListView = GetDlgItem(hWnd, m_dlgItemID);
SendMessage(hListView, WM_SETREDRAW, false, 0);
int CurSel = SendMessage(hListView, LB_GETCURSEL, 0, 0);
int TopIndex = SendMessage(hListView, LB_GETTOPINDEX, 0, 0);
@@ -799,18 +799,18 @@ void COptItem_ListCtrl::ModifyItem(HWND hWnd, int ID, CListItem &Item) SendMessage(hListView, LB_SETCURSEL, CurSel, 0);
SendMessage(hListView, LB_SETTOPINDEX, TopIndex, 0);
SendMessage(hListView, WM_SETREDRAW, true, 0);
- Value[ID].Text = Item.Text;
- Modified = true;
+ m_value[ID].Text = Item.Text;
+ m_bModified = true;
}
CListItem* COptItem_ListCtrl::InsertItem(HWND hWnd, int ID, CListItem &Item)
// returns a pointer to the newly inserted item info
// ID is position at which to insert the item; -1 = add to the end of the list
{
- HWND hListView = GetDlgItem(hWnd, DlgItemID);
+ HWND hListView = GetDlgItem(hWnd, m_dlgItemID);
int Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(TCHAR*)(Item.Text)); // LB_INSERTSTRING doesn't sort the lists even with LBS_SORT style
_ASSERT(Res != LB_ERR && Res != LB_ERRSPACE);
- int i = Value.AddElem(Item);
- Modified = true;
- return &Value[i];
+ int i = m_value.AddElem(Item);
+ m_bModified = true;
+ return &m_value[i];
}
diff --git a/plugins/NewAwaySysMod/src/Options.h b/plugins/NewAwaySysMod/src/Options.h index 1e547356cb..4e4481da8b 100644 --- a/plugins/NewAwaySysMod/src/Options.h +++ b/plugins/NewAwaySysMod/src/Options.h @@ -26,39 +26,40 @@ class COptItem {
public:
COptItem() {}
- COptItem(int DlgItemID, char *szDBSetting, int nValueSize, int lParam = 0, bool ReadOnly = false) :
- DlgItemID(DlgItemID), nValueSize(nValueSize), sDBSetting(szDBSetting), lParam(lParam), Enabled(true), ReadOnly(ReadOnly), Modified(false)
+ COptItem(int m_dlgItemID, char *szDBSetting, int nValueSize, int lParam = 0, bool m_bReadOnly = false) :
+ m_dlgItemID(m_dlgItemID), nValueSize(nValueSize), sDBSetting(szDBSetting), lParam(lParam), m_bEnabled(true), m_bReadOnly(m_bReadOnly), m_bModified(false)
{
}
virtual ~COptItem() {}
- virtual void DBToMem(const CString&, CString* = NULL) { Modified = false; }
- virtual void MemToDB(const CString&, CString* = NULL) { Modified = false; }
+ virtual void DBToMem(const CString&, CString* = NULL) { m_bModified = false; }
+ virtual void MemToDB(const CString&, CString* = NULL) { m_bModified = false; }
virtual void WndToMem(HWND) {}
- virtual void MemToWnd(HWND hWnd) { EnableWindow(GetDlgItem(hWnd, DlgItemID), Enabled); }
+ virtual void MemToWnd(HWND hWnd) { EnableWindow(GetDlgItem(hWnd, m_dlgItemID), m_bEnabled); }
void DBToMemToWnd(const CString &sModule, HWND hWnd, CString *sDBSettingPrefix = NULL) { DBToMem(sModule, sDBSettingPrefix); MemToWnd(hWnd); }
void WndToMemToDB(HWND hWnd, const CString &sModule, CString *sDBSettingPrefix = NULL) { WndToMem(hWnd); MemToDB(sModule, sDBSettingPrefix); }
- virtual void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = NULL) { db_unset(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting); }; // TODO: also set Value to DefValue?
-
- virtual void SetValue(int) { Modified = true; }
- virtual void SetDefValue(int) {}
- virtual int GetValue() { return 0; }
- virtual int GetDefValue() { return 0; }
-
- int GetDBValue(const CString &sModule, CString *sDBSettingPrefix = NULL) { DBToMem(sModule, sDBSettingPrefix); return GetValue(); }
- void SetDBValue(const CString &sModule, int Value, CString *sDBSettingPrefix = NULL) { SetValue(Value); MemToDB(sModule, sDBSettingPrefix); }
- int GetDBValueCopy(const CString &sModule, CString *sDBSettingPrefix = NULL) { COptItem* Item = Copy(); Item->DBToMem(sModule, sDBSettingPrefix); int Value = Item->GetValue(); delete Item; return Value; } // retrieves DB value, but doesn't affect current page/item state; beware! it doesn't work with string values / other dynamic pointers
- void SetDBValueCopy(const CString &sModule, int Value, CString *sDBSettingPrefix = NULL) { COptItem* Item = Copy(); Item->SetValue(Value); Item->MemToDB(sModule, sDBSettingPrefix); delete Item; }
- int GetWndValue(HWND hWnd) { WndToMem(hWnd); return GetValue(); }
- void SetWndValue(HWND hWnd, int Value) { SetValue(Value); MemToWnd(hWnd); }
- void SetDlgItemID(int _DlgItemID) { this->DlgItemID = _DlgItemID; }
- bool GetModified() { return Modified; }
- void SetModified(bool _Modified) { this->Modified = _Modified; }
-
- void Enable(int _Enabled) { this->Enabled = _Enabled; }
+ virtual void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = NULL) { db_unset(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting); }; // TODO: also set m_value to m_defValue?
+
+ virtual void SetValue(INT_PTR) { m_bModified = true; }
+ virtual void SetDefValue(INT_PTR) {}
+ virtual INT_PTR GetValue() { return 0; }
+ virtual INT_PTR GetDefValue() { return 0; }
+
+ INT_PTR GetDBValue(const CString &sModule, CString *sDBSettingPrefix = NULL) { DBToMem(sModule, sDBSettingPrefix); return GetValue(); }
+ void SetDBValue(const CString &sModule, INT_PTR m_value, CString *sDBSettingPrefix = NULL) { SetValue(m_value); MemToDB(sModule, sDBSettingPrefix); }
+ INT_PTR GetDBValueCopy(const CString &sModule, CString *sDBSettingPrefix = NULL) { COptItem* Item = Copy(); Item->DBToMem(sModule, sDBSettingPrefix); INT_PTR m_value = Item->GetValue(); delete Item; return m_value; } // retrieves DB value, but doesn't affect current page/item state; beware! it doesn't work with string values / other dynamic pointers
+ void SetDBValueCopy(const CString &sModule, INT_PTR m_value, CString *sDBSettingPrefix = NULL) { COptItem* Item = Copy(); Item->SetValue(m_value); Item->MemToDB(sModule, sDBSettingPrefix); delete Item; }
+ INT_PTR GetWndValue(HWND hWnd) { WndToMem(hWnd); return GetValue(); }
+ void SetWndValue(HWND hWnd, INT_PTR m_value) { SetValue(m_value); MemToWnd(hWnd); }
+
+ void SetDlgItemID(int _DlgItemID) { m_dlgItemID = _DlgItemID; }
+ bool GetModified() { return m_bModified; }
+ void SetModified(bool _Modified) { m_bModified = _Modified; }
+
+ void Enable(bool bEnabled) { m_bEnabled = bEnabled; }
int GetParam() { return lParam; }
- int GetID() { return DlgItemID; }
+ int GetID() { return m_dlgItemID; }
// virtual COptItem& operator = (const COptItem& Item) {return *this;};
virtual COptItem* Copy() { _ASSERT(0); return NULL; } // Attention! Free Copy() result when it's not needed anymore!
@@ -67,14 +68,14 @@ public: protected:
int GetIntDBVal(const CString &sModule, int bSigned = false, CString *sDBSettingPrefix = NULL);
- void SetIntDBVal(const CString &sModule, int Value, CString *sDBSettingPrefix = NULL);
+ void SetIntDBVal(const CString &sModule, int m_value, CString *sDBSettingPrefix = NULL);
TCString GetStrDBVal(const CString &sModule, CString *sDBSettingPrefix = NULL);
void SetStrDBVal(const CString &sModule, TCString &Str, CString *sDBSettingPrefix = NULL);
- int DlgItemID;
- int Enabled;
- bool ReadOnly;
- bool Modified;
+ int m_dlgItemID;
+ bool m_bEnabled;
+ bool m_bReadOnly;
+ bool m_bModified;
int nValueSize; // maximum pValue size in bytes
int lParam;
};
@@ -83,7 +84,7 @@ class COptItem_Generic : public COptItem {
public:
COptItem_Generic() {}
- COptItem_Generic(int DlgItemID, int lParam = 0) : COptItem(DlgItemID, NULL, 0, lParam) {}
+ COptItem_Generic(int m_dlgItemID, int lParam = 0) : COptItem(m_dlgItemID, NULL, 0, lParam) {}
virtual COptItem* Copy() { return new COptItem_Generic(*this); }
};
@@ -91,19 +92,20 @@ class COptItem_Edit : public COptItem {
public:
COptItem_Edit() {}
- COptItem_Edit(int DlgItemID, char *szDBSetting, int nMaxLen, TCHAR *szDefValue, int lParam = 0, bool ReadOnly = false)
- : COptItem(DlgItemID, szDBSetting, nMaxLen, lParam, ReadOnly), sDefValue(szDefValue)
+ COptItem_Edit(int m_dlgItemID, char *szDBSetting, int nMaxLen, TCHAR *szDefValue, int lParam = 0, bool m_bReadOnly = false)
+ : COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue)
{}
void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { sValue = GetStrDBVal(sModule, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetStrDBVal(sModule, sValue, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
- void WndToMem(HWND hWnd) { GetDlgItemText(hWnd, DlgItemID, sValue.GetBuffer(nValueSize), nValueSize); sValue.ReleaseBuffer(); COptItem::MemToWnd(hWnd); }
- void MemToWnd(HWND hWnd) { SetDlgItemText(hWnd, DlgItemID, sValue); COptItem::MemToWnd(hWnd); }
- void SetValue(int Value) { sValue = *(TCString*)Value; COptItem::SetValue(Value); }
- void SetDefValue(int DefValue) { sDefValue = *(TCString*)DefValue; COptItem::SetDefValue(DefValue); }
+ void WndToMem(HWND hWnd) { GetDlgItemText(hWnd, m_dlgItemID, sValue.GetBuffer(nValueSize), nValueSize); sValue.ReleaseBuffer(); COptItem::MemToWnd(hWnd); }
+ void MemToWnd(HWND hWnd) { SetDlgItemText(hWnd, m_dlgItemID, sValue); COptItem::MemToWnd(hWnd); }
- virtual int GetValue() { return 1; }
- virtual int GetDefValue() { return 1; }
+ virtual void SetValue(INT_PTR m_value) { sValue = *(TCString*)m_value; COptItem::SetValue(m_value); }
+ virtual void SetDefValue(INT_PTR m_defValue) { sDefValue = *(TCString*)m_defValue; COptItem::SetDefValue(m_defValue); }
+
+ virtual INT_PTR GetValue() { return (INT_PTR)&sValue; }
+ virtual INT_PTR GetDefValue() { return (INT_PTR)&sDefValue; }
// COptItem_Edit& operator = (const COptItem_Edit& Item) {return *this;};
virtual COptItem* Copy() { return new COptItem_Edit(*this); }
@@ -117,23 +119,24 @@ class COptItem_IntEdit : public COptItem {
public:
COptItem_IntEdit() {}
- COptItem_IntEdit(int DlgItemID, char *szDBSetting, int nValueSize = DBVT_BYTE, int bSigned = true, int DefValue = 0, int lParam = 0, bool ReadOnly = false)
- : COptItem(DlgItemID, szDBSetting, nValueSize, lParam, ReadOnly), DefValue(DefValue), Value(0), bSigned(bSigned)
+ COptItem_IntEdit(int m_dlgItemID, char *szDBSetting, int nValueSize = DBVT_BYTE, int bSigned = true, int m_defValue = 0, int lParam = 0, bool m_bReadOnly = false)
+ : COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0), bSigned(bSigned)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { Value = GetIntDBVal(sModule, bSigned, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, Value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
- void WndToMem(HWND hWnd) { Value = GetDlgItemInt(hWnd, DlgItemID, NULL, bSigned); COptItem::WndToMem(hWnd); }
- void MemToWnd(HWND hWnd) { SetDlgItemInt(hWnd, DlgItemID, Value, bSigned); COptItem::MemToWnd(hWnd); }
- void SetValue(int _Value) { this->Value = _Value; COptItem::SetValue(_Value); }
- void SetDefValue(int _DefValue) { this->DefValue = _DefValue; COptItem::SetDefValue(_DefValue); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = GetIntDBVal(sModule, bSigned, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void WndToMem(HWND hWnd) { m_value = GetDlgItemInt(hWnd, m_dlgItemID, NULL, bSigned); COptItem::WndToMem(hWnd); }
+ void MemToWnd(HWND hWnd) { SetDlgItemInt(hWnd, m_dlgItemID, m_value, bSigned); COptItem::MemToWnd(hWnd); }
+
+ virtual void SetValue(INT_PTR _Value) { this->m_value = _Value; COptItem::SetValue(_Value); }
+ virtual void SetDefValue(INT_PTR _DefValue) { this->m_defValue = _DefValue; COptItem::SetDefValue(_DefValue); }
- virtual int GetValue() { return Value; }
- virtual int GetDefValue() { return DefValue; }
+ virtual INT_PTR GetValue() { return m_value; }
+ virtual INT_PTR GetDefValue() { return m_defValue; }
virtual COptItem* Copy() { return new COptItem_IntEdit(*this); }
- int DefValue;
- int Value;
+ int m_defValue;
+ int m_value;
int bSigned;
};
@@ -142,8 +145,8 @@ class COptItem_Checkbox : public COptItem {
public:
COptItem_Checkbox() {}
- COptItem_Checkbox(int DlgItemID, char *szDBSetting, int nValueSize = DBVT_BYTE, int DefValue = 0, int ValueMask = 0, int lParam = 0, bool ReadOnly = false)
- : COptItem(DlgItemID, szDBSetting, nValueSize, lParam, ReadOnly), DefValue(DefValue), Value(0), ValueMask(ValueMask)
+ COptItem_Checkbox(int m_dlgItemID, char *szDBSetting, int nValueSize = DBVT_BYTE, int m_defValue = 0, int m_valueMask = 0, int lParam = 0, bool m_bReadOnly = false)
+ : COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0), m_valueMask(m_valueMask)
{}
void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL);
@@ -151,83 +154,93 @@ public: void WndToMem(HWND hWnd);
void MemToWnd(HWND hWnd);
- void SetValue(int _Value) { this->Value = _Value; COptItem::SetValue(_Value); }
- void SetDefValue(int _DefValue) { this->DefValue = _DefValue; COptItem::SetDefValue(_DefValue); }
- virtual int GetValue() { return Value; }
- virtual int GetDefValue() { return DefValue; }
+ virtual void SetValue(INT_PTR _Value) { this->m_value = _Value; COptItem::SetValue(_Value); }
+ virtual void SetDefValue(INT_PTR _DefValue) { this->m_defValue = _DefValue; COptItem::SetDefValue(_DefValue); }
+
+ virtual INT_PTR GetValue() { return m_value; }
+ virtual INT_PTR GetDefValue() { return m_defValue; }
+
virtual COptItem* Copy() { return new COptItem_Checkbox(*this); }
- int Value;
- int DefValue;
- int ValueMask;
+ int m_value;
+ int m_defValue;
+ int m_valueMask;
};
class COptItem_Radiobutton : public COptItem
{
public:
COptItem_Radiobutton() {}
- COptItem_Radiobutton(int DlgItemID, char *szDBSetting, int nValueSize, int DefValue, int ValueMask, int lParam = 0, bool ReadOnly = false)
- : COptItem(DlgItemID, szDBSetting, nValueSize, lParam, ReadOnly), DefValue(DefValue), Value(0), ValueMask(ValueMask)
+ COptItem_Radiobutton(int m_dlgItemID, char *szDBSetting, int nValueSize, int m_defValue, int m_valueMask, int lParam = 0, bool m_bReadOnly = false)
+ : COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0), m_valueMask(m_valueMask)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { Value = (GetIntDBVal(sModule, false, sDBSettingPrefix) == ValueMask) ? BST_CHECKED : BST_UNCHECKED; COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { if ((Value == BST_CHECKED)) SetIntDBVal(sModule, ValueMask, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
- void WndToMem(HWND hWnd) { Value = IsDlgButtonChecked(hWnd, DlgItemID); COptItem::WndToMem(hWnd); }
- void MemToWnd(HWND hWnd) { CheckDlgButton(hWnd, DlgItemID, Value ? BST_CHECKED : BST_UNCHECKED); COptItem::MemToWnd(hWnd); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = (GetIntDBVal(sModule, false, sDBSettingPrefix) == m_valueMask) ? BST_CHECKED : BST_UNCHECKED; COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { if ((m_value == BST_CHECKED)) SetIntDBVal(sModule, m_valueMask, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void WndToMem(HWND hWnd) { m_value = IsDlgButtonChecked(hWnd, m_dlgItemID); COptItem::WndToMem(hWnd); }
+ void MemToWnd(HWND hWnd) { CheckDlgButton(hWnd, m_dlgItemID, m_value ? BST_CHECKED : BST_UNCHECKED); COptItem::MemToWnd(hWnd); }
- void SetValue(int _Value) { this->Value = _Value; COptItem::SetValue(_Value); }
- void SetDefValue(int _DefValue) { this->DefValue = _DefValue; COptItem::SetDefValue(_DefValue); }
- virtual int GetValue() { return Value; }
- virtual int GetDefValue() { return DefValue; }
+ virtual void SetValue(INT_PTR _Value) { this->m_value = _Value; COptItem::SetValue(_Value); }
+ virtual void SetDefValue(INT_PTR _DefValue) { this->m_defValue = _DefValue; COptItem::SetDefValue(_DefValue); }
+
+ virtual INT_PTR GetValue() { return m_value; }
+ virtual INT_PTR GetDefValue() { return m_defValue; }
+
virtual COptItem* Copy() { return new COptItem_Radiobutton(*this); }
- int Value;
- int DefValue;
- int ValueMask;
+ int m_value;
+ int m_defValue;
+ int m_valueMask;
};
class COptItem_Combobox : public COptItem
{
public:
COptItem_Combobox() {}
- COptItem_Combobox(int DlgItemID, char *szDBSetting, int nValueSize = DBVT_BYTE, int DefValue = 0, int lParam = 0, bool ReadOnly = false)
- : COptItem(DlgItemID, szDBSetting, nValueSize, lParam, ReadOnly), DefValue(DefValue), Value(0)
+ COptItem_Combobox(int m_dlgItemID, char *szDBSetting, int nValueSize = DBVT_BYTE, int m_defValue = 0, int lParam = 0, bool m_bReadOnly = false)
+ : COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { Value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, Value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
- void WndToMem(HWND hWnd) { Value = SendDlgItemMessage(hWnd, DlgItemID, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hWnd, DlgItemID, CB_GETCURSEL, 0, 0), 0); COptItem::WndToMem(hWnd); }
- void MemToWnd(HWND hWnd) { SendDlgItemMessage(hWnd, DlgItemID, CB_SETCURSEL, Value, 0); COptItem::MemToWnd(hWnd); }
- void SetValue(int _Value) { this->Value = _Value; COptItem::SetValue(_Value); }
- void SetDefValue(int _DefValue) { this->DefValue = _DefValue; COptItem::SetDefValue(_DefValue); }
- virtual int GetValue() { return Value; }
- virtual int GetDefValue() { return DefValue; }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void WndToMem(HWND hWnd) { m_value = SendDlgItemMessage(hWnd, m_dlgItemID, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hWnd, m_dlgItemID, CB_GETCURSEL, 0, 0), 0); COptItem::WndToMem(hWnd); }
+ void MemToWnd(HWND hWnd) { SendDlgItemMessage(hWnd, m_dlgItemID, CB_SETCURSEL, m_value, 0); COptItem::MemToWnd(hWnd); }
+
+ virtual void SetValue(INT_PTR _Value) { this->m_value = _Value; COptItem::SetValue(_Value); }
+ virtual void SetDefValue(INT_PTR _DefValue) { this->m_defValue = _DefValue; COptItem::SetDefValue(_DefValue); }
+
+ virtual INT_PTR GetValue() { return m_value; }
+ virtual INT_PTR GetDefValue() { return m_defValue; }
+
virtual COptItem* Copy() { return new COptItem_Combobox(*this); }
- int DefValue;
- int Value;
+ int m_defValue;
+ int m_value;
};
class COptItem_Colourpicker : public COptItem
{
public:
COptItem_Colourpicker() {}
- COptItem_Colourpicker(int DlgItemID, char *szDBSetting, int DefValue = 0, int lParam = 0, bool ReadOnly = false)
- : COptItem(DlgItemID, szDBSetting, DBVT_DWORD, lParam, ReadOnly), DefValue(DefValue), Value(0)
+ COptItem_Colourpicker(int m_dlgItemID, char *szDBSetting, int m_defValue = 0, int lParam = 0, bool m_bReadOnly = false)
+ : COptItem(m_dlgItemID, szDBSetting, DBVT_DWORD, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { Value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, Value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
- void WndToMem(HWND hWnd) { Value = SendDlgItemMessage(hWnd, DlgItemID, CPM_GETCOLOUR, 0, 0); COptItem::WndToMem(hWnd); }
- void MemToWnd(HWND hWnd) { SendDlgItemMessage(hWnd, DlgItemID, CPM_SETCOLOUR, 0, Value); COptItem::MemToWnd(hWnd); }
- void SetValue(int _Value) { this->Value = _Value; COptItem::SetValue(_Value); }
- void SetDefValue(int _DefValue) { this->DefValue = _DefValue; COptItem::SetDefValue(_DefValue); }
- virtual int GetValue() { return Value; }
- virtual int GetDefValue() { return DefValue; }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void WndToMem(HWND hWnd) { m_value = SendDlgItemMessage(hWnd, m_dlgItemID, CPM_GETCOLOUR, 0, 0); COptItem::WndToMem(hWnd); }
+ void MemToWnd(HWND hWnd) { SendDlgItemMessage(hWnd, m_dlgItemID, CPM_SETCOLOUR, 0, m_value); COptItem::MemToWnd(hWnd); }
+
+ virtual void SetValue(INT_PTR _Value) { this->m_value = _Value; COptItem::SetValue(_Value); }
+ virtual void SetDefValue(INT_PTR _DefValue) { this->m_defValue = _DefValue; COptItem::SetDefValue(_DefValue); }
+
+ virtual INT_PTR GetValue() { return m_value; }
+ virtual INT_PTR GetDefValue() { return m_defValue; }
+
virtual COptItem* Copy() { return new COptItem_Colourpicker(*this); }
- DWORD DefValue;
- DWORD Value;
+ DWORD m_defValue;
+ DWORD m_value;
};
@@ -235,23 +248,24 @@ class COptItem_Slider : public COptItem {
public:
COptItem_Slider() {}
- COptItem_Slider(int DlgItemID, char *szDBSetting, int nValueSize = DBVT_BYTE, int DefValue = 0, int lParam = 0, bool ReadOnly = false)
- : COptItem(DlgItemID, szDBSetting, nValueSize, lParam, ReadOnly), DefValue(DefValue), Value(0)
+ COptItem_Slider(int m_dlgItemID, char *szDBSetting, int nValueSize = DBVT_BYTE, int m_defValue = 0, int lParam = 0, bool m_bReadOnly = false)
+ : COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { Value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, Value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
- void WndToMem(HWND hWnd) { Value = SendDlgItemMessage(hWnd, DlgItemID, TBM_GETPOS, 0, 0); COptItem::WndToMem(hWnd); }
- void MemToWnd(HWND hWnd) { SendDlgItemMessage(hWnd, DlgItemID, TBM_SETPOS, true, Value); COptItem::MemToWnd(hWnd); }
- void SetValue(int _Value) { this->Value = _Value; COptItem::SetValue(_Value); }
- void SetDefValue(int _DefValue) { this->DefValue = _DefValue; COptItem::SetDefValue(_DefValue); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void WndToMem(HWND hWnd) { m_value = SendDlgItemMessage(hWnd, m_dlgItemID, TBM_GETPOS, 0, 0); COptItem::WndToMem(hWnd); }
+ void MemToWnd(HWND hWnd) { SendDlgItemMessage(hWnd, m_dlgItemID, TBM_SETPOS, true, m_value); COptItem::MemToWnd(hWnd); }
+
+ virtual void SetValue(INT_PTR _Value) { this->m_value = _Value; COptItem::SetValue(_Value); }
+ virtual void SetDefValue(INT_PTR _DefValue) { this->m_defValue = _DefValue; COptItem::SetDefValue(_DefValue); }
- virtual int GetValue() { return Value; }
- virtual int GetDefValue() { return DefValue; }
+ virtual INT_PTR GetValue() { return m_value; }
+ virtual INT_PTR GetDefValue() { return m_defValue; }
virtual COptItem* Copy() { return new COptItem_Slider(*this); }
- int DefValue;
- int Value;
+ int m_defValue;
+ int m_value;
};
@@ -259,23 +273,24 @@ class COptItem_IntDBSetting : public COptItem {
public:
COptItem_IntDBSetting() {}
- COptItem_IntDBSetting(int DlgItemID, char *szDBSetting, int nValueSize = DBVT_BYTE, int bSigned = true, int DefValue = 0, int lParam = 0, bool ReadOnly = false)
- : COptItem(DlgItemID, szDBSetting, nValueSize, lParam, ReadOnly), DefValue(DefValue), Value(0), bSigned(bSigned)
+ COptItem_IntDBSetting(int m_dlgItemID, char *szDBSetting, int nValueSize = DBVT_BYTE, int bSigned = true, int m_defValue = 0, int lParam = 0, bool m_bReadOnly = false)
+ : COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0), bSigned(bSigned)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { Value = GetIntDBVal(sModule, bSigned, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, Value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = GetIntDBVal(sModule, bSigned, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { COptItem::MemToWnd(hWnd); }
- void SetValue(int _Value) { this->Value = _Value; COptItem::SetValue(_Value); }
- void SetDefValue(int _DefValue) { this->DefValue = _DefValue; COptItem::SetDefValue(_DefValue); }
+
+ virtual void SetValue(INT_PTR _Value) { this->m_value = _Value; COptItem::SetValue(_Value); }
+ virtual void SetDefValue(INT_PTR _DefValue) { this->m_defValue = _DefValue; COptItem::SetDefValue(_DefValue); }
- virtual int GetValue() { return Value; }
- virtual int GetDefValue() { return DefValue; }
+ virtual INT_PTR GetValue() { return m_value; }
+ virtual INT_PTR GetDefValue() { return m_defValue; }
virtual COptItem* Copy() { return new COptItem_IntDBSetting(*this); }
- int Value;
- int DefValue;
+ int m_value;
+ int m_defValue;
int bSigned;
};
@@ -284,23 +299,23 @@ class COptItem_BitDBSetting : public COptItem {
public:
COptItem_BitDBSetting() {}
- COptItem_BitDBSetting(int DlgItemID, char *szDBSetting, int nValueSize = DBVT_BYTE, int DefValue = 0, int ValueMask = 0, int lParam = 0, bool ReadOnly = false) : COptItem(DlgItemID, szDBSetting, nValueSize, lParam, ReadOnly), DefValue(DefValue), Value(0), ValueMask(ValueMask) {}
+ COptItem_BitDBSetting(int m_dlgItemID, char *szDBSetting, int nValueSize = DBVT_BYTE, int m_defValue = 0, int m_valueMask = 0, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0), m_valueMask(m_valueMask) {}
void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL);
void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL);
void WndToMem(HWND hWnd) { COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { COptItem::MemToWnd(hWnd); }
- void SetValue(int _Value) { this->Value = _Value; COptItem::SetValue(_Value); }
- void SetDefValue(int _DefValue) { this->DefValue = _DefValue; COptItem::SetDefValue(_DefValue); }
+ virtual void SetValue(INT_PTR _Value) { this->m_value = _Value; COptItem::SetValue(_Value); }
+ virtual void SetDefValue(INT_PTR _DefValue) { this->m_defValue = _DefValue; COptItem::SetDefValue(_DefValue); }
- virtual int GetValue() { return Value; }
- virtual int GetDefValue() { return DefValue; }
+ virtual INT_PTR GetValue() { return m_value; }
+ virtual INT_PTR GetDefValue() { return m_defValue; }
virtual COptItem* Copy() { return new COptItem_BitDBSetting(*this); }
- int Value;
- int DefValue;
- int ValueMask;
+ int m_value;
+ int m_defValue;
+ int m_valueMask;
};
@@ -308,16 +323,18 @@ class COptItem_StrDBSetting : public COptItem {
public:
COptItem_StrDBSetting() {}
- COptItem_StrDBSetting(int DlgItemID, char *szDBSetting, int nMaxLen, TCHAR *szDefValue, int lParam = 0, bool ReadOnly = false) : COptItem(DlgItemID, szDBSetting, nMaxLen, lParam, ReadOnly), sDefValue(szDefValue) {}
+ COptItem_StrDBSetting(int m_dlgItemID, char *szDBSetting, int nMaxLen, TCHAR *szDefValue, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue) {}
void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { sValue = GetStrDBVal(sModule, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetStrDBVal(sModule, sValue, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { COptItem::MemToWnd(hWnd); }
- void SetValue(int _Value) { sValue = *(TCString*)_Value; COptItem::SetValue(_Value); }
- void SetDefValue(int _DefValue) { sDefValue = *(TCString*)_DefValue; COptItem::SetDefValue(_DefValue); }
+
+ virtual void SetValue(INT_PTR _Value) { sValue = *(TCString*)_Value; COptItem::SetValue(_Value); }
+ virtual void SetDefValue(INT_PTR _DefValue) { sDefValue = *(TCString*)_DefValue; COptItem::SetDefValue(_DefValue); }
- virtual int GetValue() { return 1; }
- virtual int GetDefValue() { return 1; }
+ virtual INT_PTR GetValue() { return (INT_PTR)&sValue; }
+ virtual INT_PTR GetDefValue() { return (INT_PTR)&sDefValue; }
+
virtual COptItem* Copy() { return new COptItem_StrDBSetting(*this); }
TCString sDefValue;
@@ -385,7 +402,7 @@ class COptItem_TreeCtrl : public COptItem {
public:
COptItem_TreeCtrl() {}
- COptItem_TreeCtrl(int DlgItemID, char *szDBSetting, TreeItemArray &DefValue, TreeRootItemArray RootItems, int lParam = 0, CString User_Str1_DBName = NULL, bool ReadOnly = false, int TreeFlags = 0) : COptItem(DlgItemID, szDBSetting, DBVT_DWORD, lParam, ReadOnly), DefValue(DefValue), RootItems(RootItems), User_Str1_DBName(User_Str1_DBName), TreeFlags(TreeFlags)
+ COptItem_TreeCtrl(int m_dlgItemID, char *szDBSetting, TreeItemArray &m_defValue, TreeRootItemArray RootItems, int lParam = 0, CString User_Str1_DBName = NULL, bool m_bReadOnly = false, int TreeFlags = 0) : COptItem(m_dlgItemID, szDBSetting, DBVT_DWORD, lParam, m_bReadOnly), m_defValue(m_defValue), RootItems(RootItems), User_Str1_DBName(User_Str1_DBName), TreeFlags(TreeFlags)
{
if (TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL) {
_ASSERT(!RootItems.GetSize()); // there can't be any root items when the tree is a plain list
@@ -399,11 +416,13 @@ public: void WndToMem(HWND hWnd);
void MemToWnd(HWND hWnd);
void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = NULL);
- void SetValue(int _Value) { this->Value = *(TreeItemArray*)_Value; COptItem::SetValue(_Value); }
- void SetDefValue(int _DefValue) { this->DefValue = *(TreeItemArray*)_DefValue; COptItem::SetDefValue(_DefValue); }
- virtual int GetValue() { return 1; }
- virtual int GetDefValue() { return 1; }
+ virtual void SetValue(INT_PTR _Value) { this->m_value = *(TreeItemArray*)_Value; COptItem::SetValue(_Value); }
+ virtual void SetDefValue(INT_PTR _DefValue) { this->m_defValue = *(TreeItemArray*)_DefValue; COptItem::SetDefValue(_DefValue); }
+
+ virtual INT_PTR GetValue() { return (INT_PTR)&m_value; }
+ virtual INT_PTR GetDefValue() { return (INT_PTR)&m_defValue; }
+
virtual COptItem* Copy() { return new COptItem_TreeCtrl(*this); }
int IDToOrder(int ID);
@@ -414,7 +433,7 @@ public: CTreeItem* InsertItem(HWND hWnd, CTreeItem &Item);
void MoveItem(HWND hWnd, HTREEITEM hItem, HTREEITEM hMoveTo);
- TreeItemArray DefValue, Value;
+ TreeItemArray m_defValue, m_value;
TreeRootItemArray RootItems;
CString User_Str1_DBName;
int TreeFlags;
@@ -442,18 +461,20 @@ class COptItem_ListCtrl : public COptItem {
public:
COptItem_ListCtrl() {}
- COptItem_ListCtrl(int DlgItemID, char *szDBSetting, ListItemArray &DefValue, int lParam = 0, bool ReadOnly = false) : COptItem(DlgItemID, szDBSetting, DBVT_DWORD, lParam, ReadOnly), DefValue(DefValue) {}
+ COptItem_ListCtrl(int m_dlgItemID, char *szDBSetting, ListItemArray &m_defValue, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, DBVT_DWORD, lParam, m_bReadOnly), m_defValue(m_defValue) {}
~COptItem_ListCtrl() {}
void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL);
void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL);
void WndToMem(HWND hWnd);
void MemToWnd(HWND hWnd);
void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = NULL);
- void SetValue(int _Value) { this->Value = *(ListItemArray*)_Value; COptItem::SetValue(_Value); }
- void SetDefValue(int _DefValue) { this->DefValue = *(ListItemArray*)_DefValue; COptItem::SetDefValue(_DefValue); }
- virtual int GetValue() { return 1; }
- virtual int GetDefValue() { return 1; }
+ virtual void SetValue(INT_PTR _Value) { this->m_value = *(ListItemArray*)_Value; COptItem::SetValue(_Value); }
+ virtual void SetDefValue(INT_PTR _DefValue) { this->m_defValue = *(ListItemArray*)_DefValue; COptItem::SetDefValue(_DefValue); }
+
+ virtual INT_PTR GetValue() { return (INT_PTR)&m_value; }
+ virtual INT_PTR GetDefValue() { return (INT_PTR)&m_defValue; }
+
virtual COptItem* Copy() { return new COptItem_ListCtrl(*this); }
int GetSelectedItemID(HWND hWnd); // returns -1 if there's no selection
@@ -462,7 +483,7 @@ public: CListItem* InsertItem(HWND hWnd, int ID, CListItem &Item);
void ModifyItem(HWND hWnd, int ID, CListItem &Item);
- ListItemArray DefValue, Value;
+ ListItemArray m_defValue, m_value;
};
@@ -482,20 +503,26 @@ public: void PageToMemToDB() { PageToMem(); MemToDB(); }
void CleanDBSettings();
- COptItem* Find(int DlgItemID);
- int GetValue(int DlgItemID) { return Find(DlgItemID)->GetValue(); }
- void SetValue(int DlgItemID, int Value) { Find(DlgItemID)->SetValue(Value); }
- int GetDBValue(int DlgItemID) { return Find(DlgItemID)->GetDBValue(sModule, &sDBSettingPrefix); }
- void SetDBValue(int DlgItemID, int Value) { Find(DlgItemID)->SetDBValue(sModule, Value, &sDBSettingPrefix); }
- int GetDBValueCopy(int DlgItemID) { return Find(DlgItemID)->GetDBValueCopy(sModule, &sDBSettingPrefix); }
- void SetDBValueCopy(int DlgItemID, int Value) { Find(DlgItemID)->SetDBValueCopy(sModule, Value, &sDBSettingPrefix); }
- int GetWndValue(int DlgItemID) { return Find(DlgItemID)->GetWndValue(hWnd); }
- void SetWndValue(int DlgItemID, int Value) { Find(DlgItemID)->SetWndValue(hWnd, Value); }
+ COptItem* Find(int m_dlgItemID);
+ INT_PTR GetValue(int m_dlgItemID) { return Find(m_dlgItemID)->GetValue(); }
+ void SetValue(int m_dlgItemID, INT_PTR m_value) { Find(m_dlgItemID)->SetValue(m_value); }
+
+ INT_PTR GetDBValue(int m_dlgItemID) { return Find(m_dlgItemID)->GetDBValue(sModule, &sDBSettingPrefix); }
+ void SetDBValue(int m_dlgItemID, INT_PTR m_value) { Find(m_dlgItemID)->SetDBValue(sModule, m_value, &sDBSettingPrefix); }
+
+ INT_PTR GetDBValueCopy(int m_dlgItemID) { return Find(m_dlgItemID)->GetDBValueCopy(sModule, &sDBSettingPrefix); }
+ void SetDBValueCopy(int m_dlgItemID, INT_PTR m_value) { Find(m_dlgItemID)->SetDBValueCopy(sModule, m_value, &sDBSettingPrefix); }
+
+ INT_PTR GetWndValue(int m_dlgItemID) { return Find(m_dlgItemID)->GetWndValue(hWnd); }
+ void SetWndValue(int m_dlgItemID, INT_PTR m_value) { Find(m_dlgItemID)->SetWndValue(hWnd, m_value); }
+
HWND GetWnd() { return hWnd; }
void SetWnd(HWND _hWnd) { _ASSERT(!this->hWnd || !_hWnd); this->hWnd = _hWnd; }
- void Enable(int DlgItemID, int Enabled) { Find(DlgItemID)->Enable(Enabled); }
+
+ void Enable(int m_dlgItemID, bool m_bEnabled) { Find(m_dlgItemID)->Enable(m_bEnabled); }
+
bool GetModified();
- void SetModified(bool Modified);
+ void SetModified(bool m_bModified);
COptPage& operator = (const COptPage& Page);
diff --git a/plugins/NewAwaySysMod/src/Properties.cpp b/plugins/NewAwaySysMod/src/Properties.cpp index e921a72096..59ffb1fca7 100644 --- a/plugins/NewAwaySysMod/src/Properties.cpp +++ b/plugins/NewAwaySysMod/src/Properties.cpp @@ -182,26 +182,26 @@ void CProtoSettings::SetMsgFormat(int Flags, TCString Message) TreeCtrl->DBToMem(CString(MOD_NAME));
int RecentGroupID = GetRecentGroupID(Status);
if (RecentGroupID == -1) { // we didn't find the group, it also means that we're using per status messages; so we need to create it
- TreeCtrl->Value.AddElem(CTreeItem(Status ? pcli->pfnGetStatusModeDescription(Status, 0) : MSGTREE_RECENT_OTHERGROUP, g_Messages_RecentRootID, RecentGroupID = TreeCtrl->GenerateID(), TIF_GROUP));
+ TreeCtrl->m_value.AddElem(CTreeItem(Status ? pcli->pfnGetStatusModeDescription(Status, 0) : MSGTREE_RECENT_OTHERGROUP, g_Messages_RecentRootID, RecentGroupID = TreeCtrl->GenerateID(), TIF_GROUP));
TreeCtrl->SetModified(true);
}
int i;
// try to find an identical message in the same group (to prevent saving multiple identical messages),
// or at least if we'll find an identical message somewhere else, then we'll use its title for our new message
TCString Title(_T(""));
- for (i = 0; i < TreeCtrl->Value.GetSize(); i++) {
- if (!(TreeCtrl->Value[i].Flags & TIF_GROUP) && TreeCtrl->Value[i].User_Str1 == (const TCHAR*)Message) {
- if (TreeCtrl->Value[i].ParentID == RecentGroupID) { // found it in the same group
+ for (i = 0; i < TreeCtrl->m_value.GetSize(); i++) {
+ if (!(TreeCtrl->m_value[i].Flags & TIF_GROUP) && TreeCtrl->m_value[i].User_Str1 == (const TCHAR*)Message) {
+ if (TreeCtrl->m_value[i].ParentID == RecentGroupID) { // found it in the same group
int GroupOrder = TreeCtrl->IDToOrder(RecentGroupID);
- TreeCtrl->Value.MoveElem(i, (GroupOrder >= 0) ? (GroupOrder + 1) : 0); // now move it to the top of recent messages list
+ TreeCtrl->m_value.MoveElem(i, (GroupOrder >= 0) ? (GroupOrder + 1) : 0); // now move it to the top of recent messages list
TreeCtrl->SetModified(true);
break; // no reason to search for anything else
}
if (Title.IsEmpty()) // it's not in the same group, but at least we'll use its title
- Title = TreeCtrl->Value[i].Title;
+ Title = TreeCtrl->m_value[i].Title;
}
}
- if (i == TreeCtrl->Value.GetSize()) { // we didn't find an identical message in the same group, so we'll add our new message here
+ if (i == TreeCtrl->m_value.GetSize()) { // we didn't find an identical message in the same group, so we'll add our new message here
if (Title.IsEmpty()) { // didn't find a title for our message either
if (Message.GetLen() > MRM_MAX_GENERATED_TITLE_LEN)
Title = Message.Left(MRM_MAX_GENERATED_TITLE_LEN - 3) + _T("...");
@@ -218,17 +218,17 @@ void CProtoSettings::SetMsgFormat(int Flags, TCString Message) Title.ReleaseBuffer();
}
int GroupOrder = TreeCtrl->IDToOrder(RecentGroupID);
- TreeCtrl->Value.InsertElem(CTreeItem(Title, RecentGroupID, TreeCtrl->GenerateID(), 0, Message), (GroupOrder >= 0) ? (GroupOrder + 1) : 0);
+ TreeCtrl->m_value.InsertElem(CTreeItem(Title, RecentGroupID, TreeCtrl->GenerateID(), 0, Message), (GroupOrder >= 0) ? (GroupOrder + 1) : 0);
TreeCtrl->SetModified(true);
}
// now clean up here
int MRMNum = 0;
int MaxMRMNum = g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_RECENTMSGSCOUNT);
- for (i = 0; i < TreeCtrl->Value.GetSize(); i++) {
- if (TreeCtrl->Value[i].ParentID == RecentGroupID) { // found a child of our group
- if (TreeCtrl->Value[i].Flags & TIF_GROUP || ++MRMNum > MaxMRMNum) { // what groups are doing here?! :))
- TreeCtrl->Value.RemoveElem(i);
+ for (i = 0; i < TreeCtrl->m_value.GetSize(); i++) {
+ if (TreeCtrl->m_value[i].ParentID == RecentGroupID) { // found a child of our group
+ if (TreeCtrl->m_value[i].Flags & TIF_GROUP || ++MRMNum > MaxMRMNum) { // what groups are doing here?! :))
+ TreeCtrl->m_value.RemoveElem(i);
TreeCtrl->SetModified(true);
i--;
}
@@ -237,10 +237,10 @@ void CProtoSettings::SetMsgFormat(int Flags, TCString Message) // if we're saving recent messages per status, then remove any messages that were left at the recent messages' root
if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_PERSTATUSMRM)) {
- for (i = 0; i < TreeCtrl->Value.GetSize(); i++) {
- if (TreeCtrl->Value[i].ParentID == g_Messages_RecentRootID) {
- if (!(TreeCtrl->Value[i].Flags & TIF_GROUP)) {
- TreeCtrl->Value.RemoveElem(i);
+ for (i = 0; i < TreeCtrl->m_value.GetSize(); i++) {
+ if (TreeCtrl->m_value[i].ParentID == g_Messages_RecentRootID) {
+ if (!(TreeCtrl->m_value[i].Flags & TIF_GROUP)) {
+ TreeCtrl->m_value.RemoveElem(i);
TreeCtrl->SetModified(true);
i--;
}
@@ -284,9 +284,9 @@ TCString CProtoSettings::GetMsgFormat(int Flags, int *pOrder) Message = NULL; // to be sure it's NULL, not "" - as we're checking 'Message == NULL' later
int RecentGroupID = GetRecentGroupID(Status);
if (RecentGroupID != -1) {
- for (int i = 0; i < TreeCtrl->Value.GetSize(); i++) { // find first message in the group
- if (TreeCtrl->Value[i].ParentID == RecentGroupID && !(TreeCtrl->Value[i].Flags & TIF_GROUP)) {
- Message = TreeCtrl->Value[i].User_Str1;
+ for (int i = 0; i < TreeCtrl->m_value.GetSize(); i++) { // find first message in the group
+ if (TreeCtrl->m_value[i].ParentID == RecentGroupID && !(TreeCtrl->m_value[i].Flags & TIF_GROUP)) {
+ Message = TreeCtrl->m_value[i].User_Str1;
if (pOrder)
*pOrder = i;
break;
@@ -325,7 +325,7 @@ TCString CProtoSettings::GetMsgFormat(int Flags, int *pOrder) int Order = TreeCtrl->IDToOrder(DefMsgID); // this will return -1 in any case if something goes wrong
if (Order >= 0)
- Message = TreeCtrl->Value[Order].User_Str1;
+ Message = TreeCtrl->m_value[Order].User_Str1;
if (pOrder)
*pOrder = Order;
diff --git a/plugins/NewAwaySysMod/src/Properties.h b/plugins/NewAwaySysMod/src/Properties.h index 2f03c935a4..f9231be443 100644 --- a/plugins/NewAwaySysMod/src/Properties.h +++ b/plugins/NewAwaySysMod/src/Properties.h @@ -327,14 +327,14 @@ public: class CAutoreply
{
public:
- CAutoreply& operator = (const int Value)
+ CAutoreply& operator = (const int m_value)
{
CString Setting(Parent->szProto ? Parent->ProtoStatusToDBSetting(DB_ENABLEREPLY, IDC_MOREOPTDLG_PERSTATUSPROTOSETTINGS) : DB_ENABLEREPLY);
- if (db_get_b(NULL, MOD_NAME, Setting, VAL_USEDEFAULT) == Value)
+ if (db_get_b(NULL, MOD_NAME, Setting, VAL_USEDEFAULT) == m_value)
return *this;
- if (Value != VAL_USEDEFAULT)
- db_set_b(NULL, MOD_NAME, Setting, Value != 0);
+ if (m_value != VAL_USEDEFAULT)
+ db_set_b(NULL, MOD_NAME, Setting, m_value != 0);
else
db_unset(NULL, MOD_NAME, Setting);
return *this;
@@ -349,8 +349,8 @@ public: int IncludingParents() // takes into account global data also, if per-protocol setting is not defined
{
_ASSERT(Parent->szProto);
- int Value = *this;
- return (Value == VAL_USEDEFAULT) ? CProtoSettings(NULL).Autoreply : Value;
+ int m_value = *this;
+ return (m_value == VAL_USEDEFAULT) ? CProtoSettings(NULL).Autoreply : m_value;
}
friend class CProtoSettings;
private:
@@ -420,11 +420,11 @@ public: class CIgnore
{
public:
- CIgnore& operator = (const int Value)
+ CIgnore& operator = (const int m_value)
{
CString Setting(Parent->ContactStatusToDBSetting(DB_IGNOREREQUESTS, IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS));
MCONTACT hContact = (Parent->m_hContact != INVALID_CONTACT_ID) ? Parent->m_hContact : NULL;
- if (Value)
+ if (m_value)
db_set_b(hContact, MOD_NAME, Setting, 1);
else
db_unset(hContact, MOD_NAME, Setting);
@@ -445,15 +445,15 @@ public: class CAutoreply
{
public:
- CAutoreply& operator = (const int Value)
+ CAutoreply& operator = (const int m_value)
{
CString Setting(Parent->ContactStatusToDBSetting(DB_ENABLEREPLY, IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS));
MCONTACT hContact = (Parent->m_hContact != INVALID_CONTACT_ID) ? Parent->m_hContact : NULL;
- if (db_get_b(hContact, MOD_NAME, Setting, VAL_USEDEFAULT) == Value)
+ if (db_get_b(hContact, MOD_NAME, Setting, VAL_USEDEFAULT) == m_value)
return *this;
- if (Value != VAL_USEDEFAULT)
- db_set_b(hContact, MOD_NAME, Setting, Value != 0);
+ if (m_value != VAL_USEDEFAULT)
+ db_set_b(hContact, MOD_NAME, Setting, m_value != 0);
else
db_unset(hContact, MOD_NAME, Setting);
return *this;
@@ -462,12 +462,12 @@ public: int IncludingParents(const char *szProtoOverride = NULL) // takes into account protocol and global data also, if per-contact setting is not defined
{
_ASSERT((Parent->m_hContact && Parent->m_hContact != INVALID_CONTACT_ID) || szProtoOverride); // we need either correct protocol or a correct hContact to determine its protocol
- int Value = *this;
- if (Value == VAL_USEDEFAULT) {
+ int m_value = *this;
+ if (m_value == VAL_USEDEFAULT) {
const char *szProto = (Parent->m_hContact && Parent->m_hContact != INVALID_CONTACT_ID) ? GetContactProto(Parent->m_hContact) : szProtoOverride;
return CProtoSettings(szProto).Autoreply.IncludingParents();
}
- return Value;
+ return m_value;
}
int GetNextToggleValue()
{
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index fdceb93f39..6d0f2ae624 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -217,9 +217,9 @@ int SetAwayMsgDlgResize(HWND, LPARAM lParam, UTILRESIZECONTROL *urc) return RD_ANCHORX_LEFT | RD_ANCHORY_BOTTOM;
}
-__inline int DBValueToReplyIcon(int Value)
+__inline int DBValueToReplyIcon(int m_value)
{
- switch (Value) {
+ switch (m_value) {
case VAL_USEDEFAULT: return EXTRAIMGLIST_DOT;
case 0: return EXTRAIMGLIST_AUTOREPLY_OFF;
default: return EXTRAIMGLIST_AUTOREPLY_ON;
@@ -452,7 +452,7 @@ static Buttons[] = };
struct {
- int DlgItemID;
+ int m_dlgItemID;
TCHAR* Text;
} Tooltips[] = {
IDC_SAWAYMSG_IGNOREREQ, LPGENT("Don't send the status message to selected contact(s)"),
@@ -612,7 +612,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA ti.cbSize = sizeof(ti);
ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
for (int i = 0; i < _countof(Tooltips); i++) {
- ti.uId = (UINT_PTR)GetDlgItem(hwndDlg, Tooltips[i].DlgItemID);
+ ti.uId = (UINT_PTR)GetDlgItem(hwndDlg, Tooltips[i].m_dlgItemID);
ti.lpszText = TranslateTS(Tooltips[i].Text);
SendMessage(hWndTooltips, TTM_ADDTOOL, 0, (LPARAM)&ti);
}
@@ -711,8 +711,8 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA bool StatusDetermined = false;
for (int i = 0; i < pnm->NewSelection->GetSize(); i++) {
HTREEITEM hItem = (*pnm->NewSelection)[i];
- MCONTACT hContact;
- char *szProto;
+ MCONTACT hContact = 0;
+ char *szProto = NULL;
int ItemType = CList->GetItemType(hItem);
if (ItemType == MCLCIT_CONTACT) {
hContact = CList->GethContact(hItem);
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 73afb9408d..d0a9924980 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -229,11 +229,9 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l DestroyWindow(hdlg);
g_hSDlg = 0;
}
- else
- MessageBox(NULL, TranslateT("Current session is empty!"), TranslateT("Sessions Manager"), MB_OK | MB_ICONWARNING);
+ else MessageBox(NULL, TranslateT("Current session is empty!"), TranslateT("Sessions Manager"), MB_OK | MB_ICONWARNING);
}
- else
- MessageBox(NULL, TranslateT("Session name is empty, enter the name and try again"), TranslateT("Sessions Manager"), MB_OK | MB_ICONWARNING);
+ else MessageBox(NULL, TranslateT("Session name is empty, enter the name and try again"), TranslateT("Sessions Manager"), MB_OK | MB_ICONWARNING);
}
break;
|