Мелкие правки и фикс багов
This commit is contained in:
@@ -2,7 +2,7 @@ import wx
|
|||||||
import random
|
import random
|
||||||
|
|
||||||
|
|
||||||
class SeconPageFrame(wx.Frame):
|
class SecondPageFrame(wx.Frame):
|
||||||
def scale_bitmap(self, bitmap, width, height):
|
def scale_bitmap(self, bitmap, width, height):
|
||||||
self.w = width
|
self.w = width
|
||||||
self.h = height
|
self.h = height
|
||||||
@@ -20,8 +20,9 @@ class SeconPageFrame(wx.Frame):
|
|||||||
self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PROCESS_ENTER)
|
self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PROCESS_ENTER)
|
||||||
self.text_ctrl_2 = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PROCESS_ENTER)
|
self.text_ctrl_2 = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PROCESS_ENTER)
|
||||||
|
|
||||||
self.text_ctrl_1.Bind(wx.EVT_TEXT_ENTER, self.proverka)
|
self.text_ctrl_1.Bind(wx.EVT_TEXT_ENTER, self.proverka_vvoda)
|
||||||
self.text_ctrl_2.Bind(wx.EVT_TEXT_ENTER, self.proverka)
|
self.text_ctrl_2.Bind(wx.EVT_TEXT_ENTER, self.proverka_vvoda)
|
||||||
|
self.radio_btn_2.SetValue(True)
|
||||||
|
|
||||||
|
|
||||||
self.__set_properties()
|
self.__set_properties()
|
||||||
@@ -140,16 +141,13 @@ class SeconPageFrame(wx.Frame):
|
|||||||
self.kat_horizont.SetLabel(str(random.randint(2, 4)))
|
self.kat_horizont.SetLabel(str(random.randint(2, 4)))
|
||||||
self.kat_vertical.SetLabel(str(random.randint(2, 4)))
|
self.kat_vertical.SetLabel(str(random.randint(2, 4)))
|
||||||
|
|
||||||
def proverka(self, event):
|
def proverka_vvoda(self, event):
|
||||||
print(self.text_ctrl_1.GetValue())
|
|
||||||
print(self.text_ctrl_2.GetValue())
|
|
||||||
|
|
||||||
self.pr_Vert = int(self.kolvo_polosv_horiz.GetLabel()) * 3.75
|
self.pr_Vert = int(self.kolvo_polosv_horiz.GetLabel()) * 3.75
|
||||||
self.pr_hor = int(self.kolvo_polosv_horiz.GetLabel()) * 3.75
|
self.pr_hor = int(self.kolvo_polosv_horiz.GetLabel()) * 3.75
|
||||||
|
|
||||||
print(self.pr_hor)
|
print(self.pr_hor)
|
||||||
print(self.pr_Vert)
|
print(self.pr_Vert)
|
||||||
|
if len(self.text_ctrl_1.GetValue()) > 0:
|
||||||
if str(self.pr_hor) == self.text_ctrl_1.GetValue():
|
if str(self.pr_hor) == self.text_ctrl_1.GetValue():
|
||||||
print("good")
|
print("good")
|
||||||
self.bitmap_2.Hide()
|
self.bitmap_2.Hide()
|
||||||
@@ -165,8 +163,10 @@ class SeconPageFrame(wx.Frame):
|
|||||||
self.img3 = self.scale_bitmap(self.img2, 70, 50)
|
self.img3 = self.scale_bitmap(self.img2, 70, 50)
|
||||||
self.bitmap_2.SetBitmap(wx.Bitmap(self.img3))
|
self.bitmap_2.SetBitmap(wx.Bitmap(self.img3))
|
||||||
self.bitmap_2.Show()
|
self.bitmap_2.Show()
|
||||||
|
self.text_ctrl_1.SetValue(str(self.pr_hor))
|
||||||
self.Refresh()
|
self.Refresh()
|
||||||
|
|
||||||
|
if len(self.text_ctrl_2.GetValue()) > 0:
|
||||||
if str(self.pr_Vert) == self.text_ctrl_2.GetValue() and len(self.text_ctrl_2.GetValue()) > 0:
|
if str(self.pr_Vert) == self.text_ctrl_2.GetValue() and len(self.text_ctrl_2.GetValue()) > 0:
|
||||||
print("good")
|
print("good")
|
||||||
self.bitmap_3.Hide()
|
self.bitmap_3.Hide()
|
||||||
@@ -182,14 +182,30 @@ class SeconPageFrame(wx.Frame):
|
|||||||
self.img3 = self.scale_bitmap(self.img2, 70, 50)
|
self.img3 = self.scale_bitmap(self.img2, 70, 50)
|
||||||
self.bitmap_3.SetBitmap(wx.Bitmap(self.img3))
|
self.bitmap_3.SetBitmap(wx.Bitmap(self.img3))
|
||||||
self.bitmap_3.Show()
|
self.bitmap_3.Show()
|
||||||
|
self.text_ctrl_2.SetValue(str(self.pr_Vert))
|
||||||
self.Refresh()
|
self.Refresh()
|
||||||
|
|
||||||
def go_page3(self):
|
|
||||||
pass
|
|
||||||
|
def proverka_radiobtn(self):
|
||||||
|
self.s = 1
|
||||||
|
print(self.radio_btn_2.GetValue())
|
||||||
|
print(self.radio_btn_3.GetValue())
|
||||||
|
if self.radio_btn_2.GetValue() == self.radio_btn_2.GetValue():
|
||||||
|
self.error_radio_btn()
|
||||||
|
self.s = 0
|
||||||
|
return self.s
|
||||||
|
|
||||||
|
|
||||||
|
def go_page3(self, event):
|
||||||
|
from gui import page3
|
||||||
|
page3.Page3.OnInit(page3)
|
||||||
|
self.Destroy()
|
||||||
|
|
||||||
|
|
||||||
class SecondPage(wx.App):
|
class SecondPage(wx.App):
|
||||||
def OnInit(self):
|
def OnInit(self):
|
||||||
self.frame = SeconPageFrame(None, wx.ID_ANY, "")
|
self.frame = SecondPageFrame(None, wx.ID_ANY, "")
|
||||||
self.frame.Show()
|
self.frame.Show()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
2
main.py
2
main.py
@@ -111,8 +111,6 @@ class MainFramePanel(wx.Panel):
|
|||||||
student = Student(fname=fio, group=group, zach_number=zach_number)
|
student = Student(fname=fio, group=group, zach_number=zach_number)
|
||||||
new_session.add(student)
|
new_session.add(student)
|
||||||
new_session.commit()
|
new_session.commit()
|
||||||
if fio == 'талыкова ксения':
|
|
||||||
from gui import kotya
|
|
||||||
|
|
||||||
self.frame.Destroy()
|
self.frame.Destroy()
|
||||||
SecondPage.SecondPage.OnInit(SecondPage)
|
SecondPage.SecondPage.OnInit(SecondPage)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<!-- generated by wxGlade 0.8.3 on Thu Dec 6 10:03:14 2018 -->
|
<!-- generated by wxGlade 0.8.3 on Thu Dec 6 15:16:02 2018 -->
|
||||||
|
|
||||||
<application class="MyApp" encoding="UTF-8" for_version="3.0" header_extension=".h" indent_amount="4" indent_symbol="space" is_template="0" language="python" name="app" option="0" overwrite="1" path="/Users/danamir/PycharmProjects/odd-perekrestok/src/page3_1.py" source_extension=".cpp" top_window="frame" use_gettext="0" use_new_namespace="1">
|
<application class="MyApp" encoding="UTF-8" for_version="3.0" header_extension=".h" indent_amount="4" indent_symbol="space" is_template="0" language="python" name="app" option="0" overwrite="1" path="/Users/danamir/PycharmProjects/odd-perekrestok/src/page3_1.py" source_extension=".cpp" top_window="frame" use_gettext="0" use_new_namespace="1">
|
||||||
<object class="MyFrame" name="frame" base="EditFrame">
|
<object class="MyFrame" name="frame" base="EditFrame">
|
||||||
|
|||||||
Reference in New Issue
Block a user