Silverfrost Forums

Welcome to our forums

rambling enquiry about full_mouse_input and callback_reason

10 Mar 2014 10:41 #13818

It might not be elegant, but my simple solution is that I just leave a grey screen. I have a menu option for redraw, which I use to repaint when the resize is complete. There are a lot of interrupts when resizing. I have a text screen which reports a lot of size resets! All I do is reset the screen size and aspect ratio. I'm not sure if I paint the screen grey, or if this is the default. The problem, I haven't bothered fixing is that on redraw I reset the blow-up factor to 100%, so loose any magnification of the screen graphics.

I avoid the problem.

John

10 Mar 2014 11:18 #13819

John -

I think you're right. Life's too short to fight the deficiencies of Microsoft Windows.

Mine works fine without redrawing at all during the resize - all I do is record the new x,y size in a common block, and I let the user refresh from a menu option when happy with the new window size. I have provided two different options, both of which compute new scaling factors, one ('refresh') redraws the data that was visible before the resize, the other ('reset') sets the display to the original data area before any zooming and panning.

cheers

Steve

10 Mar 2014 11:31 #13820

To redraw a graphics window only after releasing the left mouse button I do the following:

This is a small part of my code to display a BMP file in a new window:

      common  /H_WINTAB/ wthwnd,flag
c
c     ...
c
c     afile = name of BMP graphics
c
      call get_im_info@(afile,cols,rows,i,j,ext,rtcode)
      if (rtcode .eq. 0) then
        wthwnd = import_bmp@(afile,rtcode)
        if (rtcode .eq. 0) then
          j = winio@('%`ca@%ww[no_border,no_maxbox,topmost,toolwindow]'
     *        //'%lw%sp%pv%`^gr[user_resize]',
     *        afile,ctrl,pos_x,pos_y,cols,rows,4L,z_neu)
        end if
      end if
c
c     ...
c

and this is the function connected with user_resize:

      integer function z_neu()
 
      IMPLICIT NONE
      INCLUDE <WINDOWS.INS>
 
      integer*4     k,wthwnd,flag
 
      common  /H_WINTAB/ wthwnd,flag
 
      k = select_graphics_object@(4L)
      k = clearwin_info@('GRAPHICS_RESIZING')
      if (k .eq. 1) k = dib_paint@(0,0,wthwnd,0,0)
      k = select_graphics_object@(1L)
      z_neu = 1
      end

Regards - Wilfried

10 Mar 2014 12:26 #13822

When using %gr[user_resize], the callback can access the current mouse state by calling clearwin_info@('GRAPHICS_MOUSE_FLAGS').

I have not tried this to see if it helps in this context.

10 Mar 2014 12:27 #13823

Quoted from silicondale you get a whole stream of WM_SIZE messages while dragging the corner of the window, which stop when you release the mouse button. All I want to find is the LAST one of these messages...,

I think the window should get just one WM_SIZE window message after resize is complete, unless the dragging of full windows system option is set on. If the dragging of full windows is set on, you could probably monitor the WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE window messages.

10 Mar 2014 2:37 #13825

jalih - you are an absolute star!! That WM_EXITSIZEMOVE message does the trick. However, it's so obscure, it's not in the win32prm file and hence not picked up by USE MSWIN - had to find the value (0x0232 - decimal 562) from the MS website. I plugged a new callback into the file opening using

    integer WM_EXITSIZEMOVE
    parameter (WM_EXITSIZEMOVE=562) 
....
    I=winio@('%ww[no_border,not_fixed_size]%mg&', WM_EXITSIZEMOVE, DOREDRAW) 
    I=winio@('%gr etc etc  &')
....

      integer function DOREDRAW ()
....

and it has done the trick. A single redraw at the end of the resize loop.

Please login to reply.