Click here to Skip to main content
Click here to Skip to main content
Articles » Database » Database » General » Downloads
 
Add your own
alternative version
Go to top

PostgreSQL/libpqxx Class Generator

, 18 Aug 2006
Automated generation of PostgreSQL data transfer classes.
/*
$Id: WtlEditBrowserCtrl.h 2069 2006-08-16 01:00:57Z phil $
*/
#if !defined EDITBROWSERCTRL_H
#define EDITBROWSERCTRL_H

#include <AtlCrack.h>
#include <atlmisc.h>
#include <atlctrls.h>

#define BTN_UP          0x01
#define BTN_DOWN        0x02
#define BTN_DISABLED    0x04
#define BTN_FLAT        0x08

// Brush sizes for drawing the button background
#define BRUSHWIDTH      8
#define BRUSHHEIGHT     8

#define FEC_BUTTONLEFT			0x00000010

#define WM_EB_PRESS				WM_USER + 4444
class CWtlEditBrowserCtrl : public CWindowImpl< CWtlEditBrowserCtrl, CEdit, CControlWinTraits>
{
private:
    int				m_nButtonState;        // current button state (up, down, or disabled)
    int             m_nButtonWidth;        // the width of the button (-1 is default)
    CRect           m_rcButtonRect;        // window coordinates of the button
    BOOL            m_bMouseCaptured;      // button has captured the mouse?
public:
	CWtlEditBrowserCtrl();

	typedef CWtlEditBrowserCtrl			thisClass;

	BEGIN_MSG_MAP(CWtlEditBrowserCtrl)
		MESSAGE_HANDLER( WM_CREATE, OnCreate )
		MESSAGE_HANDLER( WM_NCLBUTTONDOWN, OnNcLButtonDown )
		MESSAGE_HANDLER( WM_LBUTTONUP, OnLButtonUp )
		MESSAGE_HANDLER( WM_NCCALCSIZE, OnNcCalcSize )
		MESSAGE_HANDLER( WM_NCHITTEST, OnNcHitTest )
		MESSAGE_HANDLER( WM_NCPAINT, OnNcPaint )
	END_MSG_MAP()

	virtual BOOL SubclassWindow( HWND hWnd );
	virtual BOOL PreTranslateMessage(MSG* pMsg);

    void ButtonClicked();                   // handles a mouse click on the button

	LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnNcLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
private:
	void DrawButton(int nButtonState);
	void DrawDots(CDC& pDC, COLORREF CR, int nOffset = 0);

	BOOL ScreenPointInButtonRect(CPoint point);
};

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

_oti

Australia Australia
No Biography provided

| Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 18 Aug 2006
Article Copyright 2005 by _oti
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid