diff options
author | Robert Pösel <robyer@seznam.cz> | 2013-10-29 18:17:04 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2013-10-29 18:17:04 +0000 |
commit | 4d01f5f5096cb4d22c4a7ba17cc82977c7f5f19b (patch) | |
tree | 9353d79ddff12a1c2ced3e300d61a516f2572fb5 /plugins/MirandaG15/LCDFramework/src/CLCDTextLog.h | |
parent | 2307fd7414d16d4ff936607a215e9a2ca0294741 (diff) |
Adopted MirandaG15 plugin
First compilable version and 32-bit only.
git-svn-id: http://svn.miranda-ng.org/main/trunk@6681 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirandaG15/LCDFramework/src/CLCDTextLog.h')
-rw-r--r-- | plugins/MirandaG15/LCDFramework/src/CLCDTextLog.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/plugins/MirandaG15/LCDFramework/src/CLCDTextLog.h b/plugins/MirandaG15/LCDFramework/src/CLCDTextLog.h new file mode 100644 index 0000000000..312ec8a992 --- /dev/null +++ b/plugins/MirandaG15/LCDFramework/src/CLCDTextLog.h @@ -0,0 +1,90 @@ +#ifndef _CLCDTEXTLOG_H_
+#define _CLCDTEXTLOG_H_
+
+#include "CLCDTextObject.h"
+#include "CLCDBar.h"
+
+
+enum EScrollMode {SCROLL_NONE, SCROLL_MESSAGE,SCROLL_LINE };
+enum EExpandMode { EXPAND_SCROLL, EXPAND_UP,EXPAND_DOWN };
+
+class CLCDTextLog : public CLCDTextObject
+{
+public:
+
+
+ // Constructor
+ CLCDTextLog();
+ // Destructor
+ ~CLCDTextLog();
+
+ // Initializes the log
+ bool Initialize();
+ // Deinitializes the log
+ bool Shutdown();
+
+ // updates the log
+ bool Update();
+ // draws the log
+ bool Draw(CLCDGfx *pGfx);
+
+ // sets the logs text
+ void SetText(tstring strText);
+ // adds some text to the log
+ void AddText(tstring strText,bool bForceAutoscroll=false);
+ // sets the maximum number of log entrys
+ void SetLogSize(int iSize);
+ // clears the log
+ void ClearLog();
+
+ // scrolls one line up
+ bool ScrollUp();
+ // scrolls one line down
+ bool ScrollDown();
+ // scrolls to the specified line
+ bool ScrollTo(int iIndex);
+
+ // associates a scrollbar with the log
+ void SetScrollbar(CLCDBar *pScrollbar);
+
+ // sets the autoscrolling mode
+ void SetAutoscrollMode(EScrollMode eMode);
+ // sets the expand mode
+ void SetExpandMode(EExpandMode eMode);
+
+protected:
+ // called when the logs font has changed
+ void OnFontChanged();
+ // called when the logs size has changed
+ void OnSizeChanged(SIZE OldSize);
+
+ // rewraps all textlines
+ void RefreshLines();
+private:
+ // the log entry class
+ class CLogEntry
+ {
+ public:
+ tstring strString;
+ int iLines;
+ vector<tstring> vLines;
+ };
+
+ // wraps the specified log entry
+ void WrapMessage(CLogEntry *pEntry);
+
+ EScrollMode m_eAutoScroll;
+ EExpandMode m_eExpandMode;
+
+ int m_iLogSize;
+ int m_iPosition;
+ int m_iTextLines;
+ int m_iLastScrollDirection;
+
+ DWORD m_dwLastScroll;
+
+ list<CLogEntry*> m_Entrys;
+ CLCDBar *m_pScrollbar;
+};
+
+#endif
\ No newline at end of file |