檢視原始碼 wxGridCellAttr (wx v2.4.3)
此類別可用於透過變更儲存格的預設屬性來改變網格中儲存格的外觀。
此類別的物件可能由 wxGridTableBase::GetAttr()
傳回(在 wx 中未實作)。
請注意,此類別的物件會進行參考計數,建議在使用它們時使用 wxGridCellAttrPtr 智慧型指標類別,以避免記憶體洩漏。
wxWidgets 文件:wxGridCellAttr
摘要
函數
取得具有指定屬性的儲存格要使用的對齊方式。
傳回背景顏色。
傳回儲存格編輯器。
傳回字型。
傳回儲存格渲染器。
傳回文字顏色。
如果此屬性設定了有效的對齊方式,則傳回 true。
如果此屬性設定了有效的背景顏色,則傳回 true。
如果此屬性設定了有效的儲存格編輯器,則傳回 true。
如果此屬性設定了有效的字型,則傳回 true。
如果此屬性設定了有效的儲存格渲染器,則傳回 true。
如果此屬性設定了有效的文字顏色,則傳回 true。
如果此儲存格設定為唯讀,則傳回 true。
設定要用於具有此屬性的儲存格的編輯器。
設定字型。
將儲存格設定為唯讀。
設定要用於具有此屬性的儲存格的渲染器。
設定文字顏色。
類型
-type wxGridCellAttr() :: wx:wx_object().
函數
-spec getAlignment(This) -> {HAlign :: integer(), VAlign :: integer()} when This :: wxGridCellAttr().
取得具有指定屬性的儲存格要使用的對齊方式。
如果此屬性沒有指定任何對齊方式,則會使用預設的屬性對齊方式(可以使用 wxGrid:setDefaultCellAlignment/3
變更,但預設為靠左和靠上)。
請注意,hAlign
和 vAlign
值總是會被此函數覆寫,如果不需要這樣做,請使用 GetNonDefaultAlignment()
(在 wx 中未實作)。
-spec getBackgroundColour(This) -> wx:wx_colour4() when This :: wxGridCellAttr().
傳回背景顏色。
-spec getEditor(This, Grid, Row, Col) -> wxGridCellEditor:wxGridCellEditor() when This :: wxGridCellAttr(), Grid :: wxGrid:wxGrid(), Row :: integer(), Col :: integer().
傳回儲存格編輯器。
呼叫者有責任在傳回的指標上呼叫 DecRef()
(在 wx 中未實作),使用 GetEditorPtr()
(在 wx 中未實作)來自動執行此操作。
-spec getFont(This) -> wxFont:wxFont() when This :: wxGridCellAttr().
傳回字型。
-spec getRenderer(This, Grid, Row, Col) -> wxGridCellRenderer:wxGridCellRenderer() when This :: wxGridCellAttr(), Grid :: wxGrid:wxGrid(), Row :: integer(), Col :: integer().
傳回儲存格渲染器。
呼叫者有責任在傳回的指標上呼叫 DecRef()
(在 wx 中未實作),使用 GetRendererPtr()
(在 wx 中未實作)來自動執行此操作。
-spec getTextColour(This) -> wx:wx_colour4() when This :: wxGridCellAttr().
傳回文字顏色。
-spec hasAlignment(This) -> boolean() when This :: wxGridCellAttr().
如果此屬性設定了有效的對齊方式,則傳回 true。
-spec hasBackgroundColour(This) -> boolean() when This :: wxGridCellAttr().
如果此屬性設定了有效的背景顏色,則傳回 true。
-spec hasEditor(This) -> boolean() when This :: wxGridCellAttr().
如果此屬性設定了有效的儲存格編輯器,則傳回 true。
-spec hasFont(This) -> boolean() when This :: wxGridCellAttr().
如果此屬性設定了有效的字型,則傳回 true。
-spec hasRenderer(This) -> boolean() when This :: wxGridCellAttr().
如果此屬性設定了有效的儲存格渲染器,則傳回 true。
-spec hasTextColour(This) -> boolean() when This :: wxGridCellAttr().
如果此屬性設定了有效的文字顏色,則傳回 true。
-spec isReadOnly(This) -> boolean() when This :: wxGridCellAttr().
如果此儲存格設定為唯讀,則傳回 true。
-spec setAlignment(This, HAlign, VAlign) -> ok when This :: wxGridCellAttr(), HAlign :: integer(), VAlign :: integer().
設定對齊方式。
hAlign
可以是 wxALIGN_LEFT
、wxALIGN_CENTRE
或 wxALIGN_RIGHT
的其中之一,而 vAlign
可以是 wxALIGN_TOP
、wxALIGN_CENTRE
或 wxALIGN_BOTTOM
的其中之一。
-spec setBackgroundColour(This, ColBack) -> ok when This :: wxGridCellAttr(), ColBack :: wx:wx_colour().
設定背景顏色。
-spec setDefAttr(This, DefAttr) -> ok when This :: wxGridCellAttr(), DefAttr :: wxGridCellAttr().
-spec setEditor(This, Editor) -> ok when This :: wxGridCellAttr(), Editor :: wxGridCellEditor:wxGridCellEditor().
設定要用於具有此屬性的儲存格的編輯器。
-spec setFont(This, Font) -> ok when This :: wxGridCellAttr(), Font :: wxFont:wxFont().
設定字型。
-spec setReadOnly(This) -> ok when This :: wxGridCellAttr().
-spec setReadOnly(This, [Option]) -> ok when This :: wxGridCellAttr(), Option :: {isReadOnly, boolean()}.
將儲存格設定為唯讀。
-spec setRenderer(This, Renderer) -> ok when This :: wxGridCellAttr(), Renderer :: wxGridCellRenderer:wxGridCellRenderer().
設定要用於具有此屬性的儲存格的渲染器。
取得指標的所有權。
-spec setTextColour(This, ColText) -> ok when This :: wxGridCellAttr(), ColText :: wx:wx_colour().
設定文字顏色。