1. Technical Field
Embodiments of the present disclosure relate to a computing device and a method for managing display of a widget.
2. Description of Related Art
In computer programming, widgets (or controls) are computer programs that when executed displays in a graphical user interface (GUI) environment. A particular GUI, such as a user interface of a webpage, may include a number of widgets (e.g., text input boxes, list boxes, and check boxes) that are configured for interacting with the user. The widgets, may occupy most of the real estate of the GUI, and the GUI may be disorganized if a great many of the widgets are displayed thereon, this is inconvenient. Therefore, there is room for improvement in the art.
The disclosure, including the accompanying drawings, is illustrated by way of example and not by way of limitation. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean at least one.
The management system 10 may include a plurality of programs in the form of one or more computerized instructions stored in the storage system 11 and executed by the processor 12 to perform operations of the computing device 1. In the embodiment, the management system 10 includes a data configuration module 101, an initialization module 102, an event detection module 103, and a display control module 104. In general, the word “module”, as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, such as, Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware, such as in an EPROM. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable medium include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives.
The data configuration module 101 sets original data of a widget, the original data including a widget type, and information to be displayed and selected by a user through the widget when the user interacts with the widget. In the embodiment, the widget type may be, for example, a text entry box, a list box, or a check box. The text entry box is a type of widget that allows the user to input text information to be used by a program of the widget. The list box is a type of widget that allows the user to select one or more items from a list contained within a static, multiple line text box. The user may click an item inside the list box to select it, and sometimes in combination with a Shift key or a Control key of the keyboard of the input/output device 1 in order to make multiple selections. The check box is a type of widget that permits the user to make single or multiple selections from a number of options. Normally, the check box is shown on a user interface as a square box that contains the options. In one example, if the widget is the list box or the check box, the original data may include a plurality of items or options that the user can select wherefrom, such as “Beijing”, “Shanghai”, and “Shenzhen” of
The initialization module 102 displays the widget in a form of a predetermined textbox on a user interface (UI), and displays predetermined initial information in the textbox according to the widget type. In one example, as shown in
If the widget type is a check box M2, the initial information displayed in the textbox may be “Click for displaying options”.
The event detection module 103 detects focus events of the widget, the focus events including a got focus event and a lost focus event. In one embodiment, when the widget is selected, such as clicked using the mouse or the keyboard of the input/output device 1, the got focus event of the widget is detected, which means the widget has got focus. In contrast, the lost focus event of the widget may be detected when the widget is unselected (e.g., another element on the UI is clicked) after the widget has been selected, which means the widget has lost focus.
The display control module 104 executes corresponding functions of the widget according to the widget type and displays the set information of the original data on the UI through the widget, when the got focus event of the widget is detected. The display control module 104 further reverts the display of the widget to the textbox, and displays information that is inputted or selected by the user through the widget in the textbox, when the lost focus event of the widget is detected.
Referring to
Referring to
Referring to
In step S01, the data configuration module 101 sets original data of the widget, the original data include a widget type, and information to be displayed through the widget for being selected by a user when the user interacts with the widget. In the embodiment, the widget type may be, for example, a text entry box, a list box, or a check box. Details of the text entry box, the list box, and the check box are described above.
In step S02, the initialization module 102 displays the widget in a form of a predetermined textbox on the user interface, and displays predetermined initial information in the predetermined textbox according to the widget type.
In step S03, the event detection module 103 detects focus events of the widget, the focus events including a got focus event and a lost focus event. Details of the got focus event and the lost focus event are provided above.
In step S04, the display control module 104 executes corresponding functions of the widget according to the widget type and displays the set information of the original data on the user interface through the widget when the got focus event of the widget is detected, and reverts the display of the widget to the predetermined textbox and displays information that is inputted or selected by the user through the widget in the predetermined textbox when the lost focus event of the widget is detected.
Although certain embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
| Number | Date | Country | Kind |
|---|---|---|---|
| 201210057632.2 | Mar 2012 | CN | national |