View previous topic :: View next topic |
Author |
Message |
wahorger
Joined: 13 Oct 2014 Posts: 1217 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: 7925 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 |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Tue Sep 10, 2019 10:54 pm Post subject: |
|
|
Bill,
The documentation here:
https://silverfrost.com/ftn95-help/clearwinp/library/winstyle_.aspx
states clearly that it is only applicable to a limited number of format codes.
%bg doesn't appear in the list. _________________ ''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... " |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 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: 1217 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: 7925 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: 1217 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: 7925 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: 1217 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: 7925 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: 1217 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: 7925 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 |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Fri Sep 13, 2019 8:07 pm Post subject: |
|
|
so, should it have woeked ok and it was a bug that was fixed , in which case ....
Quote: | Provides a default style for all subsequent winio@ windows. FORMAT is the same as the first argument of winio@ but has no other arguments. Its use is restricted to the following format codes:
%fn Font name
%bf Bold font
%it Italic font
%ul Underlined font
%ts Text size (in the new form %ts[value] where value is a floating point number)
%tc Text colour
%fb Button font
%ww Window style
%sy Dialog style
%es Escape key closes the window
|
is out of date and needs to be updated, in which case what other formats are conform to using WINSTYLE@ ?
or was the 'fix for mext dll release an introduction of it's capability f'or %sh and the list above just needs to be updated with %sh ? _________________ ''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... " |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 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 |
|
|
|