libcdos-fw
CFComboBox类 参考
+ 类 CFComboBox 继承关系图:

Public 成员函数

 CFComboBox (bool has_entry=false)
 Creates a new empty ComboBox, optionally with an entry. 更多...
 
Glib::ustring getActiveId ()
 Returns the ID of the active row of combo_box. 更多...
 
void getActiveId (const Glib::ustring &active_id)
 Changes the active row of combo_box to the one that has an ID equal to active_id, or unsets the active row if active_id is nullptr. 更多...
 
int getActiveRowNumber ()
 Returns the index of the currently active item, or -1 if there’s no active item. 更多...
 
bool getAddTearoffs ()
 Gets the current title of the menu in tearoff mode. 更多...
 
CFSensitivityType getButtonSensitivity ()
 Returns whether the combo box sets the dropdown button sensitive or not when there are no items in the model. 更多...
 
int getColumnSpanColumn ()
 Returns the column with column span information for combo_box. 更多...
 
CFEntrygetEntry ()
 
int getEntryTextColumn ()
 Returns the column which combo_box is using to get the strings from to display in the internal entry. 更多...
 
bool getFocusOnClick ()
 Returns whether the combo box grabs focus when it is clicked with the mouse. 更多...
 
bool getHasEntry ()
 Returns whether the combo box has an entry. 更多...
 
int getIdColumn ()
 Returns the column which combo_box is using to get string IDs for values from. 更多...
 
bool getPopupFixedWidth ()
 Gets whether the popup uses a fixed width matching the allocated width of the combo box. 更多...
 
int getRowSpanColumn ()
 Returns the column with row span information for combo_box. 更多...
 
Glib::ustring getTitle ()
 Gets the current title of the menu in tearoff mode. 更多...
 
int getWrapWidth ()
 Returns the wrap width which is used to determine the number of columns for the popup menu. 更多...
 
void popdown ()
 Hides the menu or dropdown list of combo_box. 更多...
 
void popup ()
 Pops up the menu or dropdown list of combo_box. 更多...
 
void popup (const Glib::RefPtr< Gdk::Device > &device)
 Pops up the menu or dropdown list of combo_box, the popup window will be grabbed so only device and its associated pointer/keyboard are the only Gdk::Devices able to send events to it. 更多...
 
void setActive (int index)
 Sets the active item of combo_box to be the item at index. 更多...
 
bool setActiveId (const Glib::ustring &active_id)
 Changes the active row of the combo box to the one that has an ID equal to active_id. 更多...
 
void setAddTearoffs (bool add_tearoffs=true)
 Sets whether the popup menu should have a tearoff menu item. 更多...
 
void setButtonSensitivity (CFSensitivityType sensitivity)
 Sets whether the dropdown button of the combo box should be always sensitive (CFSENSITIVITY_ON), never sensitive (CFSENSITIVITY_OFF) or only if there is at least one item to display (CFSENSITIVITY_AUTO). 更多...
 
void setColumnSpanColumn (int column_span)
 Sets the column with column span information for combo_box to be column_span. 更多...
 
void setEntryTextColumn (int text_column)
 Sets the model column which combo_box should use to get strings from to be text_column. 更多...
 
void setFocusOnClick (bool focus_on_click=true)
 Sets whether the combo box will grab focus when it is clicked with the mouse. 更多...
 
void setIdColumn (int id_column)
 Sets the model column which combo_box should use to get string IDs for values from. 更多...
 
void setPopupFixedWidth (bool fixed=true)
 Specifies whether the popup’s width should be a fixed width matching the allocated width of the combo box. 更多...
 
void setRowSpanColumn (int row_span)
 Sets the column with row span information for combo_box to be row_span. 更多...
 
void setTitle (const Glib::ustring &title)
 Sets the menu’s title in tearoff mode. 更多...
 
void setWrapWidth (int width)
 Sets the wrap width of combo_box to be width. 更多...
 
void unsetActive ()
 Causes no item to be active. 更多...
 
void unsetRowSeparatorFunc ()
 Causes no separators to be drawn.
 
- Public 成员函数 继承自 CFContainer
virtual void add (CFWidget &widget)
 
virtual void addCssStyleData (const Glib::ustring &data, CFUInt priority)
 
virtual void addCssStylePath (const Glib::ustring &path, CFUInt priority)
 
void forall (ForeachSlot slot)
 
void foreach (ForeachSlot slot)
 
bool isContainer ()
 判断控件是否为容器。 更多...
 
virtual void remove (CFWidget &widget)
 
- Public 成员函数 继承自 CFWidget
void addEvents (Gdk::EventMask events)
 将 events 位字段添加到控件的事件监听掩码中。 更多...
 
int getAllocatedHeight ()
 返回当前给控件分配的高度。 更多...
 
int getAllocatedWidth ()
 返回当前给控件分配的宽度。 更多...
 
bool getCanFocus ()
 获取控件是否可以拥有输入焦点。 更多...
 
CFAlign getHalign ()
 获取横向对齐方式。 更多...
 
bool getHasTooltip ()
 获取是否使用提示信息。 更多...
 
int getMarginBottom ()
 获取控件的下边距 更多...
 
int getMarginLeft ()
 获取控件的左边距 更多...
 
int getMarginRight ()
 获取控件的右边距 更多...
 
int getMarginTop ()
 获取控件的上边距 更多...
 
bool getSensitive ()
 获取控件可用状态 更多...
 
Glib::ustring getTooltipMarkup ()
 获取当前控件提示信息的内容。 更多...
 
Glib::ustring getTooltipText ()
 获取当前控件提示信息的内容。 更多...
 
CFAlign getValign ()
 获取纵向对齐方式。 更多...
 
bool getVisible ()
 判断本控件是否为可见状态。 更多...
 
void grabFocus ()
 控件获取键盘输入焦点。 更多...
 
bool hasFocus ()
 判断控件是否拥有全局输入焦点。 更多...
 
void hide ()
 隐藏控件 更多...
 
bool isFocus ()
 判断控件是否当前拥有焦点的控件。 更多...
 
bool isSensitive ()
 获取控件及其所在容器控件的可用状态 更多...
 
bool isVisible ()
 判断本控件以及控件所在容器(直到顶层容器)是否为可见状态。 更多...
 
void queueDraw ()
 请求重新描画控件 更多...
 
void queueDrawArea (int x, int y, int width, int height)
 请求重新描画的指定区域 更多...
 
void reparent (CFWidget &new_parent)
 将控件从当前的容器中移动到 newParent 指定的容器中。 更多...
 
void setCanFocus (bool can_focus=true)
 指定控件是否可以获取输入焦点。 更多...
 
void setEvents (Gdk::EventMask events)
 设置控件的事件监听掩码。 更多...
 
void setHalign (CFAlign align)
 设置控件横向对齐方式。 更多...
 
void setHasTooltip (bool has_tooltip=true)
 设置是否使用提示信息。 更多...
 
void setMarginBottom (int margin)
 设置控件的下边距 更多...
 
void setMarginLeft (int margin)
 设置控件的左边距 更多...
 
void setMarginRight (int margin)
 设置控件的右边距 更多...
 
void setMarginTop (int margin)
 设置控件的上边距 更多...
 
void setName (const Glib::ustring &name)
 设置控件的名称,以便于使用CSS文件来控制样式。 更多...
 
void setSensitive (bool sensitive=true)
 设置控件是否可用。 更多...
 
void setSizeRequest (int width=-1, int height=-1)
 设置控件的最小尺寸。 更多...
 
void setTooltipMarkup (const Glib::ustring &markup)
 设置提示信息的内容。 更多...
 
void setTooltipText (const Glib::ustring &text)
 设置提示信息的内容。 更多...
 
void setValign (CFAlign align)
 设置控件纵向对齐方式。 更多...
 
void setVisible (bool visible=true)
 设置控件的可见状态。 更多...
 
void show ()
 显示控件。 更多...
 
void showAll ()
 显示控件以及控件所容纳的所有控件(包括所容纳容器控件的所有子控件) 更多...
 
virtual ~CFWidget ()
 析构函数 更多...
 
virtual void addCssStyleName (const Glib::ustring &name)
 
virtual void addCssStyleFromPath (const Glib::ustring &css_file_path, const Glib::ustring &name, CFUInt priority)
 通过自定义css样式文件路径设置样式 更多...
 
virtual void listCssStyle ()
 查看样式列表 更多...
 
virtual std::vector< Glib::ustring > getCssStyleVector ()
 获取控件样式列表 更多...
 
virtual void removeCssStyle (const Glib::ustring &name)
 通过样式名移除样式 更多...
 
Glib::RefPtr< Gdk::Window > getWindow ()
 
sigc::signal< bool, const ::Cairo::RefPtr< ::Cairo::Context > &> signalDraw ()
 
sigc::signal< bool, GdkEvent *> signalEvent ()
 
sigc::signal< bool, GdkEventButton *> signalButtonPressEvent ()
 
sigc::signal< bool, GdkEventButton *> signalButtonReleaseEvent ()
 
sigc::signal< bool, GdkEventAny *> signalDeleteEvent ()
 
sigc::signal< bool, GdkEventKey *> signalKeyPressEvent ()
 
sigc::signal< bool, GdkEventKey *> signalKeyReleaseEvent ()
 
sigc::signal< void > signalShow ()
 
- Public 成员函数 继承自 CFObject
void * getObj ()
 获取支持库类实例所绑定的对象实例。 更多...
 
virtual ~CFObject ()
 析构函数。 更多...
 

额外继承的成员函数

- Public 类型 继承自 CFContainer
typedef sigc::slot< void, CFWidget * > ForeachSlot
 
- 静态 Public 成员函数 继承自 CFObject
static CFObjectgetCFObject (void *realObj)
 通过对象实例获取所对应的 CFObject的子类对象实例。 更多...
 
- Protected 成员函数 继承自 CFBin
 CFBin ()
 构造函数. 更多...
 
- Protected 成员函数 继承自 CFContainer
void onApplyCssData (CFWidget *widget)
 
void onApplyCssPath (CFWidget *widget)
 
- Protected 成员函数 继承自 CFWidget
virtual void onRealObjectInit ()
 对象绑定后进行初始化的回调函数。 更多...
 
virtual void onRealObjectFinalize ()
 对象解除绑定前的回调函数。 更多...
 
virtual bool onDraw (const ::Cairo::RefPtr< ::Cairo::Context > &cr)
 
virtual bool onEvent (GdkEvent *event)
 
virtual bool onButtonPressEvent (GdkEventButton *event)
 
virtual bool onButtonReleaseEvent (GdkEventButton *event)
 
virtual bool onDeleteEvent (GdkEventAny *event)
 
virtual bool onKeyPressEvent (GdkEventKey *event)
 
virtual bool onKeyReleaseEvent (GdkEventKey *event)
 
virtual void onShow ()
 
 CFWidget ()
 
- Protected 成员函数 继承自 CFObject
 CFObject ()
 构造函数 更多...
 
void setRealObject (void *obj)
 将自身实例与需要使用的对象实例进行绑定。 更多...
 

构造及析构函数说明

§ CFComboBox()

CFComboBox::CFComboBox ( bool  has_entry = false)
explicit

Creates a new empty ComboBox, optionally with an entry.

参数
has_entryIf this is true then this will have an Entry widget.

成员函数说明

§ getActiveId() [1/2]

Glib::ustring CFComboBox::getActiveId ( )

Returns the ID of the active row of combo_box.

This value is taken from the active row and the column specified by the CFComboBox::property_id_column() property of combo_box (see set_id_column()).

The returned value is an interned string which means that you can compare the pointer by value to other interned strings and that you must not free it.

If the Cdos::CFComboBox::property_id_column() property of combo_box is not set, or if no row is active, or if the active row has a nullptr ID value, then nullptr is returned.

返回
The ID of the active row, or nullptr.

§ getActiveId() [2/2]

void CFComboBox::getActiveId ( const Glib::ustring &  active_id)

Changes the active row of combo_box to the one that has an ID equal to active_id, or unsets the active row if active_id is nullptr.

Rows having a nullptr ID string cannot be made active by this function.

If the Cdos::CFComboBox::property_id_column() property of combo_box is unset or if no row has the given ID then the function does nothing and returns false.

弃用:
使用 set_active_id(). 该方法命名不规范, id实际上的类型是字符串, 而不是数值
参数
active_idThe ID of the row to select, or nullptr.
返回
true if a row with a matching ID was found. If a nullptr active_id was given to unset the active row, the function always returns true.

§ getActiveRowNumber()

int CFComboBox::getActiveRowNumber ( )

Returns the index of the currently active item, or -1 if there’s no active item.

If the model is a non-flat treemodel, and the active item is not an immediate child of the root of the tree, where path is the CFTreePath of the active item.

返回
An integer which is the index of the currently active item, or -1 if there’s no active item.

§ getAddTearoffs()

bool CFComboBox::getAddTearoffs ( )

Gets the current title of the menu in tearoff mode.

See setAddTearoffs().

弃用:
没有替代的函数.
返回
The menu’s title in tearoff mode. This is an internal copy of the string which must not be freed.

§ getButtonSensitivity()

CFSensitivityType CFComboBox::getButtonSensitivity ( )

Returns whether the combo box sets the dropdown button sensitive or not when there are no items in the model.

返回
CFSENSITIVITY_ON if the dropdown button is sensitive when the model is empty, CFSENSITIVITY_OFF if the button is always insensitive or CFSENSITIVITY_AUTO if it is only sensitive as long as the model has one item to be selected.

§ getColumnSpanColumn()

int CFComboBox::getColumnSpanColumn ( )

Returns the column with column span information for combo_box.

返回
The column span column.

§ getEntry()

CFEntry* CFComboBox::getEntry ( )
参见
CFBin::get_child().

§ getEntryTextColumn()

int CFComboBox::getEntryTextColumn ( )

Returns the column which combo_box is using to get the strings from to display in the internal entry.

返回
A column in the data source model of combo_box.

§ getFocusOnClick()

bool CFComboBox::getFocusOnClick ( )

Returns whether the combo box grabs focus when it is clicked with the mouse.

参见
setFocusOnClick().
弃用:
使用 CFWidget::getFocusOnClick() 代替
返回
true if the combo box grabs focus when it is clicked with the mouse.

§ getHasEntry()

bool CFComboBox::getHasEntry ( )

Returns whether the combo box has an entry.

返回
Whether there is an entry in combo_box.

§ getIdColumn()

int CFComboBox::getIdColumn ( )

Returns the column which combo_box is using to get string IDs for values from.

返回
A column in the data source model of combo_box.

§ getPopupFixedWidth()

bool CFComboBox::getPopupFixedWidth ( )

Gets whether the popup uses a fixed width matching the allocated width of the combo box.

返回
true if the popup uses a fixed width.

§ getRowSpanColumn()

int CFComboBox::getRowSpanColumn ( )

Returns the column with row span information for combo_box.

返回
The row span column.

§ getTitle()

Glib::ustring CFComboBox::getTitle ( )

Gets the current title of the menu in tearoff mode.

参见
setAddTearoffs().
弃用:
没有替代的函数.
返回
The menu’s title in tearoff mode. This is an internal copy of the string which must not be freed.

§ getWrapWidth()

int CFComboBox::getWrapWidth ( )

Returns the wrap width which is used to determine the number of columns for the popup menu.

If the wrap width is larger than 1, the combo box is in table mode.

返回
The wrap width.

§ popdown()

void CFComboBox::popdown ( )

Hides the menu or dropdown list of combo_box.

This function is mostly intended for use by accessibility technologies; applications should have little use for it.

§ popup() [1/2]

void CFComboBox::popup ( )

Pops up the menu or dropdown list of combo_box.

This function is mostly intended for use by accessibility technologies; applications should have little use for it.

§ popup() [2/2]

void CFComboBox::popup ( const Glib::RefPtr< Gdk::Device > &  device)

Pops up the menu or dropdown list of combo_box, the popup window will be grabbed so only device and its associated pointer/keyboard are the only Gdk::Devices able to send events to it.

参数
deviceA Gdk::Device.

§ setActive()

void CFComboBox::setActive ( int  index)

Sets the active item of combo_box to be the item at index.

参数
indexAn index in the model passed during construction, or -1 to have no active item.

§ setActiveId()

bool CFComboBox::setActiveId ( const Glib::ustring &  active_id)

Changes the active row of the combo box to the one that has an ID equal to active_id.

If property_id_column() is unset or if no row has the given ID then the function does nothing and returns false.

参数
active_idThe ID of the row that should be set to active.
返回
true if a row with a matching ID was found.

§ setAddTearoffs()

void CFComboBox::setAddTearoffs ( bool  add_tearoffs = true)

Sets whether the popup menu should have a tearoff menu item.

弃用:
没有替代的函数.
参数
add_tearoffstrue to add tearoff menu items.

§ setButtonSensitivity()

void CFComboBox::setButtonSensitivity ( CFSensitivityType  sensitivity)

Sets whether the dropdown button of the combo box should be always sensitive (CFSENSITIVITY_ON), never sensitive (CFSENSITIVITY_OFF) or only if there is at least one item to display (CFSENSITIVITY_AUTO).

参数
sensitivitySpecify the sensitivity of the dropdown button.

§ setColumnSpanColumn()

void CFComboBox::setColumnSpanColumn ( int  column_span)

Sets the column with column span information for combo_box to be column_span.

The column span column contains integers which indicate how many columns an item should span.

参数
column_spanA column in the model passed during construction.

§ setEntryTextColumn()

void CFComboBox::setEntryTextColumn ( int  text_column)

Sets the model column which combo_box should use to get strings from to be text_column.

The column text_column in the model of combo_box must be of type TYPE_STRING.

This is only relevant if combo_box has been created with CFComboBox::property_has_entry() as true.

参数
text_columnA column in model to get the strings from for the internal entry.

§ setFocusOnClick()

void CFComboBox::setFocusOnClick ( bool  focus_on_click = true)

Sets whether the combo box will grab focus when it is clicked with the mouse.

Making mouse clicks not grab focus is useful in places like toolbars where you don’t want the keyboard focus removed from the main area of the application.

弃用:
使用 CFWidget::setFocusOnClick() 代替
参数
focus_on_clickWhether the combo box grabs focus when clicked with the mouse.

§ setIdColumn()

void CFComboBox::setIdColumn ( int  id_column)

Sets the model column which combo_box should use to get string IDs for values from.

The column id_column in the model of combo_box must be of type TYPE_STRING.

参数
id_columnA column in model to get string IDs for values from.

§ setPopupFixedWidth()

void CFComboBox::setPopupFixedWidth ( bool  fixed = true)

Specifies whether the popup’s width should be a fixed width matching the allocated width of the combo box.

参数
fixedWhether to use a fixed popup width.

§ setRowSpanColumn()

void CFComboBox::setRowSpanColumn ( int  row_span)

Sets the column with row span information for combo_box to be row_span.

The row span column contains integers which indicate how many rows an item should span.

参数
row_spanA column in the model passed during construction.

§ setTitle()

void CFComboBox::setTitle ( const Glib::ustring &  title)

Sets the menu’s title in tearoff mode.

弃用:
没有替代的函数.
参数
titleA title for the menu in tearoff mode.

§ setWrapWidth()

void CFComboBox::setWrapWidth ( int  width)

Sets the wrap width of combo_box to be width.

The wrap width is basically the preferred number of columns when you want the popup to be layed out in a table.

参数
widthPreferred number of columns.

§ unsetActive()

void CFComboBox::unsetActive ( )

Causes no item to be active.

参见
setActive().

该类的文档由以下文件生成: