From 6ae86c78a2ab8ab7ee876f9caf11e5c3079284fe Mon Sep 17 00:00:00 2001 From: pescuma Date: Sun, 13 Apr 2008 23:45:56 +0000 Subject: New grouped selection window git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@79 c086bb3d-8645-0410-b8da-73a8550f86e7 --- Plugins/emoticons/EmoticonsSelectionLayout.h | 68 ++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Plugins/emoticons/EmoticonsSelectionLayout.h (limited to 'Plugins/emoticons/EmoticonsSelectionLayout.h') 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); + +}; -- cgit v1.2.3