![forums.silverfrost.com Forum Index](templates/subSilver/images/logo_phpBB.gif) |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
John-Silver
![](http://i.postimg.cc/K8HMTnXq/Bart-Unrivalled-Native-Plotting256.jpg)
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Wed Mar 28, 2018 6:10 am Post subject: When is a Child Window Not a Child Window ? ... when it's .. |
|
|
When is a Child Window Not a Child Window ? ... when it's in an MDI maybe ?
Bill's (wahoger) post about his troubles with child windows:-
(ref. http://forums.silverfrost.com/viewtopic.php?p=24315#24315 on p.3, 16th March)
spurred me into investigating the possibilities of setting up a window with several sub-windows (child windows).
The aim being to create a window, and inside it an MDI 'frame', and inside that, as a test, just the one scrollable child window of Bill's example.
Using Bill's example as a starting point I botched up an example using the example codes for child windows in mdi's and '%sh' child windows (the one Bill's example is based on) in the ftn95 dcumentation.
I tried various configurations of the code to start with and got windows (main and child) appearing but never with the 'child window' being restrained within the main window as it's supposed to be.
Playing around I have eventually ended up with the code below, which fails at runtime with a 'Pivot applied to control which cannot resize' error.
Note that I have tried deleting the 2 occurences of %pv (with the %fr and with the %aw) to no avail, resulting in a new 'incomplete formatted window at end of program' error.
You'll ses the order of the coding is as follows:
- set up main window containing an MDI frame (ctrl1)
- then set up of sheet (for child window) (ctrl2)
- then set up the child window (calling the sheet)attaching it to the MDI window.
So, where have I gone wrong with this setup ?
Code: | WINAPP
integer i1,i2,i3, ctrl1, ctrl2, wd, ht
integer,external:: button10
!__________________________________________
! set up mdi frame in a MAIN window
i1=winio@('%ca[Main Window containing an MDI frame]&')
i1=winio@('%pv%fr&',800L,600L)
i1=winio@('%lw',ctrl1)
!____________________________________________
!definition of child window 'sheet' with controls...
i2=winio@("%sh&",ctrl2)
i2=winio@('%ww[no_frame]&')
!Add your controls here...
i2=winio@("Sample containing scrolling child window as a test&")
i2=winio@("%3nl%cn%^6bb[OK]&",button10)
i2=winio@("%3nl%cn%6bb[Cancel]")
!_________________________________________________
! attach child window to mdi parent
i3=winio@('%pv%aw&',ctrl1)
! Defn of window to display child with vertical scroll bar...
i3=winio@("%ww[no_maxbox]&")
i3=winio@("%ca[Scroll Demo Child Window]&")
wd = 280; ht = 150
i3=winio@("%sz&",wd,ht)
i3=winio@("%ch[vscrollbar,hscrollbar]&",ctrl2)
print *,ii
stop
end
integer function button10()
button10 = -10
return
end |
_________________ ''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 |
|
![](templates/subSilver/images/spacer.gif) |
John-Silver
![](http://i.postimg.cc/K8HMTnXq/Bart-Unrivalled-Native-Plotting256.jpg)
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Thu Mar 29, 2018 1:49 am Post subject: |
|
|
Compiles OK ...
Below is the runtime error message I get ....
The line it points to iděs theone with the %ch definition in it.
I'm running v8.1 personal with dlls14 included and compiling 32bit.
Eddie, on the post with Bill's original code you mentioned 'it works ok for me with v8.1' ... that's all very strange ... are you compiling under 32bit or 64bit ? do you have the dlls included ?
![](https://s26.postimg.org/k7a2jiipl/Bill_s_Child_W_code-2aasposted-1c_error_with_CHECK.jpg) _________________ ''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 ... "
Last edited by John-Silver on Wed Apr 11, 2018 8:26 pm; edited 1 time in total |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Fri Mar 30, 2018 11:10 pm Post subject: |
|
|
I tried it with 8.10 32-bit Pe. I don't use or need 64-bit. There's always a chance that I didn't test it fully - I'll have another go. It compiled and ran, so I reported that.
Eddie.
Yes I tried it again with FTN95 -LGO. It scrolls. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
John-Silver
![](http://i.postimg.cc/K8HMTnXq/Bart-Unrivalled-Native-Plotting256.jpg)
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Wed Apr 04, 2018 8:20 am Post subject: |
|
|
Thanks Eddie.
So the only difference might be becasue I'm using the DLLs14 then.
Paul - any ideas why this is happening please ? _________________ ''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 |
|
![](templates/subSilver/images/spacer.gif) |
John-Silver
![](http://i.postimg.cc/K8HMTnXq/Bart-Unrivalled-Native-Plotting256.jpg)
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Wed Apr 04, 2018 8:34 am Post subject: |
|
|
Thanks Eddie.
So the only difference might be becasue I'm using the DLLs14 then.
Paul - any ideas why this is happening please ? _________________ ''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 |
|
![](templates/subSilver/images/spacer.gif) |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Wed Apr 04, 2018 8:46 am Post subject: |
|
|
John
No. I don't have any ideas about this. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
DanRRight
Joined: 10 Mar 2008 Posts: 2816 Location: South Pole, Antarctica
|
Posted: Sat Apr 07, 2018 11:38 am Post subject: |
|
|
I did not look inside what this program is doing, I saw frames, child windows etc and know this will be a headache (my own code looks like that), and just compiled it in 8.30 and when run, it produced the same error like John-Silver had.
My suggestion: use the well working method of yelling and swearing with Clearwin+ together with combinatorics (by changing and trying everything imaginable) I think after exhausting all possible variants you will find the running solution . Formally, GUI creation is not regulated by the Fortran Standard so there will be a lot of cultural shocks. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
John-Silver
![](http://i.postimg.cc/K8HMTnXq/Bart-Unrivalled-Native-Plotting256.jpg)
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Mon Apr 09, 2018 11:42 am Post subject: |
|
|
*** A working version !!! ***
The problem was with the %pv%aw i.e. re-sizing of the attached window done in that way.
In fact it needed to be done with this:
Quote: | %ww[not_fixed_size] |
now included a few lines below.
The code now produces a main window, which contains a mdi frame, which in turn contains a child window with scrollbars (which is actually a child window to get the scrollbars) which calls the %sh where the contents of that child window are defined.
Try expanding up and down both the main window and the child window, moving them around (and out of) the main window, and minimising and maximising them to see how it works out.
Notice the tab bar at the top where icons appear when the child window is maximised to allow for return to original size/position.
Effectively you can see how %ps works becasue it's just a special case with the child windows all mximised and seperate tabs for each child window to bring them to the top.
!
! Bill's_ChildW_code-2b
!
Code: |
WINAPP
integer i1,i2,i3, ctrl0,ctrl1, ctrl2, wd, ht
integer,external:: button10
!__________________________________________
! set up mdi frame in a MAIN window
i1=winio@('%ca[Main Window containing an MDI frame]&')
i1=winio@('%ww[not_fixed_size]&') ! main window re-size allowed
i1=winio@('%pv%fr&',800L,600L) ! pivot on frame is OK
! i1=winio@('%fr&',800L,600L)
i1=winio@('%lw',ctrl0)
!____________________________________________
!definition of child window 1 - 'sheet' with controls...
i2=winio@("%sh&",ctrl1)
i2=winio@('%ww[no_frame]&')
! attempt to put pivot here on referenced 'sheet' instead of on %aw below has no apparent effect
! i1=winio@('%ww[not_fixed_size]&')
!Add your controls here...
i2=winio@("Sample containing scrolling child window as a test&")
i2=winio@("%3nl%cn%^6bb[OK]&",button10)
i2=winio@("%3nl%cn%6bb[Cancel]")
!_________________________________________________
! attach child window 1 to mdi parent
! i3=winio@('%pv%aw&',ctrl0) ! pivot on 'attached window' *** crashes prog ***
i3=winio@('%aw&',ctrl0)
! Defn of window to display child with vertical scroll bar...
! i3=winio@("%ww[no_maxbox]&") ! removed to see display when child window is maximised
i3=winio@('%ww[not_fixed_size]&') ! main child window 1 re-size allowed
i3=winio@("%ca[Scroll Demo Child Window 1]&")
wd = 280; ht = 150
i3=winio@("%sz&",wd,ht)
i3=winio@("%ch[vscrollbar,hscrollbar]",ctrl1)
! i3=winio@("%ch",ctrl1)
!_____________________________________________
print *,i1,i2,i3
stop
end
integer function button10()
button10 = -10
return
end |
_________________ ''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 ... "
Last edited by John-Silver on Thu May 03, 2018 7:33 am; edited 2 times in total |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
John-Silver
![](http://i.postimg.cc/K8HMTnXq/Bart-Unrivalled-Native-Plotting256.jpg)
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Mon Apr 09, 2018 11:53 am Post subject: |
|
|
Here's what it should produce on first running:-
![](https://s26.postimg.cc/b3ewxw43d/Child_Wcode-2b-1_window_when_run.jpg) _________________ ''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 |
|
![](templates/subSilver/images/spacer.gif) |
wahorger
![](http://cjdsoftware.com/wp-content/uploads/2016/06/cjd-color-avatar.png)
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Tue Jun 09, 2020 10:42 pm Post subject: |
|
|
Thanks for providing this. I have been working on getting scroll bars attached properly, and kept failing miserably. Your examples helped me greatly! There are some subtle nuances. Like needing to have %sz available in the main window, while providing the [vscrollbar,hscrollbar] option for the child window. If you don't have it, my sample program will start, and end without any window displayed and no error messages. While in the sample, it isn't clear that you need this for everything to work. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
John-Silver
![](http://i.postimg.cc/K8HMTnXq/Bart-Unrivalled-Native-Plotting256.jpg)
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Fri Jun 12, 2020 10:05 am Post subject: |
|
|
Good grief I'd forgotten all about this - 2 years ago now.
Don't thank me Bill, it was based on your code , mixed with code from an example in the documentation, sprinkled with a large dose of Dan's considered and scientific approach advice of his 7th April 2018 comment !!!
(Are you sure you're not on one of the Covid19 scientific adviser teams Dan ??? ) LOL ) beccause here in France and over in the UK the governments seem to be using your approach ! LOLEM _________________ ''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 |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|