Struct winsafe::gui::ComboBoxOpts[][src]

pub struct ComboBoxOpts {
    pub position: POINT,
    pub width: u32,
    pub combo_box_style: CBS,
    pub window_style: WS,
    pub window_ex_style: WS_EX,
    pub ctrl_id: u16,
    pub items: Vec<String>,
    pub selected_item: Option<u32>,
}
Expand description

Options to create a ComboBox programmatically with ComboBox::new.

Fields

position: POINT

Control position within parent client area, in pixels, to be created.

Will be adjusted to match current system DPI.

Defaults to 0 x 0.

width: u32

Control width, in pixels, to be created.

Will be adjusted to match current system DPI.

Defaults to 120.

combo_box_style: CBS

Combo box styles to be created.

Defaults to CBS::DROPDOWNLIST.

Suggestions:

  • replace with CBS::DROPDOWN to allow the user to type a text;
  • add CBS::SORT to automatically sort the items.
window_style: WS

Window styles to be created.

Defaults to WS::CHILD | WS::VISIBLE | WS::TABSTOP | WS::GROUP.

window_ex_style: WS_EX

Extended window styles to be created.

Defaults to WS_EX::LEFT.

ctrl_id: u16

The control ID.

Defaults to an auto-generated ID.

items: Vec<String>

Items to be added right away to the control.

Defaults to none.

selected_item: Option<u32>

Index of the item initially selected. The item must exist.

Defaults to None.

Trait Implementations

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.