CN102012813A - Implementation method for control of slider - Google Patents
Implementation method for control of slider Download PDFInfo
- Publication number
- CN102012813A CN102012813A CN2010105585263A CN201010558526A CN102012813A CN 102012813 A CN102012813 A CN 102012813A CN 2010105585263 A CN2010105585263 A CN 2010105585263A CN 201010558526 A CN201010558526 A CN 201010558526A CN 102012813 A CN102012813 A CN 102012813A
- Authority
- CN
- China
- Prior art keywords
- slider
- control
- implementation method
- bar
- sliding shoe
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 18
- 230000002452 interceptive effect Effects 0.000 abstract description 2
- 238000012986 modification Methods 0.000 abstract description 2
- 230000004048 modification Effects 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000012797 qualification Methods 0.000 description 1
Images
Landscapes
- User Interface Of Digital Computer (AREA)
Abstract
The invention provides an implementation method for a control of a slider, which comprises the following steps: a) creating and loading the control of the slider into a parent window; b) calculating the relative position of a sliding block in the slider according to operation information received by the parent window of the slider; and c) setting the relative value of the position of the sliding block into the control of the slider, calculating the coordinate of a starting point of the sliding block according to the set position value of the sliding block, and re-drawing the control of the slider. In the implementation method, when a user implements interactive operation, the control of the slider can send a message to the parent window, the relative position value of the sliding block is modified, and then the control of the slider re-draws the whole slider according to the position value of the sliding block after modification till the display of the relative position of the current record in the whole records. By adopting the implementation method, the user can conveniently and intuitively see the position of the record of the current operation, judge whether the records occur in front and behind the position, and conveniently determine whether a corresponding key can be moved continuously or not for checking the related record. The interface of the control of the slider is simple, attractive and elegant.
Description
Technical field
The present invention relates to communication technique field, relate in particular to a kind of implementation method of slider control.
Background technology
Slider control is one of control the most frequently used among the PC.Generally speaking it is by a slider bar, and a slide block and optional scale are formed, and the user can show corresponding value by moving slider in corresponding control.Usually, label control or edit box control are arranged necessarily near the slip control, be used to show corresponding value.Slip control purposes level in application program is extensively, as just seeing in the attribute of desktop.But it is rarely found on embedded type GUI.
Existing, based on the embedded type GUI shape library of supporting FrameBuffer, owing to support the embedded type GUI shape library of FrameBuffer directly Framebuffer to be operated basic graphical controls such as no window, no label, edit box, button, programming efficiency is low, and is difficult in maintenance.
Summary of the invention
The object of the present invention is to provide a kind of implementation method of slider control.
Technical scheme of the present invention is to realize like this.
A kind of implementation method of slider control comprises step:
A: create and load slider control in parent window;
B: the operation information according to the slider bar parent window is received, calculate the relative position of sliding shoe in slider bar;
C: sliding shoe position relative value is set in the slider control,, calculates the starting point coordinate of sliding shoe, repaint slider control according to the sliding shoe positional value that is provided with.
Wherein, step a specifically comprises:
A1: definition slider bar spatial object and spatial object pointer;
A2: call the corresponding api function in embedded graphic storehouse, create the slider bar window;
A3: slider control is loaded in the parent window that has slider control.
Wherein, also comprise among the described step a2: the sliding shoe image that loads slider bar background bar image and slider bar.
Wherein, described operation information is up and down button or page turning key information.
Wherein, described relative position is represented with number percent.
Wherein, described slider bar is horizontal slider or vertical slider.
The embodiment of the invention compared with prior art, beneficial effect is: among the present invention, when the user carries out interactive operation, slider bar control will send message to its parent window, revise the relative position value of sliding shoe, slider control repaints whole slider bar according to the sliding shoe positional value after changing, and intuitively shows the relative position of current record in whole record.The present invention creates slider control on based on the embedded type GUI shape library basis of supporting FrameBuffer, make things convenient for the user to see that intuitively whether the record position of current operation, front and back also have record, make things convenient for the user to determine whether to continue mobile respective keys and check relative recording.The interface is succinct, attractive in appearance, generous.
Description of drawings
Fig. 1 is the inventive method process flow diagram;
Fig. 2 is an embodiment of the invention process flow diagram.
Embodiment
The present invention is based on linux system, support the embedded type GUI shape library of FrameBuffer, the slider control that realizes is used for intuitively showing the GUI window interface of multipage data manipulation, when the user uses button to check the multipage data recording, shows the positional information of current record.
After system start-up, the user enters the GUI window interface of multipage data manipulation, and creates slider control.When up and down arrow keys that the user uses a teleswitch, cursor (focus) is moved on the new record, according to certain algorithm, calculate current record shared number percent in whole record, according to these data, calculate the position of sliding shoe in whole slider bar, the position of drawing slider bar and sliding shoe.
In order to make purpose of the present invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with drawings and Examples.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
See also shown in Figure 1ly, comprising:
Step 101: create and load slider control in parent window;
Step 102: according to button up and down or the page turning key information that the slider bar parent window is received, calculate the relative position of sliding shoe in slider bar, relative position is represented with number percent;
Step 103: sliding shoe position relative value is set in the slider control,, calculates the starting point coordinate of sliding shoe, repaint slider control according to the sliding shoe positional value that is provided with.
See also shown in Figure 2, the slider bar treatment scheme:
1. establishment and loading slider control are in parent window
Definition slider bar spatial object: g_stSlider;
Definition slider bar spatial object pointer: g_pSlider;
Call the corresponding API in embedded graphic storehouse, create the slider bar window, and load the sliding shoe image of slider bar background bar image (slider bar image) and loading slider bar;
Slider control is loaded in the parent window that has slider control.
2. button up and down or the page turning key information of receiving according to the slider bar parent window is calculated the percent variable of slider bar button, and the relative position of sliding shoe in slider bar is set, and draws slider bar again.
Definition g_ListIndex is the index value of current focus record, and TotalListRecordNum is all record numbers of tabulation.
If the list records sum is greater than 1, the relative position value percent in slider bar of sliding shoe represents that with integer (number percent) its value is:
percent=g_ListIndex×100÷(TotalListRecordNum-1);
Then percent value is set in the slider control object, and draws slider control again
3. slider control is according to the percent variable that receives, and the relative position of the controll block of drawing in slider bar, slider bar can be horizontal slider, also can be vertical slider.
Call the corresponding api function of embedded type GUI shape library, carry out the drafting of slider control:
At first according to initialized setting, the Background of the slider bar that on framebuffer, draws,
(a). calculating slider bar length is also drawn
Definition barLen variable is represented its length.
If variable percent is more than or equal to 0, when slider bar was level, the length of slider bar equaled the background image width of slider control; If slider bar is vertical, then the length of slider bar equals the background image height of slider control.
Call corresponding API, the Background of the slider bar that on framebuffer, draws.
(b). calculating sliding shoe relative position also draws
If the coordinate of the reference position point of sliding shoe is X, Y; If the Len variable is the initial point position value of sliding shoe apart from slider bar.
Len=barLen×percent÷100
If slider bar is a horizontal positioned, calculate the origin coordinates of sliding shoe,
X coordinate+the Len of the upper left angle point of the corresponding rectangle of X=slider bar;
The Y coordinate of the upper left angle point of the corresponding rectangle of Y=slider bar;
When if moving bar is vertical, calculate the origin coordinates of sliding shoe:
The X coordinate of the upper left angle point of the corresponding rectangle of X=slider bar;
Y coordinate+the Len of the upper left angle point of the corresponding rectangle of Y=slider bar;
Call corresponding API, sliding shoe draws on framebuffer.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.
Claims (6)
1. the implementation method of a slider control is characterized in that, comprises step:
A: create and load slider control in parent window;
B: the operation information according to the slider bar parent window is received, calculate the relative position of sliding shoe in slider bar;
C: sliding shoe position relative value is set in the slider control,, calculates the starting point coordinate of sliding shoe, repaint slider control according to the sliding shoe positional value that is provided with.
2. the implementation method of slider control as claimed in claim 1 is characterized in that, step a specifically comprises:
A1: definition slider bar spatial object and spatial object pointer;
A2: call the corresponding api function in embedded graphic storehouse, create the slider bar window;
A3: slider control is loaded in the parent window that has slider control.
3. the implementation method of slider control as claimed in claim 2 is characterized in that, also comprises among the described step a2: the sliding shoe image that loads slider bar background bar image and slider bar.
4. the implementation method of slider control as claimed in claim 1 is characterized in that, described operation information is up and down button or page turning key information.
5. the implementation method of slider control as claimed in claim 1 is characterized in that, described relative position is represented with number percent.
6. the implementation method of slider control as claimed in claim 1 is characterized in that, described slider bar is horizontal slider or vertical slider.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2010105585263A CN102012813A (en) | 2010-11-24 | 2010-11-24 | Implementation method for control of slider |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2010105585263A CN102012813A (en) | 2010-11-24 | 2010-11-24 | Implementation method for control of slider |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN102012813A true CN102012813A (en) | 2011-04-13 |
Family
ID=43842989
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN2010105585263A Pending CN102012813A (en) | 2010-11-24 | 2010-11-24 | Implementation method for control of slider |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN102012813A (en) |
Cited By (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102567030A (en) * | 2012-01-06 | 2012-07-11 | 深圳市酷开网络科技有限公司 | Method and system for realizing television user interface |
| CN103037059A (en) * | 2012-12-14 | 2013-04-10 | 广东欧珀移动通信有限公司 | Method for locating information quickly |
| CN104636038A (en) * | 2015-01-28 | 2015-05-20 | 桂林长海发展有限责任公司 | Self-drawing system and method for slider |
| CN106033343A (en) * | 2015-03-16 | 2016-10-19 | 腾讯科技(深圳)有限公司 | Method and device for realizing owner-drawing control |
| CN106033350A (en) * | 2015-03-20 | 2016-10-19 | 广州金山移动科技有限公司 | Single value widget adjusting method and device |
| CN106528130A (en) * | 2016-10-26 | 2017-03-22 | 腾讯科技(深圳)有限公司 | Editing button adaptation method and apparatus |
| CN106528806A (en) * | 2016-11-10 | 2017-03-22 | 广西爱聘科技有限公司 | Salary sliding shaft |
| CN107479795A (en) * | 2017-07-07 | 2017-12-15 | 阿里巴巴集团控股有限公司 | Scroll processing method, device and electronic equipment |
| CN110275661A (en) * | 2018-03-15 | 2019-09-24 | 武汉斗鱼网络科技有限公司 | Method for exhibiting data and device |
| US12019859B2 (en) | 2020-03-23 | 2024-06-25 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Setting control display method and apparatus, storage medium, and electronic apparatus |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1635471A (en) * | 2003-12-25 | 2005-07-06 | 英业达股份有限公司 | Progress display system and method |
| CN101295244A (en) * | 2007-04-29 | 2008-10-29 | 鸿富锦精密工业(深圳)有限公司 | Progress bar design system and method |
| US20090064143A1 (en) * | 2007-08-30 | 2009-03-05 | International Business Machines Corporation | Subscribing to Progress Indicator Treshold |
| CN101796477A (en) * | 2007-09-07 | 2010-08-04 | 国际商业机器公司 | Scroll bar control |
-
2010
- 2010-11-24 CN CN2010105585263A patent/CN102012813A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1635471A (en) * | 2003-12-25 | 2005-07-06 | 英业达股份有限公司 | Progress display system and method |
| CN101295244A (en) * | 2007-04-29 | 2008-10-29 | 鸿富锦精密工业(深圳)有限公司 | Progress bar design system and method |
| US20090064143A1 (en) * | 2007-08-30 | 2009-03-05 | International Business Machines Corporation | Subscribing to Progress Indicator Treshold |
| CN101796477A (en) * | 2007-09-07 | 2010-08-04 | 国际商业机器公司 | Scroll bar control |
Non-Patent Citations (1)
| Title |
|---|
| 邱玉宝等: "利用VB编程实现窗体状态栏中使用进度条", 《电脑编程技巧与维护》, no. 2, 4 September 2006 (2006-09-04) * |
Cited By (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102567030A (en) * | 2012-01-06 | 2012-07-11 | 深圳市酷开网络科技有限公司 | Method and system for realizing television user interface |
| CN103037059A (en) * | 2012-12-14 | 2013-04-10 | 广东欧珀移动通信有限公司 | Method for locating information quickly |
| CN103037059B (en) * | 2012-12-14 | 2016-03-02 | 广东欧珀移动通信有限公司 | A kind of method of quick position information |
| CN104636038B (en) * | 2015-01-28 | 2018-03-09 | 桂林长海发展有限责任公司 | A kind of system and method for painting slider bar certainly |
| CN104636038A (en) * | 2015-01-28 | 2015-05-20 | 桂林长海发展有限责任公司 | Self-drawing system and method for slider |
| CN106033343B (en) * | 2015-03-16 | 2020-06-05 | 腾讯科技(深圳)有限公司 | Method and device for realizing self-drawing control |
| CN106033343A (en) * | 2015-03-16 | 2016-10-19 | 腾讯科技(深圳)有限公司 | Method and device for realizing owner-drawing control |
| CN106033350A (en) * | 2015-03-20 | 2016-10-19 | 广州金山移动科技有限公司 | Single value widget adjusting method and device |
| CN106528130A (en) * | 2016-10-26 | 2017-03-22 | 腾讯科技(深圳)有限公司 | Editing button adaptation method and apparatus |
| CN106528130B (en) * | 2016-10-26 | 2019-10-18 | 腾讯科技(深圳)有限公司 | A kind of Edit button adaptation method and device |
| CN106528806A (en) * | 2016-11-10 | 2017-03-22 | 广西爱聘科技有限公司 | Salary sliding shaft |
| CN107479795A (en) * | 2017-07-07 | 2017-12-15 | 阿里巴巴集团控股有限公司 | Scroll processing method, device and electronic equipment |
| CN107479795B (en) * | 2017-07-07 | 2020-06-23 | 阿里巴巴集团控股有限公司 | Scroll processing method and device and electronic equipment |
| CN110275661A (en) * | 2018-03-15 | 2019-09-24 | 武汉斗鱼网络科技有限公司 | Method for exhibiting data and device |
| CN110275661B (en) * | 2018-03-15 | 2021-04-27 | 武汉斗鱼网络科技有限公司 | Data display method and device |
| US12019859B2 (en) | 2020-03-23 | 2024-06-25 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Setting control display method and apparatus, storage medium, and electronic apparatus |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN102012813A (en) | Implementation method for control of slider | |
| KR101351162B1 (en) | Terminal apparatus and method for supporting list selection using flicking | |
| US9015639B2 (en) | Methods and systems for navigating a list with gestures | |
| CN106575196B (en) | Electronic device and method for displaying its user interface | |
| US8875017B2 (en) | Information processing apparatus, information processing method and program | |
| CN105335041A (en) | Method and apparatus for providing application icon | |
| KR102027879B1 (en) | Menu contolling method of media equipment, apparatus thereof, and medium storing program source thereof | |
| WO2019041779A1 (en) | Terminal interface switching, moving and gesture processing method and device and terminal | |
| AU2013222958A1 (en) | Method and apparatus for object size adjustment on a screen | |
| EP2965181B1 (en) | Enhanced canvas environments | |
| KR20110112980A (en) | Touch Sensing Devices and Methods | |
| US9513795B2 (en) | System and method for graphic object management in a large-display area computing device | |
| US10768807B2 (en) | Display control device and recording medium | |
| US10019148B2 (en) | Method and apparatus for controlling virtual screen | |
| CN105204751A (en) | Method and terminal for touch screen equipment background image conversion | |
| US20250251857A1 (en) | Display device and display method for menu bar thereof | |
| EP2911115A2 (en) | Electronic device and method for color extraction | |
| US20140173466A1 (en) | Transitions within views of conversation environments | |
| CN102291491B (en) | Form control and terminal equipment comprising same | |
| US20160364031A1 (en) | Storage medium, display control device, display control system, and display method | |
| JP2006092269A (en) | Electronic board system | |
| US20130067403A1 (en) | Electronic device and method for displaying user interface | |
| US9824667B2 (en) | Image processing apparatus and method | |
| WO2022143337A1 (en) | Display control method and apparatus, and electronic device and storage medium | |
| KR20180029625A (en) | Ground Truth generation program for performance evaluation of image processing |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C12 | Rejection of a patent application after its publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20110413 |