June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
45
Task/Simulate-input-Mouse/Ring/simulate-input-mouse.ring
Normal file
45
Task/Simulate-input-Mouse/Ring/simulate-input-mouse.ring
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# Project : Simulate input/Mouse
|
||||
# Date : 2018/02/02
|
||||
# Author : Gal Zsolt [~ CalmoSoft ~]
|
||||
# Email : <calmosoft@gmail.com>
|
||||
|
||||
load "guilib.ring"
|
||||
load "stdlib.ring"
|
||||
|
||||
paint = null
|
||||
|
||||
new qapp
|
||||
{
|
||||
win1 = new qwidget() {
|
||||
setwindowtitle("")
|
||||
setgeometry(100,100,800,600)
|
||||
setwindowtitle("Mouse events")
|
||||
|
||||
line1 = new qlineedit(win1) {
|
||||
setgeometry(150,450,300,30)
|
||||
settext("")}
|
||||
|
||||
line2 = new qlineedit(win1) {
|
||||
setgeometry(150,400,300,30)
|
||||
settext("")}
|
||||
|
||||
new qpushbutton(win1) {
|
||||
setgeometry(150,500,300,30)
|
||||
settext("draw")
|
||||
myfilter = new qallevents(win1)
|
||||
myfilter.setMouseButtonPressevent("drawpress()")
|
||||
myfilter.setMouseButtonReleaseevent("drawrelease()")
|
||||
installeventfilter(myfilter)
|
||||
}
|
||||
show()
|
||||
}
|
||||
exec()
|
||||
}
|
||||
|
||||
func drawpress()
|
||||
line2.settext("")
|
||||
line1.settext("Mouse was pressed")
|
||||
|
||||
func drawrelease()
|
||||
line1.settext("")
|
||||
line2.settext("Mouse was released")
|
||||
Loading…
Add table
Add a link
Reference in a new issue