home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 February / maximum-cd-2011-02.iso / DiscContents / digsby_setup85.exe / lib / gui / uberwidgets / formattedinput2 / test.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-11-24  |  2.0 KB  |  45 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4. import sys
  5. sys.path.append('C:\\Users\\Aaron\\workspace\\DigsbyTrunk\\digsby')
  6. from ctypes import windll
  7. windll.comctl32.InitCommonControls()
  8. import wx
  9. from tests.testapp import testapp
  10. from win32events import bindwin32
  11. from gui.uberwidgets.formattedinput2.FormattedExpandoTextCtrl import FormattedExpandoTextCtrl
  12. FormattedExpandoTextCtrl.BindWin32 = bindwin32
  13. from gui.uberwidgets.formattedinput2.fontutil import FontFromFacename
  14. from cgui import EVT_ETC_LAYOUT_NEEDED
  15.  
  16. def _(text):
  17.     return text
  18.  
  19. __builtins__._ = _
  20. from gui.uberwidgets.formattedinput2.formattedinput import FormattedInput
  21.  
  22. def NewInput():
  23.     f = wx.Frame(None)
  24.     f.Sizer = wx.BoxSizer(wx.VERTICAL)
  25.     font = FontFromFacename('Arial')
  26.     font.SetPointSize(10)
  27.     textattr = wx.TextAttr(wx.BLACK, wx.WHITE, font)
  28.     i = FormattedInput(f, multiFormat = True)
  29.     
  30.     def OnExpandEvent(event):
  31.         height = None if i.FormattingBarIsShown() else 0 + i.tc.MinSize.height
  32.         i.MinSize = wx.Size(-1, height)
  33.         f.Fit()
  34.  
  35.     i.Bind(EVT_ETC_LAYOUT_NEEDED, OnExpandEvent)
  36.     f.Sizer.Add(i, 0, wx.EXPAND)
  37.     f.Show()
  38.     f.Fit()
  39.  
  40. if __name__ == '__main__':
  41.     app = testapp(plugins = False)
  42.     NewInput()
  43.     app.MainLoop()
  44.  
  45.