Silverfrost Forums

Welcome to our forums

Two graphics regions

14 Feb 2010 11:13 #5979

For one of my applications it would be very helpful and make programming easier, if I could place two %gr graphic regions in a window which can resize together, when changing the window size. I have made many trials - but no success. Surprisingly the box1 is changing size together with the windows size and one of my two graphics areas.

Any idea?

!----------------------------------------------------------------------------------------------------------------------------------- WINAPP PROGRAM MkWindow

IMPLICIT NONE INCLUDE <windows.ins>

REAL*8 rsl_logZoomV, rsl_logZoomT INTEGER iDrawingSizeX1, iDrawingSizeY1, iDrawingSizeX2, iDrawingSizeY2, handle1, handle2, ibHandle, MA COMMON iDrawingSizeX1, iDrawingSizeY1, iDrawingSizeX2, iDrawingSizeY2, handle1, handle2 INTEGER CB_Size EXTERNAL CB_Size

iDrawingSizeX1 = 400 iDrawingSizeY1 = 150 iDrawingSizeX2 = 400 iDrawingSizeY2 = 150 handle1 = 101 handle1 = 102

MA = WINIO@ ('%hw&', ibHandle) MA = WINIO@ ('%bf%bg&', RGB@(135,215,230)) MA = WINIO@ ('%mn[&Exit]&', 'EXIT')

MA = WINIO@ ('%ob[]&') ! Box 1 MA = WINIO@ ('%dy&', 0.2D0) MA = WINIO@ ('%cnv&') MA = WINIO@ ('%ff&') MA = WINIO@ ('%18sl[vertical]&', rsl_logZoomV, -1.0D0, 2.D0) MA = WINIO@ ('%cb&')

MA = WINIO@ ('%ob[]&') ! Box 2 MA = WINIO@ ('%35rs&amp;', 'Part1 Data: ') MA = WINIO@ ('%nl%bg[white]&') ! MA = WINIO@ ('%pv&') MA = WINIO@ ('%^gr[user_resize,rgb_colours,full_mouse_input]&amp;', iDrawingSizeX1, iDrawingSizeY1, handle1, CB_Size) MA = WINIO@ ('%ff&amp;') MA = WINIO@ ('%35rs&', 'Part2 Data: ') MA = WINIO@ ('%nl%bg[white]&amp;') MA = WINIO@ ('%pv&amp;') MA = WINIO@ ('%^gr[user_resize,rgb_colours,full_mouse_input]&', iDrawingSizeX2, iDrawingSizeY2, handle2, CB_Size) MA = WINIO@ ('%ff &') MA = WINIO@ ('%cb&')

MA = WINIO@ ('%ob[]&') ! Box 3 MA = WINIO@ ('%dy&', 0.2D0) MA = WINIO@ ('%cnSc&') MA = WINIO@ ('%nl&') MA = WINIO@ ('%18sl[vertical]&', rsl_logZoomT, -1.0D0, 2.D0) MA = WINIO@ ('%cb&') MA = WINIO@ ('%es%ww')

END !----------------------------------------------------------------------------------------------------------------------------------- INTEGER FUNCTION CB_Size () IMPLICIT NONE INTEGER iDrawingSizeX1, iDrawingSizeY1, iDrawingSizeX2, iDrawingSizeY2, handle1, handle2 COMMON iDrawingSizeX1, iDrawingSizeY1, iDrawingSizeX2, iDrawingSizeY2, handle1, handle2 INCLUDE <windows.ins>

IF (clearwin_info@ ('graphics_resizing') .EQ. 1) THEN iDrawingSizeX1 = clearwin_info@ ('graphics_width') iDrawingSizeY1 = clearwin_info@ ('graphics_depth') CALL WINDOW_UPDATE@ ( iDrawingSizeX1 ) CALL WINDOW_UPDATE@ ( iDrawingSizeY1 ) CALL UPDATE_WINDOW@ ( handle1 ) CALL UPDATE_WINDOW@ ( handle2 ) WRITE (,) iDrawingSizeX1, iDrawingSizeY1 ENDIF

CB_Size = 1 RETURN END !-----------------------------------------------------------------------------------------------------------------------------------

14 Feb 2010 12:04 #5982

see possible error in: handle1 = 101 handle1 = 102

14 Feb 2010 5:49 #5984

Why don't you have only one graphics area, and divide it into two yourself by drawing a bar across the middle. That way, when you resize it you can reposition the divider. (You could make the 'two' graphics flip to side by side if the main window is wide, for example).

Only one control can have the pivot.

Eddie

15 Feb 2010 2:20 #5992

ClearWin+ will not resize two regions automatically for you but you can do the resizing yourself by using %sz together with the %lc handle for each region and the functions move_window@ and resize_window@.

You would also need a callback function that is triggered on a resize message. Ideally one ought to be able to put a callback on %sz but I would need to check if this is provided. Otherwise it may be necessary to use %mg with WM_SIZE.

Please login to reply.