Ejemplo n.º 1
0
	def MainBackup_buildLayout(self,parent):
		BufferLayout = MelColumnLayout(parent)

		#>>>  Snap Section
		guiFactory.header('Buffers')
		guiFactory.lineSubBreak()
		
		bufferScroll = MelScrollLayout(BufferLayout,cr = 1)
		for i,b in enumerate(self.objectBuffers):
			self.b = MelHSingleStretchLayout(bufferScroll,h = 20)
			
			MelSpacer(self.b, w = 2)
			"""
			
			lambda *a:bufferToolsLib.selectBufferObjects(self.objectBuffers[i]),
			"%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.selectBufferObjects('",b,"')"),
			
			"""
			guiFactory.doButton2(self.b,
			                     'Sel',
			                     "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.selectBufferObjects('",b,"')"),
			                     'Select the buffer objects')
			tmp = MelTextField(self.b, w = 100,ut = 'cgmUIReservedTemplate', text = b, editable = False)
			self.b.setStretchWidget(tmp)
			guiFactory.doButton2(self.b,
			                     '+',
			                     "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.addSelected('",b,"')"),
			                     'Add selected  to the buffer')
			guiFactory.doButton2(self.b,
			                     '-',
			                     "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.removeSelected('",b,"')"),
			                     'Remove selected  to the buffer')
			guiFactory.doButton2(self.b,
			                     'k',
			                     "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.keyBuffer('",b,"')"),
			                     'Key buffer')
			guiFactory.doButton2(self.b,
			                     'p',
			                     "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.purgeBuffer('",b,"')"),
			                     'Purge buffer')			
			
			MelSpacer(self.b, w = 2)
			self.b.layout()
			
		mc.setParent(BufferLayout)
		guiFactory.lineSubBreak()
			
		guiFactory.lineBreak()
		guiFactory.doButton2(BufferLayout,
	                         'Create Buffer',
	                         lambda *a:bufferToolsLib.createBuffer(self),
	                         'Create new buffer from selected buffer')	
		


		"""
		for b in self.objectBuffers:
			self.b = MelFormLayout(BufferLayout,height = 20)
			tmpSel = guiFactory.doButton2(self.b,
			                              'Sel',
			                              lambda *a:bufferToolsLib.selectBufferObjects(b),
			                              'Select the buffer objects')
			tmpName = MelTextField(self.b, w = 100,ut = 'cgmUIReservedTemplate', text = b, editable = False)
			
			tmpAdd = guiFactory.doButton2(self.b,
			                               '+',
			                               lambda *a:bufferToolsLib.addSelected(b),
			                               'Add selected  to the buffer')
			tmpRem= guiFactory.doButton2(self.b,
			                             '-',
			                             lambda *a:bufferToolsLib.removeSelected(b),
			                             'Remove selected  to the buffer')
			tmpKey = guiFactory.doButton2(self.b,
			                              'k',
			                              lambda *a:bufferToolsLib.keyBuffer(b),
			                              'Key buffer')
			tmpPurge = guiFactory.doButton2(self.b,
			                                'p',
			                                lambda *a:bufferToolsLib.purgeBuffer(b),
			                                'Purge buffer')	
			mc.formLayout(self.b, edit = True,
			              af = [tmpSel, "left", 0],
			              ac = [tmpName,"left",0,tmpSel],
			              ac = [tmpName,"right",0,tmpAdd],
			              ac = [tmpAdd,"right",0,tmpRem],
			              ac = [tmpRem,"right",0,tmpKey],
			              ac = [tmpKey,"right",0,tmpPurge],
			              af = [tmpPurge,"right",0])
			
			
		
		"""
		"""
Ejemplo n.º 2
0
	def MainBackup_buildLayout(self,parent):
		BufferLayout = MelColumnLayout(parent)

		#>>>  Snap Section
		guiFactory.header('Buffers')
		guiFactory.lineSubBreak()
		
		bufferScroll = MelScrollLayout(BufferLayout,cr = 1)
		for i,b in enumerate(self.objectBuffers):
			self.b = MelHSingleStretchLayout(bufferScroll,h = 20)
			
			MelSpacer(self.b, w = 2)
			"""
			
			lambda *a:bufferToolsLib.selectBufferObjects(self.objectBuffers[i]),
			"%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.selectBufferObjects('",b,"')"),
			
			"""
			guiFactory.doButton2(self.b,
			                     'Sel',
			                     "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.selectBufferObjects('",b,"')"),
			                     'Select the buffer objects')
			tmp = MelTextField(self.b, w = 100,ut = 'cgmUIReservedTemplate', text = b, editable = False)
			self.b.setStretchWidget(tmp)
			guiFactory.doButton2(self.b,
			                     '+',
			                     "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.addSelected('",b,"')"),
			                     'Add selected  to the buffer')
			guiFactory.doButton2(self.b,
			                     '-',
			                     "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.removeSelected('",b,"')"),
			                     'Remove selected  to the buffer')
			guiFactory.doButton2(self.b,
			                     'k',
			                     "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.keyBuffer('",b,"')"),
			                     'Key buffer')
			guiFactory.doButton2(self.b,
			                     'p',
			                     "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.purgeBuffer('",b,"')"),
			                     'Purge buffer')			
			
			MelSpacer(self.b, w = 2)
			self.b.layout()
			
		mc.setParent(BufferLayout)
		guiFactory.lineSubBreak()
			
		guiFactory.lineBreak()
		guiFactory.doButton2(BufferLayout,
	                         'Create Buffer',
	                         lambda *a:bufferToolsLib.createBuffer(self),
	                         'Create new buffer from selected buffer')	
		


		"""
		for b in self.objectBuffers:
			self.b = MelFormLayout(BufferLayout,height = 20)
			tmpSel = guiFactory.doButton2(self.b,
			                              'Sel',
			                              lambda *a:bufferToolsLib.selectBufferObjects(b),
			                              'Select the buffer objects')
			tmpName = MelTextField(self.b, w = 100,ut = 'cgmUIReservedTemplate', text = b, editable = False)
			
			tmpAdd = guiFactory.doButton2(self.b,
			                               '+',
			                               lambda *a:bufferToolsLib.addSelected(b),
			                               'Add selected  to the buffer')
			tmpRem= guiFactory.doButton2(self.b,
			                             '-',
			                             lambda *a:bufferToolsLib.removeSelected(b),
			                             'Remove selected  to the buffer')
			tmpKey = guiFactory.doButton2(self.b,
			                              'k',
			                              lambda *a:bufferToolsLib.keyBuffer(b),
			                              'Key buffer')
			tmpPurge = guiFactory.doButton2(self.b,
			                                'p',
			                                lambda *a:bufferToolsLib.purgeBuffer(b),
			                                'Purge buffer')	
			mc.formLayout(self.b, edit = True,
			              af = [tmpSel, "left", 0],
			              ac = [tmpName,"left",0,tmpSel],
			              ac = [tmpName,"right",0,tmpAdd],
			              ac = [tmpAdd,"right",0,tmpRem],
			              ac = [tmpRem,"right",0,tmpKey],
			              ac = [tmpKey,"right",0,tmpPurge],
			              af = [tmpPurge,"right",0])
			
			
		
		"""
		"""
Ejemplo n.º 3
0
	def Main_buildLayout(self,parent):
		MainForm = MelFormLayout(parent)

		#>>>  Snap Section
		BufferHeader = guiFactory.header('Buffers')
		HelpInfo = MelLabel(MainForm,
		                    l = " Set buffer options: Set active, select, change name,add,remove,key,purge",
		                    ut = 'cgmUIInstructionsTemplate',
		                    al = 'center',
		                    ww = True,vis = self.ShowHelpOption)
		self.helpBlurbs.extend([HelpInfo])
		
		BufferListScroll = MelScrollLayout(MainForm,cr = 1, ut = 'cgmUISubTemplate')
		BufferMasterForm = MelFormLayout(BufferListScroll)
		BufferListColumn = MelColumnLayout(BufferMasterForm, adj = True, rowSpacing = 3)
		
		for i,b in enumerate(self.objectBuffers):
			tmpSetRow = MelFormLayout(BufferListColumn,height = 20)
			
			#Get check box state
			activeState = False
			if b in self.activeObjectBuffersOptionVar.value:
				activeState = True
			
			tmpActive = MelCheckBox(tmpSetRow,
			                        annotation = 'Set buffer set as active',
			                        value = activeState,
			                        onCommand =  "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.setBufferAsActive('cgmVar_activeObjectBuffers','",b,"')"),
			                        offCommand = "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.setBufferAsInactive('cgmVar_activeObjectBuffers','",b,"')"))
			tmpSel = guiFactory.doButton2(tmpSetRow,
			                              's->',
										  "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.selectBufferObjects('",b,"')"),
			                              'Select the buffer objects')
			
			tmpName = MelTextField(tmpSetRow, w = 100,ut = 'cgmUIReservedTemplate', text = b)
			bField = "%s"%tmpName
			bName = "%s"%b
			tmpName(edit = True,
			        ec = lambda *a:bufferToolsLib.updateBufferName(self,bField,bName))
			
			"""
			tmpName(edit = True,
			        ec = "%s%s%s%s%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.updateBufferName('",self,"','",tmpName,"','",b,"')"))
			"""
			tmpAdd = guiFactory.doButton2(tmpSetRow,
			                               '+',
										   "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.addSelected('",b,"')"),
			                               'Add selected  to the buffer')
			tmpRem= guiFactory.doButton2(tmpSetRow,
			                             '-',
										 "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.removeSelected('",b,"')"),
			                             'Remove selected  to the buffer')
			tmpKey = guiFactory.doButton2(tmpSetRow,
			                              'k',
										  "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.keyBuffer('",b,"')"),
			                              'Key buffer')
			tmpPurge = guiFactory.doButton2(tmpSetRow,
			                                'p',
											"%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.purgeBuffer('",b,"')"),
			                                'Purge buffer')	
			mc.formLayout(tmpSetRow, edit = True,
			              af = [(tmpActive, "left", 2),
			                    (tmpPurge,"right",0)],
			              ac = [(tmpSel,"left",0,tmpActive),
			                    (tmpName,"left",2,tmpSel),
			                    (tmpName,"right",2,tmpAdd),
			                    (tmpAdd,"right",2,tmpRem),
			                    (tmpRem,"right",2,tmpKey),
			                    (tmpKey,"right",2,tmpPurge)])
			
			MelSpacer(tmpSetRow, w = 2)
		
		
		
			
		
		NewBufferRow = guiFactory.doButton2(MainForm,
		                                    'Create Buffer',
		                                    lambda *a:bufferToolsLib.createBuffer(self),
		                                    'Create new buffer from selected buffer')	
			
		BufferMasterForm(edit = True,
		                 af = [(BufferListColumn,"top",0),
		                       (BufferListColumn,"left",0),
		                       (BufferListColumn,"right",0),
		                       (BufferListColumn,"bottom",0)])
		                 
		MainForm(edit = True,
		         af = [(BufferHeader,"top",0),
		               (BufferHeader,"left",0),
		               (BufferHeader,"right",0),
		               (HelpInfo,"left",0),
		               (HelpInfo,"right",0),
		               (BufferListScroll,"left",0),
		               (BufferListScroll,"right",0),
		               (NewBufferRow,"left",4),
		               (NewBufferRow,"right",4),
		               (NewBufferRow,"bottom",4)],
		         ac = [(HelpInfo,"top",0,BufferHeader),
		               (BufferListScroll,"top",0,HelpInfo),
		               (BufferListScroll,"bottom",0,NewBufferRow)],
		         attachNone = [(NewBufferRow,"top")])


		"""
Ejemplo n.º 4
0
	def Main_buildLayout(self,parent):
		MainForm = MelFormLayout(parent)

		#>>>  Snap Section
		BufferHeader = guiFactory.header('Buffers')
		HelpInfo = MelLabel(MainForm,
		                    l = " Set buffer options: Set active, select, change name,add,remove,key,purge",
		                    ut = 'cgmUIInstructionsTemplate',
		                    al = 'center',
		                    ww = True,vis = self.ShowHelpOption)
		self.helpBlurbs.extend([HelpInfo])
		
		BufferListScroll = MelScrollLayout(MainForm,cr = 1, ut = 'cgmUISubTemplate')
		BufferMasterForm = MelFormLayout(BufferListScroll)
		BufferListColumn = MelColumnLayout(BufferMasterForm, adj = True, rowSpacing = 3)
		
		for i,b in enumerate(self.objectBuffers):
			tmpSetRow = MelFormLayout(BufferListColumn,height = 20)
			
			#Get check box state
			activeState = False
			if b in self.activeObjectBuffersOptionVar.value:
				activeState = True
			
			tmpActive = MelCheckBox(tmpSetRow,
			                        annotation = 'Set buffer set as active',
			                        value = activeState,
			                        onCommand =  "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.setBufferAsActive('cgmVar_activeObjectBuffers','",b,"')"),
			                        offCommand = "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.setBufferAsInactive('cgmVar_activeObjectBuffers','",b,"')"))
			tmpSel = guiFactory.doButton2(tmpSetRow,
			                              's->',
										  "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.selectBufferObjects('",b,"')"),
			                              'Select the buffer objects')
			
			tmpName = MelTextField(tmpSetRow, w = 100,ut = 'cgmUIReservedTemplate', text = b)
			bField = "%s"%tmpName
			bName = "%s"%b
			tmpName(edit = True,
			        ec = lambda *a:bufferToolsLib.updateBufferName(self,bField,bName))
			
			"""
			tmpName(edit = True,
			        ec = "%s%s%s%s%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.updateBufferName('",self,"','",tmpName,"','",b,"')"))
			"""
			tmpAdd = guiFactory.doButton2(tmpSetRow,
			                               '+',
										   "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.addSelected('",b,"')"),
			                               'Add selected  to the buffer')
			tmpRem= guiFactory.doButton2(tmpSetRow,
			                             '-',
										 "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.removeSelected('",b,"')"),
			                             'Remove selected  to the buffer')
			tmpKey = guiFactory.doButton2(tmpSetRow,
			                              'k',
										  "%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.keyBuffer('",b,"')"),
			                              'Key buffer')
			tmpPurge = guiFactory.doButton2(tmpSetRow,
			                                'p',
											"%s%s%s"%("from cgm.tools.lib import bufferToolsLib;bufferToolsLib.purgeBuffer('",b,"')"),
			                                'Purge buffer')	
			mc.formLayout(tmpSetRow, edit = True,
			              af = [(tmpActive, "left", 2),
			                    (tmpPurge,"right",0)],
			              ac = [(tmpSel,"left",0,tmpActive),
			                    (tmpName,"left",2,tmpSel),
			                    (tmpName,"right",2,tmpAdd),
			                    (tmpAdd,"right",2,tmpRem),
			                    (tmpRem,"right",2,tmpKey),
			                    (tmpKey,"right",2,tmpPurge)])
			
			MelSpacer(tmpSetRow, w = 2)
		
		
		
			
		
		NewBufferRow = guiFactory.doButton2(MainForm,
		                                    'Create Buffer',
		                                    lambda *a:bufferToolsLib.createBuffer(self),
		                                    'Create new buffer from selected buffer')	
			
		BufferMasterForm(edit = True,
		                 af = [(BufferListColumn,"top",0),
		                       (BufferListColumn,"left",0),
		                       (BufferListColumn,"right",0),
		                       (BufferListColumn,"bottom",0)])
		                 
		MainForm(edit = True,
		         af = [(BufferHeader,"top",0),
		               (BufferHeader,"left",0),
		               (BufferHeader,"right",0),
		               (HelpInfo,"left",0),
		               (HelpInfo,"right",0),
		               (BufferListScroll,"left",0),
		               (BufferListScroll,"right",0),
		               (NewBufferRow,"left",4),
		               (NewBufferRow,"right",4),
		               (NewBufferRow,"bottom",4)],
		         ac = [(HelpInfo,"top",0,BufferHeader),
		               (BufferListScroll,"top",0,HelpInfo),
		               (BufferListScroll,"bottom",0,NewBufferRow)],
		         attachNone = [(NewBufferRow,"top")])


		"""