ReactOS 0.4.15-dev-7942-gd23573b
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 540 of file CAutoComplete.cpp.

541{
542 ATLASSERT(m_hWnd == NULL);
543 DWORD dwStyle = WS_CHILD | /*WS_VISIBLE |*/ SBS_SIZEBOX;
545 0, 0, 0, 0, hwndParent, NULL,
546 _AtlBaseModule.GetModuleInstance(), NULL);
547 SubclassWindow(hWnd); // do subclass to handle message
548 return m_hWnd;
549}
#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 593 of file CAutoComplete.cpp.

594{
595 return TRUE; // do nothing (for quick drawing)
596}

◆ OnNCHitTest()

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

Definition at line 599 of file CAutoComplete.cpp.

600{
601 return HTTRANSPARENT; // pass through
602}
#define HTTRANSPARENT
Definition: winuser.h:2473

◆ OnPaint()

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

Definition at line 605 of file CAutoComplete.cpp.

606{
607 CRect rc;
608 GetClientRect(&rc);
609
610 PAINTSTRUCT ps;
611 HDC hDC = BeginPaint(&ps);
612 if (!hDC)
613 return 0;
614
615 // fill background
617
618 // draw size-box
619 INT cxy = rc.Width();
620 for (INT shift = 0; shift < 2; ++shift)
621 {
622 // choose pen color
624 HPEN hPen = ::CreatePen(PS_SOLID, 1, ::GetSysColor(iColor));
625 HGDIOBJ hPenOld = ::SelectObject(hDC, hPen);
626 // do loop to draw the slanted lines
627 for (INT delta = cxy / 4; delta < cxy; delta += cxy / 4)
628 {
629 // draw a grip line
630 if (m_bDowner)
631 {
632 ::MoveToEx(hDC, rc.right, rc.top + delta + shift, NULL);
633 ::LineTo(hDC, rc.left + delta + shift, rc.bottom);
634 }
635 else
636 {
637 ::MoveToEx(hDC, rc.left + delta + shift, rc.top, NULL);
638 ::LineTo(hDC, rc.right, rc.bottom - delta - shift);
639 }
640 }
641 // delete pen
642 ::SelectObject(hDC, hPenOld);
643 ::DeleteObject(hPen);
644 }
645
646 EndPaint(&ps);
647 return 0;
648}
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:1539
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 551 of file CAutoComplete.cpp.

552{
553 // set flags
554 m_bDowner = bDowner;
555 m_bLongList = bLongList;
556
557 if (bLongList)
558 {
559 SetWindowRgn(NULL, TRUE); // reset window region
560 return;
561 }
562
563 RECT rc;
564 GetWindowRect(&rc); // get size-box size
565 ::OffsetRect(&rc, -rc.left, -rc.top); // window regions use special coordinates
566 ATLASSERT(rc.left == 0 && rc.top == 0);
567
568 // create a trianglar region
571 if (m_bDowner)
572 {
573 ::MoveToEx(hDC, rc.right, 0, NULL);
574 ::LineTo(hDC, rc.right, rc.bottom);
575 ::LineTo(hDC, 0, rc.bottom);
576 ::LineTo(hDC, rc.right, 0);
577 }
578 else
579 {
580 ::MoveToEx(hDC, rc.right, rc.bottom, NULL);
581 ::LineTo(hDC, rc.right, 0);
582 ::LineTo(hDC, 0, 0);
583 ::LineTo(hDC, rc.right, rc.bottom);
584 }
585 ::EndPath(hDC);
586 HRGN hRgn = ::PathToRegion(hDC);
588
589 SetWindowRgn(hRgn, TRUE); // set the trianglar region
590}
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: