TileSelector.h
上传用户:pfmy85
上传日期:2007-01-07
资源大小:22k
文件大小:2k
- // TileSelector.h: interface for the CTileSelector class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_TILESELECTOR_H__2C8B50C1_3A87_11D3_9B58_0080C8E05391__INCLUDED_)
- #define AFX_TILESELECTOR_H__2C8B50C1_3A87_11D3_9B58_0080C8E05391__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "DXMap.h"
- #include "DDDIBSurface.h"
- // Tile selector class.
- // this class is displayed at the top of the screen,
- // it only call scroll up and down, it also use
- // tiles in size of 32*16.
- class CTileSelector
- {
- public:
- CTileSelector(); // default constructor
- virtual ~CTileSelector(); // default destructor
- // creation member function
- bool Create(CDDDevice *pDevice, // DirectDraw device
- CDDSurface* pTiles, // tile source
- int nTileWidthShift,
- int nTileHeightShift,
- LPRECT lpRect, // Display rectangle
- LPCTSTR lpName, // arrors bitmap file name
- CPackFileManager* pPackFileManager = NULL); // Packfile manager
- void Draw(CDDSurface* pSurface);
- bool ProcessMouse(int x, int y, // mouse position
- CDIMouseState::MOUSE_BUTTON_STATE eMouseState); // mouse button state
- void Up();
- void Down();
- //void PageUp();
- //void PageDown();
- int GetCurTile(){return m_nCurTile;};
- protected:
- CDDSurface* m_pTiles; //
- int m_nTileWidthShift;
- int m_nTileHeightShift;
- int m_nTileWidth;
- int m_nTileHeight;
- int m_nTotalHeight; // =m_nTileCnt*16
- int m_nTileCnt; // Tiles sumary
- int m_nSrcSurfaceCellRows;
- CDDDIBSurface* m_pArrows; // Arrors surface
- int m_nArrowWidth;
- int m_nArrowHeight;
- CRect m_rect; // rectangle to display the whole selector
- CRect m_rcTiles; // rectangle to display tiles
- BOOL m_bTop; // is at top most position
- BOOL m_bBottom; // is at bottom most position
- int m_nCurPos;
- int m_nCurTile;
- };
- #endif // !defined(AFX_TILESELECTOR_H__2C8B50C1_3A87_11D3_9B58_0080C8E05391__INCLUDED_)