def __init__(self, parent, title, msg, **kwargs): ShapedWindow.__init__(self, rorSettings().mainApp, skinOnlyFilename="scrolledtext.png", title=title, **kwargs) self.parent = parent grid = self.grid grid.SetEmptyCellSize(wx.Size(110, 3)) r = 1 c = 1 self.mainLabel = wx.StaticText(self, -1, "", size=wx.Size(0, 20), style=wx.TRANSPARENT_WINDOW | wx.ST_NO_AUTORESIZE) self.mainLabel.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD)) grid.Add(self.mainLabel, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) r = 2 c = 1 self.text = wx.TextCtrl(self, -1, msg, size=wx.Size(360, 320), style=wx.TE_MULTILINE | wx.HSCROLL | wx.TE_READONLY) f = self.text.GetFont() f.SetFamily(wx.FONTFAMILY_MODERN) f.SetFaceName("Courier New") self.text.SetFont(f) grid.Add(self.text, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) r += 1 c = 1 self.btnclose = wx.Button(self, -1, "Close", size=wx.Size(80, 20), pos=(160, 0)) self.btnclose.Bind(wx.EVT_BUTTON, self.Onclose) grid.Add(self.btnclose, pos=wx.GBPosition(r, c)) self.SetSizerAndFit(grid) self.updateSkin()
def __init__(self, parent, **kwargs): ShapedWindow.__init__(self, parent, **kwargs) self.parent = parent self.rordir = rorSettings().rorFolder grid = self.grid grid.SetEmptyCellSize(wx.Size(110, 10)) r = 1 c = 1 self.mainLabel = wx.StaticText(self, -1, "", size=wx.Size(0, 20), style=wx.TRANSPARENT_WINDOW | wx.ST_NO_AUTORESIZE) grid.Add(self.mainLabel, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) r += 1 self.objectPreviewWindow = ObjectPreviewOgreWindow(self, "PreviewToolwindow", size=wx.Size(150, 150)) grid.Add(self.objectPreviewWindow, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 2)) self.errorLabel = wx.StaticText(self, -1, " ", size=wx.Size(240, 80)) self.errorLabel.Wrap(230) self.errorLabel.SetForegroundColour(wx.RED) self.errorLabel.SetBackgroundColour(self.skinBack) r += 1 grid.Add(self.errorLabel, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.SetSizerAndFit(grid) # It works too, but i want the window "minimized" # self.SetSize(self.skinSize) self.Refresh()
def __init__(self, parent, **kwargs): ShapedWindow.__init__(self, parent, **kwargs) self.parent = parent self.rordir = rorSettings().rorFolder self.skinList = [] self.lastcount = 0 grid = self.grid grid.SetEmptyCellSize(wx.Size(110, 3)) r = 1 c = 1 self.mainLabel = wx.StaticText(self, -1, "", size=wx.Size(0, 20), style=wx.TRANSPARENT_WINDOW | wx.ST_NO_AUTORESIZE) self.mainLabel.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD)) #self.mainLabel.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) grid.Add(self.mainLabel, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) r += 2 c = 1 l = wx.StaticText(self, -1, "available skins:") grid.Add(l, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) r += 1 c = 1 self.list = wx.ListBox(self, -1, wx.DefaultPosition, wx.Size(250, 220), [], wx.LB_SINGLE | wx.LB_NEEDED_SB) self.list.Bind(wx.EVT_LISTBOX, self.Onselect) grid.Add(self.list, pos=wx.GBPosition(r, c)) r += 2 c = 1 self.btnclose = wx.Button(self, -1, "Close", size=wx.Size(250, 20)) self.btnclose.Bind(wx.EVT_BUTTON, self.Onclose) grid.Add(self.btnclose, pos=wx.GBPosition(r, c)) self.SetSizerAndFit(grid) self.searchSkins() self.updateSkin()
def __init__(self, parent, title, **kwargs): ShapedWindow.__init__(self, parent, title, ** kwargs) self.parent = parent self.rordir = rorSettings().rorFolder self.title = title grid = self.grid grid.SetEmptyCellSize(wx.Size(110, 3)) # Window padding - sides spacer_size = (6,6) grid.AddSpacer(spacer_size, (0,0)) # Row 0, Col 0 grid.AddSpacer(spacer_size, (0,2)) # Row 0, Col 2 r = 1 c = 1 self.mainLabel = wx.StaticText(self, -1, "", size=wx.Size(0, 20), style=wx.TRANSPARENT_WINDOW | wx.ST_NO_AUTORESIZE) self.mainLabel.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD)) grid.Add(self.mainLabel, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 3)) r += 2 self.transpa = wx.StaticText(self, -1, "Transparency", size=wx.Size(265, 20), style=wx.TRANSPARENT_WINDOW | wx.ST_NO_AUTORESIZE) self.transpa.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL)) grid.Add(self.transpa, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 3)) r += 1 self.ObjTransparencySlider = wx.SpinCtrl(self, ID_ChangeMainMeshTrans, "", wx.DefaultPosition, wx.Size(265, 20), min=0, max=100, initial=60) grid.Add(self.ObjTransparencySlider, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 4)) r += 1 c = 1 self.chkMeshVisible = wx.CheckBox(self, ID_ChangeMainMeshVisibility, "Display Object", wx.DefaultPosition, wx.Size(265, 20)) grid.Add(self.chkMeshVisible, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 4)) r += 1 self.chkBoxNormalVisible = wx.CheckBox(self, ID_ChangeNormalBoxesVisibility, "Display Collision Boxes", wx.DefaultPosition, wx.Size(265, 20)) grid.Add(self.chkBoxNormalVisible, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 4)) r += 1 self.chkBoxVirtualVisible = wx.CheckBox(self, ID_ChangeVirtualBoxesVisibility, "Display Virtual Boxes", wx.DefaultPosition, wx.Size(265, 20)) self.chkBoxVirtualVisible.SetValue(True) grid.Add(self.chkBoxVirtualVisible, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 4)) self.Bind(wx.EVT_SPINCTRL, self.OnMainMeshTransChange, id=ID_ChangeMainMeshTrans) self.Bind(wx.EVT_CHECKBOX, self.OnMainMeshVisibilityChange, id=ID_ChangeMainMeshVisibility) self.Bind(wx.EVT_CHECKBOX, self.OnNormalBoxesVisibilityChange, id=ID_ChangeNormalBoxesVisibility) self.Bind(wx.EVT_CHECKBOX, self.OnVirtualBoxesVisibilityChange, id=ID_ChangeVirtualBoxesVisibility) # Window padding - bottom r += 1 grid.AddSpacer(spacer_size, (r, c)) self.SetSizerAndFit(grid) self.resetControls() self.updateSkin()
def __init__(self, parent, **kwargs): ShapedWindow.__init__(self, parent, **kwargs) self.parent = parent grid = self.grid grid.SetEmptyCellSize(wx.Size(110, 3)) # Window padding - sides spacer_size = (6,6) grid.AddSpacer(spacer_size, (0,0)) # Row 0, Col 0 grid.AddSpacer(spacer_size, (0,2)) # Row 0, Col 2 r = 1 c = 1 self.mainLabel = wx.StaticText(self, -1, "", size=wx.Size(0, 20), style=wx.TRANSPARENT_WINDOW | wx.ST_NO_AUTORESIZE) grid.Add(self.mainLabel, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.nameObject = wx.StaticText(self, -1, "", style=wx.ALIGN_CENTRE) self.nameObject.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD)) self.nameObject.Bind(wx.EVT_LEFT_DOWN, self.OnnameObjectDown) r += 1 c = 1 grid.Add(self.nameObject, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 2)) l = wx.StaticText(self, -1, " X", style=wx.TRANSPARENT_WINDOW) l.SetForegroundColour(wx.RED) r += 1 c = 1 grid.Add(l, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.X = wx.TextCtrl(self, -1, "", style=wx.TE_PROCESS_ENTER) c += 1 grid.Add(self.X, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) c += 1 pan = CopyPasteClass(self) pan.addButtons(None, self.OnPasteX, None) grid.Add(pan, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) pan = CopyPasteClass(self) l = wx.StaticText(pan, -1, " Y") l.SetForegroundColour(wx.BLUE) pan.addButtons(self.OnCopy, self.OnPastePos, None, 40) r += 1 c = 1 grid.Add(pan, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.Y = wx.TextCtrl(self, -1, "", wx.DefaultPosition, wx.Size(100, 20), style=wx.TE_PROCESS_ENTER) c += 1 grid.Add(self.Y, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) c += 1 pan = CopyPasteClass(self) pan.addButtons(None, self.OnPasteY, None) grid.Add(pan, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) l = wx.StaticText(self, -1, " Z") l.SetForegroundColour(wx.GREEN) r += 1 c = 1 grid.Add(l, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.Z = wx.TextCtrl(self, -1, "", wx.DefaultPosition, wx.Size(100, 20), style=wx.TE_PROCESS_ENTER) c += 1 grid.Add(self.Z, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) c += 1 pan = CopyPasteClass(self) pan.addButtons(None, self.OnPasteZ, None) grid.Add(pan, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) l = wx.StaticText(self, -1, " Rot X") l.SetForegroundColour(wx.RED) r += 1 c = 1 grid.Add(l, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.rotX = wx.TextCtrl(self, -1, "", wx.DefaultPosition, wx.Size(100, 20), style=wx.TE_PROCESS_ENTER) c += 1 grid.Add(self.rotX, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) c += 1 pan = CopyPasteClass(self) pan.addButtons(None, self.OnPasterotX, self.OnResetrotX) grid.Add(pan, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) pan = CopyPasteClass(self) l = wx.StaticText(pan, -1, " Rot Y") l.SetForegroundColour(wx.BLUE) pan.addButtons(None, self.OnPasterot, self.OnResetrot, 40) r += 1 c = 1 grid.Add(pan, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.rotY = wx.TextCtrl(self, -1, "", wx.DefaultPosition, wx.Size(100, 20), style=wx.TE_PROCESS_ENTER) c += 1 grid.Add(self.rotY, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) c += 1 pan = CopyPasteClass(self) pan.addButtons(None, self.OnPasterotY, self.OnResetrotY) grid.Add(pan, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) l = wx.StaticText(self, -1, " Rot Z") l.SetForegroundColour(wx.GREEN) r += 1 c = 1 grid.Add(l, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.rotZ = wx.TextCtrl(self, -1, "", wx.DefaultPosition, wx.Size(100, 20), style=wx.TE_PROCESS_ENTER) c += 1 grid.Add(self.rotZ, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) c += 1 pan = CopyPasteClass(self) pan.addButtons(None, self.OnPasterotZ, self.OnResetrotZ) grid.Add(pan, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) r += 1 c = 1 l = wx.StaticText(self, -1, " Height From Ground") grid.Add(l, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.heightFromGround = wx.TextCtrl(self, -1, "", wx.DefaultPosition, wx.Size(100, 20), style=wx.TE_PROCESS_ENTER) c += 1 grid.Add(self.heightFromGround, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) c += 1 pan = CopyPasteClass(self) pan.addButtons(None, self.OnPasteHeight, self.OnResetHeight) grid.Add(pan, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) r += 1 c = 1 self.places = wx.ComboBox(self, -1, choices=hardcoded['ingamemap'], style=wx.CB_READONLY) # self.places.Bind(wx.EVT_COMBOBOX, self.Onplaces) grid.Add(self.places, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) c += 1 self.placeName = wx.TextCtrl(self, -1, "", size=wx.Size(100, 20), style=wx.TE_PROCESS_ENTER) self.placeName.Bind(wx.EVT_TEXT_ENTER, self.OnplaceName) grid.Add(self.placeName, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) r += 1 c = 1 l = wx.StaticText(self, -1, " Object Comment:") grid.Add(l, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) # a memo for comments will span throw 6 rows and 2 columns of the sizer. self.comments = wx.TextCtrl(self, -1, "", size=wx.Size(200, 80), style=wx.TE_MULTILINE | wx.TE_PROCESS_ENTER) r += 1 c = 1 grid.Add(self.comments, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 2)) self.chkVisible = wx.CheckBox(self, -1, "Visible", wx.DefaultPosition, wx.Size(50, 20)) self.chkVisible.SetValue(True) self.chkVisible.Bind(wx.EVT_CHECKBOX, self.OnVisible) r += 1 c = 1 grid.Add(self.chkVisible, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) c += 1 self.makeVisible = wx.Button(self, -1, "make all visible", size=wx.Size(100, 20)) self.makeVisible.Bind(wx.EVT_BUTTON, self.OnmakeVisible) grid.Add(self.makeVisible, pos=wx.GBPosition(r, c)) r += 1 c = 1 self.details = wx.Button(self, -1, "Details...", size=wx.Size(100, 20)) self.details.Bind(wx.EVT_BUTTON, self.Ondetails) grid.Add(self.details, pos=wx.GBPosition(r, c)) # grid.SetFlexibleDirection(wx.BOTH) # grid.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_NONE) self.Bind(wx.EVT_TEXT_ENTER, self.OnEditChanged, self.X) self.Bind(wx.EVT_TEXT_ENTER, self.OnEditChanged, self.Y) self.Bind(wx.EVT_TEXT_ENTER, self.OnEditChanged, self.Z) self.Bind(wx.EVT_TEXT_ENTER, self.OnEditHeightChanged, self.heightFromGround) self.Bind(wx.EVT_TEXT_ENTER, self.OnEditrotChanged, self.rotX) self.Bind(wx.EVT_TEXT_ENTER, self.OnEditrotChanged, self.rotY) self.Bind(wx.EVT_TEXT_ENTER, self.OnEditrotChanged, self.rotZ) self.Bind(wx.EVT_TEXT_ENTER, self.OnEditcommentChanged, self.comments) # Bottom padding r += 1 grid.AddSpacer(spacer_size, (r, 4)) self.SetSizerAndFit(grid) # no need to use wx.Clipboard to copy/paste feature. self.clipboard = [] self.updateSkin()
def __init__(self, parent, **kwargs): skin = 'PivotControls.png' ShapedWindow.__init__(self, parent, skinOnlyFilename=skin, **kwargs) # self._frame = frame self.parent = parent grid = wx.GridBagSizer(2, 3) # first row is invisible due skin grid.SetEmptyCellSize(wx.Size(40, 40)) r = 1 c = 0 self.mainLabel = wx.StaticText(self, -1, "Pivots Controls", size=wx.Size(120, 20), style=wx.TRANSPARENT_WINDOW | wx.ST_NO_AUTORESIZE) # self.mainLabel.Wrap(50) self.mainLabel.SetBackgroundColour(self.skinBack) self.mainLabel.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD)) #self.mainLabel.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) grid.Add(self.mainLabel, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) # ----- first row of controls self.rotxP = wx.Button(self, -1, label="rot x +", size=wx.Size(40, 40)) self.rotxP.Bind(wx.EVT_BUTTON, self.OnrotxP) r = 1 c = 1 grid.Add(self.rotxP, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.up = wx.Button(self, -1, label="UP", size=wx.Size(40, 40)) self.up.Bind(wx.EVT_BUTTON, self.Onup) c += 2 grid.Add(self.up, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.rotzP = wx.Button(self, -1, label="rot z +", size=wx.Size(40, 40)) self.rotzP.Bind(wx.EVT_BUTTON, self.OnrotzP) c += 2 grid.Add(self.rotzP, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.resetx = wx.Button(self, -1, label="Reset x", size=wx.Size(40, 40)) self.resetx.Bind(wx.EVT_BUTTON, self.Onresetx) c += 1 grid.Add(self.resetx, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) # ------ # ----- second row self.rotyP = wx.Button(self, -1, label="rot y +", size=wx.Size(40, 40)) self.rotyP.Bind(wx.EVT_BUTTON, self.OnrotyP) r += 1 c = 1 grid.Add(self.rotyP, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.left = wx.Button(self, -1, label="LEFT", size=wx.Size(40, 40)) self.left.Bind(wx.EVT_BUTTON, self.Onleft) c += 1 grid.Add(self.left, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.right = wx.Button(self, -1, label="RIGHT", size=wx.Size(40, 40)) self.right.Bind(wx.EVT_BUTTON, self.Onright) c += 2 grid.Add(self.right, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.rotyM = wx.Button(self, -1, label="rot y -", size=wx.Size(40, 40)) self.rotyM.Bind(wx.EVT_BUTTON, self.OnrotyM) c += 1 grid.Add(self.rotyM, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.resety = wx.Button(self, -1, label="Reset y", size=wx.Size(40, 40)) self.resety.Bind(wx.EVT_BUTTON, self.Onresety) c += 1 grid.Add(self.resety, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) # ------ # ----- self.rotxM = wx.Button(self, -1, label="rot x -", size=wx.Size(40, 40)) self.rotxM.Bind(wx.EVT_BUTTON, self.OnrotxM) r += 1 c = 1 grid.Add(self.rotxM, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.down = wx.Button(self, -1, label="DOWN", size=wx.Size(40, 40)) self.down.Bind(wx.EVT_BUTTON, self.Ondown) c += 2 grid.Add(self.down, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.rotzM = wx.Button(self, -1, label="rot z -", size=wx.Size(40, 40)) self.rotzM.Bind(wx.EVT_BUTTON, self.OnrotzM) c += 2 grid.Add(self.rotzM, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) self.resetz = wx.Button(self, -1, label="Reset z", size=wx.Size(40, 40)) self.resetz.Bind(wx.EVT_BUTTON, self.Onresetz) c += 1 grid.Add(self.resetz, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) # ------ self.SetSizerAndFit(grid) self.Refresh() return
def __init__(self, parent, **kwargs): ShapedWindow.__init__(self, parent, skinOnlyFilename=None, **kwargs) self.parent = parent # self._frame = frame # Auto Open Map stuff self.autoOpenItem = None self.selectedItem = None self.boldedItem = None # Truck to use when starting RoR self.useTruck = rorSettings().getSetting(TOOLKIT, "usetruck") if self.useTruck == "": self.useTruck = None self.rordir = rorSettings().rorFolder grid = self.grid grid.SetEmptyCellSize(wx.Size(110, 3)) # Window padding - sides spacer_size = (6, 6) grid.AddSpacer(spacer_size, (0, 0)) # Row 0, Col 0 grid.AddSpacer(spacer_size, (0, 2)) # Row 0, Col 2 r = 2 c = 1 self.mainLabel = wx.StaticText( self, -1, "", size=wx.Size(0, 20), style=wx.ST_NO_AUTORESIZE | wx.TRANSPARENT_WINDOW ) grid.Add(self.mainLabel, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) r += 1 self.objectPreviewWindow = ObjectPreviewOgreWindow(self, "PreviewToolwindow", size=wx.Size(260, 160)) grid.Add(self.objectPreviewWindow, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 2)) self.errorLabel = wx.StaticText(self, -1, " ") # , size=wx.Size(260, 20)) self.errorLabel.SetForegroundColour(wx.RED) r += 1 grid.Add(self.errorLabel, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) r += 1 self.chkMousePlacement = wx.CheckBox( self, -1, "Place Objects with Middle Mouse Button" ) # , wx.DefaultPosition, wx.Size(240,20)) self.chkMousePlacement.Bind(wx.EVT_CHECKBOX, self.OnMousePlacement) grid.Add(self.chkMousePlacement, pos=wx.GBPosition(r, c)) r += 1 tree = wx.TreeCtrl(self, -1, size=(265, 360), style=wx.NO_BORDER | wx.TR_HIDE_ROOT) grid.Add(tree, pos=wx.GBPosition(r, c)) # Bottom padding r += 1 grid.AddSpacer(spacer_size, (r, c)) self.SetSizerAndFit(grid) self.updateSkin() self.Refresh() root = tree.AddRoot("Objects") items = [] imglist = wx.ImageList(16, 16, True, 2) imglist.Add(wx.ArtProvider_GetBitmap(wx.ART_FOLDER, wx.ART_OTHER, wx.Size(16, 16))) imglist.Add(wx.ArtProvider_GetBitmap(wx.ART_NORMAL_FILE, wx.ART_OTHER, wx.Size(16, 16))) tree.AssignImageList(imglist) self.tree = tree self.treeroot = root # saves the section node to expand when load finish self.scannedExt = [ ".terrn", ".truck", ".boat", ".airplane", ".load", ".trailer", ".fixed", ".odef", ".material", ".mesh", ".cfg", ] # allfiles = self.getInstalledFiles(self.scannedExt) self._autoOpenMap = rorSettings().getSetting(TOOLKIT, "autoopen") t = self.addSection("Terrains", ["*.terrn"], None, True) bo = beamobjs = self.tree.AppendItem(self.treeroot, "Beam Objects", 0) self.addSection("Trucks", ["*.truck"], beamobjs, True) self.addSection("Boats", ["*.boat"], beamobjs, True) self.addSection("Airplanes", ["*.airplane"], beamobjs, True) self.addSection("Loads", ["*.load"], beamobjs, True) self.addSection("Trailers", ["*.trailer"], beamobjs, True) self.addSection("Statics Structures", ["*.fixed"], beamobjs, True) tree.SortChildren(bo) o = self.addSection("Objects", ["*.odef"], None, False) metaobjs = self.tree.AppendItem(self.treeroot, "Meta Files (click to load)", 0) # no full expand because there are a lot of children # expand only first level # if t is not None: # self.tree.Expand(t) # terrain # self.tree.SelectItem(t) #select terrain # if o is not None: # self.tree.Expand(o) # objects # if bo is not None: # self.tree.Expand(bo)# beam objects # if metaobjs is not None: # self.tree.Expand(metaobjs) # materials # self.GetSizer().SetSizeHints(self) self.Bind(wx.EVT_TREE_SEL_CHANGED, self.onTreeSelectionChange, self.tree) self.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK, self.OnRightClick, self.tree) # self.Bind(wx.wxEVT_TREE_BEGIN_DRAG, self.BeginDrag, self.tree) # initalize variable !!!! self.selectedfn = None
def __init__(self, parent, **kwargs): ShapedWindow.__init__(self, parent, **kwargs) self.parent = parent self.rordir = rorSettings().rorFolder self._splines = [] grid = self.grid grid.SetEmptyCellSize(wx.Size(10, 3)) # Window padding - sides spacer_size = (6, 6) grid.AddSpacer(spacer_size, (0, 0)) # Row 0, Col 0 grid.AddSpacer(spacer_size, (0, 8)) # Row 0, Col 2 r = 1 c = 1 self.mainLabel = wx.StaticText( self, -1, "", size=wx.Size(0, 20), style=wx.TRANSPARENT_WINDOW | wx.ST_NO_AUTORESIZE ) grid.Add(self.mainLabel, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 3)) r += 2 l = wx.StaticText(self, -1, "Splines:", size=wx.Size(60, 20), style=wx.TRANSPARENT_WINDOW) grid.Add(l, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 2)) c += 2 # span self.cboSpline = wx.ComboBox(self, -1, size=wx.Size(170, 20), style=wx.CB_READONLY) self.cboSpline.Bind(wx.EVT_COMBOBOX, self.OncboSpline) grid.Add(self.cboSpline, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 4)) r += 1 c -= 2 self.createSpline = wx.Button(self, -1, "Create new road", size=wx.Size(100, 20)) self.createSpline.Bind(wx.EVT_BUTTON, self.OncreateSpline) grid.Add(self.createSpline, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 4)) r += 1 c += 1 self.changeName = wx.Button(self, -1, "Change Spline name") self.changeName.Bind(wx.EVT_BUTTON, self.OnchangeName) grid.Add(self.changeName, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 4)) r += 1 self.pauseSpline = wx.Button(self, -1, "Pause - allow to modify control points") self.pauseSpline.Bind(wx.EVT_BUTTON, self.OnpauseSpline) grid.Add(self.pauseSpline, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 4)) r += 1 self.insertBefore = wx.Button(self, -1, "Insert control point Before") self.insertBefore.Bind(wx.EVT_BUTTON, self.OninsertBefore) grid.Add(self.insertBefore, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 3)) r += 1 self.deleteControlPoint = wx.Button(self, -1, "Delete control point") self.deleteControlPoint.Bind(wx.EVT_BUTTON, self.OndeleteControlPoint) grid.Add(self.deleteControlPoint, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 3)) r += 1 self.insertAfter = wx.Button(self, -1, "Insert control point After") self.insertAfter.Bind(wx.EVT_BUTTON, self.OninsertAfter) grid.Add(self.insertAfter, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 3)) r += 1 l = wx.StaticText(self, -1, "segment Type:", size=wx.Size(80, 20), style=wx.TRANSPARENT_WINDOW) grid.Add(l, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 2)) c += 2 self.cbosegmentType = wx.ComboBox( self, -1, size=wx.Size(130, 20), choices=[ "auto", "road", "roadborderleft", "roadborderright", "roadborderboth", "roadbridge", "roadbridgenopillar", ], style=wx.CB_READONLY, ) self.cbosegmentType.SetSelection(0) self._segmentType = "auto" self.cbosegmentType.Bind(wx.EVT_COMBOBOX, self.OncbosegmentType) grid.Add(self.cbosegmentType, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 4)) r += 1 c -= 2 self.chkSmooth = wx.CheckBox(self, -1, "stick to ground", wx.DefaultPosition, wx.Size(100, 20)) self.chkSmooth.SetValue(True) self._segmentSticked = True self.chkSmooth.Bind(wx.EVT_CHECKBOX, self.Onsmooth) grid.Add(self.chkSmooth, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 4)) r += 1 self.finishSpline = wx.Button(self, -1, "Finish - Accept the road") self.finishSpline.Bind(wx.EVT_BUTTON, self.OnfinishSpline) grid.Add(self.finishSpline, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 4)) r += 1 self.deleteSpline = wx.Button(self, -1, "Delete - Decline actual road") self.deleteSpline.Bind(wx.EVT_BUTTON, self.OndeleteSpline) grid.Add(self.deleteSpline, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 4)) r += 1 self.walk = wx.Button(self, -1, "Walk on roads") self.walk.Bind(wx.EVT_BUTTON, self.Onwalk) grid.Add(self.walk, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 2)) r += 1 self.purgue = wx.Button(self, -1, "Purgue spline forever") self.purgue.Bind(wx.EVT_BUTTON, self.Onpurgue) grid.Add(self.purgue, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 3)) self.enableCreateSpline(True) self.enableInsert(False) # Window padding - bottom r += 1 grid.AddSpacer(spacer_size, (r, c)) self.SetSizerAndFit(grid) self.updateSkin()
def __init__(self, parent, **kwargs): ShapedWindow.__init__(self, parent, **kwargs) self.parent = parent self._luaParser = None self.rordir = rorSettings().rorFolder grid = self.grid grid.SetEmptyCellSize(wx.Size(110, 20)) # Window padding - sides spacer_size = (6,6) grid.AddSpacer(spacer_size, (0,0)) # Row 0, Col 0 grid.AddSpacer(spacer_size, (0,3)) # Row 0, Col 2 r = 1 c = 1 self.mainLabel = wx.StaticText(self, -1, "", size=wx.Size(0, 20), style=wx.TRANSPARENT_WINDOW | wx.ST_NO_AUTORESIZE) grid.Add(self.mainLabel, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) r += 1 self.newRace = wx.Button(self, -1, "new Race", size=wx.Size(100, 20)) self.newRace.Bind(wx.EVT_BUTTON, self.OnnewRace) grid.Add(self.newRace, pos=wx.GBPosition(r, c)) c += 1 self.modifyRace = wx.Button(self, -1, "Modify Race", size=wx.Size(100, 20)) self.modifyRace.Bind(wx.EVT_BUTTON, self.OnmodifyRace) grid.Add(self.modifyRace, pos=wx.GBPosition(r, c)) r += 1 c = 1 l = wx.StaticText(self, -1, "available races:") grid.Add(l, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) c += 1 self.racelist = wx.ComboBox(self, -1, "", size=wx.Size(100, 20), style=wx.CB_READONLY) self.racelist.Bind(wx.EVT_COMBOBOX , self.Onracelist) grid.Add(self.racelist, pos=wx.GBPosition(r, c)) r += 1 c = 1 l = wx.StaticText(self, -1, "Objects to spawn (click to go):") grid.Add(l, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) r += 1 c = 1 self.list = wx.ListBox(self, -1, wx.DefaultPosition, wx.Size(250, 180), [], wx.LB_SINGLE | wx.LB_NEEDED_SB) self.list.Bind(wx.EVT_LISTBOX, self.OnselectCheckpoint) grid.Add(self.list, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 2)) r += 1 c = 1 self.endModify = wx.Button(self, -1, "End Modify", size=wx.Size(100, 20)) self.endModify.Bind(wx.EVT_BUTTON, self.OnendModify) grid.Add(self.endModify, pos=wx.GBPosition(r, c)) c += 1 self.deleteRace = wx.Button(self, -1, "Delete Race", size=wx.Size(100, 20)) self.deleteRace.Bind(wx.EVT_BUTTON, self.OndeleteRace) grid.Add(self.deleteRace, pos=wx.GBPosition(r, c)) r += 1 c = 1 self.altitude = wx.CheckBox(self, -1, "Show Altitude of the next Checkpoint") self.altitude.Bind(wx.EVT_CHECKBOX, self.Onaltitude) grid.Add(self.altitude, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 2)) r += 1 c = 1 self.isLoop = wx.CheckBox(self, -1, "is circuit race?") self.isLoop.Bind(wx.EVT_CHECKBOX, self.OnisLoop) grid.Add(self.isLoop, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) # Window padding - bottom r += 1 grid.AddSpacer(spacer_size, (r, c)) self.SetSizerAndFit(grid) self._raceIndex = -1 self.updateSkin()
def __init__(self, parent, **kwargs): ShapedWindow.__init__(self, parent, **kwargs) self.parent = parent self.rordir = rorSettings().rorFolder grid = self.grid grid.SetEmptyCellSize(wx.Size(110, 3)) # Window padding spacer_size = (6,6) grid.AddSpacer(spacer_size, (0,0)) # Row 0, Col 0 grid.AddSpacer(spacer_size, (0,2)) # Row 0, Col 2 r = 1 c = 1 self.mainLabel = wx.StaticText(self, -1, "", size=wx.Size(0, 20), style=wx.TRANSPARENT_WINDOW | wx.ST_NO_AUTORESIZE) grid.Add(self.mainLabel, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) r += 1 c = 1 l = wx.StaticText(self, -1, "Ingame menu Map name:", style=wx.TRANSPARENT_WINDOW) grid.Add(l, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 2)) r += 1 c = 1 self.mapName = wx.TextCtrl(self, -1, "", size=wx.Size(252, 20), style=wx.TE_PROCESS_ENTER) self.mapName.Bind(wx.EVT_TEXT_ENTER, self.OnmapName) grid.Add(self.mapName, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 2)) r += 1 c = 1 l = wx.StaticText(self, -1, "Config file (*.cfg):", style=wx.TRANSPARENT_WINDOW) grid.Add(l, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) c += 1 self.mapConfig = wx.TextCtrl(self, -1, "", size=wx.Size(120, 20), style=wx.TE_PROCESS_ENTER) self.mapConfig.Bind(wx.EVT_TEXT_ENTER, self.OnmapConfig) grid.Add(self.mapConfig, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 2)) r += 1 c = 1 self.useCaelum = wx.CheckBox(self, -1, "Use Caelum in this map") self.useCaelum.Bind(wx.EVT_CHECKBOX, self.OnuseCaelum) grid.Add(self.useCaelum, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) r += 1 c = 1 self.chkWaterLevel = wx.CheckBox(self, -1, "Water level (in meters):") self.chkWaterLevel.Bind(wx.EVT_CHECKBOX, self.OnCheckWater) grid.Add(self.chkWaterLevel, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) # r+=1 c += 1 self.waterHeight = wx.TextCtrl(self, -1, "", style=wx.TE_PROCESS_ENTER) self.waterHeight.Bind(wx.EVT_TEXT_ENTER, self.OnwaterHeight) grid.Add(self.waterHeight, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) r += 1 c = 1 l = wx.StaticText(self, -1, "author information:", style=wx.TRANSPARENT_WINDOW) grid.Add(l, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 2)) r += 1 c = 1 self.comments = wx.TextCtrl(self, -1, "", size=wx.Size(252, 150), style=wx.TE_MULTILINE | wx.TE_PROCESS_ENTER) self.comments.Bind(wx.EVT_TEXT_ENTER, self.Oncomments) grid.Add(self.comments, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 2)) r += 1 self.btdetails = wx.Button(self, -1, "Summary...", size=wx.Size(100, 20)) self.btdetails.Bind(wx.EVT_BUTTON, self.Onbtdetails) grid.Add(self.btdetails, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 4)) # Bottom padding r += 1 grid.AddSpacer(spacer_size, (r, 3)) self.SetSizerAndFit(grid) self.updateSkin() # It works too, but i want the window "minimized" # self.SetSize(self.skinSize) self.Refresh()
def __init__(self, parent, **kwargs): ShapedWindow.__init__(self, parent, **kwargs) self.parent = parent # self._frame = frame # Auto Open Map stuff self.autoOpenItem = None self.selectedItem = None self.boldedItem = None self.rordir = rorSettings().rorFolder grid = self.grid grid.SetEmptyCellSize(wx.Size(120, 40)) r = 1 c = 0 self.mainLabel = wx.StaticText(self, -1, "", size=wx.Size(0, 20), style=wx.TRANSPARENT_WINDOW | wx.ST_NO_AUTORESIZE) grid.Add(self.mainLabel, pos=wx.GBPosition(r, c), span=wx.GBSpan(1, 1)) r = 1 c = 1 tree = wx.TreeCtrl(self, -1, size=(250, 300), style=wx.NO_BORDER | wx.TR_HIDE_ROOT) grid.Add(tree, pos=wx.GBPosition(r, c)) self.chkMousePlacement = wx.CheckBox(self, -1, "Place Objects with Middle Mouse Button", wx.DefaultPosition, wx.Size(200, 20)) self.chkMousePlacement.SetBackgroundColour(ShapedWindow.skinBack) self.chkMousePlacement.Bind(wx.EVT_CHECKBOX, self.OnMousePlacement) r += 1 c = 1 grid.Add(self.chkMousePlacement, pos=wx.GBPosition(r, c)) root = tree.AddRoot("Objects") items = [] imglist = wx.ImageList(16, 16, True, 2) imglist.Add(wx.ArtProvider_GetBitmap(wx.ART_FOLDER, wx.ART_OTHER, wx.Size(16, 16))) imglist.Add(wx.ArtProvider_GetBitmap(wx.ART_NORMAL_FILE, wx.ART_OTHER, wx.Size(16, 16))) tree.AssignImageList(imglist) self.tree = tree self.treeroot = root #saves the section node to expand when load finish self.scannedExt = ['.terrn', '.truck', '.boat', '.airplane', '.load', '.trailer', '.fixed', '.odef', '.material' , '.mesh', '.cfg', '.machine' ] # allfiles = self.getInstalledFiles(self.scannedExt) self._autoOpenMap = rorSettings().getSetting(TOOLKIT, "autoopen") t = self.addSection("Terrains", ['*.terrn'], None, True) beamobjs = self.tree.AppendItem(self.treeroot, "Beam Objects", 0) self.addSection("Trucks", ['*.truck'], beamobjs, True) self.addSection("Boats", ['*.boat'], beamobjs, True) self.addSection("Airplanes", ['*.airplane'], beamobjs, True) self.addSection("Loads", ['*.load'], beamobjs, True) self.addSection("Trailers", ['*.trailer'], beamobjs, True) self.addSection("Statics Structures", ['*.fixed', '*.machine'], beamobjs, True) tree.SortChildren(beamobjs) o = self.addSection("Objects", ['*.odef'], None, False) metaobjs = self.tree.AppendItem(self.treeroot, "Meta Files", 0) #FIXME: Lepes are needed to load on Object Tree?? spend a lot of time # self.addSection("Materials", ['*.material'], metaobjs, False) # self.addSection("Meshes", ['*.mesh'], metaobjs, False) # self.addSection("Configurations", ['*.cfg'], metaobjs, False) # no full expand because there are a lot of children #expand only first level # if t is not None: # self.tree.Expand(t) # terrain # self.tree.SelectItem(t) #select terrain # if o is not None: # self.tree.Expand(o) # objects # if bo is not None: # self.tree.Expand(bo)# beam objects # if metaobjs is not None: # self.tree.Expand(metaobjs) # materials # self.GetSizer().SetSizeHints(self) self.Bind(wx.EVT_TREE_SEL_CHANGED, self.onTreeSelectionChange, self.tree) self.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK, self.OnRightClick, self.tree) #self.Bind(wx.wxEVT_TREE_BEGIN_DRAG, self.BeginDrag, self.tree) #initalize variable !!!! self.selectedfn = None self.SetSizerAndFit(grid) self.updateSkin()