Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions construct_editor/wx_widgets/wx_construct_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def GetMode(self) -> int:
# this always works.)

dvc: "dv.DataViewCtrl" = self.GetView()
editor: "WxConstructEditor" = dvc.GetParent()
editor = t.cast("WxConstructEditor", dvc.GetParent())
selected_entry = editor.get_selected_entry()
if selected_entry is None:
mode = dv.DATAVIEW_CELL_INERT
Expand Down Expand Up @@ -126,8 +126,8 @@ def CreateEditorCtrl(
) -> WxObjEditor:
view_settings = value.obj_view_settings
editor: WxObjEditor = create_obj_editor(parent, view_settings)
editor.SetPosition(labelRect.Position)
editor.SetSize(labelRect.Size)
editor.SetPosition(labelRect.GetPosition())
editor.SetSize(labelRect.GetSize())
return editor

def GetValueFromEditorCtrl(self, editor: WxObjEditor):
Expand Down
8 changes: 4 additions & 4 deletions construct_editor/wx_widgets/wx_hex_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def __init__(self, editor: "WxHexEditor", binary_data: HexEditorBinaryData):

self._attr_default = Grid.GridCellAttr()
self._attr_default.SetFont(self.font)
self._attr_default.SetBackgroundColour("white")
self._attr_default.SetBackgroundColour(wx.WHITE)

self._attr_selected = Grid.GridCellAttr()
self._attr_selected.SetFont(self.font)
Expand Down Expand Up @@ -381,7 +381,7 @@ def on_key_down(self, evt):
key = evt.GetKeyCode()

if key == wx.WXK_BACK or key == wx.WXK_DELETE:
self.SetValue(self.startValue)
self.SetValue(self.startValue or "")
self.Clear()

if key == wx.WXK_TAB:
Expand All @@ -394,7 +394,7 @@ def on_key_down(self, evt):
or key == wx.WXK_LEFT
or key == wx.WXK_RIGHT
):
self.SetValue(self.startValue)
self.SetValue(self.startValue or "")
wx.CallAfter(self.parentgrid._abort_edit)
return
elif self.mode == "hex":
Expand Down Expand Up @@ -1315,7 +1315,7 @@ class MyFrame(wx.Frame):
"""We simply derive a new class of Frame."""

def __init__(self, parent, title):
wx.Frame.__init__(self, parent, title=title, size=(420, 800))
wx.Frame.__init__(self, parent, title=title, size=wx.Size(420, 800))

# Create an instance of our model...
self.hex_editor = WxHexEditor(self)
Expand Down
10 changes: 5 additions & 5 deletions construct_editor/wx_widgets/wx_obj_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
# Value Editors
# #####################################################################################################################
class WxObjEditor_Default(wx.TextCtrl):
def __init__(self, parent, settings: ObjViewSettings):
def __init__(self, parent: wx.Window, settings: ObjViewSettings):
self.entry = settings.entry

super(wx.TextCtrl, self).__init__(
super().__init__(
parent,
wx.ID_ANY,
self.entry.obj_str,
Expand All @@ -48,7 +48,7 @@ class WxObjEditor_String(wx.TextCtrl):
def __init__(self, parent, settings: ObjViewSettings_String):
self.entry = settings.entry

super(wx.TextCtrl, self).__init__(
super().__init__(
parent,
wx.ID_ANY,
self.entry.obj_str,
Expand All @@ -66,7 +66,7 @@ class WxObjEditor_Integer(wx.TextCtrl):
def __init__(self, parent, settings: ObjViewSettings_Integer):
self.entry = settings.entry

super(wx.TextCtrl, self).__init__(
super().__init__(
parent,
wx.ID_ANY,
self.entry.obj_str,
Expand All @@ -91,7 +91,7 @@ class WxObjEditor_Bytes(wx.TextCtrl):
def __init__(self, parent, settings: ObjViewSettings_Bytes):
self.entry = settings.entry

super(wx.TextCtrl, self).__init__(
super().__init__(
parent,
wx.ID_ANY,
settings.entry.obj_str,
Expand Down
2 changes: 1 addition & 1 deletion construct_editor/wx_widgets/wx_python_code_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def SetUpEditor(self):
# Caret color
self.SetCaretForeground("BLUE")
# Selection background
self.SetSelBackground(1, "#66CCFF")
self.SetSelBackground(True, "#66CCFF")

# Attempt to set caret blink rate.
try:
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ construct-editor = "construct_editor.main:main"

[dependency-groups]
dev = [
"poethepoet>=0.46.0",
"pyright>=1.1.410",
"ruff>=0.15.16",
"ty>=0.0.46",
"poethepoet>=0.47.1",
"pyright>=1.1.411",
"ruff>=0.15.20",
"ty>=0.0.56",
"cryptography", # optional "extra" from construct that the user may or may not have installed
"cloudpickle", # optional "extra" from construct that the user may or may not have installed
"lz4", # optional "extra" from construct that the user may or may not have installed
Expand Down Expand Up @@ -103,7 +103,6 @@ exclude = [
# Valid values: "error", "warning", "information", "none"
reportArgumentType = "none"
reportAttributeAccessIssue = "none"
reportGeneralTypeIssues = "none"
reportIncompatibleMethodOverride = "none"
reportInvalidTypeArguments = "none"
reportMissingParameterType = "none"
Expand Down Expand Up @@ -137,6 +136,7 @@ exclude = [
# These warnings should be activated as "error" in the future, but for now we don't want to refactor the entire codebase right now.
# Valid values: "error", "warn", "ignore"
[tool.ty.rules]
invalid-argument-type = "ignore"
invalid-assignment = "ignore"
invalid-method-override = "ignore"
invalid-type-arguments = "ignore"
Expand Down
Loading