// Win32++ Version 7.2
// Released: 5th AUgust 2011
//
// David Nash
// email: dnash@bigpond.net.au
// url: https://sourceforge.net/projects/win32-framework
//
//
// Copyright (c) 2005-2011 David Nash
//
// Permission is hereby granted, free of charge, to
// any person obtaining a copy of this software and
// associated documentation files (the "Software"),
// to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify,
// merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom
// the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice
// shall be included in all copies or substantial portions
// of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
// SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
// ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
// OR OTHER DEALINGS IN THE SOFTWARE.
//
////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
// stdcontrols.h
// Declaration of the CButton, CEdit, CListBox and CStatic classes
// The Button, Edit, ListBox and Static controls are often referred to
// as "standard controls". These set of older controls were originally
// developed for Win16 operating systems (Windows 3.1 and 3.11). They use an
// older form of notification, and send their notifications via a WM_COMMAND
// message. Newer controls send their notifications via a WM_NOTIFY message.
#ifndef _WIN32XX_STDCONTROLS_H_
#define _WIN32XX_STDCONTROLS_H_
#include "wincore.h"
namespace Win32xx
{
class CButton : public CWnd
{
public:
CButton() {}
virtual ~CButton() {}
// Attributes
HBITMAP GetBitmap() const;
UINT GetButtonStyle() const;
int GetCheck() const;
HCURSOR GetCursor() const;
HICON GetIcon() const;
UINT GetState() const;
HBITMAP SetBitmap(HBITMAP hBitmap) const;
void SetButtonStyle(DWORD dwStyle, BOOL bRedraw) const;
void SetCheck(int nCheckState) const;
HCURSOR SetCursor(HCURSOR hCursor) const;
HICON SetIcon(HICON hIcon) const;
void SetState(BOOL bHighlight) const;
protected:
// Overridables
virtual void PreCreate(CREATESTRUCT& cs);
};
class CEdit : public CWnd
{
public:
// Construction
CEdit() {}
virtual ~CEdit() {}
// Attributes
BOOL CanUndo() const;
int CharFromPos(CPoint pt) const;
int GetFirstVisibleLine() const;
HLOCAL GetHandle() const;
UINT GetLimitText() const;
int GetLine(int nIndex, LPTSTR lpszBuffer) const;
int GetLine(int nIndex, LPTSTR lpszBuffer, int nMaxLength) const;
int GetLineCount() const;
DWORD GetMargins() const;
BOOL GetModify() const;
TCHAR GetPasswordChar() const;
void GetRect(LPRECT lpRect) const;
void GetSel(int& nStartChar, int& nEndChar) const;
DWORD GetSel() const;
CPoint PosFromChar(UINT nChar) const;
void SetHandle(HLOCAL hBuffer) const;
void SetLimitText(UINT nMax) const;
void SetMargins(UINT nLeft, UINT nRight) const;
void SetModify(BOOL bModified = TRUE) const;
// Operations
void EmptyUndoBuffer() const;
BOOL FmtLines(BOOL bAddEOL) const;
void LimitText(int nChars = 0) const;
int LineFromChar(int nIndex = -1) const;
int LineIndex(int nLine = -1) const;
int LineLength(int nLine = -1) const;
void LineScroll(int nLines, int nChars = 0) const;
void ReplaceSel(LPCTSTR lpszNewText, BOOL bCanUndo) const;
void SetPasswordChar(TCHAR ch) const;
BOOL SetReadOnly(BOOL bReadOnly = TRUE) const;
void SetRect(LPCRECT lpRect) const;
void SetRectNP(LPCRECT lpRect) const;
void SetSel(DWORD dwSelection, BOOL bNoScroll) const;
void SetSel(int nStartChar, int nEndChar, BOOL bNoScroll) const;
BOOL SetTabStops(int nTabStops, LPINT rgTabStops) const;
BOOL SetTabStops() const;
BOOL SetTabStops(const int& cxEachStop) const;
//Clipboard Operations
void Clear() const;
void Copy() const;
void Cut() const;
void Paste() const;
void Undo() const;
protected:
// Overridables
virtual void PreRegisterClass(WNDCLASS &