Discussion of article "DoEasy. Controls (Part 14): New algorithm for naming graphical elements. Continuing work on the TabControl WinForms object"

 

New article DoEasy. Controls (Part 14): New algorithm for naming graphical elements. Continuing work on the TabControl WinForms object has been published:

In this article, I will create a new algorithm for naming all graphical elements meant for building custom graphics, as well as continue developing the TabControl WinForms object.

In the last article, when developing the TabControl WinForms object, we encountered a limitation on the length of the name of a graphical element, which prevented us from a full-fledged creation of the object. The name of each child graphical element, included in the parent, featured a reference to its parent element with the entire hierarchy of all related graphical controls. The name of each subsequent object in this chain was longer than the name of the previous object. As a result, I ran into a limitation on the length of a graphical resource name of 63 characters. Today I will implement a different algorithm for naming graphical elements to eliminate the drawback: each new object of the same type will contain in its name the name of the program, the name of the graphical element type and the number of already existing elements of this type created in the program when building GUI elements.

For example, when creating GUI elements for the test program of this article, we got the following list of graphical elements (only the first part of all constructed elements is visible, but this is enough to understand the accepted concept):


Thus, now we will not have any restrictions on the nesting of objects when creating controls. Instead of displaying a hierarchy in the name of a graphical element, we will simply use the element index with the program name and control type.

Author: Artyom Trishkin

Reason: