Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

non quickwin scrollin application+

Brooks_Van_Horn
New Contributor I
561 Views

When the user clicks the 'Restore Down' button, They get a partial view of my modeless dialog controller, See picture1. I have added the vertical scrollbar and will do the horizontal bar later. Right now I need to know what do I do. The pages are directly drawn to the screen. If I tell it to give me say percentages from 1 to 100 and say it sends me 20, do I have to redrae the screen? Are their any good examples of non-qwin apps using scroll bars?

 

Thanks,

Brooks

0 Kudos
8 Replies
jimdempseyatthecove
Honored Contributor III
561 Views

Adjusting the drawing area of your chart may be relatively easy to do, but changing the display area of the button boxes may be problematic (unless they consume less than full screen when in full screen mode). You could consider having two modeless dialog boxes, one for the buttons (fixed size) and one for the chart area (resizable).

Jim Dempsey

0 Kudos
Brooks_Van_Horn
New Contributor I
561 Views

Thanks Jim,

 

Don't really know what I'm going to do if anything. I may just force the user to stay maximized or minimize to the tray. Have you seen an app with the modeless control before?

Brooks

0 Kudos
jimdempseyatthecove
Honored Contributor III
561 Views

I've used such an application before. In my case I'd launched one modeless dialog for a button/slider/spinner box, and one or more additional windows to show charts, graphs, data. I'd used the older Array VisualizerUB-Desktop.png

Jim Dempsey

0 Kudos
Paul_Curtis
Valued Contributor I
561 Views

Here is a code sample showing how to scroll content which is larger than the screen.

SUBROUTINE TabFunc (msg, wParam)
    IMPLICIT NONE
    INTEGER(UINT),    INTENT(IN)   :: msg
    INTEGER(fWPARAM), INTENT(IN)   :: wParam
    INTEGER                        :: rval
    
    INTEGER(HANDLE)                :: hwnd
    INTEGER(HANDLE)                :: hdc_Screen
    INTEGER, SAVE                  :: screen_wide, screen_high
    INTEGER, SAVE                  :: clientwide, clienthigh

    !    TYPE T_SCROLLINFO  
    !    SEQUENCE
    !      integer(UINT) Size     ! cbSize knowns  UINT 
    !      integer(UINT) Mask     ! fMask knowns  UINT 
    !      integer(SINT) Min      ! nMin knowns  int 
    !      integer(SINT) Max      ! nMask knowns  int 
    !      integer(UINT) Page     ! nPage knowns  UINT 
    !      integer(SINT) Pos      ! nPos knowns  int 
    !      integer(SINT) TrackPos ! NTrackPos knowns  int 
    !    END TYPE
    TYPE(T_SCROLLINFO)             :: si
    TYPE(T_RECT)                   :: clientRect
           
    !   the scrollbars are attached to the main window instead of the
    !   client area of the tab window so that the scrolling messages
    !   can be seen by MainWndProc()
    hwnd = ghwndmain
    
    !   fullscreen size
    hdc_screen  = GetDC (NULL)
    screen_wide = GetDeviceCaps (hdc_screen, HORZRES)
    screen_high = GetDeviceCaps (hdc_screen, VERTRES)
    rval        = ReleaseDC (NULL, hdc_screen)
    
    !   PVWindow client size, smaller than fullscreen
    rval  = GetClientRect (ghwndPVWindow, clientRect)
    clientWide = clientRect%right  - clientRect%left
    clientHigh = clientRect%bottom - clientRect%top
  
    !   prepare the ScrollInfo data structure
    CALL ZeroMemory (LOC(si), SIZEOF(si))
    si%Size = SIZEOF(si)
    si%Min  = 0
    si%Mask = MOR(SIF_RANGE, SIF_POS, SIF_PAGE)
 
    SELECT CASE (msg)
    
    CASE (WM_CREATE)
        xCurrentScroll = 0 
        yCurrentScroll = 0
        
        si%Max  = screen_wide
        si%Page = clientWide
        si%Pos  = (screen_wide - clientWide)/2
        rval    = SetScrollInfo (hwnd, SB_HORZ, si, TRUE)

        si%Max  = screen_high
        si%Page = clientHigh
        si%Pos  = (screen_high - clientHigh)/2
        rval    = SetScrollInfo (hwnd, SB_VERT, si, TRUE)            

    CASE (WM_HSCROLL, WM_VSCROLL)
        SELECT CASE (LOWORD(wParam))
        CASE (SB_THUMBPOSITION)
            SELECT CASE (msg)
            CASE (WM_HSCROLL)
                xCurrentScroll = HIWORD(wParam)
                si%Pos         = xCurrentScroll
                si%Max         = screen_wide
                si%Page        = clientWide
                rval           = SetScrollInfo (hwnd, SB_HORZ, si, TRUE)
                xCurrentScroll = xCurrentScroll - (screen_wide - clientWide)/2
            CASE (WM_VSCROLL)
                yCurrentScroll = HIWORD(wParam)
                si%Pos         = yCurrentScroll
                si%Min         = 0
                si%Max         = screen_high
                si%Page        = clientHigh
                rval           = SetScrollInfo (hwnd, SB_VERT, si, TRUE)
                yCurrentScroll = yCurrentScroll - (screen_high - clientHigh)/2
            END SELECT
			CALL PVWindowRepaint (-1)  ! repaint the window
        END SELECT

    END SELECT
    
END SUBROUTINE TabFunc


SUBROUTINE ScrollAdjust (ix, iy)
    IMPLICIT NONE
    INTEGER, INTENT(INOUT)      :: ix, iy
        ix = ix - xCurrentScroll
        iy = iy - yCurrentScroll
   END SUBROUTINE ScrollAdjust

 

0 Kudos
Brooks_Van_Horn
New Contributor I
561 Views

Steve,

You don't have to IOR in WS_HSCROLL and WS_VSCROLL in the wc in WinMain?

Brooks

PS, is MOR your function to do multiple IOR's.

0 Kudos
andrew_4619
Honored Contributor II
561 Views

MOR is Paul's own function. for multiple  IORs I think. You can use IANY, for example:

wc%style = IANY( [ CS_VREDRAW , CS_HREDRAW, CS_OWNDC] )

IANY can take an array form so you can have as many elements as is required. I find this syntax neat. I think IANY was added in F2008

0 Kudos
jimdempseyatthecove
Honored Contributor III
561 Views

I (personally) do not understand why the standards committee did not choose to expand a perfectly good IOR intrinsic to accept an array. "any" as used in ANY grammatically conflicts with "any" in IANY. The former stops examining values in the input array upon the first occurrence, the latter does not. 

(edit, on second thought, it is not technically in grammatical conflict, rather implementationlly in conflict)

Jim Dempsey

0 Kudos
Steven_L_Intel1
Employee
561 Views

You can use IALL for that purpose. I know that extension of IOR and IAND were considered but rejected.

0 Kudos
Reply