def onLoad(self): self.windowTitle = "Pex Editor" self.container = self.requestDocumentWindow( "SimpleParticleEditor", title="Pex Editor", size=(500, 300), minSize=(500, 300) ) self.toolbar = self.addToolBar("simple_particle_editor", self.container.addToolBar()) self.window = window = self.container.addWidgetFromFile(_getModulePath("SimpleParticleEditor.ui")) self.propEditor = addWidgetWithLayout(PropertyEditor(window.containerPropSystem)) self.canvas = addWidgetWithLayout(MOAIEditCanvas(window.containerPreview)) self.canvas.loadScript(_getModulePath("SimpleParticleEditor.lua")) self.addTool("simple_particle_editor/save", label="Save", icon="save") self.addTool("simple_particle_editor/clone", label="Clone", icon="clone") self.propEditor.propertyChanged.connect(self.onPropertyChanged) signals.connect("asset.modified", self.onAssetModified) self.container.setEnabled(False) self.editingAsset = None self.updateSchduleTimer = QtCore.QTimer(self.container) self.updateSchduleTimer.setInterval(50) self.updateSchduleTimer.setSingleShot(True) self.updateSchduleTimer.timeout.connect(self.updatePreview)
def __init__(self, *args): super(SearchViewWidget, self).__init__(*args) self.searchState = None self.setWindowFlags(Qt.Popup) self.ui = SearchViewForm() self.ui.setupUi(self) self.installEventFilter(WindowAutoHideEventFilter(self)) self.editor = None self.treeResult = addWidgetWithLayout( SearchViewTree(self.ui.containerResultTree, multiple_selection=False, editable=False, sorting=False)) self.treeResult.hideColumn(0) self.textTerms = addWidgetWithLayout( SearchViewTextTerm(self.ui.containerTextTerm)) self.textTerms.browser = self self.textTerms.textEdited.connect(self.onTermsChanged) self.textTerms.returnPressed.connect(self.onTermsReturn) self.treeResult.browser = self self.entries = None self.setMinimumSize(800, 300) self.setMaximumSize(800, 600) self.multipleSelection = False self.setInfo(None) self.ui.buttonOK.clicked.connect(self.onButtonOK) self.ui.buttonCancel.clicked.connect(self.onButtonCancel) self.ui.buttonAll.clicked.connect(self.onButtonAll) self.ui.buttonInverse.clicked.connect(self.onButtonInverse) self.ui.buttonNone.clicked.connect(self.onButtonNone)
def __init__(self, *args): super(SearchViewWidget, self).__init__(*args) self.searchState = None self.setWindowFlags(Qt.Popup) self.ui = SearchViewForm() self.ui.setupUi(self) self.installEventFilter(WindowAutoHideEventFilter(self)) self.editor = None self.treeResult = addWidgetWithLayout( SearchViewTree(self.ui.containerResultTree, multiple_selection=False, editable=False, sorting=False) ) self.treeResult.hideColumn(0) self.textTerms = addWidgetWithLayout(SearchViewTextTerm(self.ui.containerTextTerm)) self.textTerms.browser = self self.textTerms.textEdited.connect(self.onTermsChanged) self.textTerms.returnPressed.connect(self.onTermsReturn) self.treeResult.browser = self self.entries = None self.setMinimumSize(800, 300) self.setMaximumSize(800, 600) self.multipleSelection = False self.setInfo(None) self.ui.buttonOK.clicked.connect(self.onButtonOK) self.ui.buttonCancel.clicked.connect(self.onButtonCancel) self.ui.buttonAll.clicked.connect(self.onButtonAll) self.ui.buttonInverse.clicked.connect(self.onButtonInverse) self.ui.buttonNone.clicked.connect(self.onButtonNone)
def onLoad(self): self.windowTitle = 'Shader Editor' self.container = self.requestDocumentWindow('ShaderEditor', title = 'Shader Editor', size = (500,300), minSize = (500,300), # allowDock = False ) self.tool = self.addToolBar( 'shader_editor', self.container.addToolBar() ) self.addTool( 'shader_editor/save', label = 'Save', icon = 'save' ) self.addTool( 'shader_editor/refresh', label = 'Refresh', icon = 'refresh' ) self.window = window = self.container.addWidgetFromFile( _getModulePath('ShaderEditor.ui') ) self.canvas = addWidgetWithLayout( MOAIEditCanvas( window.containerPreview ) ) self.tree = addWidgetWithLayout( ShaderUniformTreeWidget( window.containerTree, multiple_selection = False, editable = True ) ) self.tree.module = self
def onLoad(self): self.windowTitle = 'Deck2D Pack Editor' self.container = self.requestDocumentWindow('MockDeck2DEditor', title='Deck2D Pack Editor', size=(500, 300), minSize=(500, 300), dock='right' # allowDock = False ) self.window = window = self.container.addWidgetFromFile( _getModulePath('Deck2DEditor.ui')) self.propEditor = addWidgetWithLayout( PropertyEditor(window.settingsContainer), window.settingsContainer) self.canvas = addWidgetWithLayout( MOCKEditCanvas(window.canvasContainer), window.canvasContainer) self.canvas.loadScript(_getModulePath('Deck2DEditor.lua')) self.canvas.setDelegateEnv('updateEditor', self.onCanvasUpdateRequested) self.canvas.setDelegateEnv('triangulatePolygon', triangulatePolygon) #setup listwidget treeSprites = addWidgetWithLayout( SpriteTreeWidget(self.window.containerSpriteTree, multiple_selection=False)) treeSprites.module = self treeSprites.setSortingEnabled(True) self.treeSprites = treeSprites #signals window.toolAddQuad.clicked.connect(lambda: self.addItem('quad')) window.toolAddQuadArray.clicked.connect( lambda: self.addItem('quad_array')) window.toolAddTileset.clicked.connect(lambda: self.addItem('tileset')) window.toolAddStretchPatch.clicked.connect( lambda: self.addItem('stretchpatch')) window.toolAddPoly.clicked.connect(lambda: self.addItem('polygon')) window.toolSave.clicked.connect(self.saveAsset) window.toolRemove.clicked.connect(self.onRemoveItem) window.toolClone.clicked.connect(self.onCloneItem) window.toolOriginE.clicked.connect(lambda: self.setOrigin('E')) window.toolOriginS.clicked.connect(lambda: self.setOrigin('S')) window.toolOriginW.clicked.connect(lambda: self.setOrigin('W')) window.toolOriginN.clicked.connect(lambda: self.setOrigin('N')) window.toolOriginSE.clicked.connect(lambda: self.setOrigin('SE')) window.toolOriginSW.clicked.connect(lambda: self.setOrigin('SW')) window.toolOriginNE.clicked.connect(lambda: self.setOrigin('NE')) window.toolOriginNW.clicked.connect(lambda: self.setOrigin('NW')) window.toolOriginC.clicked.connect(lambda: self.setOrigin('C')) window.checkAlphaView.stateChanged.connect(self.toggleAlphaView) self.propEditor.propertyChanged.connect(self.onPropertyChanged) signals.connect('asset.modified', self.onAssetModified) self.container.setEnabled(False)
def onLoad(self): self.container = self.requestDocumentWindow( "MockTextureManager", title="TextureManager", size=(500, 300), minSize=(500, 300), # allowDock = False ) self.toolbar = self.addToolBar("texture_manager", self.container.addToolBar()) self.window = window = self.container.addWidgetFromFile(_getModulePath("TextureManager.ui")) self.tree = addWidgetWithLayout( TextureTreeWidget( window.containerTree, drag_mode="internal", editable=True, multiple_selection=True, expanded=False ) ) self.tree.module = self self.treeFilter = GenericTreeFilter(window.containerTree) window.containerTree.layout().insertWidget(0, self.treeFilter) self.treeFilter.setTargetTree(self.tree) self.propEditor = addWidgetWithLayout(PropertyEditor(window.containerProp)) self.canvas = addWidgetWithLayout(MOAIEditCanvas(window.containerPreview)) self.canvas.loadScript(_getModulePath("TextureManager.lua")) self.addMenuItem("main/asset/----") self.addMenuItem( "main/asset/texture_manager", {"label": "Texture Manager", "on_click": lambda menu: self.setFocus()} ) self.addTool("asset/show_texture_manager", label="Texture Manager", on_click=lambda item: self.setFocus()) self.addTool("texture_manager/add_group", label="Add Group", icon="add") self.addTool("texture_manager/remove_group", label="Remove Group", icon="remove") self.addTool("texture_manager/----") self.addTool("texture_manager/assign_group", label="Assign Group", icon="in") self.addTool("texture_manager/----") self.addTool("texture_manager/assign_processor", label="Assign Processor", icon="compose") self.addTool("texture_manager/clear_processor", label="Clear Processor", icon="remove") self.addTool("texture_manager/----") self.addTool("texture_manager/rebuild", label="Rebuild", icon="refresh") self.addShortcut(self.container, "=", self.regroupTo) self.addShortcut(self.container, "-", self.regroup, "default") self.propEditor.propertyChanged.connect(self.onPropertyChanged) signals.connect("texture.add", self.onTextureAdd) signals.connect("texture.remove", self.onTextureRemove) registerSearchEnumerator(textureGroupSearchEnumerator)
def onLoad(self): self.container = self.requestDocumentWindow('MockStyleSheetEditor', title='Style Sheet Editor', size=(500, 300), minSize=(500, 300), dock='right') self.toolBar = self.addToolBar('style_sheet', self.container.addToolBar()) self.window = window = self.container.addWidgetFromFile( _getModulePath('styleEditor.ui')) self.tree = addWidgetWithLayout( StyleTreeWidget(self.window.containerTree, multiple_selection=False, editable=True, show_root=False, sorting=True, drag_mode=False)) self.tree.module = self self.propEditor = addWidgetWithLayout( PropertyEditor(window.containerProp)) #Previews self.canvasPreviewSheet = addWidgetWithLayout( MOCKEditCanvas(window.previewSheet)) self.canvasPreviewSheet.loadScript( _getModulePath('StyleSheetPreview.lua')) self.canvasPreviewStyle = addWidgetWithLayout( MOCKEditCanvas(window.previewStyle)) self.canvasPreviewStyle.loadScript( _getModulePath('SingleStylePreview.lua')) #Tools self.addTool('style_sheet/save', label='Save', icon='save') self.addTool('style_sheet/add_style', label='Add Style', icon='add') self.addTool('style_sheet/remove_style', label='Remove Style', icon='remove') self.addTool('style_sheet/clone_style', label='Clone Style', icon='clone') #signals self.propEditor.propertyChanged.connect(self.onPropertyChanged) window.textStylePreview.textChanged.connect( self.onStylePreviewTextChanged) window.textSheetPreview.textChanged.connect( self.onSheetPreviewTextChanged)
def onLoad( self ): self.configPath = self.getProject().getConfigPath( _DEPLOY_CONFIG_FILE ) #UI self.container = self.requestDocumentWindow( 'ScreenProfileManager', title = 'Screen Profile Manager', allowDock = False, minSize = ( 600, 600 ), maxSize = ( 600, 600 ) ) self.window = window = self.container.addWidgetFromFile( _getModulePath('ScreenProfileManager.ui') ) # self.tree layout = QtGui.QVBoxLayout() window.containerTree.setLayout( layout ) layout.setSpacing( 0 ) layout.setMargin( 0 ) self.tree = ScreenProfileTree( window.containerTree, editable = True, multiple_selection = False ) self.tree.manager = self layout.addWidget( self.tree ) screenToolbar = QtGui.QToolBar( window.containerTree ) layout.addWidget( screenToolbar ) self.targetTool = self.addToolBar( 'screen_profile', screenToolbar ) self.addTool( 'screen_profile/add_profile', label = '+', icon = 'add' ) self.addTool( 'screen_profile/remove_profile', label = '-', icon = 'remove' ) #target property self.propertyEditor = addWidgetWithLayout( PropertyEditor( window.containerProperty ) ) #menu # self.addMenuItem( 'main/file/screen_profile_manager', # dict( label = 'Screen Profile Manager', shortcut = 'F9' ) # ) self.addTool( 'asset/show_screen_profile_manager', label = 'Screen Profile Manager', on_click = lambda item: self.setFocus() ) self.canvas = addWidgetWithLayout( MOAIEditCanvas( window.containerPreview ) ) self.canvas.loadScript( _getModulePath('ScreenProfileManager.lua') ) self.propertyEditor .propertyChanged .connect( self.onPropertyChanged )
def onLoad(self): self.configPath = self.getProject().getConfigPath(_DEPLOY_CONFIG_FILE) #UI self.container = self.requestDocumentWindow( 'ScreenProfileManager', title='Screen Profile Manager', allowDock=False, minSize=(200, 200), ) self.window = window = self.container.addWidgetFromFile( _getModulePath('ScreenProfileManager.ui')) # self.tree layout = QtWidgets.QVBoxLayout() window.containerTree.setLayout(layout) layout.setSpacing(0) layout.setContentsMargins(0, 0, 0, 0) self.tree = ScreenProfileTree(window.containerTree, editable=True, multiple_selection=False) self.tree.manager = self layout.addWidget(self.tree) screenToolbar = QtWidgets.QToolBar(window.containerTree) layout.addWidget(screenToolbar) self.targetTool = self.addToolBar('screen_profile', screenToolbar) self.addTool('screen_profile/add_profile', label='+', icon='add') self.addTool('screen_profile/remove_profile', label='-', icon='remove') #target property self.propertyEditor = addWidgetWithLayout( PropertyEditor(window.containerProperty)) #menu self.addMenuItem('main/file/screen_profile_manager', dict(label='Screen Profile Manager')) # self.addTool( # 'asset/show_screen_profile_manager', # label = 'Screen Profile Manager', # on_click = lambda item: self.setFocus() # ) self.canvas = addWidgetWithLayout( MOCKEditCanvas(window.containerPreview)) self.canvas.loadScript(_getModulePath('ScreenProfileManager.lua')) self.propertyEditor.propertyChanged.connect(self.onPropertyChanged)
def __init__(self, *args, **kwargs ): super(StoryGraphWidget, self).__init__( *args, **kwargs ) self.setupUi( self ) self.owner = None self.graphView = addWidgetWithLayout( GraphNodeViewWidget( parent = self.containerGraph ) ) self.containerContent.hide() self.buildTestData()
def createWidget(self, container): self.container = container self.container.setCallbackOnClose(self.onClose) self.toolbar = self.container.addToolBar() self.toolbar.setIconSize(QtCore.QSize(16, 16)) self.actionSave = self.toolbar.addAction(getIcon('save'), 'Save') self.actionLocate = self.toolbar.addAction(getIcon('search-2'), 'Locate') self.actionSave.setEnabled(False) self.actionSave.triggered.connect(self.onActionSave) self.actionLocate.triggered.connect(self.onActionLocate) self.window = window = self.container.addWidgetFromFile( _getModulePath('SerializableEditor.ui')) self.scroll = scroll = addWidgetWithLayout( QtGui.QScrollArea(window.containerProperty), window.containerProperty) scroll.verticalScrollBar().setStyleSheet('width:4px') scroll.setWidgetResizable(True) self.propertyEditor = PropertyEditor(scroll) scroll.setWidget(self.propertyEditor) self.propertyEditor.propertyChanged.connect(self.onPropertyChanged)
def createWidget( self, container ): self.container = container self.container.setCallbackOnClose( self.onClose ) self.toolbar = self.container.addToolBar() self.toolbar.setIconSize( QtCore.QSize( 16, 16 ) ) self.actionSave = self.toolbar.addAction( getIcon( 'save' ), 'Save' ) self.actionLocate = self.toolbar.addAction( getIcon( 'search-2' ), 'Locate' ) self.actionSave.setEnabled( False ) self.actionSave.triggered.connect( self.onActionSave ) self.actionLocate.triggered.connect( self.onActionLocate ) self.window = window = self.container.addWidgetFromFile( _getModulePath('SerializableEditor.ui') ) self.scroll = scroll = addWidgetWithLayout( QtGui.QScrollArea( window.containerProperty ), window.containerProperty ) scroll.verticalScrollBar().setStyleSheet('width:4px') scroll.setWidgetResizable( True ) self.propertyEditor = PropertyEditor( scroll ) scroll.setWidget( self.propertyEditor ) self.propertyEditor.propertyChanged.connect( self.onPropertyChanged )
def __init__(self, *args, **kwargs): super(StoryGraphWidget, self).__init__(*args, **kwargs) self.setupUi(self) self.owner = None self.graphView = addWidgetWithLayout( GraphNodeViewWidget(parent=self.containerGraph)) self.containerContent.hide() self.buildTestData()
def initUI(self): self.setObjectName('SQScriptEditorWidget') self.ui = SQScriptEditorForm() self.ui.setupUi(self) self.listRoutine = addWidgetWithLayout( RoutineListWidget(self.ui.containerRoutine)) self.listRoutine.owner = self self.toolbarMain = wrapToolBar( 'main', addWidgetWithLayout(QtWidgets.QToolBar(self.ui.containerToolbar)), owner=self) self.toolbarMain.addTools([ dict(name='save', label='Save', icon='save'), dict(name='locate', label='Locate', icon='search'), '----', dict(name='add_routine', label='Add Routine', icon='add'), dict(name='del_routine', label='Remove Routine', icon='remove'), ]) self.treeRoutineNode = addWidgetWithLayout( RoutineNodeTreeWidget(self.ui.containerContent)) self.treeRoutineNode.owner = self self.scrollProperty = scroll = addWidgetWithLayout( QtWidgets.QScrollArea(self.ui.containerProperty)) scroll.verticalScrollBar().setStyleSheet('width:4px') scroll.setWidgetResizable(True) self.propertyEditor = PropertyEditor(scroll) scroll.setWidget(self.propertyEditor) self.propertyEditor.propertyChanged.connect(self.onPropertyChanged) #setup shortcuts # self.addShortcut( self.treeRoutineNode, 'Tab', self.promptAddNode ) self.addShortcut(self.treeRoutineNode, 'Return', self.focusNodeEditor) self.addShortcut(self, 'Ctrl+Return', self.promptAddNode) self.addShortcut(self, 'Escape', self.focusContentTree) # self.addShortcut( self, 'Ctrl+Return', self.focusContentTree ) # self.addShortcut( self, 'Ctrl+1', self.focusContentTree ) self.nodeEditorContainer = self.ui.containerEditor editorContainerLayout = QtWidgets.QVBoxLayout(self.nodeEditorContainer) editorContainerLayout.setSpacing(0) editorContainerLayout.setContentsMargins(0, 0, 0, 0)
def __init__(self, *args): self.titleBar = None super(SearchViewWidget, self).__init__(*args) self.searchState = None self.defaultSortMethod = 'name' self.setWindowFlags(Qt.Window | Qt.FramelessWindowHint) self.setWindowModality(Qt.ApplicationModal) self.ui = SearchViewForm() self.ui.setupUi(self) self.editor = None self.treeResult = addWidgetWithLayout( SearchViewTree(self.ui.containerResultTree, multiple_selection=False, editable=False, sorting=False)) self.treeResult.hideColumn(0) self.textTerms = addWidgetWithLayout( SearchViewTextTerm(self.ui.containerTextTerm)) self.textTerms.browser = self self.textTerms.textEdited.connect(self.onTermsChanged) self.textTerms.returnPressed.connect(self.onTermsReturn) self.setFocusProxy(self.textTerms) self.treeResult.browser = self self.entries = None self.setMinimumSize(800, 300) self.setMaximumSize(800, 600) self.multipleSelection = False self.setInfo(None) self.ui.buttonOK.clicked.connect(self.onButtonOK) self.ui.buttonCancel.clicked.connect(self.onButtonCancel) self.ui.buttonAll.clicked.connect(self.onButtonAll) self.ui.buttonInverse.clicked.connect(self.onButtonInverse) self.ui.buttonNone.clicked.connect(self.onButtonNone) self.titleBar = SimpleTitleBar(self) self.layout().insertWidget(0, self.titleBar)
def initUI(self): self.setObjectName("SQScriptEditorWidget") self.ui = SQScriptEditorForm() self.ui.setupUi(self) self.listRoutine = addWidgetWithLayout(RoutineListWidget(self.ui.containerRoutine)) self.listRoutine.owner = self self.toolbarMain = wrapToolBar( "main", addWidgetWithLayout(QtGui.QToolBar(self.ui.containerToolbar)), owner=self ) self.toolbarMain.addTools( [ dict(name="save", label="Save", icon="save"), dict(name="locate", label="Locate", icon="search-2"), "----", dict(name="add_routine", label="Add Routine", icon="add"), dict(name="del_routine", label="Remove Routine", icon="remove"), ] ) self.treeRoutineNode = addWidgetWithLayout(RoutineNodeTreeWidget(self.ui.containerContent)) self.treeRoutineNode.owner = self self.scrollProperty = scroll = addWidgetWithLayout(QtGui.QScrollArea(self.ui.containerProperty)) scroll.verticalScrollBar().setStyleSheet("width:4px") scroll.setWidgetResizable(True) self.propertyEditor = PropertyEditor(scroll) scroll.setWidget(self.propertyEditor) self.propertyEditor.propertyChanged.connect(self.onPropertyChanged) # setup shortcuts # self.addShortcut( self.treeRoutineNode, 'Tab', self.promptAddNode ) self.addShortcut(self.treeRoutineNode, "Return", self.focusNodeEditor) self.addShortcut(self, "Ctrl+Return", self.promptAddNode) self.addShortcut(self, "Escape", self.focusContentTree) # self.addShortcut( self, 'Ctrl+Return', self.focusContentTree ) # self.addShortcut( self, 'Ctrl+1', self.focusContentTree ) self.nodeEditorContainer = self.ui.containerEditor editorContainerLayout = QtGui.QVBoxLayout(self.nodeEditorContainer) editorContainerLayout.setSpacing(0) editorContainerLayout.setMargin(0)
def createWidget(self, container): self.container = uic.loadUi( _getModulePath('FModPreview.ui') ) self.canvas = addWidgetWithLayout( MOAIEditCanvas(container), self.container.canvasContainer ) self.canvas.loadScript( _getModulePath('FModPreview.lua') ) return self.container
def createWidget(self, container): self.container = uic.loadUi(_getModulePath('FontPreview.ui')) self.canvas = addWidgetWithLayout(MOCKEditCanvas(container), self.container.canvasContainer) self.canvas.loadScript(_getModulePath('FontPreview.lua')) self.container.textPreview.textChanged.connect(self.onTextChanged) self.container.spinFontSize.valueChanged.connect(self.onSizeChanged) return self.container
def __init__(self): QtGui.QWidget.__init__(self) self.ui = addWidgetWithLayout(uic.loadUi(_getModulePath('stub.ui')), self) self.setMinimumSize(600, 400) self.setMaximumSize(600, 400) self.ui.buttonOpen.clicked.connect(self.onButtonOpen) self.ui.buttonNew.clicked.connect(self.onButtonNew) self.setWindowTitle('GII ( %d bits )' % osbit.pythonBits())
def onLoad(self): self.windowTitle = 'Particle System Editor' self.container = self.requestDocumentWindow('MockParticleEditor', title = 'Particle System Editor', size = (500,300), minSize = (500,300), # allowDock = False ) self.tool = self.addToolBar( 'particle_editor', self.container.addToolBar() ) self.addTool( 'particle_editor/save', label = 'Save', icon = 'save' ) self.addTool( 'particle_editor/----' ) self.addTool( 'particle_editor/add_state', label = '+ State' ) self.addTool( 'particle_editor/add_emitter', label = '+ Emitter' ) self.addTool( 'particle_editor/remove', label = 'Delete', icon = 'remove' ) self.addTool( 'particle_editor/update', label = 'Update', icon = 'refresh' ) self.addTool( 'particle_editor/----' ) self.addTool( 'particle_editor/start_preview', icon = 'play' ) self.addTool( 'particle_editor/stop_preview', icon = 'stop' ) self.window = window = self.container.addWidgetFromFile( _getModulePath('ParticleEditor2.ui') ) self.canvas = addWidgetWithLayout( MOAIEditCanvas( window.containerPreview ) ) self.tree = addWidgetWithLayout( ParticleTreeWidget( window.containerTree, multiple_selection = False, editable = False ) ) self.tree.module = self self.propEditor = addWidgetWithLayout( PropertyEditor( window.containerProperty ) ) window.textScriptRender.textChanged.connect( self.onScriptModified ) window.textScriptInit.textChanged.connect( self.onScriptModified ) self.window.panelScript.setEnabled( False ) self.propEditor.propertyChanged.connect( self.onPropertyChanged )
def createWidget(self, container): self.container = uic.loadUi(_getModulePath("AnimPreview.ui")) self.canvas = addWidgetWithLayout(MOAIEditCanvas(container), self.container.canvasContainer) self.listAnim = self.container.listAnim self.listAnim.setSortingEnabled(True) self.listAnim.itemSelectionChanged.connect(self.onItemSelectionChanged) self.container.topToolBar.hide() # not in use currently self.canvas.loadScript(_getModulePath("AnimPreview.lua")) return self.container
def onLoad(self): self.windowTitle = 'Particle System Editor' self.container = self.requestDocumentWindow( 'MockParticleEditor', title='Particle System Editor', size=(500, 300), minSize=(500, 300), # allowDock = False ) self.tool = self.addToolBar('particle_editor', self.container.addToolBar()) self.addTool('particle_editor/save', label='Save', icon='save') self.addTool('particle_editor/----') self.addTool('particle_editor/add_state', label='+ State') self.addTool('particle_editor/add_emitter', label='+ Emitter') self.addTool('particle_editor/remove', label='Delete', icon='remove') self.addTool('particle_editor/update', label='Update', icon='refresh') self.addTool('particle_editor/----') self.addTool('particle_editor/start_preview', icon='play') self.addTool('particle_editor/stop_preview', icon='stop') self.window = window = self.container.addWidgetFromFile( _getModulePath('ParticleEditor2.ui')) self.canvas = addWidgetWithLayout( MOAIEditCanvas(window.containerPreview)) self.tree = addWidgetWithLayout( ParticleTreeWidget(window.containerTree, multiple_selection=False, editable=False)) self.tree.module = self self.propEditor = addWidgetWithLayout( PropertyEditor(window.containerProperty)) window.textScriptRender.textChanged.connect(self.onScriptModified) window.textScriptInit.textChanged.connect(self.onScriptModified) self.window.panelScript.setEnabled(False) self.propEditor.propertyChanged.connect(self.onPropertyChanged)
def onLoad(self): self.container = self.requestDocumentWindow( "MockStyleSheetEditor", title="Style Sheet Editor", size=(500, 300), minSize=(500, 300), dock="right" ) self.toolBar = self.addToolBar("style_sheet", self.container.addToolBar()) self.window = window = self.container.addWidgetFromFile(_getModulePath("styleEditor.ui")) self.tree = addWidgetWithLayout( StyleTreeWidget( self.window.containerTree, multiple_selection=False, editable=True, show_root=False, sorting=True, drag_mode=False, ) ) self.tree.module = self self.propEditor = addWidgetWithLayout(PropertyEditor(window.containerProp)) # Previews self.canvasPreviewSheet = addWidgetWithLayout(MOAIEditCanvas(window.previewSheet)) self.canvasPreviewSheet.loadScript(_getModulePath("StyleSheetPreview.lua")) self.canvasPreviewStyle = addWidgetWithLayout(MOAIEditCanvas(window.previewStyle)) self.canvasPreviewStyle.loadScript(_getModulePath("SingleStylePreview.lua")) # Tools self.addTool("style_sheet/save", label="Save", icon="save") self.addTool("style_sheet/add_style", label="Add Style", icon="add") self.addTool("style_sheet/remove_style", label="Remove Style", icon="remove") self.addTool("style_sheet/clone_style", label="Clone Style", icon="clone") # signals self.propEditor.propertyChanged.connect(self.onPropertyChanged) window.textStylePreview.textChanged.connect(self.onStylePreviewTextChanged) window.textSheetPreview.textChanged.connect(self.onSheetPreviewTextChanged)
def createWidget(self, container): self.container = uic.loadUi( _getModulePath('FontPreview.ui') ) self.canvas = addWidgetWithLayout( MOAIEditCanvas(container), self.container.canvasContainer ) self.canvas.loadScript( _getModulePath('FontPreview.lua') ) self.container.textPreview.textChanged.connect( self.onTextChanged ) self.container.spinFontSize.valueChanged.connect( self.onSizeChanged ) return self.container
def createWidget(self, container): self.container = uic.loadUi(_getModulePath('AnimPreview.ui')) self.canvas = addWidgetWithLayout(MOAIEditCanvas(container), self.container.canvasContainer) self.listAnim = self.container.listAnim self.listAnim.setSortingEnabled(True) self.listAnim.itemSelectionChanged.connect(self.onItemSelectionChanged) self.container.topToolBar.hide() #not in use currently self.canvas.loadScript(_getModulePath('AnimPreview.lua')) return self.container
def __init__( self ): QtGui.QWidget.__init__( self ) self.ui = addWidgetWithLayout( uic.loadUi( _getModulePath( 'stub.ui' ) ), self ) self.setMinimumSize( 600,400 ) self.setMaximumSize( 600,400 ) self.ui.buttonOpen.clicked.connect( self.onButtonOpen ) self.ui.buttonNew.clicked.connect( self.onButtonNew ) self.setWindowTitle( 'GII ( %d bits )' % osbit.pythonBits() )
def onLoad(self): self.windowTitle = 'Pex Editor' self.container = self.requestDocumentWindow( 'SimpleParticleEditor', title='Pex Editor', size=(500, 300), minSize=(500, 300), ) self.toolbar = self.addToolBar('simple_particle_editor', self.container.addToolBar()) self.window = window = self.container.addWidgetFromFile( _getModulePath('SimpleParticleEditor.ui')) self.propEditor = addWidgetWithLayout( PropertyEditor(window.containerPropSystem)) self.canvas = addWidgetWithLayout( MOAIEditCanvas(window.containerPreview)) self.canvas.loadScript(_getModulePath('SimpleParticleEditor.lua')) self.addTool('simple_particle_editor/save', label='Save', icon='save') self.addTool('simple_particle_editor/clone', label='Clone', icon='clone') self.propEditor.propertyChanged.connect(self.onPropertyChanged) signals.connect('asset.modified', self.onAssetModified) self.container.setEnabled(False) self.editingAsset = None self.updateSchduleTimer = QtCore.QTimer(self.container) self.updateSchduleTimer.setInterval(50) self.updateSchduleTimer.setSingleShot(True) self.updateSchduleTimer.timeout.connect(self.updatePreview)
def onLoad(self): self.windowTitle = 'Shader Editor' self.container = self.requestDocumentWindow( 'ShaderEditor', title='Shader Editor', size=(500, 300), minSize=(500, 300), # allowDock = False ) self.tool = self.addToolBar('shader_editor', self.container.addToolBar()) self.addTool('shader_editor/save', label='Save', icon='save') self.addTool('shader_editor/refresh', label='Refresh', icon='refresh') self.window = window = self.container.addWidgetFromFile( _getModulePath('ShaderEditor.ui')) self.canvas = addWidgetWithLayout( MOAIEditCanvas(window.containerPreview)) self.tree = addWidgetWithLayout( ShaderUniformTreeWidget(window.containerTree, multiple_selection=False, editable=True)) self.tree.module = self
def onLoad(self): userSettings = app.getProject().getUserSetting('locale_manager', {}) self._isAdmin = userSettings.get('is_admin') self.currentPackEntry = None self.windowTitle = 'Locale Pack Manager' self.container = self.requestDocumentWindow('localepackmanager', title='Locale Packs', size=(500, 300), minSize=(500, 300) # allowDock = False ) self.tool = self.addToolBar('locale_pack_manager', self.container.addToolBar()) self.addTool('locale_pack_manager/refresh', label='Refresh', icon='refresh') self.addTool('locale_pack_manager/----') self.addTool('locale_pack_manager/locate', label='Locate', icon='search') if self._isAdmin: self.addTool('locale_pack_manager/----') self.addTool('locale_pack_manager/build_source', label='Build Source') #self.addTool( 'locale_pack_manager/update_remote', label = 'Update Remote' ) self.addTool('locale_pack_manager/----') self.addTool('locale_pack_manager/sync_external', label='Sync External') self.window = window = self.container.addWidgetFromFile( _getModulePath('window.ui')) treePacksFilter = addWidgetWithLayout( GenericTreeFilter(window.containerLeft)) self.treePacks = treePacks = addWidgetWithLayout( LocalePackTreeWidget(window.containerLeft)) self.treePacks.module = self treePacks.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) treePacksFilter.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) treePacksFilter.setTargetTree(self.treePacks) treeItemsFilter = addWidgetWithLayout( GenericTreeFilter(window.containerRight)) self.treeItems = treeItems = addWidgetWithLayout( LocalePackItemTreeWidget(window.containerRight)) self.treeItems.module = self treeItems.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) treeItemsFilter.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) treeItemsFilter.setTargetTree(self.treeItems) self.addMenuItem('main/asset/----') self.addMenuItem( 'main/asset/locale_pack_manager', { 'label': 'Locale Pack Manager', 'on_click': lambda menu: self.setFocus() }) self.mockLocaleManager = None
def onLoad(self): self.windowTitle = 'Deck2D Pack Editor' self.container = self.requestDocumentWindow('MockDeck2DEditor', title = 'Deck2D Pack Editor', size = (500,300), minSize = (500,300), dock = 'right' # allowDock = False ) self.window = window = self.container.addWidgetFromFile( _getModulePath('Deck2DEditor.ui') ) self.propEditor = addWidgetWithLayout( PropertyEditor(window.settingsContainer), window.settingsContainer ) self.canvas = addWidgetWithLayout( MOAIEditCanvas( window.canvasContainer ), window.canvasContainer ) self.canvas.loadScript( _getModulePath('Deck2DEditor.lua') ) self.canvas.setDelegateEnv( 'updateEditor', self.onCanvasUpdateRequested ) self.canvas.setDelegateEnv( 'triangulatePolygon', triangulatePolygon ) #setup listwidget treeSprites = addWidgetWithLayout( SpriteTreeWidget( self.window.containerSpriteTree, multiple_selection = False ) ) treeSprites.module = self treeSprites.setSortingEnabled(True) self.treeSprites = treeSprites #signals window.toolAddQuad .clicked. connect( lambda: self.addItem('quad') ) window.toolAddQuadArray .clicked. connect( lambda: self.addItem('quad_array') ) window.toolAddTileset .clicked. connect( lambda: self.addItem('tileset') ) window.toolAddStretchPatch .clicked. connect( lambda: self.addItem('stretchpatch') ) window.toolAddPoly .clicked. connect( lambda: self.addItem('polygon') ) window.toolSave .clicked. connect( self.saveAsset ) window.toolRemove .clicked. connect( self.onRemoveItem ) window.toolClone .clicked. connect( self.onCloneItem ) window.toolOriginE .clicked. connect( lambda: self.setOrigin('E') ) window.toolOriginS .clicked. connect( lambda: self.setOrigin('S') ) window.toolOriginW .clicked. connect( lambda: self.setOrigin('W') ) window.toolOriginN .clicked. connect( lambda: self.setOrigin('N') ) window.toolOriginSE .clicked. connect( lambda: self.setOrigin('SE') ) window.toolOriginSW .clicked. connect( lambda: self.setOrigin('SW') ) window.toolOriginNE .clicked. connect( lambda: self.setOrigin('NE') ) window.toolOriginNW .clicked. connect( lambda: self.setOrigin('NW') ) window.toolOriginC .clicked. connect( lambda: self.setOrigin('C') ) window.checkAlphaView .stateChanged .connect( self.toggleAlphaView ) self.propEditor .propertyChanged .connect(self.onPropertyChanged) signals.connect('asset.modified', self.onAssetModified) self.container.setEnabled( False )
def onLoad(self): self.windowTitle = 'Effect System Editor' self.container = self.requestDocumentWindow( 'MockEffectEditor', title='Effect Editor', size=(500, 300), minSize=(500, 300), # allowDock = False ) self.tool = self.addToolBar('effect_editor', self.container.addToolBar()) self.addTool('effect_editor/save', label='Save', icon='save') self.addTool('effect_editor/----') self.addTool('effect_editor/remove_node', icon='remove') self.addTool('effect_editor/clone_node', icon='clone') self.addTool('effect_editor/add_system', label='+System') self.addTool('effect_editor/add_child', label='+Child') self.addTool('effect_editor/----') self.addTool('effect_editor/add_move', label='+Move') self.addTool('effect_editor/----') self.addTool('effect_editor/move_up', icon='arrow-up') self.addTool('effect_editor/move_down', icon='arrow-down') self.addTool('effect_editor/----') self.addTool('effect_editor/toggle_preview', icon='play', type='check') self.window = window = self.container.addWidgetFromFile( _getModulePath('EffectEditor.ui')) self.canvas = addWidgetWithLayout( MOAIEditCanvas(window.containerPreview)) window.setFocusProxy(self.canvas) self.tree = addWidgetWithLayout( EffectNodeTreeWidget(window.containerTree)) self.tree.module = self propLayout = QtGui.QVBoxLayout() window.containerEditor.setLayout(propLayout) propLayout.setSpacing(2) propLayout.setMargin(0) self.nodePropEditor = PropertyEditor(window.containerEditor) self.paramPropEditor = PropertyEditor(window.containerEditor) propLayout.addWidget(self.nodePropEditor) propLayout.addWidget(self.paramPropEditor) self.paramPropEditor.setVisible(False) window.containerScript.setVisible(False) self.codebox = codebox = addWidgetWithLayout( CodeEditor(window.containerScript)) settingData = jsonHelper.tryLoadJSON( self.getApp().findDataFile('script_settings.json')) # if settingData: # codebox.applySetting( settingData ) self.editingTarget = None #ShortCuts self.addShortcut(self.container, '+', self.addSystem) self.addShortcut(self.container, '=', self.promptAddChild) self.addShortcut(self.container, '-', self.removeNode) # self.addShortcut( self.container, ']', self.moveNodeUp ) # self.addShortcut( self.container, '[', self.moveNodeDown ) self.addShortcut(self.container, 'ctrl+D', self.cloneNode) self.addShortcut(self.container, 'f5', self.togglePreview) self.addShortcut(self.container, 'f4', self.restartPreview) #Signals self.nodePropEditor.propertyChanged.connect(self.onNodePropertyChanged) self.paramPropEditor.propertyChanged.connect( self.onParamPropertyChanged) self.codebox.textChanged.connect(self.onScriptChanged)
def onLoad( self ): self.configPath = self.getProject().getConfigPath( _DEPLOY_CONFIG_FILE ) #UI self.container = self.requestDocumentWindow( 'DeployManager', title = 'Deployment Manager', allowDock = False, minSize = ( 300, 300 ), maxSize = ( 300, 300 ) ) #Components self.window = self.container.addWidgetFromFile( _getModulePath('DeployManager.ui') ) self.delegate = MOAILuaDelegate( self ) self.delegate.load( _getModulePath( 'DeployManager.lua' ) ) #scene tree layout = QtGui.QVBoxLayout() self.window.containerSceneTree.setLayout( layout ) layout.setSpacing( 0 ) layout.setMargin( 0 ) self.treeScene = DeploySceneTree( self.window.containerSceneTree, editable = True, sorting = False, multiple_selection = False ) self.treeScene.manager = self layout.addWidget( self.treeScene ) sceneToolbar = QtGui.QToolBar( self.window.containerSceneTree ) layout.addWidget( sceneToolbar ) self.sceneTool = self.addToolBar( 'deploy_scene', sceneToolbar ) self.addTool( 'deploy_scene/add_scene', label = 'add' ,icon = 'add' ) self.addTool( 'deploy_scene/remove_scene', label = 'remove' ,icon = 'remove' ) self.addTool( 'deploy_scene/move_up_scene', label = 'up' ,icon = 'arrow-up' ) self.addTool( 'deploy_scene/move_down_scene', label = 'down' ,icon = 'arrow-down' ) self.addTool( 'deploy_scene/----' ) self.addTool( 'deploy_scene/edit_scene', label = 'change target scene' ,icon = 'pencil' ) self.addTool( 'deploy_scene/----' ) self.addTool( 'deploy_scene/set_entry_scene', label = 'set as entry' ,icon = 'flag' ) #deploy target tree layout = QtGui.QVBoxLayout() self.window.containerTargetTree.setLayout( layout ) layout.setSpacing( 0 ) layout.setMargin( 0 ) self.treeTarget = DeployTargetTree( self.window.containerTargetTree, editable = True, multiple_selection = False ) self.treeTarget.manager = self layout.addWidget( self.treeTarget ) targetToolbar = QtGui.QToolBar( self.window.containerTargetTree ) layout.addWidget( targetToolbar ) self.targetTool = self.addToolBar( 'deploy_target', targetToolbar ) self.addTool( 'deploy_target/add_target', label = '+' ) self.addTool( 'deploy_target/remove_target', label = '-' ) #target property self.propertyTarget = addWidgetWithLayout( PropertyEditor( self.window.containerTargetProp ) ) #menu self.addMenuItem( 'main/file/----' ) self.addMenuItem( 'main/file/deploy_manager', dict( label = 'Deploy Manager', shortcut = 'F11' ) ) self.addMenuItem( 'main/file/deploy_build', dict( label = 'Deploy Build', shortcut = 'Ctrl+F11' ) ) # self.container.show() self.window.buttonOK.clicked.connect( self.onButtonOK ) #other registerSearchEnumerator( deployTargetSearchEnumerator ) signals.connect( 'project.pre_deploy', self.preDeploy ) signals.connect( 'project.deploy', self.onDeploy ) signals.connect( 'project.post_deploy', self.postDeploy )
def onLoad(self): self.configPath = self.getProject().getConfigPath(_DEPLOY_CONFIG_FILE) #UI self.container = self.requestDocumentWindow('DeployManager', title='Deployment Manager', allowDock=False, minSize=(300, 300), maxSize=(300, 300)) #Components self.window = self.container.addWidgetFromFile( _getModulePath('DeployManager.ui')) self.delegate = MOAILuaDelegate(self) self.delegate.load(_getModulePath('DeployManager.lua')) #scene tree layout = QtGui.QVBoxLayout() self.window.containerSceneTree.setLayout(layout) layout.setSpacing(0) layout.setMargin(0) self.treeScene = DeploySceneTree(self.window.containerSceneTree, editable=True, sorting=False, multiple_selection=False) self.treeScene.manager = self layout.addWidget(self.treeScene) sceneToolbar = QtGui.QToolBar(self.window.containerSceneTree) layout.addWidget(sceneToolbar) self.sceneTool = self.addToolBar('deploy_scene', sceneToolbar) self.addTool('deploy_scene/add_scene', label='add', icon='add') self.addTool('deploy_scene/remove_scene', label='remove', icon='remove') self.addTool('deploy_scene/move_up_scene', label='up', icon='arrow-up') self.addTool('deploy_scene/move_down_scene', label='down', icon='arrow-down') self.addTool('deploy_scene/----') self.addTool('deploy_scene/edit_scene', label='change target scene', icon='pencil') self.addTool('deploy_scene/----') self.addTool('deploy_scene/set_entry_scene', label='set as entry', icon='flag') #deploy target tree layout = QtGui.QVBoxLayout() self.window.containerTargetTree.setLayout(layout) layout.setSpacing(0) layout.setMargin(0) self.treeTarget = DeployTargetTree(self.window.containerTargetTree, editable=True, multiple_selection=False) self.treeTarget.manager = self layout.addWidget(self.treeTarget) targetToolbar = QtGui.QToolBar(self.window.containerTargetTree) layout.addWidget(targetToolbar) self.targetTool = self.addToolBar('deploy_target', targetToolbar) self.addTool('deploy_target/add_target', label='+') self.addTool('deploy_target/remove_target', label='-') #target property self.propertyTarget = addWidgetWithLayout( PropertyEditor(self.window.containerTargetProp)) #menu self.addMenuItem('main/file/----') self.addMenuItem('main/file/deploy_manager', dict(label='Deploy Manager', shortcut='F11')) self.addMenuItem('main/file/deploy_build', dict(label='Deploy Build', shortcut='Ctrl+F11')) # self.container.show() self.window.buttonOK.clicked.connect(self.onButtonOK) #other registerSearchEnumerator(deployTargetSearchEnumerator) signals.connect('project.pre_deploy', self.preDeploy) signals.connect('project.deploy', self.onDeploy) signals.connect('project.post_deploy', self.postDeploy)
def onLoad(self): self.container = self.requestDocumentWindow( 'MockTextureManager', title='TextureManager', size=(500, 300), minSize=(500, 300), # allowDock = False ) self.toolbar = self.addToolBar('texture_manager', self.container.addToolBar()) self.window = window = self.container.addWidgetFromFile( _getModulePath('TextureManager.ui')) self.tree = addWidgetWithLayout( TextureTreeWidget(window.containerTree, drag_mode='internal', editable=True, multiple_selection=True, expanded=False)) self.tree.module = self self.treeFilter = GenericTreeFilter(window.containerTree) window.containerTree.layout().insertWidget(0, self.treeFilter) self.treeFilter.setTargetTree(self.tree) self.propEditor = addWidgetWithLayout( PropertyEditor(window.containerProp)) self.canvas = addWidgetWithLayout( MOCKEditCanvas(window.containerPreview)) self.canvas.loadScript(_getModulePath('TextureManager.lua')) self.addMenuItem('main/asset/----') self.addMenuItem('main/asset/texture_manager', { 'label': 'Texture Manager', 'on_click': lambda menu: self.setFocus() }) self.addTool('texture_manager/rebuild', label='Rebuild', icon='refresh') self.addTool('texture_manager/----') self.addTool('texture_manager/add_group', label='Add Group', icon='add') self.addTool('texture_manager/remove_group', label='Remove Group', icon='remove') self.addTool('texture_manager/----') self.addTool('texture_manager/assign_group', label='Assign Group', icon='in') self.addTool('texture_manager/----') self.addTool('texture_manager/assign_processor', label='Assign Processor', icon='compose') self.addTool('texture_manager/clear_processor', label='Clear Processor', icon='remove') self.addTool('texture_manager/----') self.addTool('texture_manager/apply', label='Apply Changes') self.addShortcut(self.container, '=', self.regroupTo) self.addShortcut(self.container, '-', self.regroup, 'default') self.propEditor.propertyChanged.connect(self.onPropertyChanged) registerSearchEnumerator(textureGroupSearchEnumerator)