neingeist
/
smstool
Archived
1
0
Fork 0
master
neingeist 20 years ago
parent 8936fce2f3
commit c1faae9272

@ -1,4 +1,7 @@
from wxPython.wx import * from wxPython.wx import *
from os import system
SMSLEN = 160
class SmsToolFrame(wxFrame): class SmsToolFrame(wxFrame):
def __init__(self, parent, id, title): def __init__(self, parent, id, title):
@ -12,7 +15,8 @@ class SmsToolFrame(wxFrame):
wxDLG_PNT(panel, wxPoint(4, 4)), wxDefaultSize) wxDLG_PNT(panel, wxPoint(4, 4)), wxDefaultSize)
wxStaticText(panel, -1, "Nummer:", wxStaticText(panel, -1, "Nummer:",
wxDLG_PNT(panel, wxPoint(4, 20)), wxDefaultSize) wxDLG_PNT(panel, wxPoint(4, 20)), wxDefaultSize)
self.textCtrl = wxTextCtrl(panel, -1, "",
self.textCtrl = wxTextCtrl(panel, 20, "",
wxDLG_PNT(panel, wxPoint(30, 4)), wxDLG_PNT(panel, wxPoint(30, 4)),
wxDLG_SZE(panel, wxSize(160, -1))) wxDLG_SZE(panel, wxSize(160, -1)))
@ -25,11 +29,27 @@ class SmsToolFrame(wxFrame):
wxDLG_SZE(panel, wxSize(30, -1))) wxDLG_SZE(panel, wxSize(30, -1)))
EVT_BUTTON(self, 10, self.OnFooClick) EVT_BUTTON(self, 10, self.OnFooClick)
self.zaehler = wxStaticText(panel, -1, str(SMSLEN),
wxDLG_PNT(panel, wxPoint(110, 20)), wxDefaultSize)
EVT_TEXT(self, 20, self.OnChange)
def OnCloseWindow(self, event): def OnCloseWindow(self, event):
self.Destroy() self.Destroy()
def OnFooClick(self, event): def OnFooClick(self, event):
self.Destroy() text = self.textCtrl.GetValue()
nr = self.nrCtrl.GetValue()
foo = system("echo '" + text + "' | cat")
self.foodialog = wxMessageDialog(self.panel,
text + str(foo) + nr,
"foo", wxOK, wxPoint(100, 100))
self.foodialog.Show(true)
def OnChange(self, event):
self.zaehler.SetLabel(str(SMSLEN-len(self.textCtrl.GetValue())))
class SmsTool(wxApp): class SmsTool(wxApp):
def OnInit(self): def OnInit(self):
@ -40,4 +60,3 @@ class SmsTool(wxApp):
smstool=SmsTool(0) smstool=SmsTool(0)
smstool.MainLoop() smstool.MainLoop()