Mercurial > foo_out_sdl
diff foosdk/sdk/libPPUI/CListViewCtrlEx.h @ 1:20d02a178406 default tip
*: check in everything else
yay
| author | Paper <paper@tflc.us> |
|---|---|
| date | Mon, 05 Jan 2026 02:15:46 -0500 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foosdk/sdk/libPPUI/CListViewCtrlEx.h Mon Jan 05 02:15:46 2026 -0500 @@ -0,0 +1,34 @@ +#pragma once + +class CListViewCtrlEx : public CListViewCtrl { +public: + CListViewCtrlEx( HWND wnd = NULL ) : CListViewCtrl(wnd) {} + CListViewCtrlEx const & operator=( HWND wnd ) { m_hWnd = wnd; return *this; } + unsigned InsertColumnEx(unsigned index, const wchar_t * name, unsigned widthDLU); + unsigned AddColumnEx( const wchar_t * name, unsigned widthDLU ); + void FixContextMenuPoint( CPoint & pt ); + unsigned GetColunnCount(); + + unsigned InsertString( unsigned index, const wchar_t * str ); + unsigned InsertString8( unsigned index, const char * str ); + unsigned AddString( const wchar_t * str ); + unsigned AddString8(const char * str); + void SetItemText(unsigned item, unsigned subItem, const wchar_t * str ); + void SetItemText8(unsigned item, unsigned subItem, const char * str ); + + void AutoSizeColumn( int iCol ) { SetColumnWidth(iCol, LVSCW_AUTOSIZE) ;} + int AddGroup(int iGroupID, const wchar_t * header); +}; + +// BOOL HandleLVKeyDownMod() +#define LVN_KEYDOWN_MOD_HANDLER(id, key, mod, func) \ + if (uMsg == WM_NOTIFY && LVN_KEYDOWN == ((LPNMHDR)lParam)->code && id == ((LPNMHDR)lParam)->idFrom && ((LPNMLVKEYDOWN)lParam)->wVKey == (key) && GetHotkeyModifierFlags() == (mod)) \ + { \ + SetMsgHandled(TRUE); \ + lResult = func()?1:0; \ + if(IsMsgHandled()) \ + return TRUE; \ + } + +// BOOL HandleLVCopy() +#define LVN_COPY_HANDLER(id, func) LVN_KEYDOWN_MOD_HANDLER(id, 'C', MOD_CONTROL, func)
