Text box adaptive adjustment method and device and text display method and device

By obtaining and adjusting the width of the text box, the layout abnormality of text box design in multilingual scenes and text matching icons and background scenes is solved, and the adaptive adjustment of the text box and the coordination of interface layout is achieved.

CN119576456APending Publication Date: 2025-03-07CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411618680.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

The method of designing text boxes in the prior art cannot better adapt to multilingual scenes or scenes with text matching icons and backgrounds, resulting in typography exceptions and UI problems.

Method used

By obtaining the actual width of the text to be displayed, if it is less than the preset width threshold, it is determined as the target width; if it is greater than or equal to the threshold, the threshold is determined as the target width, and the text box width is adjusted to complete the adaptive adjustment of the text box.

Benefits of technology

It realizes dynamic changes in text box width, adapts to the length changes of text in different languages, avoids the problem of text exceeding or overlapping with UI elements, and ensures the coordination of interface layout.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576456A_ABST
    Figure CN119576456A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a textbox self-adaptive adjustment method and device and a text display method and device.The textbox self-adaptive adjustment method comprises the steps that the actual width of a to-be-displayed text is obtained; if the actual width is smaller than a preset width threshold value, determining the actual width as a target width; if the actual width is greater than or equal to a width threshold value, determining the width threshold value as a target width; a preset original textbox width is adjusted to a target width, textbox creation is completed based on the target width, and the created textbox is used for displaying the to-be-displayed text; according to the textbox adaptive adjustment method, adaptive adjustment can be performed on the width of the original textbox based on the actual length of the to-be-displayed text, so that dynamic change of the width of the textbox is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a text box adaptive adjustment method and device, and a text display method and device. Background Art

[0002] With the continuous development of new energy vehicle technology, the functions and display technology of vehicle electronic systems have also been rapidly improved. As the core components of vehicle human-computer interaction, the vehicle instrument screen and central control screen are no longer limited to traditional mechanical pointers and simple LCD displays, but are gradually developing in the direction of integration, high resolution, large screen, and intelligence. In the process of display interface development, text box design is usually involved. The designed text box is used to display the corresponding text to play a role of prompt or warning.

[0003] In the related art, a text box with a fixed size and position is usually designed to display text. However, in multilingual scenarios or scenarios where text is combined with icons (UI (User Interface) elements) and backgrounds, this method is prone to various UI problems such as abnormal layout. For example: for the same content, a fixed-size text box can reasonably display the Chinese version of the text, but because the English version of the text is too long, when the system language is switched to English, the displayed text content exceeds the text box and overlaps with the background or other UI elements in the display interface. Summary of the invention

[0004] The present application provides a text box adaptive adjustment method, device, text display method and device to solve the problem that the method of designing text boxes in the related art cannot adapt well to multi-language scenarios or scenarios where text is matched with icons and backgrounds.

[0005] The present application provides a text box adaptive adjustment method, the method comprising: obtaining the actual width of the text to be displayed;

[0006] If the actual width is less than the preset width threshold, the actual width is determined as the target width;

[0007] If the actual width is greater than or equal to the width threshold, the width threshold is determined as the target width;

[0008] The preset original text box width is adjusted to the target width to complete the text box creation based on the target width, and the created text box is used to display the text to be displayed.

[0009] In one embodiment of the present application, obtaining the text to be displayed includes:

[0010] Performing status monitoring on at least one preset target node;

[0011] The text information to be displayed is obtained according to a preset mapping relationship and the state of the target node, wherein the preset mapping relationship is a mapping relationship between the text information and the state of the target node, and / or a mapping relationship between the text information and a state change of the target node;

[0012] Get the current system language type;

[0013] The text to be displayed is obtained according to the text information to be displayed and the system language type.

[0014] In one embodiment of the present application, obtaining the actual width of the text to be displayed includes:

[0015] The width attribute information of the text to be displayed is read to obtain the actual width of the text to be displayed.

[0016] In one embodiment of the present application, completing the text box creation based on the target width includes:

[0017] If the actual width is greater than or equal to the width threshold, determining the height of the text box according to the actual width and the target width;

[0018] The text box is created according to the target width and the height of the text box.

[0019] The present application also provides a text box adaptive adjustment device, comprising:

[0020] The actual width acquisition module is used to obtain the actual width of the text to be displayed;

[0021] A first processing module, configured to determine the actual width as a target width if the actual width is less than a preset width threshold;

[0022] A second processing module, configured to determine the width threshold as a target width if the actual width is greater than or equal to the width threshold;

[0023] The adjustment module is used to adjust the preset original text box width to the target width, so as to complete the text box creation based on the target width, and the created text box is used to display the text to be displayed.

[0024] In one embodiment of the present application, the text to be displayed is transmitted by a preset status monitoring node, the text to be displayed is obtained by the status monitoring node according to the text information to be displayed and the current system language type, and the text information to be displayed is obtained by the status monitoring node according to a preset mapping relationship and the status of the target node;

[0025] The preset mapping relationship is a mapping relationship between text information and a state of a target node, and / or a mapping relationship between text information and a state change of a target node, and the target node is a preset node.

[0026] In one embodiment of the present application, the actual width acquisition module includes:

[0027] An information receiving unit, used for receiving the text to be displayed transmitted by the status monitoring node;

[0028] The unit to be read is bound to the information receiving unit to be consistent with the content of the information receiving unit and obtain the actual width of the text to be displayed.

[0029] In one embodiment of the present application, the first processing module and the second processing module are integrated into the same target processing module;

[0030] The target processing module is used to compare the actual width with a preset width threshold to determine the target width.

[0031] The present application also provides a text display method, comprising:

[0032] The text to be displayed is displayed in a text box, and the text box is obtained by using any of the text box adaptive adjustment methods described above.

[0033] The present application also provides a text display device, comprising:

[0034] The display module is used to display the text to be displayed in a text box, and the text box is obtained by using any of the above-mentioned text box adaptive adjustment methods.

[0035] Beneficial effects of the embodiments of the present application: The text box adaptive adjustment method, device, text display method and device provided by the embodiments of the present application, the text box adaptive adjustment method obtains the actual width of the text to be displayed; if the actual width is less than the preset width threshold, the actual width is determined as the target width; if the actual width is greater than or equal to the width threshold, the width threshold is determined as the target width; the preset original text box width is adjusted to the target width to complete the text box creation based on the target width, and the created text box is used to display the text to be displayed; the text box adaptive adjustment method can adaptively adjust the original text box width based on the actual length of the text to be displayed, thereby realizing dynamic changes in the text box width. By determining the actual width as the target width when the actual width is less than the preset width threshold, dynamic coordination between shorter text and other UI elements used for matching display can be achieved. It is understandable that, assuming that a UI element, such as a warning icon, is designed during the interface development process, and the UI element is located on the left side of the text box at a fixed distance, if a fixed-width text box is used for text display, then when the system language is switched and the length of the text to be displayed becomes shorter, the text in the text box may be too far away from the UI element (assuming that the text is displayed in the center of the text box) or the text and the UI element may be biased to the left as a whole (assuming that the text is displayed on the left in the text box). The text box adaptive adjustment method can solve this problem better by determining the actual width as the target width when the actual width is less than the preset width threshold, and realize dynamic coordination of shorter text and other UI elements displayed in combination. In addition, by determining the width threshold as the target width when the actual width is greater than or equal to the width threshold, the width of the text box can be limited to the width threshold to avoid overlapping or conflicting with the background or other UI elements in the display interface due to excessive width. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 An example diagram of a text box with a fixed length designed in the related art causing a longer text to exceed the display range;

[0037] Figure 2 An example of a fixed-length text box designed for related art that causes shorter text to be inconsistent with other UI elements Figure 1 ;

[0038] Figure 3 An example of a fixed-length text box designed in the related art that causes shorter text to be inconsistent with other UI elements Figure 2 ;

[0039] Figure 4 A flowchart of a text box adaptive adjustment method provided in one embodiment of the present application;

[0040] Figure 5A schematic diagram of a process for obtaining text to be displayed in a text box adaptive adjustment method provided in an embodiment of the present application;

[0041] Figure 6 A schematic diagram of a process for completing text box creation in a text box adaptive adjustment method provided in an embodiment of the present application;

[0042] Figure 7 A structural schematic diagram of a text box adaptive adjustment device provided in an embodiment of the present application;

[0043] Figure 8 A schematic diagram of the relationship between a text box adaptive adjustment device and a status monitoring node provided in an embodiment of the present application;

[0044] Fig. 9 Another structural schematic diagram of a text box adaptive adjustment device provided in an embodiment of the present application;

[0045] Fig.10 A flowchart of a specific embodiment of a text box adaptive adjustment method provided in an embodiment of the present application;

[0046] Fig.11 An example of an interface of a state monitoring node in a text box adaptive adjustment device provided in an embodiment of the present application Figure 1 ;

[0047] Fig.12 An example of an interface of a state monitoring node in a text box adaptive adjustment device provided in an embodiment of the present application Figure 2 ;

[0048] Fig.13 This is an example diagram of a setting interface for a trigger of a status monitoring node in a text box adaptive adjustment device provided in an embodiment of the present application;

[0049] Fig.14 This is an example diagram of an interface for binding an information receiving unit and a unit to be read in a text box adaptive adjustment device provided in an embodiment of the present application;

[0050] Fig.15 This is an example diagram of an interface for binding a to-be-read unit and a target processing module in a text box adaptive adjustment device provided in an embodiment of the present application;

[0051] Fig.16 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0052] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0053] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.

[0054] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.

[0055] Figure 1 The following is an example of a fixed-length text box designed in the related art causing a long text to exceed the display range, such as Figure 1 As shown, assuming that the text to be displayed is "The maximum charge level has been reached. Charging is completed", if a fixed-length text box is designed according to the Chinese version of the text to be displayed, then when the system language is switched to English, the English text to be displayed "Maximum charge level reached. Charge completed" may be too long and exceed the display range of the text box, causing the text displayed in the text box to overlap with the background or other UI elements. Figure 1 The icons to the left of the Chinese text are exemplary UI elements.

[0056] Figure 2 An example of a fixed-length text box designed for related art that causes shorter text to be inconsistent with other UI elements Figure 1 , please refer to Figure 2 , assuming that the current text to be displayed is "Charging Complete", and its English text is "Charging Complete", if a fixed-length text box is designed based on its English text, when the system language is switched to Chinese, Figure 2 In the display situation, the Chinese text is displayed on the left, causing the text and the corresponding icon to be displayed on the left as a whole, resulting in an inconsistent interface layout.

[0057] Figure 3 An example in the related art where a text box with a fixed length is designed, resulting in disharmony between shorter texts and other UI elements Figure 2 , please refer to Figure 3 , assuming that the text to be displayed currently is "pure electric", and its English text is "pure electric". Obviously, the length of its English text is greater than that of the Chinese text. If the text box is designed based on the English text, then when the system language is switched to Chinese, the situation as shown in Figure 3 may occur, that is, the Chinese text is centered and displayed, resulting in a too large distance between the Chinese text and the icons displayed in combination, and further resulting in a poor interface display effect.

[0058] The present application provides a text box adaptive adjustment method, device, text display method and device to solve the above problems. The following combines Figures 4 to 16 to explain the text box adaptive adjustment method, device, text display method and device provided by the present application.

[0059] Please refer to Figure 4 , Figure 4 is a schematic flowchart of the text box adaptive adjustment method provided by an embodiment of the present application. As shown in Figure 4 , the text box adaptive adjustment method provided by this embodiment includes:

[0060] S410: Obtain the actual width of the text to be displayed.

[0061] The text to be displayed refers to the text that needs to be displayed currently. In the two-dimensional display field, the width represents the dimension in the horizontal direction, and the height represents the dimension in the vertical direction.

[0062] Next, compare the actual width of the text to be displayed with a preset width threshold. As in Figure 4 , determine whether the actual width is less than the preset width threshold.

[0063] S420: If the actual width is less than the preset width threshold, then determine the actual width as the target width.

[0064] Exemplarily, the width threshold can correspond to different texts to be displayed one by one, that is, different texts to be displayed correspond to different width thresholds, and the value of the width threshold can be set according to actual needs. Usually, the width threshold refers to the maximum width that can be accepted for the text display in the current display interface.

[0065] In step S420, by determining the actual width as the target width when the actual width is less than the preset width threshold, the dynamic coordination between shorter texts and other UI elements for combined display can be achieved.

[0066] by Figure 2 For example, assuming that the current text to be displayed is "Charging is complete" and the actual width of the text to be displayed is less than the width threshold, the actual width of the text to be displayed is determined as the target width, so that the preset original text box width can be adjusted based on the target width, thereby achieving adaptive adjustment of the text box. It can be understood that during the interface development process, the distance between the text box where the text to be displayed is located and the corresponding UI element displayed with it is fixed. Therefore, by adaptively adjusting the text box, the dynamic movement of the UI element and the text box is achieved, thereby effectively avoiding Figure 2 Similarly, when the actual width is less than the width threshold, the actual width is determined as the target width, and the text box is adjusted based on the target width, which can better avoid the problem of inconsistent interface layout. Figure 3 The situation in.

[0067] S430: If the actual width is greater than or equal to the width threshold, the width threshold is determined as the target width.

[0068] by Figure 1 Taking the text displayed in as an example, assuming that the current text to be displayed is "Maximum charge level reached. Charge completed", and the text to be displayed is larger than the width threshold, the width threshold is determined as the target width, and based on the target width, the text box is adjusted to avoid the text display exceeding the range.

[0069] The above steps S420 and S430 are performed selectively.

[0070] S440: Adjusting the preset original text box width to the target width to complete the text box creation based on the target width, and the created text box is used to display the text to be displayed.

[0071] Exemplarily, the height of the text box may be a preset height value or the like.

[0072] The text box adaptive adjustment method can be applied to scenarios such as text display in vehicle-mounted systems.

[0073] Figure 5 For a flow chart of obtaining the text to be displayed in the text box adaptive adjustment method provided in an embodiment of the present application, please refer to Figure 5 In some embodiments, obtaining the text to be displayed includes:

[0074] S510: Perform status monitoring on at least one preset target node.

[0075] Exemplarily, the target node may be a node in a vehicle-mounted system.

[0076] The target node may be a hardware node, such as a sensor, or a software node, such as a process management, network management, power management, or other functional node.

[0077] S520: Obtaining text information to be displayed according to a preset mapping relationship and the state of the target node, wherein the preset mapping relationship is a mapping relationship between the text information and the state of the target node, and / or a mapping relationship between the text information and a state change of the target node.

[0078] In some embodiments, the state of the target node is matched with the target mapping relationship, and the matched corresponding text information is determined as the text information to be displayed.

[0079] In some embodiments, the state change of the target node is obtained according to the state (current state) and historical state of the target node; and the text information to be displayed is obtained according to the state change of the target node and the target mapping relationship.

[0080] S530: Obtain the current system language type.

[0081] S540: Obtain the text to be displayed according to the text information to be displayed and the system language type.

[0082] Exemplarily, the language type of the text information to be displayed is the default language type. The default language type is matched with the current system language type. If the current system language type is the same as the default language type, the current text information to be displayed is directly determined as the text to be displayed; if the current system language type is different from the default language type, the text information to be displayed is translated into a language of the corresponding type to obtain the text to be displayed.

[0083] The above-mentioned embodiments can better meet the demand for real-time text display, that is, according to the state or state change of the target node, the text box is adaptively adjusted and the text is displayed in real time.

[0084] In some embodiments, obtaining the actual width of the text to be displayed includes:

[0085] The width attribute information of the text to be displayed is read to obtain the actual width of the text to be displayed. It can be understood that by reading the width attribute information of the text to be displayed, it is convenient to directly obtain the actual width of the text to be displayed.

[0086] In order to achieve adaptive adjustment of the height of the text box, some embodiments use the following method to complete the creation of the text box. Figure 6 For a flow chart of completing text box creation in a text box adaptive adjustment method provided in an embodiment of the present application, please refer to Figure 6In some embodiments, creating a text box based on the target width includes:

[0087] S610: If the actual width is greater than or equal to the width threshold, determine the height of the text box according to the actual width and the target width.

[0088] In some embodiments, when the actual width is greater than or equal to the width threshold, the target width is determined as the new width of the text box, and based on the new width and the actual width of the text to be displayed, the text to be displayed is wrapped to obtain the height of the text box.

[0089] S620: Complete the creation of the text box according to the target width and the height of the text box.

[0090] Through the above embodiments, adaptive adjustment of the height of the text box can be achieved well.

[0091] The text box adaptive adjustment device provided in the present application is described below. The text box adaptive adjustment device described below and the text box adaptive adjustment method described above can be referenced to each other.

[0092] Figure 7 A structural diagram of a text box adaptive adjustment device provided in an embodiment of the present application, please refer to Figure 7 The text box adaptive adjustment device provided in this embodiment includes:

[0093] The actual width acquisition module 710 is used to acquire the actual width of the text to be displayed;

[0094] A first processing module 720, configured to determine the actual width as a target width if the actual width is less than a preset width threshold;

[0095] A second processing module 730 is configured to determine the width threshold as a target width if the actual width is greater than or equal to the width threshold;

[0096] The adjustment module 740 is used to adjust the preset original text box width to the target width to complete the text box creation based on the target width, and the created text box is used to display the text to be displayed. The text box adaptive adjustment device in this embodiment can achieve the technical effect achieved by the above text box adaptive adjustment method, which will not be repeated here.

[0097] Figure 8 For a schematic diagram of the relationship between the text box adaptive adjustment device and the status monitoring node provided in an embodiment of the present application, please refer to Figure 8 In some embodiments, the text to be displayed is transmitted by a preset state monitoring node, and the text to be displayed is obtained by the state monitoring node according to a preset mapping relationship and the state of the target node;

[0098] The preset mapping relationship is a mapping relationship between the text and the state of the target node, and / or a mapping relationship between the text and the state change of the target node, and the target node is a preset node.

[0099] In one embodiment, the text to be displayed is sent by a trigger in a status monitoring node, that is, the status monitoring node performs status monitoring on at least one target node. When the trigger condition is met, that is, the status of the target node is monitored to match the preset mapping relationship, or the change in the status of the target node matches the preset mapping relationship, the trigger is triggered, and the corresponding text to be displayed is sent to the actual width acquisition module 710 in the text box adaptive adjustment device.

[0100] It can be understood that the state monitoring node is responsible for state monitoring and text transmission, and the text box adaptive adjustment device is essentially also a node, responsible for the comparison of the actual width and the width threshold, as well as text display, etc. Compared with integrating all functions into one node, that is, integrating the state monitoring, text transmission, the comparison of the actual width and the width threshold, and the text display functions into one node, the above embodiment can effectively reduce the logic intersection by performing function allocation. In addition, it is convenient to separately produce the state monitoring node and the text box adaptive adjustment device, thereby improving development efficiency.

[0101] In some embodiments, the text box adaptive adjustment device is connected to the status monitoring node.

[0102] Fig. 9 For another structural diagram of a text box adaptive adjustment device provided in an embodiment of the present application, please refer to Fig. 9 In some embodiments, the actual width acquisition module includes:

[0103] An information receiving unit, used for receiving the text to be displayed transmitted by the status monitoring node;

[0104] The unit to be read is bound to the information receiving unit to be consistent with the content of the information receiving unit and obtain the actual width of the text to be displayed.

[0105] It can be understood that the unit to be read is a direct node for text display. By binding the unit to be read with the information receiving unit, the content in the information receiving unit can be synchronized to the unit to be read in real time.

[0106] The text box adaptive adjustment method is explained below with a specific embodiment in combination with the text box adaptive adjustment device and the state monitoring node in the above embodiment.

[0107] Fig.10For a flow chart of a specific embodiment of the text box adaptive adjustment method provided in an embodiment of the present application, please refer to Fig.10 First, the status monitoring node performs status monitoring on at least one preset target node; obtains the text information to be displayed according to the preset mapping relationship and the status of the target node; obtains the current system language type; obtains the text to be displayed according to the text information to be displayed and the system language type.

[0108] Secondly, the trigger in the status monitoring node transmits the text to be displayed to the text box adaptive adjustment device.

[0109] Finally, the text box adaptive adjustment device compares the actual width of the text to be displayed with the preset width threshold to complete the text box width adjustment, and then completes the text box creation.

[0110] Fig.11 An example of an interface of a state monitoring node in a text box adaptive adjustment device provided in an embodiment of the present application Figure 1 , please refer to Fig.11 , assuming that the target node currently to be monitored is the charging module of the vehicle, the text information to be displayed corresponding to each state of the charging module can be set in the interface of the state monitoring node. Fig.11 Charge Text StateManager means the charging text state manager, that is, under the charging text state manager, the text information to be displayed corresponding to each state of the charging module can be set. State Group means the state group, State_0 and State_6 are both custom states, State Object means the state object, by clicking the State Object in each state, the corresponding text information to be displayed in the state can be set. The remaining states such as Charging in preparation means charging preparation, Charging means charging, Charging over means charging is complete (no longer charging), Charging complete means charging is complete (charged), The charge gun is unlocked means the charging gun has been unlocked, and Charging inpreparation2 is also a custom state.

[0111] Fig.12 An example of an interface of a state monitoring node in a text box adaptive adjustment device provided in an embodiment of the present application Figure 2 , please refer to Fig.12 When you click on the State Object, the following will be displayed: Fig.12 The exemplary interface shown, in which the corresponding text information to be displayed in this state can be set. Fig.12 The text in the Text column is the corresponding text information to be displayed in this state, where:<Resource ID> Indicates the source of the text information to be displayed, and Charge_Text_19 is the number of the text information to be displayed. In this exemplary interface, the applicable scope of the text information to be displayed can also be set, such as General (general) and the like. Fig.12 The Name here represents the name, that is, State Object, the Target Object Path represents the target object path, and Bindings represents the binding. Fig.12 In the example, three functions available for binding are provided, such as Value Sources, Modifiers, and To Source. "+Add Binding" means adding binding, and Description means description, which can be used to add corresponding description to the text information to be displayed. Text Concept means the content of the text information to be displayed.

[0112] Fig.13 This is an example diagram of the setting interface of the trigger of the state monitoring node in the text box adaptive adjustment device provided in an embodiment of the present application. Assume that the trigger needs to monitor the state change of the target node and perform the corresponding trigger operation. Please refer to Fig.13 , Fig.13 In On Property Change, it indicates property changes, Condition indicates condition, i.e. trigger condition, Actions indicates operation, i.e. action to be performed after the condition is met (state change is detected), "SetPropert:Changing State Text.Charge Text=".".Charge......" indicates the setting logic language, which has no actual meaning and will not be described here, Set Propert indicates setting property, Trigger Action Type indicates trigger action type, Source indicates source, Value From indicates value source, Source Item indicates source item, <relative>"Represents relative, Source Property represents source property, "ChargeMode.ChargeText" represents an exemplary expression of source property, without actual reference meaning, Source Property Field represents source property field, Whole property represents whole property, Target represents target, Target Item represents target item, and the content filled in the Target Item column has no actual meaning. By completing the configuration of the above items, the configuration of the trigger can be well realized.

[0113] Fig.14 For an example diagram of an interface for binding an information receiving unit and a unit to be read in a text box adaptive adjustment device provided in an embodiment of the present application, please refer to Fig.14 , Fig.14 Here, Charging State Text represents the unit to be read, and Charge Text represents the information receiving unit. Binding Editor represents the binding editor. Binding Mode represents the binding mode, and One way represents one-way binding, to ensure that the content in Charge Text can be synchronized to ChargingState Text in real time. Item represents item, Property represents property, Text represents text, Property Field represents property field, and Whole_property represents overall property. Expression is the expression for binding Charging State Text and ChargeText. The content in the Expression column is an expression example and has no actual meaning, so it will not be repeated here. Through the above settings, the one-way binding of Charging State Text and Charge Text can be better achieved.

[0114] Fig.15 For an example diagram of an interface for binding a to-be-read unit and a target processing module in a text box adaptive adjustment device provided in an embodiment of the present application, please refer to Fig.15 , Fig.15 Tags represents tags, and Layout Width represents layout width. The content in the Expression column is a logic example of comparing the actual width of the text to be displayed with the width threshold in the target processing module, that is, a logic example of the target processing module, where a represents the actual width, and b represents the width threshold. The expressions in the Expression column are only examples and have no actual meaning, so they will not be repeated here. Through the above settings, the binding of the unit to be read and the target processing module can be better achieved.

[0115] Fig.14 [. / TextConcept.Text] and Fig.15 [. / Node.Width] in the figure are all preset paths.

[0116] This embodiment also provides a text display method, including:

[0117] The text to be displayed is displayed in a text box, and the text box is obtained by using any of the above-mentioned text box adaptive adjustment methods. This text display method can achieve the technical effect of the text box adaptive adjustment method in the above-mentioned embodiment, and will not be described in detail here.

[0118] This embodiment also provides a text display device, including:

[0119] The display module is used to display the text to be displayed in a text box, and the text box is obtained by using any of the above-mentioned text box adaptive adjustment methods. The text display device is a device corresponding to the above-mentioned text display method, and can achieve the technical effect achieved by the text display method.

[0120] The text box adaptive adjustment method, device, text display method and device in the above embodiments can be well applied to Kanzi Engine (Kanzi Engine, an efficient and customizable engine for developing embedded graphical user interfaces (GUIs)), and are widely used in user interface design and development in the fields of automobiles, consumer electronics, industrial equipment, etc. In addition, it can also be applied to other engines or systems with text box adaptive adjustment requirements.

[0121] In some embodiments, an electronic device is also provided, whose internal structure is shown in FIG. Fig.16 As shown. The electronic device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, the functions or steps on the server side of the above method are implemented.

[0122] In some embodiments, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: obtaining an actual width of text to be displayed; if the actual width is less than a preset width threshold, determining the actual width as a target width; if the actual width is greater than or equal to the width threshold, determining the width threshold as the target width; adjusting a preset original text box width to a target width to complete text box creation based on the target width, and the created text box is used to display the text to be displayed.

[0123] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining the actual width of the text to be displayed; if the actual width is less than a preset width threshold, determining the actual width as the target width; if the actual width is greater than or equal to the width threshold, determining the width threshold as the target width; adjusting the preset original text box width to the target width to complete text box creation based on the target width, and the created text box is used to display the text to be displayed.

[0124] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or electronic device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.

[0125] The flow chart and block diagram in the accompanying drawings illustrate the possible implementation architecture, function and operation of the method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0126] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.< / relative>

Claims

1. A text box adaptive adjustment method, characterized in that: include: Get the actual width of the text to be displayed; If the actual width is less than a preset width threshold, the actual width is determined as the target width; If the actual width is greater than or equal to the width threshold, the width threshold is determined as the target width; The preset original text box width is adjusted to the target width to complete the text box creation based on the target width, and the created text box is used to display the text to be displayed.

2. The text box adaptive adjustment method according to claim 1, characterized in that: Get the text to be displayed, including: Performing status monitoring on at least one preset target node; The text information to be displayed is obtained according to a preset mapping relationship and the state of the target node, wherein the preset mapping relationship is a mapping relationship between the text information and the state of the target node, and / or a mapping relationship between the text information and a state change of the target node; Get the current system language type; The text to be displayed is obtained according to the text information to be displayed and the system language type.

3. The text box adaptive adjustment method according to claim 1 or 2, characterized in that: Get the actual width of the text to be displayed, including: The width attribute information of the text to be displayed is read to obtain the actual width of the text to be displayed.

4. The text box adaptive adjustment method according to claim 1, characterized in that: Complete text box creation based on the target width, including: If the actual width is greater than or equal to the width threshold, determining the height of the text box according to the actual width and the target width; The text box is created according to the target width and the height of the text box.

5. A text box adaptive adjustment device, characterized in that: include: The actual width acquisition module is used to obtain the actual width of the text to be displayed; A first processing module, configured to determine the actual width as a target width if the actual width is less than a preset width threshold; A second processing module, configured to determine the width threshold as a target width if the actual width is greater than or equal to the width threshold; The adjustment module is used to adjust the preset original text box width to the target width, so as to complete the text box creation based on the target width, and the created text box is used to display the text to be displayed.

6. The text box adaptive adjustment device according to claim 5, characterized in that: The text to be displayed is transmitted by a preset state monitoring node, the text to be displayed is obtained by the state monitoring node according to the text information to be displayed and the current system language type, and the text information to be displayed is obtained by the state monitoring node according to a preset mapping relationship and the state of the target node; The preset mapping relationship is a mapping relationship between text information and a state of a target node, and / or a mapping relationship between text information and a state change of a target node, and the target node is a preset node.

7. The text box adaptive adjustment device according to claim 6, characterized in that: The actual width acquisition module comprises: An information receiving unit, used for receiving the text to be displayed transmitted by the status monitoring node; The unit to be read is bound to the information receiving unit to be consistent with the content of the information receiving unit and obtain the actual width of the text to be displayed.

8. The text box adaptive adjustment device according to claim 7, characterized in that: The first processing module and the second processing module are integrated into the same target processing module; The target processing module is used to compare the actual width with a preset width threshold to determine the target width.

9. A text display method, characterized in that: include: The text to be displayed is displayed in a text box, and the text box is obtained by using the text box adaptive adjustment method according to any one of claims 1 to 4.

10. A text display device, characterized in that: include: The display module is used to display the text to be displayed in a text box, and the text box is obtained by the text box adaptive adjustment method according to any one of claims 1 to 4.