Source code for pygame_menu.widgets.widget.menubar

"""
pygame-menu
https://github.com/ppizarror/pygame-menu

MENUBAR
MenuBar class to display the Menu title.
"""
# File constants no. 1000

from __future__ import annotations

__all__ = [
    # Main class
    "MenuBar",
    # Menubar styles
    "MENUBAR_STYLE_ADAPTIVE",
    "MENUBAR_STYLE_SIMPLE",
    "MENUBAR_STYLE_TITLE_ONLY",
    "MENUBAR_STYLE_TITLE_ONLY_DIAGONAL",
    "MENUBAR_STYLE_NONE",
    "MENUBAR_STYLE_UNDERLINE",
    "MENUBAR_STYLE_UNDERLINE_TITLE",
    # Custom types
    "MenuBarStyleModeType",
]

from typing import Any

import pygame
import pygame.gfxdraw as gfxdraw

from pygame_menu._types import (
    CallbackType,
    ColorInputType,
    ColorType,
    EventVectorType,
    NumberInstance,
    NumberType,
    Tuple2IntType,
    VectorInstance,
)
from pygame_menu.locals import (
    FINGERUP,
    POSITION_EAST,
    POSITION_NORTH,
    POSITION_SOUTH,
    POSITION_WEST,
)
from pygame_menu.utils import assert_color, get_finger_pos, warn
from pygame_menu.widgets.core.widget import Widget, WidgetTransformationNotImplemented

# Menubar styles
MENUBAR_STYLE_ADAPTIVE = 1000
MENUBAR_STYLE_SIMPLE = 1001
MENUBAR_STYLE_TITLE_ONLY = 1002
MENUBAR_STYLE_TITLE_ONLY_DIAGONAL = 1003
MENUBAR_STYLE_NONE = 1004
MENUBAR_STYLE_UNDERLINE = 1005
MENUBAR_STYLE_UNDERLINE_TITLE = 1006

# Menubar operation modes
_MODE_CLOSE = 1020
_MODE_BACK = 1021

# Custom types
MenuBarStyleModeType = int