- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've searched this forum, because I know this one has been addressed before, but......
I have a QuickWin app which displays a single image. I want to maximize the screen area available, so I would like to get rid of the scroll bars that automatically appear. I have tried to alter the window style with SetWindowLong as described in the example CleanWin.f90. Couldn't get it to work on my application. Is there another way to try? Another example that might clue me in?
On a related note, is the old forum still available somewhere?
I have a QuickWin app which displays a single image. I want to maximize the screen area available, so I would like to get rid of the scroll bars that automatically appear. I have tried to alter the window style with SetWindowLong as described in the example CleanWin.f90. Couldn't get it to work on my application. Is there another way to try? Another example that might clue me in?
On a related note, is the old forum still available somewhere?
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following defines and maximizes the window in QucikWin:
Use DFLIB
INTEGER retint
Type(qwinfo) qw
qw.type = QWIN$MAX
qw.x = -1
qw.y = -1
qw.h = -1
qw.w = -1
retint = setwsizeqq(QWIN$FRAMEWINDOW,qw)
The old forum is located here but you may not need to think about it because the search at the current forum includes even the old one.
Sabalan.
Use DFLIB
INTEGER retint
Type(qwinfo) qw
qw.type = QWIN$MAX
qw.x = -1
qw.y = -1
qw.h = -1
qw.w = -1
retint = setwsizeqq(QWIN$FRAMEWINDOW,qw)
The old forum is located here but you may not need to think about it because the search at the current forum includes even the old one.
Sabalan.
Message Edited by intel.software.network.support on 12-09-2005 11:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sabalan,
Thanks for the reply, I appreciate your help. I tried your code suggestion by cut and paste, and the scroll bars remain. Perhaps you misunderstood the question slightly. Let me provide more detail.
I have an application that displays a single graphics image. I would like the maximum available screen space used for this image. For this reason, I disable the status bar at the bottom of the application frame and have already used a technique similar to the one you suggested for maximizing the frame.
Integer (4) i, Graphics_Window
TYPE (qwinfo) qwi
i = GetWSizeQQ( Graphics_Window, QWin$SizeMax, qwi ) qwi%type = QWIN$Max
i = SetWSizeQQ( Graphics_Window, qwi )
Graphics_Window is either the default (0) or explicitely set to the LUN of the display window through an OPEN statement.
A full screen application is not an option, since I use a modeless dialog for the display controls, and these must remain available. Unfortunately, in a windowed mode, Quickwin always seems to provide both a vertical and horizontal scrollbar. I don't need these and would like to get rid of them.
If you have any other suggestions, I'll give them a try. I tried searching the old forum at the link you provided, but haven't found the old discussion of this topic yet. If anyone else stumbles on to it, please let me know.
Thanks, Cliff
Thanks for the reply, I appreciate your help. I tried your code suggestion by cut and paste, and the scroll bars remain. Perhaps you misunderstood the question slightly. Let me provide more detail.
I have an application that displays a single graphics image. I would like the maximum available screen space used for this image. For this reason, I disable the status bar at the bottom of the application frame and have already used a technique similar to the one you suggested for maximizing the frame.
Integer (4) i, Graphics_Window
TYPE (qwinfo) qwi
i = GetWSizeQQ( Graphics_Window, QWin$SizeMax, qwi ) qwi%type = QWIN$Max
i = SetWSizeQQ( Graphics_Window, qwi )
Graphics_Window is either the default (0) or explicitely set to the LUN of the display window through an OPEN statement.
A full screen application is not an option, since I use a modeless dialog for the display controls, and these must remain available. Unfortunately, in a windowed mode, Quickwin always seems to provide both a vertical and horizontal scrollbar. I don't need these and would like to get rid of them.
If you have any other suggestions, I'll give them a try. I tried searching the old forum at the link you provided, but haven't found the old discussion of this topic yet. If anyone else stumbles on to it, please let me know.
Thanks, Cliff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is some time since I came across this and i have completely revised what I did then. However, I think you may to define a window size somewhat smaller than the maximum, using setwindowconfig (?), and then maximise it.
If you just take trhe default size (whole screeen effectively) this is too large The scroll bars are supposed not to appear if not needed which I think means when the space available/declared for plotting is smaller than the window size (with adjustments somewhere for the decoration). I think I found this a bit difficult to use since the scroll bars would not behave consistently on maunally resizing the window.
You might also want to look at the on-line help, searching for "WINSIZETOFIT", which may help.
If you just take trhe default size (whole screeen effectively) this is too large The scroll bars are supposed not to appear if not needed which I think means when the space available/declared for plotting is smaller than the window size (with adjustments somewhere for the decoration). I think I found this a bit difficult to use since the scroll bars would not behave consistently on maunally resizing the window.
You might also want to look at the on-line help, searching for "WINSIZETOFIT", which may help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, sometimes it's real PITA to get the scrollbars hidden. Few more suggestions:
1) Use SetScrollPos API to remove the scrollbars. You may also want to make your window non-resizable by the user:
Jugoslav
1) Use SetScrollPos API to remove the scrollbars. You may also want to make your window non-resizable by the user:
iStyle = GetWindowLong(GetHWNDQQ(whatever), GWL_STYLE) iStyle = IAND(iStyle,.NOT.WS_THICKFRAME) iStyle = IAND(iStyle,WS_DLGFRAME) i = SetWindowLong(GetHWNDQQ(whatever), GWL_STYLE, iStyle)2) If you want your app to have "SDI appearance", you can use MoveWindow to extend the child window so that frame borders obscure its title bar and borders (i.e. to something like (-3,-20,FrameWidth+20,FrameHeight+20))
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jugoslav and David,
Thanks for the help and suggestions. I tried each of your suggestions and have had some luck. Clearly this is not a simple fix.
Jugoslav's suggested technique of setting the window to a WS_DlgFrame style caused a couple problems. Menu items were disabled (although they reacted to a click, no menu appeared?) and the app could not be exited via the frame corner X. And unless you have some documentation not included with DVF and VS, I can't see how to remove scrollbars with SetScrollPos. Could you provide a code prototype?
The best results as of yesterday, was to use something similar to Jugoslav's suggestion.
! Try to get rid of scroll bars
gHandle = GetHWndQQ(Graphics_Window)
i = GetWindowLong( gHandle, GWL_STYLE )
j = WS_ThickFrame .or. WS_HScroll .or. WS_VScroll
j = iand( i, not( j ) )
i = SetWindowLong( gHandle, GWL_STYLE, j )
This had the effect of removing the horizontal scrollbar, but only after minimizing and maximizing the window.
i = GetWSizeQQ( Graphics_Window, QWin$SizeMax, qwi )
qwi%type = QWIN$Max
i = SetWSizeQQ( Graphics_Window, qwi )
qwi%type = QWIN$Max
i = SetWSizeQQ( Graphics_Window, qwi )
I confess, I don't understand why this last step was necessary, or why the vertical scroll didn't disappear as well.
Finally, after much experimentation I got it to work completely. The key was David's suggestion of WinSizeToFit. A search of the documentation was required, and this had to be combined with some elements of the example code CleanWin.f90.
! First, remove Frame Status Line
i = ClickQQ( QWin$Status )
i = ClickMenuQQ(Loc(WinSizeToFit))
! Graphics Window Initialization
Graphics_Window = 0
i = GetWSizeQQ( Graphics_Window, QWin$SizeMax, qwi )
qwi%type = QWIN$Max ! Set graphics window size.
i = SetWSizeQQ( Graphics_Window, qwi )
Try = GetWindowConfig( wc )
xfont = wc%fontsize / 2**16
yfont = Mod( wc%fontsize, 2**16 )
Graphics_Window_Width = wc%numxpixels
Graphics_Window_Height = ( qwi%H + 3 ) * yfont
It is really annoying that this approach required two different menu actuation techniques, ClickQQ and ClickMenuQQ. ClickQQ appears to be undocumented(?), although it uses a standard QWin$ defined constant argument. The other, ClickMenuQQ, uses the address of the menu item event handling routine. Is it any wonder that people give up?
The last couple steps I included in this code snippet are to carefully define a graphics drawing area so that it doesn't extend beyond the window boundaries. Does anyone have a suggestion for a cleaner way to get at the maximum graphics area size?
Again, thanks to all for the help.
I hope this journey helps others.
Cliff
Thanks for the help and suggestions. I tried each of your suggestions and have had some luck. Clearly this is not a simple fix.
Jugoslav's suggested technique of setting the window to a WS_DlgFrame style caused a couple problems. Menu items were disabled (although they reacted to a click, no menu appeared?) and the app could not be exited via the frame corner X. And unless you have some documentation not included with DVF and VS, I can't see how to remove scrollbars with SetScrollPos. Could you provide a code prototype?
The best results as of yesterday, was to use something similar to Jugoslav's suggestion.
! Try to get rid of scroll bars
gHandle = GetHWndQQ(Graphics_Window)
i = GetWindowLong( gHandle, GWL_STYLE )
j = WS_ThickFrame .or. WS_HScroll .or. WS_VScroll
j = iand( i, not( j ) )
i = SetWindowLong( gHandle, GWL_STYLE, j )
This had the effect of removing the horizontal scrollbar, but only after minimizing and maximizing the window.
i = GetWSizeQQ( Graphics_Window, QWin$SizeMax, qwi )
qwi%type = QWIN$Max
i = SetWSizeQQ( Graphics_Window, qwi )
qwi%type = QWIN$Max
i = SetWSizeQQ( Graphics_Window, qwi )
I confess, I don't understand why this last step was necessary, or why the vertical scroll didn't disappear as well.
Finally, after much experimentation I got it to work completely. The key was David's suggestion of WinSizeToFit. A search of the documentation was required, and this had to be combined with some elements of the example code CleanWin.f90.
! First, remove Frame Status Line
i = ClickQQ( QWin$Status )
i = ClickMenuQQ(Loc(WinSizeToFit))
! Graphics Window Initialization
Graphics_Window = 0
i = GetWSizeQQ( Graphics_Window, QWin$SizeMax, qwi )
qwi%type = QWIN$Max ! Set graphics window size.
i = SetWSizeQQ( Graphics_Window, qwi )
Try = GetWindowConfig( wc )
xfont = wc%fontsize / 2**16
yfont = Mod( wc%fontsize, 2**16 )
Graphics_Window_Width = wc%numxpixels
Graphics_Window_Height = ( qwi%H + 3 ) * yfont
It is really annoying that this approach required two different menu actuation techniques, ClickQQ and ClickMenuQQ. ClickQQ appears to be undocumented(?), although it uses a standard QWin$ defined constant argument. The other, ClickMenuQQ, uses the address of the menu item event handling routine. Is it any wonder that people give up?
The last couple steps I included in this code snippet are to carefully define a graphics drawing area so that it doesn't extend beyond the window boundaries. Does anyone have a suggestion for a cleaner way to get at the maximum graphics area size?
Again, thanks to all for the help.
I hope this journey helps others.
Cliff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is the function GetSystemMetrics with which you can find the size of various of the window decorations for subtraction from the total window size. If you can work out which ones are relevant you might end up with something that will work cleanly across a number of screen resolutions.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page