View previous topic :: View next topic |
Author |
Message |
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Sat Apr 18, 2015 11:41 am Post subject: Scrollbar in a Child Window - Ex. in Manual Not Working |
|
|
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 |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7916 Location: Salford, UK
|
Posted: Sat Apr 18, 2015 1:19 pm Post subject: |
|
|
This feature is fairly new so maybe you just need to use the latest salflibc.dll. |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Sat Apr 18, 2015 3:00 pm Post subject: |
|
|
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 |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Sat Apr 18, 2015 3:03 pm Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7916 Location: Salford, UK
|
Posted: Sat Apr 18, 2015 3:28 pm Post subject: |
|
|
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 |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2813 Location: South Pole, Antarctica
|
Posted: Sat Apr 18, 2015 8:34 pm Post subject: |
|
|
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 |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Sat Apr 18, 2015 10:38 pm Post subject: |
|
|
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 |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2813 Location: South Pole, Antarctica
|
Posted: Sat Apr 18, 2015 10:43 pm Post subject: |
|
|
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 |
|
|
|