forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

call back with mouse click

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
Bartl



Joined: 16 Oct 2009
Posts: 58
Location: München

PostPosted: Tue Apr 13, 2021 5:25 pm    Post subject: call back with mouse click Reply with quote

Hello, with
%ac[Enter] i can force a call back to „integer*4 function ienter()“
%ac[UP] i can force a call back to „integer*4 function iup()“
a.s.o. (see following code)

Code:

module mouse_click
character*20 cdata1,cdata2,cdata3
integer*4 ifocus,ncontrol,icontrol(3)
common/focus_control/ifocus,icontrol,cdata1,cdata2,cdata3
end module mouse_click

winapp
program mouse_click_test
use mouse_click
include <windows.ins>
external ienter,iup,idown,iesc,ifw
cdata1 = '11.11'
cdata2 = '22.22'
cdata3 = '33.33'
!i=ifw()
call add_focus_monitor@(ifw)
ncontrol = 3
i=winio@('%ac[Enter]&',ienter)
i=winio@('%ac[UP]&',iup)
i=winio@('%ac[DOWN]&',idown) 
i=winio@('%ac[ESC]&',iesc)
i=winio@('%tc[black]%co[right_justify]&')
i=winio@('%co[data_border]&')   
!i=winio@('%nl%rs%lc&',cdata1(1:10),icontrol(1))
i=winio@('%nl%rs%lc&',cdata1(1:10),icontrol(1))
i=winio@('%nl%rs%lc&',cdata2(1:10),icontrol(2))
i=winio@('%nl%rs%lc' ,cdata3(1:10),icontrol(3))
call remove_focus_monitor@(ifw)       
end

integer*4 function ienter()
use mouse_click
include <windows.ins>
ienter=1
if(ifocus.eq.icontrol(1))call set_highlighted@(icontrol(2))
if(ifocus.eq.icontrol(2))call set_highlighted@(icontrol(3))
if(ifocus.eq.icontrol(3))call set_highlighted@(icontrol(1))
end
integer*4 function iup()
use mouse_click
include <windows.ins>
iup=1
if(ifocus.eq.icontrol(3))call set_highlighted@(icontrol(2))
if(ifocus.eq.icontrol(2))call set_highlighted@(icontrol(1))
end
integer*4 function idown()
use mouse_click
include <windows.ins>
idown=1
if(ifocus.eq.icontrol(1))call set_highlighted@(icontrol(2))
if(ifocus.eq.icontrol(2))call set_highlighted@(icontrol(3))
end
integer*4 function iesc()
use mouse_click
include <windows.ins>
iesc=0
end
integer*4 function ifw()
use mouse_click
include <windows.ins>
ifw=2
ifocus=clearwin_info@('FOCUSSED_WINDOW')
end





Is there a possibility to force a call back with a left or right mouse click analogous to %ac[Enter]?
I tried it with a call back to cmouse as shown in following code,
but this didn't work

[code:1:92377ea7de]
module mouse_click
character*20 cdata1,cdata2,cdata3
CHARACTER*256 reason
integer*4 ifocus,ncontrol,icontrol(3)
common/focus_control/ifocus,icontrol,cdata1,cdata2,cdata3,reason
end module mouse_click

winapp
program mouse_click_test
use mouse_click
include <windows.ins>
external ienter,iup,idown,iesc,ifw,cmouse
cdata1 = '11.11'
cdata2 = '22.22'
cdata3 = '33.33'
call add_focus_monitor@(ifw)
ncontrol = 3
i=winio@('%ac[Enter]&',ienter)
i=winio@('%ac[UP]&',iup)
i=winio@('%ac[DOWN]&',idown)
i=winio@('%ac[ESC]&',iesc)
i=winio@('%tc[black]%co[right_justify]&')
i=winio@('%co[data_border]&')
i=winio@('%nl%^rs%lc&',cdata1(1:10),cmouse,icontrol(1))
i=winio@('%nl%rs%lc&',cdata2(1:10),icontrol(2))
i=winio@('%nl%rs%lc' ,cdata3(1:10),icontrol(3))
call remove_focus_monitor@(ifw)
end

integer*4 function ienter()
use mouse_click
include <windows.ins>
ienter=1
if(ifocus.eq.icontrol(1))call set_highlighted@(icontrol(2))
if(ifocus.eq.icontrol(2))call set_highlighted@(icontrol
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2446
Location: South Pole, Antarctica

PostPosted: Wed Apr 14, 2021 6:33 am    Post subject: Reply with quote

Code did not fit into way too limited space of each post. Try to cut it and post continuation in the following post post
Back to top
View user's profile Send private message
Bartl



Joined: 16 Oct 2009
Posts: 58
Location: München

PostPosted: Wed Apr 14, 2021 9:03 am    Post subject: Reply with quote

sorry, here is the second code again

Code:

module mouse_click
character*20 cdata1,cdata2,cdata3
CHARACTER*256 reason
integer*4 ifocus,ncontrol,icontrol(3)
common/focus_control/ifocus,icontrol,cdata1,cdata2,cdata3,reason
end module mouse_click

winapp
program mouse_click_test
use mouse_click
include <windows.ins>
external ienter,iup,idown,iesc,ifw,cmouse
cdata1 = '11.11'
cdata2 = '22.22'
cdata3 = '33.33'
call add_focus_monitor@(ifw)
ncontrol = 3
i=winio@('%ac[Enter]&',ienter)
i=winio@('%ac[UP]&',iup)
i=winio@('%ac[DOWN]&',idown) 
i=winio@('%ac[ESC]&',iesc)
i=winio@('%tc[black]%co[right_justify]&')
i=winio@('%co[data_border]&')   
i=winio@('%nl%^rs%lc&',cdata1(1:10),cmouse,icontrol(1))
i=winio@('%nl%rs%lc&',cdata2(1:10),icontrol(2))
i=winio@('%nl%rs%lc' ,cdata3(1:10),icontrol(3))
call remove_focus_monitor@(ifw)       
end

integer*4 function ienter()
use mouse_click
include <windows.ins>
ienter=1
if(ifocus.eq.icontrol(1))call set_highlighted@(icontrol(2))
if(ifocus.eq.icontrol(2))call set_highlighted@(icontrol(3))
if(ifocus.eq.icontrol(3))call set_highlighted@(icontrol(1))
end
integer*4 function iup()
use mouse_click
include <windows.ins>
iup=1
if(ifocus.eq.icontrol(3))call set_highlighted@(icontrol(2))
if(ifocus.eq.icontrol(2))call set_highlighted@(icontrol(1))
end
integer*4 function idown()
use mouse_click
include <windows.ins>
idown=1
if(ifocus.eq.icontrol(1))call set_highlighted@(icontrol(2))
if(ifocus.eq.icontrol(2))call set_highlighted@(icontrol(3))
end
integer*4 function iesc()
use mouse_click
include <windows.ins>
iesc=0
end
integer*4 function ifw()
use mouse_click
include <windows.ins>
ifw=2
ifocus=clearwin_info@('FOCUSSED_WINDOW')
end
integer*4 function cmouse()
use mouse_click
include <windows.ins>
cmouse=1
write(*,*)"Einsprung in function cmouse"
REASON=clearwin_string@('CALLBACK_REASON')
write(*,*)"Einsprung bei linker Maustaste,reason =", reason
end
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7096
Location: Salford, UK

PostPosted: Thu Apr 15, 2021 2:16 pm    Post subject: Reply with quote

You can use...

Code:
i=winio@('%mg&', WM_LBUTTONDOWN, cmouse)


but this only works when clicking on the "client" area, not when you click inside one of the integer edit boxes.

cmouse should return the value 2.

To get it to work within an edit box would probably be much more difficult.
Back to top
View user's profile Send private message AIM Address
Bartl



Joined: 16 Oct 2009
Posts: 58
Location: München

PostPosted: Fri Apr 16, 2021 8:37 am    Post subject: Reply with quote

That's a shame, maybe I'll try it with %eb when I have time.
Thank you very much for the quick help.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7096
Location: Salford, UK

PostPosted: Fri Apr 16, 2021 10:36 am    Post subject: Reply with quote

Bartl

Your edit boxes are in fact %rs edit boxes and not %rd edit boxes as I implied above.

I was not suggesting that you try %eb edit boxes.

%rs uses a Microsoft edit control and in theory you can interact with it directly but it would take me some time to work out how to do it from a ClearWin+ program.

The standard way to move from one control to another is to use the TAB key or Ctrl+TAB (if I remember correctly) for going backwards.
Back to top
View user's profile Send private message AIM Address
Bartl



Joined: 16 Oct 2009
Posts: 58
Location: München

PostPosted: Fri Apr 16, 2021 6:50 pm    Post subject: Reply with quote

Paul,
Thank you for the information.
I thought you meant the% eb function.
I'm going to consider using the% rd function instead of% rs.
My current solution with the% rs function actually works very well. I just wanted to find a way to achieve the same effect with the mouse button as with the ENTER, UP or DOWN button.
But it is not a problem if there is no corresponding possibility.
Thanks again.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group