⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zlistcontrol.h

📁 Symbian手机智能操作系统下的源码,图像查看软件,支持十几种图形格式.
💻 H
字号:
#pragma once
#include "zcontrol.h"
#include "zGraphList.h"
#include "zListColumn.h"
#include "zListRow.h"
#include "zListFlags.h"

class zListControl : public zControl
{
//	zListFlags		m_flags;	//风格操作

public:		//控件操作
	zListControl(void);
	~zListControl(void);
	virtual int		CreateEx(int ctlid,int x, int y, int nWidth, int nHeight, HWND hParent,HINSTANCE hInst);
	virtual int		OnNotify(LPNMHDR lParam);
//	virtual void	OnCustomDraw(LPNMTVCUSTOMDRAW lParam);
	virtual int		OnDispInfo(LPNMHDR lParam);
	virtual	void	OnClick(zListRow * pList);
	virtual void	OnDblClick(zListRow * pRow);
	virtual int		OnPopupMenu(POINT point);

private:	//存储操作
	zFile *	m_pFile;
public:
	void	SetFile(zFile * pFile){m_pFile = pFile;};
	zFile *	GetFile(){return m_pFile;};
	int		Save(TCHAR * pszSaveName);			//保存
	int		Load(TCHAR * pszLoadName);			//读取

private:	//图标操作
	zGraphList * m_pImageList;
	zGraphList * m_pImageSave;
public:
	void SetImageList(zGraphList * pList);

private:	//列操作
	zListColumn		m_vListColumn;
public:
	void	Reset();							//清除所有的项和列
	int		AddColumn(int size, TCHAR * pTitle);//增加一列
	int		DeleteColumn(int iColumn);
	void	SetColumnFlags(int n,int nFlags);	//设置列头风格
	void	SetColumnImage(int n,int nImage);
	int		GetColumnSize(){return m_colcnt;};

protected:	//节点操作: (zListRow附加到每行的参数里)
	int		m_colcnt;
	int		m_selrow;
	int		m_selcol;
	int		AddRow(zListRow * pRow,int iInsert=-1);		//添加一行
	zListRow * GetParam(int row);				//获取第row行的用户参数
public:
	int		ResetRow();							//清除所有的项
	int		DeleteRow(long row);				//删除一行
	int		AddRow();
	int		SetItemText(int row,int col,TCHAR * pTitle);
	int		GetItemText(int row,int col,TCHAR * pTitle,int iSize);
	int		GetItemSize(){return (int)ListView_GetItemCount(m_hCtrl);}
	void	GetSelectRowCol(int &row,int& col){row= m_selrow;col=m_selcol;}

private:	//磁盘操作
	TCHAR	m_szPath[MAX_PATH];
public:
	void	InsertDiskList();
	void	FlushDiskList(TCHAR * pPath = _T(""));
};



/*
	ListView_ApproximateViewRect		This macro calculates the approximate width and height required to display a specified number of items.  
	ListView_Arrange					This macro arranges items in icon view.  
	ListView_CreateDragImage			This macro creates a drag image list for the specified item.  
	ListView_DeleteAllItems				//删除列表框中所有项.  
	ListView_DeleteColumn				//删除一列.  
	ListView_DeleteItem					//删除一项(行).  
	ListView_EditLabel					This macro begins in-place editing of the specified list-view item's text.  
	ListView_EnsureVisible				This macro ensures that a list-view item is either entirely or partially visible, scrolling the list-view control if necessary.  
	ListView_FindItem					This macro searches for a list-view item with the specified characteristics.  
	ListView_GetBkColor					This macro retrieves the background color of a list-view control.  
	ListView_GetCallbackMask			This macro retrieves the callback mask for a list-view control.  
	ListView_GetCheckState				This macro determines if an item in a list-view control is selected.  
	ListView_GetColumn					This macro retrieves the attributes of a list-view control's column.  
	ListView_GetColumnOrderArray		This macro retrieves the current left-to-right order of columns in a list-view control. 
	ListView_GetColumnWidth				This macro retrieves the width of a column in report or list view.  
	ListView_GetCountPerPage			This macro calculates the number of items that can fit vertically in the visible area of a list-view control when in list or report view.  
	ListView_GetEditControl				This macro retrieves the handle to the edit control being used to edit a list-view item's text.  
	ListView_GetExtendedListViewStyle	This macro retrieves the extended styles that are currently in use for a specified list-view control.  
	ListView_GetHeader					This macro retrieves the handle to the header control used by a list-view control.  
	ListView_GetImageList				This macro retrieves the handle to an image list used for drawing list-view items.  
	ListView_GetISearchString			This macro retrieves the incremental search string of a list-view control.  
	ListView_GetItem					This macro retrieves some or all of a list-view item's attributes.  
	ListView_GetItemCount				This macro retrieves the number of items in a list-view control.  
	ListView_GetItemPosition			This macro retrieves the position of a list-view item.  
	ListView_GetItemRect				This macro retrieves the bounding rectangle for all or part of an item in the current view.  
	ListView_GetItemSpacing				This macro determines the spacing between items in a list-view control.  
	ListView_GetItemState				This macro retrieves the state of a list-view item.  
	ListView_GetItemText				This macro retrieves the text of a list-view item or subitem.  
	ListView_GetNextItem				This macro searches for a list-view item that has the specified properties and bears the specified relationship to a specified item.  
	ListView_GetNumberOfWorkAreas		This macro retrieves the number of working areas in a list-view control. 
	ListView_GetOrigin					This macro retrieves the current view origin for a list-view control.  
	ListView_GetSelectedCount			This macro determines the number of selected items in a list-view control.  
	ListView_GetSelectionMark			This macro retrieves the selection mark from a list-view control.  
	ListView_GetStringWidth				This macro determines the width of a specified string, using the specified list-view control's current font.  
	ListView_GetSubItemRect				This macro retrieves information about the rectangle that surrounds a subitem in a list-view control.  
	ListView_GetTextBkColor				This macro retrieves the text background color of a list-view control.  
	ListView_GetTextColor				This macro retrieves the text color of a list-view control.  
	ListView_GetTopIndex				This macro retrieves the index of the topmost visible item when in list or report view.  
	ListView_GetViewRect				This macro retrieves the bounding rectangle of all items in the list-view control.  
	ListView_GetWorkAreas				This macro retrieves the working areas from a list-view control. 
	ListView_HitTest					This macro determines which list-view item, if any, is at a specified position.  
	ListView_InsertColumn				This macro inserts a new column in a list-view control.  
	ListView_InsertItem					This macro inserts a new item in a list-view control.  
	ListView_RedrawItems				This macro forces a list-view control to redraw a range of items.  
	ListView_Scroll						This macro scrolls the content of a list-view control.  
	ListView_SetBkColor					This macro sets the background color a list-view control.  
	ListView_SetCallbackMask			This macro changes the callback mask for a list-view control.  
	ListView_SetColumn					This macro sets the attributes of a list-view column.  
	ListView_SetColumnOrderArray		This macro sets the left-to-right order of columns in a list-view control. 
	ListView_SetColumnWidth				This macro changes the width of a column in report or list view.  
	ListView_SetExtendedListViewStyle	This macro sets extended styles for list-view controls.  
	ListView_SetIconSpacing				This macro sets the spacing between icons in list-view controls set to the LVS_ICON style.  
	ListView_SetImageList				This macro assigns an image list to a list-view control.  
	ListView_SetItem					This macro sets some or all of a list-view item's attributes.  
	ListView_SetItemCount				This macro prepares a list-view control for adding a large number of items.  
	ListView_SetItemCountEx				This macro sets the virtual number of items in a virtual list-view control. 
	ListView_SetItemPosition			This macro moves an item to a specified position in a list-view control, which must be in icon or small icon view.  
	ListView_SetItemPosition32			This macro moves an item to a specified position in a list-view control, which must be in icon or small icon view.  
	ListView_SetItemState				This macro changes the state of an item in a list-view control.  
	ListView_SetItemText				This macro changes the text of a list-view item or subitem.  
	ListView_SetSelectionMark			This macro sets the selection mark in a list-view control. 
	ListView_SetTextBkColor				This macro sets the background color of text in a list-view control.  
	ListView_SetTextColor				This macro sets the text color of a list-view control.  
	ListView_SetWorkAreas				This macro sets the working area within a list-view control. 
	ListView_SortItems					This macro uses an application-defined comparison function to sort the items of a list-view control.  
	ListView_SubItemHitTest				This macro determines which list-view item or subitem is located at a specified position. 
	ListView_Update						This macro updates a list-view item.  
*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -