View previous topic :: View next topic |
Author |
Message |
wahorger

Joined: 13 Oct 2014 Posts: 1257 Location: Morrison, CO, USA
|
Posted: Tue Sep 10, 2019 6:24 pm Post subject: WINSTYLE issue |
|
|
I was playing around with child windows and wanted to add a "standard" background color using the WINSTYLE@ function. Using it, however, caused a crash "unused arguments" at run-time in line 8 (the %sh).
Code: | winapp
program main
use mswin
integer:: ii, ctrl, wd=-999, ht=-999,x=-999,y=-999
integer,external:: call_back
!child window with controls...
call winstyle@('%bg[white]&')
ii=winio@("%sh&",ctrl)
ii=winio@('%bt[Button]&')
ii=winio@('%bt[Button]&')
ii=winio@('%bt[Button]&')
ii=winio@('%bt[Button]&')
ii=winio@('%bt[Button]&')
ii=winio@('%bt[Button]&')
ii=winio@('%bt[Button]%nl&')
ii=winio@('%bt[Button]%nl&')
ii=winio@('%bt[Button]%nl&')
ii=winio@('%bt[Button]%nl&')
ii=winio@('%bt[Button]%nl&')
ii=winio@('%bt[Button]%nl&')
ii=winio@('%bt[Button]%nl&')
ii=winio@('%bt[Button]%nl&')
ii=winio@('%bt[Button]%nl&')
ii=winio@('%bt[Button]%nl&')
ii=winio@('%bt[Button]&')
ii=winio@(" ")
call get_window_location@(ctrl,x,y,wd,ht)
print *,x,y,wd,ht
!Main window to display child with vertical scroll bar...
wd = 280; ht = 150
ii=winio@("%ww[not_fixed_size]%sz&",wd,ht)
! ii = winio@('%`mv&',call_back)
ii=winio@("%ch[hscrollbar,vscrollbar]",ctrl)
end
integer function call_back()
use mswin
character*32:: callback_reason
call_back = 1
callback_reason=clearwin_string@('CALLBACK_REASON')
print *,callback_reason
return
end
|
|
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Sep 10, 2019 6:51 pm Post subject: |
|
|
Yes. It appears that winstyle@ does not work in this context.
I will make a note to investigate whether or not it can be fixed. |
|
Back to top |
|
 |
wahorger

Joined: 13 Oct 2014 Posts: 1257 Location: Morrison, CO, USA
|
Posted: Wed Sep 11, 2019 12:13 am Post subject: |
|
|
John,
It also shows used in the example. So, naturally.... |
|
Back to top |
|
 |
wahorger

Joined: 13 Oct 2014 Posts: 1257 Location: Morrison, CO, USA
|
Posted: Wed Sep 11, 2019 12:19 am Post subject: |
|
|
Paul,
I also tried it right before the %ww. Didn't work there either.
But, if it doesn't work at all, I'm OK with that. I'm thinking that a function that does the setup works in my case. WINSTYLE@ would be nice, but is not necessary for me. I can certainly see it for others!
Bill |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Wed Sep 11, 2019 6:42 am Post subject: |
|
|
Bill
I haven't checked it out yet but I am hoping that it only fails with %sh.
If anyone has the time to test it (without %sh) then please let me know how you get on. |
|
Back to top |
|
 |
wahorger

Joined: 13 Oct 2014 Posts: 1257 Location: Morrison, CO, USA
|
Posted: Wed Sep 11, 2019 2:23 pm Post subject: |
|
|
It doesn't appear to work with just the %ww either. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Wed Sep 11, 2019 3:57 pm Post subject: |
|
|
Is that %ww with %sh? Can you provide an example? Does it work at all? |
|
Back to top |
|
 |
wahorger

Joined: 13 Oct 2014 Posts: 1257 Location: Morrison, CO, USA
|
Posted: Wed Sep 11, 2019 4:03 pm Post subject: |
|
|
Code: | winapp
program main
use mswin
integer:: ii,wd,ht
call winstyle@('%tc[RED]&')
wd = 280; ht = 150
ii=winio@("%ww[not_fixed_size]%sz&",wd,ht)
II = WINIO@('%BT[tEST]')
end
|
This fails with "Unused Arguments in winio@ call". |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Thu Sep 12, 2019 2:55 pm Post subject: |
|
|
This has now been fixed for the next release of the DLLs.
In the case of %ww you can work around the problem by avoiding extra arguments (after the format) in the first call to winio@.
ii=winio@("%ww[not_fixed_size]%sz&",wd,ht)
becomes:
ii=winio@("%ww[not_fixed_size]&")
ii=winio@("%sz&",wd,ht)
If necessary, for %sh you could precede with
ii=winio@(" &")
or maybe change the order. |
|
Back to top |
|
 |
wahorger

Joined: 13 Oct 2014 Posts: 1257 Location: Morrison, CO, USA
|
Posted: Thu Sep 12, 2019 3:39 pm Post subject: |
|
|
Thanks, Paul! |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Thu Sep 12, 2019 3:58 pm Post subject: |
|
|
The above fix and work-around turns out to be for 64 bits only.
The 32 bit case has now been fixed but the above work-around may not be effective in this case. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Sat Sep 14, 2019 7:48 am Post subject: |
|
|
It is a bug and it has now been fixed for the next release. The documentation is correct apart from the fact that %bg is missing from the list. |
|
Back to top |
|
 |
|