replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Resizing different %gr areas in the same window
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, 4  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
LitusSaxonicum



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

PostPosted: Tue Apr 24, 2018 10:05 pm    Post subject: Reply with quote

The reason why all the %gr area control handle variables are zero is that is what you set them, by default. Unlike most controls' handles, which RETURN a handle, the handles for a %gr area have to be GIVEN. When I discovered this, some years ago, I wrote a post entitled 'When is a handle not a handle'.

At least, if you specified:

ihgw_control_panel = 10
ihgw_control_bar = 20
ihgw_simulation =30

before starting the Clearwin+ code, then you can determine which area to draw to with select_graphics_area@. As it is written, all three are graphics handle zero!

It may not be the complete answer, but it is part of it.

To summarise: The handle for %gr must be different for each %gr area, and you specify it, it isn't returned from Clearwin+

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



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

PostPosted: Wed Apr 25, 2018 12:20 am    Post subject: Reply with quote

Eddie, You are right.
Damn, after some time of not using i always forget that. Paul has to rename this in HELP from "handle" to "user-defined number" and stress that if it wasn't already done so. Here is complete text. Must be in extended collection of examples for Clearwin if Silverfrost is interested in increase of compiler users base
Code:

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
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 )

!... 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))

draw_simulation=2
end function


Last edited by DanRRight on Wed Apr 25, 2018 4:00 am; edited 1 time in total
Back to top
View user's profile Send private message
rudnei



Joined: 29 Dec 2011
Posts: 36

PostPosted: Wed Apr 25, 2018 1:20 am    Post subject: Reply with quote

Many thanks for your help!
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Apr 25, 2018 7:40 am    Post subject: Reply with quote

Quote:
Paul has to rename this in HELP


I have now made some further changes to try to make this clear.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



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

PostPosted: Wed Apr 25, 2018 11:18 am    Post subject: Reply with quote

Dan,

It is still a handle. Windows gives you a handle, you give Clearwin+ graphics a handle.

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



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

PostPosted: Wed Apr 25, 2018 3:48 pm    Post subject: Re: Reply with quote

LitusSaxonicum wrote:
Dan,
It is still a handle. Windows gives you a handle, you give Clearwin+ graphics a handle.


Due to either "handle" word or design faults several people were unable to resolve simplest thing for a week. Of course this puts users away from Clearwin.

My question: why this handle was made this way as apposed to other handles? Why user has to be present here as a middleman? This confusion takes debug time and has no visible reasonability. Let's Windows set the value itself, do we miss with this anything?

Second, this bug would be easily found if Clearwin ALWAYS (with and without /undef or /checkmate) checked ALL input data on undefined status. Not doing this I find as a big design mistake. Nobody cares if GUI will be 1 microsecond slower. As probably everyone now knows well that FTN77/95 demonstrated that any compiler without checking for all undefined stuff is a pure garbage. Clearwin+ though decided to go against of its own ideology causing us a lot of lost debug time and itself the lost users base.


Last edited by DanRRight on Thu Apr 26, 2018 2:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
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 AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
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: 2923
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
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
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 AIM Address
PaulLaidler
Site Admin


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

PostPosted: Mon Feb 04, 2019 5:40 pm    Post subject: Reply with quote

Yes, this should now be fixed with FTN95 v8.40. Let me know if there are still problems.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Tue Feb 05, 2019 8:11 am    Post subject: Reply with quote

I think that Robert has outlined our aims regarding the release date of the personal edition of FTN95 elsewhere on this forum. In exceptional circumstances a particular version may not appear as a personal edition but this is very rare.

The latest DLLs may not work with earlier versions of FTN95. Links to new DLLs are occasionally provided in relation to particular fixes. There are no plans to make this more organised.
Back to top
View user's profile Send private message AIM Address
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, 4  Next
Page 2 of 4

 
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