diff options
author | pescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7> | 2008-04-13 23:45:56 +0000 |
---|---|---|
committer | pescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7> | 2008-04-13 23:45:56 +0000 |
commit | 6ae86c78a2ab8ab7ee876f9caf11e5c3079284fe (patch) | |
tree | db56a9f62ca680088b817df8cd053b849d036f96 /Plugins/emoticons/EmoticonsSelectionLayout.h | |
parent | 134649159b4928ef0370c25d3a74d3c59e61e147 (diff) |
New grouped selection window
git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@79 c086bb3d-8645-0410-b8da-73a8550f86e7
Diffstat (limited to 'Plugins/emoticons/EmoticonsSelectionLayout.h')
-rw-r--r-- | Plugins/emoticons/EmoticonsSelectionLayout.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/Plugins/emoticons/EmoticonsSelectionLayout.h b/Plugins/emoticons/EmoticonsSelectionLayout.h new file mode 100644 index 0000000..e0b2bb7 --- /dev/null +++ b/Plugins/emoticons/EmoticonsSelectionLayout.h @@ -0,0 +1,68 @@ +#define MIN_COLS 5
+#define MAX_LINES 8
+#define MAX_COLS 12
+#define BORDER 3
+
+
+struct EmoticonSelectionData
+{
+ Module *module;
+ COLORREF background;
+
+ int xPosition;
+ int yPosition;
+ int Direction;
+ HWND hwndTarget;
+ UINT targetMessage;
+ LPARAM targetWParam;
+};
+
+
+class EmoticonsSelectionLayout
+{
+public:
+ EmoticonSelectionData *ssd;
+ HWND hwnd;
+ int selection;
+
+ struct {
+ int width;
+ int height;
+ } window;
+
+ virtual void Load() = 0;
+
+ virtual void OnUp(HWND hwnd) = 0;
+ virtual void OnDown(HWND hwnd) = 0;
+ virtual void OnLeft(HWND hwnd) = 0;
+ virtual void OnRight(HWND hwnd) = 0;
+
+ virtual void Draw(HDC hdc) = 0;
+
+ virtual void SetSelection(HWND hwnd, POINT p) = 0;
+
+ void SetSelection(HWND hwnd, int sel);
+
+ virtual void CreateToolTips() = 0;
+
+ void DestroyToolTips();
+
+protected:
+
+ HFONT GetFont(HDC hdc);
+ void ReleaseFont(HFONT hFont);
+ RECT CalcRect(TCHAR *txt);
+
+ void GetEmoticonSize(Emoticon *e, int &width, int &height);
+
+ int GetNumOfCols(int num_emotes);
+ int GetNumOfLines(int num_emotes, int cols);
+
+ void CreateEmoticonToolTip(Emoticon *e, RECT fr);
+
+ void EraseBackground(HDC hdc);
+
+ void DrawEmoticon(HDC hdc, int index, RECT rc);
+ void DrawEmoticonText(HDC hdc, TCHAR *txt, RECT rc);
+
+};
|