Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

GETWINDOWCONFIG

QuickWin Function: Returns the properties of the current window. This routine is only available for Windows.

Module

USE IFQWIN

result = GETWINDOWCONFIG (wc)

wc

(Output) Derived type windowconfig. Contains window properties. The windowconfig derived type is defined in IFQWIN.F90 as follows:

TYPE windowconfig
  INTEGER(2) numxpixels             ! Number of pixels on x-axis
  INTEGER(2) numypixels             ! Number of pixels on y-axis
  INTEGER(2) numtextcols            ! Number of text columns available
  INTEGER(2) numtextrows            ! Number of text rows available
  INTEGER(2) numcolors              ! Number of color indexes
  INTEGER(4) fontsize           ! Size of default font. Set to
                                !   QWIN$EXTENDFONT when specifying
                                !   extended attributes, in which
                                !   case extendfontsize sets the
                                !   font size
  CHARACTER(80) title               ! The window title
  INTEGER(2) bitsperpixel           ! The number of bits per pixel
  INTEGER(2) numvideopages          ! Unused
  INTEGER(2) mode                   ! Controls scrolling mode
  INTEGER(2) adapter                ! Unused
  INTEGER(2) monitor                ! Unused
  INTEGER(2) memory                 ! Unused
  INTEGER(2) environment            ! Unused
!
! The next three parameters provide extended font attributes.
!
  CHARACTER(32) extendfontname      ! The name of the desired font
  INTEGER(4) extendfontsize         ! Takes the same values as fontsize,
                                    !   when fontsize is set to
                                    !   QWIN$EXTENDFONT
  INTEGER(4) extendfontattributes   ! Font attributes such as bold
                                    !  and italic
END TYPE windowconfig

Results

The result type is LOGICAL(4). The result is .TRUE. if successful; otherwise, .FALSE. (for example, if there is no active child window).

GETWINDOWCONFIG returns information about the active child window. If you have not set the window properties with SETWINDOWCONFIG, GETWINDOWCONFIG returns default window values.

A typical set of values would be 1024 x pixels, 768 y pixels, 128 text columns, 48 text rows, and a font size of 8x16 pixels. The resolution of the display and the assumed font size of 8x16 pixels generates the number of text rows and text columns. The resolution (in this case, 1024 x pixels by 768 y pixels) is the size of the virtual window.

To get the size of the physical window visible on the screen, use GETWSIZEQQ. In this case, GETWSIZEQQ returned the following values: (0,0) for the x and y position of the physical window, 25 for the height or number of rows, and 71 for the width or number of columns.

The number of colors returned depends on the video drive. The window title defaults to "Graphic1" for the default window. All of these values can be changed with SETWINDOWCONFIG.

Note that the bitsperpixel field in the windowconfig derived type is an output field only, while the other fields return output values to GETWINDOWCONFIG and accept input values from SETWINDOWCONFIG.

Example

!Build as QuickWin or Standard Graphics App.
USE IFQWIN
LOGICAL(4) status
TYPE (windowconfig) wc
status = GETWINDOWCONFIG(wc)
IF(wc%numtextrows .LT. 10) THEN
  wc%numtextrows = 10
  status = SETWINDOWCONFIG(wc)
  IF(.NOT. status ) THEN  ! if setwindowconfig error
    status = SETWINDOWCONFIG(wc)   ! reset
             ! setwindowconfig with corrected values
    status = GETWINDOWCONFIG(wc)
    IF(wc%numtextrows .NE. 10) THEN
       WRITE(*,*) 'Error: Cannot increase text rows to 10'
    END IF
  END IF
END IF
END