.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Prima::ScrollBar 3" .TH Prima::ScrollBar 3 "2009-02-24" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Prima::ScrollBar \- standard scroll bars class .SH "DESCRIPTION" .IX Header "DESCRIPTION" The class \f(CW\*(C`Prima::ScrollBar\*(C'\fR implements both vertical and horizontal scrollbars in \fIPrima\fR. This is a purely Perl class without any C\-implemented parts except those inherited from \f(CW\*(C`Prima::Widget\*(C'\fR. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Prima::ScrollBar; \& \& my $sb = Prima::ScrollBar\-> create( owner => $group, %rest_of_profile); \& my $sb = $group\-> insert( \*(AqScrollBar\*(Aq, %rest_of_profile); \& \& my $isAutoTrack = $sb\-> autoTrack; \& $sb\-> autoTrack( $yesNo); \& \& my $val = $sb\-> value; \& $sb\-> value( $value); \& \& my $min = $sb\-> min; \& my $max = $sb\-> max; \& $sb\-> min( $min); \& $sb\-> max( $max); \& $sb\-> set_bounds( $min, $max); \& \& my $step = $sb\-> step; \& my $pageStep = $sb\-> pageStep; \& $sb\-> step( $step); \& $sb\-> pageStep( $pageStep); \& \& my $partial = $sb\-> partial; \& my $whole = $sb\-> whole; \& $sb\-> partial( $partial); \& $sb\-> whole( $whole); \& $sb\-> set_proportion( $partial, $whole); \& \& my $size = $sb\-> minThumbSize; \& $sb\-> minThumbSize( $size); \& \& my $isVertical = $sb\-> vertical; \& $sb\-> vertical( $yesNo); \& \& my ($width,$height) = $sb\-> get_default_size; .Ve .SH "API" .IX Header "API" .SS "Properties" .IX Subsection "Properties" .IP "autoTrack \s-1BOOLEAN\s0" 4 .IX Item "autoTrack BOOLEAN" Tells the widget if it should send \&\f(CW\*(C`Change\*(C'\fR notification during mouse tracking events. Generally it should only be set to 0 on very slow computers. .Sp Default value is 1 (logical true). .IP "growMode \s-1INTEGER\s0" 4 .IX Item "growMode INTEGER" Default value is gm::GrowHiX, i.e. the scrollbar will try to maintain the constant distance from its right edge to its owner's right edge as the owner changes its size. This is useful for horizontal scrollbars. .IP "height \s-1INTEGER\s0" 4 .IX Item "height INTEGER" Default value is \f(CW$Prima::ScrollBar::stdMetrics\fR[1], which is an operating system dependent value determined with a call to \&\f(CW\*(C`Prima::Application\-> get_default_scrollbar_metrics\*(C'\fR. The height is affected because by default the horizontal \f(CW\*(C`ScrollBar\*(C'\fR will be created. .IP "max \s-1INTEGER\s0" 4 .IX Item "max INTEGER" Sets the upper limit for \f(CW\*(C`value\*(C'\fR. .Sp Default value: 100. .IP "min \s-1INTEGER\s0" 4 .IX Item "min INTEGER" Sets the lower limit for \f(CW\*(C`value\*(C'\fR. .Sp Default value: 0 .IP "minThumbSize \s-1INTEGER\s0" 4 .IX Item "minThumbSize INTEGER" A minimal thumb breadth in pixels. The thumb cannot have main dimension lesser than this. .Sp Default value: 21 .IP "pageStep \s-1INTEGER\s0" 4 .IX Item "pageStep INTEGER" This determines the increment/decrement to \&\f(CW\*(C`value\*(C'\fR during \*(L"page\*(R"\-related operations, for example clicking the mouse on the strip outside the thumb, or pressing \f(CW\*(C`PgDn\*(C'\fR or \f(CW\*(C`PgUp\*(C'\fR. .Sp Default value: 10 .IP "partial \s-1INTEGER\s0" 4 .IX Item "partial INTEGER" This tells the scrollbar how many of imaginary units the thumb should occupy. See \f(CW\*(C`whole\*(C'\fR below. .Sp Default value: 10 .IP "selectable \s-1BOOLEAN\s0" 4 .IX Item "selectable BOOLEAN" Default value is 0 (logical false). If set to 1 the widget receives keyboard focus; when in focus, the thumb is blinking. .IP "step \s-1INTEGER\s0" 4 .IX Item "step INTEGER" This determines the minimal increment/decrement to \f(CW\*(C`value\*(C'\fR during mouse/keyboard interaction. .Sp Default value is 1. .IP "value \s-1INTEGER\s0" 4 .IX Item "value INTEGER" A basic scrollbar property; reflects the imaginary position between \f(CW\*(C`min\*(C'\fR and \&\f(CW\*(C`max\*(C'\fR, which corresponds directly to the position of the thumb. .Sp Default value is 0. .IP "vertical \s-1BOOLEAN\s0" 4 .IX Item "vertical BOOLEAN" Determines the main scrollbar style. Set this to 1 when the scrollbar style is vertical, 0 \- horizontal. The property can be changed at run-time, so the scrollbars can morph from horizontal to vertical and vice versa. .Sp Default value is 0 (logical false). .IP "whole \s-1INTEGER\s0" 4 .IX Item "whole INTEGER" This tells the scrollbar how many of imaginary units correspond to the whole length of the scrollbar. This value has nothing in common with \f(CW\*(C`min\*(C'\fR and \&\f(CW\*(C`max\*(C'\fR. You may think of the combination of \f(CW\*(C`partial\*(C'\fR and \f(CW\*(C`whole\*(C'\fR as of the proportion between the visible size of something (document, for example) and the whole size of that \*(L"something\*(R". Useful to struggle against infamous \*(L"bird\*(R" size of Windows scrollbar thumbs. .Sp Default value is 100. .SS "Methods" .IX Subsection "Methods" .IP "get_default_size" 4 .IX Item "get_default_size" Returns two integers, the default platform dependant width of a vertical scrollbar and height of a horizontal scrollbar. .SS "Events" .IX Subsection "Events" .IP "Change" 4 .IX Item "Change" The \f(CW\*(C`Change\*(C'\fR notification is sent whenever the thumb position of scrollbar is changed, subject to a certain limitations when \f(CW\*(C`autoTrack\*(C'\fR is 0. The notification conforms the general \fIPrima\fR rule: it is sent when appropriate, regardless to whether this was a result of user interaction, or a side effect of some method programmer has called. .IP "Track" 4 .IX Item "Track" If \f(CW\*(C`autoTrack\*(C'\fR is 0, called when the user changes the thumb position by the mouse instead of \f(CW\*(C`Change\*(C'\fR. .SH "EXAMPLE" .IX Header "EXAMPLE" .Vb 3 \& use Prima; \& use Prima::Application name => \*(AqScrollBar test\*(Aq; \& use Prima::ScrollBar; \& \& my $w = Prima::Window\-> create( \& text => \*(AqScrollBar test\*(Aq, \& size => [300,200]); \& \& my $sb = $w\-> insert( ScrollBar => \& width => 280, \& left => 10, \& bottom => 50, \& onChange => sub { \& $w\-> text( $_[0]\-> value); \& }); \& \& run Prima; .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" Prima, Prima::Widget, Prima::IntUtils, \fIexamples/rtc.pl\fR, \fIexamples/scrolbar.pl\fR .SH "AUTHORS" .IX Header "AUTHORS" Dmitry Karasik , Anton Berezin \- documentation