Discussion:
[Gambas-user] Does really nobody have an idea?
Rolf-Werner Eilert
2011-09-06 13:38:16 UTC
Permalink
I sent this yesterday, but nobody seems to know - or is the question too
stupid to be answered? :-)

As the mailing list doesn't accept a repost, I put it under a new Re.
Hope you aren't annoyed, guys...

Hi folks,

Is there a general function that counts or registers mouse and keyboard
events on an application-wide level? Already in Gambas 2 ?

What I need is something that simply watches if the user has clicked or
typed ANYWHERE into the program within a given period without having to
count the clicks and types of each GUI element separately.

My idea is to hide personal data parts of the GUI after some time of no
action and require a password before releasing the surface again.

Thanks for all ideas and hints!

Rolf
Stephen Bungay
2011-09-06 13:48:52 UTC
Permalink
Post by Rolf-Werner Eilert
I sent this yesterday, but nobody seems to know - or is the question too
stupid to be answered? :-)
As the mailing list doesn't accept a repost, I put it under a new Re.
Hope you aren't annoyed, guys...
Hi folks,
Is there a general function that counts or registers mouse and keyboard
events on an application-wide level? Already in Gambas 2 ?
What I need is something that simply watches if the user has clicked or
typed ANYWHERE into the program within a given period without having to
count the clicks and types of each GUI element separately.
My idea is to hide personal data parts of the GUI after some time of no
action and require a password before releasing the surface again.
Thanks for all ideas and hints!
Rolf
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Hi Rolf!
Not an answer for you (yet) but I'll add my voice because what you're
looking for would probably also help me. Basically I need to know when a
user has released the mouse button on a slider control, signalling that
they have finished making changes and allowing normal program execution
to resume... so far no luck.

Regards
Steve
Fabien Bodard
2011-09-06 14:20:22 UTC
Permalink
first answer for steve

Public Sub Slider1_MouseUp()

Print "Mouse is released"

End
Fabien Bodard
2011-09-06 14:42:03 UTC
Permalink
good question rolf :/
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
 Print "Mouse is released"
End
--
Fabien Bodard
Dag-Jarle Johansen
2011-09-06 14:54:55 UTC
Permalink
Hi,

I had to write something like that in VB for QM. Even though the effort
might be overwhelming, I would do some thing like this:

make a global object in some module,
f.eks.
m.module
public GetMe as object

in the same module you save or do anything f.eks

puclic sub WriteLogg()
Post by Fabien Bodard
good question rolf :/
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
Print "Mouse is released"
End
--
Fabien Bodard
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Dag-Jarle Johansen
2011-09-06 15:04:23 UTC
Permalink
Something happened....

public sub WriteLogg()
print GetMe.name (and or other options)
end

And the heavy stuff is here:

for every Object you want to control, you will have to:

private sub xxx_control_click()
GetMet=xxx_control
m.WriteLogg

Alternate WriteLogg as function

public WriteLogg(xctrl as control)
print xctrl.name....

I am sure one of the guys here have more sophisticated solutions for you.,
f.eks the event-handler on every form, but I am not so good at that yet.

Regards,
Dag-Jarle
Post by Dag-Jarle Johansen
Hi,
I had to write something like that in VB for QM. Even though the effort
make a global object in some module,
f.eks.
m.module
public GetMe as object
in the same module you save or do anything f.eks
puclic sub WriteLogg()
Post by Fabien Bodard
good question rolf :/
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
Print "Mouse is released"
End
--
Fabien Bodard
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Rolf-Werner Eilert
2011-09-06 15:29:10 UTC
Permalink
Thanks for your idea, Dag-Jarle, but isn't this effort exactly what I
would like to avoid?

I guess the whole thing depends on the question of how QT or GTK handle
the events of the controls within a window/application. I cannot imagine
that the controls are accessed by the GUI (X) directly. That would imply
an event loop for each control. Instead, I would expect one event loop
for the application within which you have one event request for each
window within which you have one event request for each control of that
window.

If there is a slot for the overall mouse activities of one window or
application in QT (on the C++ side), it should be easy for Benoit to
connect this to a Gambas event. If not, things are different :-)

Regards

Rolf
Post by Dag-Jarle Johansen
Something happened....
public sub WriteLogg()
print GetMe.name (and or other options)
end
private sub xxx_control_click()
GetMet=xxx_control
m.WriteLogg
Alternate WriteLogg as function
public WriteLogg(xctrl as control)
print xctrl.name....
I am sure one of the guys here have more sophisticated solutions for you.,
f.eks the event-handler on every form, but I am not so good at that yet.
Regards,
Dag-Jarle
Post by Dag-Jarle Johansen
Hi,
I had to write something like that in VB for QM. Even though the effort
make a global object in some module,
f.eks.
m.module
public GetMe as object
in the same module you save or do anything f.eks
puclic sub WriteLogg()
Post by Fabien Bodard
good question rolf :/
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
Print "Mouse is released"
End
--
Fabien Bodard
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Jorge Carrión
2011-09-06 18:35:39 UTC
Permalink
Here there is a class that do exactly what you want (I hope).

http://www.gambas-es.org/download.php?id=82
I included a little proyect with example.

Hope it'll be usefull.

Regards.
Post by Rolf-Werner Eilert
Thanks for your idea, Dag-Jarle, but isn't this effort exactly what I
would like to avoid?
I guess the whole thing depends on the question of how QT or GTK handle
the events of the controls within a window/application. I cannot imagine
that the controls are accessed by the GUI (X) directly. That would imply
an event loop for each control. Instead, I would expect one event loop
for the application within which you have one event request for each
window within which you have one event request for each control of that
window.
If there is a slot for the overall mouse activities of one window or
application in QT (on the C++ side), it should be easy for Benoit to
connect this to a Gambas event. If not, things are different :-)
Regards
Rolf
Post by Dag-Jarle Johansen
Something happened....
public sub WriteLogg()
print GetMe.name (and or other options)
end
private sub xxx_control_click()
GetMet=xxx_control
m.WriteLogg
Alternate WriteLogg as function
public WriteLogg(xctrl as control)
print xctrl.name....
I am sure one of the guys here have more sophisticated solutions for
you.,
Post by Dag-Jarle Johansen
f.eks the event-handler on every form, but I am not so good at that yet.
Regards,
Dag-Jarle
Post by Dag-Jarle Johansen
Hi,
I had to write something like that in VB for QM. Even though the effort
make a global object in some module,
f.eks.
m.module
public GetMe as object
in the same module you save or do anything f.eks
puclic sub WriteLogg()
Post by Fabien Bodard
good question rolf :/
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
Print "Mouse is released"
End
--
Fabien Bodard
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Post by Dag-Jarle Johansen
Post by Fabien Bodard
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Rolf-Werner Eilert
2011-09-07 06:33:57 UTC
Permalink
Thank you Jorge, at a first glance this looks promising. I'll try to
understand it when I've got some more time, maybe this afternoon or so...

Regards

Rolf
Post by Jorge Carrión
Here there is a class that do exactly what you want (I hope).
http://www.gambas-es.org/download.php?id=82
I included a little proyect with example.
Hope it'll be usefull.
Regards.
Post by Rolf-Werner Eilert
Thanks for your idea, Dag-Jarle, but isn't this effort exactly what I
would like to avoid?
I guess the whole thing depends on the question of how QT or GTK handle
the events of the controls within a window/application. I cannot imagine
that the controls are accessed by the GUI (X) directly. That would imply
an event loop for each control. Instead, I would expect one event loop
for the application within which you have one event request for each
window within which you have one event request for each control of that
window.
If there is a slot for the overall mouse activities of one window or
application in QT (on the C++ side), it should be easy for Benoit to
connect this to a Gambas event. If not, things are different :-)
Regards
Rolf
Post by Dag-Jarle Johansen
Something happened....
public sub WriteLogg()
print GetMe.name (and or other options)
end
private sub xxx_control_click()
GetMet=xxx_control
m.WriteLogg
Alternate WriteLogg as function
public WriteLogg(xctrl as control)
print xctrl.name....
I am sure one of the guys here have more sophisticated solutions for
you.,
Post by Dag-Jarle Johansen
f.eks the event-handler on every form, but I am not so good at that yet.
Regards,
Dag-Jarle
Post by Dag-Jarle Johansen
Hi,
I had to write something like that in VB for QM. Even though the effort
make a global object in some module,
f.eks.
m.module
public GetMe as object
in the same module you save or do anything f.eks
puclic sub WriteLogg()
Post by Fabien Bodard
good question rolf :/
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
Print "Mouse is released"
End
--
Fabien Bodard
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Post by Dag-Jarle Johansen
Post by Fabien Bodard
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Malware Security Report: Protecting Your Business, Customers, and the
Bottom Line. Protect your business and customers by understanding the
threat from malware and how it can impact your online business.
http://www.accelacomm.com/jaw/sfnl/114/51427462/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Rolf-Werner Eilert
2011-09-07 08:35:25 UTC
Permalink
Hi Andreas,

Thanks! Looks nice... I tried to integrate it into the program. It DOES
function, but only if I click on the panel below the menu. All other
controls in the program seem to be ignored. Same with MouseUp. KeyPress
doesn't react at all. Here is it:

PUBLIC SUB Form_Open()
DIM OBJ AS Object
DIM OBSwatchall AS Observer

'Start an Observer for Each Control on this Form
FOR EACH OBJ IN ME.Children
OBSwatchall = NEW Observer(OBJ) AS "WatchAll"
NEXT


ini.DateiLesen

ME.Width = ini.FensterBreite()
ME.Height = ini.FensterHoehe()

IF ini.FensterZentrieren() THEN
ME.Center
ELSE
ME.X = ini.FensterX()
ME.Y = ini.FensterY()
END IF

ME.Title = "Kartei 7.3"
ME.Font.Size = ini.FontGroesse()

'ldsv.DateisperrenAufraeumen

EinrichtenBaum

Log.Check

END

PUBLIC SUB WatchAll_MouseDown()
Suche.text = LAST.Name & "_MouseDown()"
END

Any idea what is wrong?

Rolf
Hello,
DIM OBJ as Object
DIM OBSwatchall AS Observer
'Start an Observer for Each Control on this Form
FOR EACH OBJ IN ME.Children
OBSwatchall = NEW Observer(OBJ) AS "WatchAll"
NEXT
Public SUB WatchAll_MouseDown()
PRINT LAST.Name& "_MouseDown()"
END
MouseUp, MouseDown, KeyPress, KeyRelease, GotFocus, LostFocus, ...
Regards A.Fröhlke
-----Ursprüngliche Nachricht-----
Gesendet: Mittwoch, 7. September 2011 08:34
Betreff: Re: [Gambas-user] Does really nobody have an idea?
Thank you Jorge, at a first glance this looks promising. I'll try to
understand it when I've got some more time, maybe this afternoon or so...
Regards
Rolf
Post by Jorge Carrión
Here there is a class that do exactly what you want (I hope).
http://www.gambas-es.org/download.php?id=82
I included a little proyect with example.
Hope it'll be usefull.
Regards.
Post by Rolf-Werner Eilert
Thanks for your idea, Dag-Jarle, but isn't this effort exactly what I
would like to avoid?
I guess the whole thing depends on the question of how QT or GTK handle
the events of the controls within a window/application. I cannot imagine
that the controls are accessed by the GUI (X) directly. That would imply
an event loop for each control. Instead, I would expect one event loop
for the application within which you have one event request for each
window within which you have one event request for each control of that
window.
If there is a slot for the overall mouse activities of one window or
application in QT (on the C++ side), it should be easy for Benoit to
connect this to a Gambas event. If not, things are different :-)
Regards
Rolf
Post by Dag-Jarle Johansen
Something happened....
public sub WriteLogg()
print GetMe.name (and or other options)
end
private sub xxx_control_click()
GetMet=xxx_control
m.WriteLogg
Alternate WriteLogg as function
public WriteLogg(xctrl as control)
print xctrl.name....
I am sure one of the guys here have more sophisticated solutions for
you.,
Post by Dag-Jarle Johansen
f.eks the event-handler on every form, but I am not so good at that yet.
Regards,
Dag-Jarle
Post by Dag-Jarle Johansen
Hi,
I had to write something like that in VB for QM. Even though the effort
make a global object in some module,
f.eks.
m.module
public GetMe as object
in the same module you save or do anything f.eks
puclic sub WriteLogg()
Post by Fabien Bodard
good question rolf :/
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
Print "Mouse is released"
End
--
Fabien Bodard
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Post by Dag-Jarle Johansen
Post by Fabien Bodard
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Malware Security Report: Protecting Your Business, Customers, and the
Bottom Line. Protect your business and customers by understanding the
threat from malware and how it can impact your online business.
http://www.accelacomm.com/jaw/sfnl/114/51427462/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Fabien Bodard
2011-09-07 17:05:17 UTC
Permalink
normal ... the function must be iterative... to take all the child of
containers into account
Post by Rolf-Werner Eilert
Hi Andreas,
Thanks! Looks nice... I tried to integrate it into the program. It DOES
function, but only if I click on the panel below the menu. All other
controls in the program seem to be ignored. Same with MouseUp. KeyPress
PUBLIC SUB Form_Open()
DIM OBJ AS Object
DIM OBSwatchall AS Observer
'Start an Observer for Each Control on this Form
FOR EACH OBJ IN ME.Children
  OBSwatchall = NEW Observer(OBJ) AS "WatchAll"
NEXT
  ini.DateiLesen
  ME.Width = ini.FensterBreite()
  ME.Height = ini.FensterHoehe()
  IF ini.FensterZentrieren() THEN
    ME.Center
  ELSE
    ME.X = ini.FensterX()
    ME.Y = ini.FensterY()
  END IF
  ME.Title = "Kartei 7.3"
  ME.Font.Size = ini.FontGroesse()
  'ldsv.DateisperrenAufraeumen
  EinrichtenBaum
  Log.Check
END
PUBLIC SUB WatchAll_MouseDown()
  Suche.text = LAST.Name & "_MouseDown()"
END
Any idea what is wrong?
Rolf
Hello,
DIM OBJ as Object
DIM OBSwatchall AS Observer
'Start an Observer for Each Control on this Form
FOR EACH OBJ IN ME.Children
   OBSwatchall = NEW Observer(OBJ) AS "WatchAll"
NEXT
Public SUB WatchAll_MouseDown()
   PRINT LAST.Name&  "_MouseDown()"
END
MouseUp, MouseDown, KeyPress, KeyRelease, GotFocus, LostFocus, ...
Regards A.Fröhlke
-----Ursprüngliche Nachricht-----
Gesendet: Mittwoch, 7. September 2011 08:34
Betreff: Re: [Gambas-user] Does really nobody have an idea?
Thank you Jorge, at a first glance this looks promising. I'll try to
understand it when I've got some more time, maybe this afternoon or so...
Regards
Rolf
Post by Jorge Carrión
Here there is a class that do exactly what you want (I hope).
http://www.gambas-es.org/download.php?id=82
I included a little proyect with example.
Hope it'll be usefull.
Regards.
Post by Rolf-Werner Eilert
Thanks for your idea, Dag-Jarle, but isn't this effort exactly what I
would like to avoid?
I guess the whole thing depends on the question of how QT or GTK handle
the events of the controls within a window/application. I cannot imagine
that the controls are accessed by the GUI (X) directly. That would imply
an event loop for each control. Instead, I would expect one event loop
for the application within which you have one event request for each
window within which you have one event request for each control of that
window.
If there is a slot for the overall mouse activities of one window or
application in QT (on the C++ side), it should be easy for Benoit to
connect this to a Gambas event. If not, things are different :-)
Regards
Rolf
Post by Dag-Jarle Johansen
Something happened....
public sub WriteLogg()
      print GetMe.name (and or other options)
end
private sub xxx_control_click()
     GetMet=xxx_control
     m.WriteLogg
Alternate WriteLogg as function
public WriteLogg(xctrl as control)
print xctrl.name....
I am sure one of the guys here have more sophisticated solutions for
you.,
Post by Dag-Jarle Johansen
f.eks the event-handler on every form, but I am not so good at that yet.
Regards,
Dag-Jarle
Post by Dag-Jarle Johansen
Hi,
I had to write something like that in VB for QM. Even though the effort
make a global object in some module,
f.eks.
m.module
public GetMe as object
in the same module you save or do anything f.eks
puclic sub WriteLogg()
Post by Fabien Bodard
good question rolf :/
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
    Print "Mouse is released"
End
--
Fabien Bodard
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Post by Dag-Jarle Johansen
Post by Fabien Bodard
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Malware Security Report: Protecting Your Business, Customers, and the
Bottom Line. Protect your business and customers by understanding the
threat from malware and how it can impact your online business.
http://www.accelacomm.com/jaw/sfnl/114/51427462/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
--
Fabien Bodard
Fabien Bodard
2011-09-07 17:12:24 UTC
Permalink
Private Sub SetAllObservers(hCont as Container)

dim hObj as Object
Dim hObs as Observer
For each hObj in hCont.Children
hObs = new Observer(hObj) As "WatchAll"
if hObj Is Container then SetAllObservers(hObj)
Next

End


in Form_Open or in _New :

Public Sub _New()

SetAllObservers(Me)

End


Public sub WatchAll_MouseUp()

Print Object.Type(Last)

End
Post by Fabien Bodard
normal ... the function must be iterative... to take all the child of
containers into account
Post by Rolf-Werner Eilert
Hi Andreas,
Thanks! Looks nice... I tried to integrate it into the program. It DOES
function, but only if I click on the panel below the menu. All other
controls in the program seem to be ignored. Same with MouseUp. KeyPress
PUBLIC SUB Form_Open()
DIM OBJ AS Object
DIM OBSwatchall AS Observer
'Start an Observer for Each Control on this Form
FOR EACH OBJ IN ME.Children
  OBSwatchall = NEW Observer(OBJ) AS "WatchAll"
NEXT
  ini.DateiLesen
  ME.Width = ini.FensterBreite()
  ME.Height = ini.FensterHoehe()
  IF ini.FensterZentrieren() THEN
    ME.Center
  ELSE
    ME.X = ini.FensterX()
    ME.Y = ini.FensterY()
  END IF
  ME.Title = "Kartei 7.3"
  ME.Font.Size = ini.FontGroesse()
  'ldsv.DateisperrenAufraeumen
  EinrichtenBaum
  Log.Check
END
PUBLIC SUB WatchAll_MouseDown()
  Suche.text = LAST.Name & "_MouseDown()"
END
Any idea what is wrong?
Rolf
Hello,
DIM OBJ as Object
DIM OBSwatchall AS Observer
'Start an Observer for Each Control on this Form
FOR EACH OBJ IN ME.Children
   OBSwatchall = NEW Observer(OBJ) AS "WatchAll"
NEXT
Public SUB WatchAll_MouseDown()
   PRINT LAST.Name&  "_MouseDown()"
END
MouseUp, MouseDown, KeyPress, KeyRelease, GotFocus, LostFocus, ...
Regards A.Fröhlke
-----Ursprüngliche Nachricht-----
Gesendet: Mittwoch, 7. September 2011 08:34
Betreff: Re: [Gambas-user] Does really nobody have an idea?
Thank you Jorge, at a first glance this looks promising. I'll try to
understand it when I've got some more time, maybe this afternoon or so...
Regards
Rolf
Post by Jorge Carrión
Here there is a class that do exactly what you want (I hope).
http://www.gambas-es.org/download.php?id=82
I included a little proyect with example.
Hope it'll be usefull.
Regards.
Post by Rolf-Werner Eilert
Thanks for your idea, Dag-Jarle, but isn't this effort exactly what I
would like to avoid?
I guess the whole thing depends on the question of how QT or GTK handle
the events of the controls within a window/application. I cannot imagine
that the controls are accessed by the GUI (X) directly. That would imply
an event loop for each control. Instead, I would expect one event loop
for the application within which you have one event request for each
window within which you have one event request for each control of that
window.
If there is a slot for the overall mouse activities of one window or
application in QT (on the C++ side), it should be easy for Benoit to
connect this to a Gambas event. If not, things are different :-)
Regards
Rolf
Post by Dag-Jarle Johansen
Something happened....
public sub WriteLogg()
      print GetMe.name (and or other options)
end
private sub xxx_control_click()
     GetMet=xxx_control
     m.WriteLogg
Alternate WriteLogg as function
public WriteLogg(xctrl as control)
print xctrl.name....
I am sure one of the guys here have more sophisticated solutions for
you.,
Post by Dag-Jarle Johansen
f.eks the event-handler on every form, but I am not so good at that yet.
Regards,
Dag-Jarle
Post by Dag-Jarle Johansen
Hi,
I had to write something like that in VB for QM. Even though the effort
make a global object in some module,
f.eks.
m.module
public GetMe as object
in the same module you save or do anything f.eks
puclic sub WriteLogg()
Post by Fabien Bodard
good question rolf :/
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
    Print "Mouse is released"
End
--
Fabien Bodard
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Post by Dag-Jarle Johansen
Post by Fabien Bodard
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Malware Security Report: Protecting Your Business, Customers, and the
Bottom Line. Protect your business and customers by understanding the
threat from malware and how it can impact your online business.
http://www.accelacomm.com/jaw/sfnl/114/51427462/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
--
Fabien Bodard
--
Fabien Bodard
Andreas Fröhlke
2011-09-08 06:47:45 UTC
Permalink
Sure, i forgot that ther may be containers :)

-----Ursprüngliche Nachricht-----
Von: Fabien Bodard [mailto:***@gmail.com]
Gesendet: Mittwoch, 7. September 2011 19:12
An: ***@eilert-sprachen.de; mailing list for gambas users
Betreff: Re: [Gambas-user] Does really nobody have an idea?

Private Sub SetAllObservers(hCont as Container)

dim hObj as Object
Dim hObs as Observer
For each hObj in hCont.Children
hObs = new Observer(hObj) As "WatchAll"
if hObj Is Container then SetAllObservers(hObj)
Next

End


in Form_Open or in _New :

Public Sub _New()

SetAllObservers(Me)

End


Public sub WatchAll_MouseUp()

Print Object.Type(Last)

End
Post by Fabien Bodard
normal ... the function must be iterative... to take all the child of
containers into account
Post by Rolf-Werner Eilert
Hi Andreas,
Thanks! Looks nice... I tried to integrate it into the program. It DOES
function, but only if I click on the panel below the menu. All other
controls in the program seem to be ignored. Same with MouseUp. KeyPress
PUBLIC SUB Form_Open()
DIM OBJ AS Object
DIM OBSwatchall AS Observer
'Start an Observer for Each Control on this Form
FOR EACH OBJ IN ME.Children
  OBSwatchall = NEW Observer(OBJ) AS "WatchAll"
NEXT
  ini.DateiLesen
  ME.Width = ini.FensterBreite()
  ME.Height = ini.FensterHoehe()
  IF ini.FensterZentrieren() THEN
    ME.Center
  ELSE
    ME.X = ini.FensterX()
    ME.Y = ini.FensterY()
  END IF
  ME.Title = "Kartei 7.3"
  ME.Font.Size = ini.FontGroesse()
  'ldsv.DateisperrenAufraeumen
  EinrichtenBaum
  Log.Check
END
PUBLIC SUB WatchAll_MouseDown()
  Suche.text = LAST.Name & "_MouseDown()"
END
Any idea what is wrong?
Rolf
Hello,
DIM OBJ as Object
DIM OBSwatchall AS Observer
'Start an Observer for Each Control on this Form
FOR EACH OBJ IN ME.Children
   OBSwatchall = NEW Observer(OBJ) AS "WatchAll"
NEXT
Public SUB WatchAll_MouseDown()
   PRINT LAST.Name&  "_MouseDown()"
END
MouseUp, MouseDown, KeyPress, KeyRelease, GotFocus, LostFocus, ...
Regards A.Fröhlke
-----Ursprüngliche Nachricht-----
Gesendet: Mittwoch, 7. September 2011 08:34
Betreff: Re: [Gambas-user] Does really nobody have an idea?
Thank you Jorge, at a first glance this looks promising. I'll try to
understand it when I've got some more time, maybe this afternoon or so...
Regards
Rolf
Post by Jorge Carrión
Here there is a class that do exactly what you want (I hope).
http://www.gambas-es.org/download.php?id=82
I included a little proyect with example.
Hope it'll be usefull.
Regards.
Post by Rolf-Werner Eilert
Thanks for your idea, Dag-Jarle, but isn't this effort exactly what I
would like to avoid?
I guess the whole thing depends on the question of how QT or GTK handle
the events of the controls within a window/application. I cannot imagine
that the controls are accessed by the GUI (X) directly. That would imply
an event loop for each control. Instead, I would expect one event loop
for the application within which you have one event request for each
window within which you have one event request for each control of that
window.
If there is a slot for the overall mouse activities of one window or
application in QT (on the C++ side), it should be easy for Benoit to
connect this to a Gambas event. If not, things are different :-)
Regards
Rolf
Post by Dag-Jarle Johansen
Something happened....
public sub WriteLogg()
      print GetMe.name (and or other options)
end
private sub xxx_control_click()
     GetMet=xxx_control
     m.WriteLogg
Alternate WriteLogg as function
public WriteLogg(xctrl as control)
print xctrl.name....
I am sure one of the guys here have more sophisticated solutions for
you.,
Post by Dag-Jarle Johansen
f.eks the event-handler on every form, but I am not so good at that yet.
Regards,
Dag-Jarle
Post by Dag-Jarle Johansen
Hi,
I had to write something like that in VB for QM. Even though the effort
make a global object in some module,
f.eks.
m.module
public GetMe as object
in the same module you save or do anything f.eks
puclic sub WriteLogg()
Post by Fabien Bodard
good question rolf :/
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
    Print "Mouse is released"
End
--
Fabien Bodard
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Post by Dag-Jarle Johansen
Post by Fabien Bodard
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Malware Security Report: Protecting Your Business, Customers, and the
Bottom Line. Protect your business and customers by understanding the
threat from malware and how it can impact your online business.
http://www.accelacomm.com/jaw/sfnl/114/51427462/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
--
Fabien Bodard
--
Fabien Bodard
Rolf-Werner Eilert
2011-09-08 06:56:13 UTC
Permalink
Aah sure - because of the containers...

I tried it, and it runs well, but I cannot catch action on the scroll
bars of the treeview - and nothing comes from the menu and from the
program window as well.

But it wouldn't disturb so much, so I think, this is a pretty good
solution, thank you!

What do you think of Jorge's way? It simply catches all mouse movements
over the window you want to monitor.

Rolf
Post by Fabien Bodard
Private Sub SetAllObservers(hCont as Container)
dim hObj as Object
Dim hObs as Observer
For each hObj in hCont.Children
hObs = new Observer(hObj) As "WatchAll"
if hObj Is Container then SetAllObservers(hObj)
Next
End
Public Sub _New()
SetAllObservers(Me)
End
Public sub WatchAll_MouseUp()
Print Object.Type(Last)
End
Post by Fabien Bodard
normal ... the function must be iterative... to take all the child of
containers into account
Post by Rolf-Werner Eilert
Hi Andreas,
Thanks! Looks nice... I tried to integrate it into the program. It DOES
function, but only if I click on the panel below the menu. All other
controls in the program seem to be ignored. Same with MouseUp. KeyPress
PUBLIC SUB Form_Open()
DIM OBJ AS Object
DIM OBSwatchall AS Observer
'Start an Observer for Each Control on this Form
FOR EACH OBJ IN ME.Children
OBSwatchall = NEW Observer(OBJ) AS "WatchAll"
NEXT
ini.DateiLesen
ME.Width = ini.FensterBreite()
ME.Height = ini.FensterHoehe()
IF ini.FensterZentrieren() THEN
ME.Center
ELSE
ME.X = ini.FensterX()
ME.Y = ini.FensterY()
END IF
ME.Title = "Kartei 7.3"
ME.Font.Size = ini.FontGroesse()
'ldsv.DateisperrenAufraeumen
EinrichtenBaum
Log.Check
END
PUBLIC SUB WatchAll_MouseDown()
Suche.text = LAST.Name& "_MouseDown()"
END
Any idea what is wrong?
Rolf
Hello,
DIM OBJ as Object
DIM OBSwatchall AS Observer
'Start an Observer for Each Control on this Form
FOR EACH OBJ IN ME.Children
OBSwatchall = NEW Observer(OBJ) AS "WatchAll"
NEXT
Public SUB WatchAll_MouseDown()
PRINT LAST.Name& "_MouseDown()"
END
MouseUp, MouseDown, KeyPress, KeyRelease, GotFocus, LostFocus, ...
Regards A.Fröhlke
-----Ursprüngliche Nachricht-----
Gesendet: Mittwoch, 7. September 2011 08:34
Betreff: Re: [Gambas-user] Does really nobody have an idea?
Thank you Jorge, at a first glance this looks promising. I'll try to
understand it when I've got some more time, maybe this afternoon or so...
Regards
Rolf
Post by Jorge Carrión
Here there is a class that do exactly what you want (I hope).
http://www.gambas-es.org/download.php?id=82
I included a little proyect with example.
Hope it'll be usefull.
Regards.
Post by Rolf-Werner Eilert
Thanks for your idea, Dag-Jarle, but isn't this effort exactly what I
would like to avoid?
I guess the whole thing depends on the question of how QT or GTK handle
the events of the controls within a window/application. I cannot imagine
that the controls are accessed by the GUI (X) directly. That would imply
an event loop for each control. Instead, I would expect one event loop
for the application within which you have one event request for each
window within which you have one event request for each control of that
window.
If there is a slot for the overall mouse activities of one window or
application in QT (on the C++ side), it should be easy for Benoit to
connect this to a Gambas event. If not, things are different :-)
Regards
Rolf
Post by Dag-Jarle Johansen
Something happened....
public sub WriteLogg()
print GetMe.name (and or other options)
end
private sub xxx_control_click()
GetMet=xxx_control
m.WriteLogg
Alternate WriteLogg as function
public WriteLogg(xctrl as control)
print xctrl.name....
I am sure one of the guys here have more sophisticated solutions for
you.,
Post by Dag-Jarle Johansen
f.eks the event-handler on every form, but I am not so good at that yet.
Regards,
Dag-Jarle
Post by Dag-Jarle Johansen
Hi,
I had to write something like that in VB for QM. Even though the effort
make a global object in some module,
f.eks.
m.module
public GetMe as object
in the same module you save or do anything f.eks
puclic sub WriteLogg()
Post by Fabien Bodard
good question rolf :/
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
Print "Mouse is released"
End
--
Fabien Bodard
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Post by Dag-Jarle Johansen
Post by Fabien Bodard
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Malware Security Report: Protecting Your Business, Customers, and the
Bottom Line. Protect your business and customers by understanding the
threat from malware and how it can impact your online business.
http://www.accelacomm.com/jaw/sfnl/114/51427462/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
--
Fabien Bodard
Benoît Minisini
2011-09-08 15:33:06 UTC
Permalink
Post by Rolf-Werner Eilert
Aah sure - because of the containers...
I tried it, and it runs well, but I cannot catch action on the scroll
bars of the treeview - and nothing comes from the menu and from the
program window as well.
But it wouldn't disturb so much, so I think, this is a pretty good
solution, thank you!
What do you think of Jorge's way? It simply catches all mouse movements
over the window you want to monitor.
Rolf
I had another idea : you can create a timer that checks the mouse absolute
coordinates every 10 seconds (for example). If the mouse does not move during
six timer ticks (so one minute), you can assume that the user is not doing
anything.

Of course he may use the keyboard only. But then you can use the global
keypress event handler "Application_KeyPress" to reset the previous timer.

Regards,
--
Benoît Minisini
Rolf-Werner Eilert
2011-09-08 15:46:46 UTC
Permalink
Post by Benoît Minisini
Post by Rolf-Werner Eilert
Aah sure - because of the containers...
I tried it, and it runs well, but I cannot catch action on the scroll
bars of the treeview - and nothing comes from the menu and from the
program window as well.
But it wouldn't disturb so much, so I think, this is a pretty good
solution, thank you!
What do you think of Jorge's way? It simply catches all mouse movements
over the window you want to monitor.
Rolf
I had another idea : you can create a timer that checks the mouse absolute
coordinates every 10 seconds (for example). If the mouse does not move during
six timer ticks (so one minute), you can assume that the user is not doing
anything.
Of course he may use the keyboard only. But then you can use the global
keypress event handler "Application_KeyPress" to reset the previous timer.
Regards,
Wow - so simple :-) that idea has charm!

I'll give it a try...

Thanks!

Rolf
Rolf-Werner Eilert
2011-09-08 15:52:58 UTC
Permalink
Post by Benoît Minisini
Post by Rolf-Werner Eilert
Aah sure - because of the containers...
I tried it, and it runs well, but I cannot catch action on the scroll
bars of the treeview - and nothing comes from the menu and from the
program window as well.
But it wouldn't disturb so much, so I think, this is a pretty good
solution, thank you!
What do you think of Jorge's way? It simply catches all mouse movements
over the window you want to monitor.
Rolf
I had another idea : you can create a timer that checks the mouse absolute
coordinates every 10 seconds (for example). If the mouse does not move during
six timer ticks (so one minute), you can assume that the user is not doing
anything.
Of course he may use the keyboard only. But then you can use the global
keypress event handler "Application_KeyPress" to reset the previous timer.
Regards,
Argh - where do I have to place Application_KeyPress in code to let it
react anywhere in the program? Is there an application-global SUB?

Rolf
Benoît Minisini
2011-09-08 15:54:26 UTC
Permalink
Post by Rolf-Werner Eilert
Post by Benoît Minisini
I had another idea : you can create a timer that checks the mouse
absolute coordinates every 10 seconds (for example). If the mouse does
not move during six timer ticks (so one minute), you can assume that the
user is not doing anything.
Of course he may use the keyboard only. But then you can use the global
keypress event handler "Application_KeyPress" to reset the previous timer.
Regards,
Argh - where do I have to place Application_KeyPress in code to let it
react anywhere in the program? Is there an application-global SUB?
Rolf
In the startup class, as a public static method (like the Main sub).

Regards,
--
Benoît Minisini
Rolf-Werner Eilert
2011-09-08 15:44:32 UTC
Permalink
I just saw that I cannot make full use of this because in my program,
there is a tabstrip, and on one of the tab's pages I have some kind of
input mask consisting of a varying number of "sub" tabs and a varying
number of textboxes, comboboxes etc. which is generated dynamically
after each click on the treeview.

So in practice, the program would have to run SetAllObservers all over
again - or at least a new observer would have to be started along with
each dynamic control created on the input masks. And I guess it would
mean having some kind of garbage collection such as I created it for the
dynamic controls (I mean, deleting them after use / before another mask
is built).

Hm... couldn't be too difficult if deleting the Observers is not too
difficult... or are they automagically deleted when I delete the dynamic
controls...?

Any idea?

Rolf
Post by Fabien Bodard
Private Sub SetAllObservers(hCont as Container)
dim hObj as Object
Dim hObs as Observer
For each hObj in hCont.Children
hObs = new Observer(hObj) As "WatchAll"
if hObj Is Container then SetAllObservers(hObj)
Next
End
Public Sub _New()
SetAllObservers(Me)
End
Public sub WatchAll_MouseUp()
Print Object.Type(Last)
End
Post by Fabien Bodard
normal ... the function must be iterative... to take all the child of
containers into account
Post by Rolf-Werner Eilert
Hi Andreas,
Thanks! Looks nice... I tried to integrate it into the program. It DOES
function, but only if I click on the panel below the menu. All other
controls in the program seem to be ignored. Same with MouseUp. KeyPress
PUBLIC SUB Form_Open()
DIM OBJ AS Object
DIM OBSwatchall AS Observer
'Start an Observer for Each Control on this Form
FOR EACH OBJ IN ME.Children
OBSwatchall = NEW Observer(OBJ) AS "WatchAll"
NEXT
ini.DateiLesen
ME.Width = ini.FensterBreite()
ME.Height = ini.FensterHoehe()
IF ini.FensterZentrieren() THEN
ME.Center
ELSE
ME.X = ini.FensterX()
ME.Y = ini.FensterY()
END IF
ME.Title = "Kartei 7.3"
ME.Font.Size = ini.FontGroesse()
'ldsv.DateisperrenAufraeumen
EinrichtenBaum
Log.Check
END
PUBLIC SUB WatchAll_MouseDown()
Suche.text = LAST.Name& "_MouseDown()"
END
Any idea what is wrong?
Rolf
Hello,
DIM OBJ as Object
DIM OBSwatchall AS Observer
'Start an Observer for Each Control on this Form
FOR EACH OBJ IN ME.Children
OBSwatchall = NEW Observer(OBJ) AS "WatchAll"
NEXT
Public SUB WatchAll_MouseDown()
PRINT LAST.Name& "_MouseDown()"
END
MouseUp, MouseDown, KeyPress, KeyRelease, GotFocus, LostFocus, ...
Regards A.Fröhlke
-----Ursprüngliche Nachricht-----
Gesendet: Mittwoch, 7. September 2011 08:34
Betreff: Re: [Gambas-user] Does really nobody have an idea?
Thank you Jorge, at a first glance this looks promising. I'll try to
understand it when I've got some more time, maybe this afternoon or so...
Regards
Rolf
Post by Jorge Carrión
Here there is a class that do exactly what you want (I hope).
http://www.gambas-es.org/download.php?id=82
I included a little proyect with example.
Hope it'll be usefull.
Regards.
Post by Rolf-Werner Eilert
Thanks for your idea, Dag-Jarle, but isn't this effort exactly what I
would like to avoid?
I guess the whole thing depends on the question of how QT or GTK handle
the events of the controls within a window/application. I cannot imagine
that the controls are accessed by the GUI (X) directly. That would imply
an event loop for each control. Instead, I would expect one event loop
for the application within which you have one event request for each
window within which you have one event request for each control of that
window.
If there is a slot for the overall mouse activities of one window or
application in QT (on the C++ side), it should be easy for Benoit to
connect this to a Gambas event. If not, things are different :-)
Regards
Rolf
Post by Dag-Jarle Johansen
Something happened....
public sub WriteLogg()
print GetMe.name (and or other options)
end
private sub xxx_control_click()
GetMet=xxx_control
m.WriteLogg
Alternate WriteLogg as function
public WriteLogg(xctrl as control)
print xctrl.name....
I am sure one of the guys here have more sophisticated solutions for
you.,
Post by Dag-Jarle Johansen
f.eks the event-handler on every form, but I am not so good at that yet.
Regards,
Dag-Jarle
Post by Dag-Jarle Johansen
Hi,
I had to write something like that in VB for QM. Even though the effort
make a global object in some module,
f.eks.
m.module
public GetMe as object
in the same module you save or do anything f.eks
puclic sub WriteLogg()
Post by Fabien Bodard
good question rolf :/
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
Print "Mouse is released"
End
--
Fabien Bodard
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Post by Dag-Jarle Johansen
Post by Fabien Bodard
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Malware Security Report: Protecting Your Business, Customers, and the
Bottom Line. Protect your business and customers by understanding the
threat from malware and how it can impact your online business.
http://www.accelacomm.com/jaw/sfnl/114/51427462/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
--
Fabien Bodard
Andreas Fröhlke
2011-09-07 08:11:32 UTC
Permalink
Hello,

here's my idea. In Form_Open use the following Code:

DIM OBJ as Object
DIM OBSwatchall AS Observer

'Start an Observer for Each Control on this Form
FOR EACH OBJ IN ME.Children
OBSwatchall = NEW Observer(OBJ) AS "WatchAll"
NEXT


Then you only need one Function Like:

Public SUB WatchAll_MouseDown()
PRINT LAST.Name & "_MouseDown()"
END

You also can use other Events which must be available for each control like:

MouseUp, MouseDown, KeyPress, KeyRelease, GotFocus, LostFocus, ...


Regards A.Fröhlke

-----Ursprüngliche Nachricht-----
Von: Rolf-Werner Eilert [mailto:eilert-***@t-online.de]
Gesendet: Mittwoch, 7. September 2011 08:34
An: gambas-***@lists.sourceforge.net
Betreff: Re: [Gambas-user] Does really nobody have an idea?

Thank you Jorge, at a first glance this looks promising. I'll try to
understand it when I've got some more time, maybe this afternoon or so...

Regards

Rolf
Post by Jorge Carrión
Here there is a class that do exactly what you want (I hope).
http://www.gambas-es.org/download.php?id=82
I included a little proyect with example.
Hope it'll be usefull.
Regards.
Post by Rolf-Werner Eilert
Thanks for your idea, Dag-Jarle, but isn't this effort exactly what I
would like to avoid?
I guess the whole thing depends on the question of how QT or GTK handle
the events of the controls within a window/application. I cannot imagine
that the controls are accessed by the GUI (X) directly. That would imply
an event loop for each control. Instead, I would expect one event loop
for the application within which you have one event request for each
window within which you have one event request for each control of that
window.
If there is a slot for the overall mouse activities of one window or
application in QT (on the C++ side), it should be easy for Benoit to
connect this to a Gambas event. If not, things are different :-)
Regards
Rolf
Post by Dag-Jarle Johansen
Something happened....
public sub WriteLogg()
print GetMe.name (and or other options)
end
private sub xxx_control_click()
GetMet=xxx_control
m.WriteLogg
Alternate WriteLogg as function
public WriteLogg(xctrl as control)
print xctrl.name....
I am sure one of the guys here have more sophisticated solutions for
you.,
Post by Dag-Jarle Johansen
f.eks the event-handler on every form, but I am not so good at that yet.
Regards,
Dag-Jarle
Post by Dag-Jarle Johansen
Hi,
I had to write something like that in VB for QM. Even though the effort
make a global object in some module,
f.eks.
m.module
public GetMe as object
in the same module you save or do anything f.eks
puclic sub WriteLogg()
Post by Fabien Bodard
good question rolf :/
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
Print "Mouse is released"
End
--
Fabien Bodard
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Post by Dag-Jarle Johansen
Post by Fabien Bodard
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Malware Security Report: Protecting Your Business, Customers, and the
Bottom Line. Protect your business and customers by understanding the
threat from malware and how it can impact your online business.
http://www.accelacomm.com/jaw/sfnl/114/51427462/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Dag-Jarle Johansen
2011-09-07 00:19:11 UTC
Permalink
Hi Rolf-Werner,

sorry, I thought just that.

I Benoit have no better solution, I could write you a little parser; takes
just one second, and the form(s) is/are up to date, and you can define in a
INI which events to monitor. This is a quick and dirty solution, but surely
works, and you have no effort at all.

Regards,
Dag-Jarle
Post by Rolf-Werner Eilert
Thanks for your idea, Dag-Jarle, but isn't this effort exactly what I
would like to avoid?
I guess the whole thing depends on the question of how QT or GTK handle
the events of the controls within a window/application. I cannot imagine
that the controls are accessed by the GUI (X) directly. That would imply
an event loop for each control. Instead, I would expect one event loop
for the application within which you have one event request for each
window within which you have one event request for each control of that
window.
If there is a slot for the overall mouse activities of one window or
application in QT (on the C++ side), it should be easy for Benoit to
connect this to a Gambas event. If not, things are different :-)
Regards
Rolf
Post by Dag-Jarle Johansen
Something happened....
public sub WriteLogg()
print GetMe.name (and or other options)
end
private sub xxx_control_click()
GetMet=xxx_control
m.WriteLogg
Alternate WriteLogg as function
public WriteLogg(xctrl as control)
print xctrl.name....
I am sure one of the guys here have more sophisticated solutions for
you.,
Post by Dag-Jarle Johansen
f.eks the event-handler on every form, but I am not so good at that yet.
Regards,
Dag-Jarle
Post by Dag-Jarle Johansen
Hi,
I had to write something like that in VB for QM. Even though the effort
make a global object in some module,
f.eks.
m.module
public GetMe as object
in the same module you save or do anything f.eks
puclic sub WriteLogg()
Post by Fabien Bodard
good question rolf :/
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
Print "Mouse is released"
End
--
Fabien Bodard
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Post by Dag-Jarle Johansen
Post by Fabien Bodard
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Post by Dag-Jarle Johansen
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Stephen Bungay
2011-09-07 00:24:48 UTC
Permalink
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
Print "Mouse is released"
End
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Hi Fabien

Been there, done that. MouseUp is not firing, which is why I posted
the initial email in the first place. Must be something interfering with
it. I do have gambas 3 and 2 installed on the same machine... Might they
be interfering with each other? Otherwise everything is working well...
just can't tell when the user depresses or releases the mouse on the
slider (there may be other events not firing.. I have not tested them all).

Regards
Steve
Benoît Minisini
2011-09-07 00:29:14 UTC
Permalink
Post by Stephen Bungay
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
Print "Mouse is released"
End
-------------------------------------------------------------------------
----- Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Hi Fabien
Been there, done that. MouseUp is not firing, which is why I posted
the initial email in the first place. Must be something interfering with
it. I do have gambas 3 and 2 installed on the same machine... Might they
be interfering with each other? Otherwise everything is working well...
just can't tell when the user depresses or releases the mouse on the
slider (there may be other events not firing.. I have not tested them all).
Regards
Steve
with Qt or GTK+?
--
Benoît Minisini
Stephen Bungay
2011-09-07 00:33:45 UTC
Permalink
Post by Benoît Minisini
Post by Stephen Bungay
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
Print "Mouse is released"
End
-------------------------------------------------------------------------
----- Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Hi Fabien
Been there, done that. MouseUp is not firing, which is why I posted
the initial email in the first place. Must be something interfering with
it. I do have gambas 3 and 2 installed on the same machine... Might they
be interfering with each other? Otherwise everything is working well...
just can't tell when the user depresses or releases the mouse on the
slider (there may be other events not firing.. I have not tested them all).
Regards
Steve
with Qt or GTK+?
GTK+
Stephen Bungay
2011-09-07 00:47:19 UTC
Permalink
Post by Benoît Minisini
Post by Stephen Bungay
Post by Fabien Bodard
first answer for steve
Public Sub Slider1_MouseUp()
Print "Mouse is released"
End
-------------------------------------------------------------------------
----- Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Hi Fabien
Been there, done that. MouseUp is not firing, which is why I posted
the initial email in the first place. Must be something interfering with
it. I do have gambas 3 and 2 installed on the same machine... Might they
be interfering with each other? Otherwise everything is working well...
just can't tell when the user depresses or releases the mouse on the
slider (there may be other events not firing.. I have not tested them all).
Regards
Steve
with Qt or GTK+?
Further to the earlier reply... I have tested the following events for
Slider under GTK+

DblClick: Does not fire
Enter: Does not fire
GotFocus: Fires as expected
Leave: Does not fire
LostFocus: Fires as expected
MouseDown: Does not fire
MouseUp: Does not fire
MouseWheel: Moves the slider but the actual MouseWheel event doesn't fire.


Steve
Benoît Minisini
2011-09-07 01:04:03 UTC
Permalink
Post by Stephen Bungay
Further to the earlier reply... I have tested the following events for
Slider under GTK+
DblClick: Does not fire
Enter: Does not fire
GotFocus: Fires as expected
Leave: Does not fire
LostFocus: Fires as expected
MouseDown: Does not fire
MouseUp: Does not fire
MouseWheel: Moves the slider but the actual MouseWheel event doesn't fire.
Steve
It works with Gambas 3, so it has been fixed in Gambas 3 at least. :-)
--
Benoît Minisini
Benoît Minisini
2011-09-07 00:24:37 UTC
Permalink
Post by Rolf-Werner Eilert
I sent this yesterday, but nobody seems to know - or is the question too
stupid to be answered? :-)
As the mailing list doesn't accept a repost, I put it under a new Re.
Hope you aren't annoyed, guys...
Hi folks,
Is there a general function that counts or registers mouse and keyboard
events on an application-wide level? Already in Gambas 2 ?
What I need is something that simply watches if the user has clicked or
typed ANYWHERE into the program within a given period without having to
count the clicks and types of each GUI element separately.
My idea is to hide personal data parts of the GUI after some time of no
action and require a password before releasing the surface again.
Thanks for all ideas and hints!
Rolf
I may have a solution, but after the Gambas 3 release. Sorry!
--
Benoît Minisini
Rolf-Werner Eilert
2011-09-07 06:20:55 UTC
Permalink
Post by Benoît Minisini
Post by Rolf-Werner Eilert
I sent this yesterday, but nobody seems to know - or is the question too
stupid to be answered? :-)
As the mailing list doesn't accept a repost, I put it under a new Re.
Hope you aren't annoyed, guys...
Hi folks,
Is there a general function that counts or registers mouse and keyboard
events on an application-wide level? Already in Gambas 2 ?
What I need is something that simply watches if the user has clicked or
typed ANYWHERE into the program within a given period without having to
count the clicks and types of each GUI element separately.
My idea is to hide personal data parts of the GUI after some time of no
action and require a password before releasing the surface again.
Thanks for all ideas and hints!
Rolf
I may have a solution, but after the Gambas 3 release. Sorry!
It's not urgent! If you are able to include that later, no problem, I
don't need it right now. It's one of these things I've had in mind for
quite some while... :-) All I wanted to know is whether it's there
already and I might have overseen it.

So, thanks in advance!

Regards

Rolf
Loading...