-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.py
147 lines (135 loc) · 6.8 KB
/
menu.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Form implementation generated from reading ui file 'Menu.ui'
#
# Created by: PyQt6 UI code generator 6.0.3
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
import choose_number
import rules
import leaderboard_in_menu
class Ui_Form(object):
def open_rules(self):
self.window3 = QtWidgets.QMainWindow()
self.ui = rules.Ui_Form10()
self.ui.setupUi(self.window3)
self.window3.show()
def open_choice(self):
self.window2 = QtWidgets.QMainWindow()
self.ui = choose_number.Ui_Form2()
self.ui.setupUi(self.window2)
self.window2.show()
def open_leaderboard(self):
self.window4 = QtWidgets.QMainWindow()
self.ui = leaderboard_in_menu.Ui_Form11()
self.ui.setupUi(self.window4)
self.window4.show()
def setupUi(self, Form):
Form.setObjectName("Sc")
Form.setEnabled(True)
Form.resize(700, 791)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("images/icon1.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
Form.setWindowIcon(icon)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
Form.setSizePolicy(sizePolicy)
Form.setMinimumSize(QtCore.QSize(700, 791))
Form.setMaximumSize(QtCore.QSize(700, 791))
Form.setStyleSheet("background-color:\"green\"\n"
"")
self.horizontalLayoutWidget = QtWidgets.QWidget(Form)
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(-1, 279, 661, 511))
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout.addLayout(self.verticalLayout)
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.playButton = QtWidgets.QPushButton(self.horizontalLayoutWidget)
self.playButton.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.playButton.sizePolicy().hasHeightForWidth())
self.playButton.setSizePolicy(sizePolicy)
self.playButton.setMinimumSize(QtCore.QSize(213, 35))
self.playButton.setMaximumSize(QtCore.QSize(213, 35))
self.playButton.setStyleSheet("background-color:\"lightblue\"\n"
"")
self.playButton.setObjectName("playButton")
self.playButton.clicked.connect(self.open_choice)
self.playButton.clicked.connect(Form.close)
self.verticalLayout_2.addWidget(self.playButton)
self.leaderButton = QtWidgets.QPushButton(self.horizontalLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.leaderButton.sizePolicy().hasHeightForWidth())
self.leaderButton.setSizePolicy(sizePolicy)
self.leaderButton.setMinimumSize(QtCore.QSize(213, 35))
self.leaderButton.setMaximumSize(QtCore.QSize(213, 35))
self.leaderButton.setStyleSheet("background-color:\"lightblue\"\n"
"")
self.leaderButton.setObjectName("leaderButton")
self.leaderButton.clicked.connect(self.open_leaderboard)
self.leaderButton.clicked.connect(Form.close)
self.verticalLayout_2.addWidget(self.leaderButton)
self.rulesButton = QtWidgets.QPushButton(self.horizontalLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.rulesButton.sizePolicy().hasHeightForWidth())
self.rulesButton.setSizePolicy(sizePolicy)
self.rulesButton.setMinimumSize(QtCore.QSize(213, 35))
self.rulesButton.setMaximumSize(QtCore.QSize(213, 35))
self.rulesButton.setStyleSheet("background-color:\"lightblue\"\n"
"")
self.rulesButton.setObjectName("rulesButton")
self.rulesButton.clicked.connect(self.open_rules)
self.rulesButton.clicked.connect(Form.close)
self.verticalLayout_2.addWidget(self.rulesButton)
self.exitButton = QtWidgets.QPushButton(self.horizontalLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.exitButton.sizePolicy().hasHeightForWidth())
self.exitButton.setSizePolicy(sizePolicy)
self.exitButton.setMinimumSize(QtCore.QSize(213, 35))
self.exitButton.setMaximumSize(QtCore.QSize(213, 35))
self.exitButton.setStyleSheet("background-color:\"lightblue\"\n"
"")
self.exitButton.setObjectName("exitButton")
self.exitButton.clicked.connect(Form.close)
self.verticalLayout_2.addWidget(self.exitButton)
self.horizontalLayout.addLayout(self.verticalLayout_2)
self.verticalLayout_3 = QtWidgets.QVBoxLayout()
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.horizontalLayout.addLayout(self.verticalLayout_3)
self.label = QtWidgets.QLabel(Form)
self.label.setGeometry(QtCore.QRect(0, 0, 661, 281))
self.label.setPixmap(QtGui.QPixmap('images/Logo_2.png'))
self.label.setText("")
self.label.setObjectName("label")
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Scrabble"))
self.playButton.setText(_translate("Form", "Play"))
self.leaderButton.setText(_translate("Form", "Leaderboard"))
self.rulesButton.setText(_translate("Form", "Rules"))
self.exitButton.setText(_translate("Form", "Exit"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Form = QtWidgets.QWidget()
ui = Ui_Form()
ui.setupUi(Form)
Form.show()
sys.exit(app.exec())