grid.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:4k
- /* **************************************************************************************
- * Copyright (c) 2002 ZORAN Corporation, All Rights Reserved
- * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
- *
- * File: $Workfile: Grid.h $
- *
- * Description:
- * ============
- * Menu system choice extension widget
- *
- * Log:
- * ====
- * $Revision: 3 $
- * Last Modified by $Author: Nirm $ at $Modtime: 23/04/02 9:06 $
- ****************************************************************************************
- * Updates:
- ****************************************************************************************
- * $Log: /I49/H49V/UI/Menu_sys/Grid.h $
- *
- * 3 23/04/02 9:39 Nirm
- * - Added dependency in "Config.h".
- *
- * 2 25/12/01 10:24 Atai
- * Code Cleaning
- *
- *
- **************************************************************************************** */
- #include "Config.h" // Global Configuration - do not remove!
- #ifndef _GRID_H_
- #define _GRID_H_
- // Values for m_wAttrs orientation
- #define GRID_VERTICAL 0x0000
- #define GRID_HORIZONTAL 0x0001
- #define GRID_IS_HORIZONTAL(_pGrid_) ( ((_pGrid_)->m_wAttrs & GRID_HORIZONTAL) == GRID_HORIZONTAL )
- #define GRID_IS_VERTICAL(_pGrid_) (!GRID_IS_HORIZONTAL(_pGrid_))
- // Values for m_wAttrs h-wrap
- #define GRID_HWRAP_PREV_NEXT 0x0002
- #define GRID_HWRAP_SAME_ROW 0x0004
- #define GRID_HWRAP (GRID_HWRAP_PREV_NEXT | GRID_HWRAP_SAME_ROW)
- #define GRID_IS_HWRAP(_pGrid_) ((_pGrid_)->m_wAttrs & GRID_HWRAP)
- #define GRID_IS_HWRAP_PREV_NEXT(_pGrid_) ( ((_pGrid_)->m_wAttrs & GRID_HWRAP_PREV_NEXT) == GRID_HWRAP_PREV_NEXT )
- #define GRID_IS_HWRAP_SAME_ROW(_pGrid_) ( ((_pGrid_)->m_wAttrs & GRID_HWRAP_SAME_ROW) == GRID_HWRAP_SAME_ROW )
- // Values for m_wAttrs v-wrap
- #define GRID_VWRAP_PREV_NEXT 0x0008
- #define GRID_VWRAP_SAME_COLUMN 0x0010
- #define GRID_VWRAP (GRID_VWRAP_PREV_NEXT | GRID_VWRAP_SAME_COLUMN)
- #define GRID_IS_VWRAP(_pGrid_) ((_pGrid_)->m_wAttrs & GRID_VWRAP)
- #define GRID_IS_VWRAP_PREV_NEXT(_pGrid_) ( ((_pGrid_)->m_wAttrs & GRID_VWRAP_PREV_NEXT) == GRID_VWRAP_PREV_NEXT )
- #define GRID_IS_VWRAP_SAME_COLUMN(_pGrid_) ( ((_pGrid_)->m_wAttrs & GRID_VWRAP_SAME_COLUMN) == GRID_VWRAP_SAME_COLUMN )
- // For horizontal grids, this member is used for items per row
- #define m_wItemsPerRow m_wItemsPerColumn
- typedef struct oGrid
- {
- WORD m_wNumItems;
- WORD m_wItemsPerColumn;
- WORD m_wLeftX;
- WORD m_wTopY;
- WORD m_wColumnWidth;
- WORD m_wRowHeight;
- WORD m_wAttrs;
- } O_GRID, *PO_GRID;
- WORD grid_row( PO_GRID pGrid, WORD wItemNum );
- WORD grid_column( PO_GRID pGrid, WORD wItemNum );
- WORD grid_last_column_in_row( PO_GRID pGrid, WORD wRow );
- WORD grid_last_row_in_column( PO_GRID pGrid, WORD wColumn );
- void grid_init( PO_GRID pGrid, WORD wNumItems, WORD wItemsPerColumn,
- WORD wLeftX, WORD wTopY,
- WORD wColumnWidth, WORD wRowHeight,
- WORD wAttrs );
- PO_GRID grid_create( WORD wNumItems, WORD wItemsPerColumn,
- WORD wLeftX, WORD wTopY,
- WORD wColumnWidth, WORD wRowHeight,
- WORD wAttrs );
- WORD grid_item_x( PO_GRID pGrid, WORD wItemNum );
- WORD grid_item_y( PO_GRID pGrid, WORD wItemNum );
- WORD grid_itemNum( PO_GRID pGrid, WORD wColumn, WORD wRow );
- WORD grid_itemNum_from_pos( PO_GRID pGrid, WORD x, WORD y );
- WORD grid_item_up( PO_GRID pGrid, WORD wItemNum );
- WORD grid_item_down( PO_GRID pGrid, WORD wItemNum );
- WORD grid_item_left( PO_GRID pGrid, WORD wItemNum );
- WORD grid_item_right( PO_GRID pGrid, WORD wItemNum );
- #endif // _GRID_H_