23
#ifndef TEXTVIEWWIDGET_H
24
#define TEXTVIEWWIDGET_H
26
#include "../InterfaceControl.h"
33
// Rename it to ScrollArea or ScrollWindow
34
class TextViewWidget: public ActiveInterfaceObject
38
virtual ~TextViewWidget();
40
virtual long ProcessEvent(IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
41
virtual void Draw(GraphicsContext& GfxContext, bool force_draw);
42
virtual void DrawContent(GraphicsContext& GfxContext, bool force_draw);
43
virtual void PostDraw(GraphicsContext& GfxContext, bool force_draw) {};
46
void EnableVerticalScrollBar(bool b);
47
void EnableHorizontalScrollBar(bool b);
50
//! Set the table size to be constrained by the size content.
52
Set the table size to be such that all the content items of the table are visible .
53
The scrollbar will be useless as the content is entirely visible all the time. If the table is empty, then it assume its minimum size.
54
This is needed for table inside ComboBox drop down memu.
55
@param b If b is true, the size of the table is constrained by its content.
56
@see IsSizeMatchLayout()
58
void SetSizeMatchContent(bool b);
60
//! Check if the table size is constrained by the content of the table.
62
Check if the table size is constrained by its content.
63
@return If the return value is true, the table size is constrained by its content.
64
@see SetSizeMatchContent
66
bool IsSizeMatchContent() const;
68
// bool SetMaxSizeMatchLayout(Size size)
70
// m_MaxSizeMatchLayout = size;
71
// if(m_MaxSizeMatchLayout.GetWidth() < 0)
72
// m_MaxSizeMatchLayout.SetWidth(0);
73
// if(m_MaxSizeMatchLayout.GetBaseHeight() < 0)
74
// m_MaxSizeMatchLayout.SetHeight(0);
78
bool m_bSizeMatchContent;
81
// Inherited from BaseObject
82
virtual void setGeometry(const Geometry& geo);
87
void OnSizeGrigMouseDown(int x, int y, unsigned long button_flags, unsigned long key_flags);
88
void OnSizeGrigMouseDrag(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags);
89
void EmitMouseDrag(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags);
90
//void EmitInternalResize(int x, int y, int w, int h);
96
// virtual void ScrollLeft(float stepx, int mousedx);
97
// virtual void ScrollRight(float stepx, int mousedx);
98
// virtual void ScrollUp(float stepy, int mousedy);
99
// virtual void ScrollDown(float stepy, int mousedy);
101
virtual void ResetScrollToLeft();
102
virtual void ResetScrollToRight();
103
virtual void ResetScrollToUp();
104
virtual void ResetScrollToDown();
106
int m_ContentOffsetX;
107
int m_ContentOffsetY;
109
// Geometry of the layout that encompass the child layouts.
112
int m_ViewContentWidth;
113
int m_ViewContentHeight;
120
Geometry m_ViewGeometry;
121
Geometry m_ContentGeometry;
124
sigc::signal<void> SigTest;
125
sigc::signal<void> sigMoveWindow;
126
sigc::signal<void, int, int, int, int> sigResize;
129
//SmartPtrGLTexture m_BackgroundTexture;
131
// Backup texture to speed up scrolling
132
TRefGL<IOpenGLFrameBufferObject> m_FrameBufferObject;
133
TRefGL<IOpenGLTexture2D> m_TextureBuffer[2];
134
void SwapTextureIndex() {m_TextureIndex = (m_TextureIndex == 0)? 1 : 0;}
135
void SetTextureIndex(int index) {m_TextureIndex = index;}
136
int GetTextureIndex() {return m_TextureIndex;}
138
bool m_ReformatTexture;
142
HScrollBar *hscrollbar;
143
VScrollBar *vscrollbar;
144
bool m_horizontal_scrollbar_enable;
145
bool m_vertical_scrollbar_enable;
147
int m_SizeGripDragPositionX; //<<<--- remove this
148
int m_SizeGripDragPositionY;
152
int getBorder() const;
153
int getTopBorder() const;
154
void setBorder(int border);
155
void setTopBorder(int top_border);
161
void SetViewContentLeftMargin(int margin) { m_ViewContentLeftMargin = margin; }
162
int GetViewContentLeftMargin() const { return m_ViewContentLeftMargin; }
163
void SetViewContentRightMargin(int margin) { m_ViewContentRightMargin = margin; }
164
int GetViewContentRightMargin() const { return m_ViewContentRightMargin; }
165
void SetViewContentTopMargin(int margin) { m_ViewContentTopMargin = margin; }
166
int GetViewContentTopMargin() const { return m_ViewContentTopMargin; }
167
void SetViewContentBottomMargin(int margin) { m_ViewContentBottomMargin = margin; }
168
int GetViewContentBottomMargin() const { return m_ViewContentBottomMargin; }
170
int m_ViewContentLeftMargin;
171
int m_ViewContentRightMargin;
172
int m_ViewContentTopMargin;
173
int m_ViewContentBottomMargin;
176
void FormatContent();
177
virtual void PreLayoutManagement();
178
virtual long PostLayoutManagement(long LayoutResult);
179
virtual void PositionChildLayout(float offsetX, float offsetY);
181
virtual void PreLayoutManagement2();
182
virtual long PostLayoutManagement2(long LayoutResult);
187
///////////////////////////////////////////////////////
188
// AbstractInterfaceObject
189
///////////////////////////////////////////////////////
194
#endif // TEXTVIEWWIDGET_H
23
#ifndef TEXTVIEWWIDGET_H
24
#define TEXTVIEWWIDGET_H
26
#include "../InterfaceControl.h"
33
// Rename it to ScrollArea or ScrollWindow
34
class TextViewWidget: public ActiveInterfaceObject
38
virtual ~TextViewWidget();
40
virtual long ProcessEvent(IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
41
virtual void Draw(GraphicsContext& GfxContext, bool force_draw);
42
virtual void DrawContent(GraphicsContext& GfxContext, bool force_draw);
43
virtual void PostDraw(GraphicsContext& GfxContext, bool force_draw) {};
46
void EnableVerticalScrollBar(bool b);
47
void EnableHorizontalScrollBar(bool b);
50
//! Set the table size to be constrained by the size content.
52
Set the table size to be such that all the content items of the table are visible .
53
The scrollbar will be useless as the content is entirely visible all the time. If the table is empty, then it assume its minimum size.
54
This is needed for table inside ComboBox drop down memu.
55
@param b If b is true, the size of the table is constrained by its content.
56
@see IsSizeMatchLayout()
58
void SetSizeMatchContent(bool b);
60
//! Check if the table size is constrained by the content of the table.
62
Check if the table size is constrained by its content.
63
@return If the return value is true, the table size is constrained by its content.
64
@see SetSizeMatchContent
66
bool IsSizeMatchContent() const;
68
// bool SetMaxSizeMatchLayout(Size size)
70
// m_MaxSizeMatchLayout = size;
71
// if(m_MaxSizeMatchLayout.GetWidth() < 0)
72
// m_MaxSizeMatchLayout.SetWidth(0);
73
// if(m_MaxSizeMatchLayout.GetBaseHeight() < 0)
74
// m_MaxSizeMatchLayout.SetHeight(0);
78
bool m_bSizeMatchContent;
81
// Inherited from BaseObject
82
virtual void setGeometry(const Geometry& geo);
87
void OnSizeGrigMouseDown(int x, int y, unsigned long button_flags, unsigned long key_flags);
88
void OnSizeGrigMouseDrag(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags);
89
void EmitMouseDrag(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags);
90
//void EmitInternalResize(int x, int y, int w, int h);
96
// virtual void ScrollLeft(float stepx, int mousedx);
97
// virtual void ScrollRight(float stepx, int mousedx);
98
// virtual void ScrollUp(float stepy, int mousedy);
99
// virtual void ScrollDown(float stepy, int mousedy);
101
virtual void ResetScrollToLeft();
102
virtual void ResetScrollToRight();
103
virtual void ResetScrollToUp();
104
virtual void ResetScrollToDown();
106
int m_ContentOffsetX;
107
int m_ContentOffsetY;
109
// Geometry of the layout that encompass the child layouts.
112
int m_ViewContentWidth;
113
int m_ViewContentHeight;
120
Geometry m_ViewGeometry;
121
Geometry m_ContentGeometry;
124
sigc::signal<void> SigTest;
125
sigc::signal<void> sigMoveWindow;
126
sigc::signal<void, int, int, int, int> sigResize;
129
//SmartPtrGLTexture m_BackgroundTexture;
131
// Backup texture to speed up scrolling
132
TRefGL<IOpenGLFrameBufferObject> m_FrameBufferObject;
133
TRefGL<IOpenGLTexture2D> m_TextureBuffer[2];
134
void SwapTextureIndex() {m_TextureIndex = (m_TextureIndex == 0)? 1 : 0;}
135
void SetTextureIndex(int index) {m_TextureIndex = index;}
136
int GetTextureIndex() {return m_TextureIndex;}
138
bool m_ReformatTexture;
142
HScrollBar *hscrollbar;
143
VScrollBar *vscrollbar;
144
bool m_horizontal_scrollbar_enable;
145
bool m_vertical_scrollbar_enable;
147
int m_SizeGripDragPositionX; //<<<--- remove this
148
int m_SizeGripDragPositionY;
152
int getBorder() const;
153
int getTopBorder() const;
154
void setBorder(int border);
155
void setTopBorder(int top_border);
161
void SetViewContentLeftMargin(int margin) { m_ViewContentLeftMargin = margin; }
162
int GetViewContentLeftMargin() const { return m_ViewContentLeftMargin; }
163
void SetViewContentRightMargin(int margin) { m_ViewContentRightMargin = margin; }
164
int GetViewContentRightMargin() const { return m_ViewContentRightMargin; }
165
void SetViewContentTopMargin(int margin) { m_ViewContentTopMargin = margin; }
166
int GetViewContentTopMargin() const { return m_ViewContentTopMargin; }
167
void SetViewContentBottomMargin(int margin) { m_ViewContentBottomMargin = margin; }
168
int GetViewContentBottomMargin() const { return m_ViewContentBottomMargin; }
170
int m_ViewContentLeftMargin;
171
int m_ViewContentRightMargin;
172
int m_ViewContentTopMargin;
173
int m_ViewContentBottomMargin;
176
void FormatContent();
177
virtual void PreLayoutManagement();
178
virtual long PostLayoutManagement(long LayoutResult);
179
virtual void PositionChildLayout(float offsetX, float offsetY);
181
virtual void PreLayoutManagement2();
182
virtual long PostLayoutManagement2(long LayoutResult);
187
///////////////////////////////////////////////////////
188
// AbstractInterfaceObject
189
///////////////////////////////////////////////////////
194
#endif // TEXTVIEWWIDGET_H