Control method for setting control highlighting and selection effect and related equipment

By using container wrapping controls in the UI framework, independently managing highlighting and selecting effects, the problem of highlighting and selecting effects dependencies in the existing technology is solved, achieving more accurate user operation feedback and higher code maintainability.

CN119512425APending Publication Date: 2025-02-25XIAN DUANYI TECH CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411576703.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In the existing UI framework control methods, a dependency between setting the highlighting effect and selecting effect will be generated, and the two types of operations cannot be independent of each other, making it difficult for the user's operation intention to accurately reflect on the UI.

Method used

By using containers to wrap the controls, the highlighting and selection effects are managed separately. Specifically, when receiving the highlight effect setting instruction, modify the container background color to achieve the highlight effect; when receiving the selected event instruction, modify the control background color to achieve the selected effect, and generate the cancel last selected instruction to handle other The selected state of the control.

Benefits of technology

The highlighting and selection effects are independent of each other, avoiding their dependencies, ensuring that the user's operation intentions can be accurately reflected on the UI, and improving the maintainability and scalability of the code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512425A_ABST
    Figure CN119512425A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of WPF framework interaction, and discloses a control method and related equipment for setting a control highlighting and selecting effect, and the method comprises the following steps: firstly, putting a control package into a container, and modifying the background color of the container according to a highlighting effect setting instruction so as to enable the container to present a highlighting effect; restoring the container to the original background color of the container according to the highlight effect cancelling instruction so as to cancel the highlight effect of the container; setting and cancelling of the highlight effect of the control are indirectly realized through the highlight effect of the container and the operation of cancelling the highlight effect; according to the method, the background color of the control is changed according to the selected event instruction, the selection process of the control is independent, the background color of the control is modified according to the selected event instruction, so that the selection effect of the control is achieved, other controls are restored to the original background color of the control according to the instruction for canceling the last selection, and the selection effect of other controls is canceled; according to the method, the highlighting process and the selection process are separated, the highlighting effect and the selection effect of the control are achieved by respectively setting the attributes of the container and the control, and the highlighting process and the selection process do not depend on each other and do not influence each other.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of UI framework, specifically to the field of WPF framework interaction, and in particular to a control method and related equipment for setting control highlight and selection effects. Background Art

[0002] In current applications, the interactivity of the user interface (UI) is an important design element; among them, when users interact with controls in the UI, visual feedback is usually used to indicate the state change of the control to enhance the user experience. A common way of visual feedback is to modify the background color of the control. For example, when the mouse moves over a control, in order to attract the user's attention and indicate that the control is interactive, its background color can be changed from the original white to SkyBlue to achieve a highlighting effect. This operation enables users to more intuitively perceive the interactive relationship between the mouse and the control. Furthermore, when the user clicks and selects the control, in order to clearly indicate that the control has been selected, its background color can be modified again, such as changing the background color to DeepSkyBlue to indicate the selected state. This change enables users to clearly understand the object of the current operation.

[0003] However, in the current implementation, when the mouse leaves the control, in order to maintain the selected state, if the control has been selected, the background color will not be restored to white, that is, the unhighlighting operation will not be performed; although this setting method simplifies the logic of state management to a certain extent, it also creates a dependency between the highlighting effect and the selection effect. In addition, in some specific scenarios, this dependency may cause some problems; for example, setting the highlighting effect is achieved by modifying the background color of the control through a trigger, while setting the selection effect is to modify the background color by listening to events, so when canceling the highlighting effect, it may not be possible to accurately determine whether the control has been selected; in this case, if you need to manage both the highlighting and selection states at the same time, you need to add additional logic to the code to handle the dependency between them, which increases the complexity of the implementation and the risk of errors.

[0004] It can be seen that in the existing UI framework control method, a dependency relationship will be generated between the two types of operations of setting the highlight effect and the selection effect, and the two types of operations cannot be independent of each other, resulting in the user's operation intention being difficult to accurately reflect on the UI. Summary of the invention

[0005] The purpose of the present invention is to provide a control method and related equipment for setting control highlight and selection effects, so as to solve the technical problem that in the existing UI framework control method, a dependency relationship will be generated between the two types of operations of setting highlight effects and selecting effects, and the two types of operations cannot be achieved independently.

[0006] In order to achieve the above object, the present invention adopts the following technical solution: A method for setting the highlight and selection effects of a control, including: Use containers to package controls; When a highlight effect setting instruction is received, the background color of the container is modified according to the highlight effect setting instruction so that the container presents a highlight effect; when a highlight effect cancellation instruction is received, the container is restored to its original background color according to the highlight effect cancellation instruction so as to cancel the highlight effect of the container; When a selection event instruction is received, the background color of the control is modified according to the selection event instruction so that the control appears selected; at the same time, a cancel last selection instruction is generated according to the selection event instruction, and other controls are restored to their original background colors according to the cancel last selection instruction to cancel the selection effect of other controls.

[0007] Furthermore, when the mouse moves onto the control, a highlight effect setting instruction is generated; when the mouse moves out of the control, a highlight effect cancellation instruction is generated; both the highlight effect setting instruction and the highlight effect cancellation instruction are transmitted to the trigger, and the container background color modification and the container original background color restoration operations are executed through the trigger.

[0008] Furthermore, the container adopts Border; the control is placed in the Border so that the control serves as a child element of the Border.

[0009] Furthermore, when the mouse moves onto the control, a highlight effect setting instruction is generated, and the background color and border color of the Border are modified according to the highlight effect setting instruction; when the mouse moves out of the control, a cancel highlight effect instruction is generated, and the Border is restored to the original background color and original border color according to the cancel highlight effect instruction.

[0010] Furthermore, when the mouse clicks the control, a selection event instruction is generated and a cancel last selection instruction is generated at the same time.

[0011] Furthermore, the original background color of the control is set to transparent or empty.

[0012] Furthermore, when the control is in the selected effect, the control background color is set to DeepSkyBlue; when the container is in the highlighted effect, the container background color is set to SkyBlue, and the container border color is set to Blue.

[0013] A control system for setting the highlight and selection effects of controls, including: A control packaging module is used to package controls using containers; A highlight effect execution module, configured to, when receiving a highlight effect setting instruction, modify the container background color according to the highlight effect setting instruction so that the container presents a highlight effect; and, when receiving a highlight effect cancellation instruction, restore the container to its original background color according to the highlight effect cancellation instruction so as to cancel the highlight effect of the container; The selection effect execution module is used to modify the background color of the control according to the selection event instruction when receiving the selection event instruction, so that the control presents the selection effect; at the same time, it generates a cancel last selection instruction according to the selection event instruction, and restores other controls to their original background color according to the cancel last selection instruction to cancel the selection effect of other controls.

[0014] A device comprising: Memory for storing computer programs; The processor is used to implement the steps of the above-mentioned control method for setting the highlight and selection effects of the control when executing the computer program.

[0015] A computer-readable storage medium stores a computer program, which, when executed by a processor, is used to implement the steps of the control method for setting the highlight and selection effects of a control.

[0016] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides a control method for setting the highlight and selection effects of a control. The method firstly packages the control into a container, and when a highlight effect setting instruction is received, the background color of the container is modified according to the highlight effect setting instruction, so that the container presents a highlight effect; when a highlight effect cancellation instruction is received, the container is restored to the original background color of the container according to the highlight effect cancellation instruction, so as to cancel the highlight effect of the container; the control highlight effect setting and cancellation are indirectly realized through the control of the highlight effect and the cancellation of the highlight effect of the container; and the control selection process is separated independently, when a selection event instruction is received, the control background color is modified according to the selection event instruction, so as to realize the control selection effect, and other controls are restored to the original background color of the control according to the cancel last selection instruction, so as to realize the cancellation of the selection effects of other controls; the method separates the highlight and selection processes, and sets the properties of the container and the control respectively to realize the control highlight and selection effects, which are independent of each other and do not affect each other, avoid the dependency relationship between them, and ensure that the user's operation intention can be accurately reflected on the UI.

[0017] Preferably, in the present invention, by generating corresponding highlight effect setting instructions and canceling highlight effect instructions when the mouse is moved onto a control and moved out of a control, and transmitting them to a trigger for execution, an instant response to user interaction behavior is achieved. This dynamic effect enhances the interactivity and feedback of the user interface, making the user experience smoother.

[0018] Preferably, in the present invention, Border is used as a container, and controls are placed therein as sub-elements, so that the style and layout of the controls are more flexible and controllable; at the same time, the Border container provides additional style attributes (such as border color), further enriching the visual effect of the user interface. Preferably, in the present invention, when the mouse moves onto a control, not only the background color of the Border is modified, but also its border color is modified, thereby enhancing the visual impact of the highlight effect; and when the mouse moves out, the Border is restored to its original state, thereby ensuring the neatness and consistency of the user interface.

[0019] Preferably, in the present invention, by generating a selection event instruction and canceling the last selection instruction when the mouse clicks the control, instant updating and feedback of the control selection state is achieved; this mechanism ensures that the state of the user interface is consistent with the user's operation, improving the accuracy and efficiency of the user's operation.

[0020] Preferably, in the present invention, the original background color of the control is set to transparent or empty, so that the control can inherit the style of its parent container or background, thereby improving the flexibility and scalability of the user interface. At the same time, this also avoids the visual interference that may occur when the control is not selected or highlighted.

[0021] Preferably, in the present invention, by setting specific background colors and border colors (such as DeepSkyBlue and SkyBlue, etc.) for controls and containers, highlight and selection effects are more vivid and easier to identify; this color combination not only improves the aesthetics of the user interface, but also enhances the intuitiveness and accuracy of user operations. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A flowchart of a method for setting highlight and selection effects of a control provided by an embodiment of the present invention; Figure 2 A schematic diagram of a highlight effect achieved by a method for setting a highlight and selection effect of a control provided in an embodiment of the present invention; Figure 3 A schematic diagram of canceling a highlight effect achieved by using a control method for setting a highlight and selection effect of a control provided in an embodiment of the present invention; Figure 4 A schematic diagram of realizing a highlight effect of another control by using a control method for setting a highlight and selection effect of a control provided in an embodiment of the present invention; Figure 5 A schematic diagram of a selection effect achieved by using a control method for setting a control highlight and selection effect provided in an embodiment of the present invention; Figure 6A schematic diagram of realizing a highlight effect under a control selection effect by using a control method for setting a control highlight and selection effect provided in an embodiment of the present invention; Figure 7 A schematic diagram of a selection effect and a cancellation of the last selection effect achieved by a control method for setting a control highlight and selection effect provided in an embodiment of the present invention; Figure 8 A flowchart of a method for setting the highlight and selection effects of a control provided by the present invention; Fig. 9 A structural schematic diagram of a control system for setting control highlight and selection effects provided by the present invention. DETAILED DESCRIPTION

[0023] Example 1 As described in the background technology, in the current UI framework, when the mouse leaves the control, in order to maintain the selected state, if the control has been selected, the background color will not be restored to white, that is, the unhighlighting operation will not be performed; although this setting method simplifies the logic of state management to a certain extent, it also creates a dependency between the highlighting effect and the selection effect. In addition, in some specific scenarios, this dependency may cause some problems; for example, setting the highlighting effect is achieved by modifying the background color of the control through a trigger, while setting the selection effect is to modify the background color by listening to events, so when canceling the highlighting effect, it may not be possible to accurately determine whether the control has been selected; in this case, if you need to manage both the highlighting and selection states at the same time, you need to add additional logic to the code to handle the dependency between them, which increases the complexity of the implementation and the risk of errors; the above problems will make it difficult for the user's operation intentions to be accurately reflected in the UI.

[0024] In order to achieve the above-mentioned purpose, the present invention provides a method for controlling the highlight and selection effects of a control. The method is applicable to the WPF framework and uses a container to package controls to set the highlight effect of the control independently from the selection effect of the control. No dependency is generated and the two effects are set separately without affecting each other.

[0025] In order to facilitate understanding of the control method provided in this embodiment, the following terms are explained and illustrated: WPF (Windows Presentation Foundation) is a UI framework launched by Microsoft for building rich client Windows applications; it is part of .NET Framework 3.0 and later versions, and aims to provide a unified, extensible, object-oriented programming model for building desktop applications with rich visual experience and interactivity.

[0026] like Figure 1 As shown, this embodiment provides a method for setting the highlight and selection effects of a control, which is applicable to WPF, and the steps are as follows: The first step is to use containers to package controls; Step 2: When the mouse moves into the control, set the container to highlight the effect; Step 3: When the mouse selects a control, set the control to the selected effect; and cancel the selection effect of the last selected control; Step 4: After the mouse moves out of the control, cancel the highlight effect of the container.

[0027] In this embodiment, a further solution is as follows: Step 1: Use a container to wrap the control: for example, use a Border to wrap the control, and place the control in the Border as a Child of the Border.

[0028] Step 2: Set the container to highlight effect when the mouse moves into the control: Set the container to highlight effect when the mouse moves into the control, for example, set the background color of the Border to SkyBlue and the border color of the Border to Blue.

[0029] Step 3: Set the control to the selected effect when the control is selected: The original background color of the control must be set to transparent or empty. If the original background color of the control needs to be set to another color, it can be achieved by setting the background color of the container. When the control is clicked to select, the control is set to the selected effect, such as setting the background color of the control to DeepSkyBlue. If other controls were selected before, the previously selected control needs to be deselected (that is, restored to the original effect).

[0030] Step 4: Cancel the highlight effect of the container after the mouse moves out of the control: When the mouse leaves this control, cancel the highlight effect of the container, such as setting the background color of the Border to the original background color and the border color of the Border to the original border color.

[0031] In order to facilitate further understanding of the present technical solution, the present embodiment provides a control method for setting highlight and selection effects of controls. The method aims to set highlight and selection effects for UI controls in an efficient and intuitive manner, thereby improving user experience. The method uses a container (such as a Border) to package the control, and dynamically modifies the background color of the control and its container by receiving instructions to achieve the desired effect. The method is divided into more specific control steps according to function, including: Step 1: Control packaging: A container is used to package the control. In this embodiment, a Border is used to package the control so that the control becomes a child element (Child) of the container.

[0032] Step 2: Setting and canceling the highlight effect: Highlight effect settings: In this embodiment, when the mouse moves to the control, a highlight effect setting instruction is generated and transmitted to the trigger. The trigger modifies the background color (such as setting it to SkyBlue) and border color (such as setting it to Blue) of the container according to the received highlight effect setting instruction, so that the container presents a highlight effect, and then the control presents a highlight effect.

[0033] To cancel the highlight effect: In this embodiment, when the mouse moves out of the control, a cancel highlight effect instruction is generated and transmitted to the trigger. The trigger restores the container to the original background color and the original border color according to the received cancel highlight effect to cancel the highlight effect. In this way, the cancel of the highlight effect of the control is indirectly achieved. Similarly, the above-mentioned highlight effect setting instruction and the highlight effect cancellation instruction are both transmitted to the trigger, and the trigger finally performs the background color restoration operation.

[0034] Step 3: Select the effect settings: In this embodiment, when the mouse clicks the control, that is, a selection event instruction is generated, here, the corresponding event task (such as mouse click) is obtained by listening to the event and a selection event instruction is generated. According to the selection event instruction, the background color of the control is modified (such as setting it to DeepSkyBlue) to make the control appear selected.

[0035] When generating a selection event instruction, a cancel last selection instruction is generated, and other controls are restored to their original background color (such as transparent or empty) according to the cancel last selection instruction to cancel the selection effect of other controls.

[0036] In this embodiment, regarding the setting of the control background color: To ensure that the selection effect can be displayed clearly, set the original background color of the control to transparent or empty; to improve the aesthetics of the UI, if the background color of the control is changed, it can be achieved by adjusting the background color of the container (Border).

[0037] In this embodiment, when the control is in the selected state, its background color is set to DeepSkyBlue.

[0038] Correspondence between container and control colors: When the container is in the highlight effect, its background color is set to SkyBlue and its border color is set to Blue.

[0039] The above color settings are intended to provide clear visual feedback so that users can intuitively perceive the state change of the control.

[0040] It can be seen that the control method provided in this embodiment avoids the dependency between the highlight and selected states by separating the management logic of the highlight and selected states, so that the properties of the container and the control can be set separately to achieve the highlight and selection effects of the control; at the same time, it also improves the maintainability and scalability of the code.

[0041] In addition, triggers are used to perform background color modification and restoration operations, making the entire process more automated and efficient.

[0042] In addition, by setting the original background color of the control to transparent or empty, you can more flexibly control the display effect of the control through the container to meet different UI design requirements.

[0043] The control method provided by this embodiment is further described below with reference to the accompanying drawings: like Figure 2 As shown, when the mouse moves into the Ek1541 site, the Border where the EK1541 site is located is set to highlight (the border color is set to DarkOrange and the background color is set to PeachPuff).

[0044] like Figure 3 As shown in the figure, when the mouse moves out of the EK1541 site, the highlight effect of the Border where the EK1541 site is located is cancelled (the border color is set to the initial color DarkGray, and the background color is set to the initial color FFF8F8F8).

[0045] like Figure 4 As shown, when the mouse moves into the EL1202 site, the Border where the EL1202 site is located is set to be highlighted.

[0046] like Figure 5 As shown, when you click the mouse, the EL1202 site is set to selected (the background color is set to FFFAFFB9).

[0047] like Figure 6 As shown, when the mouse moves out of the EL1202 site and into the GM421_EVB site, the Border where the EL1202 site is located is unhighlighted, and the Border where the GM421_EVB site is located is set to be highlighted. It can be seen that the selection effect and the highlight effect exist at the same time, and the two types of operations do not interfere with each other.

[0048] like Figure 7 As shown, when you click the mouse, the GM421_EVB site is set as the selected effect, and the EL1202 site is unselected.

[0049] It can be seen that the control method for setting the highlight and selection effects of a control provided in this embodiment can separate the two processes of highlighting and selecting, and set the properties of the container and the control respectively to achieve the highlight and selection effects of the control, without relying on or affecting each other.

[0050] Example 2 like Figure 8 As shown, this embodiment provides a control method for setting the highlight and selection effects of a control, including the following steps: S1: Use a container to package the control; the container uses Border; put the control into Border so that the control serves as a child element of Border.

[0051] S2: when receiving a highlight effect setting instruction, modifying the background color of the container according to the highlight effect setting instruction so that the container presents a highlight effect; when receiving a highlight effect cancellation instruction, restoring the container to the original background color of the container according to the highlight effect cancellation instruction so as to cancel the highlight effect of the container; Here, a highlight effect setting instruction is generated, and the background color and border color of the Border are modified according to the highlight effect setting instruction; when the mouse moves out of the control, a cancel highlight effect instruction is generated, and the Border is restored to the original background color and original border color according to the cancel highlight effect instruction.

[0052] Specifically, when the mouse moves onto the control, a highlight effect setting instruction is generated; when the mouse moves out of the control, a highlight effect cancellation instruction is generated; the highlight effect setting instruction and the highlight effect cancellation instruction are both transmitted to the trigger, and the trigger is used to modify the container background color and restore the original background color of the container.

[0053] S3: When a selection event instruction is received, the background color of the control is modified according to the selection event instruction so that the control appears selected; at the same time, a cancel last selection instruction is generated according to the selection event instruction, and other controls are restored to their original background colors according to the cancel last selection instruction to cancel the selection effect of other controls.

[0054] Here, when the mouse clicks the control, a selection event instruction is generated and a cancel last selection instruction is generated at the same time.

[0055] To improve the flexibility and scalability of the user interface, the control can inherit the style of its parent container or background and set the original background color of the control to transparent or empty.

[0056] In order to make the highlight and selection effects more vivid and easier to identify, when the control is in the selected effect, the control background color is set to DeepSkyBlue; when the container is in the highlighted effect, the container background color is set to SkyBlue, and the container border color is set to Blue; this color combination not only improves the aesthetics of the user interface, but also enhances the intuitiveness and accuracy of user operations.

[0057] like Fig. 9 As shown, the present embodiment also provides a control system for setting highlight and selection effects of controls, including: a control packaging module, which is used to package controls with containers; a highlight effect execution module, which is used to modify the container background color according to the highlight effect setting instruction when a highlight effect setting instruction is received, so that the container presents a highlight effect; when a cancel highlight effect instruction is received, the container is restored to the original background color of the container according to the cancel highlight effect instruction to cancel the highlight effect of the container; a selection effect execution module, which is used to modify the control background color according to the selection event instruction when a selection event instruction is received, so that the control presents a selection effect; at the same time, a cancel last selection instruction is generated according to the selection event instruction, and other controls are restored to the original background color of the control according to the cancel last selection instruction to cancel the selection effect of other controls.

[0058] The present invention also provides a device, comprising: a memory for storing a computer program; and a processor for implementing the steps of the control method for setting the highlight and selection effects of controls when executing the computer program.

[0059] When the processor executes the computer program, the above-mentioned steps of setting the control highlight and selection effects are implemented, for example: using a container to package the control; when receiving a highlight effect setting instruction, modifying the container background color according to the highlight effect setting instruction so that the container presents a highlight effect; when receiving a highlight effect cancellation instruction, restoring the container to the original background color of the container according to the highlight effect cancellation instruction to cancel the highlight effect of the container; when receiving a selection event instruction, modifying the control background color according to the selection event instruction so that the control presents a selection effect; at the same time, generating a cancel last selection instruction according to the selection event instruction, and restoring other controls to the original background color of the control according to the cancel last selection instruction to cancel the selection effect of other controls.

[0060] Alternatively, the processor implements the functions of each module in the above-mentioned system when executing the computer program, for example: a control packaging module, which is used to package the control with a container; a highlight effect execution module, which is used to modify the container background color according to the highlight effect setting instruction when a highlight effect setting instruction is received, so that the container presents a highlight effect; when a cancel highlight effect instruction is received, the container is restored to the original background color of the container according to the cancel highlight effect instruction to cancel the highlight effect of the container; a selection effect execution module, which is used to modify the control background color according to the selection event instruction when a selection event instruction is received, so that the control presents a selection effect; at the same time, a cancel last selection instruction is generated according to the selection event instruction, and other controls are restored to the original background color of the control according to the cancel last selection instruction to cancel the selection effect of other controls.

[0061] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of completing preset functions, and the instruction segments are used to describe the execution process of the computer program in the control device for setting the highlight and selection effects of the control. For example, the computer program can be divided into a control packaging module, a highlight effect execution module and a selection effect execution module; the specific functions of each module are as follows: a control packaging module, which is used to use a container to package the control; a highlight effect execution module, which is used to modify the container background color according to the highlight effect setting instruction when a highlight effect setting instruction is received, so that the container presents a highlight effect; when a cancel highlight effect instruction is received, the container is restored to the original background color of the container according to the cancel highlight effect instruction to cancel the highlight effect of the container; a selection effect execution module, which is used to modify the control background color according to the selection event instruction when a selection event instruction is received, so that the control presents a selection effect; at the same time, a cancel last selection instruction is generated according to the selection event instruction, and other controls are restored to the original background color of the control according to the cancel last selection instruction to cancel the selection effect of other controls.

[0062] The control device for setting the control highlight and selection effect can be a computing device such as a desktop computer, a notebook, a handheld computer, and a cloud server. The control device for setting the control highlight and selection effect may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that the above are examples of control devices for setting the control highlight and selection effect, and do not constitute a limitation on the control device for setting the control highlight and selection effect, and may include more components than the above, or combine certain components, or different components. For example, the control device for setting the control highlight and selection effect may also include input and output devices, network access devices, buses, etc.

[0063] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The processor is the control center for controlling the highlight and selected effects of the setting controls, and uses various interfaces and lines to connect the various parts of the entire control device for controlling the highlight and selected effects of the setting controls.

[0064] The memory can be used to store the computer program and / or module, and the processor implements various functions of the control device for setting control highlight and selection effects by running or executing the computer program and / or module stored in the memory and calling the data stored in the memory.

[0065] The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0066] The present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the control method for setting the highlight and selection effects of a control are implemented.

[0067] The module / unit integrated in the control system for setting the highlight and selection effects of controls may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product.

[0068] Based on such understanding, the present invention implements all or part of the processes in the above-mentioned control method for setting the highlight and selection effects of the control, and can also be completed by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned control method for setting the highlight and selection effects of the control can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or preset intermediate form, etc.

[0069] The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.

[0070] It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electrical carrier signals and telecommunication signals.

[0071] It can be seen that the present invention provides a control method for setting the highlight and selection effects of a control, which has the following advantages over the existing control methods: By using a container (such as Border) to package the control and setting the control logic of the highlight effect and the selected effect respectively, this technical solution can ensure that when the user interacts with the control (such as hovering the mouse, clicking, etc.), the control and its container can immediately and intuitively feedback the corresponding visual effects. Specifically, when the mouse moves to the control, the background color of the container will change immediately to present a highlight effect, enhancing the user's perception of the current operation focus; and when the mouse clicks the control, the background color of the control will change to indicate that it is selected, and the background color of other controls will be restored to the original state, avoiding visual confusion. In addition, this technical solution also allows the background color and border color of the highlight and selection effects to be customized (such as DeepSkyBlue and SkyBlue, etc.), thereby further improving the aesthetics of the interface and user experience. At the same time, by setting the original background color of the control to transparent or empty, this method also realizes the flexibility of adding and switching interactive effects without interfering with the design of the control itself. In summary, this method separates the highlighting and selection processes, and sets the properties of the container and the control respectively to achieve the highlighting and selection effects of the control, which are independent of each other and do not affect each other. This method not only improves the interactivity and intuitiveness of the user interface, but also provides a high degree of customizability, and is suitable for a variety of application scenarios.

[0072] The above embodiment is only one of the implementation methods that can realize the technical solution of the present invention. The scope of protection claimed by the present invention is not limited only to this embodiment, but also includes changes, replacements and other implementation methods that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed by the present invention.

Claims

1. A method for setting the highlight and selection effects of a control, characterized in that: include: Use containers to package controls; When a highlight effect setting instruction is received, the background color of the container is modified according to the highlight effect setting instruction so that the container presents a highlight effect; when a highlight effect cancellation instruction is received, the container is restored to its original background color according to the highlight effect cancellation instruction so as to cancel the highlight effect of the container; When a selection event instruction is received, the background color of the control is modified according to the selection event instruction so that the control appears selected; at the same time, a cancel last selection instruction is generated according to the selection event instruction, and other controls are restored to their original background colors according to the cancel last selection instruction to cancel the selection effect of other controls.

2. The method for setting the highlight and selection effects of a control according to claim 1, characterized in that: When the mouse moves onto the control, a highlight effect setting instruction is generated; when the mouse moves out of the control, a highlight effect cancellation instruction is generated; both the highlight effect setting instruction and the highlight effect cancellation instruction are transmitted to the trigger, and the trigger is used to perform the modification of the container background color and the restoration of the original background color of the container.

3. The method for setting the highlight and selection effects of a control according to claim 2, characterized in that: The container adopts Border; the control is placed in the Border so that the control serves as a child element of the Border.

4. The method for setting the highlight and selection effects of a control according to claim 3, characterized in that: When the mouse moves onto the control, a highlight effect setting instruction is generated, and the background color and border color of the Border are modified according to the highlight effect setting instruction; when the mouse moves out of the control, a cancel highlight effect instruction is generated, and the Border is restored to the original background color and original border color according to the cancel highlight effect instruction.

5. The method for setting the highlight and selection effects of a control according to claim 1, characterized in that: When the mouse clicks the control, a selection event instruction is generated and a cancel last selection instruction is generated at the same time.

6. The method for setting the highlight and selection effects of a control according to claim 1, characterized in that: Sets the control's original background color to transparent or empty.

7. The method for setting the highlight and selection effects of a control according to claim 1, characterized in that: When the control is in the selected effect, the control background color is set to DeepSkyBlue; when the container is in the highlighted effect, the container background color is set to SkyBlue and the container border color is set to Blue.

8. A control system for setting the highlight and selection effects of a control, characterized in that: include: A control packaging module is used to package controls using containers; A highlight effect execution module, configured to, when receiving a highlight effect setting instruction, modify the container background color according to the highlight effect setting instruction so that the container presents a highlight effect; and, when receiving a highlight effect cancellation instruction, restore the container to its original background color according to the highlight effect cancellation instruction so as to cancel the highlight effect of the container; The selection effect execution module is used to modify the background color of the control according to the selection event instruction when receiving the selection event instruction, so that the control presents the selection effect; at the same time, it generates a cancel last selection instruction according to the selection event instruction, and restores other controls to their original background color according to the cancel last selection instruction to cancel the selection effect of other controls.

9. A device, characterized in that: include: Memory for storing computer programs; A processor, used to implement the steps of the control method for setting the highlight and selection effects of a control as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it is used to implement the steps of the control method for setting the highlight and selection effects of a control as described in any one of claims 1-7.