diff options
Diffstat (limited to 'plugins/Quotes/src/QuoteChart.cpp')
-rw-r--r-- | plugins/Quotes/src/QuoteChart.cpp | 276 |
1 files changed, 138 insertions, 138 deletions
diff --git a/plugins/Quotes/src/QuoteChart.cpp b/plugins/Quotes/src/QuoteChart.cpp index a60d5d0a7e..c0fec78d59 100644 --- a/plugins/Quotes/src/QuoteChart.cpp +++ b/plugins/Quotes/src/QuoteChart.cpp @@ -88,16 +88,16 @@ namespace switch(msg)
{
case WM_CREATE:
- {
- CREATESTRUCT* pCS = reinterpret_cast<CREATESTRUCT*>(lp);
- MCONTACT hContact = reinterpret_cast<HANDLE>(pCS->lpCreateParams);
+ {
+ CREATESTRUCT* pCS = reinterpret_cast<CREATESTRUCT*>(lp);
+ MCONTACT hContact = reinterpret_cast<HANDLE>(pCS->lpCreateParams);
- TChart* pChart = new TChart;
- read_log_file(hContact,*pChart);
+ TChart* pChart = new TChart;
+ read_log_file(hContact,*pChart);
- ::SetWindowLongPtr(hWnd,GWLP_USERDATA,reinterpret_cast<LONG_PTR>(pChart));
- }
- return 0;
+ ::SetWindowLongPtr(hWnd,GWLP_USERDATA,reinterpret_cast<LONG_PTR>(pChart));
+ }
+ return 0;
case CHART_SET_SOURCE:
break;
@@ -106,11 +106,11 @@ namespace break;
case WM_SIZE:
- {
- TChart* pChart = get_chart_ptr(hWnd);
- pChart->SetRect(0,0,LOWORD(lp),HIWORD(lp));
- }
- return 0;
+ {
+ TChart* pChart = get_chart_ptr(hWnd);
+ pChart->SetRect(0,0,LOWORD(lp),HIWORD(lp));
+ }
+ return 0;
case WM_PAINT:
if(TRUE == ::GetUpdateRect(hWnd,NULL,FALSE))
@@ -127,12 +127,12 @@ namespace return 0;
case WM_DESTROY:
- {
- TChart* pChart = get_chart_ptr(hWnd);
- ::SetWindowLongPtr(hWnd,GWLP_USERDATA,0);
- delete pChart;
- }
- break;
+ {
+ TChart* pChart = get_chart_ptr(hWnd);
+ ::SetWindowLongPtr(hWnd,GWLP_USERDATA,0);
+ delete pChart;
+ }
+ break;
}
return ::DefWindowProc(hWnd,msg,wp,lp);
@@ -201,90 +201,90 @@ namespace switch(msg)
{
case WM_INITDIALOG:
- {
- MCONTACT hContact = reinterpret_cast<HANDLE>(lp);
+ {
+ MCONTACT hContact = reinterpret_cast<HANDLE>(lp);
- TranslateDialogDefault(hDlg);
+ TranslateDialogDefault(hDlg);
- tstring sName = get_window_text(hDlg);
- sName += _T(" - ");
- sName += GetContactName(hContact);
- ::SetWindowText(hDlg,sName.c_str());
+ tstring sName = get_window_text(hDlg);
+ sName += _T(" - ");
+ sName += GetContactName(hContact);
+ ::SetWindowText(hDlg,sName.c_str());
- HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX,false);
- assert(hWL);
- WindowList_Add(hWL,hDlg,hContact);
+ HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX,false);
+ assert(hWL);
+ WindowList_Add(hWL,hDlg,hContact);
- ::SetWindowLongPtr(hDlg,GWLP_USERDATA,reinterpret_cast<LONG_PTR>(hContact));
+ ::SetWindowLongPtr(hDlg,GWLP_USERDATA,reinterpret_cast<LONG_PTR>(hContact));
- static LPCTSTR szSources[] = {LPGENT("Log File"), LPGENT("Miranda's History")};
- static LPCTSTR szFilters[] = {LPGENT("All"), LPGENT("Last Day"), LPGENT("Last Week"), LPGENT("Last Month"), LPGENT("Last Year"), LPGENT("User-Defined")};
+ static LPCTSTR szSources[] = {LPGENT("Log File"), LPGENT("Miranda's History")};
+ static LPCTSTR szFilters[] = {LPGENT("All"), LPGENT("Last Day"), LPGENT("Last Week"), LPGENT("Last Month"), LPGENT("Last Year"), LPGENT("User-Defined")};
- for(int i = 0;i < sizeof(szSources)/sizeof(szSources[0]);++i)
- {
- LPCTSTR p = TranslateTS(szSources[i]);
- ::SendDlgItemMessage(hDlg,IDC_COMBO_DATA_SOURCE,CB_INSERTSTRING,-1,reinterpret_cast<LPARAM>(p));
- }
+ for(int i = 0;i < sizeof(szSources)/sizeof(szSources[0]);++i)
+ {
+ LPCTSTR p = TranslateTS(szSources[i]);
+ ::SendDlgItemMessage(hDlg,IDC_COMBO_DATA_SOURCE,CB_INSERTSTRING,-1,reinterpret_cast<LPARAM>(p));
+ }
- int nSel = db_get_b(hContact,QUOTES_PROTOCOL_NAME,"Chart_Source",srcLogFile);
- ::SendDlgItemMessage(hDlg,IDC_COMBO_DATA_SOURCE,CB_SETCURSEL,nSel,0);
+ int nSel = db_get_b(hContact,QUOTES_PROTOCOL_NAME,"Chart_Source",srcLogFile);
+ ::SendDlgItemMessage(hDlg,IDC_COMBO_DATA_SOURCE,CB_SETCURSEL,nSel,0);
- for(int i = 0;i < sizeof(szFilters)/sizeof(szFilters[0]);++i)
- {
- LPCTSTR p = TranslateTS(szSources[i]);
- ::SendDlgItemMessage(hDlg,IDC_COMBO_FILTER,CB_INSERTSTRING,-1,reinterpret_cast<LPARAM>(szFilters[i]));
- }
+ for(int i = 0;i < sizeof(szFilters)/sizeof(szFilters[0]);++i)
+ {
+ LPCTSTR p = TranslateTS(szSources[i]);
+ ::SendDlgItemMessage(hDlg,IDC_COMBO_FILTER,CB_INSERTSTRING,-1,reinterpret_cast<LPARAM>(szFilters[i]));
+ }
- nSel = db_get_b(hContact,QUOTES_PROTOCOL_NAME,"Chart_Filter",filterAll);
- ::SendDlgItemMessage(hDlg,IDC_COMBO_FILTER,CB_SETCURSEL,nSel,0);
+ nSel = db_get_b(hContact,QUOTES_PROTOCOL_NAME,"Chart_Filter",filterAll);
+ ::SendDlgItemMessage(hDlg,IDC_COMBO_FILTER,CB_SETCURSEL,nSel,0);
- update_filter_controls(hDlg);
+ update_filter_controls(hDlg);
- register_chart_control();
- HWND hwndImage = ::GetDlgItem(hDlg,IDC_STATIC_IMAGE);
- RECT rcImage;
- ::GetWindowRect(hwndImage,&rcImage);
- screen_2_client(hDlg,&rcImage);
- //BOOL bResult = ShowWindow(hwndImage,SW_HIDE);
- //assert(bResult);
+ register_chart_control();
+ HWND hwndImage = ::GetDlgItem(hDlg,IDC_STATIC_IMAGE);
+ RECT rcImage;
+ ::GetWindowRect(hwndImage,&rcImage);
+ screen_2_client(hDlg,&rcImage);
+ //BOOL bResult = ShowWindow(hwndImage,SW_HIDE);
+ //assert(bResult);
- HWND hChart = ::CreateWindowEx(0L,CHART_CTRL_CLASS,NULL,WS_CHILDWINDOW|WS_VISIBLE,
- rcImage.left,rcImage.top,rcImage.right-rcImage.left,rcImage.bottom-rcImage.top,
- hDlg,reinterpret_cast<HMENU>(ID_CHART),CModuleInfo::GetInstance().GetModuleHandle(),hContact);
- assert(NULL != hChart);
+ HWND hChart = ::CreateWindowEx(0L,CHART_CTRL_CLASS,NULL,WS_CHILDWINDOW|WS_VISIBLE,
+ rcImage.left,rcImage.top,rcImage.right-rcImage.left,rcImage.bottom-rcImage.top,
+ hDlg,reinterpret_cast<HMENU>(ID_CHART),CModuleInfo::GetInstance().GetModuleHandle(),hContact);
+ assert(NULL != hChart);
- Utils_RestoreWindowPosition(hDlg,hContact,QUOTES_MODULE_NAME,WINDOW_PREFIX);
- BOOL bResult = ::ShowWindow(hDlg,SW_SHOW);
- assert(bResult);
- }
- return (TRUE);
+ Utils_RestoreWindowPosition(hDlg,hContact,QUOTES_MODULE_NAME,WINDOW_PREFIX);
+ BOOL bResult = ::ShowWindow(hDlg,SW_SHOW);
+ assert(bResult);
+ }
+ return (TRUE);
case WM_CLOSE:
- {
- MCONTACT hContact = get_contact(hDlg);
- SetWindowLongPtr(hDlg,GWLP_USERDATA,0);
+ {
+ MCONTACT hContact = get_contact(hDlg);
+ SetWindowLongPtr(hDlg,GWLP_USERDATA,0);
-// save_options(hDlg,hContact);
+ // save_options(hDlg,hContact);
- HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX,false);
- assert(hWL);
- WindowList_Remove(hWL,hDlg);
- Utils_SaveWindowPosition(hDlg,hContact,QUOTES_MODULE_NAME,WINDOW_PREFIX);
+ HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX,false);
+ assert(hWL);
+ WindowList_Remove(hWL,hDlg);
+ Utils_SaveWindowPosition(hDlg,hContact,QUOTES_MODULE_NAME,WINDOW_PREFIX);
- HWND hwndChart = ::GetDlgItem(hDlg,ID_CHART);
- BOOL bResult = ::DestroyWindow(hwndChart);
- assert(bResult);
-
- ::EndDialog(hDlg,0);
- }
- return (TRUE);
+ HWND hwndChart = ::GetDlgItem(hDlg,ID_CHART);
+ BOOL bResult = ::DestroyWindow(hwndChart);
+ assert(bResult);
+
+ ::EndDialog(hDlg,0);
+ }
+ return (TRUE);
case WM_COMMAND:
switch(LOWORD(wp))
{
case IDCANCEL:
- {
- SendMessage(hDlg, WM_CLOSE, 0, 0);
- }
- return (TRUE);
+ {
+ SendMessage(hDlg, WM_CLOSE, 0, 0);
+ }
+ return (TRUE);
case IDC_COMBO_FILTER:
if(CBN_SELCHANGE == HIWORD(wp))
{
@@ -301,68 +301,68 @@ namespace }
return (FALSE);
case WM_NOTIFY:
+ {
+ LPNMHDR pNMHDR = reinterpret_cast<LPNMHDR>(lp);
+ switch(pNMHDR->code)
{
- LPNMHDR pNMHDR = reinterpret_cast<LPNMHDR>(lp);
- switch(pNMHDR->code)
+ case NM_CLICK:
+ if(IDC_SYSLINK_PROVIDER == wp)
{
- case NM_CLICK:
- if(IDC_SYSLINK_PROVIDER == wp)
- {
- PNMLINK pNMLink = reinterpret_cast<PNMLINK>(pNMHDR);
- ::ShellExecute(hDlg,_T("open"),pNMLink->item.szUrl,NULL,NULL,SW_SHOWNORMAL);
- }
- break;
+ PNMLINK pNMLink = reinterpret_cast<PNMLINK>(pNMHDR);
+ ::ShellExecute(hDlg,_T("open"),pNMLink->item.szUrl,NULL,NULL,SW_SHOWNORMAL);
}
+ break;
}
- break;
-// case WM_ERASEBKGND:
-// {
-// HDC hdc = reinterpret_cast<HDC>(wp);
-// TChart* pChart = get_chart_ptr(hDlg);
-// pChart->DrawBackground(hdc);
-// return TRUE;
-// }
-// break;
+ }
+ break;
+ // case WM_ERASEBKGND:
+ // {
+ // HDC hdc = reinterpret_cast<HDC>(wp);
+ // TChart* pChart = get_chart_ptr(hDlg);
+ // pChart->DrawBackground(hdc);
+ // return TRUE;
+ // }
+ // break;
case WM_SIZE:
- {
- enum{ INDENT = 7};
-
- int nWidth = LOWORD(lp);
- int nHeight = HIWORD(lp);
-
- HWND hwndChart = GetDlgItem(hDlg,ID_CHART);
- HWND hwndLink = GetDlgItem(hDlg,IDC_SYSLINK_PROVIDER);
- HWND hwndClose = GetDlgItem(hDlg,IDCANCEL);
-
- RECT rcDlg;
- GetClientRect(hDlg,&rcDlg);
-
- RECT rcChart;
- GetWindowRect(hwndChart,&rcChart);
- screen_2_client(hDlg,&rcChart);
-
- RECT rcLink;
- GetWindowRect(hwndLink,&rcLink);
- screen_2_client(hDlg,&rcLink);
- SetWindowPos(hwndLink,NULL,rcDlg.left + INDENT,
- rcDlg.bottom-INDENT-(rcLink.bottom-rcLink.top),
- 0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
-
- RECT rcClose;
- GetWindowRect(hwndClose,&rcClose);
- screen_2_client(hDlg,&rcClose);
- SetWindowPos(hwndClose,NULL,rcDlg.right - INDENT - (rcClose.right-rcClose.left),
- rcDlg.bottom-INDENT-(rcClose.bottom-rcClose.top),
- 0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
-
- SetWindowPos(hwndChart,NULL,rcDlg.left + INDENT,
- rcChart.top,
- (nWidth-INDENT*2),
- nHeight-(rcClose.bottom-rcClose.top)-INDENT*2-rcChart.top,
- SWP_NOZORDER|SWP_NOACTIVATE);
+ {
+ enum{ INDENT = 7};
+
+ int nWidth = LOWORD(lp);
+ int nHeight = HIWORD(lp);
+
+ HWND hwndChart = GetDlgItem(hDlg,ID_CHART);
+ HWND hwndLink = GetDlgItem(hDlg,IDC_SYSLINK_PROVIDER);
+ HWND hwndClose = GetDlgItem(hDlg,IDCANCEL);
+
+ RECT rcDlg;
+ GetClientRect(hDlg,&rcDlg);
+
+ RECT rcChart;
+ GetWindowRect(hwndChart,&rcChart);
+ screen_2_client(hDlg,&rcChart);
+
+ RECT rcLink;
+ GetWindowRect(hwndLink,&rcLink);
+ screen_2_client(hDlg,&rcLink);
+ SetWindowPos(hwndLink,NULL,rcDlg.left + INDENT,
+ rcDlg.bottom-INDENT-(rcLink.bottom-rcLink.top),
+ 0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
+
+ RECT rcClose;
+ GetWindowRect(hwndClose,&rcClose);
+ screen_2_client(hDlg,&rcClose);
+ SetWindowPos(hwndClose,NULL,rcDlg.right - INDENT - (rcClose.right-rcClose.left),
+ rcDlg.bottom-INDENT-(rcClose.bottom-rcClose.top),
+ 0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
+
+ SetWindowPos(hwndChart,NULL,rcDlg.left + INDENT,
+ rcChart.top,
+ (nWidth-INDENT*2),
+ nHeight-(rcClose.bottom-rcClose.top)-INDENT*2-rcChart.top,
+ SWP_NOZORDER|SWP_NOACTIVATE);
- }
- break;
+ }
+ break;
}
return (FALSE);
}
|