Ejemplo n.º 1
0
/*********************************************************************
*
*       _FreeAttached
*
* Purpose:
*   Delete attached objects (if any).
*/
static void _FreeAttached(LISTVIEW_Obj * pObj) {
  int i, j, NumRows, NumColumns;
  NumRows    = LISTVIEW__GetNumRows(pObj);
  NumColumns = LISTVIEW__GetNumColumns(pObj);
  for (i = 0; i < NumRows; i++) {
    LISTVIEW_ROW* pRow;
    pRow = (LISTVIEW_ROW*) GUI_ARRAY_GetpItem(&pObj->RowArray, i);
    /* Delete attached info items */
    for (j = 0; j < NumColumns; j++) {
      LISTVIEW_CELL* pCell;
      pCell = (LISTVIEW_CELL*) GUI_ARRAY_GetpItem(&pRow->CellArray, j);
      if (pCell) {
        if (pCell->hCellInfo) {
          GUI_ALLOC_Free(pCell->hCellInfo);
        }
      }
    }
    /* Delete row */
    GUI_ARRAY_Delete(&pRow->CellArray);
  }
  /* Delete sort object */
  if (pObj->hSort) {
    ((LISTVIEW_SORT *)GUI_ALLOC_h2p(pObj->hSort))->fpFree(pObj->hSort);
  }
  GUI_ARRAY_Delete(&pObj->ColumnArray);
  GUI_ARRAY_Delete(&pObj->RowArray);
}
Ejemplo n.º 2
0
/*********************************************************************
*
*       _RADIO_Callback
*/
static void _RADIO_Callback (WM_MESSAGE* pMsg) {
  RADIO_Handle hObj;
  RADIO_Obj*   pObj;
  hObj = pMsg->hWin;
  pObj = RADIO_H2P(hObj);
  /* Let widget handle the standard messages */
  if (WIDGET_HandleActive(hObj, pMsg) == 0) {
    return;
  }
  switch (pMsg->MsgId) {
  case WM_PAINT:
    GUI_DEBUG_LOG("RADIO: _Callback(WM_PAINT)\n");
    _OnPaint(hObj, pObj);
    return;
  case WM_GET_RADIOGROUP:
    pMsg->Data.v = pObj->GroupId;
    return;
  case WM_TOUCH:
    _OnTouch(hObj, pObj, pMsg);
    break;
  case WM_KEY:
    _OnKey(hObj, pMsg);
    break;
  case WM_DELETE:
    GUI_ARRAY_Delete(&pObj->TextArray);
    break;
  }
  WM_DefaultProc(pMsg);
}
Ejemplo n.º 3
0
/*********************************************************************
*
*       _FreeAttached
*
* Purpose:
*   Delete attached objects (if any).
*/
static void _FreeAttached(LISTVIEW_Obj * pObj) {
  int i, j, NumRows, NumColumns;
  NumRows    = GUI_ARRAY_GetNumItems(&pObj->RowArray);
  NumColumns = GUI_ARRAY_GetNumItems(&pObj->AlignArray);
  for (i = 0; i < NumRows; i++) {
    GUI_ARRAY * pRow;
    pRow = (GUI_ARRAY *)GUI_ARRAY_GetpItem(&pObj->RowArray, i);
    /* Delete attached info items */
    for (j = 0; j < NumColumns; j++) {
      LISTVIEW_ITEM * pItem;
      pItem = (LISTVIEW_ITEM *)GUI_ARRAY_GetpItem(pRow, j);
      if (pItem->hItemInfo) {
        GUI_ALLOC_Free(pItem->hItemInfo);
      }
    }
    /* Delete row */
    GUI_ARRAY_Delete(pRow);
  }
  GUI_ARRAY_Delete(&pObj->AlignArray);
  GUI_ARRAY_Delete(&pObj->RowArray);
}
Ejemplo n.º 4
0
/*********************************************************************
*
*       LISTVIEW_DeleteRow
*/
void LISTVIEW_DeleteRow(LISTVIEW_Handle hObj, unsigned Index) {
    if (hObj) {
        LISTVIEW_Obj* pObj;
        unsigned NumRows;
        WM_LOCK();
        pObj = LISTVIEW_H2P(hObj);
        NumRows = GUI_ARRAY_GetNumItems(&pObj->RowArray);
        if (Index < NumRows) {
            unsigned NumColumns, i;
            GUI_ARRAY* pRow;
            pRow = (GUI_ARRAY*)GUI_ARRAY_GetpItem(&pObj->RowArray, Index);
            /* Delete attached info items */
            NumColumns = GUI_ARRAY_GetNumItems(pRow);
            for (i = 0; i < NumColumns; i++) {
                LISTVIEW_ITEM * pItem;
                pItem = (LISTVIEW_ITEM *)GUI_ARRAY_GetpItem(pRow, i);
                if (pItem->hItemInfo) {
                    GUI_ALLOC_Free(pItem->hItemInfo);
                }
            }
            /* Delete row */
            GUI_ARRAY_Delete(pRow);
            GUI_ARRAY_DeleteItem(&pObj->RowArray, Index);
            /* Adjust properties */
            if (pObj->Sel == (signed int)Index) {
                pObj->Sel = -1;
            }
            if (pObj->Sel > (signed int)Index) {
                pObj->Sel--;
            }
            if (LISTVIEW__UpdateScrollParas(hObj, pObj)) {
                LISTVIEW__InvalidateInsideArea(hObj, pObj);
            } else {
                _InvalidateRowAndBelow(hObj, pObj, Index);
            }
        }
        WM_UNLOCK();
    }
}
Ejemplo n.º 5
0
/*********************************************************************
*
*       _FreeAttached
*/
static void _FreeAttached(DROPDOWN_Obj* pObj) {
  GUI_ARRAY_Delete(&pObj->Handles);
  WM_DeleteWindow(pObj->hListWin);
}
Ejemplo n.º 6
0
/*********************************************************************
*
*       _FreeAttached
*/
static void _FreeAttached(LISTBOX_Obj* pObj) {
  GUI_ARRAY_Delete(&pObj->ItemArray);
}