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 

Size of %gr graphics areas

 
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 Sep 28, 2014 2:45 pm    Post subject: Size of %gr graphics areas Reply with quote

When I create my %gr window, the variables iSizeX and iSizeY are identical to provide a square.

Code:
MA = WINIO@ ('%pv%^gr[user_resize,full_mouse_input,rgb_colours]&', iSizeX, iSizeY, DrawOnScreen)


However, when I resize the window, the graphics area is not a square anymore.

Code:

iSizeX = Clearwin_Info@ ('GRAPHICS_WIDTH')
iSizeY = Clearwin_Info@ ('GRAPHICS_DEPTH')

iSizeX = MIN (iSizeX, iSizeY)
iSizeY = iSizeX


This provides the values of a squared image, but the graphics area does not reduce it's size. I have tried several functions to update this new smaller size to the %gr area, but I had up to now no success.

Erwin
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Sun Sep 28, 2014 3:22 pm    Post subject: Reply with quote

There is a new %gr option [keep_aspect_ratio] that works with [metafile_resize] but not (at the moment) with [user_resize].

I would try using %lc after %gr to give the Window handle of the graphics area.

Then use this handle in call resize_window@ within your resizing callback function. Use your adjusted dimensions in this call.
Back to top
View user's profile Send private message AIM Address
EKruck



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

PostPosted: Mon Sep 29, 2014 9:27 am    Post subject: Reply with quote

That works fine.
Thank you.
Back to top
View user's profile Send private message Visit poster's website
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