ScrollingLabel
[ class tree: ScrollingLabel ] [ index: ScrollingLabel ] [ all elements ]

Class: Gtk_ScrollingLabel

Source Location: /Gtk_ScrollingLabel-1.0.0/ScrollingLabel.php

Class Overview


Class for creating a label with the ability to scroll text.


Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 61]
Class for creating a label with the ability to scroll text.


[ Top ]


Class Variables

$bounce =  true

[line 109]

Whether the text should change direction when it hits an edge.

Type:   boolean


[ Top ]

$currentCharPosition =  0

[line 99]

The first character to show when direction is GTK_SCROLLINGLABEL_LEFT

The last character to show when direction is GTK_SCROLLINGLABEL_RIGHT


Type:   integer


[ Top ]

$direction =  GTK_SCROLLINGLABEL_LEFT

[line 104]

The direction the text should be moving.

Type:   integer


[ Top ]

$gtkTimeoutTag =

[line 82]

The tag returned to indicate the call to gtk timeout.

Type:   integer


[ Top ]

$label =

[line 72]

The label which will display the text.

Type:   object


[ Top ]

$labelText =

[line 77]

The full text that will be displayed over time.

Type:   string


[ Top ]

$speed =  70

[line 93]

The number of milliseconds between calls to the method passed to gtk timeout.

Type:   integer


[ Top ]

$visibleLength =  70

[line 87]

The number of characters that should be visible

Type:   integer


[ Top ]

$widget =

[line 67]

The event box which will contain the label and listen for events.

Type:   object


[ Top ]



Method Detail

bounce   [line 615]

boolean bounce( boolean $bounce)

Deprecated method to set bouncing.

Parameters:

boolean   $bounce   —  true means change directions.

[ Top ]

getFullText   [line 723]

string getFullText( none 0)

Return all of the text that can ever be shown by this label.
  • Access: public

Parameters:

none   0   — 

[ Top ]

getHiddenText   [line 735]

string getHiddenText( none 0)

Return all of the text that is not currently visible.
  • Access: public

Parameters:

none   0   — 

[ Top ]

getScrollingLabel   [line 874]

&object &getScrollingLabel( none 0)

Return the GTKEventBox with the GTKLabel inside.
  • Access: public

Parameters:

none   0   — 

[ Top ]

getStyle   [line 649]

&object &getStyle( none 0)

Get the label's style widget.

getStyle() returns the label's style widget. This lets you make changes to the style to alter the look and feel of the widget. You can change the font of the display, the color of the background, etc.

  • Access: public

Parameters:

none   0   — 

[ Top ]

getVisibleLength   [line 836]

integer getVisibleLength( none 0)

Return the visible area length in characters
  • Access: public

Parameters:

none   0   — 

[ Top ]

getVisibleText   [line 669]

string getVisibleText( none 0)

Return the portion of the label text that should be visible

getVisibleText() is used internally to get the text that should be shown everytime the text scrolls. It can also be called publically to get the text that is currently displayed in the visible window area. The part of the text that is visible depends on the current character position and the direction the text is moving.


Parameters:

none   0   — 

[ Top ]

hide   [line 861]

void hide( none 0)

Hide the GTK components.
  • Access: public

Parameters:

none   0   — 

[ Top ]

jumpToChar   [line 788]

integer jumpToChar( integer $charPosition)

Change the current character position.

jumpToChar() allows you to go directly to a character position on the next call to _scrollLabel. The new position must be between zero (the first character) and the length of the label minus one. The character position should be calculated using the string from padText(). When the text is scrolling to the left the $charPosition should be the left-most character to display. When text is scrolling to the right, $charPosition should be the right-most character to display.

The visible label will not change until _scrollLabel is called again.

  • Return: The new current character position. (PEAR_Error when there is a problem.)
  • Access: public

Parameters:

integer   $charPosition   —  Depending on the direction either the left or right most character to display.

[ Top ]

padText   [line 701]

string padText( none 0)

Pad the text with enough space to fill the visible area.

padText adds the needed amount of white space to the text so that it can scroll properly. When the text is set to bounce the padding should only be what is needed to make the string as long as the visible window area. If the text is not bouncing, the text must be padded with as many spaces as the length of the visible area.


Parameters:

none   0   — 

[ Top ]

pause   [line 341]

boolean pause( none 0)

Stop the scroll where it is and do not change the current position.

Usually connected to an event.

pause() will stop the text in its tracks. The scrolling will stop but the visible text will not change. This is different from stopScroll() in that stopScroll() will clear the display back to its starting state.

This method is best used when connected to an event.


Parameters:

none   0   — 

[ Top ]

setBounce   [line 600]

boolean setBounce( boolean $bounce)

Set whether or not the text should change directions when it hits an edge

If bounce is true, the text will scroll to the left until the first character hits the left edge of the visible window then it will scroll to the right. When the last character hits the right edge of the visible window the text will scroll back to the left.

Note: I don't know what will happen if bounce is true and the text is larger than what can be viewed at one time in the window. Therefore it is suggested that the length of the text always be at least one less than the size of the window.

  • Return: The current state of $this->bounce
  • Access: public

Parameters:

boolean   $bounce   —  true means change directions.

[ Top ]

setDirection   [line 568]

integer setDirection( integer $direction)

Set the diretion that the text should scroll.

Set the direction that the text will move across the visible area of the label. The only accepted directions are the two constants GTK_SCROLLINGLABEL_LEFT and GTK_SCROLLINGLABEL_RIGHT which move the from right to left and left to right respectively. The return value is the diretion the text will move on the next call to _scrollLabel().

  • Access: public

Parameters:

integer   $direction   —  (GTK_SCROLLINGLABEL_LEFT|GTK_SCROLLINGLABEL_RIGHT)

[ Top ]

setFullText   [line 759]

string setFullText( string $text)

Set the full text of the label.

setFullText() will change the text of the scrolling label. The return value is what the text of the label will be when _scrollLabel is next called.

  • Return: The label's text.
  • Access: public

Parameters:

string   $text   —  The new text for the label.

[ Top ]

setPauseSignal   [line 447]

integer setPauseSignal( string $signal)

Connect the pause method to an event.

setPauseSignal() will make the event box listen for the signal $signal and will envoke pause() when ever it is heard. The signal should be a signal that GTKEventBox listens for normally or a button press event.

  • Access: public
  • Uses: _connectSignal

Parameters:

string   $signal   —  The GTK signal to connect to the method.

[ Top ]

setSpeed   [line 531]

integer setSpeed( string $speed, [boolean $restart = false])

Set the speed of the scrolling text.

setSpeed() will change how quickly the text scrolls across the visible label area. $speed is the number of milliseconds to wait between calls to _scrollLabel. $speed is passes to gtk::timeout_add(). If $restart is set to true, the speed of the text will be changed immediately. Otherwise the speed will not be changed until _scrollLabel is called again. This effectively means that the speed changes one letter after you set the new speed if $restart is false.

  • Access: public

Parameters:

string   $speed   —  The speed the text should scroll.
boolean   $restart   —  Whether or not the speed should be changed before the next call to _scrollLabel

[ Top ]

setStartSignal   [line 487]

integer setStartSignal( string $signal)

Connect the start method to an event.

setStartSignal() will make the event box listen for the signal $signal and will envoke startScroll() when ever it is heard. The signal should be a signal that GTKEventBox listens for normally or a button press event.

  • Access: public
  • Uses: _connectSignal

Parameters:

string   $signal   —  The GTK signal to connect to the method.

[ Top ]

setStopSignal   [line 507]

integer setStopSignal( string $signal)

Connect the stop method to an event.

setStopSignal() will make the event box listen for the signal $signal and will envoke stopScroll() when ever it is heard. The signal should be a signal that GTKEventBox listens for normally or a button press event.

  • Access: public
  • Uses: _connectSignal

Parameters:

string   $signal   —  The GTK signal to connect to the method.

[ Top ]

setStyle   [line 632]

&object setStyle( &$style, &object $style)

Set the style in which the text will be displayed.

setStyle() lets you define the look of the text that is scrolling as well as the background of the widget.

This method has not been implemented yet.

  • Access: public

Parameters:

&object   $style   —  The GTK_Style object to use.
   &$style   — 

[ Top ]

setUnPauseSignal   [line 466]

integer setUnPauseSignal( string $signal)

Connect the unpause method to an event.

setUnPauseSignal() will make the event box listen for the signal $signal and will envoke unPause() when ever it is heard. The signal should be a signal that GTKEventBox listens for normally or a button press event.

  • Access: public
  • Uses: _connectSignal

Parameters:

string   $signal   —  The GTK signal to connect to the method.

[ Top ]

setVisibleLength   [line 816]

integer setVisibleLength( integer $length)

Change how many characters should be visible at any given time.

setVisibleLength() will set the number of characters that are visible at any given time. While it is ik to set the visible length smaller than the width of the displaying widget, you probably don't want to make it larger then the width of the displaying widget. It will make the padded lenght longer and add additional time before the text begins to appear on screen.

  • Return: The new size of the visible area in characters.
  • Access: public

Parameters:

integer   $length   —  The new size of the visible area in characters.

[ Top ]

show   [line 848]

void show( none 0)

Show the GTK components.
  • Access: public

Parameters:

none   0   — 

[ Top ]

startScroll   [line 247]

boolean startScroll( none 0)

Begin scrolling the text from the start of the string.

Usually connected to an event.

startScroll() will make the text begin scrolling in the direction given by calling setDirection(). If the text is scrolling left to right (GTK_SCROLLINGLABEL_RIGHT), the current character position is set to the end of the text. This means that the last character of the label will be the first character shown. If the text is scrolling right to left (GTK_SCROLLINGLABEL_LEFT), the current character position is set to zero. This means that first character shown will be a blank space.

This method is best used when connected to an event.


Parameters:

none   0   — 

[ Top ]

stopScroll   [line 312]

boolean stopScroll( none 0)

Stop scrolling the text and return the string to the beginning.

Usually connected to an event.

stopScroll will stop the text from scrolling and set the current character position to zero. When the text is started in motion again, it will be shown as it would if it had been started for the first time.

This method is best used when connected to an event.


Parameters:

none   0   — 

[ Top ]

unPause   [line 272]

boolean unPause( none 0)

Begin scrolling the text from the current character position.

Work horse for startScroll. Usually connected to an event.

unPause() does pretty much the same thing as startScroll except that it does not manipulate the current character position. When you unpause the scroll, the text continues from where it left off when it was paused.

This method is best used when conneted to an event.


Parameters:

none   0   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:31:37 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.