wxGridCellAttr(3erl)

πŸ’– NAME πŸ’–

wxGridCellAttr β€” the Erlang Module Definition. Manual page vibe: wxGridCellAttr(3erl). It is literally Functions for wxGridCellAttr class, and yes bestie, this is the grid-cell glow-up lore. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this class is your little glow-up wand for grid cells: it can be used to alter the cells’ appearance in the grid by changing their attributes from the defaults. Slay.

Heads up: an object of this class may be returned by wxGridTableBase::GetAttr() β€” and that one is not implemented in wx. Noted, no cap.

⚠️ Important: objects of this class are reference-counted, and it’s recommended to use the wxGridCellAttrPtr smart pointer class when working with them so you don’t leak memory. Protect your peace and your heap, bestie. 🫢

Official docs drop: wxWidgets docs: wxGridCellAttr.


🌈 DATA TYPES 🌈

The whole type situation is giving minimal and iconic:

wxGridCellAttr() = wx:wx_object()

πŸ”₯ EXPORTS πŸ”₯

Here’s the full function roster β€” no skips, no cap. πŸ’–

✨ setTextColour(This, ColText) -> ok

Types:
  This = wxGridCellAttr()
  ColText = wx:wx_colour()

Sets the text colour. Simple, effective, iconic. πŸŽ€

🌸 setBackgroundColour(This, ColBack) -> ok

Types:
  This = wxGridCellAttr()
  ColBack = wx:wx_colour()

Sets the background colour. The cell’s fit is about to change. πŸ’…

πŸ¦‹ setFont(This, Font) -> ok

Types:
  This = wxGridCellAttr()
  Font = wxFont:wxFont()

Sets the font. Font choices are literally main character energy.

πŸŽ€ setAlignment(This, HAlign, VAlign) -> ok

Types:
  This = wxGridCellAttr()
  HAlign = VAlign = integer()

Sets the alignment. hAlign can be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT, and vAlign can be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM. Align your grid, align your vibes. ✨

🌸 setReadOnly(This) -> ok

Types:
  This = wxGridCellAttr()

The source gives no extra description for this one, so here’s the clean signature β€” the no-options version.

πŸ’… setReadOnly(This, Options :: [Option]) -> ok

Types:
  This = wxGridCellAttr()
  Option = {isReadOnly, boolean()}

Sets the cell as read-only.

πŸ¦‹ setRenderer(This, Renderer) -> ok

Types:
  This = wxGridCellAttr()
  Renderer = wxGridCellRenderer:wxGridCellRenderer()

Sets the renderer to be used for cells with this attribute. Takes ownership of the pointer. Do not forget that part, bestie β€” it matters. 😭

πŸ“ setEditor(This, Editor) -> ok

Types:
  This = wxGridCellAttr()
  Editor = wxGridCellEditor:wxGridCellEditor()

Sets the editor to be used with the cells with this attribute.

πŸ” hasTextColour(This) -> boolean()

Types:
  This = wxGridCellAttr()

Returns true if this attribute has a valid text colour set.

🌈 hasBackgroundColour(This) -> boolean()

Types:
  This = wxGridCellAttr()

Returns true if this attribute has a valid background colour set.

⭐ hasFont(This) -> boolean()

Types:
  This = wxGridCellAttr()

Returns true if this attribute has a valid font set.

🧚 hasAlignment(This) -> boolean()

Types:
  This = wxGridCellAttr()

Returns true if this attribute has a valid alignment set.

πŸŽ€ hasRenderer(This) -> boolean()

Types:
  This = wxGridCellAttr()

Returns true if this attribute has a valid cell renderer set.

πŸ’œ hasEditor(This) -> boolean()

Types:
  This = wxGridCellAttr()

Returns true if this attribute has a valid cell editor set.

πŸ‘‘ getTextColour(This) -> wx:wx_colour4()

Types:
  This = wxGridCellAttr()

Returns the text colour.

🌸 getBackgroundColour(This) -> wx:wx_colour4()

Types:
  This = wxGridCellAttr()

Returns the background colour.

πŸ¦‹ getFont(This) -> wxFont:wxFont()

Types:
  This = wxGridCellAttr()

Returns the font.

🧚 getAlignment(This) -> {HAlign :: integer(), VAlign :: integer()}

Types:
  This = wxGridCellAttr()

Get the alignment to use for the cell with the given attribute.

If this attribute doesn’t specify any alignment, the default attribute alignment is used (which can be changed using wxGrid:setDefaultCellAlignment/3 but is left and top by default). That default detail is lowkey important, bestie.

⚠️ Notice: hAlign and vAlign values are always overwritten by this function. Use GetNonDefaultAlignment() (not implemented in wx) if that is not desirable.

πŸŽ€ getRenderer(This, Grid, Row, Col) -> wxGridCellRenderer:wxGridCellRenderer()

Types:
  This = wxGridCellAttr()
  Grid = wxGrid:wxGrid()
  Row = Col = integer()

Returns the cell renderer.

⚠️ Memory check: the caller is responsible for calling DecRef() (not implemented in wx) on the returned pointer. Use GetRendererPtr() (not implemented in wx) to do it automatically. Your future self says thank you. πŸ™ˆ

πŸ“ getEditor(This, Grid, Row, Col) -> wxGridCellEditor:wxGridCellEditor()

Types:
  This = wxGridCellAttr()
  Grid = wxGrid:wxGrid()
  Row = Col = integer()

Returns the cell editor.

⚠️ Memory check: the caller is responsible for calling DecRef() (not implemented in wx) on the returned pointer. Use GetEditorPtr() (not implemented in wx) to do it automatically.

🌈 isReadOnly(This) -> boolean()

Types:
  This = wxGridCellAttr()

Returns true if this cell is set as read-only.

πŸ’œ setDefAttr(This, DefAttr) -> ok

Types:
  This = DefAttr = wxGridCellAttr()

The source gives no extra description here β€” just the signature, and honestly it ate. ✨


Huge credit to the wxWidgets team β€” this page is from wx 2.2.2.1, and the footer tag is wxGridCellAttr(3erl). Periodt. πŸ’…πŸŽ€

πŸ“¦ where this page comes from