コード例 #1
0
    def __init__(self, canvas: "EditCanvas"):
        wx.BoxSizer.__init__(self, wx.VERTICAL)
        CameraToolUI.__init__(self, canvas)

        self._selection = StaticSelectionBehaviour(self.canvas)

        self._open_file_button = wx.Button(canvas, label="Import File")
        self._open_file_button.Bind(wx.EVT_BUTTON, self._on_open_file)
        self.AddStretchSpacer()
        self.Add(self._open_file_button, flag=wx.ALL, border=10)
        self.AddStretchSpacer()
コード例 #2
0
    def __init__(self, canvas: "EditCanvas"):
        wx.BoxSizer.__init__(self, wx.HORIZONTAL)
        CameraToolUI.__init__(self, canvas)

        self._selection = StaticSelectionBehaviour(self.canvas)

        self._button_panel = wx.Panel(canvas)
        self._button_sizer = wx.BoxSizer(wx.VERTICAL)
        self._button_panel.SetSizer(self._button_sizer)
        paste_button = wx.Button(self._button_panel, label="Paste")
        self._button_sizer.Add(paste_button, 0, wx.ALL | wx.EXPAND, 5)
        paste_button.Bind(wx.EVT_BUTTON,
                          lambda evt: self.canvas.paste_from_cache())
        self.Add(self._button_panel, 0, wx.ALIGN_CENTER_VERTICAL)

        self._paste_panel: Optional[SelectTransformUI] = None
        self.Layout()
コード例 #3
0
ファイル: chunk.py プロジェクト: cpaika/Amulet-Map-Editor
    def __init__(self, canvas: "EditCanvas"):
        wx.BoxSizer.__init__(self, wx.HORIZONTAL)
        CameraToolUI.__init__(self, canvas)

        self._selection = ChunkSelectionBehaviour(self.canvas)

        self._button_panel = wx.Panel(canvas)
        button_sizer = wx.BoxSizer(wx.VERTICAL)
        self._button_panel.SetSizer(button_sizer)

        delete_button = wx.Button(self._button_panel, label="Delete Chunks")
        button_sizer.Add(delete_button, 0, wx.ALL | wx.EXPAND, 5)
        delete_button.Bind(wx.EVT_BUTTON, self._delete_chunks)

        prune_button = wx.Button(self._button_panel, label="Prune Chunks")
        button_sizer.Add(prune_button, 0, wx.ALL | wx.EXPAND, 5)
        prune_button.Bind(wx.EVT_BUTTON, self._prune_chunks)

        self.Add(self._button_panel, 0, wx.ALIGN_CENTER_VERTICAL)
コード例 #4
0
    def __init__(self, canvas: "EditCanvas"):
        wx.BoxSizer.__init__(self, wx.HORIZONTAL)
        CameraToolUI.__init__(self, canvas)

        self._selection = StaticSelectionBehaviour(self.canvas)
        self._cursor = PointerBehaviour(self.canvas)
        self._moving = False

        self._button_panel = wx.Panel(canvas)
        self._button_sizer = wx.BoxSizer(wx.VERTICAL)
        self._button_panel.SetSizer(self._button_sizer)
        self.Add(self._button_panel, 0, wx.ALIGN_CENTER_VERTICAL)

        self._paste_panel = SelectTransformUI(self._button_panel)
        self._paste_panel.Bind(EVT_TRANSFORM_CHANGE, self._on_transform_change)
        self._button_sizer.Add(self._paste_panel, 0, wx.EXPAND)

        confirm_button = wx.Button(self._button_panel, label="Confirm")
        self._button_sizer.Add(confirm_button, 0, wx.ALL | wx.EXPAND, 5)
        confirm_button.Bind(wx.EVT_BUTTON, self._paste_confirm)

        self._button_panel.Disable()
        self.Layout()
コード例 #5
0
    def __init__(self, canvas: "EditCanvas"):
        wx.BoxSizer.__init__(self, wx.HORIZONTAL)
        CameraToolUI.__init__(self, canvas)

        self._selection = BlockSelectionBehaviour(self.canvas)
        self._inspect_block = InspectBlockBehaviour(self.canvas,
                                                    self._selection)

        self._button_panel = wx.Panel(canvas)
        button_sizer = wx.BoxSizer(wx.VERTICAL)
        self._button_panel.SetSizer(button_sizer)
        delete_button = wx.Button(self._button_panel, label="Delete")
        button_sizer.Add(delete_button, 0, wx.ALL | wx.EXPAND, 5)
        delete_button.Bind(wx.EVT_BUTTON, lambda evt: self.canvas.delete())
        copy_button = wx.Button(self._button_panel, label="Copy")
        button_sizer.Add(copy_button, 0, wx.ALL | wx.EXPAND, 5)
        copy_button.Bind(wx.EVT_BUTTON, lambda evt: self.canvas.copy())
        cut_button = wx.Button(self._button_panel, label="Cut")
        button_sizer.Add(cut_button, 0, wx.ALL | wx.EXPAND, 5)
        cut_button.Bind(wx.EVT_BUTTON, lambda evt: self.canvas.cut())
        paste_button = wx.Button(self._button_panel, label="Paste")
        button_sizer.Add(paste_button, 0, wx.ALL | wx.EXPAND, 5)
        paste_button.Bind(wx.EVT_BUTTON,
                          lambda evt: self.canvas.paste_from_cache())
        self.Add(self._button_panel, 0, wx.ALIGN_CENTER_VERTICAL)

        self._x1: wx.SpinCtrl = self._add_row("x1",
                                              wx.SpinCtrl,
                                              min=-30000000,
                                              max=30000000)
        self._y1: wx.SpinCtrl = self._add_row("y1",
                                              wx.SpinCtrl,
                                              min=-30000000,
                                              max=30000000)
        self._z1: wx.SpinCtrl = self._add_row("z1",
                                              wx.SpinCtrl,
                                              min=-30000000,
                                              max=30000000)
        self._x1.Bind(wx.EVT_SPINCTRL, self._box_input_change)
        self._y1.Bind(wx.EVT_SPINCTRL, self._box_input_change)
        self._z1.Bind(wx.EVT_SPINCTRL, self._box_input_change)
        self._x1.SetValidator(IntValidator())
        self._y1.SetValidator(IntValidator())
        self._z1.SetValidator(IntValidator())

        self._x2: wx.SpinCtrl = self._add_row("x2",
                                              wx.SpinCtrl,
                                              min=-30000000,
                                              max=30000000)
        self._y2: wx.SpinCtrl = self._add_row("y2",
                                              wx.SpinCtrl,
                                              min=-30000000,
                                              max=30000000)
        self._z2: wx.SpinCtrl = self._add_row("z2",
                                              wx.SpinCtrl,
                                              min=-30000000,
                                              max=30000000)
        self._x2.Bind(wx.EVT_SPINCTRL, self._box_input_change)
        self._y2.Bind(wx.EVT_SPINCTRL, self._box_input_change)
        self._z2.Bind(wx.EVT_SPINCTRL, self._box_input_change)
        self._x2.SetValidator(IntValidator())
        self._y2.SetValidator(IntValidator())
        self._z2.SetValidator(IntValidator())

        self._x1.Disable()
        self._y1.Disable()
        self._z1.Disable()
        self._x2.Disable()
        self._y2.Disable()
        self._z2.Disable()

        self._x1.SetBackgroundColour((160, 215, 145))
        self._y1.SetBackgroundColour((160, 215, 145))
        self._z1.SetBackgroundColour((160, 215, 145))

        self._x2.SetBackgroundColour((150, 150, 215))
        self._y2.SetBackgroundColour((150, 150, 215))
        self._z2.SetBackgroundColour((150, 150, 215))