wxGridCellAttr(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸ’– wxGridCellAttr β€” the Erlang module πŸ’–

okay bestie, welcome to wxGridCellAttr(3), an Erlang Module Definition straight out of the wx era. grab a boba, we're customizing grid cells πŸŽ€


✨ NAME ✨

wxGridCellAttr β€” this class is literally your glow-up wand for grid cells: you can alter the cells' appearance in the grid by changing their attributes away from the defaults. main character energy for spreadsheets, fr fr. πŸ‘‘


🌸 DESCRIPTION 🌸

so here's the tea: an object of this class may be returned by wxGridTableBase::GetAttr() β€” and ngl, that one's not implemented in wx. πŸ™ˆ

also, REAL TALK: objects of this class are reference-counted, and it's recommended that you use the wxGridCellAttrPtr smart pointer class when working with them so you don't leak memory. no cap, protect your RAM, she's precious. πŸ’…

wxWidgets docs: wxGridCellAttr


πŸ¦‹ DATA TYPES πŸ¦‹

  • wxGridCellAttr() :: wx:wx_object().

⭐ FUNCTIONS ⭐

πŸ’œ getAlignment(This) -> {HAlign :: integer(), VAlign :: integer()}

when 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 instead β€” and you can change that with wxGrid:setDefaultCellAlignment/3, though by default it's left and top. left and top are the default default, if you will. 🫢

heads up though: hAlign and vAlign values are always overwritten by this function. if that's not the vibe you want, use GetNonDefaultAlignment() instead β€” except plot twist, that one is not implemented in wx. 😭

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

when This :: wxGridCellAttr().

Returns the background colour. simple as that. 🎨


🧚 getEditor(This, Grid, Row, Col) -> wxGridCellEditor:wxGridCellEditor()

when:

  • This :: wxGridCellAttr()
  • Grid :: wxGrid:wxGrid()
  • Row :: integer()
  • Col :: integer()

Returns the cell editor. ✏️

okay so important: the caller is responsible for calling DecRef() on the returned pointer β€” and yep, DecRef() is not implemented in wx. if you want that handled automatically for you, use GetEditorPtr() instead... which is also not implemented in wx. the audacity πŸ’€

πŸŽ€ getFont(This) -> wxFont:wxFont()

when This :: wxGridCellAttr().

Returns the font. πŸ”€


🌟 getRenderer(This, Grid, Row, Col) -> wxGridCellRenderer:wxGridCellRenderer()

when:

  • This :: wxGridCellAttr()
  • Grid :: wxGrid:wxGrid()
  • Row :: integer()
  • Col :: integer()

Returns the cell renderer. πŸ–ŒοΈ

and again bestie: the caller is responsible for calling DecRef() on the returned pointer (that's another not implemented in wx, naturally 😭). use GetRendererPtr() to do it automatically β€” also not implemented in wx. iconic behavior honestly.

πŸ“ getTextColour(This) -> wx:wx_colour4()

when This :: wxGridCellAttr().

Returns the text colour. ✍️


πŸ’– hasAlignment(This) -> boolean()

when This :: wxGridCellAttr().

Returns true if this attribute has a valid alignment set. βœ…


πŸ’– hasBackgroundColour(This) -> boolean()

when This :: wxGridCellAttr().

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


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

when This :: wxGridCellAttr().

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


πŸ’– hasFont(This) -> boolean()

when This :: wxGridCellAttr().

Returns true if this attribute has a valid font set. βœ…


πŸ’– hasRenderer(This) -> boolean()

when This :: wxGridCellAttr().

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


πŸ’– hasTextColour(This) -> boolean()

when This :: wxGridCellAttr().

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


πŸ”₯ isReadOnly(This) -> boolean()

when This :: wxGridCellAttr().

Returns true if this cell is set as read-only. πŸ”’


πŸ¦‹ setAlignment(This, HAlign, VAlign) -> ok

when:

  • This :: wxGridCellAttr()
  • HAlign :: integer()
  • VAlign :: integer()

Sets the alignment. πŸ“

here's the menu, bestie:

  • hAlign can be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT
  • vAlign can be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM

🌸 setBackgroundColour(This, ColBack) -> ok

when:

  • This :: wxGridCellAttr()
  • ColBack :: wx:wx_colour()

Sets the background colour. 🎨


🫢 setDefAttr(This, DefAttr) -> ok

when:

  • This :: wxGridCellAttr()
  • DefAttr :: wxGridCellAttr()

no description on this one in the original, she's mysterious like that. 🀫


✨ setEditor(This, Editor) -> ok

when:

  • This :: wxGridCellAttr()
  • Editor :: wxGridCellEditor:wxGridCellEditor()

Sets the editor to be used with the cells that have this attribute. ✏️


πŸ’… setFont(This, Font) -> ok

when:

  • This :: wxGridCellAttr()
  • Font :: wxFont:wxFont()

Sets the font. πŸ”€


πŸ”’ setReadOnly(This, [Option]) -> ok

when:

  • This :: wxGridCellAttr()
  • Option :: {isReadOnly, boolean()}

Sets the cell as read-only. 🚫✍️


🧚 setRenderer(This, Renderer) -> ok

when:

  • This :: wxGridCellAttr()
  • Renderer :: wxGridCellRenderer:wxGridCellRenderer()

Sets the renderer to be used for cells with this attribute. πŸ–ŒοΈ

and this one matters: it takes ownership of the pointer. so like, she's yours now, act accordingly. πŸ’€

🌈 setTextColour(This, ColText) -> ok

when:

  • This :: wxGridCellAttr()
  • ColText :: wx:wx_colour()

Sets the text colour. ✍️


that's the whole page bestie, every single function, flag and colour β€” nothing skipped, nothing invented, periodt. πŸ’…βœ¨

β€” with love, from Ericsson AB, wx 2.6, on the wxGridCellAttr(3) page. go forth and customize those cells, you absolute icon πŸ«ΆπŸ’–πŸŒˆ

πŸ“¦ where this page comes from