
Once again this release is not chock full of new features but I'm glad to report the arrival of multi-column sorting which is accessed via the Sort menu.
Other smaller features include:
You know how it is - you start work on one project and halfway through, you find one or two side-projects crop up that have to be solved before you can continue on the original project.
This is one such project with the added twist that it too started its life as a side-project. Here's what happened:
<Cue wavy screen effect>
I can only imagine that the planets must have been in (mis-)alignment or something, because at one point a few months ago, I was suddenly fielding emails on four or five separate articles I had previously submitted to CodeProject, some asking for features and others for bug fixes.
Foolishly or otherwise, I largely agreed with all the points raised, and subsequently found myself with fourteen or fifteen separate issues to resolve.
The situation was also made worse because I was trying to use CodeProject to keep track of all the things I had agreed to do, meaning that I had to continuously trawl the comments section of each article to remind myself of what I was supposed to be working on.
It even got to the stage where I was worrying that I'd fail to deliver on something - silly I know, but there you are!
Keeping a list on paper was a definite step in the right direction, but since I do all my coding on the same machine, it seemed somewhat inelegant, and anyway, we all know what happens to crucial bits of paper left lying around on desks and such.
The next step was to hunt around on the web for a tool to meet the following requirements:
Simple, huh! not!
I will admit that I did not spend weeks searching, but I am still surprised at the general lack of software matching my needs.
On reflection, I think that the reason may be simple: people are so used to commercial software being 'feature-rich' that when they come to design software themselves, they (not unreasonably) think they too need to cram as much in as possible, often leading to software where a lot of essential functionality is hidden away in the menu bar.
So, surprise, surprise, I decided to write something myself.
However, it's fair to say that I did not originally intend to post it on CodeProject and am only really doing so because I had a heap of fun solving some very interesting problems and these are what I think make it worth it.
There's really very little I need to say here since every feature/function is explicitly visible in the interface.
Nevertheless, the following list of basic capabilities and omissions may go someway to answering any questions that arise:
Here's where we come to the side-projects I was talking about, the first two of which I intend to work up into follow-up articles.
They are:
The idea stemmed from research I did into alternative designs for a tree-list control, which did not solve it by creating a hybrid control incorporating a tree and a list.
The hybrid control seems such an obvious solution that I suspect few people have stopped to question it, but it has still always struck me as looking far too much like hard work to be truly elegant ('square pegs' and 'round holes' spring to mind).
One possible idea is to implement the 'list' portion entirely in the non-client area of the tree. I.e., shift the right hand client edge to the left and then render the list portion in the resulting non-client area.
Whilst I've yet to get round to building a proof of concept, it was nevertheless this ongoing mental debate which prompted me to try to solve the requirement for numbered items and subitems by rendering the item/subitem numbers in the non-client area.
Without going into too much detail (as this will subsequently be an article of its own), this is how I got it to work:
TVM_INSERTITEM and TVM_DELETEITEM to know exactly when items are added and removed. SetWindowPos(NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER) to force Windows to recalculate the non-client area of the control. WM_NCCALCSIZE when it does, and offset the left border by the required gutter width. WM_NCPAINT for painting the numbers. This is necessarily an over-simplification, but it captures the essence of the solution, and all that essentially remains is lots of fiddling about to ensure the non-client area gets redrawn at the the right times to stay synchronized with the client area.
This is an idea that has been floating about for quite some time and which has only recently gelled into a workable solution.
The problem, put simply, is that if you want to take advantage of the resource editor in Visual Studio (and who doesn't), then you very quickly find yourself stuck with having to load dialog templates from resources compiled into the binary file.
This further means that if you want to make use of a dialog across multiple projects, then either you need to copy and paste the dialog template between project .RC files, or you need to build the dialog into a DLL from which it can be accessed.
'Runtime Dialogs' (a snappy title I coined myself) is a solution that neatly sidesteps both the nuisance of copying dialog resources between resource files and the extra work (and maintenance) involved in packaging dialogs in DLLs.
And it works like this:
CDialog derived class using class wizard, and wire up all the controls just as you normally would. #include "runtimedlg.h" and change all instances of CDialog to CRuntimeDlg. CRuntimeDlg::AddRCControls(...) passing the control definitions as a string. CRuntimeDlg takes care of the rest including, if required, auto-sizing the dialog to suit the control layout. I'm certainly not suggesting that this is a 'win-win' solution for all situations but it certainly has merits in its closer coupling of dialog template to dialog code which makes sharing dialogs across multiple projects a breeze.
P.S.: In case it's not clear here, I used CRuntimeDlg to create CToDoCtrl which encapsulates the ordered tree together with the priority, date and comments controls as a single simple-to-instantiate control.
I'm also proposing to use them in the .NET port of my ProjectZip add-in for VC6.
This is possibly the most satisfying aspect of the whole project because it was completely unexpected.
What I mean is that, until recently, my knowledge of DOM and XMLDOM was virtually non-existent, as it's only since I've become more interested in the presentation of AbstractSpoon that I've been forced to get to grips with the various implementations of DOM and XMLDOM out there.
I'm pleased to say that the code on my site works under IE 6.0, Netscape 7.1, and Mozilla, although custom code was required to achieve this.
The following table lists a wide range of utility classes written for this project. They can all be included in any MFC project provided you include any class dependencies too. Feel free to ask any questions relating to these specific classes and how to use them.
|
Class Name |
Description |
Class Dependencies |
|
|
Customizable "About…' dialog not requiring a dialog resource. Supports html encoded text |
|
|
|
Adds only unique items to the drop list and shuffles the list so that the last added item is at the top |
|
|
|
Encapsulates the setting and unsetting of a boolean variable thru the lifetime of the class instance |
|
|
|
Non-ownerdraw button that displays the selected colour on the button face and displays the colour dialog when clicked |
|
|
|
Owner-draw combobox for displaying and selecting user defined colours |
|
|
|
Encapsulation of various rountines for calculating date spans and for formatting |
|
|
|
Encapsulation of the Win32 API |
|
|
|
Re-implementation of the |
|
|
|
Encapsulates the |
|
|
|
Class for managing the docking of one popup window to another. |
* |
|
|
Encapsulates various rountines for querying about drives, files and disk space |
|
|
|
Adds support to |
|
|
|
Adds image manipulation funationality to |
|
|
|
Adds saving and restoring of custom colours to |
|
|
|
Adds functions for extracting and querying commandline switches |
|
|
|
Adds user-defined button capabilities to |
|
|
|
Adds support for using alternative resource or file images |
|
|
|
Adds buttons for browsing and displaying the file represented by the text in the edit control. Also shows the file's small icon. |
|
|
|
Encapsulates |
|
|
|
Fixes a number of behavioural problems including the handling of certain keypresses |
|
|
|
Tracks the cursor movement over user-defined windows and posts event messages as necessary |
* |
|
|
Provides simple method to detect if another instance of an app is running |
|
|
|
Adds simple character masking to |
|
|
|
Allows the UI of standard windows controls to be extended by supporting any number of columns to be added to the non-client area of the window. Favours tabular controls like lists, trees, etc |
* |
|
|
|
|
|
|
Very simple password dialog not requiring a dialog resource |
|
|
|
Simpler replacement for |
|
|
|
Used by |
|
|
|
Adds support to |
|
|
|
Class for handling application keyboard shortcuts. |
* |
|
|
Spellcheck dialog not requiring a dialog resource, which interfaces with |
|
|
|
Encapsulates the Windows system image list (file/folder images) |
|
|
|
Adds post rendering callback for the tabs without using owner-draw |
|
|
|
Encapsulates themed (XP) and non-themed (the rest) drawing of windows controls |
|
|
|
Adds a button for specifying time units and provided routines for converting time to and from different time units |
|
|
|
Adds support for dialog toolbar tooltips, multiline tooltips and dropbuttons with menus |
* |
|
|
Encapsulates the |
* |
|
|
Adds support for recognizing urls, clicking them and setting custom url callbacks |
|
|
|
Encapsulates the :: |
|
|
|
Non-Unicode class for reading and writing xml files |
|
|
|
Adds encryption capabilities to |
|
* CSubclassWnd was originally written by Paul DiLascia for MSJ magazine. The version I use has been heavily extended to suit my specific needs. The classes that depend on it here need this extended version.
| You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||