Summary of the invention
The purpose of the embodiment of the present invention is to provide a kind of method for displaying textbox and device, adapts to the operating procedure that window size show, and the requirement that attenuating is to user reducing the content in text box as the plain text content outside text box.
For reaching above-mentioned purpose, the embodiment of the invention discloses a kind of method for displaying textbox, including:
When destination document shows with Web format view, receive the regulating command of user;
Judge the type of the regulating command received;
Type in the regulating command received is, in the case of the size adjustment for destination document place window instructs, to instruct according to described size adjustment, the size of regulation destination document place window;
In the type of the regulating command received is for source text frame in the case of the form regulating command of content, according to the form that form regulating command is corresponding, the content in source text frame is adjusted;
Determine the original position of content in display target text box;
Obtain the content in source text frame and the current format of content, and delete source text frame;
From the beginning of original position determined by from, with the form of content in the source text frame of acquisition, the content in the source text frame that display obtains;
After content in described source text frame has shown, the surrounding of the content in the described source text frame of display, determine the bezel locations of target text box;
At bezel locations determined by, draw the frame of target text box, complete the display of target text box.
The original position of content in display target text box is determined it is also preferred that the left described, including:
By the source text frame that the is obtained ahead of time position in described destination document, it is defined as showing the original position of content in target text box;Or
Obtain source text frame position in described destination document, the position that will be obtained, be defined as showing the original position of content in target text box.
It is also preferred that the left the surrounding of described content in the described source text frame of display, determine the bezel locations of target text box, including:
Internal edges according to source text frame is away from form, the surrounding of the content in the described source text frame of display, respectively by content the most left in the content in shown described source text frame, the rightest content, the content gone up most and under content, the left side that distance records for described internal edges in form respectively away from, rightmargin, top margin and the position of bottom margin, be identified as the position of the left frame of target text box, left frame, upper side frame and lower frame;Wherein,
The internal edges of text box record in form the left side in text box away from, rightmargin, top margin and bottom margin;The left side away from, rightmargin, top margin and bottom margin be respectively content the most left in text box, the rightest content, the content gone up most and under content the distance distance of left frame of text box, the distance of left frame, the distance of upper side frame and the distance of lower frame respectively.
It is also preferred that the left described determined by bezel locations, draw the frame of target text box, including:
At bezel locations determined by, the Graphicxtras Frames Collection of the source text frame to be obtained ahead of time, draw the frame of target text box.
It is also preferred that the left described method also includes:
The Fill Color of the source text frame to be obtained ahead of time carries out color filling to target text box.
For reaching above-mentioned purpose, the embodiment of the invention discloses a kind of text box display device, including: regulating command receiver module, judge module, window size adjustment module, content adjustment module, original position determine that module, content acquisition module, content display module, bezel locations determine module and frame drafting module, wherein
Described regulating command receiver module, for when destination document shows with Web format view, receives the regulating command of user;
Described judge module, for judging the type of regulating command that described regulating command receiver module receives;
Described window size adjustment module, for in the case of the type that described judge module judged result is the regulating command received is for the size adjustment instruction of destination document place window, instruct according to described size adjustment, the size of regulation destination document place window;
Described content adjustment module, in the case of the form regulating command of content in the type that described judge module judged result is the regulating command received is for source text frame, according to the form that form regulating command is corresponding, the content in source text frame is adjusted;
Described original position determines module, for determining the original position of content in display target text box;
Described content obtains module, for obtaining the current format of the content in source text frame and content, and deletes source text frame;
Described content display module, for from the beginning of described original position determines the original position that module determines, obtains the form of content in the source text frame that module obtains with described content, shows that described content obtains the content in the source text frame that module obtains;
Described bezel locations determines module, after the content in described source text frame has shown, and the surrounding of the content in the described source text frame of display, determine the bezel locations of target text box;
Described frame drafting module, for determining at the bezel locations that module determines in described bezel locations, draws the frame of target text box, completes the display of target text box.
It is also preferred that the left described original position determines module, specifically for:
By the source text frame that the is obtained ahead of time position in described destination document, it is defined as showing the original position of content in target text box;Or
Obtain source text frame position in described destination document, the position that will be obtained, be defined as showing the original position of content in target text box.
It is also preferred that the left described bezel locations determines module, specifically for:
Internal edges according to source text frame is away from form, after content in described source text frame has shown, the surrounding of the content in the described source text frame of display, respectively by content the most left in the content in shown described source text frame, the rightest content, the content gone up most and under content, the left side that distance records for described internal edges in form respectively away from, rightmargin, top margin and the position of bottom margin, be identified as the position of the left frame of target text box, left frame, upper side frame and lower frame;Wherein,
The internal edges of text box record in form the left side in text box away from, rightmargin, top margin and bottom margin;The left side away from, rightmargin, top margin and bottom margin be respectively content the most left in text box, the rightest content, the content gone up most and under content the distance distance of left frame of text box, the distance of left frame, the distance of upper side frame and the distance of lower frame respectively.
It is also preferred that the left described frame drafting module, specifically for:
Determine at the bezel locations that module determines in described bezel locations, the Graphicxtras Frames Collection of the source text frame to be obtained ahead of time, draw the frame of target text box.
It is also preferred that the left described device also includes: color filling module,
Described color filling module, the Fill Color for the source text frame to be obtained ahead of time carries out color filling to target text box.
As seen from the above technical solutions, embodiments provide a kind of method for displaying textbox and device, when destination document shows with Web format view, receive the regulating command of user;Judge the type of the regulating command received;Type in the regulating command received is, in the case of the size adjustment for destination document place window instructs, to instruct according to described size adjustment, the size of regulation destination document place window;In the type of the regulating command received is for source text frame in the case of the form regulating command of content, according to the form that form regulating command is corresponding, the content in source text frame is adjusted;Determine the original position of content in display target text box;Obtain the content in source text frame and the current format of content, and delete source text frame;From the beginning of original position determined by from, with the form of content in the source text frame of acquisition, the content in the source text frame that display obtains;After content in described source text frame has shown, the surrounding of the content in the described source text frame of display, determine the bezel locations of target text box;At bezel locations determined by, draw the frame of target text box, complete the display of target text box.The application embodiment of the present invention, to user's no requirement (NR), and without the form of user setup text box, user has only to regulate the form of content in the size of document place window or regulation text box, the content in text box can be realized as the plain text content outside text box, adapt to window size show, decrease operating procedure.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only a part of embodiment of the present invention rather than whole embodiments.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art are obtained under not making creative work premise, broadly fall into the scope of protection of the invention.
Below by specific embodiment, the present invention is described in detail.
The first schematic flow sheet of the method for displaying textbox that Fig. 1 provides for the embodiment of the present invention;May include that
S101: when destination document shows with Web format view, receives the regulating command of user;
S102: judge the type of the regulating command received;It is, in the case of the size adjustment for destination document place window instructs, to perform S103 in the type of the regulating command received, in the type of the regulating command received is for source text frame in the case of the form regulating command of content, performs S104;
Wherein, the size adjustment for destination document place window instructs can be window maximized instruction, it is also possible to for window reduction instruction, it is also possible to for dragging the regulating command of window edge regulation window size;Can be to change the size of word, the size changing picture etc. for the form regulating command of content in source text frame.
S103: instruct according to described size adjustment, the size of regulation destination document place window;
Exemplary, it is assumed that size adjustment instruction is window maximized instruction, then by window maximized for destination document place.
S104: according to the form that form regulating command is corresponding, the content in source text frame is adjusted;
Wherein, the content in source text frame may include that word, icon, text box, form, chart etc..
Exemplary, it is assumed that form regulating command is to be No. three words by the size of word in source text frame by No. four regulation, then it is No. three words by source text frame Chinese regulation.
S105: determine the original position of content in display target text box;
In actual applications, the source text frame that the is obtained ahead of time position in described destination document can be defined as showing the original position of content in target text box;Source text frame position in described destination document, the position that will be obtained can also be obtained, be defined as showing the original position of content in target text box.Wherein,
The determination of text box position in a document, can be determined according to the placeholder of text box objects;Can also be determined relative to the position of document file page according to text box, such as, how many centimetres of document file page top margin of distance, the left side is away from how many centimetres;Can also be determined from the position that its nearest text paragraph section is first relative in document according to text box, such as text box is under text second segment word content, and how many centimetres of text second segment word content of distance, the distance page left side are away from how many centimetres.
Exemplary, it is assumed that the source text frame determined position in destination document is: on distance text second segment word content 2 centimetres, the distance page left side away from 2 centimetres.Distance text second segment word content 2 centimetres, the distance position away from 2 centimetres, the page left side are defined as showing the original position of content in target text box.
Certainly not limiting the specific implementation of the determination of text box position in a document in the present invention, any possible implementation can be applied in the present invention.
S106: obtain the content in source text frame and the current format of content, and delete source text frame;
Exemplary, assume that the content in the source text frame obtained is for " in order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art; will be briefly described the accompanying drawing used required in embodiment or description of the prior art below; apparently; the accompanying drawing in describing below is only some embodiments of the present invention; for those of ordinary skill in the art, on the premise of not paying creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings." wherein, form is first trip indentation 2 character, font size is No. three words, and line-spacing is 22 pounds.
S107: from the beginning of original position determined by from, with the form of content in the source text frame of acquisition, the content in the source text frame that display obtains;
Exemplary, from the beginning of the above-mentioned original position determined, with first trip indentation 2 character, font size is No. three words, line-spacing is the form of 22 pounds, content in display source text frame is " in order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, the accompanying drawing used required in embodiment or description of the prior art will be briefly described below, apparently, accompanying drawing in describing below is only some embodiments of the present invention, for those of ordinary skill in the art, on the premise of not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.”.Wherein, the content in source text frame the most also can carry out word wrap according to current window size or exhibition Row sum-equal matrix shows, to guarantee that the display of the content in source text frame is without departing from current window.
S108: after the content in described source text frame has shown, the surrounding of the content in the described source text frame of display, determine the bezel locations of target text box;
In actual applications, can be according to the internal edges of source text frame away from form, the surrounding of the content in the described source text frame of display, respectively by content the most left in the content in shown described source text frame, the rightest content, the content gone up most and under content, the left side that distance records for described internal edges in form respectively away from, rightmargin, top margin and the position of bottom margin, be identified as the position of the left frame of target text box, left frame, upper side frame and lower frame;Wherein,
The internal edges of text box record in form the left side in text box away from, rightmargin, top margin and bottom margin;The left side away from, rightmargin, top margin and bottom margin be respectively content the most left in text box, the rightest content, the content gone up most and under content the distance distance of left frame of text box, the distance of left frame, the distance of upper side frame and the distance of lower frame respectively.
The acquisition away from form of the internal edges of source text frame can receive user for destination document place window size adjustment instruct or for source text frame in content form regulating command after, obtained before deleting source text frame, the internal edges of source text frame can also be i.e. obtained away from form in each internal edges to source text frame after form is adjusted.
Exemplary, it is assumed that the internal edges of source text frame away from form is: the left side away from for 0.25 centimetre, rightmargin be 0.25 centimetre, top margin be 0.13 centimetre, bottom margin be 0.13 centimetre;The most respectively by content the most left in the content in shown described source text frame, the rightest content, the content gone up most and under content, distance is 0.25 centimetre, 0.25 centimetre, 0.13 centimetre, the position of 0.13 centimetre respectively, is identified as the position of the left frame of target text box, left frame, upper side frame and lower frame.
S109: at bezel locations determined by, draws the frame of target text box, completes the display of target text box.
In actual applications, can determined by bezel locations, the Graphicxtras Frames Collection of the source text frame to be obtained ahead of time, draw the frame of target text box.
Obtain source text frame Graphicxtras Frames Collection can receive user for destination document place window size adjustment instruct or for source text frame in content form regulating command after, obtained before deleting source text frame, the Graphicxtras Frames Collection of source text frame can also be i.e. obtained after each Graphicxtras Frames Collection to source text frame is adjusted.
Exemplary, it is assumed that the Graphicxtras Frames Collection of source text frame is: frame line color is black, and frame lines are dotted line, and frame line weight is 1 pound;Then with the black dotted lines that line weight is 1 pound, the frame of target text box is drawn.
Apply embodiment illustrated in fig. 1 of the present invention, to user's no requirement (NR), and without the form of user setup text box, user has only to regulate the form of content in the size of document place window or regulation text box, the content in text box can be realized as the plain text content outside text box, adapt to window size show, decrease operating procedure.
The second schematic flow sheet of the method for displaying textbox that Fig. 2 provides for the embodiment of the present invention;Embodiment illustrated in fig. 2 of the present invention, on the basis of embodiment illustrated in fig. 1, increases S110: the Fill Color of the source text frame to be obtained ahead of time carries out color filling to target text box.
In actual applications, obtain source text frame Fill Color can receive user for destination document place window size adjustment instruct or for source text frame in content form regulating command after, obtained before deleting source text frame, the Fill Color of source text frame can also be i.e. obtained after each Fill Color to source text frame is adjusted.
Exemplary, it is assumed that the Fill Color of source text frame is red, then target text box carries out the filling of color with redness.
Apply embodiment illustrated in fig. 2 of the present invention, the Fill Color of the target text box source text frame to be obtained ahead of time can be filled with, make target text box identical with the Fill Color of source text frame, visually reduce the color distortion of target text box and source text frame, more conform to the needs of user.
The first structural representation of the text box display device that Fig. 3 provides for the embodiment of the present invention;May include that regulating command receiver module 201, judge module 202, window size adjustment module 203, content adjustment module 204, original position determine that module 205, content acquisition module 206, content display module 207, bezel locations determine module 208 and frame drafting module 209, wherein
Regulating command receiver module 201, for when destination document shows with Web format view, receives the regulating command of user;
Judge module 202, for judging the type of regulating command that regulating command receiver module 201 receives;
Window size adjustment module 203, for in the case of the type that judge module 202 judged result is the regulating command received is for the size adjustment instruction of destination document place window, instruct according to described size adjustment, the size of regulation destination document place window;
Content adjustment module 204, in the case of the form regulating command of content in the type that judge module 202 judged result is the regulating command received is for source text frame, according to the form that form regulating command is corresponding, the content in source text frame is adjusted;
Original position determines module 205, for determining the original position of content in display target text box;
In actual applications, the original position of the embodiment of the present invention determines module 205, specifically may be used for:
By the source text frame that the is obtained ahead of time position in described destination document, it is defined as showing the original position of content in target text box;Or
Obtain source text frame position in described destination document, the position that will be obtained, be defined as showing the original position of content in target text box.
Content obtains module 206, for obtaining the current format of the content in source text frame and content, and deletes source text frame;
Content display module 207, for from the beginning of original position determines the original position that module 205 determines, obtains the form of content in the source text frame that module 206 obtains with content, and display content obtains the content in the source text frame that module 206 obtains;
Bezel locations determines module 208, after the content in described source text frame has shown, and the surrounding of the content in the described source text frame of display, determine the bezel locations of target text box;
In actual applications, the bezel locations of the embodiment of the present invention determines module 208, specifically may be used for:
Internal edges according to source text frame is away from form, after content in described source text frame has shown, the surrounding of the content in the described source text frame of display, respectively by content the most left in the content in shown described source text frame, the rightest content, the content gone up most and under content, the left side that distance records for described internal edges in form respectively away from, rightmargin, top margin and the position of bottom margin, be identified as the position of the left frame of target text box, left frame, upper side frame and lower frame;Wherein,
The internal edges of text box record in form the left side in text box away from, rightmargin, top margin and bottom margin;The left side away from, rightmargin, top margin and bottom margin be respectively content the most left in text box, the rightest content, the content gone up most and under content the distance distance of left frame of text box, the distance of left frame, the distance of upper side frame and the distance of lower frame respectively.
Frame drafting module 209, for determining at the bezel locations that module 208 determines in bezel locations, draws the frame of target text box, completes the display of target text box.
In actual applications, the frame drafting module 209 of the embodiment of the present invention, specifically may be used for:
Determine at the bezel locations that module 208 determines in bezel locations, the Graphicxtras Frames Collection of the source text frame to be obtained ahead of time, draw the frame of target text box.
Apply embodiment illustrated in fig. 3 of the present invention, to user's no requirement (NR), and without the form of user setup text box, user has only to regulate the form of content in the size of document place window or regulation text box, the content in text box can be realized as the plain text content outside text box, adapt to window size show, decrease operating procedure.
The second structural representation of the text box display device that Fig. 4 provides for the embodiment of the present invention, embodiment illustrated in fig. 4 of the present invention, on the basis of embodiment illustrated in fig. 3, increases color filling module 210,
Color filling module 210, the Fill Color for the source text frame to be obtained ahead of time carries out color filling to target text box.
Apply embodiment illustrated in fig. 4 of the present invention, the Fill Color of the target text box source text frame to be obtained ahead of time can be filled with, make target text box identical with the Fill Color of source text frame, visually reduce the color distortion of target text box and source text frame, more conform to the needs of user.
It should be noted that, in this article, the relational terms of such as first and second or the like is used merely to separate an entity or operation with another entity or operating space, and not necessarily requires or imply the relation or sequentially that there is any this reality between these entities or operation.And, term " includes ", " comprising " or its any other variant are intended to comprising of nonexcludability, so that include that the process of a series of key element, method, article or equipment not only include those key elements, but also include other key elements being not expressly set out, or also include the key element intrinsic for this process, method, article or equipment.In the case of there is no more restriction, statement " including ... " key element limited, it is not excluded that there is also other identical element in including the process of described key element, method, article or equipment.
Each embodiment in this specification all uses relevant mode to describe, and between each embodiment, identical similar part sees mutually, and what each embodiment stressed is the difference with other embodiments.For device embodiment, owing to it is substantially similar to embodiment of the method, so describe is fairly simple, relevant part sees the part of embodiment of the method and illustrates.
One of ordinary skill in the art will appreciate that all or part of step realizing in said method embodiment can be by program and completes to instruct relevant hardware, described program can be stored in computer read/write memory medium, the storage medium obtained designated herein, such as: ROM/RAM, magnetic disc, CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit protection scope of the present invention.All any modification, equivalent substitution and improvement etc. made within the spirit and principles in the present invention, are all contained in protection scope of the present invention.