Skip to main content

EditBoxState

Struct EditBoxState 

Source
pub struct EditBoxState {
Show 24 fields pub created: bool, pub visible: bool, pub text: String, pub cursor_pos: usize, pub selection_anchor: Option<usize>, pub composition_text: String, pub composition_cursor: Option<(usize, usize)>, pub composition_range: Option<(usize, usize)>, pub composition_clear_pending: bool, pub scroll_x_px: i32, pub mouse_selecting: bool, pub action_flag: i32, pub moji_size: i32, pub rect_x: i32, pub rect_y: i32, pub rect_w: i32, pub rect_h: i32, pub design_screen_w: i32, pub design_screen_h: i32, pub window_x: i32, pub window_y: i32, pub window_w: i32, pub window_h: i32, pub window_moji_size: i32, /* private fields */
}

Fields§

§created: bool§visible: bool§text: String§cursor_pos: usize

UTF-8 byte index. It is always normalized to a character boundary.

§selection_anchor: Option<usize>

The fixed end of the selection; cursor_pos is the active end.

§composition_text: String

Current winit IME preedit string. It is not part of GET_TEXT until committed.

§composition_cursor: Option<(usize, usize)>

Selected/caret byte range inside composition_text, as supplied by winit.

§composition_range: Option<(usize, usize)>

Committed-text range replaced by the current composition.

§composition_clear_pending: bool

Winit sends an empty Preedit immediately before Commit. Keep the replacement range alive until the next event tells us commit or cancel.

§scroll_x_px: i32

Horizontal ES_AUTOHSCROLL-equivalent offset in logical pixels.

§mouse_selecting: bool

True while the left pointer owns selection capture for this editbox.

§action_flag: i32§moji_size: i32§rect_x: i32§rect_y: i32§rect_w: i32§rect_h: i32§design_screen_w: i32§design_screen_h: i32§window_x: i32§window_y: i32§window_w: i32§window_h: i32§window_moji_size: i32

Implementations§

Source§

impl EditBoxState

Source

pub fn create_like( &mut self, x: i32, y: i32, w: i32, h: i32, moji_size: i32, design_screen_w: i32, design_screen_h: i32, )

Source

pub fn destroy_like(&mut self)

Source

pub fn set_text_like(&mut self, text: String)

Source

pub fn insert_text_at_cursor(&mut self, text: &str)

Source

pub fn commit_text(&mut self, text: &str)

Source

pub fn set_ime_preedit(&mut self, text: &str, cursor: Option<(usize, usize)>)

Source

pub fn cancel_composition(&mut self)

Source

pub fn clear_composition(&mut self)

Source

pub fn cancel_pending_composition_clear(&mut self)

Source

pub fn is_composing(&self) -> bool

Source

pub fn selection_range(&self) -> Option<(usize, usize)>

Source

pub fn selected_text(&self) -> Option<String>

Source

pub fn select_all(&mut self)

Source

pub fn cut_selection(&mut self) -> Option<String>

Source

pub fn backspace_like(&mut self)

Source

pub fn delete_backward(&mut self, by_word: bool)

Source

pub fn delete_forward(&mut self, by_word: bool)

Source

pub fn move_cursor_left(&mut self, extend: bool, by_word: bool)

Source

pub fn move_cursor_right(&mut self, extend: bool, by_word: bool)

Source

pub fn move_cursor_home(&mut self, extend: bool)

Source

pub fn move_cursor_end(&mut self, extend: bool)

Source

pub fn set_cursor_from_window_x(&mut self, window_x: i32, extend: bool)

Source

pub fn caret_window_x(&self) -> i32

Source

pub fn ensure_caret_visible_for_focus(&mut self)

Source

pub fn undo(&mut self)

Source

pub fn redo(&mut self)

Source

pub fn update_rect(&mut self, screen_w: i32, screen_h: i32)

Source

pub fn frame(&mut self, display_mode_change_proc_cnt: i32)

Source

pub fn clear_input(&mut self)

Source

pub fn is_decided(&self) -> bool

Source

pub fn is_canceled(&self) -> bool

Source

pub fn contains_point(&self, x: i32, y: i32) -> bool

Trait Implementations§

Source§

impl Clone for EditBoxState

Source§

fn clone(&self) -> EditBoxState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for EditBoxState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EditBoxState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more