Control display method and device based on stack panel, equipment, medium and product

By obtaining mouse position and control arrangement rules in the stack panel, calculating position offset data, and achieving accurate control exchange, the problem of poor exchange effect in the existing technology is solved and the user experience is improved.

CN119088495APending Publication Date: 2024-12-06GUANGZHOU BAOLUN ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411234077.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

In the prior art, control exchange only depends on the exchange of icon positions, resulting in poor exchange effect and affecting user experience.

Method used

By obtaining the mouse's pressed position and current position in the stack panel, the position offset data is determined based on the control arrangement rules, and the control is moved from the initial position to the pressed position according to the preset animation parameters and the exchange ratio, showing the control exchange process.

Benefits of technology

It improves the accuracy of exchange control, intuitive and convenient interface operation, and enhances the smoothness and display effect of the exchange process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088495A_ABST
    Figure CN119088495A_ABST
Patent Text Reader

Abstract

The invention discloses a control display method and device based on a stack panel, equipment, a medium and a product. The method comprises the following steps: acquiring a pressed position of a mouse in a stack panel corresponding to a current page; responding to a moving event of the mouse in the current page, and obtaining the current position of the mouse in the stack type panel; determining position offset data of the first control based on the pressing position, the current position and a control arrangement rule of the stack panel; and based on the position offset data and the initial position, determining that a second control meeting a preset exchange condition exists in the at least two controls, and according to the position offset data, a preset animation parameter, a preset exchange proportion and a control attribute of the second control, moving the second control from the initial position of the second control to a pressing position. The problem that in the prior art, the exchange effect is poor due to the fact that exchange only depends on icon positions is solved, the exchange control accuracy is improved, meanwhile, the control exchange moving process is displayed, and the display effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer processing technology, and in particular to a control display method, device, equipment, medium and product based on a stack panel. Background Art

[0002] Currently, when users drag and exchange controls in a graphical interface, they mostly use a method of dragging one icon to another icon, and when the mouse is released, the two icons are exchanged.

[0003] This icon exchange method only exchanges the icon positions, and the visual feedback effect of the exchange is poor. Users cannot effectively know the icon exchange process, which affects the user experience. Summary of the invention

[0004] The present invention provides a control display method, device, equipment, medium and product based on a stack panel, so as to realize the display process of control exchange and movement while improving the accuracy of exchange control.

[0005] According to one aspect of the present invention, a control display method based on a stack panel is provided, the method comprising:

[0006] In response to a mouse press event in a current page, obtaining a mouse press position in a stack panel corresponding to the current page, and determining initial positions of at least two controls in the stack panel in the stack panel;

[0007] When it is determined that there is a first control whose initial position is consistent with the pressed position among the at least two controls, in response to a movement event of the mouse in the current page, obtaining a current position of the mouse in the stack panel;

[0008] Determining position offset data of the first control based on the pressed position, the current position, and a control arrangement rule of the stack panel;

[0009] When it is determined that there is a second control that meets the preset exchange condition among the at least two controls based on the position offset data and the initial position, the second control is moved from the initial position of the second control to the pressed position according to the position offset data, preset animation parameters, preset exchange ratio and control properties of the second control.

[0010] According to another aspect of the present invention, a control display device based on a stack panel is provided, the device comprising:

[0011] A press event response module, used for obtaining the pressed position of the mouse in the stack panel corresponding to the current page in response to the press event of the mouse in the current page, and determining the initial positions of at least two controls in the stack panel in the stack panel;

[0012] a movement event response module, configured to obtain the current position of the mouse in the stacked panel in response to a movement event of the mouse in the current page when it is determined that there is a first control whose initial position is consistent with the pressed position among the at least two controls;

[0013] A position offset data determination module, configured to determine the position offset data of the first control based on the pressed position, the current position and a control arrangement rule of the stack panel;

[0014] A moving module is used to move the second control from the initial position of the second control to the pressed position according to preset animation parameters, preset exchange ratio and control properties of the second control when it is determined that there is a second control that meets the preset exchange condition among the at least two controls based on the position offset data and the initial position.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0016] at least one processor; and a memory in communication with the at least one processor; wherein,

[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the control display method based on the stack panel described in any embodiment of the present invention.

[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the control display method based on the stack panel described in any embodiment of the present invention when executed.

[0019] According to another aspect of the present invention, a computer program product is provided, including a computer program, which, when executed by a processor, implements the control display method based on a stack panel as described in any embodiment of the present invention.

[0020] The technical solution of the embodiment of the present invention is to obtain the pressed position of the mouse in the stack panel corresponding to the current page; determine the initial positions of at least two controls in the stack panel; when it is determined that there is a first control whose initial position is consistent with the pressed position in the at least two controls, in response to the movement event of the mouse in the current page, obtain the current position of the mouse in the stack panel; determine the position offset data of the first control based on the pressed position, the current position and the control arrangement rule of the stack panel; when it is determined that there is a second control that meets the preset exchange condition in the at least two controls based on the position offset data and the initial position, move the second control from the initial position of the second control to the pressed position according to the position offset data, the preset animation parameters, the preset exchange ratio and the control properties of the second control. The problem of poor exchange effect caused by the exchange of icon positions in the prior art is solved, and the dragging and exchange of controls based on the stack panel is realized, so that the user can easily adjust the position of each control in the panel, and the intuitiveness and convenience of the interface operation are improved. At the same time, by obtaining and recording the current position of the mouse in real time, the position offset data of the control is quickly calculated according to the current position, and the interface response rate and operation fluency are improved. Furthermore, based on the position offset data and the initial position, it is determined that there is a second control that meets the preset exchange conditions among at least two controls, and the second control that meets the preset exchange conditions is exchanged with the first control to improve the accuracy of the exchange control, and then, based on the position offset data, preset animation parameters, preset exchange ratio and control properties of the second control, the second control is moved from the initial position of the second control to the pressed position, and the process of control exchange movement is clearly displayed, making the exchange process smoother and improving the display effect.

[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 is a flowchart of a control display method based on a stack panel provided according to Embodiment 1 of the present invention;

[0024] Figure 2 is a schematic diagram of the vertical arrangement of controls provided according to the first embodiment of the present invention;

[0025] Figure 3 is a schematic diagram of horizontal arrangement of controls provided according to Embodiment 1 of the present invention;

[0026] Figure 4 is a schematic diagram of a control display method provided in Embodiment 1 of the present invention;

[0027] Figure 5 is a structural schematic diagram of a control display device based on a stack panel provided according to Embodiment 2 of the present invention;

[0028] Figure 6 It is a structural schematic diagram of an electronic device that implements the control display method based on the stacked panel according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] Embodiment 1

[0032] Figure 1 This is a flowchart of a control display method based on a stack panel provided according to the first embodiment of the present invention. This embodiment can be applied to any situation where it is necessary to implement control dragging under a stack panel. The method can be executed by a control display device based on a stack panel. The control display device based on a stack panel can be implemented in the form of hardware and / or software. The control display device based on a stack panel can be configured in a computing device. Figure 1 As shown, the method includes:

[0033] S110 . In response to a mouse press event in the current page, obtain a mouse press position in a stack panel corresponding to the current page, and determine initial positions of at least two controls in the stack panel.

[0034] The current page may refer to an interface that displays controls laid out based on a stack panel, such as a menu, a list, or any interface that requires compact arrangement of similar control elements. These controls may be draggable controls in the interface, such as draggable lists, table headers, table rows, columns, and other controls. A stack panel may be a container for deploying controls, and a stack panel is used to arrange controls in order in rows or columns. For example, a schematic diagram of arranging controls in the vertical direction in column order can be seen in Figure 2 , a diagram of arranging controls horizontally in row order can be seen in Figure 3 The initial position can be used to represent the position of the control in the stack panel, and its position can be expressed in the form of horizontal and vertical coordinates. The press event is triggered when the user presses the mouse button.

[0035] In this embodiment, when the user presses the mouse button at a certain position in the current page, a mouse press event can be triggered. This event indicates that the user starts to interact with the current page. It may be that the user wants to press and hold a certain control in the current page and drag it to the position of another control. The initial position of each control in the stack panel can be obtained to determine whether the mouse is pressing a certain control.

[0036] For example, see Figure 4 , you can pre-build the stack panel, initialize the data, including but not limited to the preset swap ratio, animation duration, control arrangement rules inside the panel, etc., and listen to the panel's mouse press events, move events, release events, etc. After opening a page based on the stack panel, when the mouse is pressed on the current page, try to get the control at the mouse position, and at the same time get the mouse's pressed position relative to the stack panel. Check whether there is a control at the mouse press position.

[0037] S120: When it is determined that there is a first control whose initial position is consistent with the pressed position among the at least two controls, in response to a mouse movement event in the current page, obtain a current position of the mouse in the stack panel.

[0038] The move event is triggered when the mouse moves on the screen. The current position can be used to represent the moving position of the mouse during the mouse movement process.

[0039] In this embodiment, the pressed position and the initial position of each control can be compared. If there is an initial position that is consistent with the pressed position, it means that the mouse has triggered a press operation on a control in the page. The control corresponding to the initial position that is consistent with the pressed position can be used as the first control. When the mouse is pressed on the first control, the mouse movement event will be triggered when the mouse moves on the current page. During the process of dragging the mouse, the position of the mouse will change. The position of the mouse in the stacked panel can be recorded in real time. Each recorded position is the current position. The first control dragged by the mouse will move with the movement of the mouse in the current page.

[0040] For example, see Figure 4 If there is a control at the position where the mouse is pressed, the control at the position where the mouse is pressed is recorded as the first control and set to the grabbed state. At the same time, the position of the first control in the stack panel, i.e., the index, is recorded. Check whether the mouse is moved. When the mouse is moved, obtain the current position of the mouse relative to the stack panel after movement, so as to determine the control arrangement rules inside the panel and perform subsequent operations according to the control arrangement rules and the current position.

[0041] S130: Determine position offset data of the first control based on the pressed position, the current position, and a control arrangement rule of the stack panel.

[0042] The control arrangement rule may refer to a rule for arranging controls in a stack panel. There are at least two arrangement rules, one is a horizontal arrangement (ie, a horizontal arrangement), and the other is a vertical arrangement (ie, a vertical arrangement).

[0043] In this embodiment, the pressed position can be used as the initial moving position of the mouse, and then the first coordinate corresponding to the control arrangement rule can be determined from the pressed position, and the second coordinate corresponding to the control arrangement rule can be determined from the current position. The position offset data is determined according to the difference between the first coordinate and the second coordinate.

[0044] S140. When it is determined that there is a second control that meets the preset exchange condition among at least two controls based on the position offset data and the initial position, the second control is moved from the initial position of the second control to the pressed position according to the position offset data, the preset animation parameters, the preset exchange ratio and the control properties of the second control.

[0045] Among them, the preset exchange condition can be a condition for determining whether the second control exchanges positions with the first control. It should be noted that the first control and the second control are relative. For example, in one exchange process, control A is the first control and control B is the second control. In another exchange process, control D is the first control and control C is the second control. The preset animation parameters may refer to a series of parameter values ​​used to control the animation effect. For example, the preset animation parameters include but are not limited to animation duration, frame rate, resolution, scene settings, element actions, animation curves, rendering parameters, special effects parameters, and output formats, etc. Control properties can be used to characterize the characteristics and settings of controls. For example, spatial control properties include but are not limited to control length, control width, margins (including left margin, right margin), name, background color, foreground color, border style, etc.

[0046] In this embodiment, by comparing the position offset data with the initial positions of other controls except the first control, it can be determined whether there is a control that meets the preset exchange condition. If so, the control that meets the preset exchange condition can be used as the second control. Furthermore, the animation effect of each frame within the preset animation duration can be determined by presetting the animation duration and the margin of the second control. Playing according to the animation effect, the second control is moved from the initial position of the second control to the pressed position, so as to achieve the animation effect of changing the margin of the control played according to the set animation parameters.

[0047] In this embodiment, based on the position offset data and the initial position, determining whether there is a second control that meets the preset exchange condition among at least two controls includes: determining a second control that is different from the first control from the at least two controls; for each second control, based on the initial position of the second control and the first control, as well as the preset exchange ratio and the position offset data, determining the exchange offset value corresponding to the second control; when the position offset data is greater than the exchange offset value, determining that the second control meets the preset exchange condition.

[0048] The control that is different from the first control in the at least two controls can be used as the second control. The method of determining whether each second control meets the preset exchange condition is the same, and the method of determining whether any second control meets the preset exchange condition can be used as an example for introduction.

[0049] Specifically, it is possible to determine whether there are other controls between the second control and the first control based on the initial positions of the second control and the first control, and obtain a judgment result. According to the judgment result, combined with the preset exchange ratio and the position offset data, the exchange offset value corresponding to the second control is determined. The exchange offset value can be used to characterize the offset value that the control needs to be exchanged with the dragged control. The position offset data is compared with the exchange offset value. If the position offset data is greater than the exchange offset value, it can be said that the first control and the second control need to be exchanged, and it is considered that the second control meets the preset exchange condition.

[0050] For example, see Figure 4 When it is determined that there is a first control whose initial position is consistent with the pressed position among at least two controls, the initial position (or index) of the currently grabbed control (i.e., the first control) in the stack panel can be recorded, and the state of the first control located at the mouse pressed position can be set to the grabbed state. As the mouse moves, the absolute value of the position offset data is compared with the absolute value of the swap offset value, and if the position offset data is greater than the swap offset value, the controls are swapped.

[0051] In this embodiment, based on the initial positions of the second control and the first control, as well as a preset exchange ratio and position offset data, an exchange offset value corresponding to the second control is determined, including: if the second control is adjacent to the initial position of the first control, then based on the control properties of the second control, the preset exchange ratio and the position offset data, the exchange offset value corresponding to the second control is determined; if the second control is not adjacent to the initial position of the first control, an intermediate control located between the second control and the first control is determined; based on the preset exchange ratio, the position offset data, the control properties of the second control and the control properties of each intermediate control, the exchange offset value corresponding to the second control is determined.

[0052] In this embodiment, if there is no other control between the second control and the first control, it is considered that the two controls are initially adjacent. At this time, the control attribute of the second control and the preset exchange ratio can be multiplied to obtain the product value. Furthermore, the moving direction value of the mouse can be calculated according to the position offset data, and the product value and the moving direction value can be multiplied to obtain the exchange offset value corresponding to the second control. Exemplarily, if the position offset data is greater than the preset first threshold (such as the preset first threshold is 0), the moving direction value is equal to the preset second threshold (such as the preset second threshold is 1), otherwise the moving direction value is equal to the preset third threshold (such as the preset third threshold is 1).

[0053] In this embodiment, if there are other controls between the second control and the first control, it is considered that the two controls are not adjacent to each other at the initial position, and the controls between the second control and the first control can be regarded as intermediate controls. Further, the swap offset value corresponding to the second control can be determined in combination with the preset swap ratio, the moving direction value, the control attribute of the second control, and the control attribute of each intermediate control.

[0054] Optionally, based on a preset exchange ratio, position offset data, control properties of the second control, and control properties of each intermediate control, an exchange offset value corresponding to the second control is determined, including: determining a first intermediate value based on the preset exchange ratio and control properties of the second control; determining an interval distance based on the control properties of each intermediate control; determining a second intermediate value based on the first intermediate value and the interval distance; and determining an exchange offset value corresponding to the second control based on the position offset data and the second intermediate value.

[0055] In this embodiment, the preset exchange ratio and the control attribute of the second control may be multiplied to obtain a first intermediate value. The control attribute of each intermediate control (if the controls are arranged horizontally, the control attribute is the control width; if the controls are arranged vertically, the control attribute is the control height) is summed to obtain an interval distance. The first intermediate value and the interval distance are summed to obtain a second intermediate value. Further, the second intermediate value and the moving direction value determined based on the position offset data may be multiplied to obtain an exchange offset value corresponding to the second control.

[0056] For example, see Figure 4 , according to the recorded index of the first control, calculate the offset distance (i.e., the exchange offset value) required when other controls in the stack panel are exchanged. For example: there are 10 controls arranged horizontally in the stack panel, and their indexes are [1-10] respectively. Assuming that the first control is index 7, and the indexes of the second controls are: 1-6 and 8-10 respectively, the exchange offset value when the first control index 2 and the second control index 7 are exchanged is: exchange offset value = (width of the first control [2] × preset exchange ratio + width of the middle control [3 to 6]) × moving direction value.

[0057] In this embodiment, the second control is moved from the initial position of the second control to the pressed position according to the position offset data, the preset animation parameters, the preset exchange ratio and the control properties of the second control, including: obtaining a target exchange offset value corresponding to the second control; determining the control offset value of the second control based on the target exchange offset value, the preset exchange ratio and the control properties of the second control; determining the first playback parameter based on the position offset data and the control offset value; and moving the second control from the initial position of the second control to the pressed position according to the preset animation parameters and the first playback parameters.

[0058] Specifically, the swap offset value of the second control can be obtained from the swap offset value of the control determined above as the target swap offset value. The preset swap ratio and the control attribute of the second control (if the control is arranged horizontally, the control attribute is the control width; if the control is arranged vertically, the control attribute is the control height) are multiplied to obtain the product value. Furthermore, the target swap offset value and the product value can be differenced to obtain the control offset value. Furthermore, the direction of mouse movement can be determined by the position offset data, and the first playback parameter can be determined by combining the moving direction and the control offset value. The first playback parameter can characterize the margin of the movement of the second control. Furthermore, the first playback parameter can be played using a preset animation duration to move the second control from the initial position of the second control to the pressed position.

[0059] For example, see Figure 4 , the control offset value of the second control (s_offset) = exchange offset value - the width of the second control to be exchanged × preset exchange ratio. Set the first playback parameter of the second control according to the moving direction of the first control. For example, if the first control moves to the left, the first playback parameter of the second control is: [left: s_offset, top: 0, right: 0-s_offset, bottom: 0]. You can choose to play the first playback parameter of the control according to the set animation duration to change the animation effect during exchange.

[0060] In this embodiment, after moving the second control from the initial position of the second control to the pressed position, it also includes: updating the initial position of the second control in the stack panel based on the pressed position, and updating the pressed position based on the initial position of the second control before the update, so that after the current position of the mouse in the stack panel changes, based on the updated pressed position, the updated current position and the control arrangement rule, the position offset data of the first control is determined, and based on the position offset data and the updated initial position, it is determined that there is a second control that meets the preset exchange condition in at least two controls, so as to move the second control from the initial position of the second control to the updated pressed position.

[0061] It can be understood that after the second control is moved from the initial position of the second control to the pressed position, it indicates that the positions of the first control and the second control have changed. The position of the second control in the stack panel is moved to the original position of the first control, that is, the pressed position. The pressed position can be used to update the initial position of the second control in the stack panel. At the same time, the position of the first control in the stack panel is moved to the original position of the second control. At this time, the original initial position of the second control (that is, the initial position before the update) can be used as the position of the first control in the stack panel. However, the first control may not be released at this time and is still in the process of being selected and dragged. Therefore, the original initial position of the second control can be used to update the pressed position so that the control that is subsequently exchanged with the first control can be moved to the new pressed position.

[0062] In this embodiment, the control display method of the stack panel also includes: in response to a release event of the mouse in the current page, if there is no second control that meets the preset exchange condition, determining the second playback parameter of the first control based on the position offset data; moving the first control from the current position of the first control to the updated pressed position based on the preset animation parameters and the second playback parameters; updating the initial position of the first control in the stack panel based on the updated pressed position, so as to determine the updated initial positions of at least two controls in the stack panel in the stack panel when responding to the mouse press event in the current page again.

[0063] Among them, the release event is triggered when the user releases the mouse button.

[0064] In this embodiment, when the user releases the mouse button, the release event of the mouse can be triggered. If there is no second control that meets the preset exchange condition at this time, the first control needs to be moved to the updated pressed position. At this time, the moving direction value of the mouse can be determined based on the position offset data, and the second playback parameter of the first control can be determined according to the moving direction value and the position offset data. The second playback parameter can characterize the margin of the movement of the first control. Further, the second playback parameter can be played using a preset animation duration to move the first control from the current position of the first control to the updated pressed position. The updated pressed position is used to update the initial position of the first control in the stacked panel, so that when the mouse is pressed again in the current page, the correctness of the initial position of at least two controls in the stacked panel obtained in the stacked panel is guaranteed. At the same time, according to the change of the position of the control, the smooth movement of the control is achieved by changing its playback parameter.

[0065] For example, see Figure 4, listen to whether the mouse is released. When the mouse is released, check whether there is a control grabbed. If a control is grabbed, play the second playback parameter of the first control according to the set animation time, and change the animation from the current position to the pressed position. Determine the second playback parameter of the first control as: [left: moving direction value × position offset data, up: 0, right: 0-(moving direction value × position offset data), down: 0]. Rearrange all controls in the stack panel according to the current exchange position, and reset the playback parameters of all controls to [left: 0, up: 0, right: 0, down: 0], and refresh the control layout.

[0066] It is understandable that if the pressed position has not been updated, then according to the preset animation parameters and the second playback parameters, the first control is moved from the current position of the first control to the pressed position, and the pressed position at this time is the initial position of the first control in the stacked panel. There is no need to update the initial position of the first control in the stacked panel based on the pressed position.

[0067] The technical solution of this embodiment is to obtain the pressed position of the mouse in the stack panel corresponding to the current page; determine the initial positions of at least two controls in the stack panel; when it is determined that there is a first control whose initial position is consistent with the pressed position in at least two controls, in response to the movement event of the mouse in the current page, obtain the current position of the mouse in the stack panel; determine the position offset data of the first control based on the pressed position, the current position and the control arrangement rule of the stack panel; when it is determined that there is a second control that meets the preset exchange condition in at least two controls based on the position offset data and the initial position, move the second control from the initial position of the second control to the pressed position according to the position offset data, the preset animation parameters, the preset exchange ratio and the control properties of the second control. The problem of poor exchange effect caused by the exchange of icon positions in the prior art is solved, and the dragging and exchange of controls based on the stack panel is realized, so that the user can easily adjust the position of each control in the panel, and the intuitiveness and convenience of the interface operation are improved. At the same time, by obtaining and recording the current position of the mouse in real time, the position offset data of the control is quickly calculated according to the current position, and the interface response rate and operation fluency are improved. Furthermore, based on the position offset data and the initial position, it is determined that there is a second control that meets the preset exchange conditions among at least two controls, and the second control that meets the preset exchange conditions is exchanged with the first control to improve the accuracy of the exchange control, and then, based on the position offset data, preset animation parameters, preset exchange ratio and control properties of the second control, the second control is moved from the initial position of the second control to the pressed position, and the process of control exchange movement is clearly displayed, making the exchange process smoother and improving the display effect.

[0068] Embodiment 2

[0069] Figure 5 1 is a schematic diagram of a control display device based on a stack panel according to Embodiment 2 of the present invention. Figure 5 As shown, the device includes: a press event response module 210, a movement event response module 220, a position offset data determination module 230 and a movement module 240.

[0070] Among them, the press event response module 210 is used to respond to the press event of the mouse in the current page, obtain the press position of the mouse in the stack panel corresponding to the current page, and determine the initial positions of at least two controls in the stack panel in the stack panel; the move event response module 220 is used to respond to the move event of the mouse in the current page to obtain the current position of the mouse in the stack panel when it is determined that there is a first control whose initial position is consistent with the press position among the at least two controls; the position offset data determination module 230 is used to determine the position offset data of the first control based on the press position, the current position and the control arrangement rule of the stack panel; the move module 240 is used to move the second control from the initial position of the second control to the press position according to the preset animation parameters, the preset exchange ratio and the control properties of the second control when it is determined that there is a second control that meets the preset exchange condition among the at least two controls based on the position offset data and the initial position.

[0071] The technical solution of this embodiment is to obtain the pressed position of the mouse in the stack panel corresponding to the current page; determine the initial positions of at least two controls in the stack panel; when it is determined that there is a first control whose initial position is consistent with the pressed position in at least two controls, in response to the movement event of the mouse in the current page, obtain the current position of the mouse in the stack panel; determine the position offset data of the first control based on the pressed position, the current position and the control arrangement rule of the stack panel; when it is determined that there is a second control that meets the preset exchange condition in at least two controls based on the position offset data and the initial position, move the second control from the initial position of the second control to the pressed position according to the position offset data, the preset animation parameters, the preset exchange ratio and the control properties of the second control. The problem of poor exchange effect caused by the exchange of icon positions in the prior art is solved, and the dragging and exchange of controls based on the stack panel is realized, so that the user can easily adjust the position of each control in the panel, and the intuitiveness and convenience of the interface operation are improved. At the same time, by obtaining and recording the current position of the mouse in real time, the position offset data of the control is quickly calculated according to the current position, and the interface response rate and operation fluency are improved. Furthermore, based on the position offset data and the initial position, it is determined that there is a second control that meets the preset exchange conditions among at least two controls, and the second control that meets the preset exchange conditions is exchanged with the first control to improve the accuracy of the exchange control, and then, based on the position offset data, preset animation parameters, preset exchange ratio and control properties of the second control, the second control is moved from the initial position of the second control to the pressed position, and the process of control exchange movement is clearly displayed, making the exchange process smoother and improving the display effect.

[0072] On the basis of the above device, optionally, the mobile module 240 includes:

[0073] A second control determination unit is used to determine a second control that is different from the first control from the at least two controls; an exchange offset value determination unit is used to determine, for each second control, an exchange offset value corresponding to the second control based on the initial position of the second control and the first control, a preset exchange ratio and the position offset data; and a judgment unit is used to determine that the second control meets the preset exchange condition when the position offset data is greater than the exchange offset value.

[0074] Based on the above device, optionally, the exchange offset value determination unit includes:

[0075] an adjacent determining unit, configured to determine, if the second control is adjacent to the initial position of the first control, a swap offset value corresponding to the second control based on a control property of the second control, a preset swap ratio and the position offset data;

[0076] A non-adjacent determination unit is used to determine an intermediate control located between the second control and the first control if the initial positions of the second control are not adjacent to the first control; and determine an exchange offset value corresponding to the second control based on the preset exchange ratio, the position offset data, the control properties of the second control and the control properties of each of the intermediate controls.

[0077] Based on the above device, optionally, the non-adjacent determination unit includes:

[0078] A first intermediate value determination unit is used to determine a first intermediate value based on the preset exchange ratio and the control properties of the second control; an interval distance determination unit is used to determine an interval distance based on the control properties of each of the intermediate controls; a second intermediate value determination unit is used to determine a second intermediate value based on the first intermediate value and the interval distance; and an exchange offset value determination subunit is used to determine an exchange offset value corresponding to the second control based on the position offset data and the second intermediate value.

[0079] Based on the above device, optionally, the mobile module 240 includes:

[0080] a target swap offset value determining unit, configured to obtain a target swap offset value corresponding to the second control;

[0081] a determining unit, configured to determine a control offset value of the second control based on a target exchange offset value, a preset exchange ratio, and a control property of the second control;

[0082] a control offset value determining unit, configured to determine a first playback parameter based on the position offset data and the control offset value;

[0083] A moving unit is used to move the second control from an initial position of the second control to the pressed position according to preset animation parameters and the first play parameters.

[0084] On the basis of the above device, optionally, the device further includes:

[0085] A first position updating unit is used to update the initial position of the second control in the stack panel based on the pressed position, and to update the pressed position based on the initial position of the second control before the update, so as to determine the position offset data of the first control based on the updated pressed position, the updated current position and the control arrangement rule after the current position of the mouse in the stack panel changes, and to determine whether there is a second control that meets the preset exchange condition among the at least two controls based on the position offset data and the updated initial position, so as to move the second control from the initial position of the second control to the updated pressed position.

[0086] On the basis of the above device, optionally, the device further includes:

[0087] A second playback parameter determination unit, configured to determine, in response to a release event of the mouse in the current page, a second playback parameter of the first control according to the position offset data if there is no second control that satisfies a preset exchange condition;

[0088] A playing unit, configured to move the first control from a current position of the first control to the updated pressed position according to the preset animation parameter and the second playing parameter;

[0089] The second position updating unit is used to update the initial position of the first control in the stack panel based on the updated pressed position, so as to determine the updated initial positions of at least two controls in the stack panel in the stack panel when responding to the mouse press event in the current page again.

[0090] The control display device based on stacked panels provided in the embodiment of the present invention can execute the control display method based on stacked panels provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0091] Embodiment 3

[0092] Figure 6 It is a structural schematic diagram of an electronic device that implements a control display method based on a stacked panel according to an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0093] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0094] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0095] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a control display method based on a stack panel.

[0096] In some embodiments, the control display method based on the stack panel can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the control display method based on the stack panel described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the control display method based on the stack panel by any other appropriate means (for example, by means of firmware).

[0097] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0098] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0099] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0100] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0101] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0102] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0103] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements a control display method based on a stack panel as provided in any embodiment of the present invention.

[0104] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0105] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0106] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A control display method based on a stack panel, characterized in that: include: In response to a mouse press event in a current page, obtaining a mouse press position in a stack panel corresponding to the current page, and determining initial positions of at least two controls in the stack panel in the stack panel; When it is determined that there is a first control whose initial position is consistent with the pressed position among the at least two controls, in response to a movement event of the mouse in the current page, obtaining a current position of the mouse in the stack panel; Determining position offset data of the first control based on the pressed position, the current position, and a control arrangement rule of the stack panel; When it is determined that there is a second control that meets the preset exchange condition among the at least two controls based on the position offset data and the initial position, the second control is moved from the initial position of the second control to the pressed position according to the position offset data, preset animation parameters, preset exchange ratio and control properties of the second control.

2. The method according to claim 1, characterized in that The determining, based on the position offset data and the initial position, that there is a second control that satisfies a preset exchange condition among the at least two controls includes: Determining a second control different from the first control from the at least two controls; For each second control, based on the initial positions of the second control and the first control, as well as a preset exchange ratio and the position offset data, determining an exchange offset value corresponding to the second control; When the position offset data is greater than the exchange offset value, it is determined that the second control meets a preset exchange condition.

3. The method according to claim 2, characterized in that The determining, based on the initial positions of the second control and the first control, a preset exchange ratio and the position offset data, a swap offset value corresponding to the second control includes: If the second control is adjacent to the initial position of the first control, determining a swap offset value corresponding to the second control based on the control property of the second control, a preset swap ratio and the position offset data; If the initial positions of the second control and the first control are not adjacent, determining an intermediate control between the second control and the first control; Based on the preset exchange ratio, the position offset data, the control properties of the second control, and the control properties of each of the intermediate controls, a swap offset value corresponding to the second control is determined.

4. The method according to claim 3, characterized in that The determining, based on the preset exchange ratio, the position offset data, the control attribute of the second control, and the control attribute of each of the intermediate controls, the exchange offset value corresponding to the second control includes: Determining a first intermediate value based on the preset exchange ratio and a control property of the second control; Determine the spacing distance based on the control attribute of each of the intermediate controls; determining a second intermediate value based on the first intermediate value and the interval distance; Based on the position offset data and the second intermediate value, a swap offset value corresponding to the second control is determined.

5. The method according to claim 1, characterized in that The step of moving the second control from an initial position of the second control to the pressed position according to the position offset data, the preset animation parameters, the preset exchange ratio, and the control property of the second control comprises: Obtaining a target swap offset value corresponding to the second control; Determining a control offset value of the second control based on a target exchange offset value, a preset exchange ratio, and a control property of the second control; Determining a first playback parameter based on the position offset data and the control offset value; The second control is moved from an initial position of the second control to the pressed position according to preset animation parameters and the first play parameters.

6. The method according to claim 1, characterized in that After moving the second control from the initial position of the second control to the pressed position, the method further includes: updating an initial position of the second control in the stack panel based on the pressed position, and, The pressed position is updated based on the initial position of the second control before being updated, so as to determine the position offset data of the first control based on the updated pressed position, the updated current position and the control arrangement rule after the current position of the mouse in the stack panel changes, and to determine whether there is a second control that meets the preset exchange condition among the at least two controls based on the position offset data and the updated initial position, so as to move the second control from the initial position of the second control to the updated pressed position.

7. The method according to claim 6, characterized in that The method further comprises: In response to a release event of the mouse in the current page, if there is no second control that meets the preset exchange condition, determining a second playback parameter of the first control according to the position offset data; According to the preset animation parameter and the second playback parameter, moving the first control from the current position of the first control to the updated pressed position; The initial position of the first control in the stack panel is updated based on the updated pressed position, so as to determine the updated initial positions of at least two controls in the stack panel in the stack panel when responding to a press event of the mouse in the current page again.

8. A control display device based on a stack panel, characterized in that: include: A press event response module, used for obtaining the pressed position of the mouse in the stack panel corresponding to the current page in response to the press event of the mouse in the current page, and determining the initial positions of at least two controls in the stack panel in the stack panel; a movement event response module, configured to obtain the current position of the mouse in the stacked panel in response to a movement event of the mouse in the current page when it is determined that there is a first control whose initial position is consistent with the pressed position among the at least two controls; A position offset data determination module, configured to determine the position offset data of the first control based on the pressed position, the current position and a control arrangement rule of the stack panel; A moving module is used to move the second control from the initial position of the second control to the pressed position according to preset animation parameters, preset exchange ratio and control properties of the second control when it is determined that there is a second control that meets the preset exchange condition among the at least two controls based on the position offset data and the initial position.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the control display method based on the stack panel according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the control display method based on a stacked panel according to any one of claims 1 to 7 when executed.