Ejemplo n.º 1
0
/*********************************************************************
*
*       LISTVIEW_DeleteColumn
*/
void LISTVIEW_DeleteColumn(LISTVIEW_Handle hObj, unsigned Index) {
  if (hObj) {
    LISTVIEW_Obj* pObj;
    WM_LOCK();
    pObj = LISTVIEW_H2P(hObj);
    if (Index < GUI_ARRAY_GetNumItems(&pObj->AlignArray)) {
      unsigned NumRows, i;
      GUI_ARRAY* pRow;
      HEADER_DeleteItem(pObj->hHeader, Index);
      GUI_ARRAY_DeleteItem(&pObj->AlignArray, Index);
      NumRows = GUI_ARRAY_GetNumItems(&pObj->RowArray);
      for (i = 0; i < NumRows; i++) {
        LISTVIEW_ITEM * pItem;
        pRow = (GUI_ARRAY*)GUI_ARRAY_GetpItem(&pObj->RowArray, i);
        /* Delete attached info items */
        pItem = (LISTVIEW_ITEM *)GUI_ARRAY_GetpItem(pRow, Index);
        if (pItem->hItemInfo) {
          GUI_ALLOC_Free(pItem->hItemInfo);
        }
        /* Delete cell */
        GUI_ARRAY_DeleteItem(pRow, Index);
      }
      LISTVIEW__UpdateScrollParas(hObj, pObj);
      LISTVIEW__InvalidateInsideArea(hObj, pObj);
    }
    WM_UNLOCK();
  }
}
Ejemplo n.º 2
0
/*********************************************************************
*
*       MENU_DeleteItem
*/
void MENU_DeleteItem(MENU_Handle hObj, U16 ItemId) {
    if (hObj) {
        int Index;
        WM_LOCK();
        Index = MENU__FindItem(hObj, ItemId, &hObj);
        if (Index >= 0) {
            MENU_Obj* pObj;
            pObj = MENU_H2P(hObj);
            GUI_ARRAY_DeleteItem(&pObj->ItemArray, Index);
            MENU__ResizeMenu(hObj, pObj);
        }
        WM_UNLOCK();
    }
}
Ejemplo n.º 3
0
/*********************************************************************
*
*       DROPDOWN_DeleteItem
*/
void DROPDOWN_DeleteItem(DROPDOWN_Handle hObj, unsigned int Index) {
  if (hObj) {
    DROPDOWN_Obj * pObj;
    unsigned int NumItems;
    NumItems = DROPDOWN_GetNumItems(hObj);
    if (Index < NumItems) {
      WM_LOCK();
      pObj = DROPDOWN_H2P(hObj);
      GUI_ARRAY_DeleteItem(&pObj->Handles, Index);
      WM_InvalidateWindow(hObj);
      if (pObj->hListWin) {
        LISTBOX_DeleteItem(pObj->hListWin, Index);
      }
      WM_UNLOCK();
    }
  }
}
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();
    }
}