Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
3.3 KiB

  1. NT User Interface
  2. Design Overview
  3. N-Level Outline Listbox
  4. Kevin LaChapelle (KevinL)
  5. Revision 0.5 10/06/91
  6. 1. SCOPE
  7. This document provides a general design overview of the N-Level
  8. Outline listbox design.
  9. 2. REFERENCES
  10. BLT Specification
  11. 3. OVERVIEW
  12. The current design for the OLB does not contain a data structure
  13. other than that of the underlying windows listbox. This has
  14. proven to be inadequate for a n-level implementation for several
  15. reasons that are not discussed here. The key area that needed
  16. improvement was how to insert an element into the listbox and have it
  17. placed in the proper location. The reason that this has proven
  18. difficult is because it is possible for elements to have identical
  19. "parent" values. (In the case of Multiple networks the server/domain
  20. names can be identical across domains).
  21. The solution to this problem is to have an underlying data
  22. structure that takes the form of a tree. Specifically one that has
  23. the following structure:
  24. LBI * plbi
  25. BOOL fShowChildren // Display children (if any)
  26. NODE * pnParent // Parent
  27. NODE * pnChild // First Child
  28. NODE * pnLeft // Left and Right
  29. NODE * pnRight // Siblings
  30. The benefits of using a tree are many:
  31. - You will always know based upon your location in the tree
  32. what index in the listbox you are. (The tree is always sorted, and
  33. thus provides a way to easily count the path from the root.)
  34. - This allows for easy preservation of selection across refreshes.
  35. - Easy way for to purge unwanted data from memory.
  36. For example: If someone expands a node, then chooses
  37. to collapse that node. A pointer to that node could be entered into
  38. a list for cleanup. This list would contain pointers to parents
  39. whose children were no longer visible and after an appropriate time
  40. delay that information would be purged. Of course at the moment it
  41. would be too dificult to delete anything more than one level of
  42. expansion because if the user happens to expand that node again we
  43. must present the same expansion as was there before.
  44. EXAMPLE:
  45. ABLE TO PURGE:
  46. domain
  47. server
  48. server
  49. server
  50. server
  51. server
  52. domain1
  53. domain is collapsed
  54. domain
  55. domain1
  56. after a period of time all of the servers are purged. If the user
  57. expands domain then we reload the servers.
  58. UNABLE TO PURGE:
  59. domain
  60. server
  61. server
  62. server
  63. share
  64. share
  65. share
  66. server
  67. server
  68. domain1
  69. domain is collapsed
  70. domain
  71. domain1
  72. after a period of time the servers can't be purged because we would
  73. then have to remember the level of expansion of each server because
  74. if the user re-expands domain, then we should show what was there
  75. before the initial collapse.
  76. 4. CLASS HEIRARCHY
  77. The C++ classes for implementing the OLB is as follows:
  78. LB_TREE
  79. LBNODE
  80. LBI
  81. 5. CLASS DETAILS
  82. T.B.F.I
  83. 6. OPERATION
  84. 7. OPEN ISSUES
  85. 8. REVISION HISTORY
  86. Who When What
  87. --- ---- ----
  88. KevinL 10/06/1991 Created this document.