Click here to Skip to main content
15,885,994 members
Articles / Desktop Programming / MFC

Priority sorted task list control

Rate me:
Please Sign up or sign in to vote.
4.76/5 (5 votes)
10 Oct 2002CPOL2 min read 86.9K   297   41   4
Color coded priority task list control for managing TODO lists

Screenshot - tasklist.gif

Introduction

This is one of several custom controls I have designed for a small utility I am currently developing. It offers a small, compact alternative to using full fledged TODO/TASK list organizers.

Features

  • Tasks sorted by priority level
  • Color coded priority for easy indication of level of importance
  • Check box to indicate whether task has been completed
  • 3 levels of priority, each can be assigned unique colors
  • Drop down listbox adjusts width to automatically to fit all text

Future

  • Remove items using delete key (VERY SOON)
  • Drag and drop support
  • In-place editing

Bugs

If you can fix any bug, please tell me how and i'll make sure to mention you in this article under credits.
  • When the mouse moves over items and the left mouse button is down the items sometime hilite but the text color remains COLOR_WINDOWTEXT, instead of COLOR_HIGHLIGHTTEXT. This is what I think is going on anyways.
  • When you change the priority of any item the listbox does not automatically re-sort itself. I'm currently trying to figure this out, even a quick hack.

Interface

AddTask()
GetTask()
SetCheck()
GetCheck()
SetColors()
GetColorLevelX()
SetPriority()
GetPriority()

Example

The usage of this control is VERY trivial, just as easy as using a CComboBox control. You should have no problems getting things going. Please refer to the demo app for more details.

Notes

The complexity of this control is just about at where I expect it to end. I don't plan on adding support for associating a time field with each item added to the list or anything of similar nature. I'd like to fix a few bugs and optimize wherever I can but thats about it. If you have any ideas you would like to see implemented you can contact me at the email address given inside the source files or post a message here at codeproject. I can't promise anything, but I will consider it, especially if it's really cool and of course i'd give you credit.

Credits

Source code contains reference to the following where appropriate

  • Chris Maunder
  • Magnus Egelberg, Lundalogik
  • Eric Sanchez

Copyright

By uploading my code to codeproject.com I assume I inherit all open source terms of use, licenses and those specified by codeproject.com. However if you use this control for any purpose I would really like to hear about it. It is my belief that by referencing the credited people I demonstrate the ability to effectively read and re-use source code, rather than re-invent the wheel. I expect you would do the same.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralVery nice but... Pin
Anonymous9-Oct-02 23:54
Anonymous9-Oct-02 23:54 
GeneralRe: Very nice but... Pin
alex.barylski10-Oct-02 12:23
alex.barylski10-Oct-02 12:23 
GeneralNice! Pin
Ravi Bhavnani9-Oct-02 8:54
professionalRavi Bhavnani9-Oct-02 8:54 
GeneralRe: Nice! Pin
alex.barylski9-Oct-02 22:17
alex.barylski9-Oct-02 22:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.