OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/hostdependX86LINUX64.git] / util / X86LINUX64 / man / man3 / Ttk_MakePadding.3
1 '\"
2 '\" Copyright (c) 2004 Joe English
3 '\"
4 .TH Geometry 3 8.5 Tk "Tk Themed Widget"
5 .\" The -*- nroff -*- definitions below are for supplemental macros used
6 .\" in Tcl/Tk manual entries.
7 .\"
8 .\" .AP type name in/out ?indent?
9 .\"     Start paragraph describing an argument to a library procedure.
10 .\"     type is type of argument (int, etc.), in/out is either "in", "out",
11 .\"     or "in/out" to describe whether procedure reads or modifies arg,
12 .\"     and indent is equivalent to second arg of .IP (shouldn't ever be
13 .\"     needed;  use .AS below instead)
14 .\"
15 .\" .AS ?type? ?name?
16 .\"     Give maximum sizes of arguments for setting tab stops.  Type and
17 .\"     name are examples of largest possible arguments that will be passed
18 .\"     to .AP later.  If args are omitted, default tab stops are used.
19 .\"
20 .\" .BS
21 .\"     Start box enclosure.  From here until next .BE, everything will be
22 .\"     enclosed in one large box.
23 .\"
24 .\" .BE
25 .\"     End of box enclosure.
26 .\"
27 .\" .CS
28 .\"     Begin code excerpt.
29 .\"
30 .\" .CE
31 .\"     End code excerpt.
32 .\"
33 .\" .VS ?version? ?br?
34 .\"     Begin vertical sidebar, for use in marking newly-changed parts
35 .\"     of man pages.  The first argument is ignored and used for recording
36 .\"     the version when the .VS was added, so that the sidebars can be
37 .\"     found and removed when they reach a certain age.  If another argument
38 .\"     is present, then a line break is forced before starting the sidebar.
39 .\"
40 .\" .VE
41 .\"     End of vertical sidebar.
42 .\"
43 .\" .DS
44 .\"     Begin an indented unfilled display.
45 .\"
46 .\" .DE
47 .\"     End of indented unfilled display.
48 .\"
49 .\" .SO ?manpage?
50 .\"     Start of list of standard options for a Tk widget. The manpage
51 .\"     argument defines where to look up the standard options; if
52 .\"     omitted, defaults to "options". The options follow on successive
53 .\"     lines, in three columns separated by tabs.
54 .\"
55 .\" .SE
56 .\"     End of list of standard options for a Tk widget.
57 .\"
58 .\" .OP cmdName dbName dbClass
59 .\"     Start of description of a specific option.  cmdName gives the
60 .\"     option's name as specified in the class command, dbName gives
61 .\"     the option's name in the option database, and dbClass gives
62 .\"     the option's class in the option database.
63 .\"
64 .\" .UL arg1 arg2
65 .\"     Print arg1 underlined, then print arg2 normally.
66 .\"
67 .\" .QW arg1 ?arg2?
68 .\"     Print arg1 in quotes, then arg2 normally (for trailing punctuation).
69 .\"
70 .\" .PQ arg1 ?arg2?
71 .\"     Print an open parenthesis, arg1 in quotes, then arg2 normally
72 .\"     (for trailing punctuation) and then a closing parenthesis.
73 .\"
74 .\"     # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
75 .if t .wh -1.3i ^B
76 .nr ^l \n(.l
77 .ad b
78 .\"     # Start an argument description
79 .de AP
80 .ie !"\\$4"" .TP \\$4
81 .el \{\
82 .   ie !"\\$2"" .TP \\n()Cu
83 .   el          .TP 15
84 .\}
85 .ta \\n()Au \\n()Bu
86 .ie !"\\$3"" \{\
87 \&\\$1 \\fI\\$2\\fP (\\$3)
88 .\".b
89 .\}
90 .el \{\
91 .br
92 .ie !"\\$2"" \{\
93 \&\\$1  \\fI\\$2\\fP
94 .\}
95 .el \{\
96 \&\\fI\\$1\\fP
97 .\}
98 .\}
99 ..
100 .\"     # define tabbing values for .AP
101 .de AS
102 .nr )A 10n
103 .if !"\\$1"" .nr )A \\w'\\$1'u+3n
104 .nr )B \\n()Au+15n
105 .\"
106 .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
107 .nr )C \\n()Bu+\\w'(in/out)'u+2n
108 ..
109 .AS Tcl_Interp Tcl_CreateInterp in/out
110 .\"     # BS - start boxed text
111 .\"     # ^y = starting y location
112 .\"     # ^b = 1
113 .de BS
114 .br
115 .mk ^y
116 .nr ^b 1u
117 .if n .nf
118 .if n .ti 0
119 .if n \l'\\n(.lu\(ul'
120 .if n .fi
121 ..
122 .\"     # BE - end boxed text (draw box now)
123 .de BE
124 .nf
125 .ti 0
126 .mk ^t
127 .ie n \l'\\n(^lu\(ul'
128 .el \{\
129 .\"     Draw four-sided box normally, but don't draw top of
130 .\"     box if the box started on an earlier page.
131 .ie !\\n(^b-1 \{\
132 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
133 .\}
134 .el \}\
135 \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
136 .\}
137 .\}
138 .fi
139 .br
140 .nr ^b 0
141 ..
142 .\"     # VS - start vertical sidebar
143 .\"     # ^Y = starting y location
144 .\"     # ^v = 1 (for troff;  for nroff this doesn't matter)
145 .de VS
146 .if !"\\$2"" .br
147 .mk ^Y
148 .ie n 'mc \s12\(br\s0
149 .el .nr ^v 1u
150 ..
151 .\"     # VE - end of vertical sidebar
152 .de VE
153 .ie n 'mc
154 .el \{\
155 .ev 2
156 .nf
157 .ti 0
158 .mk ^t
159 \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
160 .sp -1
161 .fi
162 .ev
163 .\}
164 .nr ^v 0
165 ..
166 .\"     # Special macro to handle page bottom:  finish off current
167 .\"     # box/sidebar if in box/sidebar mode, then invoked standard
168 .\"     # page bottom macro.
169 .de ^B
170 .ev 2
171 'ti 0
172 'nf
173 .mk ^t
174 .if \\n(^b \{\
175 .\"     Draw three-sided box if this is the box's first page,
176 .\"     draw two sides but no top otherwise.
177 .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
178 .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
179 .\}
180 .if \\n(^v \{\
181 .nr ^x \\n(^tu+1v-\\n(^Yu
182 \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
183 .\}
184 .bp
185 'fi
186 .ev
187 .if \\n(^b \{\
188 .mk ^y
189 .nr ^b 2
190 .\}
191 .if \\n(^v \{\
192 .mk ^Y
193 .\}
194 ..
195 .\"     # DS - begin display
196 .de DS
197 .RS
198 .nf
199 .sp
200 ..
201 .\"     # DE - end display
202 .de DE
203 .fi
204 .RE
205 .sp
206 ..
207 .\"     # SO - start of list of standard options
208 .de SO
209 'ie '\\$1'' .ds So \\fBoptions\\fR
210 'el .ds So \\fB\\$1\\fR
211 .SH "STANDARD OPTIONS"
212 .LP
213 .nf
214 .ta 5.5c 11c
215 .ft B
216 ..
217 .\"     # SE - end of list of standard options
218 .de SE
219 .fi
220 .ft R
221 .LP
222 See the \\*(So manual entry for details on the standard options.
223 ..
224 .\"     # OP - start of full description for a single option
225 .de OP
226 .LP
227 .nf
228 .ta 4c
229 Command-Line Name:      \\fB\\$1\\fR
230 Database Name:  \\fB\\$2\\fR
231 Database Class: \\fB\\$3\\fR
232 .fi
233 .IP
234 ..
235 .\"     # CS - begin code excerpt
236 .de CS
237 .RS
238 .nf
239 .ta .25i .5i .75i 1i
240 ..
241 .\"     # CE - end code excerpt
242 .de CE
243 .fi
244 .RE
245 ..
246 .\"     # UL - underline word
247 .de UL
248 \\$1\l'|0\(ul'\\$2
249 ..
250 .\"     # QW - apply quotation marks to word
251 .de QW
252 .ie '\\*(lq'"' ``\\$1''\\$2
253 .\"" fix emacs highlighting
254 .el \\*(lq\\$1\\*(rq\\$2
255 ..
256 .\"     # PQ - apply parens and quotation marks to word
257 .de PQ
258 .ie '\\*(lq'"' (``\\$1''\\$2)\\$3
259 .\"" fix emacs highlighting
260 .el (\\*(lq\\$1\\*(rq\\$2)\\$3
261 ..
262 .\"     # QR - quoted range
263 .de QR
264 .ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3
265 .\"" fix emacs highlighting
266 .el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3
267 ..
268 .\"     # MT - "empty" string
269 .de MT
270 .QW ""
271 ..
272 .BS
273 .SH NAME
274 Ttk_MakeBox, Ttk_PadBox, Ttk_ExpandBox, Ttk_PackBox, Ttk_StickBox, Ttk_PlaceBox, Ttk_BoxContains, Ttk_MakePadding, Ttk_UniformPadding, Ttk_AddPadding, Ttk_RelievePadding, Ttk_GetPaddingFromObj, Ttk_GetBorderFromObj, Ttk_GetStickyFromObj \- Tk themed geometry utilities
275 .SH SYNOPSIS
276 .nf
277 \fB#include <tkTheme.h>\fR
278
279 Ttk_Box
280 \fBTtk_MakeBox\fR(int \fIx\fR, int \fIy\fR, int \fIwidth\fR, int \fIheight\fR);
281
282 Ttk_Box
283 \fBTtk_PadBox\fR(Ttk_Box \fIparcel\fR, Ttk_Padding \fIpadding\fR);
284
285 Ttk_Box
286 \fBTtk_ExpandBox\fR(Ttk_Box \fIparcel\fR, Ttk_Padding \fIpadding\fR);
287
288 Ttk_Box
289 \fBTtk_PackBox\fR(Ttk_Box *\fIcavity\fR, int \fIwidth\fR, int \fIheight\fR, Ttk_Side \fIside\fR);
290
291 Ttk_Box
292 \fBTtk_StickBox\fR(Ttk_Box \fIparcel\fR, int \fIwidth\fR, int \fIheight\fR, unsigned \fIsticky\fR);
293
294 Ttk_Box
295 \fBTtk_PlaceBox\fR(Ttk_Box *\fIcavity\fR, int \fIwidth\fR, int \fIheight\fR, Ttk_Side \fIside\fR, unsigned \fIsticky\fR);
296
297 Ttk_Box
298 \fBTtk_AnchorBox\fR(Ttk_Box \fIparcel\fR, int \fIwidth\fR, int \fIheight\fR, Tk_Anchor \fIanchor\fR);
299
300 Ttk_Padding
301 \fBTtk_MakePadding\fR(short \fIleft\fR, short \fItop\fR, short \fIright\fR, short \fIbottom\fR);
302
303 Ttk_Padding
304 \fBTtk_UniformPadding\fR(short \fIborder\fR);
305
306 Ttk_Padding
307 \fBTtk_AddPadding\fR(Ttk_Padding \fIpadding1\fR, Ttk_Padding \fIpadding2\fR;
308
309 Ttk_Padding
310 \fBTtk_RelievePadding\fR(Ttk_Padding \fIpadding\fR, int \fIrelief\fR);
311
312 int
313 \fBTtk_BoxContains\fR(Ttk_Box \fIbox\fR, int \fIx\fR, int \fIy\fR);
314
315 int
316 \fBTtk_GetPaddingFromObj\fR(Tcl_Interp *\fIinterp\fR, Tk_Window \fItkwin\fR, Tcl_Obj *\fIobjPtr\fR, Ttk_Padding *\fIpadding_rtn\fR);
317
318 int
319 \fBTtk_GetBorderFromObj\fR(Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIobjPtr\fR, Ttk_Padding *\fIpadding_rtn\fR);
320
321 int
322 \fBTtk_GetStickyFromObj\fR(Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIobjPtr\fR, int *\fIsticky_rtn\fR);
323 .fi
324 .SH ARGUMENTS
325 .AP Tk_Anchor anchor in
326 One of the symbolic constants \fBTK_ANCHOR_N\fR, \fBTK_ANCHOR_NE\fR,
327 etc.  See \fITk_GetAnchorFromObj(3)\fR.
328 .AP "Ttk_Box *" cavity in/out
329 A rectangular region from which a parcel is allocated.
330 .AP short border in
331 Extra padding (in pixels) to add uniformly to each side of a region.
332 .AP short bottom in
333 Extra padding (in pixels) to add to the bottom of a region.
334 .AP Ttk_Box box in
335 .AP "Ttk_Box *" box_rtn out
336 Specifies a rectangular region.
337 .AP int height in
338 The height in pixels of a region.
339 .AP "Tcl_Interp *" interp in
340 Used to store error messages.
341 .AP int left in
342 Extra padding (in pixels) to add to the left side of a region.
343 .AP "Tcl_Obj *" objPtr in
344 String value contains a symbolic name 
345 to be converted to an enumerated value or bitmask.
346 Internal rep may be be modified to cache corresponding value.
347 .AP Ttk_Padding padding in
348 .AP "Ttk_Padding *" padding_rtn out
349 Extra padding to add on the inside of a region.
350 .AP Ttk_Box parcel in
351 A rectangular region, allocated from a cavity.
352 .AP int relief in
353 One of the standard Tk relief options 
354 (TK_RELIEF_RAISED, TK_RELIEF_SUNKEN, etc.).  
355 See \fBTk_GetReliefFromObj\fR.
356 .AP short right in
357 Extra padding (in pixels) to add to the right side of a region.
358 .AP Ttk_Side side in
359 One of \fBTTK_SIDE_LEFT\fR, \fBTTK_SIDE_TOP\fR, 
360 \fBTTK_SIDE_RIGHT\fR, or \fBTTK_SIDE_BOTTOM\fR.
361 .AP unsigned sticky in
362 A bitmask containing one or more of the bits
363 \fBTTK_STICK_W\fR (west, or left), 
364 \fBTTK_STICK_E\fR (east, or right, 
365 \fBTTK_STICK_N\fR (north, or top), and
366 \fBTTK_STICK_S\fR (south, or bottom).
367 \fBTTK_FILL_X\fR is defined as a synonym for (TTK_STICK_W|TTK_STICK_E),
368 \fBTTK_FILL_Y\fR is a synonym for (TTK_STICK_N|TTK_STICK_S),
369 and  \fBTTK_FILL_BOTH\fR and \fBTTK_STICK_ALL\fR
370 are synonyms for (TTK_FILL_X|TTK_FILL_Y).
371 See also: \fIgrid(n)\fR.
372 .AP Tk_Window tkwin in
373 Window whose screen geometry determines 
374 the conversion between absolute units and pixels.
375 .AP short top in
376 Extra padding at the top of a region.
377 .AP int width in
378 The width in pixels of a region.
379 .AP int x in
380 X coordinate of upper-left corner of region.
381 .AP int y in
382 Y coordinate of upper-left corner of region.
383 .BE
384 .SH "BOXES"
385 .PP
386 The \fBTtk_Box\fR structure represents a rectangular region of a window:
387 .CS
388 typedef struct {
389     int \fIx\fR;
390     int \fIy\fR;
391     int \fIwidth\fR;
392     int \fIheight\fR;
393 } \fBTtk_Box\fR;
394 .CE
395 All coordinates are relative to the window.
396 .PP
397 \fBTtk_MakeBox\fR is a convenience routine that constructs
398 a \fBTtk_Box\fR structure representing a region \fIwidth\fR pixels
399 wide, \fIheight\fR pixels tall, at the specified \fIx, y\fR coordinates.
400 .PP
401 \fBTtk_PadBox\fR returns a new box located inside the specified \fIparcel\fR,
402 shrunken according to the left, top, right, and bottom margins
403 specified by \fIpadding\fR.
404 .PP
405 \fBTtk_ExpandBox\fR is the inverse of \fBTtk_PadBox\fR:
406 it returns a new box surrounding the specified \fIparcel\fR,
407 expanded  according to the left, top, right, and bottom margins
408 specified by \fIpadding\fR.
409 .PP
410 \fBTtk_PackBox\fR allocates a parcel \fIwidth\fR by \fIheight\fR
411 pixels wide on the specified \fIside\fR of the \fIcavity\fR,
412 and shrinks the \fIcavity\fR accordingly.
413 .PP
414 \fBTtk_StickBox\fR places a box with the requested \fIwidth\fR
415 and \fIheight\fR inside the \fIparcel\fR according to the
416 \fIsticky\fR bits.
417 .PP
418 \fBTtk_PlaceBox\fR combines \fBTtk_PackBox\fR and \fBTtk_StickBox\fR:
419 it allocates a parcel on the specified \fIside\fR of the \fIcavity\fR,
420 places a box of the requested size inside the parcel according to \fIsticky\fR,
421 and shrinks the \fIcavity\fR.
422 .PP
423 \fBTtk_AnchorBox\fR places a box with the requested \fIwidth\fR
424 and \fIheight\fR inside the \fIparcel\fR according to the
425 specified \fIanchor\fR option.
426 .PP
427 \fBTtk_BoxContains\fR tests if the specified \fIx, y\fR coordinate
428 lies within the rectangular region \fIbox\fR.
429 .SH "PADDDING"
430 .PP
431 The \fBTtk_Padding\fR structure is used to represent
432 borders, internal padding, and external margins:
433 .CS
434 typedef struct {
435     short \fIleft\fR;
436     short \fItop\fR;
437     short \fIright\fR;
438     short \fIbottom\fR;
439 } \fBTtk_Padding\fR;
440 .CE
441 .PP
442 \fBTtk_MakePadding\fR is a convenience routine that constructs
443 a \fBTtk_Padding\fR structure with the specified left, top, right, and bottom
444 components.
445 .PP
446 \fBTtk_UniformPadding\fR constructs a \fBTtk_Padding\fR structure
447 with all components equal to the specified \fIborder\fR.
448 .PP
449 \fBTtk_AddPadding\fR adds two \fBTtk_Padding\fRs together
450 and returns a combined padding containing the sum of the
451 individual padding components.
452 .PP
453 \fBTtk_RelievePadding\fR 
454 adds an extra 2 pixels of padding to \fIpadding\fR
455 according to the specified \fIrelief\fR.
456 If \fIrelief\fR is \fBTK_RELIEF_SUNKEN\fR, 
457 adds two pixels at the top and left
458 so the inner region is shifted down and to the left.
459 If it is \fBTK_RELIEF_RAISED\fR, adds two pixels
460 at the bottom and right so 
461 the inner region is shifted up and to the right.
462 Otherwise, adds 1 pixel on all sides.
463 This is typically used in element geometry procedures to simulate a
464 .QW pressed-in
465 look for pushbuttons.
466 .SH "CONVERSION ROUTINES"
467 .PP
468 \fBTtk_GetPaddingFromObj\fR converts the string in \fIobjPtr\fR
469 to a \fBTtk_Padding\fR structure.
470 The string representation is a list of 
471 up to four length specifications 
472 .QW "\fIleft top right bottom\fR" .
473 If fewer than four elements are specified, 
474 \fIbottom\fR defaults to \fItop\fR,
475 \fIright\fR defaults to \fIleft\fR, and 
476 \fItop\fR defaults to \fIleft\fR.
477 See \fBTk_GetPixelsFromObj(3)\fR for the syntax of length specifications.
478 .PP
479 \fBTtk_GetBorderFromObj\fR is the same as \fBTtk_GetPaddingFromObj\fR
480 except that the lengths are specified as integers 
481 (i.e., resolution-dependant values like \fI3m\fR are not allowed).
482 .PP
483 \fBTtk_GetStickyFromObj\fR converts the string in \fIobjPtr\fR
484 to a \fIsticky\fR bitmask.  The string contains zero or more
485 of the characters \fBn\fR, \fBs\fR, \fBe\fR, or \fBw\fR.
486 .SH "SEE ALSO"
487 Tk_GetReliefFromObj(3), Tk_GetPixelsFromObj(3), Tk_GetAnchorFromObj(3)
488 .SH "KEYWORDS"
489 geometry, padding, margins, box, region, sticky, relief