> # -*- coding: UTF-8 -*-
> #
> # generated by wxGlade 1.1.0a2 on Fri Apr 12 20:31:59 2024
> #
>
> import wx
>
> # begin wxGlade: dependencies
> import wx.grid
> # end wxGlade
>
> # begin wxGlade: extracode
> # end wxGlade
>
> import sqlite3
>
> def storeData(thatCategory, thatPhrase, thoseKeywords, thatContext, thatTranslation):
> theCategory = thatCategory.GetCurrentSelection()
> thePhrase = thatPhrase.GetValue()
> theKeywords = thoseKeywords.GetLineText(0)
> theContext = thatContext.GetLineText(0)
> theTranslation = thatTranslation.GetLineText(0)
>
> conn = sqlite3.connect("Cairo_Qlq_Idioms.db")
> cur = conn.cursor()
> cur.execute('''INSERT INTO phrases (Phrase, Categ_ID) VALUES (?, ?)''', (thePhrase, theCategory))
> conn.commit()
> thisPhraseID = cur.lastrowid
>
> conn.close()
>
>
> class MyFrame(wx.Frame):
> def __init__(self, *args, **kwds):
> # begin wxGlade: MyFrame.__init__
> kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
> wx.Frame.__init__(self, *args, **kwds)
> self.SetSize((640, 576))
> self.SetTitle(u"التعبيرات القاهرية الدارجة في العامية المصرية")
>
> self.window_1 = wx.SplitterWindow(self, wx.ID_ANY)
> self.window_1.SetMinimumPaneSize(20)
>
> self.InputPanel = wx.Panel(self.window_1, wx.ID_ANY)
>
> sizer_1 = wx.BoxSizer(wx.VERTICAL)
>
> label_1 = wx.StaticText(self.InputPanel, wx.ID_ANY, u"إدخال البيانات")
> label_1.SetFont(wx.Font(18, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, ""))
> sizer_1.Add(label_1, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 2)
>
> sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
> sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
>
> sizer_4 = wx.BoxSizer(wx.VERTICAL)
> sizer_2.Add(sizer_4, 1, wx.EXPAND, 0)
>
> self.theClassesSet = wx.ComboBox(self.InputPanel, wx.ID_ANY, choices=[u"تعبير دارج", u"تعبير خاصّ", u"غريبة نحوية", u"صعوبة ترجمة"],
> style=wx.CB_READONLY)
> sizer_4.Add(self.theClassesSet, 0, wx.ALIGN_RIGHT | wx.ALL, 1)
>
> self.thePhrase = wx.TextCtrl(self.InputPanel, wx.ID_ANY, "")
> sizer_4.Add(self.thePhrase, 0, wx.ALL | wx.EXPAND, 1)
>
> self.theKeywordsSet = wx.TextCtrl(self.InputPanel, wx.ID_ANY, "")
> sizer_4.Add(self.theKeywordsSet, 0, wx.ALL | wx.EXPAND, 1)
>
> self.theContext = wx.TextCtrl(self.InputPanel, wx.ID_ANY, "")
> sizer_4.Add(self.theContext, 0, wx.ALL | wx.EXPAND, 1)
>
> self.theTranslation = wx.TextCtrl(self.InputPanel, wx.ID_ANY, "")
> sizer_4.Add(self.theTranslation, 0, wx.ALL | wx.EXPAND, 1)
>
> sizer_3 = wx.BoxSizer(wx.VERTICAL)
> sizer_2.Add(sizer_3, 0, wx.ALL, 1)
>
> label_2 = wx.StaticText(self.InputPanel, wx.ID_ANY, u"الفئة: ")
> label_2.SetFont(wx.Font(10, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
> sizer_3.Add(label_2, 0, wx.ALL, 4)
>
> label_3 = wx.StaticText(self.InputPanel, wx.ID_ANY, u"العبارة: ")
> label_3.SetFont(wx.Font(10, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
> sizer_3.Add(label_3, 0, wx.ALL, 4)
>
> label_4 = wx.StaticText(self.InputPanel, wx.ID_ANY, u"الكلمات الرئيسية: ")
> label_4.SetFont(wx.Font(10, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
> sizer_3.Add(label_4, 0, wx.ALL, 5)
>
> label_5 = wx.StaticText(self.InputPanel, wx.ID_ANY, u"سياق / شرح: ")
> label_5.SetFont(wx.Font(10, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
> sizer_3.Add(label_5, 0, wx.ALL, 4)
>
> label_6 = wx.StaticText(self.InputPanel, wx.ID_ANY, u"ترجمة: ")
> label_6.SetFont(wx.Font(10, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
> sizer_3.Add(label_6, 0, wx.ALL, 5)
>
> self.theCommit = wx.Button(self.InputPanel, wx.ID_ANY, u"حفظ البيانات")
> self.theCommit.SetFont(wx.Font(10, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
> sizer_1.Add(self.theCommit, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 1)
> self.theCommit.Bind(wx.EVT_BUTTON, storeData(self.theClassesSet, self.thePhrase, self.theKeywordsSet,
> self.theContext, self.theTranslation))
>
> self.DisplayPanel = wx.Panel(self.window_1, wx.ID_ANY)
>
> sizer_5 = wx.BoxSizer(wx.VERTICAL)
>
> label_7 = wx.StaticText(self.DisplayPanel, wx.ID_ANY, u"إظهار البيانات")
> label_7.SetFont(wx.Font(18, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, ""))
> sizer_5.Add(label_7, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 2)
>
> sizer_6 = wx.BoxSizer(wx.HORIZONTAL)
> sizer_5.Add(sizer_6, 1, wx.EXPAND, 0)
>
> sizer_8 = wx.BoxSizer(wx.VERTICAL)
> sizer_6.Add(sizer_8, 1, wx.EXPAND, 0)
>
> self.theClassesGet = wx.ComboBox(self.DisplayPanel, wx.ID_ANY, choices=[u"تعبير دارج", u"تعبير خاصّ", u"غريبة نحوية", u"صعوبة ترجمة"],
> style=wx.CB_READONLY)
> sizer_8.Add(self.theClassesGet, 0, wx.ALIGN_RIGHT | wx.ALL, 1)
>
> self.theKeywordsGet = wx.TextCtrl(self.DisplayPanel, wx.ID_ANY, "")
> sizer_8.Add(self.theKeywordsGet, 0, wx.ALL | wx.EXPAND, 1)
>
> sizer_7 = wx.BoxSizer(wx.VERTICAL)
> sizer_6.Add(sizer_7, 0, wx.ALL, 1)
>
> label_8 = wx.StaticText(self.DisplayPanel, wx.ID_ANY, u"الفئة: ")
> label_8.SetFont(wx.Font(10, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
> sizer_7.Add(label_8, 0, wx.ALL, 4)
>
> label_9 = wx.StaticText(self.DisplayPanel, wx.ID_ANY, u"الكلمات الرئيسية: ")
> label_9.SetFont(wx.Font(10, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
> sizer_7.Add(label_9, 0, wx.ALL, 5)
>
> self.theRetrieve = wx.Button(self.DisplayPanel, wx.ID_ANY, u"استرجاع البيانات")
> self.theRetrieve.SetFont(wx.Font(10, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
> sizer_5.Add(self.theRetrieve, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 1)
>
> self.theData = wx.grid.Grid(self.DisplayPanel, wx.ID_ANY)
> self.theData.SetLayoutDirection(wx.Layout_RightToLeft)
> self.theData.CreateGrid(10, 0)
> sizer_5.Add(self.theData, 1, wx.EXPAND, 0)
>
> self.DisplayPanel.SetSizer(sizer_5)
>
> self.InputPanel.SetSizer(sizer_1)
>
> self.window_1.SplitHorizontally(self.InputPanel, self.DisplayPanel)
>
> self.Layout()
> self.Centre()
> # end wxGlade
>
> # end of class MyFrame
>
> class MyApp(wx.App):
> def OnInit(self):
> self.frame = MyFrame(None, wx.ID_ANY, "")
> self.SetTopWindow(self.frame)
> self.frame.Show()
> return True
>
> # end of class MyApp
>
> if __name__ == "__main__":
> app = MyApp(0)
> app.MainLoop()
'''