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 

CALLBACK_REASON response ? in %gr callback
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
acw



Joined: 04 Nov 2005
Posts: 163
Location: Darkest Devon

PostPosted: Wed Jul 11, 2018 1:18 pm    Post subject: Reply with quote

Thanks Paul. In this case our large CAD application is based around the message loop to provide lots of click and drag type operations (zoom, select etc.) so relies on the click and release events. It also relies on move although if the odd move is missed that is no great drama.

Is this down to some fundamental redesign of message handling within ClearWin? Our app has worked for years and years with regular FTN95 updates.
Back to top
View user's profile Send private message Visit poster's website
acw



Joined: 04 Nov 2005
Posts: 163
Location: Darkest Devon

PostPosted: Wed Jul 11, 2018 1:33 pm    Post subject: Reply with quote

Alternatively is there any way I can get access to the underlying message loop, %mg(WM_LBUTTONDOWN) doesn't work, presumably ClearWin gets in there first.

I'm finding that it doesn't really need to be a fast mouse move - just moving is slowly with a click and release has problems. I'm still puzzled why there would be re-entrancy anyway, given I thought Windows only sends the message to the single UI thread?
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Jul 11, 2018 2:40 pm    Post subject: Reply with quote

I don't know why it worked before and not now.
I have worked out how to store one pending message and this helps but does not solve the problem completely.
I will have a go a creating a list of pending messages for stacked up mouse events.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Jul 11, 2018 3:31 pm    Post subject: Reply with quote

Please try the following download to see if it fixes the problem.

https://www.dropbox.com/s/eg9llf9lvytxrfr/acw.zip?dl=0
Back to top
View user's profile Send private message
acw



Joined: 04 Nov 2005
Posts: 163
Location: Darkest Devon

PostPosted: Wed Jul 11, 2018 7:56 pm    Post subject: Reply with quote

Great, thanks Paul. That does appear to fix the example and makes a massive difference to our main app although I am still getting a few ? reasons in the main app and always at startup after the initial RESIZE. Sometimes the first mouse click is not reported but after that is is pretty solid.

If I add some re-entrancy detection I am finding a few re-enters on MOUSE_MOVES and MOUSE_WHEEL events. Looking back at older versions this has always been the case and hasn't caused problems although I do allow for it. With the latest salflib some of the re-entrant messages are ?s.
Back to top
View user's profile Send private message Visit poster's website
acw



Joined: 04 Nov 2005
Posts: 163
Location: Darkest Devon

PostPosted: Wed Jul 11, 2018 8:12 pm    Post subject: Reply with quote

Paul, I expect that dll is work in progress but in case this is news, I'm finding the return value from winio for a window containing buttons is not returning the index of the clicked button, just 0.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Jul 11, 2018 10:30 pm    Post subject: Reply with quote

This that just with the latest download? Can you provide a demo?
Back to top
View user's profile Send private message
acw



Joined: 04 Nov 2005
Posts: 163
Location: Darkest Devon

PostPosted: Thu Jul 12, 2018 9:09 am    Post subject: Reply with quote

This is happening in both the 279 beta and the last download. It's okay with the 8.30 release. Expected 1 for Yes, 2 for No but all winoio ever returns is 0:
Code:

winapp
  use mswin

  integer:: res
  res = winio@('%ca[Confirmation]Yes = 1, No = 2: %bt[Yes] %bt[No]')
  print *, res  ! expect 1 for Yes, 2 for No
end
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 484
Location: Morrison, CO, USA

PostPosted: Thu Jul 12, 2018 3:42 pm    Post subject: Reply with quote

From my experience, the use of %bt without providing a call back, %bt will always return a zero.
Back to top
View user's profile Send private message Visit poster's website
acw



Joined: 04 Nov 2005
Posts: 163
Location: Darkest Devon

PostPosted: Thu Jul 12, 2018 4:11 pm    Post subject: Reply with quote

Interesting - I've never had any problem before whether using a callback or not. It is certainly supposed to work otherwise there'd be no way of telling which button caused the window to close without using a cb.
Back to top
View user's profile Send private message Visit poster's website
Wilfried Linder



Joined: 14 Nov 2007
Posts: 311
Location: Düsseldorf, Germany

PostPosted: Thu Jul 12, 2018 4:12 pm    Post subject: Reply with quote

Interesting... I didn't knew this, but I found information in the file cwplus.enh, topic No. 357, which says:

"A new format code %id has been added in order to specify the button number (ID) of the next %bt, %tt or %bb button. The button number provides the winio@ return value when a button is clicked and the button is not given a callback function. So %id values can be used in conjuction with the winio@ return value when button callback functions are not needed. By default, button numbers are provided automatically in the order that the buttons are defined."

Alternative coding:

Code:
res = winio@('%ca[Confirmation]Yes = 1, No = 2: %id%bt[Yes]%id%bt[No]',1,2)


Wilfried
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 484
Location: Morrison, CO, USA

PostPosted: Thu Jul 12, 2018 5:07 pm    Post subject: Reply with quote

I did not know about the %id, so this is good. For simple selections, I can see that this would be helpful.

Personally, I use a specific value, and have a set of generic callback functions (1 through 10, for my case).
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Thu Jul 12, 2018 5:10 pm    Post subject: Reply with quote

I have discovered a regression that is the probable cause of the "?" failures. I have also fixed a recent regression regarding the return of the button index.

Here is a new download to test...

https://www.dropbox.com/s/g3ir4nx0wjxqba1/acw.zip?dl=0
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 1878
Location: Yateley, Hants, UK

PostPosted: Thu Jul 12, 2018 5:12 pm    Post subject: Reply with quote

Wilfried,

I think it is a sort of madness to set the return code for the buttons.

By default, they are numbered in the order in which the buttons are specified, with 0 reserved for the close box. Once you start explicitly numbering them you have a potential to confuse which is which.

On the other hand ... while developing a window, you can be adding or removing buttons, and the return code from a particular button may change, and specifying the return code may be sensible (although if I plunged headlong into the madness I would be using high numbers like 50, 100, 150 etc not 1, 2, 3 etc.).

If the button exits from a window immediately, you process the action after the window has closed, whereas if you put the action code in a callback, it executes before the window closes. Sometimes the latter is preferable, but not always.

Clearwin+ gives you multiple options.

ACW - your code works for me and returns sensible numbers.

Eddie
Back to top
View user's profile Send private message
acw



Joined: 04 Nov 2005
Posts: 163
Location: Darkest Devon

PostPosted: Thu Jul 12, 2018 5:25 pm    Post subject: Reply with quote

That's great Paul thanks. No more ?s and dialogs are working. It also feels more responsive on redraw. Very Happy
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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