Fortran program to show multiple windows

(c) 2016 by Barton Paul Levenson


Language:
Fortran-95

Dialect:
Silverfrost F95 Personal Edition

Discussion:
This program uses the "ClearWin+" package that comes with Silverfrost's Fortran-95 IDE, Plato 3. Here's the code:


winapp
program multipleWindows
    include  <windows.ins>
    integer  :: w2
    integer, external :: closeDiagnosticWindow

    write (*, 10)
10  format('Main, important window.')

    w2 = winio@('%ca[Hello out there, all you happy taxpayers.]&')
    w2 = winio@('Some text inside the window.&')
    w2 = winio@('%ta%`^bt[&quit]', closeDiagnosticWindow)
end program multipleWindows



! closeDiagnosticWindow closes the diagnostic window, duh.
integer function closeDiagnosticWindow()
    closeDiagnosticWindow = 0
end function closeDiagnosticWindow

Much of the functionality here is peculiar to the ClearWin+ package, and will only be useful in Silverfrost Fortran. 'winapp' alerts the compiler that this is a windows program and not the default output of a console program. As a result, main output goes to a big main window. The <windows.ins> file contains the ClearWin+ routines. w2 is a handle for the subordinate window, and the winio@ routine writes to it. Things in square brackets go in as text. The following arcane symbols have these meanings:


symbolmeaning
%cacaption
&continue setup in the next call
%tahorizontal tab
`the following button is the default button
^the following button needs a call-back function to work right
%btbutton
&in button text, highlight the following letter; pressing that key activates the button


By returning a 0, the callback function closes the window where the button is pressed. A 1 would leave it open and cause a refresh, while a 2 would leave it open without refreshing. A 3 is possible for another, specialized use (%mg, used for Windows messaging).



Page created:10/31/2016
Last modified:  10/31/2016
Author:BPL