Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. What is the Best Way to Parse and Store User Input from a CTreeCtrl Dialog?

What is the Best Way to Parse and Store User Input from a CTreeCtrl Dialog?

Scheduled Pinned Locked Moved C / C++ / MFC
cssdata-structuresquestionc++
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stuck At Zero
    wrote on last edited by
    #1

    I'm trying to build an app which displays proprietary binary data on a virtual grid. Since the number of rows can be in the millions, I'm trying to implement a way to filter out the undesired data. I was asked to prompt users to select filtering by way of a tree control. My tree is 4 levels deep. At the root level, I have 8 nodes (called Bus). Each bus has 32 children nodes (called RT #). Each RT node has 2 children nodes (called Transmit / Receive). Each Transmit and Receive node has 32 children nodes (called MSG #). So top-down, my tree is essentially 8 x 32 x 2 x 32 nodes. I have been asked to also implement this tree in such a fashion that if the user only selects a particular parent node and does not select any child node beneath this parent node, that this is to mean a wild card for all descendant nodes beneath that selected parent node. I am doing things in MFC and it seems I cannot do a bit array. I've tried using a 4 dimensional bool array but I am forced to store true / false values utilizing all 4 dimensions (which makes it impossible to store the wildcard condition mentioned above for anything less than 4 dimensions.) What is the best way to encapsulate the user-defined filtering right before I am about to parse through a source file on-the-fly?

    M 1 Reply Last reply
    0
    • S Stuck At Zero

      I'm trying to build an app which displays proprietary binary data on a virtual grid. Since the number of rows can be in the millions, I'm trying to implement a way to filter out the undesired data. I was asked to prompt users to select filtering by way of a tree control. My tree is 4 levels deep. At the root level, I have 8 nodes (called Bus). Each bus has 32 children nodes (called RT #). Each RT node has 2 children nodes (called Transmit / Receive). Each Transmit and Receive node has 32 children nodes (called MSG #). So top-down, my tree is essentially 8 x 32 x 2 x 32 nodes. I have been asked to also implement this tree in such a fashion that if the user only selects a particular parent node and does not select any child node beneath this parent node, that this is to mean a wild card for all descendant nodes beneath that selected parent node. I am doing things in MFC and it seems I cannot do a bit array. I've tried using a 4 dimensional bool array but I am forced to store true / false values utilizing all 4 dimensions (which makes it impossible to store the wildcard condition mentioned above for anything less than 4 dimensions.) What is the best way to encapsulate the user-defined filtering right before I am about to parse through a source file on-the-fly?

      M Offline
      M Offline
      Member 754960
      wrote on last edited by
      #2

      Why not bitfields?

      struct filter
      {
      unsigned Bus : 3; // range : 0 - 7
      unsigned Route : 5; // range : 0 - 31
      unsigned Xmit : 1; // range : 0 - 1 // constraint: exclusive with Rcv
      unsigned Rcv : 1; // range : 0 - 1 // constraint: exclusive with Xmit
      unsigned Msg : 5; // range : 0 - 31
      unsigned dummy : 1; // padding to 16 bits
      };

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups