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 

Resize slider control %sl

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



Joined: 30 Aug 2007
Posts: 50
Location: munich

PostPosted: Thu Sep 20, 2007 10:37 am    Post subject: Resize slider control %sl Reply with quote

Hi,

I want to place a slider control in the status bar of a window. Is it possible to resize the slider control when the window is resized by the user?

Thanks,

Ralf
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Sep 20, 2007 4:38 pm    Post subject: Reply with quote

Can you supply sample code to illustrate what you want to do?
Back to top
View user's profile Send private message AIM Address
Ralf



Joined: 30 Aug 2007
Posts: 50
Location: munich

PostPosted: Tue Oct 09, 2007 10:16 am    Post subject: Reply with quote

Hello Paul,

sorry for my late response!

Here is my sample code for the described Problem:

winapp
!===================
Program resizable_slider
!===================
integer :: iw, winio@, iwidths, iheights

real*8 :: xslide, firstslide, lastslide

external redraw

iwidths = 200
iheights = 150

xslide = 0.d0
firstslide = 0.d0
lastslide = 10.d0

iw = winio@ ('%ww%ca[Slider]&')

iw = winio@ ('%pv%^gr[white,user_resize]&',iwidths, iheights, redraw)
iw = winio@ ('%ob[status,bottom_exit,raised]&')
iw = winio@ ('%30sl&', xslide, firstslide,lastslide)
iw = winio@ ('%cb')

stop
end

!===================
integer function redraw()
!===================
redraw = 2
end



When I open this window and resize it, the slider control remains with a fixed length in the status bar. It would be nice to modify the length of the slider during resizing the window, to adjust it to the current window width.
Is there any chance to do this?

Thanks,

Ralf
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Oct 09, 2007 5:24 pm    Post subject: Reply with quote

It would be quite difficult to change the size of the slider.

1) You need to put a callback on the change of size in the main window. This might use %mg and WM_SIZE.

2) You need a window handle for %sl. This is provided by %lc.

3) You could then use ClearWin+ and/or Microsoft functions to get the size of the main window and set the size of the slider (putting this in the resize callback).

Having done all this, the internal parameters for the slider will then probably be wrong and these are not programmable at runtime.

You might get further using the Microsoft slider via %di but this would involve more low level programming.
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