wxListbook(3)

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

πŸ’– wxListbook β€” aka the manual page, but make it cute πŸ’–

okay bestie, welcome to the wxListbook(3) page β€” Erlang Module Definition energy, wx 2.6 era, and yes we're doing this together 🫢


✨ NAME ✨

wxListbook β€” it's a class that's basically wxNotebook's cooler cousin, except instead of tabs it uses a wxListCtrl to show the labels. no cap.


🌸 DESCRIPTION 🌸

So the underlying wxListCtrl shows page labels in a one-column report view by default. that's the vibe, that's the default, don't fight it. but lowkey, if you call wxBookCtrl::SetImageList, the control implicitly switches over to using an icon view instead. so it's giving glow-up, automatically. πŸ’…

and if you want the actual usage docs for this class, bestie, go read the base abstract class wxBookCtrl. that's where the real lore lives. you can also run the page_samples_notebook to see wxListbook in action, and honestly? obsessed. watch it work. ✨

πŸŽ€ Styles

this class supports the following styles, periodt:

  • wxLB_DEFAULT β€” picks the default location for the labels based on whatever platform you're on (left everywhere except on Mac, where it's top). platform-dependent queen πŸ‘‘
  • wxLB_TOP β€” labels go above the page area.
  • wxLB_LEFT β€” labels go on the left side.
  • wxLB_RIGHT β€” labels go on the right side.
  • wxLB_BOTTOM β€” labels go below the page area.

See:

  • ?wxBookCtrl
  • wxNotebook
  • Examples

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

  • wxBookCtrlBase
  • wxControl
  • wxWindow
  • wxEvtHandler

wxWidgets docs: wxListbook

πŸ“¬ Events

Event types emitted from this class, and yes these are the ones you're waiting for:

  • listbook_page_changed
  • listbook_page_changing

πŸ¦‹ DATA TYPES πŸ¦‹

wxListbook() :: wx:wx_object().

short and sweet. iconic.


πŸ’œ FUNCTIONS πŸ’œ

addPage

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

Adds a new page. yes, just like that. πŸ’–

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

This call will generate the page changing and page changed events if select is true β€” but not when you're inserting the very first page. because at that point there's no previous page selection to switch from, so it literally wouldn't make sense to e.g. veto such an event. the logic is logic-ing πŸ™ˆ

Return: true if successful, false otherwise.

Remark: Do not delete the page β€” it will be deleted by the book control. it's not yours anymore, she's got custody 🫢

See: insertPage/5

advanceSelection

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

Cycles through the tabs. like flipping through a lil flipbook of pages ✨

The call to this function generates the page changing events.

assignImageList

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

Sets the image list for the page control and takes ownership of the list. she said "mine now" πŸ’…

See:

  • wxImageList
  • setImageList/2

changeSelection

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

Changes the selection to the given page, and returns the previous selection.

This function behaves as setSelection/2 but does not generate the page changing events. quiet, chill, no drama 🌈

See overview_events_prog for more information.

create

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

Create the list book control that has already been constructed with the default constructor. two-step construction, we love a slow burn πŸŽ€

deleteAllPages

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

Deletes all pages. every single one. gone. bye bestie πŸ‘‹

destroy

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

Destroys the object.

getCurrentPage

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

Returns the currently selected page or NULL.

getImageList

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

Returns the associated image list, may be NULL.

See:

  • wxImageList
  • setImageList/2

getPage

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

Returns the window at the given page position.

getPageCount

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

Returns the number of pages in the control. counting queen πŸ”’

getPageImage

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

Returns the image index for the given page.

getPageText

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

Returns the string for the given page.

getSelection

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

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

⚠️ Note that this method may return either the previously or newly selected page when called from the EVT_BOOKCTRL_PAGE_CHANGED handler, depending on the platform. so in that case you should use wxBookCtrlEvent:getSelection/1 instead. platform chaos, fr fr 😭

hitTest

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

Returns the index of the tab at the specified position, or wxNOT_FOUND if there's none. vibe check on a coordinate πŸ“

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

Return: Returns the zero-based tab index or wxNOT_FOUND if there is no tab at the specified position.

insertPage

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

Inserts a new page at the specified position. scoot over, we're making room πŸͺ‘βœ¨

Return: true if successful, false otherwise.

Remark: Do not delete the page β€” it will be deleted by the book control. same rule as before, okay? don't do it πŸ™ˆ

See: addPage/4

new

new() -> wxListbook().

Default ctor. the blank canvas moment 🎨

new/3

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

Constructs a listbook control. main character entrance πŸ’…

setImageList

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

Sets the image list to use.

It does not take ownership of the image list β€” you must delete it yourself. so like, this one's a situationship, not a commitment. don't forget to clean up after yourself πŸ’€

See:

  • wxImageList
  • assignImageList/2

setPageImage

setPageImage(This, Page, Image) -> boolean()
    when
        This :: wxListbook(),
        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 :: wxListbook(),
        Size :: {W :: integer(), H :: integer()}.

Sets the width and height of the pages.

Note: This method is currently not implemented for wxGTK. so on GTK she simply does not serve πŸ˜” sorry bestie, that's just the lore.

setPageText

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

Sets the text for the given page.

setSelection

setSelection(This, Page) -> integer()
    when This :: wxListbook(), 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. loud option vs quiet option, pick your fighter πŸ“’πŸ€«

See: getSelection/1


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

Ericsson AB β€’ wx 2.6 β€’ wxListbook(3) β€” that's the source, version and date tag at the bottom, so now you know exactly which era of wxWidgets this queen came from. slay, bye, go build something πŸ¦‹πŸ’–πŸŽ€

πŸ“¦ where this page comes from