Latest Update (6.3 Feature Release)
Some big changes 'under the covers', including:
- Full Unicode Support for User Data
- New 'Easy to Translate' Architecture
- New Tasklist importer/exporter
- Vast Improvement in Loading Performance
- Various small improvements and bug fixes
After finally compiling a FAQ of the most relevant questions asked about ToDoList I've moved all resources related to ToDoList to a new page
on my website.
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 interface
- Support for hierarchical data
- Numbered items/subitems
- Open file format
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.
Using the Software
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:
- Files are stored in XML format with .xml file extension.
- Trying to load a non-tasklist file will generally fail (unless you read the code to see how to circumvent it).
- The number of items/subitems is limited only by memory (although performance may be the deciding factor before you exhaust memory).
- Marking a parent item as 'done' will also gray-out child items, but they are not disabled or automatically marked as 'done'.
- An ellipsis (...) indicates that an item has sub-items.
- All items can be expanded or collapsed (by double-clicking).
- Top-level items and sub-items are created using different toolbar buttons.
- There are task-specific context-menus.
- The previously open tasklists are re-opened on startup.
- The tasklist is automatically saved when closing the software or minimizing it to the system tray.
- The priority of a task is shown as a grayscale box to the left of the item.
Points of Interest
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.
- The 'ordered' tree control, which incorporates a non-client gutter for displaying the item numbers.
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_DELETEITEM to know exactly when items are added and removed.
- In these handlers recalculate the width of the gutter required to display the widest 'dotted' item/subitem number. (Note: this is not necessarily simply the deepest subitem.)
- If the required gutter width changes, call
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.
- Embedding .RC control definition data directly in a .cpp file to break the dependency on binary resources (a.k.a. 'Runtime Dialogs').
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:
- First, you design your dialog template in the resource editor, create a
CDialog derived class using class wizard, and wire up all the controls just as you normally would.
- Next, you
#include "runtimedlg.h" and change all instances of
- Then, you cut and paste the control definition section from the appropriate section in the .RC file and embed it directly in the dialog's .cpp file as a static string (with a bit of tweaking to handle double quotes and such like).
- Finally, in the constructor of your dialog, you simply call
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.
- Embedding the XML file in a web page.
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.
Generic MFC Classes that may prove Useful to You
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.
(apart from MFC)
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
CDialog DDX/DDV rountines to avoid the MFC error messages when the user clears a number edit (for instance)
MapDialogRect Win32 API
Class for managing the docking of one popup window to another.
CSubclassWnd, CHoldRedraw, CAutoFlag
Encapsulates various rountines for querying about drives, files and disk space
Adds support to
CBitmap for loading non-bmp files and resources.
CEnBitmapEx, CColorReplacer, CImageBlurrer, CImageColorizer, CImageContraster, CImageEmbosser, CImageFlipper, CImageGrayer, CImageLightener, CImageNegator, CImageResizer, CImageRotator, CImageSharpener, CImageShearer, CImageSysColorMapper, CImageTinter
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
CMaskEdit, CThemed, CDlgUnits
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.
CEnEdit, CFolderDialog, CMaskEdit, CDlgUnits, CThemed, CSysImageList
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
CSubclassWnd, CHoldRedraw, CThemed, CDlgUnits
CTreeCtrl implementation of
CNcGutter displaying a single column showing the hierarchical position of each tree item in '22.214.171.124' notation.
Very simple password dialog not requiring a dialog resource
Simpler replacement for
CPropertySheet allowing easier creation as a child window
CRuntimeDlg for parsing dialog resource-like text
Adds support to
CDialog for building dialogs at runtime ie. dialogs do not require a dialog resource
Class for handling application keyboard shortcuts.
Spellcheck dialog not requiring a dialog resource, which interfaces with
ISpellCheck (interface to Open Office dictionaries)
CRuntimeDlg, CRCCtrlParser, ISpellCheck
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
CEnEdit, CMaskEdit, CThemed, CDlgUnits
Adds support for dialog toolbar tooltips, multiline tooltips and dropbuttons with menus
CSubclassWnd, CEnBitmap, CEnBitmapEx
Shell_NotifyIcon Win32 API. Also provides balloon tips and animation
Adds support for recognizing urls, clicking them and setting custom url callbacks
Encapsulates the ::
GetClassName Win32 functions
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.
Whilst this tool was originally intended for my personal use only, it is now a 'community' project, so if you find it useful and want to make suggestions for enhancements or bug fixes, then post below.
- 6.3.2 (18 Oct 2011)
- Fixed bug where due tasks notification displayed ID and comments when only titles was requested
- Fixed various translation-related bugs
- Fixed bug with default priority/risk when importing from the clipboard
- Fixed Filter bug where options were not being restored for newly saved tasklists
- Fixed Web-Update-Wizard crash
- Fixed bug where separator choice was being ignored when exporting to csv
- 6.3.1 (02 Oct 2011)
- Fixed bug handling embedded tabs in translation system
- Fixed bug checking in/out with source control
- Fixed 'missing encryption component' bug
- Fixed bug toggling visibility via the tray icon
- Fixed due tasks notification bug with stylesheet
- Fixed bug importing text from clipboard
- Fixed bug importing preferences into registry
- Changed XML encoding for Unicode tasklists to 'UTF-16'
- 6.3 Feature Release (18 Sep 2011)
- Full Unicode Support for User Data
- New 'Easy to Translate' Architecture
- New Tasklist importer/exporter
- Vast Improvement in Loading Performance
- Status bar Progress Indicator when Saving and Loading Tasklists
- Various small improvements and bug fixes
- 6.2.8 (06 Jul 2011)
- Fixed bug when using 'Right-Alt' for accented characters (Wojciech Z)
- Further fix for file icon display (philippe b)
- 6.2.7 (05 Jul 2011)
- Fixed bug in file icon display (TCP_JM)
- Fixed bug relating to comments saving (.dan.g.)
- 6.2.6 (25 Jun 2011)
- Fixed remaining bugs with file link icons (TCP_JM)
- Fixed percentage completion calculations (Firo Atrum Ventus)
- Removed  from text exporter comments (mckay.andrew75)
- Removed erroneous CR from simple text copying (verithin)
- 6.2.5 (19 Jun 2011)
- Fixed bug with comments task links (johnsoe_1)
- Fixed bug in date/time export to iCal (Robbson)
- Always assign new task IDs when importing tasks into an existing tasklist (Wojciech Ziembla)
- 6.2.4 (14 Jun 2011)
- Fixed iCal exporter to export time with dates (robbson)
- Fixed comments fields to add default editing border (TCP_JM)
- Fixed Csv importer where Risk was overwriting Priority (Eric G)
- Fixed Csv importer crash with multiline comments (Eric G)
- Fixed 'new-line' bug in FreeMind exporter (BuckDanny)
- Removed horizontal scrollbar from 'set task icon' dialog (Pierre de la Verre)
- 6.2.3 (01 Jun 2011)
- Proper fix for 'rogue' localization dll released accidentally (G.E.)
- 6.2.2 (29 May 2011)
- Fix FreeMind exporter not handling comment line-breaks (BuckDanny)
- Fix problem with outdated localization dll
- Fix 'too-long' urls in edit menu > File Link (TCP_JM)
- Fix 'tab' not moving the cursor in simple comments (Rassix)
- Fix cursor shifting when moving in/out of maximized comments (TCP_JM)
- Do not modify the attributes of new tasks to match the current filter (TCP_JM)
- Add default editing border to both comments controls (TCP_JM)
- 6.2.1 (25 May 2011)
- Removed erroneous logging (Defenestration)
- Fixed excessive length of URL menu item in Comments context-menu (TCP_JM)
- 6.2 Feature Release(20 May 2011)
- Multi-selection maintained when checking out or reloading tasklists
- 'Username' added to checkouts
- Save and restore due tasks notification window position
- Add 'Donate' button to Help menu
- Rewritten CSV exporter/importer (needs lots of testing)
- FreeMind exporter fixed to write out text as unicode characters
- Hint added to status bar to indicate current focus
- Read-only shortcuts added to 'Prefs > Keyboard Shortcuts'
- External ID added to list of inheritable attributes
- URLs can be clicked without requiring the Ctrl key
- Option added to export all tasklists to one file
- 'Toggle Expanded State' added to view menu
- View options added to hide tab controls
- 'Ctrl+A' shortcut added to tick every checkbox in check combos (Alloc To, Category, Filter droplists)
- 'Sort by time tracking' enabled
- Preference filepaths made relative to todolist.exe folder
- Web loading/saving removed
- 'Username' added to date stamp and date/time stamp
- File specific preferences keyed by filename only (allowing ini file to moved without losing settings)
- Dependencies 'corrected' when importing tasks
- Fixed sorting by Parent ID
- Fixed finding by Parent ID
- Added checkbox to 'Add time to Task Log File' dialog to add time to 'Time Spent' field
- Modified 'Add time to Task Log File' dialog to allow negative times (ie time to be subtracted from log/field)
- Removed '' around comments in HTML exporter (TCP_JM)
- Fixed bug with 'backup' folder (TCP_JM et al)
- Allow task titles to have leading spaces (Alexxcode)
- Fixed relative task and file links in comments (Member 7788196)
- Fixed display of remaining time to use correct units (box he)
- Fixed 'due today' tasks being erroneously filtered out (TCP_JM)
- Various UI tweaks
- New themes and theme attributes
- Fixed various 'Find/Replace' bugs
- Fixed html auto-export of images in comments (TCP_JM)
- Auto-detect metric/imperial measurements for Rich Text comment ruler (Member 7788196)
- Fix formatting of ISO times (Member 7788196)
- Fix tab control sorting (Member 7788196)
- Fix first-time auto-exporting to csv (..dB..)
- Fix bug in relative path creation ([d3m0n], TCP_JM, vovchik23, ..dB.., a. hermann)
- Export/Import dependencies to Gantt Exporter (Dave T)
- Fixed 'readonly' check-style droplists to toggle check with 'plain' spacebar (Alexxcode)
- Fix GP importing (Dave T)
- Fix html images for firefox (TCP_JM)
- Fix shift+cursor selection (TCP_JM)
- Add 'current focus' to title bar if status bar is hidden (Alexandra R)
- Fix tabbing in simple text to match rich text behaviour (robbson)
- Add 'Insert Time' option to Edit menu (Member 7788196)
- Fix crash when importing from csv (.dan.g. ;))
- Fix crash deleting tasks after a clipboard import (liorshin)
- Enable support for dragging and dropping PNG files into rich text comments (TCP_JM)
- Right-click 'Paste' in rich edit comments will now paste files as images by default (if that's what they are), then file icons (double-click to open), and finally as file links. Use 'Paste Simple' to directly paste as file links.
- Fix Gantt Project exporting of unicode languages (liorshin)
- Prevent entering of text into recurrence field (TCP_JM)
- Disable reuse options combo when 'Once' is selected
- Add option to display numeric menu IDs in preferences shortcut page (useful for AHK afficianados) (TCP_JM)
- 6.1.10 (12 Mar 2011)
- Add space between position and task name when exporting to html and text
- Make wordwrap settings work for new tasklists
- Fix html export of images in comments
- Fix problem with 'treat tasks with no due date as being due today'
- 6.1.9 (01 Mar 2011)
- Respect user's ISO date preference when exporting tasks
- 6.1.8 (26 Feb 2011)
- Restore spell-checking fix from 6.1.6
- 6.1.7 (13 Feb 2011)
- Fixed richedit wordwrap option not getting set properly at startup
- Fixed Outlook importer to split categories up
- Made html export completed colour darker
- Fixed Faroe islands regional settings formatting bug
- Fixed bug in Window menu
- 6.1.6 (21 Jan 2011)
- Fixed spell-checking bug
- Fixed cost formatting bug
- Fixed csv export not respecting user's period (.) preferences.
- 6.1.5 (28 Dec 2010)
- Logging task time to csv now respects user's list separator choice.
- Logging added to explore problem loading rich text comments plugin.
- 6.1.4 (19 Dec 2010)
- Fixed disabled due time field problem
- Tighten up click and double-click processing in the client column
- Automatically reload archives if ToDoList was responsible for the change (due to archiving)
- Fixed focus problem with richtext toolbar fontname and font size
- Fixed spell checker returning to start of sentence instead of continuing after each correction
- 6.1.3 (08 Dec 2010)
- Fixed find dialog not working second time round
- Fixed task editing being triggered by a task drag
- Fixed position attribute showing in html export even when column is hidden
- Fixed Calendar plugin version information
- 6.1.2 (30 Nov 2010)
- Made 'Flag' attribute inheritable by children
- Fixed Calendar plugin to show only filtered tasks
- Fixed prompt when checking in an unsaved tasklist
- Fixed reminders in 'other' tasklists getting lost
- Fixed old problem of parent folder icons not displaying correctly
- Fixed task order changing on undo
- 6.1.1 (25 Nov 2010)
- Fixed change in comments font causing change to different task
- Fixed 'Find in Comments' shortcuts not working
- When cutting and pasting within the same tasklist keep the existing task IDs
Made 'Flag' attribute inheritable by children
- Removed trailing delimiters in csv exporter
- Fixed problem with due date focus
- Fixed display issues with 'Maximise Comments'
Fixed Calendar plugin to show only filtered tasks
- Fixed problem with radio buttons on auto-export preferences
- 6.1 Feature Release (02 Nov 2010)
- New Rtf to Html converter. Handles images and multibyte languages
- 'Filtered tasks' option added to print, export and transform options
- 256x256 and 48x48 icons added for Windows 7
- upgrade comments to use RichEdit50
- support relative paths in preferences
- set comments selection to top by default
- make due task notifications modal
- fixed comments state saving/reloading
- fix line endings in simple text comments
- ALT+ column click moves focus to edit field(s)
- Allow 'Finds' to be used as filters
- add zero minutes to reminder dialog
- add toggle to turn filter on and off
- add text field to filter bar to match against titles
- add task name to 'copy as path'
- add preference to place icons next to task title
- add option to append time to the time tracking log file
- add Apply button to preferences dialog
- add absolute reminders
- add <none> to priority edit menu
- 1.1-6.0 (removed by .dan.g.)
- 1.0 (4 Nov 2003)