|
last update 14-May-2008
|
![]() |
Xeffort Extras by Mike Gaitens This site presents some additions to Jugoslav Dujic's Xeffort Framework and Library. I am pleased to announce that the utility routines in the XFTextra module have formally become part of Xeffort as of Release 23, and thus have been removed from this site.
User-Customized Toolbar
This example project features a dockable toolbar that can be completely customized by the program user. The program user can:
The OnSize handler in this program demonstrates coexistence of a dockable toolbar, a status bar, and a view window. The project also contains the system Standard, View, and History images as bitmaps. Having these images now available as individual bitmaps allows you to see what they look like, modify them as you wish, and include only the ones of interest rather than the complete sets. Download this rather well-commented project.
Like SYSTEMQQ, this function launches a single-line DOS command and waits for it to complete. Typically, the given command line will invoke a batch (.BAT) file. Unlike SYSTEMQQ, this function hides the command window and captures all output in a file without need for the DOS redirection operator. [Development of this function required considerable trial-and-error; I don't claim to understand it all.] Download the result.
Radio Buttons
Multi-Column Sorting of ListView Control (added 20-Oct-05) Download MCXListView.f90 containing a new function MCLV_Sort that replaces (and was modeled after) XLV_OnColumnClick. Programmer instructions are included in the source code. User instructions follow:
Modeless
Dialog Application Template
Jugoslav's AppWizard will generate a Modal Dialog application that includes comments as to how to convert it to a modeless dialog. If you wish to use a modeless dialog, you can save a little work by downloading this module, change its first line to the name assigned to the modal dialog, then use it to replace the modal dialog source file. (added 21-Aug-05) Here is a small example Xeffort project that uses a pair of "Date Picker" controls to establish a date range. These controls are very versatile and were assigned the "show none" style which allows the user to signify "date immaterial" or "date unknown". (If a user-supplied date were mandatory, you would clear this style and keep the variable named VALID .true.). Before a program can use a Date Picker control, the control class must be registered via InitCommonControlsEx (see routine CCLOAD). This registration must be done once and done early, before any dialog using the control is loaded. Communication with the Date Picker controls is done via straightforward XCtlSendMessage. Download the sample project.
1-Aug-05) Download a Fortran module containing routines that convert Gregorian dates to/from Julian (for easy date arithmetic) and routines to display dates and days per the user's locale settings. These routines do not employ Xeffort. For information about calendars of all types, visit John Walker's excellent Calendar Converter. 24-Sep-05) Xeffort uses the ComCtl32.dll library to render controls, e.g., pushbuttons, check boxes, etc. Microsoft ships Windows XP with two versions of this library -- Version 5 which renders the controls in "classic" style (rectangular pushbuttons, etc.) and Version 6 which renders controls in the new "XP-style" (pushbuttons have rounded corners, garish colors, etc.). You can read the Microsoft documentation here. Version 5 is the default. To render controls in XP-style, employ Version 6 by downloading the file named "MyProg.exe.manifest". This is a text file in XML format. NOTE: Wherever you see the text string "MyProg", replace it with the name of the program you are developing, i.e., the name of your .exe file. Therefore, you change the filename of the file downloaded above (the ".exe.manifest" portion must remain), and you also change the 6th line in this file. Once these changes are made, all you need do is distribute the resulting "YourProgam.exe.manifest" file along with "YourProgam.exe" file and insure both files are placed in the same directory. As an alternative to distributing a separate file, you can incorporate the manifest within your program's resources. Here is a crude but effective way of placing the manifest within your program. In the downloaded zip containing the manifest, there is a small text file named "rcinc.txt". Edit this file to replace the "MyProg" string with the name of your program. Paste the edited file into your project's resource (.rc) file, placing near the Bitmap or Icon section of the resource file. Then re-build your executable; this executable will be valid for all versions of Windows. Controls will have the XP-style when your program is being run under Windows XP, and the classic style when it is run on the older versions of Windows. Key Code Explorer (added 17-Oct-05) Download a small Xeffort application that displays the all the codes associated with a key press. The zip contains both the executable and the CVF 6.6C project source.
I like Xeffort because it gives me most of the power of the Windows API without most of the hassle of the Windows API. It makes available to the Fortran programmer sophisticated control windows such as the ListView, Toolbar, Statusbar, MDI, etc. Without Xeffort, any of these would be a major pain to implement. Xeffort beginners should visit Jugoslav Dujic's site and download Xeffort. Jugoslav has structured Xeffort for three levels of users: additional QuickWin features; a replacement for Visual Fortran's DFLOGM dialog management routines; and for full-featured Windows applications. While Xeffort benefits all three levels, it really shines with Windows applications, which is our concentration. To develop a Windows application, you start by running the Xeffort Application Wizard. The Application Wizard produces a running prototype program that you then customize for your application. Learning full-featured Xeffort programming may appear daunting, but it's less than a tenth the effort required to learn the Microsoft API. The Xeffort interface is wonderfully consistent. All you need do is modify prototyped functions and create subroutines for callbacks. Try Xeffort; after you complete your first application with it, I believe you'll become a convert. |