wxToolbook(3)

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

πŸ’– wxToolbook πŸ’–

okay bestie, so this whole thing is the manual page for wxToolbook, straight out of the Erlang module definitions (that's the manual name, in case you were wondering where the header went 🫢). It's giving very "I'm a notebook but make it fashion" energy and honestly? obsessed.


✨ NAME ✨

wxToolbook β€” it's a class similar to wxNotebook, except instead of tabs it uses a wxToolBar to show the labels. yes, a whole toolbar. iconic behavior honestly. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so lowkey there is no documentation for this class yet, but the usage is identical to wxNotebook except for the stuff that is clearly tab-only, so for now please go read that class's docs. no cap. you can also use page_samples_notebook to see wxToolbook in action, which is the cute little "go look at it with your own eyes" option. πŸŽ€

One feature of this class that's not supported by wxBookCtrlBase is the support for disabling some of the pages β€” see EnablePage() (which is not implemented in wx, so don't get your hopes up bestie πŸ’€).

🌈 Styles 🌈

This class supports the following styles:

  • wxTBK_BUTTONBAR β€” uses a wxButtonToolBar-based implementation under macOS (and is ignored under every other platform, so it's giving platform-exclusive πŸ™ˆ).
  • wxTBK_HORZ_LAYOUT β€” shows the text and the icons alongside each other, not vertically stacked (only implemented under Windows and GTK 2 platforms, because it relies on wxTB_HORZ_LAYOUT flag support). Also, the common wxBookCtrl styles described in overview_bookctrl are supported too. ✨

πŸ‘€ See:

  • Overview bookctrl
  • wxBookCtrlBase
  • wxNotebook
  • Examples

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

  • wxBookCtrlBase
  • wxControl
  • wxWindow
  • wxEvtHandler

wxWidgets docs: wxToolbook

πŸŽ‰ Events

Event types emitted from this class:

  • toolbook_page_changed
  • toolbook_page_changing

🧁 DATA TYPES 🧁

wxToolbook() :: wx:wx_object().

🌟 FUNCTIONS 🌟

πŸ’… addPage

addPage(This, Page, Text, [Option]) -> boolean()
                 when
                     This :: wxToolbook(),
                     Page :: wxWindow:wxWindow(),
                     Text :: unicode:chardata(),
                     Option ::
                         {bSelect, boolean()} | {imageId, integer()}.

Adds a new page, slay. 🫢

The page must have the book control itself as the parent, and must not have been added to this control previously β€” no double-dipping bestie.

The call to this function will generate the page changing and page changed events if select is true, but not when you're inserting the very first page (because there's no previous page selection to switch from in that case, so it wouldn't make sense to e.g. veto such an event β€” it's giving "nothing to compare against").

Return: true if it worked, false otherwise.

Remark: Do not delete the page. It will be deleted by the book control. Let the book control have this one, okay? 😭

See: insertPage/5

πŸ’… advanceSelection

advanceSelection(This, [Option]) -> ok
                          when
                              This :: wxToolbook(),
                              Option :: {forward, boolean()}.

Cycles through the tabs. πŸŒ€

The call to this function generates the page changing events.

πŸ’… assignImageList

assignImageList(This, ImageList) -> ok
                         when
                             This :: wxToolbook(),
                             ImageList :: wxImageList:wxImageList().

Sets the image list for the page control and takes ownership of the list (so it's yours now, the control is the main character of that list 😌).

See:

  • wxImageList
  • setImageList/2

πŸ’… changeSelection

changeSelection(This, Page) -> integer()
                         when This :: wxToolbook(), Page :: integer().

Changes the selection to the given page, returning the previous selection. πŸ‘‘

This function behaves like setSelection/2 but does not generate the page changing events β€” quiet mode fr fr.

See overview_events_prog for more information.

πŸ’… create

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

Create the tool book control that has already been constructed with the default constructor. ✨

πŸ’… deleteAllPages

deleteAllPages(This) -> boolean() when This :: wxToolbook().

Deletes all pages. all of them. every last one. πŸ’€

πŸ’… destroy

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

Destroys the object. rip bozo πŸͺ¦

πŸ’… getCurrentPage

getCurrentPage(This) -> wxWindow:wxWindow()
                        when This :: wxToolbook().

Returns the currently selected page, or NULL. πŸ™ˆ

πŸ’… getImageList

getImageList(This) -> wxImageList:wxImageList()
                      when This :: wxToolbook().

Returns the associated image list β€” may be NULL, so maybe don't assume bestie.

See:

  • wxImageList
  • setImageList/2

πŸ’… getPage

getPage(This, Page) -> wxWindow:wxWindow()
                 when This :: wxToolbook(), Page :: integer().

Returns the window at the given page position. πŸͺŸ

πŸ’… getPageCount

getPageCount(This) -> integer() when This :: wxToolbook().

Returns the number of pages in the control. counting is self care ✨

πŸ’… getPageImage

getPageImage(This, NPage) -> integer()
                      when This :: wxToolbook(), NPage :: integer().

Returns the image index for the given page. πŸ–ΌοΈ

πŸ’… getPageText

getPageText(This, NPage) -> unicode:charlist()
                     when This :: wxToolbook(), NPage :: integer().

Returns the string for the given page. πŸŽ€

πŸ’… getSelection

getSelection(This) -> integer() when This :: wxToolbook().

Returns the currently selected page, or wxNOT_FOUND if none was selected.

Note: this method may return either the previously or the newly selected page when it's called from the EVT_BOOKCTRL_PAGE_CHANGED handler, depending on the platform. so honestly, in that case use wxBookCtrlEvent:getSelection/1 instead. iykyk. 😭

πŸ’… hitTest

hitTest(This, Pt) -> Result
                 when
                     Result :: {Res :: integer(), Flags :: integer()},
                     This :: wxToolbook(),
                     Pt :: {X :: integer(), Y :: integer()}.

Returns the index of the tab at the specified position, or wxNOT_FOUND if there isn't one. 🎯

If the flags parameter is non-NULL, the position of the point inside the tab is returned as well.

Return: the zero-based tab index, or wxNOT_FOUND if there's no tab at the specified position.

πŸ’… insertPage

insertPage(This, Index, Page, Text, [Option]) -> boolean()
                    when
                        This :: wxToolbook(),
                        Index :: integer(),
                        Page :: wxWindow:wxWindow(),
                        Text :: unicode:chardata(),
                        Option ::
                            {bSelect, boolean()} | {imageId, integer()}.

Inserts a new page at the specified position. placement is everything bestie ✨

Return: true if it worked, false otherwise.

Remark: Do not delete the page, it will be deleted by the book control. 🫢

See: addPage/4

πŸ’… new

new() -> wxToolbook().

Constructs a choicebook control. (yes it literally says choicebook, we are not editing the source material, we simply report it πŸ’€)

new(Parent, Id, [Option]) -> wxToolbook()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

πŸ’… setImageList

setImageList(This, ImageList) -> ok
                      when
                          This :: wxToolbook(),
                          ImageList :: wxImageList:wxImageList().

Sets the image list to use. πŸ–ΌοΈ

It does not take ownership of the image list β€” you must delete it yourself. so that's on you, bestie, no pressure πŸ™ˆ

See:

  • wxImageList
  • assignImageList/2

πŸ’… setPageImage

setPageImage(This, Page, Image) -> boolean()
                      when
                          This :: wxToolbook(),
                          Page :: integer(),
                          Image :: integer().

Sets the image index for the given page. 🎨

image is an index into the image list which was set with setImageList/2.

πŸ’… setPageSize

setPageSize(This, Size) -> ok
                     when
                         This :: wxToolbook(),
                         Size :: {W :: integer(), H :: integer()}.

Sets the width and height of the pages. πŸ“

Note:</> this method is currently not implemented for wxGTK. so if that's your platform, that's a no from her 😭

πŸ’… setPageText

setPageText(This, Page, Text) -> boolean()
                     when
                         This :: wxToolbook(),
                         Page :: integer(),
                         Text :: unicode:chardata().

Sets the text for the given page. πŸ’–

πŸ’… setSelection

setSelection(This, Page) -> integer()
                      when This :: wxToolbook(), Page :: integer().

Sets the selection to the given page, returning the previous selection. πŸ‘‘

Notice that the call to this function generates the page changing events β€” so if you don't want those events to be generated, use the changeSelection/2 function instead. periodt.

See: getSelection/1


and that's the whole page bestie, you ate that πŸ’…βœ¨

this lil' manual came to you from Ericsson AB, version wx 2.6, and it's the wxToolbook page, mwah πŸŽ€πŸ’– night night, go build something cute πŸ¦‹

πŸ“¦ where this page comes from