檢視原始碼 wxListItem (wx v2.4.3)

此類別儲存關於 wxListCtrl 項目或欄位的資訊。

wxListItem 是一個類別,其中包含關於以下資訊:

  • 從零開始的項目位置;請參閱 setId/2getId/1

  • 從零開始的欄位索引;請參閱 setColumn/2getColumn/1

  • 標籤(或欄位的標頭);請參閱 setText/2getText/1

  • 在影像清單中從零開始的索引;請參閱 getImage/1setImage/2

  • 應用程式定義的資料;請參閱 SetData()(未在 wx 中實作)和 GetData()(未在 wx 中實作)。

  • 僅適用於欄位:欄位的寬度;請參閱 setWidth/2getWidth/1

  • 僅適用於欄位:欄位的格式;以下其中之一:wxLIST_FORMAT_LEFTwxLIST_FORMAT_RIGHTwxLIST_FORMAT_CENTRE。請參閱 setAlign/2getAlign/1

  • 項目的狀態;請參閱 setState/2getState/1。這是以下旗標的位元清單:

  • wxLIST_STATE_FOCUSED: 項目具有焦點。

  • wxLIST_STATE_SELECTED: 項目已選取。

  • wxLIST_STATE_DONTCARE: 沒有特殊旗標(此常數的值為 0)。

  • wxLIST_STATE_DROPHILITED: 項目已反白顯示以接收拖放事件。僅限 Win32。

  • wxLIST_STATE_CUT: 項目處於剪下狀態。僅限 Win32。

  • 一個遮罩,指示哪些狀態旗標有效;這是上面針對項目狀態回報的旗標的位元清單。請參閱 setStateMask/2 和 GetStateMask()。

  • 一個遮罩,指示此類別的哪些欄位有效;請參閱 setMask/2getMask/1。這是以下旗標的位元清單:

  • wxLIST_MASK_STATE: 狀態欄位有效。

  • wxLIST_MASK_TEXT: 標籤欄位有效。

  • wxLIST_MASK_IMAGE: 影像欄位有效。

  • wxLIST_MASK_DATA: 應用程式定義的資料欄位有效。

  • wxLIST_MASK_WIDTH: 欄位寬度有效。

  • wxLIST_MASK_FORMAT: 欄位格式有效。

wxListItem 物件也可以包含特定於項目的顏色和字型資訊:為此,您需要在其上呼叫 setTextColour/2setBackgroundColour/2setFont/2 函數,並傳遞要使用的顏色/字型。如果未指定顏色/字型,則會使用預設的清單控制項顏色/字型。

請參閱:wxListCtrl

wxWidgets 文件:wxListItem

摘要

函數

將項目狀態重設為預設值。

銷毀物件

傳回此項目的對齊方式。

傳回此項目的背景顏色。

傳回從零開始的欄位;僅在報表模式中有意義。

傳回用於顯示項目的字型。

傳回從零開始的項目位置。

傳回與項目關聯的影像在影像清單中從零開始的索引。

傳回一個位元遮罩,指示結構的哪些欄位有效。

傳回代表項目狀態的位元欄位。

傳回標籤/標頭文字。

傳回文字顏色。

僅對報表模式中的欄位標頭有意義。

建構函式。

設定項目的對齊方式。

設定項目的背景顏色。

設定從零開始的欄位。

設定項目的字型。

設定從零開始的項目位置。

設定與項目關聯的影像在影像清單中從零開始的索引。

設定有效欄位的遮罩。

設定項目狀態旗標(請注意,有效狀態旗標受狀態遮罩的值影響,請參閱 setStateMask/2)。

設定用於判斷要設定哪些狀態旗標的位元遮罩。

設定項目的文字標籤。

設定項目的文字顏色。

僅對報表模式中的欄位標頭有意義。

類型

-type wxListItem() :: wx:wx_object().

函數

-spec clear(This) -> ok when This :: wxListItem().

將項目狀態重設為預設值。

-spec destroy(This :: wxListItem()) -> ok.

銷毀物件

-spec getAlign(This) -> wx:wx_enum() when This :: wxListItem().

傳回此項目的對齊方式。

可以是 wxLIST_FORMAT_LEFTwxLIST_FORMAT_RIGHTwxLIST_FORMAT_CENTRE 其中之一。

連結到此函數

getBackgroundColour(This)

檢視原始碼
-spec getBackgroundColour(This) -> wx:wx_colour4() when This :: wxListItem().

傳回此項目的背景顏色。

-spec getColumn(This) -> integer() when This :: wxListItem().

傳回從零開始的欄位;僅在報表模式中有意義。

-spec getFont(This) -> wxFont:wxFont() when This :: wxListItem().

傳回用於顯示項目的字型。

-spec getId(This) -> integer() when This :: wxListItem().

傳回從零開始的項目位置。

-spec getImage(This) -> integer() when This :: wxListItem().

傳回與項目關聯的影像在影像清單中從零開始的索引。

-spec getMask(This) -> integer() when This :: wxListItem().

傳回一個位元遮罩,指示結構的哪些欄位有效。

可以是以下值的任意組合:

  • wxLIST_MASK_STATE:GetState 有效。

  • wxLIST_MASK_TEXT:GetText 有效。

  • wxLIST_MASK_IMAGE:GetImage 有效。

  • wxLIST_MASK_DATA:GetData 有效。

  • wxLIST_MASK_WIDTH:GetWidth 有效。

  • wxLIST_MASK_FORMAT:GetFormat 有效。

-spec getState(This) -> integer() when This :: wxListItem().

傳回代表項目狀態的位元欄位。

可以是以下各項的任意組合:

  • wxLIST_STATE_DONTCARE:沒有特殊旗標(此常數的值為 0)。

  • wxLIST_STATE_DROPHILITED:項目已反白顯示以接收拖放事件。僅限 Win32。

  • wxLIST_STATE_FOCUSED:項目具有焦點。

  • wxLIST_STATE_SELECTED:項目已選取。

  • wxLIST_STATE_CUT:項目處於剪下狀態。僅限 Win32。

-spec getText(This) -> unicode:charlist() when This :: wxListItem().

傳回標籤/標頭文字。

-spec getTextColour(This) -> wx:wx_colour4() when This :: wxListItem().

傳回文字顏色。

-spec getWidth(This) -> integer() when This :: wxListItem().

僅對報表模式中的欄位標頭有意義。

傳回欄位寬度。

-spec new() -> wxListItem().

建構函式。

-spec new(Item) -> wxListItem() when Item :: wxListItem().
-spec setAlign(This, Align) -> ok when This :: wxListItem(), Align :: wx:wx_enum().

設定項目的對齊方式。

另請參閱 getAlign/1

連結到此函數

setBackgroundColour(This, ColBack)

檢視原始碼
-spec setBackgroundColour(This, ColBack) -> ok when This :: wxListItem(), ColBack :: wx:wx_colour().

設定項目的背景顏色。

-spec setColumn(This, Col) -> ok when This :: wxListItem(), Col :: integer().

設定從零開始的欄位。

僅在報表模式中有意義。

-spec setFont(This, Font) -> ok when This :: wxListItem(), Font :: wxFont:wxFont().

設定項目的字型。

-spec setId(This, Id) -> ok when This :: wxListItem(), Id :: integer().

設定從零開始的項目位置。

-spec setImage(This, Image) -> ok when This :: wxListItem(), Image :: integer().

設定與項目關聯的影像在影像清單中從零開始的索引。

-spec setMask(This, Mask) -> ok when This :: wxListItem(), Mask :: integer().

設定有效欄位的遮罩。

請參閱 getMask/1

-spec setState(This, State) -> ok when This :: wxListItem(), State :: integer().

設定項目狀態旗標(請注意,有效狀態旗標受狀態遮罩的值影響,請參閱 setStateMask/2)。

請參閱 getState/1 以了解有效的旗標值。

連結到此函數

setStateMask(This, StateMask)

檢視原始碼
-spec setStateMask(This, StateMask) -> ok when This :: wxListItem(), StateMask :: integer().

設定用於判斷要設定哪些狀態旗標的位元遮罩。

另請參閱 setState/2

-spec setText(This, Text) -> ok when This :: wxListItem(), Text :: unicode:chardata().

設定項目的文字標籤。

連結到此函數

setTextColour(This, ColText)

檢視原始碼
-spec setTextColour(This, ColText) -> ok when This :: wxListItem(), ColText :: wx:wx_colour().

設定項目的文字顏色。

-spec setWidth(This, Width) -> ok when This :: wxListItem(), Width :: integer().

僅對報表模式中的欄位標頭有意義。

設定欄位寬度。