ReactOS 0.4.15-dev-8434-g155a7c7
CACSizeBox Class Reference

#include <CAutoComplete.h>

Inheritance diagram for CACSizeBox:
Collaboration diagram for CACSizeBox:

Public Member Functions

 CACSizeBox ()
 
HWND Create (HWND hwndParent)
 
VOID SetStatus (BOOL bDowner, BOOL bLongList)
 

Static Public Member Functions

static LPCWSTR GetWndClassName ()
 

Public Attributes

CAutoCompletem_pDropDown
 

Protected Member Functions

LRESULT OnEraseBkGnd (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNCHitTest (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnPaint (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 

Protected Attributes

BOOL m_bDowner
 
BOOL m_bLongList
 

Detailed Description

Definition at line 94 of file CAutoComplete.h.

Constructor & Destructor Documentation

◆ CACSizeBox()

CACSizeBox::CACSizeBox ( )
inline

Definition at line 99 of file CAutoComplete.h.

CAutoComplete * m_pDropDown
Definition: CAutoComplete.h:97
BOOL m_bLongList
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117

Member Function Documentation

◆ Create()

HWND CACSizeBox::Create ( HWND  hwndParent)

Definition at line 547 of file CAutoComplete.cpp.

548{
549 ATLASSERT(m_hWnd == NULL);
550 DWORD dwStyle = WS_CHILD | /*WS_VISIBLE |*/ SBS_SIZEBOX;
552 0, 0, 0, 0, hwndParent, NULL,
553 _AtlBaseModule.GetModuleInstance(), NULL);
554 SubclassWindow(hWnd); // do subclass to handle message
555 return m_hWnd;
556}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
HWND hWnd
Definition: settings.c:17
static LPCWSTR GetWndClassName()
Definition: CAutoComplete.h:98
static HWND hwndParent
Definition: cryptui.c:300
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WS_CHILD
Definition: pedump.c:617
#define SubclassWindow(hwnd, lpfn)
Definition: windowsx.h:542
#define SBS_SIZEBOX
Definition: winuser.h:329
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)

Referenced by CAutoComplete::OnCreate().

◆ GetWndClassName()

static LPCWSTR CACSizeBox::GetWndClassName ( )
inlinestatic

Definition at line 98 of file CAutoComplete.h.

98{ return WC_SCROLLBARW; }
#define WC_SCROLLBARW
Definition: commctrl.h:4729

Referenced by Create().

◆ OnEraseBkGnd()

LRESULT CACSizeBox::OnEraseBkGnd ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
protected

Definition at line 600 of file CAutoComplete.cpp.

601{
602 return TRUE; // do nothing (for quick drawing)
603}

◆ OnNCHitTest()

LRESULT CACSizeBox::OnNCHitTest ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
protected

Definition at line 606 of file CAutoComplete.cpp.

607{
608 return HTTRANSPARENT; // pass through
609}
#define HTTRANSPARENT
Definition: winuser.h:2473

◆ OnPaint()

LRESULT CACSizeBox::OnPaint ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
protected

Definition at line 612 of file CAutoComplete.cpp.

613{
614 CRect rc;
615 GetClientRect(&rc);
616
617 PAINTSTRUCT ps;
618 HDC hDC = BeginPaint(&ps);
619 if (!hDC)
620 return 0;
621
622 // fill background
624
625 // draw size-box
626 INT cxy = rc.Width();
627 for (INT shift = 0; shift < 2; ++shift)
628 {
629 // choose pen color
631 HPEN hPen = ::CreatePen(PS_SOLID, 1, ::GetSysColor(iColor));
632 HGDIOBJ hPenOld = ::SelectObject(hDC, hPen);
633 // do loop to draw the slanted lines
634 for (INT delta = cxy / 4; delta < cxy; delta += cxy / 4)
635 {
636 // draw a grip line
637 if (m_bDowner)
638 {
639 ::MoveToEx(hDC, rc.right, rc.top + delta + shift, NULL);
640 ::LineTo(hDC, rc.left + delta + shift, rc.bottom);
641 }
642 else
643 {
644 ::MoveToEx(hDC, rc.left + delta + shift, rc.top, NULL);
645 ::LineTo(hDC, rc.right, rc.bottom - delta - shift);
646 }
647 }
648 // delete pen
649 ::SelectObject(hDC, hPenOld);
650 ::DeleteObject(hPen);
651 }
652
653 EndPaint(&ps);
654 return 0;
655}
static HDC hDC
Definition: 3dtext.c:33
int Width() const noexcept
Definition: atltypes.h:461
pKey DeleteObject()
static HDC
Definition: imagelist.c:92
#define shift
Definition: input.c:1755
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
int32_t INT
Definition: typedefs.h:58
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
#define PS_SOLID
Definition: wingdi.h:586
DWORD WINAPI GetSysColor(_In_ int)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define COLOR_3DSHADOW
Definition: winuser.h:931
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:927
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define COLOR_3DFACE
Definition: winuser.h:929
_In_ ULONG iColor
Definition: xlateobj.h:17

◆ SetStatus()

VOID CACSizeBox::SetStatus ( BOOL  bDowner,
BOOL  bLongList 
)

Definition at line 558 of file CAutoComplete.cpp.

559{
560 // set flags
561 m_bDowner = bDowner;
562 m_bLongList = bLongList;
563
564 if (bLongList)
565 {
566 SetWindowRgn(NULL, TRUE); // reset window region
567 return;
568 }
569
570 RECT rc;
571 GetWindowRect(&rc); // get size-box size
572 ::OffsetRect(&rc, -rc.left, -rc.top); // window regions use special coordinates
573 ATLASSERT(rc.left == 0 && rc.top == 0);
574
575 // create a trianglar region
578 if (m_bDowner)
579 {
580 ::MoveToEx(hDC, rc.right, 0, NULL);
581 ::LineTo(hDC, rc.right, rc.bottom);
582 ::LineTo(hDC, 0, rc.bottom);
583 ::LineTo(hDC, rc.right, 0);
584 }
585 else
586 {
587 ::MoveToEx(hDC, rc.right, rc.bottom, NULL);
588 ::LineTo(hDC, rc.right, 0);
589 ::LineTo(hDC, 0, 0);
590 ::LineTo(hDC, rc.right, rc.bottom);
591 }
592 ::EndPath(hDC);
593 HRGN hRgn = ::PathToRegion(hDC);
595
596 SetWindowRgn(hRgn, TRUE); // set the trianglar region
597}
static HRGN hRgn
Definition: mapping.c:33
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HRGN WINAPI PathToRegion(_In_ HDC)
BOOL WINAPI DeleteDC(_In_ HDC)
BOOL WINAPI EndPath(_In_ HDC)
BOOL WINAPI BeginPath(_In_ HDC hdc)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
int WINAPI SetWindowRgn(_In_ HWND, _In_opt_ HRGN, _In_ BOOL)
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)

Referenced by CAutoComplete::RepositionDropDown().

Member Data Documentation

◆ m_bDowner

BOOL CACSizeBox::m_bDowner
protected

Definition at line 105 of file CAutoComplete.h.

Referenced by OnPaint(), and SetStatus().

◆ m_bLongList

BOOL CACSizeBox::m_bLongList
protected

Definition at line 106 of file CAutoComplete.h.

Referenced by SetStatus().

◆ m_pDropDown

CAutoComplete* CACSizeBox::m_pDropDown

Definition at line 97 of file CAutoComplete.h.

Referenced by CAutoComplete::OnCreate(), and CAutoComplete::OnNCDestroy().


The documentation for this class was generated from the following files: