# -*- 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, user):
        Home.setObjectName("Home")
        Home.resize(519, 505)
        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.btnStockCalc = QtWidgets.QPushButton(Home)
        self.btnStockCalc.setGeometry(QtCore.QRect(160, 290, 181, 61))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.btnStockCalc.setFont(font)
        self.btnStockCalc.setObjectName("btnStockCalc")
        self.btnStockSearch = QtWidgets.QPushButton(Home)
        self.btnStockSearch.setGeometry(QtCore.QRect(160, 210, 181, 61))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.btnStockSearch.setFont(font)
        self.btnStockSearch.setObjectName("btnStockSearch")
        self.btnStockInsert = QtWidgets.QPushButton(Home)
        self.btnStockInsert.setGeometry(QtCore.QRect(160, 130, 181, 61))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.btnStockInsert.setFont(font)
        self.btnStockInsert.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.btnStockInsert.setObjectName("btnStockInsert")
        self.btnLogout = QtWidgets.QPushButton(Home)
        self.btnLogout.setGeometry(QtCore.QRect(10, 470, 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.btnStockInsert.clicked.connect(self.showStockData)
        self.btnStockSearch.clicked.connect(self.showStockSearch)
        self.btnStockCalc.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.hide()
        self.window.show()

    def showStockSearch(self):
        self.window = QtWidgets.QMainWindow()
        self.ui = Ui_StockSearching()
        self.ui.setupUi(self.window)
        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", "Dialog"))
        self.btnStockCalc.setText(_translate("Home", "คำนวณรายการออมหุ้น"))
        self.btnStockSearch.setText(_translate("Home", "ค้นหารายชื่อหุ้นที่ทำรายการ"))
        self.btnStockInsert.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_())
