A vertical list of panels (fl_sidebar) that scrolls without a visible scrollbar, drawn by
the active theme's PaintSidebar hook.
Fill it from top to bottom with add_button and add_panel, spaced with set_margin and
add_space; Clear empties it again. Buttons added with add_button behave like tabs: the
clicked one becomes active and the previously clicked one is deactivated. The main menu and
the admin menu use it for their navigation. Derives from DScrollPanel.
Summary
Methods
Methods
Creates an fl_button as wide as the sidebar and adds it as the next item. Clicking it marks it as active and deactivates the previously clicked button.
Parameters
- text String title of the button
- callback Function optional, defaults to
nilcalled with the button when it is clicked
Returns
- Panel the created fl_button
Adds a panel below the previously added item, followed by the configured margin.
Parameters
- panel Panel
- center Boolean optional, defaults to
falsecenter the panel horizontally instead of keeping its x position
Adds empty vertical space before the next item.
Parameters
- px Number height of the gap in pixels
Centers every item horizontally within the sidebar.
Removes all items from the sidebar and resets the position of the next item to the top.
Hides the scrollbar graphics and performs the initial layout.
Delegates drawing of the sidebar to the active theme's PaintSidebar hook.
Parameters
- width Number panel width
- height Number panel height
Rebuilds the canvas and updates the scrollbar while keeping the canvas as wide as the sidebar itself.
Sets the vertical gap left after each item that is added from now on.
Parameters
- margin Number gap in pixels; values tonumber cannot convert become 0