def __init__(self, parent, group): self.group = group isNoGroup = group == parent.L["GROUP_NONE"] super().__init__(parent, size=wx.Size(-1, 20), tag=group, func=None if isNoGroup else self.ShowNameChange, edge="D") # DialogFrame - Main - Outer - Inner - Title self.Main = parent.GetGrandParent() if not isNoGroup: self.Text = UI.Text(self, style=wx.TE_CENTER | wx.SIMPLE_BORDER | wx.TE_PROCESS_ENTER) self.Text.SetMaxLength(24) self.Text.Hide() self.Text.Bind(wx.EVT_KILL_FOCUS, self.OnTextLost) self.Text.Bind(wx.EVT_TEXT_ENTER, self.OnTextEnter) Sizer = wx.BoxSizer(wx.HORIZONTAL) Sizer.Add( UI.ToolNormal(self, size=wx.Size(20, 20), pics=self.R["AP_TRIANGLE_U"], func=(self.OnMove, "U"), edge=("", "LTB"))) Sizer.Add(self.Text, 1, wx.EXPAND) Sizer.Add(0, 0, 1) Sizer.Add( UI.ToolNormal(self, size=wx.Size(20, 20), pics=self.R["AP_TRIANGLE_D"], func=(self.OnMove, "D"), edge=("", "RTB"))) self.SetSizer(Sizer)
def __init__(self, parent, tag, pic, func): super().__init__(parent=parent, size=(-1, 20), tag=(tag, "L", 20), pic=(pic, "L"), func=func, fg="B", edge="D", res="R") Sizer = wx.BoxSizer(wx.HORIZONTAL) Sizer.AddMany(( (4, 4, 1), (UI.ToolNormal(self, size=SIZE_BTN, pics=self.R["DIALOG_DTCH"], edge=("", "TB"), func=func[1].Detach)), (UI.ToolNormal(self, size=SIZE_BTN, pics=self.R["DIALOG_LOCA"], edge=("", "TB"), func=func[1].Locate)), (UI.ToolNormal(self, size=SIZE_BTN, pics=self.R["AP_EXIT"], edge=("", "RTB"), func=func[1].OnClose, res="R")) )) self.SetSizer(Sizer)
def __init__(self, parent, help): super().__init__(parent, buttons=False) size = UI.SETTINGS["DLG_HEAD_BTN"] Sizer = self.GetSizer() Sizer.Insert(1, UI.ToolNormal(self, size=size, pics=self.R["DIALOG_LOCA"], func=self.Frame.Main.Locate), self.SizerFlags) Sizer.Insert(1, UI.ToolNormal(self, size=size, pics=self.R["DIALOG_ATCH"], func=self.Frame.Main.Attach), self.SizerFlags) if help: Sizer.Insert(0, UI.ToolNormal(self, size=size, pics=self.R["AP_HELP"], func=(self.GetGrandParent().OnSimpleDialog, "GENERAL_HEAD_HELP", help)), self.SizerFlags) Sizer.Insert(0, 3, 0) self.SetTagOffset(self.TagOffset[0] + size[0], self.TagOffset[1])
def __init__(self, parent): super().__init__(parent=parent, title=parent.L["MANAGE_TITLE"], size=wx.Size(720, 480), main=Main, style=wx.FRAME_NO_TASKBAR) self.Head.GetSizer().Insert( 0, UI.ToolNormal(self.Head, size=UI.SETTINGS["DLG_HEAD_BTN"], pics=self.R["AP_HELP"], func=(parent.OnSimpleDialog, "MANAGE_HELP_HEAD", "MANAGE_HELP_TEXT")), 0, wx.ALL, 3) self.Head.SetTagOffset(24, 0) self.Center() self.Layout() self.Play("FADEIN")
def AddStdButton(self, sizer): size = wx.Size(40, self.LINE_HEIGHT) self[0] = UI.ToolNormal(self, size=size, pics=self.R["AP_CROSS"], edge="D", func=self.OnClose) if self.Widget.THREAD: self[3] = UI.ToolNormal(self, size=size, pics=self.R["AP_BEGIN"], edge="D", func=self.OnBegin) self[4] = UI.ToolNormal(self, size=size, pics=self.R["AP_ABORT"], edge="D", func=self.OnAbort) elif self.TASK: self[3] = UI.ToolNormal(self, size=size, pics=self.R["AP_BEGIN"], edge="D", func=self.OnBegin) else: self[1] = UI.ToolNormal(self, size=size, pics=self.R["AP_CHECK"], edge="D", func=self.OnReady) if self.Widget.INTERNAL or self.Widget.INCOMING: self[2] = UI.ToolNormal(self, size=size, pics=self.R["AP_APPLY"], edge="D", func=self.OnApply) if sizer.GetOrientation() == wx.HORIZONTAL: subSizer = sizer sizer.Add(4, 4, 1) else: subSizer = self.AddPerpendicularSizer(sizer, 0, wx.ALIGN_RIGHT | wx.ALL, 0) for i in (3, 4, 1, 0, 2): if i in self: subSizer.Add(self[i], 0, wx.ALL, self.MARGIN)
def __init__(self, parent): super().__init__(parent, edge=None) self.F = parent.GetParent() # MainFrame -> BaseDialog -> Main self.AddScrollBar((0, 12)) SizerLeft = wx.BoxSizer(wx.VERTICAL) self.Installed = UI.ListCtrl(self, data=(), width=(-1, )) SizerLeft.AddMany(( (self.Installed, 1, wx.EXPAND | wx.ALL, 4), (UI.ToolNormal(self, size=SIZE_B, pics=(self.R["AP_CLOUD"], "L", 8), tag=(self.L["MANAGE_PKG_REMOTE"], "L", 32), edge="D", func=self.OnRemote, showTag=True), SF_S), (UI.ToolNormal(self, size=SIZE_B, pics=(self.R["AP_LOCAL"], "L", 8), tag=(self.L["MANAGE_PKG_BROWSE"], "L", 32), edge="D", func=self.OnBrowse, showTag=True), SF_S), (UI.ToolNormal(self, size=SIZE_B, pics=(self.R["AP_TRASH"], "L", 8), tag=(self.L["MANAGE_PKG_REMOVE"], "L", 32), edge="D", func=self.OnRemove, showTag=True), SF_S), )) SizerButton = wx.BoxSizer(wx.HORIZONTAL) SizerButton.AddMany( ((UI.ToolNormal(self, size=SIZE_S, pics=(self.R["AP_RESET"], "L", 8), tag=(self.L["GENERAL_RESET"], "L", 32), edge="D", func=self.OnReset, showTag=True), SF_B), (UI.ToolNormal(self, size=SIZE_S, pics=(self.R["AP_CROSS"], "L", 8), tag=(self.L["GENERAL_CLOSE"], "L", 32), edge="D", func=self.OnClose, showTag=True), SF_B), (UI.ToolNormal(self, size=SIZE_S, pics=(self.R["AP_CHECK"], "L", 8), tag=(self.L["GENERAL_READY"], "L", 32), edge="D", func=self.OnReady, showTag=True), SF_B), (UI.ToolNormal(self, size=SIZE_S, pics=(self.R["AP_APPLY"], "L", 8), tag=(self.L["GENERAL_APPLY"], "L", 32), edge="D", func=self.OnApply, showTag=True), SF_B))) SizerRight = wx.BoxSizer(wx.VERTICAL) self.Outer = wx.Panel(self) self.Inner = wx.Panel(self.Outer, pos=(0, 0)) self.Inner.R = self.R self.Inner.S = self.S self.Inner.L = self.L InnerSizer = wx.BoxSizer(wx.VERTICAL) self.Inner.SetSizer(InnerSizer) SizerRight.Add(self.Outer, 1, wx.EXPAND) SizerRight.Add(SizerButton, 0, wx.EXPAND | wx.ALL, 2) Sizer = wx.BoxSizer(wx.HORIZONTAL) Sizer.Add(SizerLeft, 0, wx.EXPAND | wx.ALL, 4) Sizer.Add(UI.Separator(self), 0, wx.EXPAND | wx.ALL, 8) Sizer.Add(SizerRight, 1, wx.EXPAND | wx.ALL, 4) Sizer.Add(UI.SETTINGS["SCROLL_DIAMETER"], 4) self.SetSizer(Sizer) self.newGroupIndex = 1 self["NEW"] = None self.Groups = {} self.UpdatePackageList() self.AddItems(self.F.M.Groups)