OCR en imágenes funciona.

This commit is contained in:
Jesús Pavón Abián
2026-02-01 19:49:49 +01:00
parent c275ed9cf8
commit 8402bc6d82
8 changed files with 473 additions and 45 deletions
+5 -5
View File
@@ -49,8 +49,8 @@ class HomePanel(wx.Panel):
# But for now, simple list is what the previous code had.
def set_focus_function(self, func):
self.list.list.Bind(wx.EVT_SET_FOCUS, func)
self.list.list.Bind(wx.EVT_LIST_ITEM_FOCUSED, func)
def set_position(self, reverse):
if reverse:
self.list.select_item(0)
@@ -93,8 +93,8 @@ class UserPanel(wx.Panel):
self.SetSizer(self.sizer)
def set_focus_function(self, func):
self.list.list.Bind(wx.EVT_SET_FOCUS, func)
self.list.list.Bind(wx.EVT_LIST_ITEM_FOCUSED, func)
def set_position(self, reverse):
if reverse:
self.list.select_item(0)
@@ -124,7 +124,7 @@ class ChatPanel(wx.Panel):
self.SetSizer(self.sizer)
def set_focus_function(self, func):
self.list.list.Bind(wx.EVT_SET_FOCUS, func)
self.list.list.Bind(wx.EVT_LIST_ITEM_FOCUSED, func)
def set_focus_in_list(self):
self.list.list.SetFocus()
+25
View File
@@ -203,3 +203,28 @@ class viewPost(wx.Dialog):
if hasattr(self, buttonName):
return getattr(self, buttonName).Enable()
class viewText(wx.Dialog):
def __init__(self, title="", text="", *args, **kwargs):
super(viewText, self).__init__(parent=None, id=wx.ID_ANY, size=(850, 850), title=title)
panel = wx.Panel(self)
label = wx.StaticText(panel, -1, _("Text"))
self.text = wx.TextCtrl(panel, -1, text, style=wx.TE_READONLY | wx.TE_MULTILINE, size=(250, 180))
self.text.SetFocus()
textBox = wx.BoxSizer(wx.HORIZONTAL)
textBox.Add(label, 0, wx.ALL, 5)
textBox.Add(self.text, 1, wx.EXPAND, 5)
mainBox = wx.BoxSizer(wx.VERTICAL)
mainBox.Add(textBox, 0, wx.ALL, 5)
self.spellcheck = wx.Button(panel, -1, _("Check &spelling..."), size=wx.DefaultSize)
self.translateButton = wx.Button(panel, -1, _("&Translate..."), size=wx.DefaultSize)
cancelButton = wx.Button(panel, wx.ID_CANCEL, _("C&lose"), size=wx.DefaultSize)
cancelButton.SetDefault()
buttonsBox = wx.BoxSizer(wx.HORIZONTAL)
buttonsBox.Add(self.spellcheck, 0, wx.ALL, 5)
buttonsBox.Add(self.translateButton, 0, wx.ALL, 5)
buttonsBox.Add(cancelButton, 0, wx.ALL, 5)
mainBox.Add(buttonsBox, 0, wx.ALL, 5)
panel.SetSizer(mainBox)
self.SetClientSize(mainBox.CalcMin())