User interface component management method and system

By defining the class used to respond to the trigger signal of entity keys in the user interface, and setting the component type and number of the manipulating components based on hierarchical relationships, dynamically multiplexing subcomponents, integrating control logic and touch control logic, the problem of insufficient code redundancy and flexibility in the prior art is solved, and more efficient user interface component management is achieved.

CN119759346APending Publication Date: 2025-04-04FUJIAN NEBULA ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411701449.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

In the design of existing user interface components, the logic of physical keys and touch control is separated, resulting in redundancy of code, reducing maintainability and reusability, and lacking flexibility.

Method used

By defining the class used to respond to the trigger signal of entity keys in the user interface, and setting the component type and number of the manipulating component based on hierarchical relationships, dynamically multiplexing subcomponents, integrating control logic and touch control logic, avoiding repeated writing of control logic.

Benefits of technology

Improves the maintainability, reusability and flexibility of user interface components, reduces code redundancy, and achieves more flexible and efficient physical key control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759346A_ABST
    Figure CN119759346A_ABST
Patent Text Reader

Abstract

The present invention provides a user interface component management method and system in the field of computer technology, the method comprising: step S1, defining a class for responding to a trigger signal of a physical key, setting the parameters of each class; step S2, creating several control components and a connection component, connecting each class and the control component based on the connection component; step S3, setting the component type of each control component, the component type is a parent component or a child component; step S4, setting the custom attributes and parent attributes of each control component, setting the component number of each control component, and binding each class to the corresponding component number; step S5, setting the control logic of each control component and writing it into the corresponding control component; step S6, the user interface manages the control component based on the class, component type, custom attribute, parent attribute, and component number. The advantages of the present invention are: greatly improving the maintainability, reusability and flexibility of the user interface component.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a user interface component management method and system. Background Art

[0002] In user interface design, components are often required to support both physical buttons and touch control to provide a more flexible interaction method. Traditionally, for the design of components in user interfaces, the same physical button control logic is often required to be written for each place where the same component is used, and the physical button control logic is separated from the touch control logic, resulting in code redundancy, reduced code maintainability and reusability, and lack of flexibility.

[0003] Therefore, how to provide a user interface component management method and system to improve the maintainability, reusability and flexibility of user interface components has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a user interface component management method and system to improve the maintainability, reusability and flexibility of the user interface components.

[0005] In a first aspect, the present invention provides a method for managing a user interface component, comprising the following steps:

[0006] Step S1: In the user interface, based on C++, define several classes for responding to trigger signals of physical keys, and set the parameters of each class based on the key type of the physical key;

[0007] Step S2: creating a plurality of manipulation components and a connection component, and connecting various types of corresponding manipulation components based on the connection component;

[0008] Step S3: setting the component type of each control component based on the hierarchical relationship, wherein the component type is a parent component or a child component;

[0009] Step S4, setting the custom attributes and parent attributes of each of the control components, setting the component number of each of the control components based on the component type, the component number being the parent component number or the child component number, and binding each of the classes to the corresponding component number;

[0010] Step S5, setting the control logic of each control component, and writing each control logic into the corresponding control component;

[0011] Step S6: The user interface manages each of the control components based on the class, component type, custom attribute, parent attribute and component number.

[0012] Furthermore, in step S2, the control component is used to perform a preset operation according to a trigger signal of a physical key, or to perform a preset operation based on a touch control signal.

[0013] Furthermore, in step S3, the subcomponent is the parent component of the next level subcomponent.

[0014] Furthermore, in step S4, the component type is a control component of a subcomponent, and based on a trigger signal of a preset physical button, the subcomponent number is adjusted to a corresponding parent component number.

[0015] Furthermore, in step S4, the component number of each control component is set based on the component type as follows:

[0016] A numbering rule is set, and the component number of each control component is set based on the component type and the numbering rule. The sub-component number is dynamically adjusted based on the numbering rule and reuse requirements, so as to dynamically reuse the sub-components under the parent component based on the sub-component number.

[0017] In a second aspect, the present invention provides a user interface component management system, comprising the following modules:

[0018] A class definition module is used to define several classes for responding to trigger signals of physical keys in the user interface based on C++, and to set the parameters of each class based on the key type of the physical key;

[0019] A component connection module, used to create a plurality of manipulation components and a connection component, and connect various types of corresponding manipulation components based on the connection component;

[0020] A component type setting module, used to set the component type of each of the control components based on a hierarchical relationship, wherein the component type is a parent component or a child component;

[0021] A component number setting module, used to set the custom attributes and parent attributes of each of the control components, set the component number of each control component based on the component type, the component number is the parent component number or the child component number, and bind each of the classes to the corresponding component number;

[0022] A control logic setting module, used to set the control logic of each of the control components and write each of the control logics into the corresponding control component;

[0023] The component management module is used for the user interface to manage each of the control components based on the class, component type, custom attribute, parent attribute and component number.

[0024] Furthermore, in the component connection module, the control component is used to perform a preset operation according to a trigger signal of a physical key, or to perform a preset operation based on a touch control signal.

[0025] Furthermore, in the component type setting module, the subcomponent is the parent component of the next level subcomponent.

[0026] Furthermore, in the component number setting module, the component type is a control component of a subcomponent, and based on a trigger signal of a preset physical button, the subcomponent number is adjusted to the corresponding parent component number.

[0027] Furthermore, in the component number setting module, the component number of each control component is set based on the component type as follows:

[0028] A numbering rule is set, and the component number of each control component is set based on the component type and the numbering rule. The sub-component number is dynamically adjusted based on the numbering rule and reuse requirements, so as to dynamically reuse the sub-components under the parent component based on the sub-component number.

[0029] The advantages of the present invention are:

[0030] In the user interface, several classes for responding to trigger signals of physical buttons are defined based on C++, and the parameters of each category are set based on the button type of the physical button; then several control components and a connection component are created, and each category and corresponding control component are connected based on the connection component, and the component type of each control component is set based on the hierarchical relationship, and the component type is a parent component or a child component; then the custom properties and parent properties of each control component are set, and the component number of each control component is set based on the component type, and the component number is the parent component number or the child component number, and each category is bound to the corresponding component number; then the control logic of each control component is set, and each The control logic is written into the corresponding control component, and finally the user interface manages each control component based on the class, component type, custom attribute, parent attribute and component number. Since a component number is set for each control component, the related sub-components can be dynamically reused based on the component number, and the control logic is written into each control component, that is, the control logic and touch control logic of the touch control are integrated in the control component to avoid repeated writing of the control logic of reused sub-components to reduce code redundancy, and based on the component type, the control components can be flexibly nested, combined and other operations, which ultimately greatly improves the maintainability, reusability and flexibility of the user interface components. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.

[0032] Figure 1It is a flow chart of a user interface component management method of the present invention.

[0033] Figure 2 It is a structural schematic diagram of a user interface component management system of the present invention. DETAILED DESCRIPTION

[0034] The technical solution in the embodiments of the present application has the following overall idea: a component number is set for each control component, and related sub-components are subsequently dynamically reused based on the component number, and control logic is written into each control component, that is, the control logic and touch control logic of the touch control are integrated in the control component to avoid repeated writing of the control logic of reused sub-components to reduce code redundancy, and based on the component type, the control components can be flexibly nested, combined, and other operations, thereby improving the maintainability, reusability, and flexibility of the user interface components.

[0035] Please refer to Figure 1 to Figure 2 As shown, a preferred embodiment of a user interface component management method of the present invention comprises the following steps:

[0036] Step S1: In the user interface, based on C++, define several classes for responding to trigger signals of physical keys, and set the parameters of each class based on the key type of the physical key; in specific implementation, the parameters can be set as needed, such as page up, page down, confirm or return;

[0037] Step S2, creating several control components and a connection component, connecting various types and corresponding control components based on the connection component; when the class senses the trigger signal of the physical button, it will send the corresponding parameter to the connected control component, that is, when the physical button is pressed, the corresponding signal slot function will be triggered;

[0038] Step S3: setting the component type of each control component based on the hierarchical relationship, wherein the component type is a parent component or a child component;

[0039] Step S4, setting the custom attribute (myId) and parent attribute (parent Id) of each of the control components, setting the component number (current Id) of each control component based on the component type, the component number is the parent component number or the child component number, and binding each of the classes to the corresponding component number; the custom attribute and parent attribute are used to describe the characteristics and status of the control component; the custom attribute can be set as needed, such as customizing the enable attribute of an "OK" button, when set to false, the "OK" button is ineffective, or customizing the control strategy of the button, such as combination key control, etc.; the parent attribute is used to manage the relationship between the child component and the parent component through a hierarchical relationship;

[0040] When the parent component receives the trigger signal of the physical key, it executes the corresponding key event and sets the current component number as the component number for the subsequent key to take effect;

[0041] When the class sends a trigger signal of a physical key, the corresponding subcomponent will also receive the trigger signal and determine whether the current component number is equal to its own component number. If they are equal, the corresponding key event will be executed, otherwise no action will be taken, so that the key logics between the control components are not affected by each other;

[0042] Step S5, setting the control logic of each control component, and writing each control logic into the corresponding control component; the control component also integrates the touch control logic; by writing the control logic into the control component, it is possible to avoid repeatedly writing the same control logic in each place where the control component is used, effectively improving the maintainability and reusability of the code, and realizing more flexible and efficient physical key control;

[0043] Step S6: The user interface manages each of the control components based on the class, component type, custom attribute, parent attribute and component number.

[0044] In the step S2, the control component is used to perform a preset operation according to a trigger signal of a physical key, or to perform a preset operation based on a touch control signal.

[0045] In step S3, the subcomponent is the parent component of the next-level subcomponent, that is, the control components can be flexibly nested, combined and interacted at multiple levels to provide a better user experience and improve the scalability and maintainability of the user interface.

[0046] In step S4, the control component of the component type is a subcomponent, and based on the trigger signal of the preset physical key, the subcomponent number is adjusted to the corresponding parent component number. For example, based on the trigger signal of the return key, the subcomponent number is adjusted to the corresponding parent component number, and the key action is not effective for the subcomponent.

[0047] In the step S4, the component number of each control component is set based on the component type as follows:

[0048] A numbering rule is set, and the component number of each control component is set based on the component type and the numbering rule. The sub-component number is dynamically adjusted based on the numbering rule and reuse requirements, so as to dynamically reuse the sub-components under the parent component based on the sub-component number, so that the control logics between the sub-components are not affected by each other. Developers do not need to write the control logic of the reused sub-components, but only need to set their own custom properties and parent properties. When the parent component receives the trigger signal of the relevant physical button, it assigns the current component number to the component number of the sub-component to be pointed to.

[0049] The numbering rule is specifically: assigning a parent component number to a parent component, assigning a subcomponent number to a subcomponent, and dynamically adjusting the subcomponent number of a subcomponent reused under a parent component; in specific implementation, the component number can be managed using a hexadecimal conversion relationship, for example, the parent component number is 0x06, and the subcomponent number is 0x601, so that the association relationship between the parent component and the subcomponent can be found at a glance;

[0050] That is, a corresponding component number is set for each of the control components, and the sub-component number is associated with the corresponding parent component number to achieve more flexible user interface interaction and control component management.

[0051] A preferred embodiment of a user interface component management system of the present invention includes the following modules:

[0052] A class definition module is used to define several classes for responding to trigger signals of physical keys in the user interface based on C++, and to set the parameters of each class based on the key type of the physical key; in specific implementation, the parameters can be set as needed, such as page up, page down, confirm or return;

[0053] The component connection module is used to create several control components and a connection component, and connect various types and corresponding control components based on the connection component; when the class senses the trigger signal of the physical button, it will send the corresponding parameter to the connected control component, that is, when the physical button is pressed, the corresponding signal slot function will be triggered;

[0054] A component type setting module, used to set the component type of each of the control components based on a hierarchical relationship, wherein the component type is a parent component or a child component;

[0055] A component number setting module is used to set the custom attribute (myId) and parent attribute (parent Id) of each control component, and to set the component number (current Id) of each control component based on the component type. The component number is the parent component number or the child component number, and each class is bound to the corresponding component number; the custom attribute and parent attribute are used to describe the characteristics and status of the control component; the custom attribute can be set as needed, such as customizing the enable attribute of an "OK" button. When set to false, the "OK" button is ineffective, or the control strategy of the button can be customized, such as combination key control, etc.; the parent attribute is used to manage the relationship between the child component and the parent component through a hierarchical relationship;

[0056] When the parent component receives the trigger signal of the physical key, it executes the corresponding key event and sets the current component number as the component number for the subsequent key to take effect;

[0057] When the class sends a trigger signal of a physical key, the corresponding subcomponent will also receive the trigger signal and determine whether the current component number is equal to its own component number. If they are equal, the corresponding key event will be executed, otherwise no action will be taken, so that the key logics between the control components are not affected by each other;

[0058] A control logic setting module, used to set the control logic of each of the control components, and write each of the control logics into the corresponding control component; the control component also integrates the touch control logic; by writing the control logic into the control component, it is possible to avoid repeatedly writing the same control logic in each place where the control component is used, effectively improving the maintainability and reusability of the code, and realizing more flexible and efficient physical key control;

[0059] The component management module is used for the user interface to manage each of the control components based on the class, component type, custom attribute, parent attribute and component number.

[0060] In the component connection module, the control component is used to perform a preset operation according to a trigger signal of a physical key, or to perform a preset operation based on a touch control signal.

[0061] In the component type setting module, the subcomponent is the parent component of the next-level subcomponent, so that the control components can be flexibly nested, combined and interacted at multiple levels to provide a better user experience and improve the scalability and maintainability of the user interface.

[0062] In the component number setting module, the component type is a control component of a subcomponent, and based on the trigger signal of a preset physical key, the subcomponent number is adjusted to the corresponding parent component number. For example, based on the trigger signal of the return key, the subcomponent number is adjusted to the corresponding parent component number, and the key action is not effective for the subcomponent.

[0063] In the component number setting module, the component number of each control component is set based on the component type as follows:

[0064] A numbering rule is set, and the component number of each control component is set based on the component type and the numbering rule. The sub-component number is dynamically adjusted based on the numbering rule and reuse requirements, so as to dynamically reuse the sub-components under the parent component based on the sub-component number, so that the control logics between the sub-components are not affected by each other. Developers do not need to write the control logic of the reused sub-components, but only need to set their own custom properties and parent properties. When the parent component receives the trigger signal of the relevant physical button, it assigns the current component number to the component number of the sub-component to be pointed to.

[0065] The numbering rule is specifically: assigning a parent component number to a parent component, assigning a subcomponent number to a subcomponent, and dynamically adjusting the subcomponent number of a subcomponent reused under a parent component; in specific implementation, the component number can be managed using a hexadecimal conversion relationship, for example, the parent component number is 0x06, and the subcomponent number is 0x601, so that the association relationship between the parent component and the subcomponent can be found at a glance;

[0066] That is, a corresponding component number is set for each of the control components, and the sub-component number is associated with the corresponding parent component number to achieve more flexible user interface interaction and control component management.

[0067] In summary, the advantages of the present invention are:

[0068] In the user interface, several classes for responding to trigger signals of physical buttons are defined based on C++, and the parameters of each category are set based on the button type of the physical button; then several control components and a connection component are created, and each category and corresponding control component are connected based on the connection component, and the component type of each control component is set based on the hierarchical relationship, and the component type is a parent component or a child component; then the custom properties and parent properties of each control component are set, and the component number of each control component is set based on the component type, and the component number is the parent component number or the child component number, and each category is bound to the corresponding component number; then the control logic of each control component is set, and each The control logic is written into the corresponding control component, and finally the user interface manages each control component based on the class, component type, custom attribute, parent attribute and component number. Since a component number is set for each control component, the related sub-components can be dynamically reused based on the component number, and the control logic is written into each control component, that is, the control logic and touch control logic of the touch control are integrated in the control component to avoid repeated writing of the control logic of reused sub-components to reduce code redundancy, and based on the component type, the control components can be flexibly nested, combined and other operations, which ultimately greatly improves the maintainability, reusability and flexibility of the user interface components.

[0069] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.

Claims

1. A user interface component management method, characterized in that: The steps include: Step S1: In the user interface, based on C++, define several classes for responding to trigger signals of physical keys, and set the parameters of each class based on the key type of the physical key; Step S2: creating a plurality of manipulation components and a connection component, and connecting various types of corresponding manipulation components based on the connection component; Step S3: setting the component type of each control component based on the hierarchical relationship, wherein the component type is a parent component or a child component; Step S4, setting the custom attributes and parent attributes of each of the control components, setting the component number of each of the control components based on the component type, the component number being the parent component number or the child component number, and binding each of the classes to the corresponding component number; Step S5, setting the control logic of each control component, and writing each control logic into the corresponding control component; Step S6: The user interface manages each of the control components based on the class, component type, custom attribute, parent attribute and component number.

2. A user interface component management method as claimed in claim 1, characterized in that: In the step S2, the control component is used to perform a preset operation according to a trigger signal of a physical key, or to perform a preset operation based on a touch control signal.

3. A user interface component management method as claimed in claim 1, characterized in that: In step S3, the subcomponent is the parent component of the next level subcomponent.

4. A user interface component management method as claimed in claim 1, characterized in that: In step S4, the component type is a control component of a subcomponent, and based on a trigger signal of a preset physical button, the subcomponent number is adjusted to the corresponding parent component number.

5. A user interface component management method as claimed in claim 1, characterized in that: In the step S4, the component number of each control component is set based on the component type as follows: A numbering rule is set, and the component number of each control component is set based on the component type and the numbering rule. The sub-component number is dynamically adjusted based on the numbering rule and reuse requirements, so as to dynamically reuse the sub-components under the parent component based on the sub-component number.

6. A user interface component management system, characterized in that: Includes the following modules: A class definition module is used to define several classes for responding to trigger signals of physical keys in the user interface based on C++, and to set the parameters of each class based on the key type of the physical key; A component connection module, used to create a plurality of manipulation components and a connection component, and connect various types of corresponding manipulation components based on the connection component; A component type setting module, used to set the component type of each of the control components based on a hierarchical relationship, wherein the component type is a parent component or a child component; A component number setting module, used to set the custom attributes and parent attributes of each of the control components, set the component number of each control component based on the component type, the component number is the parent component number or the child component number, and bind each of the classes to the corresponding component number; A control logic setting module, used to set the control logic of each of the control components and write each of the control logics into the corresponding control component; The component management module is used for the user interface to manage each of the control components based on the class, component type, custom attribute, parent attribute and component number.

7. A user interface component management system as claimed in claim 6, characterized in that: In the component connection module, the control component is used to perform a preset operation according to a trigger signal of a physical key, or to perform a preset operation based on a touch control signal.

8. A user interface component management system as claimed in claim 6, characterized in that: In the component type setting module, the subcomponent is the parent component of the next level subcomponent.

9. A user interface component management system as claimed in claim 6, characterized in that: In the component number setting module, the component type is a control component of a subcomponent, and based on a trigger signal of a preset physical button, the subcomponent number is adjusted to the corresponding parent component number.

10. A user interface component management system as claimed in claim 6, characterized in that: In the component number setting module, the component number of each control component is set based on the component type as follows: A numbering rule is set, and the component number of each control component is set based on the component type and the numbering rule. The sub-component number is dynamically adjusted based on the numbering rule and reuse requirements, so as to dynamically reuse the sub-components under the parent component based on the sub-component number.