Experimental Win32For Class Libraries


I have started to experiment with generating my own class library for Win32For and Win32 API programming. I started by modifying a program example I had been working on that combined several of the controls I had been experimenting with (toolbars, statusbars, and menus). The new example was a simple Notepad clone. I picked this since it allowed me to experiment with multiline edit controls. The usual disclaimers apply and realize that these are "works in process" and I have been learning and debugging alot. If you find any glaring errors, give a shout.

I currently have five class files:


WinBase.f -- Has some needed definitions and the two basic window classes (BaseWindow and BaseChildWindow).
Menubar.f -- generic menu classes for popup menus and a menubar class.
Toolbar.f -- generic bitmap button toolbar.
Statbar.f -- single and multipart statusbar classes.
Editbox.f -- a multiline edit control class.

The application is in TextEdit.f. A zip file is available that includes all the above plus bitmaps. It currently has pretty basic functionality. Features not yet implemented are search/replace, word wrap, saving, and printing. OK, so there's a lot yet to do! Cut a guy some slack ;-)


Some new examples using the class library

I have included a few samples of using the menu class libraries.


A simple menubar example
A more complicated menu showing submenus and spliting menus into two columns (shown below).



The original examples redone

And, I have updated the Statusbar and Toolbar examples so that they use the new classes. The necessary bitmaps and icons are available from the earlier examples, if you don't already have them.


The Toolbar Example
The single-part Statusbar Example
The multi-part Statusbar Example

Running tooltips under Win32s

Tom Zimmer confirmed my suspicion regarding his implementation of tooltips, that it was necessary for compatibility with early versions of Win32s and Window 95. Just for giggles, I ran the TextEdit example on a Win32s machine (running Windows for Workgroups). Most of the functionality was still there (including tooltips!). Things that didn't work were reading a bitmap resource from a file (so I used the Win32 API builtin bitmaps for the toolbar), setting READONLY state, and processing files larger than 64K. I didn't spend much time on these issues so they could probably be dealt with (left as an exercise for the interested reader). The example code has conditional compilation sections to handle compiling under Win32s.


I will continue to update the classes and this example as time permits. As usual, I hope you find something of value.




Author: Jeff Kelm, (how to contact me)
URL: http://www.concentric.net/~jkelm/win32for/classlib/index.htm
(Modified: 2005-01-07)