previous up next     contents index
Next: wxMediaEdit::SetWordbreakMap Up: wxMediaEdit: wxMediaBuffer Previous: wxMediaEdit::SetTabs

wxMediaEdit::SetWordbreakFunc

void SetWordbreakFunc (wxWordbreakFunc f, void *data)

    Sets the word-breaking function for the buffer. A wordbreak function is defined as:

typedef void (*wxWordbreakFunc) (wxMediaEdit *edit, long *start, long *end, int reason,
void *data)

The value of data passed to SetWordbreakFunc will be passed on to the word-breaking function when it is called. For more information on the reason parameter, see wxMediaEdit::FindWordbreak (section gif).

Since the wordbreak function will be called when line breaks are being determined (in a buffer that has a maximum width), there is a constrained set of wxMediaEdit members that the wordbreak function is allowed to invoke. It cannot invoke a member function that uses information about graphic locations or lines (which are identified in this manual with ``Only valid when the buffer is viewed.''), but it can still invoke member functions that work with snips and item positions.

The standard wordbreaking function uses the buffer's wxMediaWordbreakMap object to determine which characters break a word. See also wxMediaWordbreakMap (section gif) and wxMediaEdit::SetWordbreakMap (section gif).



PLT