Detailed Description
The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.
In the embodiments of the present specification, for convenience of description, the side of the rectangular region on the left side may be taken as the left side; the side of the rectangular area at the top can be taken as the top side; the side of the rectangular area on the right side can be taken as the right side; the side of the rectangular area at the bottom can be taken as the bottom side; a connecting line between the top left corner vertex and the bottom right corner vertex of the rectangular area can be used as a main diagonal line; the line between the top right corner vertex and the bottom left corner vertex of the rectangular area can be used as the secondary diagonal line.
Please refer to fig. 1, fig. 6a, fig. 6b, fig. 6c and fig. 6 d. The embodiment of the specification provides a cell selection method, which takes a terminal device as an execution main body. The terminal device may be a mobile device, such as a smart phone, a tablet electronic device, a portable computer, a Personal Digital Assistant (PDA), an in-vehicle device, a POS machine, or a smart wearable device. Alternatively, the terminal device may also be a desktop device, such as a television, a server, an industrial Personal Computer (PC), a kiosk, or a smart self-service terminal (kiosk). The cell selection method of the present embodiment may include the following steps.
Step S10: in response to detecting a touch on the form, the cell to which the touch is directed is retrieved as the first cell.
In the present embodiment, the terminal device may have a Display component, such as a touch Display, a Liquid Crystal Display (LCD) Display, a Cathode Ray Tube (CRT) Display, a Light Emitting Diode (LED) Display, and the like. The terminal device may use the display component to present a form to a user. The form may be a form in a web page implemented based on a computer Language such as HTML (HyperText Markup Language); alternatively, a form based on spreadsheet software implementations is also possible. Of course, the table may also be other types of tables, and this embodiment is not particularly limited. The table may include a plurality of cells. The cells may organize and manage the basic units of data for the table. The cell can be a default cell formed by intersecting rows and columns in a table; alternatively, the cells may be formed by combining a plurality of default cells located in the same row or column; alternatively, the cells formed after splitting the default cells may be used.
For example, a table may be as shown in Table 1 below.
TABLE 1
The above table 1 may include 8 cells, such as Cell1, Cell2, Cell3, Cell4, Cell5, Cell6, Cell7, and Cell 8. The cells Cell1, Cell2, Cell4, Cell6, Cell7, and Cell8 are default cells formed by rows and columns intersecting in a table. The cells Cell3 and Cell4 are cells formed by splitting a default Cell. The Cell5 is a Cell formed by merging default cells.
In this embodiment, the user may contact the form using any object, such as a mouse, a finger, or a stylus. The terminal device may acquire, as the first cell, a cell to which the contact is directed in response to detecting the contact on the form. The contact may include pressing, touching, or the like. The cell to which the contact is directed can be understood as the cell in which the contact point of the contact is located. The terminal device may detect the contact by detecting a system event, for example, a mouse down event, a screen touch event TouchStart, or the like.
Step S12: in response to the movement of the contact, a cell to which the contact is currently directed is acquired as a second cell.
In the present embodiment, after step S10, the user may hold and move the contact. The terminal device may acquire, as the second cell, a cell to which the contact is currently directed in response to the movement of the contact. The cell to which the contact is currently directed may be understood as the cell in which the current contact position of the contact is located. The terminal device may detect the contact movement by detecting a system event, where the system event may be, for example, a mouse movement event MouseMove, or a sliding event TouchMove on a screen.
Step S14: determining a first location point and a second location point based on the first cell and the second cell.
In this embodiment, the terminal device may determine the first location point and the second location point based on the first cell and the second cell. The first rectangular region having a diagonal line as a connection line between the first position point and the second position point may include the first cell and the second cell. Generally, there may be a plurality of rectangular areas in the table, where the rectangular areas include the first cell and the second cell, and the first rectangular area may be a rectangular area with a smallest area among the rectangular areas. A line connecting the first position point and the second position point may be a main diagonal line or a sub diagonal line of the first rectangular region. It should be noted that the first location point may be a vertex of the first cell, and may also be a vertex of another cell in the table; similarly, the second location point may be a vertex of the second cell, and may also be vertices of other cells in the table.
In an embodiment of the present invention, a connection line between the first position point and the second position point may be a major diagonal line of the first rectangular region. As such, the terminal device may determine a lateral position component of the first location point based on the position of the left side of the first cell and the position of the left side of the second cell; a longitudinal position component of the first location point may be determined based on the position of the first cell top edge and the position of the second cell top edge; the first location point may be determined based on a lateral location component and a longitudinal location component of the first location point. The terminal device may further determine a lateral position component of the second position point based on the position of the right side of the first cell and the position of the right side of the second cell; a longitudinal position component of the second location point may be determined based on the position of the first cell bottom edge and the position of the second cell bottom edge; the second location point may be determined based on a lateral location component and a longitudinal location component of the second location point.
Specifically, the terminal device may compare the position of the left side of the first cell with the position of the left side of the second cell; when the first cell left side is located on the left side of the second cell left side, the position of the first cell left side may be taken as the lateral position component of the first position point; when the second cell left side is located on the left side of the first cell left side, the position of the second cell left side may be taken as the lateral position component of the first position point. The terminal equipment can also compare the position of the top edge of the first cell with the position of the top edge of the second cell; when the first cell top edge is above the second cell top edge, the position of the first cell top edge may be taken as the longitudinal position component of the first position point; when the second cell top edge is located above the first cell top edge, the position of the second cell top edge may be taken as the longitudinal position component of the first position point. For example, the lateral position component of the first location point may be X1 and the longitudinal position component may be Y1. Then, X1 ═ min (cell1.left, cell2. left); y1 ═ min (cell1.top, cell2. top). Cell1 represents a first Cell; left represents the distance between the left side of the first cell and the left boundary of the current interface; top represents the distance between the first cell top edge and the current interface top boundary; cell2 represents a second Cell; left represents the distance between the left side of the second cell and the left boundary of the current interface; top represents the distance between the top edge of the second cell and the top boundary of the current interface; the function min () represents the return of the minimum value in a given parameter.
Specifically, the terminal device may compare the position of the right side of the first cell with the position of the right side of the second cell; when the first cell right side is located on the right side of the second cell right side, the position of the first cell right side may be taken as the lateral position component of the second position point; when the second cell right side is located on the right side of the first cell right side, the position of the second cell right side may be taken as the lateral position component of the second position point. The terminal equipment can also compare the position of the bottom edge of the first cell with the position of the bottom edge of the second cell; when the first cell bottom edge is located below the second cell bottom edge, the position of the first cell bottom edge may be taken as the longitudinal position component of the first position point; when the second cell bottom edge is located below the first cell bottom edge, the position of the second cell bottom edge may be taken as the longitudinal position component of the second position point. For example, the lateral position component of the second location point may be X2 and the longitudinal position component may be Y2. Then, X2 ═ max (cell1.right, cell2. right); y2 ═ max (cell1.bottom, cell2. bottom). Cell1 represents a first Cell; right denotes the distance between the right side of the first cell and the left side boundary of the current interface; bottom represents the distance between the bottom edge of the first cell and the top boundary of the current interface; cell2 represents a second Cell; right denotes the distance between the right side of the second cell and the left side boundary of the current interface; bottom represents the distance between the bottom edge of the second cell and the top boundary of the current interface; the function max () represents the maximum value in the given parameter to be returned.
In another implementation manner of this embodiment, a connection line between the first position point and the second position point may be a secondary diagonal line of the first rectangular region. As such, the terminal device may determine a lateral position component of the first location point based on the position of the right side of the first cell and the position of the right side of the second cell; a longitudinal position component of the first location point may be determined based on the position of the first cell top edge and the position of the second cell top edge; the first location point may be determined based on a lateral location component and a longitudinal location component of the first location point. The terminal device may further determine a lateral position component of the second position point based on the position of the left side of the first cell and the position of the left side of the second cell; a longitudinal position component of the second location point may be determined based on the position of the first cell bottom edge and the position of the second cell bottom edge; the second location point may be determined based on a lateral location component and a longitudinal location component of the second location point.
Specifically, the terminal device may compare the position of the right side of the first cell with the position of the right side of the second cell; when the first cell right side is located on the right side of the second cell right side, the position of the first cell right side may be taken as the lateral position component of the first position point; when the second cell right side is located on the right side of the first cell right side, the position of the second cell right side may be taken as the lateral position component of the first position point. The terminal equipment can also compare the position of the top edge of the first cell with the position of the top edge of the second cell; when the first cell top edge is above the second cell top edge, the position of the first cell top edge may be taken as the longitudinal position component of the first position point; when the second cell top edge is located above the first cell top edge, the position of the second cell top edge may be taken as the longitudinal position component of the first position point.
Specifically, the terminal device may compare the position of the left side of the first cell with the position of the left side of the second cell; when the left side of the first cell is located at the left side of the second cell, the position of the left side of the first cell may be taken as the lateral position component of the second position point; when the second cell left side is located on the left side of the first cell left side, the position of the second cell left side may be taken as the lateral position component of the second position point. The terminal equipment can also compare the position of the bottom edge of the first cell with the position of the bottom edge of the second cell; when the first cell bottom edge is located below the second cell bottom edge, the position of the first cell bottom edge may be taken as the longitudinal position component of the second position point; when the second cell bottom edge is located below the first cell bottom edge, the position of the second cell bottom edge may be taken as the longitudinal position component of the second position point.
Step S16: determining a third location point and a fourth location point when the table includes a cell that intersects the first rectangular region.
In this embodiment, the terminal device may detect whether a cell intersecting the first rectangular area is included in the table; when it is detected that the cell intersecting the first rectangular region is included in the table, a third location point and a fourth location point may be determined based on a positional relationship between the cell intersecting the first rectangular region and the first rectangular region. The second rectangular area having a diagonal line connecting the third position point and the fourth position point may include and be larger than the first rectangular area. Specifically, the second rectangular region may include both the first rectangular region and the cell intersecting the first rectangular region. In general, the number of the rectangular regions in the table, which include both the first rectangular region and the cell intersecting with the first rectangular region, may be multiple, and the second rectangular region may be a rectangular region having a smallest area among the multiple rectangular regions. Through step S16, when a cell intersecting the first rectangular area is included in the table, the terminal device may re-determine a location point to achieve expansion of the first rectangular area. It should be noted that, here, the unit cell intersects with the first rectangular area, it is understood that a partial area of the unit cell is located in the first rectangular area. Further, a connection line between the third location point and the fourth location point may be a main diagonal line or a sub diagonal line of the second rectangular region. Specifically, when a connecting line between the first position point and the second position point is a main diagonal line of the first rectangular region, a connecting line between the third position point and the fourth position point may be a main diagonal line of the second rectangular region, respectively; when the connection line between the first position point and the second position point is the secondary diagonal line of the first rectangular region, the connection line between the third position point and the fourth position point may be the secondary diagonal line of the second rectangular region.
In this embodiment, the position relationship between the cell intersecting the first rectangular region and the first rectangular region may include at least one of:
(1) one vertex of the cell intersecting the first rectangular region is located within the first rectangular region;
(2) one side of the cell intersected with the first rectangular area is positioned in the first rectangular area;
(3) four vertices of the cell intersecting the first rectangular region are located outside the first rectangular region.
Further, a vertex of the cell intersecting the first rectangular region is located within the first rectangular region, and may include at least one of:
(1-1) the upper left corner vertex of the cell intersecting the first rectangular region is located inside the first rectangular region, and vertices other than the upper left corner vertex are located outside the first rectangular region;
(1-2) the upper right corner vertex of the cell intersecting the first rectangular region is located inside the first rectangular region, and vertices other than the upper right corner vertex are located outside the first rectangular region;
(1-3) the lower left corner vertex of the cell intersecting the first rectangular region is located inside the first rectangular region, and other vertices except for the lower left corner vertex are located outside the first rectangular region;
(1-4) the lower right corner vertex of the cell intersecting the first rectangular region is located within the first rectangular region, and the other vertices except for the lower right corner vertex are located outside the first rectangular region.
Further, one side of the cell intersecting the first rectangular region is located in the first rectangular region, and may include at least one of:
(2-1) the top edge of the cell intersecting the first rectangular region is located within the first rectangular region and the lower left corner vertex and the lower right corner vertex are located outside the first rectangular region;
(2-2) the right side of the cell intersecting the first rectangular region is located inside the first rectangular region, and the top left corner vertex and the bottom left corner vertex are located outside the first rectangular region;
(2-3) the bottom edge of the cell intersecting the first rectangular region is located within the first rectangular region, and the top left corner vertex and the top right corner vertex are located outside the first rectangular region;
(2-4) the left side of the cell intersecting the first rectangular region is located inside the first rectangular region, and the top-right corner vertex and the bottom-right corner vertex are located outside the first rectangular region.
Further, the four vertices of the cell intersecting the first rectangular region are located outside the first rectangular region, which may include at least one of:
(3-1) the top and bottom sides of the unit cell intersecting the first rectangular region are both located between the top and bottom sides of the first rectangular region, and the left side of the unit cell intersecting the first rectangular region is located on the left side of the first rectangular region, and the right side of the unit cell intersecting the first rectangular region is located on the right side of the first rectangular region;
(3-2) the left side and the right side of the cell intersected with the first rectangular region are both located between the left side and the right side of the first rectangular region, the top side of the cell intersected with the first rectangular region is located above the top side of the first rectangular region, and the bottom side of the cell intersected with the first rectangular region is located below the bottom side of the first rectangular region.
In this embodiment, the terminal device may determine a location point as a third location point again; the second location point may be referred to as a fourth location point. Or, the terminal device may also use the first location point as a third location point; one location point may be redetermined as a fourth location point. Or, the terminal device may further re-determine a location point as a third location point; another location point may be redetermined as the fourth location point.
In an embodiment of the present invention, a connection line between the first position point and the second position point is a main diagonal line of the first rectangular region. Thus, for the positional relationships (1-1), (1-2), (1-3), (1-4), (2-1), (2-2), (2-3), (2-4), (3-1), and (3-2), the terminal device may determine the third location point and the fourth location point by using the following methods, respectively. For convenience of description herein, the cell intersecting the first rectangular region may be referred to as an intersecting cell.
Please refer to fig. 7a and 7 b. For the positional relationship (1-1), the terminal device may regard the first position point as a third position point; one location point may be redetermined as a fourth location point. Specifically, the terminal device may take the position of the right side of the intersecting cell as the lateral position component of the fourth position point; the position of the bottom edge of the intersecting cell may be taken as the longitudinal position component of the fourth position point; the fourth location point may be determined based on a lateral location component and a longitudinal location component of the fourth location point.
Please refer to fig. 8a and 8 b. For the position relation (1-2), the terminal device may re-determine one position point as a third position point; another location point may be redetermined as the fourth location point. Specifically, the terminal device may take the position of the left side of the intersecting cell as the lateral position component of the third position point; the longitudinal position component of the first position point may be taken as the longitudinal position component of the third position point; the third location point may be determined based on a lateral location component and a longitudinal location component of the third location point. The terminal device may further take a lateral position component of the second position point as a lateral position component of the fourth position point; the position of the bottom edge of the intersecting cell may be taken as the longitudinal position component of the fourth position point; the fourth location point may be determined based on a lateral location component and a longitudinal location component of the fourth location point.
Please refer to fig. 9a and 9 b. For the position relation (1-3), the terminal device may re-determine one position point as a third position point; the second location point may be referred to as a fourth location point. Specifically, the terminal device may take the position of the left side of the intersecting cell as the lateral position component of the third position point; the position of the top edge of the intersecting cell may be taken as the longitudinal position component of the third location point; the third location point may be determined based on a lateral location component and a longitudinal location component of the third location point.
Please refer to fig. 10a and 10 b. For the position relation (1-4), the terminal device may re-determine one position point as a third position point; another location point may be redetermined as the fourth location point. Specifically, the terminal device may take a lateral position component of the first position point as a lateral position component of the third position point; the position of the top edge of the intersecting cell may be taken as the longitudinal position component of the third location point; the third location point may be determined based on a lateral location component and a longitudinal location component of the third location point. The terminal device may further take the position of the right side of the intersecting cell as the lateral position component of the fourth position point; the longitudinal position component of the second position point may be taken as the longitudinal position component of the fourth position point; the fourth location point may be determined based on a lateral location component and a longitudinal location component of the fourth location point.
Please refer to fig. 11a and 11 b. For the positional relationship (2-1), the terminal device may regard the first position point as a third position point; one location point may be redetermined as a fourth location point. Specifically, the terminal device may take a lateral position component of the second position point as a lateral position component of the fourth position point; the position of the bottom edge of the intersecting cell may be taken as the longitudinal position component of the fourth position point; the fourth location point may be determined based on a lateral location component and a longitudinal location component of the fourth location point.
Please refer to fig. 12a and 12 b. For the position relation (2-2), the terminal device may re-determine one position point as a third position point; the second location point may be referred to as a fourth location point. Specifically, the terminal device may take the position of the left side of the intersecting cell as the lateral position component of the third position point; the longitudinal position component of the first position point may be taken as the longitudinal position component of the third position point; the third location point may be determined based on a lateral location component and a longitudinal location component of the third location point.
Please refer to fig. 13a and 13 b. For the position relation (2-3), the terminal device may re-determine one position point as a third position point; the second location point may be referred to as a fourth location point. Specifically, the terminal device may take a lateral position component of the first position point as a lateral position component of the third position point; the position of the top edge of the intersecting cell may be taken as the longitudinal position component of the third location point; the third location point may be determined based on a lateral location component and a longitudinal location component of the third location point.
Please refer to fig. 14a and 14 b. For the positional relationship (2-4), the terminal device may regard the first position point as a third position point; one location point may be redetermined as a fourth location point. Specifically, the terminal device may take the position of the right side of the intersecting cell as the lateral position component of the fourth position point; the longitudinal position component of the second position point may be taken as the longitudinal position component of the fourth position point; the fourth location point may be determined based on a lateral location component and a longitudinal location component of the fourth location point.
Please refer to fig. 15a and fig. 15 b. For the position relation (3-1), the terminal device may re-determine one position point as a third position point; another location point may be redetermined as the fourth location point. Specifically, the terminal device may take a position of a left side of the intersecting cell as a lateral position component of the third cell; the longitudinal position component of the first position point may be taken as the longitudinal position component of the third position point; the third location point may be determined based on a lateral location component and a longitudinal location component of the third location point. The terminal device may further take a position of a right side of the intersecting cell as a lateral position component of the fourth cell; the longitudinal position component of the second position point may be taken as the longitudinal position component of the fourth position point; the fourth location point may be determined based on a lateral location component and a longitudinal location component of the fourth location point.
Please refer to fig. 16a and fig. 16 b. For the position relation (3-2), the terminal device may re-determine one position point as a third position point; another location point may be redetermined as the fourth location point. Specifically, the terminal device may take a lateral position component of the first position point as a lateral position component of the third position point; the position of the top edge of the intersecting cell may be taken as the longitudinal position component of the third location point; the third location point may be determined based on a lateral location component and a longitudinal location component of the third location point. The terminal device may further take a lateral position component of the second position point as a lateral position component of the fourth position point; the position of the bottom edge of the intersecting cell may be taken as the longitudinal position component of the fourth position point; the fourth location point may be determined based on a lateral location component and a longitudinal location component of the fourth location point.
In another implementation manner of this embodiment, a connection line between the first position point and the second position point is a secondary diagonal line of the first rectangular region. Thus, for the position relationships (1-1), (1-2), (1-3), (1-4), (2-1), (2-2), (2-3), (2-4), (3-1), and (3-2), the terminal device may determine the third position point and the fourth position point by using a method similar to the foregoing embodiment, which is not described herein again.
Step S18: and obtaining the cells in the second rectangular area as the selected cells.
In this embodiment, the terminal device may obtain a cell in the second rectangular region; the acquired cell may be taken as the selected cell.
In an implementation manner of this embodiment, in order to facilitate the user to understand the cell selected by the user, the terminal device may further highlight the cell in the second rectangular area. For example, the terminal device may fill any color into cells within the second rectangular area.
In an implementation manner of this embodiment, in response to that the contact is no longer detected, the terminal device may use a cell at the upper left corner of the main diagonal in the second rectangular area as a start cell, and use a cell at the lower right corner of the main diagonal in the second rectangular area as a stop cell, and may store the identifier of the start cell and the identifier of the stop cell. Or, in response to that the contact is no longer detected, the terminal device may use the cell at the upper right corner of the secondary diagonal in the second rectangular region as a starting cell, may use the cell at the lower left corner of the secondary diagonal in the second rectangular region as a terminating cell, and may store the identifier of the starting cell and the identifier of the terminating cell.
In this embodiment, the terminal device may detect a system event, such as a mouse up event MouseUp or a screen exit event touch, to prevent the terminal device from detecting the contact. The identification of the cell may be used to identify the cell, and may be, for example, a title or number of the cell, etc. In this embodiment, by storing the identifier of the starting cell and the identifier of the ending cell, the terminal device can record the cell selected by the user. Furthermore, when data representing the cell selected by the user needs to be transmitted to the server or other terminal device, the terminal device may transmit only the identification of the starting cell and the identification of the ending cell to the server or other terminal device, without transmitting the identification of each cell selected by the user.
In an implementation manner of this embodiment, when the table does not include a cell intersecting a first rectangular area, the terminal may further obtain a cell in the first rectangular area as the selected cell. Further, in this embodiment, the terminal device may further highlight the cells in the first rectangular area.
In one embodiment of this embodiment, the table may include cells intersecting the second rectangular region. As such, after step S16, the terminal device may further detect whether a cell intersecting the second rectangular region is included in the table. When it is detected that a cell intersecting a second rectangular area is included in the table, the terminal device may determine a fifth location point and a sixth location point based on a positional relationship between the cell intersecting the second rectangular area and the second rectangular area. A third rectangular area having a diagonal line defined by a line connecting the fifth position point and the sixth position point may include and be larger than the second rectangular area. Specifically, the third rectangular region may include the second rectangular region and the unit cell intersecting the second rectangular region. The terminal device may acquire the cell in the third rectangular area as the selected cell. When detecting that the table does not include a cell intersecting with a second rectangular area, the terminal device may acquire a cell in the second rectangular area as a selected cell.
Further, in the present embodiment, the table may further include a cell intersecting the third rectangular region. In this way, the terminal device may further detect whether a cell intersecting the third rectangular region is included in the table. Upon detecting that a cell intersecting a third rectangular region is included in the table, the terminal device may determine a seventh location point and an eighth location point based on a positional relationship between the cell intersecting the third rectangular region and the third rectangular region. A fourth rectangular area diagonal to a line between the seventh location point and the eighth location point may include and be larger than the third rectangular area. Specifically, the fourth rectangular region may include the third rectangular region and the cell intersecting the third rectangular region. The terminal device may acquire the cell in the fourth rectangular area as the selected cell. When detecting that the table does not include the cell intersecting with the third rectangular area, the terminal device may acquire the cell in the third rectangular area as the selected cell.
As can be seen, in this embodiment, the terminal device may determine the location point again a plurality of times to expand the first rectangular area a plurality of times until the table does not include the cell intersecting the first rectangular area that was expanded most recently. Further, in the present embodiment, in view of the need to re-determine the location point from the location data of each cell in the table, the terminal device may acquire the location data of each cell in the table in advance, and may re-determine the location point from the position data acquired in advance, so that the time taken to re-determine the location point a plurality of times may be reduced.
In this embodiment, after detecting a contact on a table and moving the contact, the terminal device may obtain a first cell and a second cell from the table; a first location point and a second location point may be determined based on the first cell and the second cell; when the table includes a cell intersecting a first rectangular area diagonal to a connection line between the first position point and the second position point, a third position point and a fourth position point may be further determined to expand the first rectangular area; cells in a second rectangular area having a diagonal line as a connecting line between the third position point and the fourth position point may be acquired as the selected cells. In the cell selection method of this embodiment, the terminal device may determine the cell selected by the user through a diagonal line formed by the position points. The user can select the cells in the rectangular area without clicking each cell in the rectangular area one by one, so that the user operation is reduced, and the user experience is improved.
A specific scenario example is introduced below to describe the cell selection method of the present embodiment. It should be noted that the scenario examples are only for better illustrating the embodiments of the present specification, and should not be construed as an inappropriate limitation to the embodiments of the present specification.
In the scene example, the terminal device may be a smartphone. The smartphone may include a touch-sensitive display. The smart phone may display a table through the touch display. The user may use a finger to touch a cell in the table. The smartphone, in response to detecting a contact on the form, may obtain a cell to which the contact is directed as a first cell. The user may hold and move the contact. In the process that the user moves the contact, the smart phone can acquire a cell to which the contact points currently as a second cell; a first location point and a second location point may be determined based on the first cell and the second cell; with a line between the first location point and the second location point as a diagonal of a first rectangular area, a third location point and a fourth location point may be determined when the table includes a cell intersecting the first rectangular area; and taking a connecting line between the third position point and the fourth position point as a diagonal line of a second rectangular area, and obtaining the cells in the second rectangular area as the selected cells.
In this scenario example, the user may select multiple cells by moving the contact. In the process that the user moves the contact, the smart phone can determine the cell currently selected by the user through a diagonal line formed by the position points. When the cell determined by the smartphone is not the cell that the smartphone desires to select, the user may continue to move the contact. When the cell determined by the smart phone is the cell expected to be selected by the user, the user can lift the finger.
Please refer to fig. 2, fig. 6a, fig. 6b, fig. 6c and fig. 6 d. The embodiment of the specification provides a cell selection method, which takes a terminal device as an execution main body. The terminal device may be a mobile device, such as a smart phone, a tablet electronic device, a portable computer, a Personal Digital Assistant (PDA), an in-vehicle device, a POS machine, or a smart wearable device. Alternatively, the terminal device may also be a desktop device, such as a television, a server, an industrial Personal Computer (PC), a kiosk, or a smart self-service terminal (kiosk). The cell selection method of the present embodiment may include the following steps.
Step S20: a start identity and a stop identity are obtained.
In this embodiment, the start identifier and the end identifier may be respectively used to identify one cell in the table. The terminal device may store a start identifier and a termination identifier. In this way, the terminal device can read the stored start identifier and the end identifier. Alternatively, other terminal devices or servers than this embodiment may send the start identifier and the end identifier to the terminal device of this embodiment. The terminal device of this embodiment may receive the start identifier and the end identifier sent.
Step S22: and determining a rectangular area based on the cell identified by the starting identifier and the cell identified by the termination identifier.
In this embodiment, the terminal device may determine the rectangular area by using a connection between a top left corner vertex of the cell identified by the start identifier and a bottom right corner vertex of the cell identified by the end identifier as a diagonal line. The cells identified by the start identifier and the cells identified by the end identifier may be located at two ends of a main diagonal line of the rectangular area, respectively.
Or, in this embodiment, the terminal device may further determine the rectangular area by taking a connection line between the top right corner vertex of the cell identified by the start identifier and the bottom left corner vertex of the cell identified by the end identifier as a diagonal line. The cells identified by the start identifier and the cells identified by the end identifier may be located at two ends of the secondary diagonal of the rectangular region, respectively.
Step S24: and obtaining the cells in the rectangular area as the selected cells.
In this embodiment, the terminal device may obtain cells in the rectangular area; the acquired cell may be taken as the selected cell. Therefore, the terminal equipment can determine the cell selected by the user according to the starting identifier and the ending identifier.
Please refer to fig. 3. The embodiment of the specification further provides the terminal equipment. The terminal device may include the following elements.
A first acquiring unit 30 configured to acquire, in response to detection of a contact on a form, a cell to which the contact is directed as a first cell;
a second acquiring unit 32 configured to acquire, as a second cell, a cell to which the contact is currently directed in response to the movement of the contact;
a first determining unit 34 configured to determine a first location point and a second location point based on the first cell and the second cell;
a second determining unit 36, configured to determine a third location point and a fourth location point when the table includes a cell intersecting the first rectangular region, with a connection line between the first location point and the second location point as a diagonal line of the first rectangular region;
a third obtaining unit 38, configured to obtain a cell in a second rectangular area as a selected cell by taking a connection line between the third position point and the fourth position point as a diagonal line of the second rectangular area; the second rectangular area includes and is larger than the first rectangular area.
Please refer to fig. 4. The embodiment of the specification also provides another terminal device. The terminal device may include a memory and a processor.
In the present embodiment, the Memory includes, but is not limited to, a Dynamic Random Access Memory (DRAM), a Static Random Access Memory (SRAM), and the like. The memory may be used to store computer instructions.
In this embodiment, the processor may be implemented in any suitable manner. For example, the processor may take the form of, for example, a microprocessor or processor and a computer-readable medium that stores computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, an embedded microcontroller, and so forth. The processor may be configured to execute the computer instructions to perform the steps of: in response to detecting a contact on a form, acquiring a cell pointed to by the contact as a first cell; in response to the movement of the contact, acquiring a cell to which the contact is currently directed as a second cell; determining a first location point and a second location point based on the first cell and the second cell; determining a third position point and a fourth position point when the table comprises a cell intersecting the first rectangular area by taking a connecting line between the first position point and the second position point as a diagonal line of the first rectangular area; taking a connecting line between the third position point and the fourth position point as a diagonal line of a second rectangular area, and acquiring cells in the second rectangular area as selected cells; the second rectangular area includes and is larger than the first rectangular area.
Please refer to fig. 5. The embodiment of the specification also provides another terminal device. The terminal device may include the following elements.
A first obtaining unit 50 for obtaining a start identifier and a termination identifier; the starting identifier and the terminating identifier are respectively used for identifying one cell in a table;
a determining unit 52, configured to determine a rectangular area based on the cells identified by the start identifier and the cells identified by the end identifier;
and a second obtaining unit 54, configured to obtain the cells in the rectangular area as the selected cells.
Please refer to fig. 4. The embodiment of the specification also provides another terminal device. The terminal device may include a memory and a processor.
In the present embodiment, the Memory includes, but is not limited to, a Dynamic Random Access Memory (DRAM), a Static Random Access Memory (SRAM), and the like. The memory may be used to store computer instructions.
In this embodiment, the processor may be implemented in any suitable manner. For example, the processor may take the form of, for example, a microprocessor or processor and a computer-readable medium that stores computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, an embedded microcontroller, and so forth. The processor may be configured to execute the computer instructions to perform the steps of: acquiring a starting identifier and a terminating identifier; the starting identifier and the terminating identifier are respectively used for identifying one cell in a table; determining a rectangular area based on the cells identified by the start identifier and the cells identified by the end identifier; and obtaining the cells in the rectangular area as the selected cells.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. Particularly, for the terminal device embodiment, since it is basically similar to the cell selection method embodiment, the description is relatively simple, and for relevant points, reference may be made to part of the description of the cell selection method embodiment.
In addition, it should be understood by those skilled in the art that after reading this specification, there is no need for inventive faculty to conceive of any combination of some or all of the embodiments recited in this document, which combinations are also within the scope of the disclosure and protection of this application.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate a dedicated integrated circuit chip 2. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Language Description Language), traffic, pl (core unified Programming Language), HDCal, JHDL (Java Hardware Description Language), langue, Lola, HDL, laspam, hardbyscript Description Language (vhr Description Language), and the like, which are currently used by Hardware compiler-software (Hardware Description Language-software). It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
From the above description of the embodiments, it is clear to those skilled in the art that the present specification can be implemented by software plus a necessary general hardware platform. Based on such understanding, the technical solutions of the present specification may be essentially or partially implemented in the form of software products, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and include instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments of the present specification.
The description is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
While the specification has been described with examples, those skilled in the art will appreciate that there are numerous variations and permutations of the specification that do not depart from the spirit of the specification, and it is intended that the appended claims include such variations and modifications that do not depart from the spirit of the specification.