Using Intel® Visual Fortran to Create and Build Windows*-Based Applications
Total Page:16
File Type:pdf, Size:1020Kb
Using Intel® Visual Fortran to Create and Build Windows*-Based Applications Document Number: 324197-001US www.intel.com Legal Information Using Intel® Visual Fortran to Create and Build Windows*-Based Applications Contents Legal Information................................................................................ 5 Chapter 1: Introduction Overview..................................................................................................6 Notational Conventions...............................................................................6 Related Information................................................................................... 7 Chapter 2: Creating Windowing Applications Creating Windowing Applications Overview....................................................8 Understanding Coding Requirements for Fortran Windowing Applications...........8 Using Menus and Dialogs in SDI and MDI Fortran Windowing Applications........11 Sample Fortran Windows Applications.........................................................13 Advanced Graphics Using OpenGL.............................................................. 13 Chapter 3: Creating and Using DLLs Creating and Using Fortran DLLs Overview.................................................. 15 Coding Requirements for Sharing Procedures in DLLs....................................15 Coding Requirements for Sharing Data in DLLs............................................ 16 Building Dynamic-Link Libraries................................................................. 18 Building Executables that Use DLLs............................................................ 20 Chapter 4: Using QuickWin Using QuickWin Overview..........................................................................21 Special Naming Convention for Certain QuickWin and Windows* Graphics Routines............................................................................................. 22 Comparing QuickWin with Windows*-Based Applications............................... 22 Using Windows API Routines with QuickWin.................................................23 Types of QuickWin Programs..................................................................... 23 QuickWin Programs Overview............................................................23 Fortran Standard Graphics Applications...............................................24 Fortran QuickWin Graphics Applications.............................................. 24 The QuickWin User Interface..................................................................... 25 QuickWin User Interface Overview..................................................... 25 Default QuickWin Menus................................................................... 25 USE Statement Needed for Fortran QuickWin Applications............................. 26 Creating QuickWin Windows...................................................................... 27 Creating QuickWin Windows Overview................................................ 27 Accessing Window Properties.............................................................27 Creating Child Windows.................................................................... 29 Giving a Window Focus and Setting the Active Window......................... 31 Keeping Child Windows Open............................................................ 32 Controlling Size and Position of Windows............................................ 32 Using QuickWin Graphics Library Routines................................................... 33 Using Graphics Library Routines.........................................................33 Selecting Display Options..................................................................33 Checking the Current Graphics Mode.................................................. 34 2 Contents Setting the Graphics Mode................................................................ 34 Setting Figure Properties.................................................................. 35 Understanding Coordinate Systems.................................................... 35 Understanding Coordinate Systems Overview..............................35 Text Coordinates..................................................................... 36 Graphics Coordinates............................................................... 36 Setting Graphics Coordinates.................................................... 39 Real Coordinates Sample Program............................................. 39 Adding Color................................................................................... 43 Adding Color Overview............................................................. 43 Color Mixing........................................................................... 44 VGA Color Palette.................................................................... 45 Using Text Colors.................................................................... 46 Writing a Graphics Program...............................................................46 Writing a Graphics Program Overview........................................ 46 Activating a Graphics Mode.......................................................47 Drawing Lines on the Screen.....................................................48 Drawing a Sine Curve.............................................................. 49 Adding Shapes........................................................................ 50 Displaying Graphics Output............................................................... 51 Displaying Graphics Output Overview......................................... 51 Drawing Graphics.................................................................... 51 Displaying Character-Based Text............................................... 53 Displaying Font-Based Characters..............................................54 Using Fonts from the Graphics Library........................................ 54 Storing and Retrieving Images.......................................................... 57 Working With Screen Images.................................................... 57 Transferring Images in Memory................................................. 58 Loading and Saving Images to Files........................................... 58 Editing Text and Graphics from the QuickWin Edit Menu................58 Customizing QuickWin Applications.................................................... 59 Customizing QuickWin Applications Overview.............................. 59 Enhancing QuickWin Applications...............................................59 Controlling Menus....................................................................60 Changing Status Bar and State Messages................................... 63 Displaying Message Boxes........................................................ 63 Defining an About Box..............................................................64 Using Custom Icons................................................................. 64 Using a Mouse........................................................................ 64 QuickWin Programming Precautions................................................... 67 QuickWin Programming Precautions Overview............................. 67 Using Blocking Procedures........................................................ 67 Using Callback Routines........................................................... 68 Simulating Nonblocking I/O...............................................................68 Chapter 5: Using Dialog Boxes for Application Controls Using Dialog Boxes for Application Controls Overview................................... 69 Using the Resource Editor to Design a Dialog Box.........................................69 Designing a Dialog Box Overview....................................................... 69 Setting Control Properties................................................................. 73 3 Using Intel® Visual Fortran to Create and Build Windows*-Based Applications Including Resources Using Multiple Resource Files................................ 74 The Include (.FD and .H) Files........................................................... 74 Writing a Dialog Application.......................................................................74 Writing a Dialog Application Overview.................................................75 Initializing and Activating the Dialog Box............................................ 75 Using Dialog Callback Routines.......................................................... 77 Using a Modeless Dialog Box............................................................. 78 Using Fortran AppWizards to Help Add Modal Dialog Box Coding............ 79 Using Fortran AppWizards to Help Add Modeless Dialog Box Coding........ 81 Using Dialog Controls in a DLL...........................................................83 Summary of Dialog Routines..................................................................... 84 Understanding Dialog Controls...................................................................85 Understanding Dialog Controls Overview.............................................85 Using Control Indexes...................................................................... 86 Available Indexes for Each Dialog Control............................................87 Specifying Control Indexes................................................................90 Using Dialog Controls..............................................................................