fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
  SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation)  

Selection & Clipboard functions

Functions

static void Fl::copy (const char *stuff, int len, int destination=0)
static void Fl::paste (Fl_Widget &receiver, int source)
static int Fl::dnd ()
static Fl_WidgetFl::selection_owner ()
static void Fl::selection_owner (Fl_Widget *)
static void Fl::selection (Fl_Widget &owner, const char *, int len)
static void Fl::paste (Fl_Widget &receiver)

Detailed Description

FLTK global copy/cut/paste functions declared in <FL/Fl.H>


Function Documentation

void Fl::copy ( const char *  stuff,
int  len,
int  clipboard = 0 
) [static, inherited]

Copies the data pointed to by stuff to the selection buffer (destination is 0) or the clipboard (destination is 1); len is the number of relevant bytes in stuff. The selection buffer is used for middle-mouse pastes and for drag-and-drop selections. The clipboard is used for traditional copy/cut/paste operations.

create a selection owner: widget that created the selection stuff: pointer to selected data size of selected data

Definition at line 2607 of file Fl_mac.cxx.

References NULL.

Referenced by Fl_Text_Display::handle(), Fl_Text_Editor::kf_copy(), Fl_Text_Editor::kf_ctrl_move(), Fl_Text_Editor::kf_meta_move(), Fl_Text_Editor::kf_move(), Fl_Text_Editor::kf_select_all(), Fl_Text_Editor::kf_shift_move(), Fl_Text_Editor::kf_undo(), and Fl::selection().

int Fl::dnd ( ) [static, inherited]

Initiate a Drag And Drop operation. The selection buffer should be filled with relevant data before calling this method. FLTK will then initiate the system wide drag and drop handling. Dropped data will be marked as text.

Create a selection first using: Fl::copy(const char *stuff, int len, 0)

Definition at line 526 of file fl_dnd_win32.cxx.

References FLDropSource::AddRef(), FLDataObject::AddRef(), Fl::e_number, FL_RELEASE, Fl_Widget::handle(), Fl::pushed(), FLDropSource::Release(), FLDataObject::Release(), and Fl::w().

Referenced by Fl_Text_Display::handle(), and Fl_Input::handle().

void Fl::paste ( Fl_Widget receiver,
int  source 
) [static, inherited]

Pastes the data from the selection buffer (source is 0) or the clipboard (source is 1) into receiver. Set things up so the receiver widget will be called with an FL_PASTE event some time in the future with the data from the specified source in Fl::event_text() and the number of characters in Fl::event_length(). The receiver should be prepared to be called directly by this, or for it to happen later, or possibly not at all. This allows the window system to take as long as necessary to retrieve the paste buffer (or even to screw up completely) without complex and error-prone synchronization code in FLTK.

The selection buffer is used for middle-mouse pastes and for drag-and-drop selections. The clipboard is used for traditional copy/cut/paste operations.

Definition at line 2646 of file Fl_mac.cxx.

References Fl::e_length, Fl::e_text, FL_PASTE, Fl_Widget::handle(), handledFlavorsCount, i, and NULL.

Referenced by Fl_Text_Editor::handle(), Fl_Input::handle(), Fl_Text_Editor::kf_paste(), and Fl::paste().

void Fl::paste ( Fl_Widget receiver) [static, inherited]

Backward compatibility only:

See also:
Fl::paste(Fl_Widget &receiver, int clipboard)

Definition at line 1400 of file Fl.cxx.

References Fl::paste().

void Fl::selection ( Fl_Widget owner,
const char *  text,
int  len 
) [static, inherited]

Changes the current selection. The block of text is copied to an internal buffer by FLTK (be careful if doing this in response to an FL_PASTE as this may be the same buffer returned by event_text()). The selection_owner() widget is set to the passed owner.

Definition at line 1392 of file Fl.cxx.

References Fl::copy(), and Fl::selection_owner_.

void Fl::selection_owner ( Fl_Widget owner) [static, inherited]

Back-compatibility only: The single-argument call can be used to move the selection to another widget or to set the owner to NULL, without changing the actual text of the selection. FL_SELECTIONCLEAR is sent to the previous selection owner, if any.

Copying the buffer every time the selection is changed is obviously wasteful, especially for large selections. An interface will probably be added in a future version to allow the selection to be made by a callback function. The current interface will be emulated on top of this.

Definition at line 1383 of file Fl.cxx.

References Fl::selection_owner_.

static Fl_Widget* Fl::selection_owner ( ) [inline, static, inherited]

back-compatibility only: Gets the widget owning the current selection

See also:
Fl_Widget* selection_owner(Fl_Widget*)

Definition at line 747 of file Fl.H.