Summary of the invention
For solving the problems of the technologies described above, the invention provides a kind of tab controller, comprising: the tab positioning unit is used for determining according to user's operation the display position of one or more tabs; The tab control module, the display position that is used for the relevant tab of the operation with described user determined according to described user's operation and described tab positioning unit is determined the state of described tab.
In technique scheme, further comprise, described tab positioning unit comprises Dynamic Array, be used for and leave in wherein as array element according to the hierarchical sequence up and down that on screen, shows corresponding to the pointer of described one or more tabs, and when the arbitrary tab in described one or more tabs changes display position, the hierarchical sequence switch after the element in the described Dynamic Array moves by described arbitrary tab.
In technique scheme, the state of described tab comprises: shrink, launch or be positioned at first display position.
In technique scheme, described user's operation comprises to be chosen tab or slips over tab.
In technique scheme, described tab control module further comprises: arrange module automatically, the width that is used for the size of described array element, viewing area according to described Dynamic Array and tab is determined the state and the order of each tab of arranging in the described viewing area.
In technique scheme, described tab control module also further comprises: the tab condition judgment module, be used in that being operating as of described user is described when slipping over tab, whether the state of definite tab that is slipped over is the state of described contraction, and when judged result is the state of described contraction, described judged result is sent to tab launches module; And described tab launches module, is used for when the described judged result that receives from described tab condition judgment module the described tab that slips over being launched.
In technique scheme, described tab control module also further comprises: tab sequential adjustment module, be used for operation described user and be described when choosing tab, and determine that at described tab positioning unit the tab chosen is not during at first display position, is adjusted to described first display position with the described tab of choosing.
In technique scheme, further comprise, when described first display position is the leftmost side of viewing area, whether described tab condition judgment module has covered the position of the described tab that slips over according to the position of the contiguous tab in the left side of the described tab that slips over, if cover then determine that the state of the described tab that slips over is described contraction.
In technique scheme, comprise that further described tab is launched module and shunk the expansion that realizes the tab that slipped over by one or more tabs in the left side of the tab that will be slipped over.
In technique scheme, comprise that further the contraction of tab is to add that by the position of tab with its left side width that width deducts described tab then adds the width after tab is shunk.
In technique scheme, further comprise, when described first display position is the leftmost side of viewing area, described automatic layout module is launched all tabs successively from left side to the right side of described viewing area, deduct the quantity that the width that can allow after tab is shunk multiply by the residue tab up to the overall width of the tab of determining to have launched greater than the width of described viewing area, then described residue tab is all shunk demonstration.
Pass through technique scheme, tab control and demonstration problem have well been solved, at first, in the handoff procedure of tab, tab controller is always adjusted the order of tab dynamically according to the front and back order of window, the tab of the window of the superiors shows in the leftmost side, along with going deep into of level, arranges to the right successively.Secondly, when tab too many, can not be when showing with delegation, the automatic indentation of follow-up tab.At last, in the time of the tab of mouse-over indentation, the tab of indentation can be launched rapidly.
Embodiment
Below will be in detail with reference to the preferred embodiments of the present invention, the example of preferred embodiment is described with reference to the accompanying drawings.
Fig. 1 is the schematic block diagram according to tab controller of the present invention, and Fig. 2 is the schematic block diagram of tab controller according to an embodiment of the invention.
As shown in the figure, the invention provides a kind of tab controller 100, comprising: tab positioning unit 102 is used for determining according to user's operation the display position of one or more tabs; Tab control module 104, the display position that is used for the relevant tab of the operation with described user determined according to described user's operation and described tab positioning unit 102 is determined the state of described tab.
In technique scheme, described tab positioning unit 102 comprises Dynamic Array, be used for and leave in wherein as array element according to the hierarchical sequence up and down that on screen, shows corresponding to the pointer of described one or more tabs, and when the arbitrary tab in described one or more tabs changes display position, the hierarchical sequence switch after the element in the described Dynamic Array moves by described arbitrary tab.
In technique scheme, the state of described tab comprises: shrink, launch or be positioned at first display position.
In technique scheme, described user's operation comprises to be chosen tab or slips over tab.
As shown in Figure 2, described tab control module 104 can further include: arrange module 202 automatically, the width that is used for the size of described array element, viewing area according to described Dynamic Array and tab is determined the state and the order of each tab of arranging in the described viewing area.
Described tab control module 104 can further include: tab condition judgment module 204, be used in that being operating as of described user is described when slipping over tab, whether the state of definite tab that is slipped over is the state of described contraction, and when judged result is the state of described contraction, described judged result is sent to tab launches module 206; And described tab launches module 206, is used for when the described judged result that receives from described tab condition judgment module 204 the described tab that slips over being launched.
Described tab control module 104 can further include: tab sequential adjustment module 208, be used for operation described user and be described when choosing tab, and determine that at described tab positioning unit 102 tabs of being chosen are not during at first display position, are adjusted to described first display position with the described tab of choosing.
In technique scheme, further comprise, when described first display position is the leftmost side of viewing area, whether described tab condition judgment module 204 has covered the position of the described tab that slips over according to the position of the contiguous tab in the left side of the described tab that slips over, if cover then determine that the state of the described tab that slips over is described contraction.
In technique scheme, comprise that further described tab is launched module 206 and shunk the expansion that realizes the tab that slipped over by one or more tabs in the left side of the tab that will be slipped over.
In technique scheme, comprise that further the contraction of tab is to add that by the position of tab with its left side width that width deducts described tab then adds the width after tab is shunk.
In technique scheme, further comprise, when described first display position is the leftmost side of viewing area, described automatic layout module 202 is launched all tabs successively from left side to the right side of described viewing area, deduct the quantity that the breadth extreme that can allow to show multiply by the residue tab up to the overall width of the tab of determining to have launched greater than the width of described viewing area, then described residue tab is all shunk demonstration.
Be specifically described below in conjunction with one embodiment of the present of invention.
One, realize effect:
Be used for dynamically controlling the position and the sequencing of tab according to the tab controller of this embodiment, independently tab and a unified controller combine by one for it.Can a plurality of tabs of dynamic creation in tab controller, using of Multiple Document Interface its control effect is described with this control below to example.
1, when in a main window, when increasing a subwindow, can increase a tab automatically on the tab controller, in in the new tab of IE 8 windows, newly open a page, different is, the dynamic position of adjusting all tabs of tab controller meeting, a pairing tab of window of opening at last always are presented at the leftmost side.At this, it should be appreciated by those skilled in the art, if design needs, also can be designed as a pairing tab of window will opening at last and always be presented at the rightmost side.
2, when clicking a tab, corresponding subwindow can be shown to front end, and this tab can position saliency from behind be come out, and floats to the leftmost side with the form of animation effect, subsequently, originally the tab in this tab left side together moves to right, and after the tab position dynamic was arranged, the tab that is window correspondence foremost equally was in the leftmost side, and the corresponding tab of original active window is come the right side of this tab, turn right more, after the window level that expression is opened leans on more, be of little use more.
3, when tab number when not being a lot, all tabs all launch to show, when tab quantity along with number of windows increases when delegation can show any more, follow-up tab indentation shows, in the time of the tab of these indentations of mouse-over, tab can be launched rapidly.The principle of launching is, if the right side has clearance spaces to launch to the right, if not then shrink the nearest tab in left side, launches this tab simultaneously.Click the tab of indentation, tab can be advanced to the leftmost side equally, and corresponding window is preposition simultaneously, and tab can be arranged again.
4, click the X symbol on tab right side, tab is together closed together with window, and follow-up tab is arranged again.
Two, realize principle
1, independently the tab control is made up of title control, background picture and X button control;
2, tab controller is made up of a plurality of tab controls and a boundary frame area picture, current control shows that in the leftmost side level is the highest, and the boundary frame area picture shows at the second layer, other tab controls increase progressively according to order level from left to right, have so just formed the level contractive effect;
3, when mouse slides on tab, if the tab that slips over is retracted, then to calculate the layout of present tab automatically, look at whether the tab right side that slips over has the position, if the position is arranged, then tab moves right, literal on the tab is just unfolded, if the tab right side does not have the position, then need a control of the rightmost side of having launched is shunk, so that current control can have enough positions to launch;
4, in the time of click tab control, the incident of dishing out, allow the preposition demonstration of corresponding window, simultaneously the preposition demonstration of clicked tab, original preposition tab postposition, do animation effect subsequently, current tab moves left to the position of the leftmost side, and tab originally moves to right together with the tab in the middle of some;
5, when clicking the X button of tab control, the close event of dishing out if current window allows to close, then closes window, and hides tab simultaneously, and the tab that is hidden can be reactivated by name when open new window next time again.
Three, technical scheme and arthmetic statement
Main part according to the tab controller of this embodiment is a control combing, and it has made up a plurality of independently tab controls, and handles order and control relation between a plurality of tabs.The tab control mainly contains TabName, Caption, and the Picture attribute is showed oneself, and OnClick is arranged, and the OnClose incident is notified applications, and controller has Tabs to gather to operate these tabs, and concrete operations comprise: increase, deletion and mobile tab position.
The tab sequential organization: tab leaves in the Dynamic Array according to level up and down, show according to from left to right order when showing, in the time of the tab shift position, element in the array is by the hierarchical sequence switch, can guarantee like this in calculating process, can to know at any time current control on the position and the size of or next tab.
Tab controller according to present embodiment is mainly realized following function:
1, judge that the tab state is to shrink or launch: whether the position of previous tab of judging the sequence number of current tab has covered current tab, concrete determination methods is pre.left+pre.width>cur.left+6, wherein 6 for tab can allow the fixed width that shows after shrinking, and unit is a pixel.The fixed width that allows to show that is provided with in this embodiment after tab is shunk is 6 pixels, but it should be appreciated by those skilled in the art that this width can change according to the actual needs.
2, autoplacement computing method: if tab is shunk demonstration, then each tab takies 6 pixels, the computing method of autoplacement are, from left to right launch the tab control successively, if the overall width of the tab of find launching deducts 6 greater than container width and multiply by poor after the residue tab number, then follow-up tab is all shunk demonstration.
3, shrink the algorithm of tab: the position that the position of this tab equals a tab adds the width that deducts this tab behind the width of a tab, adds 6 pixels at last.
By top in conjunction with the accompanying drawings to the description of embodiments of the invention, can be expressly understood, tab control and demonstration problem have well been solved according to tab controller of the present invention, at first, in the handoff procedure of tab, always according to the dynamic order of adjusting tab of front and back order of window, the tab of the window of the superiors shows in the leftmost side tab controller, along with going deep into of level, arrange to the right successively.Secondly, when tab too many, can not be when showing with delegation, the automatic indentation of follow-up tab.At last, in the time of the tab of mouse-over indentation, the tab of indentation can be launched rapidly.Can ensure that so the most frequently used tab shows in the left side, and show, and tab not too commonly used is pressed against the state demonstration of right side to shrink automatically according to the inverted order expansion from left to right of used order.Fig. 3 A to 3E is a design sketch according to an embodiment of the invention.Below use Fig. 3 A to 3E foregoing description to be represented as follows:
As shown in Figure 3A, the subwindow of opening is few, and tab shows that successively the window tab of opening at last is presented at the leftmost side.
Shown in Fig. 3 B, opened a plurality of subwindows, follow-up tab does not show, just shrinks.
Shown in Fig. 3 C, mouse-over, tab is launched automatically.
Shown in Fig. 3 D, after tab 3 is clicked, dynamically moving to the left side.
Shown in Fig. 3 E, tab 3 moves to the leftmost side, and tab originally is again after the layout.
In above-mentioned example, the application process of tab controller is:
Drag and drop tab controller Stab1 on main window.
When the order of new subwindow is opened in execution, carry out the 1st subwindow of Stab1.Tabs.add (" frm1 ", " ") order realize the loading of new tab.
When closing window, carry out the method for Stab1.Tabs.remove (tab) and delete corresponding tab.
The OnTabClick incident of treatment S tab1 when tab is clicked, finds corresponding window according to the tab title, the preposition demonstration of window.
The OnTabClose incident of treatment S tab1 finds corresponding window according to the tab title, carries out window unloading shutdown command.
When subwindow is switched, carry out Stab1.SetCurrentTab (tab) method, in advance the tab of current window correspondence.
By said process, use the tab controller better controlled window of Multiple Document Interface switch.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.