Exemplo n.º 1
0
func (B *Imp) Edit(i *uint) {
	//
	xi, yi := scr.MousePosGr()
	x, y := xi, yi
	if scr.UnderMouseGr(int(B.x0), int(B.y0), int(B.x0+B.width-1), int(B.y0+B.height-1), 0) {
		if B.horizontal {
			B.value = (uint(int(x)-int(B.x0)) * B.max) / (B.width - 1)
		} else {
			B.value = B.max - (uint(int(y)-int(B.y0))*B.max)/(B.height-1)
		}
	}
	*i = B.value
	B.Write()
}
Exemplo n.º 2
0
func UnderMouse(a Any) bool {
	//
	x := a.(*Imp)
	return scr.UnderMouseGr(int(x.x), int(x.y), int(x.x), int(x.y), x.Radius())
}