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 

Resizing different %gr areas in the same window
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
PaulLaidler
Site Admin


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

PostPosted: Wed Apr 25, 2018 7:34 pm    Post subject: Reply with quote

Dan

ClearWin+ could check if the identifier was "undefined" but only in /UNDEF mode (or any mode that includes /UNDEF such as /CHECKMATE).

Another possibility, which might help, is to get ClearWin+ to generate a unique identifier when used with %gr or %pl and when the user-supplied value is less than or equal to zero.
Back to top
View user's profile Send private message
John-Silver



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

PostPosted: Wed Apr 25, 2018 9:06 pm    Post subject: Reply with quote

It's worth re-posting Paul's 2 explanations here for future reference,
first from the post back in 2009 (resurrected today)
http://forums.silverfrost.com/viewtopic.php?p=24740#24740
we have:
Quote:
ClearWin+ provides an interface into the Microsoft Windows API. A window (or control) has a unique ID called its handle and this is supplied by the API. Many ClearWin+ routines use this handle including SET_MOUSE_CURSOR_POSITION@.

%gr is a ClearWin+ object that has an associated "graphics block". When ClearWin+ creates a graphics block it attaches a unique ID to the block but the user is also allowed to provide the value of the ID (via a grave modifier on %gr). I guess we ought to have a way to get the current automatic ID but we don't at the moment.

The word "handle" is usually used to denote a unique integer that identifies a particular object within a set of similar objects with the same attributes.


but also, just last year on this post:-
http://forums.silverfrost.com/viewtopic.php?p=21671&sid=51bcf5afd6926a80cd4494ac2a8aeba2
we have the equally useful :-
Quote:
Yes a %gr region has its own programmer defined identifier (which unfortunately is/was called a "handle" in the documentation). This identifier is used for example in SELECT_GRAPHICS_OBJECT@.

But the %gr control (like any other control) is also a Microsoft Window with its own HWND. You can get this value by using %lc immediately after %gr (in this case). This is the value given by a call to CLEARWIN_INFO@("CALL_BACK_WINDOW").


Both excellent descriptions (which probably form the basis of what you've addd to the documentation Paul ? which documentation have you changed btw ?)

so from the last quote, maybe there's the better monicker .... use the term 'identifier' (ID) for the user-defined controls labelling ?

remember Dan, a %gr has BOTH a user-defined handle (IDentifier) AND a windows handle,
_________________
''Computers are incredibly rigid. They question nothing. Especialy input data.Human beings are incredibly trusting of computers and don't check input data. Together they are capable of cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
John-Silver



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

PostPosted: Thu Apr 26, 2018 10:09 am    Post subject: Reply with quote

Lest it gets lost in the washing machine, my comment from 18th April still remains unresolved even with the last code above from Dan ....

Quote:
Additionally, if I reduce any of the windows using the top right icon the window just plain disappears (not to an icon in the parent window, nor to taskbar.
When you do that with my working mdi code (which differs in that it uses %ch in order to get scrollbars) the windows reduce to an icon at bottom of parent window.


it's probably a subtlety of some critiacl setting being un/ill-defined ?
_________________
''Computers are incredibly rigid. They question nothing. Especialy input data.Human beings are incredibly trusting of computers and don't check input data. Together they are capable of cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Thu Apr 26, 2018 11:53 am    Post subject: Reply with quote

John,

Using the middle of left icons, I get a mini caption bar (with the buttons) down at the bottom left of the parent window. Maybe you get that but can't see it (my monitor isn't 4k, but it's pretty big). I see it best if I maximise the main window to full screen.

A method to address this is to find the x,y size of the parent and reposition the child in its minimised state so that it is visible, but that would require actin when the minimise (etc) button is clicked, and I don't know how to do that. Perhaps it is encapsulated in the CLEARWIN_STRING@ 'RESIZE' in some way.

The example doesn't use %mi to specify a minimised icon, but even when you do, this stays on the caption bar of the child window, i.e. the window isn't reduced to an icon only (which is what I half expected) but still to the reduced size caption bar at the bottom of the MDI frame, although it does show the minimise icon on it.

What would be nice is for minimised child windows to be shown as %mi icons (if specified) in a row at the bottom of the MDI frame, complementing any status bar contents, but that is asking for a lot! I don't see any good reason why they should appear outside the MDI frame on the WIndows taskbar.

Eddie
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Thu Apr 26, 2018 3:20 pm    Post subject: Re: Reply with quote

PaulLaidler wrote:
Dan

ClearWin+ could check if the identifier was "undefined" but only in /UNDEF mode (or any mode that includes /UNDEF such as /CHECKMATE).

Another possibility, which might help, is to get ClearWin+ to generate a unique identifier when used with %gr or %pl and when the user-supplied value is less than or equal to zero.


No doubts that for Clearwin to check for input undefined variables in /undef or /checkmate mode is most important. All other is optional.

As to %`gr "not so handle" : if user is not that lazy and is not writing
Code:
i=winio@( "%`gr",5)
instead of
Code:
i=winio@( "%`gr",ihgrw)
then switching to Windows defined real handles will not break any code. Not defining anything is the only bad thing. And even it may not break any codes if there is no need to switch windows like in above example for Rudnei. The specially issued warning may remind some lazy progger about using constant (5) instead of variable (ihgrw) is not permitted and if he refuses to comply then again the code will still work. Just look at the final code above for Rudnei: if you define those not so handles or Windows will do that itself with real handles the code will still work ok. But Clearwin+ logics tells that there is no visible reason for user to define %gr "not so handles".

How Windows is not crashing codes with user defined "not so handles" if two instances of code are running ? Smile
Back to top
View user's profile Send private message
John-Silver



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

PostPosted: Fri Apr 27, 2018 5:50 pm    Post subject: Reply with quote

Eddie, thanks fo rthe pointer to the fundamental of the problem.
My resolution is the standard 1366x768 15" laptop.
The minimized bars were not appearing because the windows dimensions in the program as written were too big for my screen.

So I modified to be compatible.

There are still problems and I'm convinced it's because the taskbar isn't taken into account properly for one thing.

If I move the taskbar from the bottom edge to the rhs things get a bit better ... then worse as I arbitrarily try various minimizes, recovery, maximizeing, etc .... sometimes on one window, sometimes on all 3ė4 one at a time.

1. in a 'normal situation' ! the mini-minimize bars DO NOT SHOW UP FULLY, just a part of the grey top of the bar (not the icons) is visible at the bottom.

2. The position isn't always starting at bottom left and then moving right as more are minimized !

3. Sometimes the bars are at different 'heights' from the botom of the screen.

4. I tried moving the task bar to th rhs with not a lot of improvement - sometimes a lot worse !

5. Very strange thigs start to happed like :
a) a couple of times, after some re-sixing, maximize, recofėvery of a window, i I thn drag the window around it starts to 'paint' the background of th main window white !!! (I joke not)

b) after awhile, if I first maximized a child window, when I recover it it's contents also appear in the main window/frame !!!!!

6. if I have the taskbar along the bottom, then maximize the main window, then drag the taskbar to the rhs,:
- sthe window remsins in the same place
-if I do the same but with the commandline window, after maximizing, when I move the taskbar to the rhs the window automatically re-sizes to the full available free area (covering also the bottom edge where the taskbar was.

7. almost forgot this one - at one point when I started reducing the child windows they each left their 'footprint' as a white area where the window had been on the black background !!!!
I also start to go crazy at one point because the background is ne minute white then another black !!!! Weird.

The taskbar related problem I've seen before a long time ago when I tried to mazimize a window and it was never exactly the maximized area.

Now I've done a lot of screengrabs but am holding back on posting them all until the appetite is there for people to comment. But for me it's a real problemo this.

Paul do you have the appetite ?
Should I post the pics or is the description enough for you to pinpoint what might be awry ?
_________________
''Computers are incredibly rigid. They question nothing. Especialy input data.Human beings are incredibly trusting of computers and don't check input data. Together they are capable of cocking up even the simplest calculation ... Smile "


Last edited by John-Silver on Fri Apr 27, 2018 6:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
John-Silver



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

PostPosted: Fri Apr 27, 2018 5:52 pm    Post subject: Reply with quote

Here's the modified code I've been using for my screen size (1366 x 768) ... btw I'm using Windows 7 and FTN95 v8.3perso + dlls23

Code:
!  Rudnei's_GR_cod_mdi_DanSol_3-1a.f90
!  Dan's code v3 ! - with fix for update of %gr's
!
!                  v1c - window & GR area sizes reduced to fit my screen !!!
!
winapp
program test_mdi1
include <windows.ins>

integer      :: i1,i2,i3,i4, ixF, iyF, rslt, ihgw_main_window, ihgw_control_panel, ihgw_display_bar, ihgw_simulation
integer iT, iTextUnit
integer, external :: draw_control_panel, draw_display_bar, draw_simulation

common /GR_areas_ids/ihgw_main_window, ihgw_control_panel, ihgw_display_bar, ihgw_simulation

!ixF=1100
!iyF=1000
! Reduced to fit a 1366 x 768 laptop screen
ixF=1100
!iyF=700
iyF=500

iTextUnit=2 ! was 0 before version 8.30

ihgw_control_panel = 11
ihgw_display_bar   = 12
ihgw_simulation    = 13

i1=winio@('%ww[no_border]%es&')
i1=winio@('%ca[Main Window containing an MDI frame]&')
i1=winio@('%pv%fr%lw',ixF,iyF, ihgw_main_window)


iT=winio@('%aw%ww[no_border]%ca[Text Window]%pv%40.8cw', &
ihgw_main_window, iTextUnit )

i2=winio@('%aw%ww[no_border]%ca[Control Panel]%pv%`^gr[black,user_resize]', &
ihgw_main_window, 300,200,ihgw_control_panel, draw_control_panel )

i3=winio@('%aw%ww[no_border]%ca[Display Bar]%pv%`^gr[white,rgb_colours,user_resize]', &
ihgw_main_window, 500,400, ihgw_display_bar, draw_display_bar )

i4=winio@('%aw%ww[no_border]%ca[ihgw_simulation]%pv%`^gr[black,user_resize]', &
!ihgw_main_window, 800,800, ihgw_simulation, draw_simulation )
ihgw_main_window, 400,400, ihgw_simulation, draw_simulation )

!... Text window
Print*, 'This is Text window'

end program test_mdi1

!..............................................................
integer function draw_control_panel ()
include <windows.ins>
common /GR_areas_ids/ihgw_main_window, ihgw_control_panel, ihgw_display_bar, ihgw_simulation

i44=select_graphics_object@(ihgw_control_panel)

call draw_filled_ellipse@(100,100,80,80,rgb@(127,59,30))

draw_control_panel=2
end function

!..............................................................
integer function draw_display_bar ()
include <windows.ins>
common /GR_areas_ids/ihgw_main_window, ihgw_control_panel, ihgw_display_bar, ihgw_simulation

i44=select_graphics_object@(ihgw_display_bar)

call draw_filled_rectangle@(2,2,398,398,rgb@(255,255,30))

draw_display_bar=2
end function

!..............................................................
integer function draw_simulation ()
include <windows.ins>
common /GR_areas_ids/ihgw_main_window, ihgw_control_panel, ihgw_display_bar, ihgw_simulation

i44=select_graphics_object@(ihgw_simulation )

call draw_filled_rectangle@(10,10,200,200,rgb@(30,255,30))
call draw_filled_rectangle@(100,50,120,60,rgb@(255,0,30))
!call draw_filled_rectangle@(400,400,600,5000,rgb@(30,0,255))
call draw_filled_rectangle@(200,200,150,300,rgb@(30,0,255))

draw_simulation=2
end function

_________________
''Computers are incredibly rigid. They question nothing. Especialy input data.Human beings are incredibly trusting of computers and don't check input data. Together they are capable of cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
John-Silver



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

PostPosted: Fri Apr 27, 2018 5:53 pm    Post subject: Reply with quote

Just keep trying maximizing, minimizing and re-sizing various combinations of main and child windows until you see similar things (hopefully) to those I describe above.
_________________
''Computers are incredibly rigid. They question nothing. Especialy input data.Human beings are incredibly trusting of computers and don't check input data. Together they are capable of 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: 5497
Location: Salford, UK

PostPosted: Mon Apr 30, 2018 3:27 pm    Post subject: Reply with quote

I have made a note that the MDI needs further work.
If you provide a menu bar then the immediate problem is resolved.
When a main menu is not provided then the blank menu bar should not appear.
Upon resizing the frame it would be nice if the child icons could be moved to the bottom of the frame.

I have made a note of this and I will report back if and when it is fixed.
Back to top
View user's profile Send private message
John-Silver



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

PostPosted: Thu May 03, 2018 7:58 am    Post subject: Reply with quote

Thanks Paul

Quote:
When a main menu is not provided then the blank menu bar should not appear.


Yes .... and No .... it is anticipated that you'll want to maximize one or more of the child windows at some poin, and the menu bar is where the recovery icons go.
I guess if all the shild windows didn't have a maximize button defined then maybe it shouldn't appear. Or only appear 'dynamically' when a window(s) is maximised (which I think is what you meant should ideally happen).
_____________________________________

Just so it doesn't get lost when you return here at some point ... in the hope it might help you then ...
I mentioned in an earlier comment on p. 2 of this post that a previous working code on Billės problem ... ref. previous post:
http://forums.silverfrost.com/viewtopic.php?p=24470#24470
doesn't appear to have the problem.
That code uses one child window defined in a '%ps - style' in order to have the scrollbars it needed.

It does also produce the blank menu bar.

I also had extended it to 2 windows and observed:

a) the child windows both reduce nominally ok to the bottom left corner (although there appears to be a 'gap' at the start between the corner of the window and the first reduced icon-bar)

b) if after reducing the 2 windows the parent window is maximised then the icons remain in the dėsame place ! i.e. are not re-adjusted to the new corner/bottom position.
If however the 2 windows are then recovered and then reduced again they go to the correct place

c) if ch windows are re-sized the icons don't re-position to the bottom corner

d) if any of the ch windows are reduced , when any one of the reduced (or indeed non-reduced) windows are maximised and then 'recovered' then ALL minimised ch windows are recovered also !

So there is some 'improvement in the behaviour (the initial minimised icon bars are visible) but there are some of the same drawbacks as observed with the code for this post.
_________________
''Computers are incredibly rigid. They question nothing. Especialy input data.Human beings are incredibly trusting of computers and don't check input data. Together they are capable of 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
Goto page Previous  1, 2, 3
Page 3 of 3

 
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