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..................................................................................6 Chapter 1: Introduction Overview....................................................................................................7 Notational Conventions................................................................................7 Related Information.....................................................................................8 Chapter 2: Creating Windowing Applications Creating Windowing Applications Overview.....................................................9 Understanding Coding Requirements for Fortran Windowing Applications............9 Using Menus and Dialogs in SDI and MDI Fortran Windowing Applications.........13 Sample Fortran Windows Applications...........................................................15 Chapter 3: Creating and Using DLLs Creating and Using Fortran DLLs Overview....................................................16 Coding Requirements for Sharing Procedures in DLLs.....................................16 Coding Requirements for Sharing Data in DLLs..............................................18 Building Dynamic-Link Libraries...................................................................20 Building Executables that Use DLLs..............................................................21 Chapter 4: Using QuickWin Using QuickWin Overview...........................................................................23 Special Naming Convention for Certain QuickWin and Windows* Graphics Routines...............................................................................................24 Comparing QuickWin with Windows*-Based Applications.................................25 Using Windows API Routines with QuickWin...................................................25 Types of QuickWin Programs.......................................................................25 QuickWin Programs Overview..............................................................25 Fortran Standard Graphics Applications................................................26 Fortran QuickWin Graphics Applications................................................27 The QuickWin User Interface.......................................................................27 QuickWin User Interface Overview.......................................................27 Default QuickWin Menus.....................................................................28 USE Statement Needed for Fortran QuickWin Applications...............................29 Creating QuickWin Windows........................................................................29 Creating QuickWin Windows Overview..................................................29 Accessing Window Properties..............................................................30 ii Contents Creating Child Windows......................................................................32 Giving a Window Focus and Setting the Active Window...........................33 Keeping Child Windows Open..............................................................34 Controlling Size and Position of Windows..............................................35 Using QuickWin Graphics Library Routines.....................................................35 Using Graphics Library Routines..........................................................35 Selecting Display Options...................................................................36 Checking the Current Graphics Mode....................................................36 Setting the Graphics Mode..................................................................36 Setting Figure Properties....................................................................37 Understanding Coordinate Systems......................................................38 Understanding Coordinate Systems Overview................................38 Text Coordinates.......................................................................38 Graphics Coordinates.................................................................39 Setting Graphics Coordinates......................................................42 Real Coordinates Sample Program...............................................43 Advanced Graphics Using OpenGL........................................................47 Adding Color.....................................................................................49 Adding Color Overview...............................................................49 Color Mixing.............................................................................49 VGA Color Palette......................................................................51 Using Text Colors......................................................................52 Writing a Graphics Program................................................................52 Writing a Graphics Program Overview..........................................52 Activating a Graphics Mode.........................................................53 Drawing Lines on the Screen......................................................54 Drawing a Sine Curve................................................................55 Adding Shapes..........................................................................56 Displaying Graphics Output.................................................................57 Displaying Graphics Output Overview...........................................57 Drawing Graphics......................................................................57 Displaying Character-Based Text.................................................59 Displaying Font-Based Characters................................................60 Using Fonts from the Graphics Library..........................................61 Storing and Retrieving Images............................................................64 Working With Screen Images......................................................64 Transferring Images in Memory...................................................64 Loading and Saving Images to Files.............................................65 Editing Text and Graphics from the QuickWin Edit Menu.................65 Customizing QuickWin Applications......................................................66 Customizing QuickWin Applications Overview................................66 iii Using Intel® Visual Fortran to Create and Build Windows*-Based Applications Enhancing QuickWin Applications................................................66 Controlling Menus.....................................................................67 Changing Status Bar and State Messages.....................................70 Displaying Message Boxes..........................................................71 Defining an About Box...............................................................71 Using Custom Icons...................................................................71 Using a Mouse..........................................................................72 QuickWin Programming Precautions.....................................................75 QuickWin Programming Precautions Overview...............................75 Using Blocking Procedures..........................................................75 Using Callback Routines.............................................................75 Simulating Nonblocking I/O................................................................76 Chapter 5: Using Dialog Boxes for Application Controls Using Dialog Boxes for Application Controls Overview.....................................77 Using the Resource Editor to Design a Dialog Box..........................................78 Designing a Dialog Box Overview.........................................................78 Setting Control Properties...................................................................82 Including Resources Using Multiple Resource Files..................................83 The Include (.FD and .H) Files.............................................................84 Writing a Dialog Application........................................................................84 Writing a Dialog Application Overview..................................................84 Initializing and Activating the Dialog Box..............................................85 Using Dialog Callback Routines............................................................86 Using a Modeless Dialog Box...............................................................88 Using Fortran AppWizards to Help Add Modal Dialog Box Coding..............89 Using Fortran AppWizards to Help Add Modeless Dialog Box Coding..........91 Using Dialog Controls in a DLL.............................................................93 Summary of Dialog Routines.......................................................................95 Understanding Dialog Controls.....................................................................96 Understanding Dialog Controls Overview..............................................96 Using Control Indexes........................................................................97 Available Indexes for Each Dialog Control.............................................98 Specifying Control