View previous topic :: View next topic |
Author |
Message |
acw
Joined: 04 Nov 2005 Posts: 165 Location: Darkest Devon
|
Posted: Wed Jul 11, 2018 1:18 pm Post subject: |
|
|
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 |
|
|
acw
Joined: 04 Nov 2005 Posts: 165 Location: Darkest Devon
|
Posted: Wed Jul 11, 2018 1:33 pm Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Wed Jul 11, 2018 2:40 pm Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
|
Back to top |
|
|
acw
Joined: 04 Nov 2005 Posts: 165 Location: Darkest Devon
|
Posted: Wed Jul 11, 2018 7:56 pm Post subject: |
|
|
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 |
|
|
acw
Joined: 04 Nov 2005 Posts: 165 Location: Darkest Devon
|
Posted: Wed Jul 11, 2018 8:12 pm Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Wed Jul 11, 2018 10:30 pm Post subject: |
|
|
This that just with the latest download? Can you provide a demo? |
|
Back to top |
|
|
acw
Joined: 04 Nov 2005 Posts: 165 Location: Darkest Devon
|
Posted: Thu Jul 12, 2018 9:09 am Post subject: |
|
|
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 |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Thu Jul 12, 2018 3:42 pm Post subject: |
|
|
From my experience, the use of %bt without providing a call back, %bt will always return a zero. |
|
Back to top |
|
|
acw
Joined: 04 Nov 2005 Posts: 165 Location: Darkest Devon
|
Posted: Thu Jul 12, 2018 4:11 pm Post subject: |
|
|
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 |
|
|
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: Düsseldorf, Germany
|
Posted: Thu Jul 12, 2018 4:12 pm Post subject: |
|
|
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 |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Thu Jul 12, 2018 5:07 pm Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Thu Jul 12, 2018 5:10 pm Post subject: |
|
|
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 |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Thu Jul 12, 2018 5:12 pm Post subject: |
|
|
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 |
|
|
acw
Joined: 04 Nov 2005 Posts: 165 Location: Darkest Devon
|
Posted: Thu Jul 12, 2018 5:25 pm Post subject: |
|
|
That's great Paul thanks. No more ?s and dialogs are working. It also feels more responsive on redraw. |
|
Back to top |
|
|
|