mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-01-19 00:40:42 -06:00
Add find dialog to WX UI.
This commit is contained in:
parent
3f82dc387e
commit
54a3805626
26
src/wxUI/dialogs/find.py
Normal file
26
src/wxUI/dialogs/find.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import baseDialog
|
||||||
|
import wx
|
||||||
|
|
||||||
|
class findDialog(baseDialog.BaseWXDialog):
|
||||||
|
def __init__(self, value=""):
|
||||||
|
super(findDialog, self).__init__(None, -1)
|
||||||
|
panel = wx.Panel(self)
|
||||||
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
|
self.SetTitle(_(u"Find in current buffer"))
|
||||||
|
label = wx.StaticText(panel, -1, _(u"String"))
|
||||||
|
self.string = wx.TextCtrl(panel, -1, value)
|
||||||
|
dc = wx.WindowDC(self.string)
|
||||||
|
dc.SetFont(self.string.GetFont())
|
||||||
|
self.string.SetSize(dc.GetTextExtent("0"*40))
|
||||||
|
sizer.Add(label, 0, wx.ALL, 5)
|
||||||
|
sizer.Add(self.string, 0, wx.ALL, 5)
|
||||||
|
ok = wx.Button(panel, wx.ID_OK, _(u"OK"))
|
||||||
|
ok.SetDefault()
|
||||||
|
cancel = wx.Button(panel, wx.ID_CANCEL, _(u"Cancel"))
|
||||||
|
btnsizer = wx.BoxSizer()
|
||||||
|
btnsizer.Add(ok, 0, wx.ALL, 5)
|
||||||
|
btnsizer.Add(cancel, 0, wx.ALL, 5)
|
||||||
|
sizer.Add(btnsizer, 0, wx.ALL, 5)
|
||||||
|
panel.SetSizer(sizer)
|
||||||
|
self.SetClientSize(sizer.CalcMin())
|
Loading…
x
Reference in New Issue
Block a user