Mercurial > dwindows
comparison os2/dw.c @ 1019:452388c9c3d8
Attempt at fixing no SELECT event being triggered during container insertion on OS/2.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Wed, 18 May 2011 01:02:23 +0000 |
parents | b7e7e2bc8085 |
children | c63abcab5312 |
comparison
equal
deleted
inserted
replaced
1018:a943f973c3ff | 1019:452388c9c3d8 |
---|---|
4764 WindowData *blah = calloc(1, sizeof(WindowData)); | 4764 WindowData *blah = calloc(1, sizeof(WindowData)); |
4765 HWND tmp = WinCreateWindow(HWND_OBJECT, | 4765 HWND tmp = WinCreateWindow(HWND_OBJECT, |
4766 WC_CONTAINER, | 4766 WC_CONTAINER, |
4767 NULL, | 4767 NULL, |
4768 WS_VISIBLE | CCS_READONLY | | 4768 WS_VISIBLE | CCS_READONLY | |
4769 (multi ? CCS_EXTENDSEL : CCS_SINGLESEL) | | 4769 (multi ? CCS_MULTIPLESEL : CCS_SINGLESEL) | |
4770 CCS_AUTOPOSITION, | 4770 CCS_AUTOPOSITION, |
4771 0,0,2000,1000, | 4771 0,0,2000,1000, |
4772 NULLHANDLE, | 4772 NULLHANDLE, |
4773 HWND_TOP, | 4773 HWND_TOP, |
4774 id ? id : (GlobalID++), | 4774 id ? id : (GlobalID++), |
7572 pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); | 7572 pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); |
7573 count++; | 7573 count++; |
7574 } | 7574 } |
7575 } | 7575 } |
7576 | 7576 |
7577 /* Internal function to get the first item with given flags */ | |
7578 PRECORDCORE _dw_container_start(HWND handle, unsigned long flags) | |
7579 { | |
7580 PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); | |
7581 | |
7582 if(pCore) | |
7583 { | |
7584 while(pCore) | |
7585 { | |
7586 if(pCore->flRecordAttr & flags) | |
7587 { | |
7588 return pCore; | |
7589 } | |
7590 pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); | |
7591 } | |
7592 } | |
7593 return NULL; | |
7594 } | |
7595 | |
7577 /* | 7596 /* |
7578 * Sets the title of a row in the container. | 7597 * Sets the title of a row in the container. |
7579 * Parameters: | 7598 * Parameters: |
7580 * handle: Handle to the container window (widget). | 7599 * handle: Handle to the container window (widget). |
7581 * pointer: Pointer to the allocated memory in dw_container_alloc(). | 7600 * pointer: Pointer to the allocated memory in dw_container_alloc(). |
7583 */ | 7602 */ |
7584 void API dw_container_insert(HWND handle, void *pointer, int rowcount) | 7603 void API dw_container_insert(HWND handle, void *pointer, int rowcount) |
7585 { | 7604 { |
7586 RECORDINSERT recin; | 7605 RECORDINSERT recin; |
7587 ContainerInfo *ci = (ContainerInfo *)pointer; | 7606 ContainerInfo *ci = (ContainerInfo *)pointer; |
7607 PRECORDCORE pCore; | |
7588 | 7608 |
7589 if(!ci) | 7609 if(!ci) |
7590 return; | 7610 return; |
7591 | 7611 |
7592 recin.cb = sizeof(RECORDINSERT); | 7612 recin.cb = sizeof(RECORDINSERT); |
7597 recin.cRecordsInsert = rowcount; | 7617 recin.cRecordsInsert = rowcount; |
7598 | 7618 |
7599 _dw_send_msg(handle, CM_INSERTRECORD, MPFROMP(ci->data), MPFROMP(&recin), 0); | 7619 _dw_send_msg(handle, CM_INSERTRECORD, MPFROMP(ci->data), MPFROMP(&recin), 0); |
7600 | 7620 |
7601 free(ci); | 7621 free(ci); |
7622 | |
7623 if((pCore = _dw_container_start(handle, CRA_CURSORED))) | |
7624 { | |
7625 NOTIFYRECORDEMPHASIS pre; | |
7626 | |
7627 pre.pRecord = pCore; | |
7628 pre.fEmphasisMask = CRA_CURSORED; | |
7629 pre.hwndCnr = handle; | |
7630 _run_event(handle, WM_CONTROL, MPFROM2SHORT(0, CN_EMPHASIS), (MPARAM)&pre); | |
7631 pre.pRecord->flRecordAttr |= CRA_CURSORED; | |
7632 } | |
7602 } | 7633 } |
7603 | 7634 |
7604 /* | 7635 /* |
7605 * Removes all rows from a container. | 7636 * Removes all rows from a container. |
7606 * Parameters: | 7637 * Parameters: |
7712 { | 7743 { |
7713 dw_window_set_data(handle, "_dw_pcore", (void *)pCore); | 7744 dw_window_set_data(handle, "_dw_pcore", (void *)pCore); |
7714 return pCore->pszIcon; | 7745 return pCore->pszIcon; |
7715 } | 7746 } |
7716 } | 7747 } |
7717 return NULL; | 7748 return NULL; |
7718 } | 7749 } |
7719 | 7750 |
7720 /* | 7751 /* |
7721 * Continues an existing query of a container. | 7752 * Continues an existing query of a container. |
7722 * Parameters: | 7753 * Parameters: |