-
Notifications
You must be signed in to change notification settings - Fork 125
/
Ticker.h
executable file
·131 lines (113 loc) · 4.19 KB
/
Ticker.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/******************************************************************************
Module name: Ticker.h
Written by: CRanjeet::RanjeetChakraborty() Copyright (c) 2000.
Purpose: Provides a scrolling news/stock ticker for your MFC applications.
******************************************************************************/
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is
// not sold for profit without the authors written consent, and
// providing that this notice and the authors name is included. If
// the source code in this file is used in any commercial application
// then a simple email would be nice.
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability if it causes any damage whatsoever.
// It's free - so you get what you pay for.
//
//Special thanks to Fabian Toader for providing The CJumpyDraw class
//I have borrowed the DrawLinearWash function from his class to provide
//the gradient look.
#if !defined(AFX_TICKER_H__B4018D56_EE66_11D3_96F9_0000E8E1DEED__INCLUDED_)
#define AFX_TICKER_H__B4018D56_EE66_11D3_96F9_0000E8E1DEED__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define MODE_REGULAR_TICKER 1
#define MODE_RATES_TICKER 2
#define ID_TICKER_TIMER 666
#define TRACK_TICKER_MOUSEMOVE(CTRLNAME, TICKERRECT) if(TICKERRECT.PtInRect (point)){ \
CTRLNAME.m_EdgeType = EDGE_BUMP;\
CTRLNAME.m_BorderType = BF_RECT;\
CTRLNAME.StopTicker();\
CTRLNAME.Invalidate();\
return;\
} \
else { \
CTRLNAME.m_EdgeType = EDGE_SUNKEN;\
CTRLNAME.m_EdgeType = EDGE_SUNKEN;\
CTRLNAME.m_BorderType = BF_FLAT;\
}\
/////////////////////////////////////////////////////////////////////////////
// CTicker window
class CTicker : public CStatic
{
// Construction
public:
CTicker();
~CTicker();
// Attributes
public:
UINT m_EdgeType ;
UINT m_BorderType ;
CBitmap m_BmpDragBar;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTicker)
//}}AFX_VIRTUAL
// Implementation
public:
void ShowRates(CString pszFileName,COLORREF bkg, COLORREF fore, LPCTSTR pszFontName, int FontHeight, int TickerSpeed, int mode);
void ShowRatesWithBkgBmp(CString pszFileName,COLORREF bkg, COLORREF fore, LPCTSTR pszFontName, int FontHeight, int TickerSpeed, int mode, int BmpResId);
void DrawBitmap(HDC hdc, HBITMAP hBitmap, int xStart, int yStart);
void SetTickerTextColor(COLORREF TextColor, COLORREF RatesTextColor);
void SetTickerTextColor(COLORREF TextColor);
int GetTickerSpeed();
void SetTickerSpeed(int sp);
void SetTickerTextCharVersion(char* Str);
char* GetTickerTextCharVersion();
void SetTickerFontHeight(int ht);
int GetTickerFontHeight();
CString GetTickerFontName();
void SetTickerFontName(CString FontNameStr);
void SetTickerRect(CRect rect);
CRect GetTickerRect();
CString GetTickerText();
void SetTickerText(CString DisplayStr);
void StopTicker();
void StartTicker(int mode);
void ResumeTicker();
int i;
//the gradient function
void DrawLinearWash(CDC* pDC, CRect* prc, int iSegments,
COLORREF crStart, COLORREF crEnd);
// Generated message map functions
protected:
COLORREF m_TickerRateTextColor;
COLORREF m_TickerTextColor;
int m_TickerSpeed;
int m_Mode;
CBitmap m_BmpBkg ;
BOOL m_bIsBkgBmp;
char* m_TickerTextCharVersion;
int m_TickerFontHeight;
CString m_TickerFontName;
CRect m_TickerRect;
CString m_TextToDisplay;
CFont* m_pTickerFont;
BOOL m_bTickerOn;
//{{AFX_MSG(CTicker)
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnPaint();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TICKER_H__B4018D56_EE66_11D3_96F9_0000E8E1DEED__INCLUDED_)