Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- """NOLCtest 1.0
- by nucular
- A little wxPython example for the NOLC module.
- This is my first wx GUI application in Python, so...
- Have fun.
- This code is published under the Public Domain!
- """
- import wx, sys
- __version__ = "1.0"
- app = wx.PySimpleApp(True,None,True,True)
- frame = wx.Frame(None, title='NOLCtest ' + __version__, size=(418, 180))
- try:
- import nolc
- except:
- dlg = wx.MessageDialog(frame, 'You need NOLC to run this program. Get it on http://www.pastebin.com/UWCZgC50',
- 'You need NOLC',
- wx.OK | wx.ICON_INFORMATION
- )
- dlg.ShowModal()
- dlg.Destroy()
- sys.exit()
- def leetfunc(self):
- t2.SetValue(nolc.leet(t1.GetValue()))
- def leet2func(self):
- t2.SetValue(nolc.leet2(t1.GetValue()))
- def greekfunc(self):
- t2.SetValue(nolc.greek(t1.GetValue()))
- def flipfunc(self):
- t2.SetValue(nolc.flip(t1.GetValue()))
- def updownfunc(self):
- t2.SetValue(nolc.updown(t1.GetValue()))
- def messfunc(self):
- t2.SetValue(nolc.mess(t1.GetValue()))
- def morsefunc(self):
- t2.SetValue(nolc.morse(t1.GetValue()))
- t1 = wx.TextCtrl(frame, -1, "Enter your input text here", size=(200, 100), style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER, pos=(0, 0))
- t2 = wx.TextCtrl(frame, -1, "Get your output text here", size=(200, 100), style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER|wx.TE_READONLY, pos=(201,0))
- leet = wx.Button(frame, -1, u"1337", size=(80,20), pos=(0, 101))
- leet.SetToolTipString("Leet your text")
- leet2 = wx.Button(frame, -1, u"£ēē†", size=(80,20), pos=(80, 101))
- leet2.SetToolTipString("Leet2 your text")
- greek = wx.Button(frame, -1, u"Gяεεκ", size=(80,20), pos=(160, 101))
- greek.SetToolTipString("Make your text looking greek")
- flip = wx.Button(frame, -1, u"dılɟ", size=(80,20), pos=(240, 101))
- flip.SetToolTipString("Flip it upside down")
- updown = wx.Button(frame, -1, u"UpDoWn", size=(80,20), pos=(320, 101))
- updown.SetToolTipString("Do it camelcased")
- mess = wx.Button(frame, -1, u"Mses", size=(80,20), pos=(0, 121))
- mess.SetToolTipString("Mess all mid chars of the words")
- morse = wx.Button(frame, -1, u"-- --- ·-· ··· ·", size=(80,20), pos=(80, 121))
- morse.SetToolTipString("Translate it to morse code")
- wx.StaticText(frame, -1, "NOLCtest " + ver + " by nucular. Public Domain.", (200, 124))
- frame.Bind(wx.EVT_BUTTON, leetfunc, leet)
- frame.Bind(wx.EVT_BUTTON, leet2func, leet2)
- frame.Bind(wx.EVT_BUTTON, greekfunc, greek)
- frame.Bind(wx.EVT_BUTTON, flipfunc, flip)
- frame.Bind(wx.EVT_BUTTON, updownfunc, updown)
- frame.Bind(wx.EVT_BUTTON, messfunc, mess)
- frame.Bind(wx.EVT_BUTTON, morsefunc, morse)
- frame.Show()
- app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement