aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/General/gen_ml/skinnededit.h
blob: d56eaed6410f31b6b17d8190adba35c09a8a77ad (plain) (blame)
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
#ifndef NULLOSFT_MEDIALIBRARY_SKINNED_EDIT_HEADER
#define NULLOSFT_MEDIALIBRARY_SKINNED_EDIT_HEADER

#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

#include "./skinnedwnd.h"


class SkinnedEdit : public SkinnedWnd
{
protected:
	SkinnedEdit(void);
	virtual ~SkinnedEdit(void);

protected:
	virtual BOOL Attach(HWND hwndEdit);
	virtual LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam); // treat this as dialog proc
	virtual void OnPaint(void);
	virtual void OnSkinUpdated(BOOL bNotifyChildren, BOOL bRedraw);
	virtual void OnWindowPosChanged(WINDOWPOS *pwp);
	virtual void OnSetFont(HFONT hFont, BOOL fRedraw);
	void FontChanged();

private:
	friend BOOL SkinWindowEx(HWND hwndToSkin, INT type, UINT style);
	void EraseBckGnd(HDC hdc, RECT *prc, RECT *prcText, BOOL fEraseAll, HBRUSH hBrush);
	void DrawText(HDC hdc, RECT *prc, RECT *prcText, LPCWSTR pszText, INT cchText);
	LRESULT OverrideDefault(UINT uMsg, WPARAM wParam, LPARAM lParam);

	typedef struct __SELECTION
	{
		INT first;
		INT last;
		LONG leftX;
		LONG rightX;
	} SELECTION;

	BOOL GetSelection(SELECTION *selection, INT cchText, const RECT *clientRect);

protected:
	int firstVisible;
	int lastVisible;
	int firstSelected;
	int lastSelected;
	INT maxCharWidth;
	WPARAM mouseWParam;
	LPARAM mouseLParam;
	int	cx;
	int cy;
};

#endif // NULLOSFT_MEDIALIBRARY_SKINNED_EDIT_HEADER