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

Freeware

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.

They are:

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:

Handle TVM_INSERTITEM and 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.)

Handle WM_NCCALCSIZE when it does, and offset the left border by the required gutter width.

Handle 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 CDialog to CRuntimeDlg.

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.

And 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.

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.

Adds support for recognizing urls, clicking them and setting custom url callbacks

CWinClasses

Encapsulates the ::GetClassName Win32 functions

CXmlFile, CXmlItem

Non-Unicode class for reading and writing xml files

CXmlFileEx

Adds encryption capabilities to CXmlFile

CXmlFile, IEncryption

* 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.

Further Work

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.

History

7.1.4 (26 Aug 2017)

Fixed filter selection when names contain brackets

Fixed HTML exporting of '&', '<', '>'

Fixed application window resizing on startup

Fixed file encoding of 'Transformed' tasklists when auto-exporting after saving

Hello, congratullation for this great and free utility. I know you are not the developer of the Android mobile app, but I have observed that so many changes in the file format continuosly breaks the compatibility among those two apps... would it be possible to keep a fixed file format to keep the compatibility? It is a pity that the compatibility now is broken. Maybe it would be desirable the possibility to keep the file format for specific files, in an older file format or something, to keep them compatible...
Thank you very much!

I need your help to identify the causes of this error. When I opened the .sln with VS2010, one project(TDLTransEdit) was unloaded, so I manually added it back into the solution. When I built it, a bulk of error came out as below. May I know what is the causes and solution.

So you can group by feild1 (color), then by feild2 (animals)
so it becomes
Red
--Anima
--Plant
----Rose
--Material

Yellow
--Animal
--Plant
---Sunflower
--Material

etc.

I would also like to suggest if another position feild could be included in the custom user thin - so to rearrange it as per multiple orders of choice..

Also, the mindmap view is wonderful addon - and to compliment, I would
Its very similar to the mindmap you have developed, with a few differences. Namely, the direction can be top down, bottup up, left to rihgt or right to left. Also it allows icons to remain visible.

ALSO Bugs
a bug in the recent B4
if the total hours in day is set to any number greter than 19, it crashes the day view.

Also items with multiple tags in the kanban show up in only one column, not both... I don't know if the hisis a bug

Also if a taks is CLONED to multiple paerts, the sum doesn't seem to change. Also ifthe list is filtered, the sums dont change (they summ ALL the items - even those that are not visible)

Anyways, I hope you like these suggestiond and take them into consideration!
And thank you again for the wonderul app

So you can group by feild1 (color), then by feild2 (animals)
so it becomes
Red
--Anima
--Plant
----Rose
--Material

I would also like to suggest if another position feild could be included in the custom user thin - so to rearrange it as per multiple orders of choice..

Also, the mindmap view is wonderful addon - and to compliment, I would
Its very similar to the mindmap you have developed, with a few differences. Namely, the direction can be top down, bottup up, left to rihgt or right to left. Also it allows icons to remain visible.

FYI: I had the same thing happen to me after installing this patch. I have TDL installed in C:\Users\{MyUserName}\Documents\ToDoList.

I ended up doing a re-install and reconfigured my settings. Considering where I have TDL installed (using a INI file, not storing settings in the registry) it never occurred to me that a Windows patch had caused the problem. I just assumed it was a run-of-the-mill Windows glitch.

Hi
Not sure what to call this problem so apologies for title. It occurred before a few months ago but briefly and i forgot about it. But yesterday/today its much worse and restarting TDL and/or PC doesn't seem to help.

Three examples -
a. I clicked on tab of a TDL (I have around 10 open) but nothing happens. Right-clicking however DOES open the context menu and switches to that TDL, and so does using the 'window' menu items.
b. I clicked the quick-find box and started typing a search term. The box did NOT clear or change to the new characters as I typed (as if frozen) BUT the search DOES respond to the typed letters.
c. I have a tree of tasks I just typed in, and wish to move one of the 'children' up the hierarchy of the tree. Neither clicking nor using keyboard commands appears to make this happen - the tasks are 'stuck' or frozen apparently... BUT after restarting TDL, these tasks HAVE been re-arranged per my keypresses.

So something mysterious and random with no sudden change of TDL usage habits or behaviour on my part or PC configuration or anything else hardware or software to give clues. Plus aware that in the brave new world of Win10 it might not even be caused by TDL. I am even eating the same breakfast these days!!

From the sounds of things, 'something' is consuming so much CPU/Hard Disk that the UI is not getting updated in time.

My suggestion for investigating this further is to keep 'Task Manager' open (and visible at all times) so that when these hiccups next occur you can see at a glance on the 'Performance' tab if any of your computer elements is flat-lining.

If that is the issue, you can then switch to the 'Details' tab and narrow down the culprit.

Additionally you could repost this to our Google Group[^] to see if you get any other feedback...

Hi again, I found the culprit! So it was caused by a recurring alert within the STICKIES application, which was not being pushed to the front of the open window(s). All the while the recurring note was 'alarming' it was hijacking some doodad <insert codespeak here> in TDL - in particular the ability to click on the tabs (although not right-click, which seems very specific).

Note that I am using Stickies independent of TDL - so these alerts/alarms are not managed by TDL. But I know that TDL can use Stickies as a reminder 'vehicle' so I will give that a try as a side issue.

Applications bringing themselves to the foreground without user involvement has been a fraught problem since Windows 3.1 (at least) because nefarious apps would take advantage of this to push ads and other such <insert expletive here>.

So Microsoft has been fighting a battle to prevent apps hijacking the foreground, but it's not perfect and I suspect creates some very weird loopholes and 'edge-cases' when it gets it wrong.

So it sounds like the Stickies app was getting the focused input messages even though it was not visible to you. Why the right-click worked could be specific to the handling of context menus which were only added in Windows 95.

I think trying TDL's built-in use of Stickies is a good idea, though from look the code I don't seem to be doing anything that might prevent this occurring again (if that's even possible)...

First of all: this is a great, feature packed tool! Trying to use the tool for some project planning, I noticed a few small things though.

The gantt chart does not pass year's end. This is a bit annoying especially in this time of year as a lot of tasks are planned or due in 2018.

Secondly: if a task's due date is changed, its dependent task's due dates also are recalculated. Only: this calculation does not take into account weekends as defined in the settings. So, if a task ends Friday and the dependent task takes one day and ends on Monday, after moving the first task's due date to Thursday, the dependent task ends on Sunday and not on Friday. In the other direction, the same applies (i.e. leaving Friday, ending up on Saturday). Doesn't the calculation of the projected end date take into account its predecessor enddate + weekend days (if any) + its own duration?

Does ToDoList have a "Memo" field in addition to the "Comments" field? One possible use of this field would be to keep internal/private memo for the project, i.e. show Comments but hide Memo when printing/exporting.

No. For custom attributes there is only a single line Text type, not a Text Area, for a block like Comments. I requested this feature a couple years ago too for similar reasons.

If you look at the Stylesheets that come with TDL, there is a file tgEstimates_eng.xsl. That includes code that will extract off the first line of comments for reporting. You can use this as a base for other customizations, where you can get sections of comments for public or private reporting.

Another way to do this is with a User-Defined Tool that calls an external process which will save notes related to the current task. This way private notes are saved outside of the environment but still accessible from TDL as though it's internal. Rather than storing the data externally, you can create a custom text attribute and use a UDT to read/modify/write that data, and then just exclude the field from reports and exports. I know that's vague but if you can code then at least you know there is a way to do this yourself.