Project:DUI

Class List Class Hierarchy
Summary: Ctors Methods Mixins

Module dui.TextView

Class TextView

dui.ObjectG.ObjectG
        dui.DUIObject.DUIObject
                dui.Widget.Widget
                        dui.Container.Container
                                dui.TextView.TextView

Implemented interfaces:


public class

TextView



A container that knows how to display a TextBuffer.

Constructor Summary
(GtkWidget* gtkWidget)
          
public ()
          Creates a new TextView
(TextBuffer textBuffer)
          Creates a new TextView with a textBuffer

Methods Summary
GtkTextView* gtkT()
          
static GType getType()
          Gets this class type
: aliasSignalHandler!(TextView , MovementStep , int , bit )
          
alias SignalHandler!(TextView , void* )
          
public void addOnMoveCursor(void delegate(MovementStep, int , bit) dlg)
          
public void addOnPopupMenu(void delegate(void*))
          
void setBuffer(TextBuffer textBuffer)
          Setst eh text buffer for this text view
TextBuffer getBuffer()
          Gets the text buffer of this text view
bit scrollToIter(TextIter iter, gdouble within_margin, bit use_align, gdouble xalign, gdouble yalign)
          Scrolls text_view so that iter is on the screen in the position indicated by xalign and yalign.
void scrollToMark(TextMark mark, gdouble within_margin, bit use_align, gdouble xalign, gdouble yalign)
          Scroll to make mark visible
void scrollMarkOnScreen(TextMark mark)
          Scrolls text_view the minimum distance such that mark is contained within the visible area of the widget.
bit moveMarkOnScreen(TextMark mark)
          Moves a mark within the buffer so that it's located within the currently-visible text area.
bit placeCursorOnScreen()
          Moves the cursor to the currently visible region of the buffer, it it isn't there already.
void getVisibleRect(Rectangle* visible_rect)
          getVisibleRect
void setCursorVisible(bit setting)
          setCursorVisible
bit getCursorVisible()
          getCursorVisible
void getIterLocation(TextIter iter, Rectangle* location)
          getIterLocation
void getIterAtLocation(TextIter iter, gint x, gint y)
          getIterAtLocation
void getLineYRange(TextIter* iter, gint* y, gint* height)
          getLineYRange
void getLineAt(TextIter target_iter, gint y, gint* line_top)
          getLineAt
String getLineTextAt(gint y)
          Get the text line at the pixel y
void bufferToWindowCoords(TextWindowType win, gint buffer_x, gint buffer_y, gint window_x, gint window_y)
          bufferToWindowCoords
void windowToBufferCoords(TextWindowType win, gint window_x, gint window_y, gint* buffer_x, gint* buffer_y)
          windowToBufferCoords
WindowG getWindow(TextWindowType win)
          get window
TextWindowType getWindowType(WindowG windowG)
          get window type
void setBorderWindowSize(TextWindowType type, gint size)
          setBorderWindowSize
gint getBorderWindowSize(TextWindowType type)
          getBorderWindowSize
bit forwardDisplayLine(TextIter iter)
          Moves the given iter forward by one display (wrapped) line.
bit backwardDisplayLine(TextIter iter)
          Moves the given iter backward by one display (wrapped) line.
bit forwardDisplayLineEnd(TextIter iter)
          Moves the given iter forward to the next display line end.
bit backwardDisplayLineStart(TextIter iter)
          Moves the given iter backward to the next display line start.
bit startsDisplayLine(TextIter iter)
          Determines whether iter is at the start of a display line.
bit moveVisually(TextIter iter, gint count)
          moveVisually
void addChildAtAnchor(Widget child, TextChildAnchor anchor)
          /* Adding child widgets adds a widget at the anchor
void addChildInWindow(Widget child, TextWindowType which_window, gint xpos, gint ypos)
          add child in window
void moveChild(Widget child, gint xpos, gint ypos)
          move child
void setWrapMode(WrapMode wrap_mode)
          /* Default style settings (fallbacks if no tag affects the property) Sets the line wrapping for the view.
WrapMode getWrapMode()
          Gets the line wrapping for the view.
void setEditable(bit setting)
          Sets the default editability of this TextView.
bit getEditable()
          Returns the default editability of this TextView.
void setPixelsAboveLines(int pixels_above_lines)
          Sets the default number of blank pixels above paragraphs in text_view.
gint getPixelsAboveLines()
          Gets the default number of pixels to put above paragraphs.
void setPixelsBelowLines(int pixels_below_lines)
          Sets the default number of pixels of blank space to put below paragraphs in text_view.
gint getPixelsBelowLines()
          Gets the number of pixels of blank space to put below paragraphs
void setPixelsInsideWrap(int pixels_inside_wrap)
          Sets the default number of pixels of blank space to leave between display/wrapped lines within a paragraph.
gint getPixelsInsideWrap()
          Gets the default number of pixels of blank space to leave between display/wrapped lines within a paragraph.
void setJustification(Justification justification)
          Sets the default justification of text in text_view.
Justification getJustification()
          Gets the justification of text in text_view.
void setLeftMargin(int left_margin)
          Sets the default left margin for text in text_view.
gint getLeftMargin()
          Gets the default left margin for text in text_view.
void setRightMargin(int right_margin)
          Sets the default right margin for text in the text view.
gint getRightMargin()
          Gets the default right margin for text in the text view.
void setIndent(int indent)
          Sets the default indentation for paragraphs in text_view.
gint getIndent()
          Gets the default indentation for paragraphs in text_view.
void setTabs(TabArray tabs)
          setTabs
TabArray getTabs()
          Get tabs
void appendText(String text)
          Simply appends some text to this view
void appendText(String text, bit ensureVisible)
          Simply appends some text to this view
void insertText(String text)
          Simply appends some on the cursor position


gtkT

GtkTextView* gtkT()

getType

static GType getType()
Gets this class type

Returns:
this class type

aliasSignalHandler!

: aliasSignalHandler!(TextView , MovementStep , int , bit )

SignalHandler!

alias SignalHandler!(TextView , void* )

addOnMoveCursor

public void addOnMoveCursor(void delegate(MovementStep, int , bit) dlg)

addOnPopupMenu

public void addOnPopupMenu(void delegate(void*))



ctor(TextView)(GtkWidget* gtkWidget)



public ctor(TextView)()
Creates a new TextView



ctor(TextView)(TextBuffer textBuffer)
Creates a new TextView with a textBuffer

Parameters:
textBuffer - the text buffer for this text view

setBuffer

void setBuffer(TextBuffer textBuffer)
Setst eh text buffer for this text view

Parameters:
textBuffer - the text buffer

getBuffer

TextBuffer getBuffer()
Gets the text buffer of this text view

Returns:
the text buffer

scrollToIter

bit scrollToIter(TextIter iter, gdouble within_margin, bit use_align, gdouble xalign, gdouble yalign)
Scrolls text_view so that iter is on the screen in the position indicated by xalign and yalign.
An alignment of 0.0 indicates left or top, 1.0 indicates right or bottom, 0.5 means center. If use_align is FALSE, the text scrolls the minimal distance to get the mark onscreen, possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size within_margin. NOTE: This function uses the currently-computed height of the lines in the text buffer. Note that line heights are computed in an idle handler; so this function may not have the desired effect if it's called before the height computations. To avoid oddness, consider using gtk_text_view_scroll_to_mark() which saves a point to be scrolled to after line validation.

Parameters:
iter -
within_margin - margin as a [0.0,0.5) fraction of screen size
use_align - whether to use alignment arguments (if FALSE, just get the mark onscreen)
xalign - horizontal alignment of mark within visible area.
yalign - vertical alignment of mark within visible area

Returns:
true if scrolling occurred

scrollToMark

void scrollToMark(TextMark mark, gdouble within_margin, bit use_align, gdouble xalign, gdouble yalign)
Scroll to make mark visible

Parameters:
mark -
within_margin -
use_align -
xalign -
yalign -

scrollMarkOnScreen

void scrollMarkOnScreen(TextMark mark)
Scrolls text_view the minimum distance such that mark is contained within the visible area of the widget.

Parameters:
mark -

moveMarkOnScreen

bit moveMarkOnScreen(TextMark mark)
Moves a mark within the buffer so that it's located within the currently-visible text area.

Parameters:
mark -

Returns:
true if the mark moved (wasn't already onscreen)

placeCursorOnScreen

bit placeCursorOnScreen()
Moves the cursor to the currently visible region of the buffer, it it isn't there already.

Returns:
true if the cursor had to be moved.

getVisibleRect

void getVisibleRect(Rectangle* visible_rect)
getVisibleRect

Parameters:
visible_rect -

setCursorVisible

void setCursorVisible(bit setting)
setCursorVisible

Parameters:
setting -

getCursorVisible

bit getCursorVisible()
getCursorVisible

Returns:

getIterLocation

void getIterLocation(TextIter iter, Rectangle* location)
getIterLocation

Parameters:
iter -
location -

getIterAtLocation

void getIterAtLocation(TextIter iter, gint x, gint y)
getIterAtLocation

Parameters:
iter -
x -
y -

getLineYRange

void getLineYRange(TextIter* iter, gint* y, gint* height)
getLineYRange

Parameters:
iter -
y -
height -

getLineAt

void getLineAt(TextIter target_iter, gint y, gint* line_top)
getLineAt

Parameters:
target_iter -
y -
line_top -

getLineTextAt

String getLineTextAt(gint y)
Get the text line at the pixel y

bufferToWindowCoords

void bufferToWindowCoords(TextWindowType win, gint buffer_x, gint buffer_y, gint window_x, gint window_y)
bufferToWindowCoords

Parameters:
win -
buffer_x -
buffer_y -
window_x -
window_y -

windowToBufferCoords

void windowToBufferCoords(TextWindowType win, gint window_x, gint window_y, gint* buffer_x, gint* buffer_y)
windowToBufferCoords

Parameters:
win -
window_x -
window_y -
buffer_x -
buffer_y -

getWindow

WindowG getWindow(TextWindowType win)
get window

Parameters:
win - the text window type
a - new WindowG wrapping the gtkWindow

getWindowType

TextWindowType getWindowType(WindowG windowG)
get window type

Parameters:
window -

Returns:
the text window type

setBorderWindowSize

void setBorderWindowSize(TextWindowType type, gint size)
setBorderWindowSize

Parameters:
type -
size -

getBorderWindowSize

gint getBorderWindowSize(TextWindowType type)
getBorderWindowSize

Parameters:
type -

Returns:

forwardDisplayLine

bit forwardDisplayLine(TextIter iter)
Moves the given iter forward by one display (wrapped) line.
A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view's width; paragraphs are the same in all views, since they depend on the contents of the GtkTextBuffer.

Returns:

backwardDisplayLine

bit backwardDisplayLine(TextIter iter)
Moves the given iter backward by one display (wrapped) line.
A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view's width; paragraphs are the same in all views, since they depend on the contents of the GtkTextBuffer.

Returns:

forwardDisplayLineEnd

bit forwardDisplayLineEnd(TextIter iter)
Moves the given iter forward to the next display line end.
A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view's width; paragraphs are the same in all views, since they depend on the contents of the GtkTextBuffer.

Returns:

backwardDisplayLineStart

bit backwardDisplayLineStart(TextIter iter)
Moves the given iter backward to the next display line start.
A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view's width; paragraphs are the same in all views, since they depend on the contents of the GtkTextBuffer.

Returns:

startsDisplayLine

bit startsDisplayLine(TextIter iter)
Determines whether iter is at the start of a display line.
See gtk_text_view_forward_display_line() for an explanation of display lines vs. paragraphs.

Returns:

moveVisually

bit moveVisually(TextIter iter, gint count)
moveVisually

Returns:

addChildAtAnchor

void addChildAtAnchor(Widget child, TextChildAnchor anchor)
/* Adding child widgets adds a widget at the anchor

Parameters:
child - the widget to add
anchor -

addChildInWindow

void addChildInWindow(Widget child, TextWindowType which_window, gint xpos, gint ypos)
add child in window

moveChild

void moveChild(Widget child, gint xpos, gint ypos)
move child

setWrapMode

void setWrapMode(WrapMode wrap_mode)
/* Default style settings (fallbacks if no tag affects the property) Sets the line wrapping for the view.

Parameters:
wrap_mode -

getWrapMode

WrapMode getWrapMode()
Gets the line wrapping for the view.

Returns:
the line wrapping for the view.

setEditable

void setEditable(bit setting)
Sets the default editability of this TextView.
You can override this default setting with tags in the buffer, using the "editable" attribute of tags.

Parameters:
setting -

getEditable

bit getEditable()
Returns the default editability of this TextView.
Tags in the buffer may override this setting for some ranges of text.

Returns:
true if editable

setPixelsAboveLines

void setPixelsAboveLines(int pixels_above_lines)
Sets the default number of blank pixels above paragraphs in text_view.
Tags in the buffer for text_view may override the defaults.

Parameters:
pixels_above_lines -

getPixelsAboveLines

gint getPixelsAboveLines()
Gets the default number of pixels to put above paragraphs.

Returns:
number of blank pixels above paragraphs in text_view.

setPixelsBelowLines

void setPixelsBelowLines(int pixels_below_lines)
Sets the default number of pixels of blank space to put below paragraphs in text_view.
May be overridden by tags applied to text_view's buffer.

Parameters:
pixels_below_lines -

getPixelsBelowLines

gint getPixelsBelowLines()
Gets the number of pixels of blank space to put below paragraphs

Returns:

setPixelsInsideWrap

void setPixelsInsideWrap(int pixels_inside_wrap)
Sets the default number of pixels of blank space to leave between display/wrapped lines within a paragraph.
May be overridden by tags in text_view's buffer.

Parameters:
pixels_inside_wrap -

getPixelsInsideWrap

gint getPixelsInsideWrap()
Gets the default number of pixels of blank space to leave between display/wrapped lines within a paragraph.

Returns:

setJustification

void setJustification(Justification justification)
Sets the default justification of text in text_view.
Tags in the view's buffer may override the default.

Parameters:
justification -

getJustification

Justification getJustification()
Gets the justification of text in text_view.

Returns:

setLeftMargin

void setLeftMargin(int left_margin)
Sets the default left margin for text in text_view.
Tags in the buffer may override the default.

Parameters:
left_margin -

getLeftMargin

gint getLeftMargin()
Gets the default left margin for text in text_view.

Returns:

setRightMargin

void setRightMargin(int right_margin)
Sets the default right margin for text in the text view.
Tags in the buffer may override the default.

Parameters:
right_margin -

getRightMargin

gint getRightMargin()
Gets the default right margin for text in the text view.

Returns:

setIndent

void setIndent(int indent)
Sets the default indentation for paragraphs in text_view.
Tags in the buffer may override the default.

Parameters:
indent -

getIndent

gint getIndent()
Gets the default indentation for paragraphs in text_view.

Returns:

setTabs

void setTabs(TabArray tabs)
setTabs

Parameters:
tabs - the tab stops

getTabs

TabArray getTabs()
Get tabs

Returns:
a new TabArray wrapping the PatnTabArray

appendText

void appendText(String text)
Simply appends some text to this view

Parameters:
text - the text to append

appendText

void appendText(String text, bit ensureVisible)
Simply appends some text to this view

Parameters:
text - the text to append

insertText

void insertText(String text)
Simply appends some on the cursor position

Parameters:
text - the text to append