-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindow_layout.py
50 lines (41 loc) · 2.48 KB
/
window_layout.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# -*- coding: utf-8 -*-
from PyQt5 import QtWidgets, QtGui
class MainWindow:
"""макет для основоного окна программы"""
def __init__(self):
super(MainWindow, self).__init__()
def setup(self, main_window: QtWidgets.QMainWindow):
main_window.setWindowTitle('Untitled')
main_window.setMinimumSize(800, 700)
self.central_widget = QtWidgets.QWidget(main_window)
self.central_widget.setObjectName("central_widget")
main_window.setCentralWidget(self.central_widget)
main_window.statusBar()
self.menu_bar = QtWidgets.QMenuBar(main_window)
self.menu_bar.setObjectName("menu_bar")
main_window.setMenuBar(self.menu_bar)
self.file_menu = self.menu_bar.addMenu('File')
self.status_bar = QtWidgets.QStatusBar(main_window)
self.status_bar.setObjectName("status_bar")
main_window.setStatusBar(self.status_bar)
self.add_function_block_action = QtWidgets.QAction(QtGui.QIcon('pictures/function.png'), 'function', self)
self.add_variable_block_action = QtWidgets.QAction(QtGui.QIcon('./pictures/variable.png'), 'variable', self)
self.add_for_loop_block_action = QtWidgets.QAction(QtGui.QIcon('./pictures/for.png'), 'for loop', self)
self.add_while_loop_block_action = QtWidgets.QAction(QtGui.QIcon('./pictures/while.png'), 'while loop', self)
self.add_if_block_action = QtWidgets.QAction(QtGui.QIcon('./pictures/if.png'), 'if block', self)
self.execute_program_action = QtWidgets.QAction('Execute', self)
self.save_file_action = QtWidgets.QAction('Save', self)
self.save_file_action.setShortcut('Ctrl+S')
self.save_as_file_action = QtWidgets.QAction('Save as', self)
self.open_file_action = QtWidgets.QAction('Open', self)
self.block_toolbar = QtWidgets.QToolBar('blocks', self)
main_window.addToolBar(self.block_toolbar)
self.block_toolbar.addAction(self.add_function_block_action)
self.block_toolbar.addAction(self.add_variable_block_action)
self.block_toolbar.addAction(self.add_for_loop_block_action)
self.block_toolbar.addAction(self.add_while_loop_block_action)
self.block_toolbar.addAction(self.add_if_block_action)
self.menu_bar.addAction(self.execute_program_action)
self.file_menu.addAction(self.save_file_action)
self.file_menu.addAction(self.save_as_file_action)
self.file_menu.addAction(self.open_file_action)