29 #include "../../idlib/precompiled.h"
32 #include "../../sys/win32/win_local.h"
78 mWindow = CreateWindowEx ( 0,
"LISTBOX",
"", WS_VSCROLL|WS_CHILD|WS_VISIBLE|LBS_OWNERDRAWFIXED|LBS_NOINTEGRALHEIGHT|LBS_NOTIFY, 0, 0, 0, 0, parent, (HMENU)
id,
win32.
hInstance, 0 );
80 SetWindowLong (
mWindow, GWL_USERDATA, (
LONG)
this );
83 LoadLibrary (
"Riched20.dll" );
84 mEdit = CreateWindowEx ( 0,
"RichEdit20A",
"", WS_CHILD, 0, 0, 0, 0,
mWindow, (HMENU) 999,
win32.
hInstance,
NULL );
85 SendMessage (
mEdit, EM_SETEVENTMASK, 0, ENM_KEYEVENTS );
92 ZeroMemory ( &lf,
sizeof(lf) );
93 lf.lfHeight = -MulDiv(8, GetDeviceCaps(dc, LOGPIXELSY), 72);
94 strcpy ( lf.lfFaceName,
"MS Shell Dlg" );
95 SendMessage (
mWindow, WM_SETFONT, (WPARAM)CreateFontIndirect ( &lf ), 0 );
96 SendMessage (
mEdit, WM_SETFONT, (WPARAM)CreateFontIndirect ( &lf ), 0 );
113 MoveWindow (
mWindow, x, y, w, h, redraw );
134 SendMessage (
mWindow, LB_GETITEMRECT, item, (
LPARAM)&rItem );
137 rItem.right = rItem.left +
mSplitter - 1;
149 MoveWindow (
mEdit, rItem.left, rItem.top + 2,
150 rItem.right - rItem.left,
151 rItem.bottom - rItem.top - 2,
TRUE );
152 ShowWindow (
mEdit, SW_SHOW );
183 GetWindowText (
mEdit, value, 1023 );
188 MessageBeep ( MB_ICONASTERISK );
197 nmpg.
hdr.idFrom = GetWindowLong (
mWindow, GWL_ID );
230 ShowWindow (
mEdit, SW_HIDE );
254 ShowWindow (
mEdit, SW_HIDE );
284 return SendMessage (
mWindow, LB_INSERTSTRING, insert, (
LONG)item );
303 SendMessage (
mWindow, LB_DELETESTRING, index, 0 );
318 for ( i = SendMessage (
mWindow, LB_GETCOUNT, 0, 0 ); i > 0; i -- )
324 SendMessage (
mWindow, LB_RESETCONTENT, 0, 0 );
333 SendMessage (
mWindow, LB_ADDSTRING, 0, (
LONG)item );
397 nmkey.hdr.code = NM_KEYDOWN;
398 nmkey.hdr.hwndFrom = grid->
mWindow;
399 nmkey.nVKey = wParam;
400 nmkey.uFlags = HIWORD(lParam);
401 nmkey.hdr.idFrom = GetWindowLong ( hWnd, GWL_ID );
402 SendMessage (
GetParent ( hWnd ), WM_NOTIFY, nmkey.hdr.idFrom, (
LPARAM)&nmkey );
427 hdr = (NMHDR*)lParam;
428 if ( hdr->idFrom == 999 )
430 if ( hdr->code == EN_MSGFILTER )
433 filter = (MSGFILTER*)lParam;
434 if ( filter->msg == WM_KEYDOWN )
436 switch ( filter->wParam )
449 if ( filter->msg == WM_CHAR || filter->msg == WM_KEYUP )
451 switch ( filter->wParam )
465 if ( lParam == (
long)grid->
mEdit )
467 if ( HIWORD(wParam) == EN_KILLFOCUS )
475 case WM_LBUTTONDBLCLK:
476 grid->
mSelectedItem = SendMessage ( hWnd, LB_ITEMFROMPOINT, 0, lParam );
492 item = (short)LOWORD(SendMessage ( hWnd, LB_ITEMFROMPOINT, 0, lParam ));
499 pt.
x = LOWORD(lParam);
500 pt.
y = HIWORD(lParam);
502 SendMessage ( hWnd, LB_GETITEMRECT, item, (
LPARAM)&rItem );
506 rItem.right = rItem.left + grid->
mSplitter - 1;
507 if ( PtInRect ( &rItem, pt) )
515 rItem.left = rItem.left + grid->
mSplitter + 1;
516 if ( PtInRect ( &rItem, pt) )
524 ClientToScreen ( hWnd, &pt );
525 ScreenToClient ( grid->
mEdit, &pt );
526 SendMessage ( grid->
mEdit, WM_LBUTTONDOWN, wParam, MAKELONG(pt.
x,pt.
y) );
536 GetClientRect ( hWnd, &rClient );
537 FillRect ( (
HDC)wParam, &rClient, GetSysColorBrush ( COLOR_3DFACE ) );
544 GetCursorPos ( &point );
545 ScreenToClient ( hWnd, &point );
548 SetCursor ( LoadCursor (
NULL, MAKEINTRESOURCE(IDC_SIZEWE)));
555 return CallWindowProc ( grid->
mListWndProc, hWnd, msg, wParam, lParam );
573 switch ( HIWORD(wParam) )
589 MEASUREITEMSTRUCT* mis = (MEASUREITEMSTRUCT*) lParam;
590 mis->itemHeight = 18;
607 DRAWITEMSTRUCT* dis = (DRAWITEMSTRUCT*) lParam;
620 brush = GetSysColorBrush ( COLOR_SCROLLBAR );
621 rTemp.right = rTemp.left + 10;
622 FillRect ( dis->hDC, &rTemp, brush );
623 rTemp.left = rTemp.right;
624 rTemp.right = dis->rcItem.right;
629 brush = GetSysColorBrush ( COLOR_SCROLLBAR );
631 else if ( dis->itemState & ODS_SELECTED )
633 brush = GetSysColorBrush ( COLOR_HIGHLIGHT );
637 brush = GetSysColorBrush ( COLOR_WINDOW );
640 FillRect ( dis->hDC, &rTemp, brush );
642 HPEN pen = CreatePen ( PS_SOLID, 1, GetSysColor ( COLOR_SCROLLBAR ) );
643 HPEN oldpen = (HPEN)SelectObject ( dis->hDC, pen );
644 MoveToEx ( dis->hDC, dis->rcItem.left, dis->rcItem.top,
NULL );
645 LineTo ( dis->hDC, dis->rcItem.right, dis->rcItem.top );
646 MoveToEx ( dis->hDC, dis->rcItem.left, dis->rcItem.bottom,
NULL );
647 LineTo ( dis->hDC, dis->rcItem.right, dis->rcItem.bottom);
651 MoveToEx ( dis->hDC, dis->rcItem.left +
mSplitter, dis->rcItem.top,
NULL );
652 LineTo ( dis->hDC, dis->rcItem.left +
mSplitter, dis->rcItem.bottom );
654 SelectObject ( dis->hDC, oldpen );
655 DeleteObject ( pen );
657 int colorIndex = ( (dis->itemState & ODS_SELECTED ) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT );
658 SetTextColor ( dis->hDC, GetSysColor ( colorIndex ) );
659 SetBkMode ( dis->hDC, TRANSPARENT );
660 SetBkColor ( dis->hDC, GetSysColor ( COLOR_3DFACE ) );
667 DrawText ( dis->hDC, item->
mName, item->
mName.
Length(), &rText, DT_LEFT|DT_VCENTER|DT_SINGLELINE );
669 rText.left = dis->rcItem.left +
mSplitter + 2;
670 rText.right = dis->rcItem.right;
671 DrawText ( dis->hDC, item->
mValue, item->
mValue.
Length(), &rText, DT_LEFT|DT_VCENTER|DT_SINGLELINE );
GLsizei const GLfloat * value
assert(prefInfo.fullscreenBtn)
int Cmp(const char *text) const
CONST PIXELFORMATDESCRIPTOR UINT
void RemoveAllItems(void)
GLuint GLuint GLsizei GLenum type
void Move(int x, int y, int w, int h, BOOL redraw=FALSE)
const char * GetItemValue(int index)
int Icmp(const char *text) const
bool Create(HWND parent, int id, int style=0)
int AddItem(const char *name, const char *value, EItemType type=PGIT_STRING)
GLubyte GLubyte GLubyte GLubyte w
bool ReflectMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
void RemoveItem(int index)
typedef HDC(WINAPI *PFNWGLGETCURRENTREADDCARBPROC)(void)
void SetCurSel(int index)
void StartEdit(int item, bool label)
int HandleDrawItem(WPARAM wParam, LPARAM lParam)
MFnDagNode * GetParent(MFnDagNode *joint)
if(!ValidDisplayID(prefInfo.prefDisplayID)) prefInfo.prefDisplayID
static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
rvPropertyGrid::EItemType mType
const char * GetItemName(int index)