CN111240678B - Pop-up window setting method and device, electronic equipment and storage medium - Google Patents

Pop-up window setting method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111240678B
CN111240678B CN202010033211.0A CN202010033211A CN111240678B CN 111240678 B CN111240678 B CN 111240678B CN 202010033211 A CN202010033211 A CN 202010033211A CN 111240678 B CN111240678 B CN 111240678B
Authority
CN
China
Prior art keywords
window
pop
control
proxy
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010033211.0A
Other languages
Chinese (zh)
Other versions
CN111240678A (en
Inventor
冯伟超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202010033211.0A priority Critical patent/CN111240678B/en
Publication of CN111240678A publication Critical patent/CN111240678A/en
Application granted granted Critical
Publication of CN111240678B publication Critical patent/CN111240678B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention provides a pop-up window setting method and device, electronic equipment and storage medium, wherein the method comprises the following steps: creating a pop-up window template; the window manager is called by adopting a popup window template reflection, and a proxy window manager corresponding to the window manager is generated; in response to the control adding instruction sent to the window manager, the proxy window manager generates a proxy control corresponding to the target control; adding the target control into the proxy control to generate a target proxy control; the target agent control is a parent control of the target control; invoking a window manager to add the target agent control to the pop-up window template to generate a pop-up window; a pop-up window is displayed. The embodiment of the invention can solve the problems that the priority of the developer is lower than that of the system and the touch event cannot be acquired, avoid instability caused by version difference, and enable the pop-up window to be normally displayed at the preset position of the developer when the pop-up window is displayed for the first time.

Description

Pop-up window setting method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computers, and in particular, to a method and apparatus for setting a pop-up window, an electronic device, and a storage medium.
Background
In Android (Android) daily development, we often use various popup windows, and popup windows (popuppwindow) belong to one of them. The method has the advantages that the customization is easy, the positioning is simple, but the method has various defects that the system native popup window is complicated to create, a lot of repeated template methods are needed to be written in each creation, the priority of a developer is lower than that of the system, touch events are transmitted to default consumption processing and cannot be transmitted to the outside, the touch events cannot be acquired, the instability is high due to large difference of system versions, the popup window cannot be displayed at a preset position of the developer when being displayed for the first time, the background cannot be subjected to fuzzy processing and the like, and the developer is unwilling to use the popup window for development.
Disclosure of Invention
In view of the foregoing, the present invention has been made to provide a pop-up window setting method and apparatus, an electronic device, and a storage medium, which overcome or at least partially solve the foregoing problems, including:
in order to solve the above problems, an embodiment of the present invention discloses a pop-up window setting method, which includes:
creating a pop-up window template;
reflecting and calling a window manager by adopting the popup window template, and generating a proxy window manager corresponding to the window manager;
responding to an instruction of adding a control sent to the window manager, and generating a proxy control corresponding to a target control by the proxy window manager;
adding the target control to the proxy control to generate a target proxy control; the target agent control is a parent control of the target control;
invoking the window manager to add the target agent control to the pop-up window template to generate a pop-up window;
and displaying the pop-up window.
Preferably, the step of creating a pop-up window template includes:
inheriting preset pop-up window template parameters;
and creating a popup window template based on the popup window template parameters.
Preferably, after the step of creating the pop-up window template based on the pop-up window template parameter, the method further includes:
receiving an identity identifier returned by a user;
analyzing the identity mark by adopting layout service to obtain a target control;
and measuring the target control and storing the measured parameters.
Preferably, before the step of generating the proxy control corresponding to the target control by the proxy window manager in response to the control adding instruction sent to the window manager, the method further includes:
saving the window manager as a variable of the proxy window manager;
detecting whether a variable of the proxy window manager is empty;
and if the variable is not null, executing the step of responding to the control adding instruction sent to the window manager and generating a proxy control corresponding to the target control by the proxy window manager.
Preferably, the method further comprises:
if the variable is empty, recreating a reflection between the pop-up window template and the window manager;
and when the re-creation fails, outputting a record log.
Preferably, the step of displaying the pop-up window includes:
judging whether an anchor point exists in the screen;
if an anchor point exists in the screen, acquiring coordinates of the anchor point;
calling position parameters to calculate coordinates of the popup window in the screen according to the measured parameters and coordinates of the anchor point;
and displaying the pop-up window according to the coordinates.
Preferably, the method further comprises:
if no anchor point exists in the screen, acquiring the width and the height of the screen;
calling position parameters to calculate coordinates of the pop-up window in the screen according to the measured parameters and the width and height of the screen;
and displaying the pop-up window according to the coordinates.
Preferably, the step of calculating coordinates of the pop-up window in the screen according to the measured parameters and coordinates of the anchor point by calling position parameters includes:
judging the relative position of the pop-up window and the anchor point according to the position parameter;
and calculating the coordinates of the pop-up window in the screen by adopting the relative position, the measured parameters and the coordinates of the anchor point.
Preferably, the step of calculating coordinates of the pop-up window in the screen according to the measured parameters and the width and height of the screen by calling position parameters includes:
judging the position of the pop-up window in the screen according to the position parameter;
and calculating coordinates of the pop-up window in the screen by using the position, the measured parameters and the width and height of the screen.
Preferably, the target agent control comprises a background control, and the background control is used for setting the background.
The embodiment of the invention also discloses a device for setting the pop-up window, which comprises:
the creation module is used for creating a pop-up window template;
the reflection module is used for reflecting and calling a window manager by adopting the pop-up window template and generating a proxy window manager corresponding to the window manager;
the agent control generation module is used for responding to an adding control instruction sent to the window manager, and the agent window manager generates an agent control corresponding to the target control;
the target agent control generation module is used for adding the target control into the agent control to generate a target agent control; the target agent control is a parent control of the target control;
a pop-up window generation module for invoking the window manager to add the target agent control to the pop-up window template to generate a pop-up window;
and the display module is used for displaying the popup window.
The embodiment of the invention also provides electronic equipment, which comprises a processor, a memory and a computer program stored on the memory and capable of running on the processor, wherein the computer program realizes the steps of the pop-up window setting method when being executed by the processor.
The embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the steps of the pop-up window setting method when being executed by a processor.
The invention has the following advantages:
in the embodiment of the invention, the pop-up window template is created, the pop-up window template is adopted to reflect and call the window manager, the proxy window manager corresponding to the window manager is generated, the proxy window manager generates the proxy control corresponding to the target control in response to the adding control instruction sent to the window manager, the target control is added to the proxy control, the target proxy control is generated, the pop-up window is called to add the target proxy control to the pop-up window template to generate the pop-up window, and the pop-up window is displayed, so that a developer does not need to start to create the pop-up window by self-restarting in the development process using the pop-up window, the complex repeated construction method is avoided, the problem that the priority of the developer is lower than that of the system, the touch event cannot be acquired is solved, the instability caused by version difference is avoided, the pop-up window can be normally displayed at the preset position of the developer when the pop-up window is displayed for the first time, and the background can be subjected to fuzzy processing.
Drawings
In order to more clearly illustrate the technical solutions of the present invention, the drawings that are needed in the description of the present invention will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a flowchart of steps of a method for setting a pop-up window according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of another pop-up window setting method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a prior art pop-up window display method;
FIG. 4 is a schematic diagram of another prior art pop-up window display method;
FIG. 5 is a schematic illustration of a pop-up window coordinate calculation according to an embodiment of the present invention;
fig. 6 is a block diagram of a pop-up window setting device according to an embodiment of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description. It will be apparent that the described embodiments are some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, a step flowchart of a pop-up window setting method provided by an embodiment of the present invention is shown, where the method specifically may include the following steps:
step 101, creating a pop-up window template;
in the process of developing an android system, a pop-up window (P pop window) is often required to be used for development, and in the process of creating a pop-up window, complex data setting is required, so that in order to reduce workload, a developer can directly use a pop-up window template (basepop) preset in the android development system to create the pop-up window. Some common parameters of the popup window in the popup window template are set, and a developer can generate the popup window by adding own controls and animation effects on the basis of the popup window template.
Step 102, adopting the popup window template to reflect and call a window manager, and generating a proxy window manager corresponding to the window manager;
the window manager (WindowManager) is used to add a control (C ontentiview) to the created pop-up window template, which is dynamically generated, and the system cannot directly know whether the window manager has been generated. Therefore, in order to generate the proxy window manager (WindowManager Proxy) corresponding to the window manager, in the embodiment of the invention, a pop-up window template is used to make a reflection call to the window manager, whether the window manager has been generated is obtained through whether the reflection is successfully established, and if the reflection is successfully established, the proxy window manager (windowmanager proxy) corresponding to the window manager can be generated. In addition, in order to facilitate modification and use of codes, a corresponding proxy pop-up window (popuppwindowproxy) can be created for the pop-up window template, and the proxy pop-up window is adopted to make a reflection call to the window manager, which is not limited by the present invention.
It should be noted that: the primary role of the proxy is to provide a proxy for other objects to control access to this object. In some cases, one object cannot directly reference another object, while a proxy object may act as an intermediary between the proxied object and the target object, and the proxy object may inherit all parameters of the proxied object. In the embodiment of the invention, the agent window manager is generated, so that the control adding instruction sent by the pop-up window template to the window manager can be intercepted, and the control needing to be added is modified.
While reflection, i.e. in the running state, for any one class, all properties and methods of that class can be known; any method and attribute of any object can be called; the function of the dynamically acquired information and the method for dynamically calling the object is called reflection, and because the window manager is dynamically generated and cannot be predicted in advance, whether the window manager is generated or not is known in a reflection mode, and the proxy window manager corresponding to the window manager can be effectively created only after the window manager is generated.
Step 103, responding to an instruction of adding a control sent to the window manager, and generating a proxy control corresponding to the target control by the proxy window manager;
after the proxy window manager is generated, in order to add the control to the pop-up window template, a developer sends an instruction addView () method for adding the control to the window manager by using the system, because the proxy window manager exists, the instruction for adding the control is intercepted by the proxy window manager before being transmitted to the window manager, after the proxy window manager intercepts the instruction for adding the control, a target control needing to be added can be determined according to the identity of the control carried in the instruction, and a proxy control (ContentViewProxy) corresponding to the target control is generated.
104, adding the target control to the proxy control to generate a target proxy control; the target agent control is a parent control of the target control;
after the proxy control is generated, adding the target control into the proxy control to generate the target proxy control, so that the proxy control becomes a parent control of the target control. Because the target control is already a child control, a developer can carry out custom measurement and layout on the target control, and because the target agent control is a father control, the target control has higher priority than the target control, when the information is transmitted, the target control is preferentially acquired by the target agent control, and after the acquisition, the information is transmitted to the pop-up window by interception and monitoring, so that the information is used by the developer. In addition, the target agent control can also comprise a background control, and a developer can use the background control to add a background effect, such as background blurring, to the popup window.
Step 105, calling the window manager to add the target agent control to the popup window template to generate a popup window;
after the agent control is generated, the system calls a window manager, and adds the target agent control into the pop-up window template through an addView () method of an instruction of the adding control.
And 106, displaying a popup window.
After the pop-up window is generated, a display instruction show () method can be called to set the layout of the pop-up window, and the pop-up window can be displayed on the screen after the setting is completed.
In the embodiment of the invention, the pop-up window template is created, the pop-up window template is adopted to reflect and call the window manager, the proxy window manager corresponding to the window manager is generated, the proxy window manager generates the proxy control corresponding to the target control in response to the adding control instruction sent to the window manager, the target control is added to the proxy control, the target proxy control is generated, the pop-up window template is called to add the target proxy control to the pop-up window template to generate the pop-up window, the pop-up window is displayed, a developer does not need to start to create the pop-up window by self-restarting in the development process using the pop-up window, the problem that the priority of the developer is lower than that of a system, and touch event information cannot be acquired is solved, meanwhile, the wide and high positions of the proxy control are all measured by the developer, namely all versions are unified into a measuring scheme of the developer, instability caused by version differences is avoided, the developer can also self-define the target proxy control, and the developer can process fuzzy control in background addition.
Referring to fig. 2, a flowchart illustrating steps of another pop-up window setting method provided by an embodiment of the present invention may specifically include the following steps:
step 201, creating a pop-up window template;
since this step is similar to step 101, the detailed description will refer to step 101, and will not be repeated here.
In a preferred embodiment of the present invention, step 201 may further comprise the sub-steps of:
inheriting preset pop-up window template parameters;
and creating a popup window template based on the popup window template parameters.
The method comprises the steps of providing a preset popup window template in an android development system, acquiring various attributes and methods of the popup window template through inheritance, and creating a new popup window template for generating a popup window based on the acquired various attributes and methods.
Step 202, receiving an identity returned by a user;
step 203, analyzing the identity mark by adopting a layout service to obtain a target control;
step 204, measuring the target control and saving the measured parameters;
after the pop-up window template is created, the developer sets the target control to be added, and returns the identity of the target control to the system, and as an example, the identity may be an ID, that is, the ID of the target control is returned to the system, and the system calls a layout service (layoutinfo) to parse the identity, obtain the target control, measure the width and height of the target control, and store the measured parameter for use in a subsequent layout.
Step 205, adopting the popup window template to reflect and call a window manager, and generating a proxy window manager corresponding to the window manager;
since this step is similar to step 102, reference to step 102 is made for similar descriptions, and is not repeated here.
Step 206, saving the window manager as a variable of the proxy window manager;
step 207, detecting whether the variable of the proxy window manager is empty;
step 208, if the variable is not null, executing the step of responding to the control adding instruction sent to the window manager, and generating a proxy control corresponding to the target control by the proxy window manager;
in order to ensure that the reflection between the pop-up window template and the window manager is established, the window manager is wrapped in the proxy window manager and stored as a member variable of the proxy window manager, and when the setContentView () method is called to perform control layout, whether the reflection is established can be judged by detecting the member variable. If the variable is not null, the reflection is established, and the proxy window manager continues to execute the step of intercepting the command of adding the control to generate the proxy control corresponding to the target control. If the variable is empty, the reflection is not established, a flow for establishing the reflection is initiated, if the reflection is failed to be established again, the reflection is judged to be unable to be established, the whole flow is ended, and a log is output for reference by a developer. It should be noted that, in order to facilitate modification and use of the code, a corresponding proxy pop-up window may also be created for the pop-up window template, and a reflection call of the proxy pop-up window to the window manager may be created, which is not limited in this regard by the present invention.
Step 209, responding to an instruction of adding a control sent to the window manager, and generating a proxy control corresponding to the target control by the proxy window manager;
step 210, adding the target control to a proxy control to generate a target proxy control; the target agent control is a parent control of the target control;
step 211, calling the window manager to add the target agent control to the popup window template to generate a popup window;
since steps 209 to 211 are similar to steps 103 to 105, similar descriptions will refer to steps 103 to 105, and will not be repeated here.
Step 212, displaying the popup window.
In a preferred embodiment of the present invention, step 212 further comprises the sub-steps of:
judging whether an anchor point exists in the screen;
if an anchor point exists in the screen, acquiring coordinates of the anchor point;
calling position parameters to calculate coordinates of the popup window in the screen according to the measured parameters and coordinates of the anchor point;
and displaying the pop-up window according to the coordinates.
Before the popup window is displayed, the measurement of the target control and the layout processing of the popup window are required. In order to reduce the difficulty of a developer in controlling the position of the pop-up window during layout, the embodiment of the invention calls the position parameter gradient, and the position of the pop-up window is controlled through the position parameter and the anchor point.
As shown in fig. 3, the screen in fig. 3 does not designate an anchor point, and the position parameter acts on the whole screen and is displayed at the position on the screen, and when the position parameter is the gray.top, the pop-up window 301 is displayed above the screen.
For example, in fig. 4, when an anchor point is designated in the screen, the position parameter acts on the anchor point and is displayed at the relative position of the anchor point, and when the position parameter is a gradient.
Therefore, when the coordinates of the pop-up window on the screen are calculated, whether the anchor point exists in the screen is judged, if the anchor point exists in the screen, the coordinates of the anchor point are obtained, the relative position of the pop-up window and the anchor point is judged according to the position parameters, and then the coordinates of the pop-up window in the screen are calculated according to the obtained width and height parameters and the position parameters of the target control. Taking the position parameter as the gradient. Left as an example, after the anchor point coordinate is obtained, judging that the pop-up window is on the right of the anchor point, subtracting the width of the target control from the anchor point coordinate to obtain the coordinate of the upper left corner of the pop-up window, calculating the coordinates of the rest 3 points of the pop-up window according to the width and height of the target control, and displaying the pop-up window at the corresponding position according to the calculated coordinates.
In another preferred embodiment of the present invention, step 212 further comprises the sub-steps of:
if no anchor point exists in the screen, acquiring the width and the height of the screen;
calling position parameters to calculate coordinates of the pop-up window in the screen according to the measured parameters and the width and height of the screen;
and displaying the pop-up window according to the coordinates.
When judging that the anchor point does not exist in the screen, acquiring the width and the height of the screen, calling the position parameters to judge the position of the pop-up window in the screen, and calculating the coordinates of the pop-up window in the screen by utilizing the acquired width and the height of the target control and the acquired width and the height of the screen. As shown in fig. 5, when the position parameter is the gravity.right, it is determined that the pop-up window 501 is on the right side of the screen 502, so that the coordinates of the upper left corner of the pop-up window can be obtained by subtracting the width of the target control from the width of the screen, then the coordinates of the remaining 3 points of the pop-up window can be calculated according to the width and height of the target control, and the pop-up window is displayed at the corresponding position according to the calculated coordinates.
In the embodiment of the invention, the popup window is generated by inheriting the popup window template, and the popup window is laid out and displayed by calling the position parameter and combining with the anchor point, so that a developer does not need to spend a large amount of time writing the layout code, and the layout precision is improved.
Referring to fig. 6, a structural block diagram of a pop-up window setting method according to an embodiment of the present invention is shown, where the device may include the following modules:
a creating module 601, configured to create a pop-up window template;
the reflection module 602 is configured to reflect and call a window manager by using the pop-up window template, and generate a proxy window manager corresponding to the window manager;
the proxy control generation module 603 is configured to respond to an add control instruction sent to the window manager, where the proxy window manager generates a proxy control corresponding to the target control;
the target agent control generation module 604 is configured to add the target control to an agent control, and generate a target agent control; the target agent control is a parent control of the target control;
a pop-up window generation module 605 for invoking the window manager to add the target agent control to the pop-up window template to generate a pop-up window;
and a display module 606, configured to display the pop-up window.
In one embodiment of the present invention, the creating module 601 includes:
the inheritance sub-module is used for inheriting preset popup window template parameters;
and the template creation sub-module is used for creating a popup window template based on the popup window template parameters.
In an embodiment of the invention, the apparatus further comprises:
the identity identification receiving module is used for receiving the identity identification returned by the user;
the analysis module is used for analyzing the identity mark by adopting a layout service to obtain a target control;
and the measurement module is used for measuring the target control and storing the measured parameters.
In an embodiment of the invention, the apparatus further comprises:
the variable module is used for saving the window manager as a variable of the proxy window manager;
the detection module is used for detecting whether the variable of the proxy window manager is empty or not;
and the call execution module is used for executing the step of responding to the control adding instruction sent to the window manager and generating the proxy control corresponding to the target control by the proxy window manager if the variable is not null.
In an embodiment of the invention, the apparatus further comprises:
a recreating reflection module for recreating reflection between the pop-up window template and the window manager if the variable is empty;
and the log recording module is used for outputting a log recording when the re-creation fails.
In an embodiment of the present invention, the display module 606 further includes:
the anchor point judging sub-module is used for judging whether an anchor point exists in the screen or not;
the anchor point coordinate acquisition sub-module is used for acquiring the coordinates of an anchor point if the anchor point exists in the screen;
the first calculation sub-module is used for calling the position parameters to calculate the coordinates of the pop-up window in the screen according to the measured parameters and the coordinates of the anchor point;
a screen parameter obtaining sub-module, configured to obtain a width and a height of the screen if no anchor point exists in the screen;
the second calculation sub-module is used for calling position parameters to calculate coordinates of the pop-up window in the screen according to the measured parameters and the width and height of the screen;
and the pop-up window display sub-module is used for displaying the pop-up window according to the coordinates.
In an embodiment of the present invention, the first computing sub-module further includes:
the relative position judging subunit is used for judging the relative position of the pop-up window and the anchor point according to the position parameter;
and the first popup window coordinate calculating subunit is used for calculating the coordinates of the popup window in the screen by adopting the relative position, the measured parameters and the coordinates of the anchor point.
In an embodiment of the present invention, the second computing sub-module further includes:
a pop-up window position judging subunit, configured to judge a position of the pop-up window in a screen according to the position parameter;
and a second pop-up window coordinate calculating subunit for calculating coordinates of the pop-up window in the screen by using the position, the measured parameter and the width and height of the screen.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
An embodiment of the present invention further provides an electronic device, which may include a processor, a memory, and a computer program stored on the memory and capable of running on the processor, the computer program implementing the steps of the pop-up window setting method as above when executed by the processor.
An embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the steps of the pop-up window setting method as above.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the invention may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The method and device for setting pop-up window, electronic device and storage medium provided by the invention are described in detail, and specific examples are applied to illustrate the principle and implementation of the invention, and the description of the above examples is only used for helping to understand the method and core idea of the invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (13)

1. A method for setting a pop-up window, the method comprising:
creating a pop-up window template;
reflecting and calling a window manager by adopting the popup window template, and generating a proxy window manager corresponding to the window manager;
responding to an instruction of adding a control sent to the window manager, and generating a proxy control corresponding to a target control by the proxy window manager;
adding the target control to the proxy control to generate a target proxy control; the target agent control is a parent control of the target control;
invoking the window manager to add the target agent control to the pop-up window template to generate a pop-up window;
and displaying the pop-up window.
2. The method of claim 1, wherein the step of creating a pop-up window template comprises:
inheriting preset pop-up window template parameters;
and creating a popup window template based on the popup window template parameters.
3. The method of claim 2, further comprising, after the step of creating a pop-up window template based on the pop-up window template parameters:
receiving an identity identifier returned by a user;
analyzing the identity mark by adopting layout service to obtain a target control;
and measuring the target control and storing the measured parameters.
4. The method of claim 1, wherein the step of the proxy window manager generating a proxy control corresponding to a target control in response to the add control instruction sent to the window manager further comprises:
saving the window manager as a variable of the proxy window manager;
detecting whether a variable of the proxy window manager is empty;
and if the variable is not null, executing the step of responding to the control adding instruction sent to the window manager and generating a proxy control corresponding to the target control by the proxy window manager.
5. The method as recited in claim 4, further comprising:
if the variable is empty, recreating a reflection between the pop-up window template and the window manager;
and when the re-creation fails, outputting a record log.
6. A method according to claim 3, wherein the step of displaying the pop-up window comprises:
judging whether an anchor point exists in the screen;
if an anchor point exists in the screen, acquiring coordinates of the anchor point;
calling position parameters to calculate coordinates of the popup window in the screen according to the measured parameters and coordinates of the anchor point;
and displaying the pop-up window according to the coordinates.
7. The method of claim 6, wherein the method further comprises:
if no anchor point exists in the screen, acquiring the width and the height of the screen;
calling position parameters to calculate coordinates of the pop-up window in the screen according to the measured parameters and the width and height of the screen;
and displaying the pop-up window according to the coordinates.
8. The method of claim 6, wherein the step of calling a location parameter to calculate coordinates of the pop-up window in the screen based on the measured parameter and coordinates of an anchor point, comprises:
judging the relative position of the pop-up window and the anchor point according to the position parameter;
and calculating the coordinates of the pop-up window in the screen by adopting the relative position, the measured parameters and the coordinates of the anchor point.
9. The method of claim 7, wherein the step of calculating coordinates of the pop-up window in the screen based on the measured parameters and the width and height of the screen, invoking position parameters, comprises:
judging the position of the pop-up window in the screen according to the position parameter;
and calculating coordinates of the pop-up window in the screen by using the position, the measured parameters and the width and height of the screen.
10. The method of claim 1, wherein the target agent control comprises a context control, the context control for setting a context.
11. A pop-up window setting apparatus, the apparatus comprising:
the creation module is used for creating a pop-up window template;
the reflection module is used for reflecting and calling a window manager by adopting the pop-up window template and generating a proxy window manager corresponding to the window manager;
the agent control generation module is used for responding to an adding control instruction sent to the window manager, and the agent window manager generates an agent control corresponding to the target control;
the target agent control generation module is used for adding the target control into the agent control to generate a target agent control; the target agent control is a parent control of the target control;
a pop-up window generation module for invoking the window manager to add the target agent control to the pop-up window template to generate a pop-up window;
and the display module is used for displaying the popup window.
12. An electronic device comprising a processor, a memory and a computer program stored on the memory and capable of running on the processor, which when executed by the processor, implements the steps of the pop-up window setting method according to any one of claims 1 to 10.
13. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the pop-up window setting method according to any one of claims 1 to 10.
CN202010033211.0A 2020-01-13 2020-01-13 Pop-up window setting method and device, electronic equipment and storage medium Active CN111240678B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010033211.0A CN111240678B (en) 2020-01-13 2020-01-13 Pop-up window setting method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010033211.0A CN111240678B (en) 2020-01-13 2020-01-13 Pop-up window setting method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111240678A CN111240678A (en) 2020-06-05
CN111240678B true CN111240678B (en) 2023-05-05

Family

ID=70876045

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010033211.0A Active CN111240678B (en) 2020-01-13 2020-01-13 Pop-up window setting method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111240678B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113126855B (en) * 2021-05-14 2023-05-12 广州虎牙科技有限公司 Client interaction method, device, electronic equipment and storage medium
CN114020267A (en) * 2021-11-04 2022-02-08 四川启睿克科技有限公司 Method for detecting RPA window control

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107807821A (en) * 2017-10-26 2018-03-16 福建中金在线信息科技有限公司 The implementation method and terminal of animation pop-up
CN109992264A (en) * 2017-12-29 2019-07-09 浙江宇视科技有限公司 Window management method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7296230B2 (en) * 2002-11-29 2007-11-13 Nippon Telegraph And Telephone Corporation Linked contents browsing support device, linked contents continuous browsing support device, and method and program therefor, and recording medium therewith

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107807821A (en) * 2017-10-26 2018-03-16 福建中金在线信息科技有限公司 The implementation method and terminal of animation pop-up
CN109992264A (en) * 2017-12-29 2019-07-09 浙江宇视科技有限公司 Window management method

Also Published As

Publication number Publication date
CN111240678A (en) 2020-06-05

Similar Documents

Publication Publication Date Title
CN107992427B (en) Method, device and equipment for creating service test scene and storage medium thereof
US9021438B2 (en) Automatic framework for parallel testing on multiple testing environments
US10462029B2 (en) Device cloud monitoring and stability
US20050289088A1 (en) Processing logic modeling and execution
US20170147480A1 (en) Test script generation
US20150236799A1 (en) Method and system for quick testing and detecting mobile devices
CN111240678B (en) Pop-up window setting method and device, electronic equipment and storage medium
US20190073249A1 (en) Message oriented middleware with integrated rules engine
CN113868126A (en) Application debugging method, device and storage medium of equipment
CN112494940B (en) User interface manufacturing method and device, storage medium and computer equipment
CN111667199A (en) Workflow construction method and device, computer equipment and storage medium
CN113986426B (en) Image detection method and device, readable medium and electronic equipment
US10503572B2 (en) Hybrid remote controller
US10678561B2 (en) Virtualizing extension code in an application
CN115509531A (en) Micro front end implementation method, device, terminal and storage medium based on front end technology
CN116107885A (en) Interface testing method, device, equipment and storage medium
CN112463626B (en) Memory leakage positioning method and device, computer equipment and storage medium
CN111459547B (en) Method and device for displaying function call link
CN111858037B (en) Service arrangement method, device and equipment of physical machine and storage medium
CN113986679A (en) Performance analysis method and device based on configuration information hot loading
US9003371B2 (en) Recursive method call representation in a plot view of method execution performance
CN112749282A (en) Knowledge graph display method, device, equipment and storage medium
CN113128187B (en) Form generation method, device and system
CN112799954B (en) Method, apparatus and computer readable medium for quickly constructing test environment
CN118193389A (en) Test case generation method, device, equipment, storage medium and product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant