 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Tue Apr 24, 2018 10:05 pm Post subject: |
|
|
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 |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Wed Apr 25, 2018 12:20 am Post subject: |
|
|
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 |
|
 |
rudnei
Joined: 29 Dec 2011 Posts: 36
|
Posted: Wed Apr 25, 2018 1:20 am Post subject: |
|
|
Many thanks for your help! |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Wed Apr 25, 2018 7:40 am Post subject: |
|
|
Quote: | Paul has to rename this in HELP |
I have now made some further changes to try to make this clear. |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Wed Apr 25, 2018 11:18 am Post subject: |
|
|
Dan,
It is still a handle. Windows gives you a handle, you give Clearwin+ graphics a handle.
Eddie |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Wed Apr 25, 2018 3:48 pm Post subject: Re: |
|
|
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 |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Wed Apr 25, 2018 7:34 pm Post subject: |
|
|
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 |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Thu Apr 26, 2018 11:53 am Post subject: |
|
|
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 |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Thu Apr 26, 2018 3:20 pm Post subject: Re: |
|
|
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 ?  |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Mon Apr 30, 2018 3:27 pm Post subject: |
|
|
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 |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Mon Feb 04, 2019 5:40 pm Post subject: |
|
|
Yes, this should now be fixed with FTN95 v8.40. Let me know if there are still problems. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Feb 05, 2019 8:11 am Post subject: |
|
|
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 |
|
 |
|
|
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
|