From 57fab6d5a879c5126ba72c4282b0d45fefe9303b Mon Sep 17 00:00:00 2001 From: CPD Date: Wed, 5 Mar 2025 17:05:45 +0100 Subject: [PATCH] add menubar --- cpdctrl_gui/ui/widgets/menubar.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 cpdctrl_gui/ui/widgets/menubar.py diff --git a/cpdctrl_gui/ui/widgets/menubar.py b/cpdctrl_gui/ui/widgets/menubar.py new file mode 100644 index 0000000..a75ad59 --- /dev/null +++ b/cpdctrl_gui/ui/widgets/menubar.py @@ -0,0 +1,27 @@ +''' cpdctrl_gui/ui/widgets/menubar.py ''' +from PyQt6.QtWidgets import QMenuBar + + +class MenuBar(QMenuBar): + """ + Initialize the menu bar. + + Args: + parent: The parent widget. + """ + + def __init__(self, parent=None) -> None: + super().__init__(parent) + self.m_file = self.addMenu("File") + self.m_dev = self.addMenu("Devices") + # edit_menu = self.addMenu("Edit") + # view_menu = self.addMenu("View") + # help_menu = self.addMenu("Help") + + # Add actions to the menus + # file_menu.addAction(self.parent().topbar.actions_call["Open"]) # type: ignore + self.m_file.addAction(self.parent().topbar.actions_call["meas_save"]) # type: ignore + self.m_file.addAction(self.parent().topbar.actions_call["app_exit"]) # type: ignore + + self.m_dev.addAction(self.parent().topbar.actions_call["connect_vmdev"]) # type: ignore + self.m_dev.addAction(self.parent().topbar.actions_call["connect_leddev"]) # type: ignore