TreeView + DataList = TreeList

The TreeView and the DataList objects are two of the most commonly used UI objects in conzept 16 for visualizing dynamically generated data.

The TreeView object is primarily used to display hierarchical structures. The DataList object, on the other hand, is mainly used to display equivalent but more detailed information.

In this article, I would like to introduce you to a Modul that extends a DataList object with the features of a TreeView object.

TreeView

The main advantage of a tree view over a list view is that it allows users to hide information that is irrelevant to them by collapsing individual branches of the tree. In addition, the tree view makes it very easy to visualize hierarchies or dependencies in the data.

TreeView-Objekt

DataList Object

Typically, the information contained in a single element within a TreeView object is limited to a small amount of data, such as the element’s name. In a DataList object, however, the information for a single element can be divided into any number of columns.

DataList-Objekt

TreeList

The “MdlTreeList” module extends the DataList object with the benefits of the TreeView object: the ability to collapse individual elements and the easy visualization of hierarchical structures.

TreeList-Objekt

Additional columns within the DataList object are required to store the hierarchy and display the icons. With conzept 16 version 5.7.05 and the dynamic columns, the module can create and delete these columns automatically.

The module’s interface is based on the functions of the TreeView and DataList objects. Here is an excerpt:

LineAdd // Add a Line
(
  aVarOrLineParent      : handle;       // Instance or Parent Line
  opt aCaption          : alpha(4096);  // Title
  opt aImage            : int;          // Image “collapsed” (_Win.TreeListImage...)
  opt aImageExp         : int;          // Image “expanded” (_Win.TreeListImage...)
  opt aLineNext         : handle;       // Next Line
)
: handle;                               // Line

LineRemove // Remove line
(
  aLine                 : handle;       // Line
  opt aChildrenOnly     : logic;        // Remove only Child Lines
)

LineCaptionSet // Titel setzen
(
  aLine                 : handle;       // Line
  aCaption              : alpha(4096);  // Titel
)

LineImageSet // Insert image
(
  aLine                 : handle;       // Line
  aImage                : int;          // Image “collapsed” (_Win.TreeListImage...)
  opt aImageExp         : int;          // Image “expanded” (_Win.TreeListImage...)
)

LineExpand // Expand Line
(
  aLine                 : handle;       // Line
)

LineCollapse // Zeile zuklappen
(
  aLine                 : handle;       // Line
)

LineDynamicSet // Ensure that Child Lines are dynamically added or removed (when expanding or collapsing)
(
  aLine                 : handle;       // Line
  aDynamic              : logic;        // Child Lines are added dynamically
)

CellSetA // Zelle setzen (Typ: alpha)
(
  aLine                 : handle;       // Line
  aColumnNo             : int;          // Column number
  aValue                : alpha(4096);  // Value
)

// Set EvtFold event - Triggered before a line is expanded or collapsed.
EventFoldSet
(
  aVar                  : handle;       // Instance
  aEvt                  : alpha(61);    // Function
)
Example
...
@I:MdlWinTreeListInc

...
// Initialize the TreeList object
tTreeList # MdlWinTreeList:Init(
  $dlDataList,        // DataList-Objekt
  5,                  // Number of image columns in the DataList object
  1,                  // Column number for title
);
// Add a line to the list
tTreeLine # tTreeList->MdlWinTreeList:LineAdd(‘Folder 1’, _Win.TreeListImageFolder);
// Add a Child Line to the line
tTreeLine # tTreeLine->MdlWinTreeList:LineAdd(‘Document 1’, _Win.TreeListImageDocument);
// Set the 2nd cell
tTreeLine->MdlWinTreeList:CellSetA(2, ‘Jan. 1’);
// Set the 3rd cell
tTreeLine->MdlWinTreeList:CellSetA(3, ‘95 KB’);
...
// Terminate the TreeList object
tTreeList->MdlWinTreeList:Term();
...

The download link at the end of the article includes not only the module itself but also an example of how to use it.

The module gives developers a great deal of freedom in terms of visual design and also allows them to customize and extend it.


Conclusion

The wide range of surface objects that conzept 16 comes with out of the box can be expanded with your own objects—though this requires some effort, the result is tailored to your specific needs. Incidentally, the Slider-Objekt and the search bar for RTFEdit objects.

Have you developed your own general-purpose objects for your applications that you’d like to showcase here on the conzept 16 blog and share with other developers? We’d love to hear from you =).

Download

Zum downloaden hier klicken MdlWinTreeList.zip (129.13 KB)
Sie müssen angemeldet sein, um die Datei herunterladen zu können.

Klicken Sie hier, um die Nutzungsbedingungen für unseren Blog zu lesen.

Leave a Reply

Your email address will not be published. Required fields are marked *

Leave the field below empty!

Requests, questions or feedback are welcome:

Terms of use of the comment function in the blog

1. General information

Vectorsoft AG (‘Provider’) provides a public blog for Internet users (‘Users’) on the vectorsoft.de website. The public blog is intended for the exchange of information and ideas. Users who participate with contributions and comments undertake to comply with the blog terms of use and are responsible for the accuracy, appropriateness and freedom from legal infringements of their contributions. By using the comment function in our blog, you accept these terms of use.

2. Netiquette

We ask you to refrain from personal attacks and provocations based on other opinions. Please argue objectively and maintain a constructive discussion culture. Your comment should always be related to the topic in question in order to avoid digressions into other topics. Posting the same comment or several similar comments more than once is not permitted.

3. Prohibition of illegal content

By submitting your comment, you confirm that you are not violating any copyrights or other rights of third parties. Inciting, racist statements, instructions for criminal offences and their glorification, depictions of violence, pornographic content and statements that violate personal rights are prohibited.

4. No advertising

The use of the comment function is not permitted for commercial or party-political purposes. Advertising contributions of any kind will be deleted immediately.

5. Details of the name

When entering your name, pay attention to the principles mentioned above.

6. Source references

If you intend to publish quotes or contributions from third parties, please indicate the respective sources and explain how they relate to the blog post.

7. Violation of the terms of use

Posts that violate this policy will be deleted immediately. If you notice any violations yourself, please send us the link to the comment in question by e-mail to . We expressly point out that we will exclude individual users in the event of repeated or serious violations of these terms of use.

As of: Sept. 2024

Get your Trial Version now!

Test yeet free of charge

IHRE EVALUIERUNGSLIZENZ - JETZT ANFORDERN!

TESTEN SIE DIE CONZEPT 16 VOLLVERSION - UNVERBINDLICH und KOSTENFREI

Subscribe to our newsletter

Anrede*
     
Zustimmung zur Datenverarbeitung gem. DSGVO*



WordPress Cookie Notice by Real Cookie Banner