CN114371901A - Method and system for self-defining attribute adaptation format of interface control - Google Patents

Method and system for self-defining attribute adaptation format of interface control Download PDF

Info

Publication number
CN114371901A
CN114371901A CN202210026193.2A CN202210026193A CN114371901A CN 114371901 A CN114371901 A CN 114371901A CN 202210026193 A CN202210026193 A CN 202210026193A CN 114371901 A CN114371901 A CN 114371901A
Authority
CN
China
Prior art keywords
attribute
adaptation
file
name
format
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202210026193.2A
Other languages
Chinese (zh)
Inventor
刘德建
柳旭辉
汪松
李佳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Tianqing Online Interactive Technology Co Ltd
Original Assignee
Fujian Tianqing Online Interactive Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Tianqing Online Interactive Technology Co Ltd filed Critical Fujian Tianqing Online Interactive Technology Co Ltd
Priority to CN202210026193.2A priority Critical patent/CN114371901A/en
Publication of CN114371901A publication Critical patent/CN114371901A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)
  • User Interface Of Digital Computer (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The invention provides a method for self-defining attribute adaptation format of an interface control, which comprises the following steps: step S1, drawing an interface control in the user interface; step S2, setting custom attributes for the interface control; step S3, compiling an attribute adaptation table and storing the attribute adaptation table into an attribute adaptation file; step S4, when setting custom attribute for the interface control, reading the attribute adaptation file, adapting the corresponding attribute format; step S5, setting corresponding attribute values for interface controls of different attribute formats; the method improves the efficiency of the user for editing the interface control.

Description

Method and system for self-defining attribute adaptation format of interface control
Technical Field
The invention relates to the technical field of interface controls, in particular to a method and a system for customizing a property adaptation format of an interface control.
Background
In the editing of the user interface, the attribute setting of most interface controls is set by judging the type according to the attribute name, and generally, when the attribute bar is directly set at the beginning, the attribute of the corresponding format is set for the specific interface control. If the user adds the self-defined attribute later, the format is uniformly set to be the character string format. Thus, although it is ensured that the user can input data to set the attributes, the corresponding auxiliary tool setting attributes cannot be added (for example, a color palette is added when setting colors; a picture selection interface is added when setting pictures) because the different formats of different attributes cannot be used, and attribute format matching is performed, which makes it inconvenient for the user to set the attributes.
The prior art mainly has the following defects: when the user-defined attribute is set, the uniform character string format is used, so that the value to be set for the attribute cannot be accurately judged, and the format of the set value cannot be correctly matched. If some attributes need to be set as floating point values or integer values, but because of the string format, support inputting strings of english and the like, it will cause errors in setting values. If the set attribute is a font, because the custom attribute displays a character string, it cannot know which fonts are supported by the text of the interface control, and if the set font does not exist or is in a wrong format, the font cannot be correctly set. For setting some color attributes, it is necessary to know the corresponding format, some color formats are RGBA, some color formats are ARGB, and some color formats are only RGB, so that a specific attribute format cannot be accurately set. In addition, for the picture attribute, it is desirable to preview the picture when selecting the picture, so that it is ensured that the set picture and the selected picture are consistent.
Disclosure of Invention
In order to overcome the above problems, an object of the present invention is to provide a method for interface control custom property adaptation format, so that the property setting can set the property value according to the specific property format, instead of setting the property to the character string format as common setting custom property, and the efficiency of the user editing interface is improved.
The invention is realized by adopting the following scheme: a method for self-defining attribute adaptation format of interface control, the method includes the following steps:
step S1, drawing an interface control in the user interface;
step S2, setting custom attributes for the interface control;
step S3, compiling an attribute adaptation table and storing the attribute adaptation table into an attribute adaptation file;
step S4, when setting custom attribute for the interface control, reading the attribute adaptation file, adapting the corresponding attribute format;
and step S5, setting corresponding attribute values for the interface controls in different attribute formats.
Further, the step S1 is further specifically: writing an interface control in a user interface, and drawing the control by setting the position, the size and the type of the interface control; the set control is defaulted to be a rectangular frame, and frame pictures, background pictures, display texts and basic attributes required by the control are added according to the type of the control to further render the control.
Further, the step S3 is further specifically: the written custom attribute can support different types of attribute formats, and the attribute formats comprise: a floating point value attribute, a Boolean value attribute, a color value attribute, a font attribute, and a three-dimensional vector attribute; writing a property adaptation table, wherein the property adaptation table consists of four parts, the first part is ID which represents the serial number of the property table, the second part is a property Name, the third part is a property format Type which needs to be set, and the fourth part is a specific control Type Name Widget which needs to be set; in the attribute adaptation table, after the attribute Name, the attribute format Type and the specific control Type Name Widget of each item of the attribute adaptation table are written, a attribute adaptation file is stored to form, the attribute adaptation file mainly comprises attribute items, the content of the attribute adaptation file corresponds to the content of the attribute adaptation table one by one, and the content of the attribute adaptation file also comprises the attribute Name, the attribute format Type and the specific control Type Name Widget of each attribute adaptation item.
Further, the step S4 is further specifically: matching according to the attribute adaptation file, adapting to a corresponding attribute format, acquiring an attribute type corresponding to the attribute name and a corresponding specific control type name through a process of analyzing the attribute adaptation file, and determining the attribute format corresponding to the custom attribute according to the attribute name and the corresponding specific control type name; the process of analyzing the attribute adaptation file specifically comprises the following steps: the attribute adaptation file is an ini type file, the ini file is composed of sections, keys and values, and all the sections are obtained through an ini file reading mode; the first section of the attribute adaptation file is fixed as MaxID and represents the total number of attribute adaptation items; then the rest section is Property _ id, which represents the content of each attribute adaptation item; the number of the attribute adaptation items is obtained through the MaxID, all sections in the attribute adaptation file are traversed through the number, then the attribute Name, the attribute format Type and the specific control Type Name Widget in each section are obtained, the names of the custom attributes and the obtained attribute names of the attribute adaptation items are compared, whether the names of the custom attributes are equal to each other is judged, if the names of the custom attributes and the attribute names of the specific control Type items are equal to each other, the current attribute adaptation item is matched, the corresponding attribute format and the specific control Type Name are obtained, and the current custom attributes are matched.
Further, the step S5 is further specifically: according to the attribute adaptation file, after all attributes are adapted, setting attribute values corresponding to the attribute formats for the attributes of different formats; after setting the attribute value, the attribute of the interface control can be saved, so that a required user interface file is formed later.
The invention provides a system for self-defining attribute adaptation formats of interface controls, which comprises a drawing module, an attribute setting module, an adaptation file production module, a corresponding matching module and an attribute processing module, wherein the drawing module is used for drawing an interface control;
the drawing module is used for drawing an interface control in a user interface;
the setting attribute module is used for setting custom attributes for the interface control;
the adaptive file production module is used for compiling an attribute adaptive table and storing the attribute adaptive table into an attribute adaptive file;
the corresponding matching module is used for reading the attribute adaptation file and adapting to the corresponding attribute format when the user-defined attribute is set for the interface control;
and the attribute processing module sets corresponding attribute values for the interface controls in different attribute formats.
Further, the implementation manner of the drawing module is further specifically: writing an interface control in a user interface, and drawing the control by setting the position, the size and the type of the interface control; the set control is defaulted to be a rectangular frame, and frame pictures, background pictures, display texts and basic attributes required by the control are added according to the type of the control to further render the control.
Further, the implementation manner of the adaptation file production module is further specifically: the written custom attribute can support different types of attribute formats, and the attribute formats comprise: a floating point value attribute, a Boolean value attribute, a color value attribute, a font attribute, and a three-dimensional vector attribute; writing a property adaptation table, wherein the property adaptation table consists of four parts, the first part is ID which represents the serial number of the property table, the second part is a property Name, the third part is a property format Type which needs to be set, and the fourth part is a specific control Type Name Widget which needs to be set; in the attribute adaptation table, after the attribute Name, the attribute format Type and the specific control Type Name Widget of each item of the attribute adaptation table are written, a attribute adaptation file is stored to form, the attribute adaptation file mainly comprises attribute items, the content of the attribute adaptation file corresponds to the content of the attribute adaptation table one by one, and the content of the attribute adaptation file also comprises the attribute Name, the attribute format Type and the specific control Type Name Widget of each attribute adaptation item.
Further, the implementation manner of the corresponding matching module is further specifically: matching according to the attribute adaptation file, adapting to a corresponding attribute format, acquiring an attribute type corresponding to the attribute name and a corresponding specific control type name through a process of analyzing the attribute adaptation file, and determining the attribute format corresponding to the custom attribute according to the attribute name and the corresponding specific control type name; the process of analyzing the attribute adaptation file specifically comprises the following steps: the attribute adaptation file is an ini type file, the ini file is composed of sections, keys and values, and all the sections are obtained through an ini file reading mode; the first section of the attribute adaptation file is fixed as MaxID and represents the total number of attribute adaptation items; then the rest section is Property _ id, which represents the content of each attribute adaptation item; the number of the attribute adaptation items is obtained through the MaxID, all sections in the attribute adaptation file are traversed through the number, then the attribute Name, the attribute format Type and the specific control Type Name Widget in each section are obtained, the names of the custom attributes and the obtained attribute names of the attribute adaptation items are compared, whether the names of the custom attributes are equal to each other is judged, if the names of the custom attributes and the attribute names of the specific control Type items are equal to each other, the current attribute adaptation item is matched, the corresponding attribute format and the specific control Type Name are obtained, and the current custom attributes are matched.
Further, the attribute processing module is further specifically implemented as follows: according to the attribute adaptation file, after all attributes are adapted, setting attribute values corresponding to the attribute formats for the attributes of different formats; after setting the attribute value, the attribute of the interface control can be saved, so that a required user interface file is formed later.
The invention has the beneficial effects that: the invention can set the corresponding attribute format of the custom attribute of the interface control, correctly adapt the attribute value, is beneficial to increasing the auxiliary tool setting corresponding to the custom attribute, is convenient for the user to edit the custom attribute and improves the efficiency of editing the interface by the user.
Drawings
FIG. 1 is a schematic flow diagram of the process of the present invention.
Fig. 2 is a schematic block diagram of the system of the present invention.
FIG. 3 is a diagram of an attribute adaptation table according to an embodiment of the invention.
FIG. 4 is a diagram illustrating a Boolean type attribute format setting according to an embodiment of the present invention.
FIG. 5 is a diagram illustrating the format of the attribute of the floating point number type according to an embodiment of the present invention.
FIG. 6 is a diagram of a color type attribute format set according to an embodiment of the invention.
Fig. 7 is a diagram illustrating an alignment type attribute format setting according to an embodiment of the present invention.
Fig. 8 is a diagram illustrating a setting of a picture type attribute format according to an embodiment of the invention.
FIG. 9 is a diagram illustrating a three-dimensional vector type property format setup, according to an embodiment of the invention.
Fig. 10 is a diagram illustrating a location attribute type attribute format setting according to an embodiment of the present invention.
FIG. 11 is a diagram of font type property format settings, in accordance with an embodiment of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
The invention provides a method for self-defining attribute adaptation format of an interface control, which comprises the steps of generating a corresponding attribute adaptation file by compiling an attribute adaptation table, reading the attribute format of the corresponding attribute in the attribute adaptation file when the control attribute is bound, setting the attribute into the attribute format, and setting the corresponding attribute value, so that the attribute can be set according to the specific attribute format instead of setting the attribute into a character string format as common custom attribute setting is generally carried out.
As shown in fig. 1, a method for interface control custom property adaptation format includes the following steps:
step S1, drawing an interface control in the user interface;
step S2, setting custom attributes for the interface control;
step S3, compiling an attribute adaptation table and storing the attribute adaptation table into an attribute adaptation file;
step S4, when setting custom attribute for the interface control, reading the attribute adaptation file, adapting the corresponding attribute format;
and step S5, setting corresponding attribute values for the interface controls in different attribute formats.
The invention is further illustrated below with reference to a specific embodiment:
a method for self-defining attribute adaptation format of interface control,
1. drawing interface controls in a user interface
Firstly, a control in a user interface needs to be written, and the control is drawn by setting the position, the size and the type of the control. The default of the set control is a rectangular frame, and then frame pictures, background pictures, display texts and basic attributes required by the control are added according to the type of the control to further render the control. For example, the button control needs to set the background picture, the border picture and the displayed text of the button.
2. Setting custom properties for interface controls
After writing the basic interface control, the user sometimes needs to set some custom properties for the interface control, for example, a button control, and needs to set some custom properties such as Horizontal alignment mode, Vertical alignment mode, TextFont, OutLineColor, and the like for the interface control, which is convenient for further operation of the interface control.
3. Writing attribute adaptation table and storing into attribute adaptation file
The written custom attributes can support different types of attribute formats and can be set to be various attributes such as floating point value attributes, Boolean value attributes, color value attributes, font attributes, three-dimensional vector attributes and the like. However, after the custom attribute is written, only the name of the written custom attribute, which is in a string format, can be obtained, and it is not possible to determine which type of attribute format the custom attribute corresponds to, at this time, the attribute adaptation table needs to be written.
The attribute adaptation table mainly comprises four parts, wherein the first part is a table ID which represents the serial number of the attribute table, the second part is an attribute Name (Name), the third part is an attribute format (Type) which needs to be set, and the fourth part is a specific control Type Name (Widget) which needs to be set. Since different widgets may have the same custom attribute, but the attribute formats are not consistent, for example, an Image widget whose attribute format of the custom attribute ImageColor is FFFFFFFF (ARGB format), which is a simple color attribute. But for the ImageEx control, the attribute format of the custom attribute ImageColor is tl: FFFFFFFF tr: FFFFFFFF bl: FFFFFFFF br: FFFFFFFFFF br (tl represents the upper left color, tr represents the upper right color, bl represents the lower left color, br represents the lower right color), and the custom attribute is a gradient color attribute with four orientations. Because of this, a specific control type name setting is required. If the specific control type name is null, all controls matched with the attribute name are in a set corresponding attribute format, such as the front ImageColor attribute, the attribute type is set to FFFFFF, and the specific control type name is null, so that the set ImageColor attribute type is the simple color attribute of FFFFFF, and no gradient color attribute exists no matter Image or ImageEx; if the specific control type name is set as a specific interface control type, for example, if the ImageColor of the control type of Image is set as a simple color attribute, only the format of the ImageColor attribute of the Image control type is the simple color attribute, and the format of the ImageColor of another control type is not the simple color attribute, but a corresponding attribute format is required to be set.
In the attribute adaptation table, after the attribute name, the attribute format and the specific control type name of the attribute adaptation item (each item of the attribute adaptation table) are written, the attribute adaptation item can be automatically saved into an attribute adaptation file through a program. The attribute adaptation file mainly comprises attribute items, the content of the attribute adaptation file corresponds to the content of the attribute adaptation table one by one, and the content of the attribute adaptation file also comprises the attribute Name, the attribute format Type and the specific control Type Name Widget of each attribute adaptation item.
4. When the user-defined attribute is set for the interface control, reading an attribute adaptation file, and adapting to a corresponding attribute format;
matching according to the attribute adaptation file, adapting to a corresponding attribute format, acquiring an attribute type corresponding to the attribute name and a corresponding specific control type name through a process of analyzing the attribute adaptation file, and determining the attribute format corresponding to the custom attribute according to the attribute name and the corresponding specific control type name; the process of analyzing the attribute adaptation file specifically comprises the following steps: the attribute adaptation file is an ini type file, the ini file is composed of sections, keys and values, and all the sections are obtained through an ini file reading mode; the first section of the attribute adaptation file is fixed as MaxID and represents the total number of attribute adaptation items; then the rest section is Property _ id, which represents the content of each attribute adaptation item; the number of the attribute adaptation items is obtained through the MaxID, all sections in the attribute adaptation file are traversed through the number, then the attribute Name, the attribute format Type and the specific control Type Name Widget in each section are obtained, the names of the custom attributes and the obtained attribute names of the attribute adaptation items are compared, whether the names of the custom attributes are equal to each other is judged, if the names of the custom attributes and the attribute names of the specific control Type items are equal to each other, the current attribute adaptation item is matched, the corresponding attribute format and the specific control Type Name are obtained, and the current custom attributes are matched.
5. Setting corresponding attribute values for interface controls of different attribute formats
And (4) adapting the file according to the attributes, and setting attribute values corresponding to the attribute formats for the attributes in different formats after all the attributes are adapted. Boolean type checkboxes that need to be set to True and False; the floating point type needs to be set into a floating point format, and only floating point numbers can be input; the need for simple color types supports setting Alpha (transparency), Red (Red), Green (Green), Blue (Blue), and palette settings; the gradient color type needs to support setting of the gradient color types in four directions of upper left, lower left, upper right and lower right; the horizontal alignment property needs to be set as a drop-down box that can select "Left", "Center", "Right"; the picture attribute needs to support the selection of pictures, and so on. After setting the attribute value, the attribute of the interface control can be saved, so that a required user interface file is formed later.
As shown in fig. 2, the present invention provides a system for interface control custom attribute adaptation format, which comprises a drawing module, a setting attribute module, an adaptation file production module, a corresponding matching module, and an attribute processing module;
the drawing module is used for drawing an interface control in a user interface; the implementation manner of the drawing module is further specifically as follows: writing an interface control in a user interface, and drawing the control by setting the position, the size and the type of the interface control; the set control is defaulted to be a rectangular frame, and frame pictures, background pictures, display texts and basic attributes required by the control are added according to the type of the control to further render the control.
The setting attribute module is used for setting custom attributes for the interface control; the implementation manner of the attribute setting module is further specifically that: after writing the basic interface control, the user sometimes needs to set some custom properties for the interface control, for example, a button control, and needs to set some custom properties such as Horizontal alignment mode, Vertical alignment mode, TextFont, OutLineColor, and the like for the interface control, which is convenient for further operation of the interface control.
The adaptive file production module is used for compiling an attribute adaptive table and storing the attribute adaptive table into an attribute adaptive file; the implementation mode of the adaptation file production module is further specifically as follows: the written custom attribute can support different types of attribute formats, and the attribute formats comprise: a floating point value attribute, a Boolean value attribute, a color value attribute, a font attribute, and a three-dimensional vector attribute; writing a property adaptation table, wherein the property adaptation table consists of four parts, the first part is ID which represents the serial number of the property table, the second part is a property Name, the third part is a property format Type which needs to be set, and the fourth part is a specific control Type Name Widget which needs to be set; in the attribute adaptation table, after the attribute Name, the attribute format Type and the specific control Type Name Widget of each item of the attribute adaptation table are written, a attribute adaptation file is stored to form, the attribute adaptation file mainly comprises attribute items, the content of the attribute adaptation file corresponds to the content of the attribute adaptation table one by one, and the content of the attribute adaptation file also comprises the attribute Name, the attribute format Type and the specific control Type Name Widget of each attribute adaptation item.
The corresponding matching module is used for reading the attribute adaptation file and adapting to the corresponding attribute format when the user-defined attribute is set for the interface control; the corresponding matching module is further specifically implemented as follows: matching according to the attribute adaptation file, adapting to a corresponding attribute format, acquiring an attribute type corresponding to the attribute name and a corresponding specific control type name through a process of analyzing the attribute adaptation file, and determining the attribute format corresponding to the custom attribute according to the attribute name and the corresponding specific control type name; the process of analyzing the attribute adaptation file specifically comprises the following steps: the attribute adaptation file is an ini type file, the ini file is composed of sections, keys and values, and all the sections are obtained through an ini file reading mode; the first section of the attribute adaptation file is fixed as MaxID and represents the total number of attribute adaptation items; then the rest section is Property _ id, which represents the content of each attribute adaptation item; the number of the attribute adaptation items is obtained through the MaxID, all sections in the attribute adaptation file are traversed through the number, then the attribute Name, the attribute format Type and the specific control Type Name Widget in each section are obtained, the names of the custom attributes and the obtained attribute names of the attribute adaptation items are compared, whether the names of the custom attributes are equal to each other is judged, if the names of the custom attributes and the attribute names of the specific control Type items are equal to each other, the current attribute adaptation item is matched, the corresponding attribute format and the specific control Type Name are obtained, and the current custom attributes are matched.
And the attribute processing module sets corresponding attribute values for the interface controls in different attribute formats. The attribute processing module is further specifically implemented as follows: according to the attribute adaptation file, after all attributes are adapted, setting attribute values corresponding to the attribute formats for the attributes of different formats; after setting the attribute value, the attribute of the interface control can be saved, so that a required user interface file is formed later.
The invention is further described below in connection with an application scenario:
firstly, a control in a user interface needs to be written, and the control is drawn by setting the position, the size and the type of the control. The default of the set control is a rectangular frame, and then frame pictures, background pictures, display texts and basic attributes required by the control are added according to the type of the control to further render the control.
After the basic interface control is written, some custom properties need to be set for the user, for example, a button control needs to be set, and some custom properties such as Horizontal (Horizontal alignment), Vertical (Vertical alignment), TextFont (text font), OutLineColor (outline color) and the like need to be set for the user.
This is some format for setting custom properties (name is property name, initialValue is property initial value, and the property initial value format is string type):
<PropertyDefinition name="Horizontal"initialValue="Center"/>
<PropertyDefinition name="Vertical"initialValue="Stretched"/>
<PropertyDefinition name="OutLineColor"initialValue="FF5F5F69"/>
the written custom attributes can support different types of formats and can be set to be various attributes such as floating point value attributes, Boolean value attributes, color value attributes, font attributes, three-dimensional vector attributes and the like. However, after the custom attribute is written, only the name of the written custom attribute, which is in a string format, can be obtained, and it is not possible to determine which type of attribute format the custom attribute corresponds to, at this time, the attribute adaptation table needs to be written.
The attribute adaptation table mainly comprises four parts, wherein the first part is a table ID which represents the serial number of the attribute table, the second part is an attribute Name (Name), the third part is an attribute format (Type) which needs to be set, and the fourth part is a specific control Type Name (Widget) which needs to be set. Since different widgets may have the same attribute, but the attribute formats are not consistent, for example, an Image widget whose attribute format of the custom attribute ImageColor is FFFFFFFF is a simple color attribute. However, the attribute format of the ImageEx control of the self-defined attribute Imagecolor is tl: FFFFFFFF tr: FFFFFFFF bl: FFFFFFFFFF br: FFFFFFFFFFFF, and the attribute format is a four-azimuth gradient color attribute.
As shown in fig. 3, in the attribute adaptation table, after the attribute name, the attribute format, and the specific control type name of the attribute adaptation item (each item in the attribute adaptation table) are written, the attribute adaptation table can be automatically saved as an attribute adaptation file by a program. The attribute adaptation file mainly comprises attribute items, is in one-to-one correspondence with the attribute adaptation table, and also comprises the attribute name, the attribute format and the specific control type name of each attribute adaptation item. There is initially a MaxID that indicates how many attribute adaptation entries are present in the current attribute adaptation file.
The attribute adaptation file is as follows:
[MaxID]
ID=8
[Property_1]
ID=1
Name=ImageColor
Type=Colour
Widget=
[Property_2]
ID=2
Name=LeftImage
Type=Image
Widget=BtnOk
[Property_3]
ID=3
Name=TextFont
Type=Font
Widget=textAttack
[Property_4]
ID=4
Name=Hori
Type=HorizontalAlignment
Widget=textAttack
[Property_5]
ID=5
Name=IsOpen
Type=Bool
Widget=
[Property_6]
ID=6
Name=Blood
Type=Float
Widget=
[Property_7]
ID=7
Name=Pos
Type=UVector2
Widget=
[Property_8]
ID=8
Name=ShadeColours
Type=ColourRect
Widget=
when setting attributes for the interface control, reading the attribute adaptation file, matching according to the attribute adaptation file, adapting to the corresponding attribute format, and acquiring the attribute type of the corresponding attribute name and the corresponding control name by analyzing and traversing the attribute adaptation file. For example, when traversing the attribute adaptation file, the attribute Name (Name) is "LeftImage", the group of "Property _ 2" is corresponded to, the acquired attribute Type (Type) is "Image" Type, and the acquired control Name (Widget) is "BtnOk".
According to the attribute adaptation file, after all attributes are adapted, attribute values corresponding to attribute formats need to be set for the attributes in different formats, boolean types need to be set as check boxes of True and False, floating point types need to be set as floating point formats, only floating point numbers can be input, color types need to support setting of Alpha (transparency), Red (Red), Green (Green), Blue (Blue) and palette setting, horizontal alignment attributes need to be set as drop-down boxes capable of selecting 'Left', 'Center', 'Right', picture attributes need to support picture selection, and the like. The following are some common attribute format settings. (1) Boolean value type, as shown in fig. 4; (2) floating point number type, as shown in FIG. 5; (3) color type, as shown in FIG. 6; (4) alignment type, as shown in fig. 7; (5) picture type, as shown in fig. 8; (6) three-dimensional vector types, as shown in FIG. 9; (7) location attribute type, as shown in FIG. 10; (8) font type, as shown in FIG. 11;
after setting the attribute value, the attribute of the interface control can be saved, and after all the interface controls are written, the interface file is saved to form the final needed user interface file.
The above description is only a preferred embodiment of the present invention, and all equivalent changes and modifications made in accordance with the claims of the present invention should be covered by the present invention.

Claims (10)

1. A method for self-defining attribute adaptation format of interface control is characterized in that: the method comprises the following steps:
step S1, drawing an interface control in the user interface;
step S2, setting custom attributes for the interface control;
step S3, compiling an attribute adaptation table and storing the attribute adaptation table into an attribute adaptation file;
step S4, when setting custom attribute for the interface control, reading the attribute adaptation file, adapting the corresponding attribute format;
and step S5, setting corresponding attribute values for the interface controls in different attribute formats.
2. The method of claim 1, wherein the method comprises: the step S1 further includes: writing an interface control in a user interface, and drawing the control by setting the position, the size and the type of the interface control; the set control is defaulted to be a rectangular frame, and frame pictures, background pictures, display texts and basic attributes required by the control are added according to the type of the control to further render the control.
3. The method of claim 1, wherein the method comprises: the step S3 further includes: the written custom attribute can support different types of attribute formats, and the attribute formats comprise: a floating point value attribute, a Boolean value attribute, a color value attribute, a font attribute, and a three-dimensional vector attribute; writing a property adaptation table, wherein the property adaptation table consists of four parts, the first part is ID which represents the serial number of the property table, the second part is a property Name, the third part is a property format Type which needs to be set, and the fourth part is a specific control Type Name Widget which needs to be set; in the attribute adaptation table, after the attribute Name, the attribute format Type and the specific control Type Name Widget of each item of the attribute adaptation table are written, a attribute adaptation file is stored to form, the attribute adaptation file mainly comprises attribute items, the content of the attribute adaptation file corresponds to the content of the attribute adaptation table one by one, and the content of the attribute adaptation file also comprises the attribute Name, the attribute format Type and the specific control Type Name Widget of each attribute adaptation item.
4. The method of claim 1, wherein the method comprises: the step S4 further includes: matching according to the attribute adaptation file, adapting to a corresponding attribute format, acquiring an attribute type corresponding to the attribute name and a corresponding specific control type name through a process of analyzing the attribute adaptation file, and determining the attribute format corresponding to the custom attribute according to the attribute name and the corresponding specific control type name; the process of analyzing the attribute adaptation file specifically comprises the following steps: the attribute adaptation file is an ini type file, the ini file is composed of sections, keys and values, and all the sections are obtained through an ini file reading mode; the first section of the attribute adaptation file is fixed as MaxID and represents the total number of attribute adaptation items; then the rest section is Property _ id, which represents the content of each attribute adaptation item; the number of the attribute adaptation items is obtained through the MaxID, all sections in the attribute adaptation file are traversed through the number, then the attribute Name, the attribute format Type and the specific control Type Name Widget in each section are obtained, the names of the custom attributes and the obtained attribute names of the attribute adaptation items are compared, whether the names of the custom attributes are equal to each other is judged, if the names of the custom attributes and the attribute names of the specific control Type items are equal to each other, the current attribute adaptation item is matched, the corresponding attribute format and the specific control Type Name are obtained, and the current custom attributes are matched.
5. The method of claim 1, wherein the method comprises: the step S5 further includes: according to the attribute adaptation file, after all attributes are adapted, setting attribute values corresponding to the attribute formats for the attributes of different formats; after setting the attribute value, the attribute of the interface control can be saved, so that a required user interface file is formed later.
6. A system for interface control custom attribute adaptation format is characterized in that: the system comprises a drawing module, an attribute setting module, an adaptive file production module, a corresponding matching module and an attribute processing module;
the drawing module is used for drawing an interface control in a user interface;
the setting attribute module is used for setting custom attributes for the interface control;
the adaptive file production module is used for compiling an attribute adaptive table and storing the attribute adaptive table into an attribute adaptive file;
the corresponding matching module is used for reading the attribute adaptation file and adapting to the corresponding attribute format when the user-defined attribute is set for the interface control;
and the attribute processing module sets corresponding attribute values for the interface controls in different attribute formats.
7. The system of claim 6, wherein the system comprises: the implementation manner of the drawing module is further specifically as follows: writing an interface control in a user interface, and drawing the control by setting the position, the size and the type of the interface control; the set control is defaulted to be a rectangular frame, and frame pictures, background pictures, display texts and basic attributes required by the control are added according to the type of the control to further render the control.
8. The system of claim 6, wherein the system comprises: the implementation mode of the adaptation file production module is further specifically as follows: the written custom attribute can support different types of attribute formats, and the attribute formats comprise: a floating point value attribute, a Boolean value attribute, a color value attribute, a font attribute, and a three-dimensional vector attribute; writing a property adaptation table, wherein the property adaptation table consists of four parts, the first part is ID which represents the serial number of the property table, the second part is a property Name, the third part is a property format Type which needs to be set, and the fourth part is a specific control Type Name Widget which needs to be set; in the attribute adaptation table, after the attribute Name, the attribute format Type and the specific control Type Name Widget of each item of the attribute adaptation table are written, a attribute adaptation file is stored to form, the attribute adaptation file mainly comprises attribute items, the content of the attribute adaptation file corresponds to the content of the attribute adaptation table one by one, and the content of the attribute adaptation file also comprises the attribute Name, the attribute format Type and the specific control Type Name Widget of each attribute adaptation item.
9. The system of claim 6, wherein the system comprises: the corresponding matching module is further specifically implemented as follows: matching according to the attribute adaptation file, adapting to a corresponding attribute format, acquiring an attribute type corresponding to the attribute name and a corresponding specific control type name through a process of analyzing the attribute adaptation file, and determining the attribute format corresponding to the custom attribute according to the attribute name and the corresponding specific control type name; the process of analyzing the attribute adaptation file specifically comprises the following steps: the attribute adaptation file is an ini type file, the ini file is composed of sections, keys and values, and all the sections are obtained through an ini file reading mode; the first section of the attribute adaptation file is fixed as MaxID and represents the total number of attribute adaptation items; then the rest section is Property _ id, which represents the content of each attribute adaptation item; the number of the attribute adaptation items is obtained through the MaxID, all sections in the attribute adaptation file are traversed through the number, then the attribute Name, the attribute format Type and the specific control Type Name Widget in each section are obtained, the names of the custom attributes and the obtained attribute names of the attribute adaptation items are compared, whether the names of the custom attributes are equal to each other is judged, if the names of the custom attributes and the attribute names of the specific control Type items are equal to each other, the current attribute adaptation item is matched, the corresponding attribute format and the specific control Type Name are obtained, and the current custom attributes are matched.
10. The system of claim 6, wherein the system comprises: the attribute processing module is further specifically implemented as follows: according to the attribute adaptation file, after all attributes are adapted, setting attribute values corresponding to the attribute formats for the attributes of different formats; after setting the attribute value, the attribute of the interface control can be saved, so that a required user interface file is formed later.
CN202210026193.2A 2022-01-11 2022-01-11 Method and system for self-defining attribute adaptation format of interface control Withdrawn CN114371901A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210026193.2A CN114371901A (en) 2022-01-11 2022-01-11 Method and system for self-defining attribute adaptation format of interface control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210026193.2A CN114371901A (en) 2022-01-11 2022-01-11 Method and system for self-defining attribute adaptation format of interface control

Publications (1)

Publication Number Publication Date
CN114371901A true CN114371901A (en) 2022-04-19

Family

ID=81144170

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210026193.2A Withdrawn CN114371901A (en) 2022-01-11 2022-01-11 Method and system for self-defining attribute adaptation format of interface control

Country Status (1)

Country Link
CN (1) CN114371901A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739251A (en) * 2008-11-17 2010-06-16 康佳集团股份有限公司 Method and system for generating interface control
CN102375733A (en) * 2010-08-24 2012-03-14 北大方正集团有限公司 Convenient and quick interface arrangement method
US20160188560A1 (en) * 2014-12-31 2016-06-30 Shih-Hsin Chen Method for creating form validation program and corresponding form interface according to result set metadata
CN108549533A (en) * 2018-04-11 2018-09-18 上海百事灵多媒体科技有限公司 A kind of method that self-defined control is added in EPG pages visual development
CN112988142A (en) * 2021-04-19 2021-06-18 广州南方卫星导航仪器有限公司 Attribute table generation method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739251A (en) * 2008-11-17 2010-06-16 康佳集团股份有限公司 Method and system for generating interface control
CN102375733A (en) * 2010-08-24 2012-03-14 北大方正集团有限公司 Convenient and quick interface arrangement method
US20160188560A1 (en) * 2014-12-31 2016-06-30 Shih-Hsin Chen Method for creating form validation program and corresponding form interface according to result set metadata
CN108549533A (en) * 2018-04-11 2018-09-18 上海百事灵多媒体科技有限公司 A kind of method that self-defined control is added in EPG pages visual development
CN112988142A (en) * 2021-04-19 2021-06-18 广州南方卫星导航仪器有限公司 Attribute table generation method and device

Similar Documents

Publication Publication Date Title
US8819545B2 (en) Digital comic editor, method and non-transitory computer-readable medium
US8930814B2 (en) Digital comic editor, method and non-transitory computer-readable medium
US8952985B2 (en) Digital comic editor, method and non-transitory computer-readable medium
JPS59191637A (en) Formatting method and apparatus
WO2013058397A1 (en) Digital comic editing device and method therefor
US6959414B1 (en) Form editing method and apparatus, and storage medium storing computer-readable program
CN109447019B (en) Paper scanned document electronization method based on image recognition and database storage
JP2008146228A (en) Image processor and print method
US5493639A (en) Drawing processing with flexible accomodation of character strings
CN114371901A (en) Method and system for self-defining attribute adaptation format of interface control
CN113641719A (en) Data processing method, data processing device, computer and storage medium
CN104424174B (en) Document processing system and document processing method
CN112988142A (en) Attribute table generation method and device
CN109948133B (en) Data form realization method based on Layu
JP4834919B2 (en) Automatic typesetting system
JP4218517B2 (en) Color correction device
JP2001202392A (en) Cad system
JP2855027B2 (en) Graphic display device
JP2641391B2 (en) Character recognition method
JPH103516A (en) Method and device for processing information
JP3136852B2 (en) Touch panel screen creation method and device
JPH08212206A (en) Document generation device
JPH07121515A (en) Method and device for edition processing
JP2000163271A (en) Method and apparatus for information processing
JPH0764981A (en) Document processor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20220419

WW01 Invention patent application withdrawn after publication