image-list.zc

来自「实现树形结构」· ZC 代码 · 共 62 行

ZC
62
字号
//[of]:license
//[c]Code Browser - a folding text editor for programmers
//[c]Copyright (C) 2003-07 Marc Kerbiquet
//[c]
//[c]This program is free software; you can redistribute it and/or modify
//[c]it under the terms of the GNU General Public License as published by
//[c]the Free Software Foundation; either version 2 of the License, or
//[c](at your option) any later version.
//[c]
//[c]This program is distributed in the hope that it will be useful,
//[c]but WITHOUT ANY WARRANTY; without even the implied warranty of
//[c]MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//[c]GNU General Public License for more details.
//[c]
//[c]You should have received a copy of the GNU General Public License
//[c]along with this program; if not, write to the Free Software
//[c]Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//[cf]
//[of]:imports
import "base/types"
import "base/memory-allocator"
import "user/box"

import "win32/windows"
import "win32/commctrl"
import "win32/winerror"
//[cf]
//[of]:structures
//[c]
public struct image list
	handle: HIMAGELIST
end
//[c]
//[cf]
//[c]
//[of]:initialize - release
//[of]:initialize
public func initialize (m: image list, n: int, w: int, h: int)

	handle (m) = ImageList_Create (w, h, ILC_COLORDDB|ILC_MASK, n, 8)

end
//[cf]
//[of]:release
public func release (m: image list)

	ImageList_Destroy (handle (m))

end
//[cf]
//[cf]
//[of]:adding - removing
//[of]:add icon (id)
public func add icon (m: image list, icon: int)

	def hicon = LoadIconA (hinstance, icon:LPCSTR)
	ImageList_AddIcon (handle (m), hicon)

end
//[cf]
//[cf]

⌨️ 快捷键说明

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