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 

When is a Child Window Not a Child Window ? ... when it's ..

 
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: 1383
Location: Aerospace Valley

PostPosted: Wed Mar 28, 2018 6:10 am    Post subject: When is a Child Window Not a Child Window ? ... when it's .. Reply with quote

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



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

PostPosted: Thu Mar 29, 2018 1:49 am    Post subject: Reply with quote

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 ?


_________________
''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 "


Last edited by John-Silver on Wed Apr 11, 2018 8:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Fri Mar 30, 2018 11:10 pm    Post subject: Reply with quote

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



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

PostPosted: Wed Apr 04, 2018 8:20 am    Post subject: Reply with quote

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



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

PostPosted: Wed Apr 04, 2018 8:34 am    Post subject: Reply with quote

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


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

PostPosted: Wed Apr 04, 2018 8:46 am    Post subject: Reply with quote

John

No. I don't have any ideas about this.
Back to top
View user's profile Send private message AIM Address
DanRRight



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

PostPosted: Sat Apr 07, 2018 11:38 am    Post subject: Reply with quote

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 Smile. Formally, GUI creation is not regulated by the Fortran Standard so there will be a lot of cultural shocks.
Back to top
View user's profile Send private message
John-Silver



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

PostPosted: Mon Apr 09, 2018 11:42 am    Post subject: Reply with quote

*** 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 ... Smile "


Last edited by John-Silver on Thu May 03, 2018 7:33 am; edited 2 times in total
Back to top
View user's profile Send private message
John-Silver



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

PostPosted: Mon Apr 09, 2018 11:53 am    Post subject: Reply with quote

Here's what it should produce on first running:-


_________________
''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: 749
Location: Morrison, CO, USA

PostPosted: Tue Jun 09, 2020 10:42 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
John-Silver



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

PostPosted: Fri Jun 12, 2020 10:05 am    Post subject: Reply with quote

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 ??? Surprised) 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 ... Smile "
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