# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1305680543 0 # Node ID 452388c9c3d865c0379e05b17085b64374d500e4 # Parent a943f973c3ff43fa38418c3cf0b5baf41e9706ae Attempt at fixing no SELECT event being triggered during container insertion on OS/2. diff -r a943f973c3ff -r 452388c9c3d8 os2/dw.c --- a/os2/dw.c Tue May 17 23:27:33 2011 +0000 +++ b/os2/dw.c Wed May 18 01:02:23 2011 +0000 @@ -4766,7 +4766,7 @@ WC_CONTAINER, NULL, WS_VISIBLE | CCS_READONLY | - (multi ? CCS_EXTENDSEL : CCS_SINGLESEL) | + (multi ? CCS_MULTIPLESEL : CCS_SINGLESEL) | CCS_AUTOPOSITION, 0,0,2000,1000, NULLHANDLE, @@ -7574,6 +7574,25 @@ } } +/* Internal function to get the first item with given flags */ +PRECORDCORE _dw_container_start(HWND handle, unsigned long flags) +{ + PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); + + if(pCore) + { + while(pCore) + { + if(pCore->flRecordAttr & flags) + { + return pCore; + } + pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); + } + } + return NULL; +} + /* * Sets the title of a row in the container. * Parameters: @@ -7585,6 +7604,7 @@ { RECORDINSERT recin; ContainerInfo *ci = (ContainerInfo *)pointer; + PRECORDCORE pCore; if(!ci) return; @@ -7599,6 +7619,17 @@ _dw_send_msg(handle, CM_INSERTRECORD, MPFROMP(ci->data), MPFROMP(&recin), 0); free(ci); + + if((pCore = _dw_container_start(handle, CRA_CURSORED))) + { + NOTIFYRECORDEMPHASIS pre; + + pre.pRecord = pCore; + pre.fEmphasisMask = CRA_CURSORED; + pre.hwndCnr = handle; + _run_event(handle, WM_CONTROL, MPFROM2SHORT(0, CN_EMPHASIS), (MPARAM)&pre); + pre.pRecord->flRecordAttr |= CRA_CURSORED; + } } /* @@ -7714,7 +7745,7 @@ return pCore->pszIcon; } } - return NULL; + return NULL; } /*