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 

Scrollbar in a Child Window - Ex. in Manual Not Working

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
John-Silver



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

PostPosted: Sat Apr 18, 2015 11:41 am    Post subject: Scrollbar in a Child Window - Ex. in Manual Not Working Reply with quote

While trying to help Dan find his bug I've been introduced to the joys of Property Sheets, which seem to be very powerful.

Resulting from this:-

1. I've tried to run the example of how to include a scrollbar in a child window which is based on the code included in the on-line manual (see reference in comments.
Here's the code:-

Code:
!
! Child Window with Vertical Scroll Bar
!  Ex. - ref. http://silverfrost.com/ftn95-help/clearwinp/formats/_ch.aspx
!
WINAPP
program main
integer control_var

integer ii, ctrl, wd, ht
!child window with controls...
ii=winio@("%sh&",ctrl)

!Add your controls here...
ii=winio@('Hello, this is a test&')
ii=winio@('%nl,Why does this appear like this&')
ii=winio@('%nl,instead of inserting scroll bars&')
ii=winio@('%nl%bt[Stop1]&')
ii=winio@('%nl%bt[Stop2]&')
ii=winio@('%nl%bt[Stop3]&')
ii=winio@('%nl%bt[Stop4]&')

ii=winio@(" ")
!Main window to display child with vertical scroll bar...
wd = 500; ht = 150
ii=winio@("%sz&",wd,ht)
ii=winio@("%ch[vscrollbar]",ctrl)

end program[/url]


It doesn't work, it just writes the text '[vscrollbar]' into the window as if it was a text string.
It's probably a stupid error on my part but I'm struggling to see it.

Note - At first I had put a single button, then thought it was maybe because the scrollbar only appears if needed, which is why there are 5 buttons in the code just to force it to extend below the nominal window size.

---------------------------------

2. Once it's working, I'm interested in then extending this example to use to define scrollbars in Property Sheets. Is this possible ?
In principal, if I understand correctly, the arrangement of a property sheet is similar, they are set up as %sh's and then called with %ps. But %ps doesn't seem to have an option for putting scrollbars on the various sheets.
I've been unsuccessful in finding anything in the manuals about this. Is it actually possible ?
Back to top
View user's profile Send private message
John-Silver



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

PostPosted: Sat Apr 18, 2015 11:45 am    Post subject: Reply with quote

here's a screen grab showing what I get .......

https://www.dropbox.com/s/svrm7w5wmgpjcy2/scrollbar%20in%20child%20window%20error.jpg?dl=0
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Apr 18, 2015 1:19 pm    Post subject: Reply with quote

This feature is fairly new so maybe you just need to use the latest salflibc.dll.
Back to top
View user's profile Send private message AIM Address
John-Silver



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

PostPosted: Sat Apr 18, 2015 3:00 pm    Post subject: Reply with quote

Thanks Paul. I'm using v7.0 and it was introduced in 7.1.

... and for my other question ? Is it possible to add scrollbar to sheets in a %ps in a similar way ? If so how.


[It does also raise the question as to why the presence of a non-valid 'option' (vscrollbar) wasn't flagged on compile !!!]
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Sat Apr 18, 2015 3:03 pm    Post subject: Reply with quote

Probably it doesn't work well, because you (and Dan too maybe) are trying to get too much out of %ps. Where it works fine is that you have a few tabs and individual sheets that have a few data entry boxes on each of them. They certainly don't work well as surrogates for the tabbed sheets in a spreadsheet program like Excel. It's in the name: 'Property sheets' says it all - it isn't 'Excel tabbed sheets'.

Dan has infinitely more patience than I have, as I do my programming for free and know what my hourly rate is for my main work, hence what messing around costs me (and the Government, as they take a sizeable chunk of it when I bother to earn it). Hence I give up just as I feel my blood pressure rising - I don't wait for the blood to boil.

I spent several weeks on %ps before I decided that it wouldn't do what I wanted, and I did it a different way. If no standard program you bought to run under Windows does it like you want to do it (whatever it is) just accept that it is difficult to do it that way, and as Clearwin+ only does a subset of what Windows can do for you, then you will struggle.

Eddie

PS (no pun intended) %ps is on my 'don't bother with it' list.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Apr 18, 2015 3:28 pm    Post subject: Reply with quote

The reason %ch did not complain about the invalid option is that %ch previously had no options so anything after %ch was just treated as text.

I doubt very much that you will find a way to use %ch within a property sheet, however, some controls have their own scroll bars and naturally controls can be displayed on a tab page of a property sheet.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Sat Apr 18, 2015 8:34 pm    Post subject: Reply with quote

Possibly %PS is sensitive to something. I had patience to not fix it for few last years thinking that bug will expose itself somewhere else or will be found by others who report it. Alas, the damn roach hides too deep. But... Code works under debugger even if compiled with /nocheck /optimize. And %ps from the hell works like charm asking for big respect to itself when trying to put it down and make small prototype for this crash from zero I eventually added gazillions of controls to few dozen of tabs. And this devilry even works fine with John's one of computers. It does not work only with my current content of program. Same was with another smaller code but SAVE statement fixed it.

This %ps is key property sheet called "General Settings" of large code, I can not divide it to make smaller. Code already has few smaller ones. Division will make a total mess. Making %ps reliable is hence the key.

John is trying to make %ps to look more compact with vertical scrollbars but that could not be the reason for crash and could be also not that easy to do. Sure after fixing this bug I will probably grow %ps further in all dimensions and at some point will hit the screen bottom again. Or screen width. I hope Paul will make meantime tabs stackable in multiple lines as it will take for me years. But I think the simples solution would be just to buy 50" 3840x2160 monitors as they go down in price to fit everything.
Back to top
View user's profile Send private message
John-Silver



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

PostPosted: Sat Apr 18, 2015 10:38 pm    Post subject: Reply with quote

I wasn't trying to make the PS more compact as such, I was trying to make it just so I could see (and try) the CANCEL/ESC buttons at the bottom to see if using those generated the error you're getting. At the moment all I can do is press the keyboard ESC key (which works on my Win7 laprop).
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Sat Apr 18, 2015 10:43 pm    Post subject: Reply with quote

John, I don't think those buttons are important for seeing crash. Crash in my case takes place with any way of closing %ps. But if you want to try this you can shorten temporally (comment few lines) those tabs which are long.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ 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