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 

Two graphics regions

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
EKruck



Joined: 09 Jan 2010
Posts: 224
Location: Aalen, Germany

PostPosted: Sun Feb 14, 2010 12:13 pm    Post subject: Two graphics regions Reply with quote

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&', 'Part1 Data: ')
MA = WINIO@ ('%nl%`bg[white]&')
! MA = WINIO@ ('%pv&')
MA = WINIO@ ('%^`gr[user_resize,rgb_colours,full_mouse_input]&', iDrawingSizeX1, iDrawingSizeY1, handle1, CB_Size)
MA = WINIO@ ('%ff&')
MA = WINIO@ ('%`35rs&', 'Part2 Data: ')
MA = WINIO@ ('%nl%`bg[white]&')
MA = WINIO@ ('%pv&')
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
!-----------------------------------------------------------------------------------------------------------------------------------
Back to top
View user's profile Send private message Visit poster's website
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Sun Feb 14, 2010 1:04 pm    Post subject: Reply with quote

see possible error in:
handle1 = 101
handle1 = 102
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Sun Feb 14, 2010 6:49 pm    Post subject: Reply with quote

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


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

PostPosted: Mon Feb 15, 2010 3:20 pm    Post subject: Reply with quote

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