-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtextview.h
75 lines (56 loc) · 2.31 KB
/
textview.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
/* Sergeev Artemiy, 33601/2 (3057/2) */
#ifndef _TEXTVIEW_H_
#define _TEXTVIEW_H_
#include "viewbuf.h"
#include "win.h"
/* Project namespace */
namespace notepad
{
/* Window for view text class */
class textview : public win
{
private:
viewbuf buffer; // Buffer with text to be displayed
unsigned int textWidth, // Average width (in pixels) of one character
textHeight, // Height (in pixels) of one character
stringsInPage, // Count of string, which can contains in work window's area
charsInPage, // Count of characters, which can contains in work window's area
scrollX, // Current count of scrolls by X-axis
scrollY; // Current count of scrolls by Y-axis
public:
/* Default class constructor */
textview( int cmdShow = SW_SHOWNORMAL, char *cmdLine = NULL, HINSTANCE hInst = NULL, char *windowName = "Task" );
/* Class destructor */
~textview( void );
/* Shift text in window by X-axis */
void ShiftX( int shift );
/* Shift text in window by Y-axis */
void ShiftY( int shift );
/* Hide or show scrollbar and set new scrollbar position function */
void UpdateScrollBar( void );
/***
* Virtual functions for window customization
***/
/* Initialization function */
virtual void Init( void );
/* Deinitialization function */
virtual void Close( void );
/* Change window size handle function */
virtual void Resize( void );
/* Paint window content function */
virtual void Paint( void );
/* Erase background handle function */
virtual void Erase( void );
/* Keyboard state handle function */
virtual void Key(unsigned int vk, bool fDown, int cRepeat, unsigned int flags);
/* WM_MOUSEWHEEL window message handle function */
virtual void MouseWheel(int xPos, int yPos, int zDelta, unsigned int fwKeys);
/* WM_COMMAND window message handle function */
virtual void Command(int id, HWND hwndCtl, unsigned int codeNotify);
/* WM_HSCROLL window message handle function */
virtual void HScroll(HWND hwndCtl, unsigned int code, int pos);
/* WM_VSCROLL window message handle function */
virtual void VScroll(HWND hwndCtl, unsigned int code, int pos);
};
}
#endif /* _TEXTVIEW_H_ */