Struct iup::control::text::Text [] [src]

pub struct Text(_);

See the IUP Text Documentation.

Methods

impl Text

fn new() -> Text

Creates a editable text-field.

fn new_spin() -> Text

Creates a spin control.

The spin increments and decrements an integer number.

fn convert_lincol_to_pos(&self, lin: i32, col: i32) -> usize

Converts a (lin, col) character positioning into an absolute position.

lin and col starts at 1, pos starts at 0. For single line controls pos is always col-1.

fn convert_pos_to_lincol(&self, pos: usize) -> (i32, i32)

Converts an absolute position into a (lin, col) character positioning.

lin and col starts at 1, pos starts at 0. For single line controls lin is always 1, and col is always pos+1.

Trait Implementations

impl Element for Text

fn raw(&self) -> *mut Ihandle

unsafe fn from_raw_unchecked(ih: *mut Ihandle) -> Self

unsafe fn target_classname() -> &'static str

fn from_handle(handle: Handle) -> Result<Self, Handle>

fn from_name<S: Into<String>>(name: S) -> Option<Handle>

fn from_raw(ih: *mut Ihandle) -> Self

unsafe fn classname(&self) -> &CStr

fn destroy(self)

fn does_attrib_exist(&self, cname: &CString) -> bool

fn attribs(&self) -> Vec<String>

fn set_attrib<S1, S2>(&mut self, name: S1, value: S2) -> Self where S1: Into<String>, S2: Into<String>

fn attrib<S: Into<String>>(&self, name: S) -> Option<String>

fn set_attrib_data<S1>(&mut self, name: S1, data: *const c_void) -> Self where S1: Into<String>

fn attrib_data<S1>(&mut self, name: S1) -> *mut c_void where S1: Into<String>

fn set_attrib_handle<S1, E>(&mut self, name: S1, elem: E) -> Self where S1: Into<String>, E: Element

fn attrib_handle<S1>(&mut self, name: S1) -> Option<Handle> where S1: Into<String>

fn clear_attrib<S: Into<String>>(&mut self, name: S) -> Self

fn reset_attrib<S: Into<String>>(&mut self, name: S) -> Self

fn handle_name(&self) -> Option<String>

fn add_handle_name<S: Into<String>>(&self, name: S) -> Option<Handle>

fn clear_handle_name<S: Into<String>>(name: S) -> Option<Handle>

impl Debug for Text

fn fmt(&self, fmt: &mut Formatter) -> Result

impl Copy for Text

impl Clone for Text

fn clone(&self) -> Text

fn clone_from(&mut self, source: &Self)

impl DestroyCb for Text

fn set_destroy_cb<F>(&mut self, cb: F) -> Self where F: Callback<(Self,)>

fn remove_destroy_cb(&mut self) -> Option<Box<Callback<(Self,)>>>

impl Widget for Text

fn map(&mut self) -> Result<Self, Self>

fn unmap(&mut self)

fn show(&mut self) -> Result<(), String>

fn hide(&mut self) -> Self

impl Node for Text

fn detach(&mut self) -> Self

fn reparent<E1, E2>(&mut self, new_parent: E1, ref_child: E2) -> Result<Self, Self> where E1: Container, E2: Node

fn parent(&self) -> Option<Handle>

fn brother(&self) -> Option<Handle>

fn dialog(&self) -> Option<Handle>

fn dialog_child<S: Into<String>>(&self, name: S) -> Option<Handle>

fn refresh(&mut self)

fn refresh_children(&mut self)

fn update(&self)

fn update_children(&self)

fn redraw(&self, also_redraw_children: bool)

impl ConvertXYToPos for Text

Returns a position in the string.

fn convert_xy_to_pos(&self, x: i32, y: i32) -> Option<i32>

impl MapCb for Text

fn set_map_cb<F>(&mut self, cb: F) -> Self where F: Callback<(Self,)>

fn remove_map_cb(&mut self) -> Option<Box<Callback<(Self,)>>>

impl UnmapCb for Text

fn set_unmap_cb<F>(&mut self, cb: F) -> Self where F: Callback<(Self,)>

fn remove_unmap_cb(&mut self) -> Option<Box<Callback<(Self,)>>>

impl GetFocusCb for Text

fn set_getfocus_cb<F>(&mut self, cb: F) -> Self where F: Callback<(Self,)>

fn remove_getfocus_cb(&mut self) -> Option<Box<Callback<(Self,)>>>

impl KillFocusCb for Text

fn set_killfocus_cb<F>(&mut self, cb: F) -> Self where F: Callback<(Self,)>

fn remove_killfocus_cb(&mut self) -> Option<Box<Callback<(Self,)>>>

impl EnterWindowCb for Text

fn set_enterwindow_cb<F>(&mut self, cb: F) -> Self where F: Callback<(Self,)>

fn remove_enterwindow_cb(&mut self) -> Option<Box<Callback<(Self,)>>>

impl LeaveWindowCb for Text

fn set_leavewindow_cb<F>(&mut self, cb: F) -> Self where F: Callback<(Self,)>

fn remove_leavewindow_cb(&mut self) -> Option<Box<Callback<(Self,)>>>

impl HelpCb for Text

fn set_help_cb<F>(&mut self, cb: F) -> Self where F: Callback<(Self,)>

fn remove_help_cb(&mut self) -> Option<Box<Callback<(Self,)>>>

impl ButtonCb for Text

Action generated when any mouse button is pressed or released.

Use convert_xy_to_pos to convert (x,y) coordinates in character positioning.

fn set_button_cb<F>(&mut self, cb: F) -> Self where F: Callback<(Self, MouseButton, MouseButtonState, i32, i32, KeyStates)>

fn remove_button_cb(&mut self) -> Option<Box<Callback<(Self, MouseButton, MouseButtonState, i32, i32, KeyStates)>>>

impl CaretCb for Text

Action generated when the caret/cursor position is changed.

For single line controls lin (2nd param) is always 1, and pos (3rd param) is always col-1.

fn set_caret_cb<F>(&mut self, cb: F) -> Self where F: Callback<(Self, i32, i32, usize)>

fn remove_caret_cb(&mut self) -> Option<Box<Callback<(Self, i32, i32, usize)>>>

impl DropFilesCb for Text

Action generated when one or more files are dropped in the element.

fn set_dropfiles_cb<F>(&mut self, cb: F) -> Self where F: Callback<(Self, PathBuf, usize, i32, i32)>

fn remove_dropfiles_cb(&mut self) -> Option<Box<Callback<(Self, PathBuf, usize, i32, i32)>>>

impl MotionCb for Text

Action generated when the mouse is moved.

Use convert_xy_to_pos to convert (x,y) coordinates in character positioning.

fn set_motion_cb<F>(&mut self, cb: F) -> Self where F: Callback<(Self, i32, i32, KeyStates)>

fn remove_motion_cb(&mut self) -> Option<Box<Callback<(Self, i32, i32, KeyStates)>>>

impl SpinCb for Text

Action generated when a spin button is pressed.

Valid only when the element is a spin (Text::new_spin or SPIN=YES attribute). When this callback is called the ACTION callback is not called. The VALUE attribute can be changed during this callback only if SPINAUTO=NO.

The i32 parameter received by the callback is the value of the spin (after incremented).

May return CallbackReturn::Ignore but that is only allowed on Windows and Motif.

fn set_spin_cb<F>(&mut self, cb: F) -> Self where F: Callback<(Self, i32)>

fn remove_spin_cb(&mut self) -> Option<Box<Callback<(Self, i32)>>>

impl ValueChangedCb for Text

Called after the value was interactively changed by the user.

fn set_valuechanged_cb<F>(&mut self, cb: F) -> Self where F: Callback<(Self,)>

fn remove_valuechanged_cb(&mut self) -> Option<Box<Callback<(Self,)>>>

impl TextAction for Text

See the TextAction documentation.

fn set_action<F>(&mut self, cb: F) -> Self where F: Callback<(Self, Option<char>, String)>

fn remove_action(&mut self) -> Option<Box<Callback<(Self, Option<char>, String)>>>