示例#1
0
文件: imagelist.go 项目: wangch/walk
func imageListForImage(image interface{}) (hIml win.HIMAGELIST, isSysIml bool, err error) {
	if filePath, ok := image.(string); ok {
		_, hIml = iconIndexAndHImlForFilePath(filePath)
		isSysIml = hIml != 0
	} else {
		w, h := win.GetSystemMetrics(win.SM_CXSMICON), win.GetSystemMetrics(win.SM_CYSMICON)

		hIml = win.ImageList_Create(w, h, win.ILC_MASK|win.ILC_COLOR24, 8, 8)
		if hIml == 0 {
			return 0, false, newError("ImageList_Create failed")
		}
	}

	return
}
示例#2
0
func (rb *RadioButton) MinSizeHint() Size {
	defaultSize := rb.dialogBaseUnitsToPixels(Size{50, 10})
	textSize := rb.calculateTextSizeImpl("n" + windowText(rb.hWnd))

	// FIXME: Use GetThemePartSize instead of GetSystemMetrics?
	w := textSize.Width + int(win.GetSystemMetrics(win.SM_CXMENUCHECK))
	h := maxi(defaultSize.Height, textSize.Height)

	return Size{w, h}
}
示例#3
0
文件: icon.go 项目: wangch/walk
func (i *Icon) Size() Size {
	return Size{int(win.GetSystemMetrics(win.SM_CXICON)), int(win.GetSystemMetrics(win.SM_CYICON))}
}