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 

WINSTYLE issue

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
wahorger



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

PostPosted: Tue Sep 10, 2019 6:24 pm    Post subject: WINSTYLE issue Reply with quote

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
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Tue Sep 10, 2019 6:51 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Tue Sep 10, 2019 10:54 pm    Post subject: Reply with quote

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 ... Smile "
Back to top
View user's profile Send private message
wahorger



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

PostPosted: Wed Sep 11, 2019 12:13 am    Post subject: Reply with quote

John,

It also shows used in the example. So, naturally....
Back to top
View user's profile Send private message Visit poster's website
wahorger



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

PostPosted: Wed Sep 11, 2019 12:19 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Sep 11, 2019 6:42 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
wahorger



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

PostPosted: Wed Sep 11, 2019 2:23 pm    Post subject: Reply with quote

It doesn't appear to work with just the %ww either.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Sep 11, 2019 3:57 pm    Post subject: Reply with quote

Is that %ww with %sh? Can you provide an example? Does it work at all?
Back to top
View user's profile Send private message AIM Address
wahorger



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

PostPosted: Wed Sep 11, 2019 4:03 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Thu Sep 12, 2019 2:55 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
wahorger



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

PostPosted: Thu Sep 12, 2019 3:39 pm    Post subject: Reply with quote

Thanks, Paul!
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Thu Sep 12, 2019 3:58 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Fri Sep 13, 2019 8:07 pm    Post subject: Reply with quote

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 ... Smile "
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Sep 14, 2019 7:48 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support 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