# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'home.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt5 import QtCore, QtGui, QtWidgets
from StockData import Ui_StockData
from StockSearching import Ui_StockSearching
from StockCalc import Ui_StockCalc


class Ui_Home(object):
    def setupUi(self, Home, prewindow):
        Home.setObjectName("Home")
        Home.resize(519, 510)
        Home.setStyleSheet("background-color: rgb(205, 219, 231);")
        self.lblRealPrice = QtWidgets.QLabel(Home)
        self.lblRealPrice.setGeometry(QtCore.QRect(190, 510, 131, 21))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.lblRealPrice.setFont(font)
        self.lblRealPrice.setText("")
        self.lblRealPrice.setObjectName("lblRealPrice")
        self.pushButton = QtWidgets.QPushButton(Home)
        self.pushButton.setStyleSheet("background-color: rgb(255, 255, 255);\n"
                                        "border-radius: 10px;"
                                      "color: rgb(105, 147, 184);")
        self.pushButton.setGeometry(QtCore.QRect(170, 300, 181, 61))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.pushButton.setFont(font)
        self.pushButton.setObjectName("pushButton")
        self.pushButton_2 = QtWidgets.QPushButton(Home)
        self.pushButton_2.setStyleSheet("background-color: rgb(255, 255, 255);\n"
                                        "border-radius: 10px;"
                                        "color: rgb(105, 147, 184);")
        self.pushButton_2.setGeometry(QtCore.QRect(170, 220, 181, 61))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.pushButton_2.setFont(font)
        self.pushButton_2.setObjectName("pushButton_2")
        self.pushButton_3 = QtWidgets.QPushButton(Home)
        self.pushButton_3.setStyleSheet("background-color: rgb(255, 255, 255);\n"
                                       "border-radius: 10px;"
                                        "color: rgb(105, 147, 184);")
        self.pushButton_3.setGeometry(QtCore.QRect(170, 140, 181, 61))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.pushButton_3.setFont(font)
        self.pushButton_3.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.pushButton_3.setObjectName("pushButton_3")
        self.btnLogout = QtWidgets.QPushButton(Home)
        self.btnLogout.setGeometry(QtCore.QRect(10, 480, 75, 23))
        self.btnLogout.setCheckable(False)
        self.btnLogout.setAutoRepeat(False)
        self.btnLogout.setAutoExclusive(False)
        self.btnLogout.setDefault(False)
        self.btnLogout.setFlat(True)
        self.btnLogout.setObjectName("btnLogout")
        self.btnLogout.setStyleSheet("color: rgb(105, 147, 184);")
        self.label_5 = QtWidgets.QLabel(Home)
        self.label_5.setGeometry(QtCore.QRect(410, 20, 31, 21))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.lblUserName = QtWidgets.QLabel(Home)
        self.lblUserName.setGeometry(QtCore.QRect(450, 20, 101, 21))
        font = QtGui.QFont()
        font.setPointSize(10)


        self.pushButton_3.clicked.connect(self.showStockData)
        self.pushButton_2.clicked.connect(self.showStockSearch)
        self.pushButton.clicked.connect(self.showStockCalc)
        self.btnLogout.clicked.connect(self.logout)

        self.thiswindow = Home
        self.prewindow = prewindow

        self.retranslateUi(Home)
        QtCore.QMetaObject.connectSlotsByName(Home)

    def logout(self):
        self.thiswindow.hide()
        self.prewindow.show()

    def showStockCalc(self):
        self.window = QtWidgets.QMainWindow()
        self.ui = Ui_StockCalc()
        self.ui.setupUi(self.window,self.thiswindow)
        self.thiswindow.hide()
        self.window.show()

    def showStockSearch(self):
        self.window = QtWidgets.QMainWindow()
        self.ui = Ui_StockSearching()
        self.ui.setupUi(self.window,self.thiswindow)
        self.thiswindow.hide()
        self.window.show()

    def showStockData(self):
        self.window = QtWidgets.QMainWindow()
        self.ui = Ui_StockData()
        self.ui.setupUi(self.window,self.thiswindow)
        self.thiswindow.hide()
        self.window.show()

    def retranslateUi(self, Home):
        _translate = QtCore.QCoreApplication.translate
        Home.setWindowTitle(_translate("Home", "โปรแกรมคำนวณเงินออมสะสมหุ้น"))
        self.pushButton.setText(_translate("Home", "คำนวณรายการออมหุ้น"))
        self.pushButton_2.setText(_translate("Home", "ค้นหารายชื่อหุ้นที่ทำรายการ"))
        self.pushButton_3.setText(_translate("Home", "เพิ่มรายการหุ้นจดทะเบียน"))
        self.btnLogout.setText(_translate("Home", "Logout"))



if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    Home = QtWidgets.QDialog()
    ui = Ui_Home()
    ui.setupUi(Home)
    Home.show()
    sys.exit(app.exec_())
