|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Ralf
Joined: 30 Aug 2007 Posts: 50 Location: munich
|
Posted: Thu Sep 20, 2007 10:37 am Post subject: Resize slider control %sl |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Thu Sep 20, 2007 4:38 pm Post subject: |
|
|
Can you supply sample code to illustrate what you want to do? |
|
Back to top |
|
|
Ralf
Joined: 30 Aug 2007 Posts: 50 Location: munich
|
Posted: Tue Oct 09, 2007 10:16 am Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Tue Oct 09, 2007 5:24 pm Post subject: |
|
|
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 |
|
|
|
|
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
|