Outlining Items in Visual C++
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: Outlining Items in Visual C++

  1. #1
    Join Date
    Sep 2013
    Posts
    4

    Outlining Items in Visual C++

    I am struggling with how to efficiently design my class objects to support the outlining of a collection of items. The collection would be sorted but would also have the ability to indent and outdent individual items representing a Parent and Child relationship (see attached).

    An item could indent up to 5 levels deep. A summary level would be considered a Parent while items below the summary level would be consider as children. Working examples would be wonderful, or just an outline of the class design to get me going would be much appreciated.

    Name:  Outline.jpg
Views: 117
Size:  65.3 KB

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,095

    Re: Outlining Items in Visual C++

    Looks pretty close to a tree control. Are you looking for help with the graphical representation or the actual structure of your data?

  3. #3
    Join Date
    Sep 2013
    Posts
    4

    Re: Outlining Items in Visual C++

    Thanks for your prompt reply. Not 100% sure, but I believe I need help on the structure of the data, as well as, the design of the classes that will support such a structure. Assuming the list provided started at Level 0 the user would have the ability to indent/outdent individual items given the shown results. Thanks for your patience. Does that help?

  4. #4
    Join Date
    Apr 1999
    Posts
    27,427

    Re: Outlining Items in Visual C++

    Quote Originally Posted by aww91 View Post
    Thanks for your prompt reply. Not 100% sure, but I believe I need help on the structure of the data, as well as, the design of the classes that will support such a structure. Assuming the list provided started at Level 0 the user would have the ability to indent/outdent individual items given the shown results. Thanks for your patience. Does that help?
    Flip your design 90 degrees clockwise and connect those 3 upper nodes (Non-Fiction, Fiction, Poetry) to a single root node. Do you see the tree?

    http://www.brpreiss.com/books/opus5/html/page257.html

    Regards,

    Paul McKenzie

  5. #5
    Join Date
    Sep 2013
    Posts
    4

    Re: Outlining Items in Visual C++

    Good one. Think I got it from here. Thanks

  6. #6
    Join Date
    Apr 1999
    Posts
    27,427

    Re: Outlining Items in Visual C++

    Quote Originally Posted by aww91 View Post
    Good one. Think I got it from here. Thanks
    Good. The link discusses a lot of mathematical aspects of trees, but I think it isn't important for what you're trying to accomplish, at least at the moment.

    Basically you want to design a tree that is 5 (or 6) levels deep, with n nodes per leaf (the extra level is the root node). You need to know how to insert, remove, and search for an item in the tree. Sounds no different than the usual college CS assignment (is this a school assignment?).

    Regards,

    Paul McKenzie

  7. #7
    Join Date
    Sep 2013
    Posts
    4

    Re: Outlining Items in Visual C++

    Nope, just doing some stuff on my own.

    Best Regards,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center