wxBitmapButton(3)

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

πŸ’– wxBitmapButton πŸ’–

okay bestie, welcome to the Erlang Module Definition page for wxBitmapButton β€” yes that's the manual name, it lives in the wx 2.6 docs and it's literally just the glow-up guide for one very cute little button. sit down, hydrate, let's go 🫢


✨ NAME ✨

wxBitmapButton β€” a bitmap button is a control that contains a bitmap. that's it, that's the whole vibe πŸŽ€


🌸 DESCRIPTION 🌸

okay so real talk: since wxWidgets 2.9.1, bitmap display is supported by the base wxButton class itself. so the only tiny advantage of using this class is that it lets you specify the bitmap right in its constructor, unlike wxButton (which is giving "you have to do it the long way" energy πŸ’€). if you want the full tea on image support in wxButton, go read the base class documentation, bestie, it's all there.

🎨 Styles

this class supports the following styles, and yes every single one is iconic:

  • wxBU_LEFT β€” left-justifies the bitmap label. yes babe, left. πŸ‘ˆ
  • wxBU_TOP β€” aligns the bitmap label to the top of the button. up up and away ⬆️
  • wxBU_RIGHT β€” right-justifies the bitmap label. right where it belongs πŸ‘‰
  • wxBU_BOTTOM β€” aligns the bitmap label to the bottom of the button. ⬇️ note that the wxBU_EXACTFIT style supported by wxButton is not used by this class, because bitmap buttons don't have any minimal standard size by default. no cap, that's just how it is.

See: wxButton

this class is derived, and can use functions, from:

  • wxButton
  • wxControl
  • wxWindow
  • wxEvtHandler

that's a whole ancestry tree of slay 🌈

wxWidgets docs: wxBitmapButton

πŸ”” Events

event types emitted from this class:

  • command_button_clicked β€” the moment the button gets clicked, main character energy fr fr ⭐

πŸ¦‹ DATA TYPES πŸ¦‹

wxBitmapButton() :: wx:wx_object().

one type, one icon, one legend ✨


πŸ’… FUNCTIONS πŸ’…

πŸ“ create

create(This, Parent, Id, Bitmap, [Option]) -> boolean()
                when
                    This :: wxBitmapButton(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Bitmap :: wxBitmap:wxBitmap(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()}.

button creation function for two-step creation. it's giving "part two of a two-part series" 🎬

for more details, see new/4.

πŸ“ destroy

destroy(This :: wxBitmapButton()) -> ok.

destroys the object. bye bestie, it was real πŸ˜­πŸ’”

πŸ“ new()

new() -> wxBitmapButton().

default ctor. the blank canvas moment, the "before" picture, the empty page πŸ“„

πŸ“ new(Parent, Id, Bitmap, [Option])

new(Parent, Id, Bitmap, [Option]) -> wxBitmapButton()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Bitmap :: wxBitmap:wxBitmap(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

constructor, creating and showing a button. the glow-up itself, the debut, the ✨moment✨

Remark: the bitmap parameter is normally the only bitmap you need to provide, and wxWidgets will draw the button correctly in its different states. so like, chill, it's handled. 🧘 but if you want more control, call any of the functions SetBitmapPressed() (not implemented in wx, so don't come for it πŸ’€), wxButton:setBitmapFocus/2, wxButton:setBitmapDisabled/2.

See: create/5

πŸ“ newCloseButton(Parent, Winid)

newCloseButton(Parent, Winid) -> wxBitmapButton()
                        when
                            Parent :: wxWindow:wxWindow(),
                            Winid :: integer().

helper function creating a standard-looking "Close" button. lowkey the MVP of this whole page πŸ‘‘

to get the best results, platform-specific code may need to be used to create a small, title bar-like "Close" button. this function is provided to avoid the need to test for the current platform, and it creates the button with as native a look as possible. so it does the platform-sniffing for you, bestie, that's the whole point 🫢

Return: the new button.

Since: 2.9.5


and that's the whole page, no skips, no summaries, every flag and function accounted for πŸ’–βœ‹

signing off: this has been brought to you by Ericsson AB, rocking the wx 2.6 era, and yes the header said wxBitmapButton(3) and the footer said the same thing twice because that's just how manpages dress up. stay iconic, go build a cute little button, command_button_clicked your way to greatness πŸŒŸπŸ’… no cap.

πŸ“¦ where this page comes from