def createEntries(self, master): self.f = Tkinter.Frame(master) self.f.grid(column=1, rowspan=6) self.entryX = NormVectEntry(master=self.f, label='Vector X', width=18) self.entryX.grid(row=0, column=0) self.entryX.callbacks.AddCallback(self.entryX_cb) self.thumbx = ThumbWheel(master=self.f, width=self.widthX, height=self.heightX, labcfg=self.labcfgX, wheelPad=self.wheelPadX) self.thumbx.callbacks.AddCallback(self.thumbx_cb) self.thumbx.grid(row=1, column=0) self.entryY = NormVectEntry(master=self.f, label='Vector Y', width=18) self.entryY.grid(row=2, column=0) self.entryY.callbacks.AddCallback(self.entryY_cb) self.thumby = ThumbWheel(master=self.f, width=self.widthY, height=self.heightY, labcfg=self.labcfgY, wheelPad=self.wheelPadY) self.thumby.callbacks.AddCallback(self.thumby_cb) self.thumby.grid(row=3, column=0) self.entryZ = NormVectEntry(master=self.f, label='Vector Z', width=18) self.entryZ.grid(row=4, column=0) self.entryZ.callbacks.AddCallback(self.entryZ_cb) self.thumbz = ThumbWheel(master=self.f, width=self.widthZ, height=self.heightZ, labcfg=self.labcfgZ, wheelPad=self.wheelPadZ) self.thumbz.callbacks.AddCallback(self.thumbz_cb) self.thumbz.grid(row=5, column=0) self.f.pack(side='top', expand=1) self.setVector([1.0, 0, 0], 'x') self.setVector([0.0, 1, 0], 'y') self.setVector([0.0, 0, 1], 'z')
def __init__(self, tasks, root=None): # create panel if needed if root is None: root = Tkinter.Toplevel() root.title("Execution profile") self.ownsMaster = True else: assert isinstance(root, Tkinter.Toplevel) or\ isinstance(root, Tkinter.Frame) self.ownsMaster = False self.root = root self.pixelsPersecond = 100 self.yoff = 20 self.scale = 1.0 self.scrolledCanvas = Pmw.ScrolledCanvas(root, canvas_width=600, canvas_bg='white', vscrollmode='static', hscrollmode='static', horizscrollbar_width=10, vertscrollbar_width=10) self.canvas = self.scrolledCanvas.component('canvas') self.scrollregion = [0, 0, 4000, 4000] self.canvas.configure(scrollregion=tuple(self.scrollregion)) self.scrolledCanvas.pack(expand=True, fill='both') f = self.bframe = Tkinter.Frame(root) self.scaleTimeTW = ThumbWheel(f, showLabel=0, width=70, height=16, type=float, value=0, callback=self.setTimeScaleFactor_cb, continuous=True, oneTurn=10, wheelPad=2, reportDelta=True) self.scaleTimeTW.pack(side='right', anchor='e') f.pack(side='bottom', expand=0, fill='x') self.relativeData = [] self.setTasks(tasks)
def __init__(self,master=None,callback=None,continuous=1): self.master=master self.callback = None self.callbacks = CallbackManager() self.canvas=canvas = Canvas(self.master,width=345,height=320,bg='white') self.toolbar = Frame(master) # Create Toolbar self.toolbar.pack(side='top', expand=1, fill='both') self.menuFrame1 = Tkinter.Frame(self.toolbar, relief='raised', borderwidth=3) self.menuFrame1.pack(side='top', expand=1, fill='x') self.filebutton = Tkinter.Menubutton(self.menuFrame1, text='File') self.filebutton.pack(side='left') self.filemenu = Tkinter.Menu(self.filebutton, {}) self.filemenu.add_command(label='Read', command=self.read_cb) self.filemenu.add_command(label='Write', command=self.write_cb) self.filebutton['menu'] = self.filemenu self.editbutton = Tkinter.Menubutton(self.menuFrame1, text='Edit') self.editbutton.pack(side='left', anchor='w') self.editmenu = Tkinter.Menu(self.editbutton, {}) self.editmenu.add_command(label='Reset to first in history', command=self.resetAll_cb) self.editmenu.add_command(label='Step back in history loop', command=self.stepBack_cb) self.editmenu.add_command(label='Default Curve', command=self.defaultcurve_cb) self.editmenu.add_command(label='Invert Curve',command=self.invertGraph) self.histvar=IntVar() self.histvar.set(1) self.editmenu.add_checkbutton(label='Histogram',var=self.histvar,command=self.drawHistogram) self.editbutton['menu'] = self.editmenu self.optionType = IntVar() self.updatebutton = Tkinter.Menubutton(self.menuFrame1, text='Update') self.updatebutton.pack(side='left', anchor='w') self.updatemenu = Tkinter.Menu(self.updatebutton,{} ) for v,s in {0:'Continuous',1:'MouseButtonUp',2:'Update'}.items(): self.updatemenu.add_radiobutton(label=s, var=self.optionType, value = v,command=self.calloption) if continuous==1: self.optionType.set(0) self.updatebutton['menu'] = self.updatemenu #Curve Type self.CurveType = IntVar() self.CurveType.set(0) self.Smooth=1 self.curvebutton = Tkinter.Menubutton(self.menuFrame1, text='Curve') self.curvebutton.pack(side='left', anchor='w') self.curvemenu = Tkinter.Menu(self.curvebutton,{} ) for v,s in {0:'Smooth',1:'Freehand'}.items(): self.curvemenu.add_radiobutton(label=s, var=self.CurveType, value = v,command=self.curveoption) self.curvebutton['menu'] = self.curvemenu f1 = Tkinter.Frame(self.master) f1.pack(side='bottom', fill='both', expand=1) self.d1scalewheellab=Label(f1,text="Sensitivity") self.d1scalewheellab.pack(side="left") self.d1scalewheel=ThumbWheel(width=100, height=26,wheelPad=4,master=f1,labcfg={'fg':'black', 'side':'left', 'text':'Test:'},wheelLabcfg1={'font':(ensureFontCase('times'),14,'bold')},wheelLabcfg2={'font':(ensureFontCase('times'),14,'bold')},canvascfg={'bg':'blue'},min = 0.0,max = 1.0,precision =4,showlabel =0,value =0.013,continuous =0,oneTurn =0.01,size = 200) self.d1scalewheel.pack(side="left") #tooltip self.balloon = Pmw.Balloon(f1) self.balloon.bind(self.d1scalewheel,"cutoff value for differences in Z xoordinates,small values generate more contours") self.Updatebutton=Button(f1,text=' Update ',command=self.Update) self.Updatebutton.pack(side=LEFT) self.Quitbutton=Button(f1,text=' Dismiss ',command=self.dismiss_cb) self.Quitbutton.pack(side=RIGHT) self.canvas.bind("<Button-1>", self.OnCanvasClicked) self.canvas.bind("<B1-Motion>", self.OnCanvasMouseDrag) self.canvas.bind("<ButtonRelease-1>", self.OnCanvasMouseUp) self.canvas.config(closeenough=2.0) self.canvas.pack(side=BOTTOM, fill=BOTH,expand=1) self.startpoint=(px,py)=(50,275) self.endpoint=(px1,py1)=(305,20) self.newpoints=[(px,py),(px1,py1)] self.canvas.create_rectangle([(px-1,py),(px1+1,py1)],fill='white',outline="black",width=1) self.canvas.create_text(46,281,text=0,anchor=N) #Drawing Graph Sheet for i in range(1,6): x=50+i*50 canvas.create_line(x,280,x,275,width=1) canvas.create_text(x,281,text='%d' %(50*i),anchor=N) for i in range(1,5): x=50+i*50 canvas.create_line(x,275,x,20,width=1,fill="gray80") for i in range(1,6): y=275-i*50 canvas.create_line(45,y,50,y,width=1) canvas.create_text(44,y,text='%d' %(50*i),anchor=E) for i in range(1,5): y=275-i*50 canvas.create_line(50,y,305,y,width=1,fill="gray80") (x,y)=self.newpoints[0] (x1,y1)=self.newpoints[-1] self.curline=canvas.create_line(self.newpoints,fill='black',width=1) #GRAY SCALE grays=[] for i in range(0,100,1): grays.append("gray"+"%d" %i) #grays.reverse() #bottom one x1=48 x2=51 self.canvas.create_rectangle([(50,315),(307,300)],fill='white',outline="black",width=0.5) for a in grays: if x1>306: x1=x2=306 self.canvas.create_rectangle([(x1+2.5,314),(x2+2.5,301)],fill=a,outline=a,width=1) x1=x1+2.5 x2=x2+2.5 #left one y1=274 y2=271 self.canvas.create_rectangle([(20,275),(5,20)],fill='black',outline="black",width=0.5) for a in grays: if y1>275: y1=y2=275 self.canvas.create_rectangle([(19,y1-2.5),(6,y2-2.5)],fill=a,outline=a,width=1) y1=y1-2.5 y2=y2-2.5 self.oldpoints=[] self.canvas.configure(cursor='cross') self.curovals=[] self.default_points=[(50,275),(88, 238), (101, 150), (154, 78), (75, 271),(305,20)] # now set the constructor options correctly using the configure method apply( self.configure, (),{'callback':callback,'continuous':continuous}) self.continuous=continuous self.mousebuttonup=0 self.update=0 self.range_points=[] self.history=[] self.bars=[] self.default_ramp=[] self.histvalues=[]
def __init__(self, master=None, viewerGui=None): if master is None: self.master = Tkinter.Toplevel() self.master.withdraw() self.master.title('Selection Settings') self.master.protocol('WM_DELETE_WINDOW', self.master.withdraw) else: self.master = master self.mainFrame = Tkinter.Frame(self.master, relief='ridge', borderwidth=3) # CONTOUR WIDTH if DejaVu.enableSelectionContour is True: lLabel = Tkinter.Label(self.mainFrame, text='Contour width:') lLabel.grid(row=0, column=0, sticky='w') self.contourSizeSlider = Slider.Slider(self.mainFrame, minval=0, maxval=10, immediate=1, incr=1, labelformat='%d', cursortype='int') self.contourSizeSlider.frame.grid(row=0, column=1, columnspan=3) def setContourWidthSliderValue_cb(val): DejaVu.selectionContourSize = val viewerGui.viewer.Redraw() self.contourSizeSlider.AddCallback(setContourWidthSliderValue_cb) else: lLabel = Tkinter.Label(self.mainFrame, text='Contour selection is disabled') lLabel.grid(row=0, column=0, columnspan=3, sticky='w') # BACKGROUND COLOR lLabel = Tkinter.Label(self.mainFrame, text='Contour color:') lLabel.grid(row=1, column=0, sticky='w') lFunc = CallBackFunction(viewerGui.colorChooser.showColorChooser, 'selection contour') self.contourColorButton = Tkinter.Button( self.mainFrame, #text='Contour color', width=7, background=TkColor(DejaVu.selectionContourColor), command=lFunc) self.contourColorButton.grid(row=1, column=1, columnspan=3) # PATTERN SIZE lLabel = Tkinter.Label(self.mainFrame, text='Pattern size:') lLabel.grid(row=2, column=0, sticky='w') def setPatternSizeSliderValue_cb(val): DejaVu.selectionPatternSize = val viewerGui.viewer.Redraw() self.patternSizeThumbwheel = ThumbWheel( self.mainFrame, width=70, height=16, type=int, value=DejaVu.selectionPatternSize, callback=setPatternSizeSliderValue_cb, continuous=True, oneTurn=10, wheelPad=2, min=0, max=50) self.patternSizeThumbwheel.grid(row=2, column=1, columnspan=3) self.mainFrame.pack(side='top') self.updateWidgets()
def makeInterface(self): """ create interface for ssh """ self.resetFrame() colors = { 'center_x' : '#ff3333', 'center_y' : 'green', 'center_z' : '#00aaff', 'size_x' : '#ff3333', 'size_y' : 'green', 'size_z' : '#0099ff', } frame_set = { 'ring_bd' : 1, 'ring_highlightbackground' :'black', 'ring_borderwidth' : 2, 'ring_highlightcolor' : 'black', 'ring_highlightthickness' : 1, 'ring_relief' : 'flat', 'groupchildsite_bg':'white', 'groupchildsite_relief':'sunken','ring_bg':'white', 'tag_bd' : '1', 'tag_highlightbackground' :'black', 'tag_borderwidth':2, 'tag_highlightcolor' : 'black', 'tag_highlightthickness': 1} frame_set = { 'ring_bd' : 1, 'ring_highlightbackground' :'black', 'ring_borderwidth' : 2, 'ring_highlightcolor' : 'black', 'ring_highlightthickness' : 1, 'ring_relief' : 'flat'} frame_set = {} bset = { 'bg' : '#95bed5', 'width' : 22, 'height': 22, 'relief' : 'raised'} bset = { 'bg' : '#2e363b', 'width' : 22, 'height': 22, 'relief' : 'raised'} bset = { 'bg' : '#a6abae', 'width' : 22, 'height': 22, 'relief' : 'raised'} bset = { 'bg' : '#969b9d' } # 'width' : 22, 'height': 22, 'relief' : 'raised'} bset = {} bset.update(self.BORDER) # left frame lframe = tk.Frame(self.frame) # button tollbar tk.Frame(lframe, height=7).pack(expand=0, fill='x', padx=0, pady=0, side='top', anchor='n') # minispacer bframe = tk.Frame(lframe) b = tk.Button(bframe, text='Load...', command = self.openConfig, image= self._ICON_open, compound='left', height=14,**bset) b.pack(expand=1,fill='x', anchor='w', side='left',padx=1) b.pack(expand=1,fill='x', anchor='w', side='left',padx=1) bframe.pack(expand=0, fill='x', padx=0, pady=0, side='top', anchor='n') ########################## center wheels self._thumbw_array = [] c_group = Pmw.Group(lframe, tag_text='Center', tag_font=self.FONTbold, **frame_set) for lab in ['center_x', 'center_y', 'center_z']: cb = CallbackFunction(self.setWheelBox, lab) tw = ThumbWheel( c_group.interior(), labCfg={'text':lab, 'side':'left','fg':colors[lab], 'bg':'black', 'width':9 }, showLabel=1, width=90, height=14, type=float, value=0.0, callback=cb, continuous=True, oneTurn=5, wheelPad=0) tw.pack(side='top', pady=2,anchor='n') self._thumbw_array.append(tw) c_group.pack(side='top', anchor='n', expand=0,fill='x',ipadx=2,ipady=3, padx=1) ########################## size wheels s_group = Pmw.Group(lframe, tag_text='Size', tag_font=self.FONTbold, **frame_set) for lab in ['size_x', 'size_y', 'size_z']: cb = CallbackFunction(self.setWheelBox, lab) tw = ThumbWheel( s_group.interior(), labCfg={'text':lab, 'side':'left','fg':colors[lab], 'bg':'black', 'width':9 }, showLabel=1, width=90, height=14, type=float, value=0.0, min=0.0001, callback=cb, continuous=True, oneTurn=5, wheelPad=0) tw.pack(side='top', pady=2,anchor='n') self._thumbw_array.append(tw) s_group.pack(side='top', anchor='n', expand=0,fill='x',ipadx=2,ipady=3, padx=1,pady=2) ########################## search settings self.searchparmgroup = Pmw.Group(lframe, tag_text='Search parameters', tag_font=self.FONTbold, **frame_set) # autodock search parms self.buildSearchADPanel(target = self.searchparmgroup ) # vina search parms self.buildSearchVinaPanel(target = self.searchparmgroup ) self.searchparmgroup.pack(side='top', anchor='n', expand=0,fill='x',ipadx=2,ipady=3, padx=1,pady=5) ########################## Receptors self._receptors_group = Pmw.Group(lframe, tag_text='Receptor list', tag_font=self.FONTbold,collapsedsize=3, **frame_set) # important self.receptorListbox = Pmw.ScrolledListBox(self._receptors_group.interior(), listbox_highlightbackground = 'black', # selectioncommand=self.loadreceptor, listbox_selectbackground='yellow') self.receptorListbox.pack(expand=1, fill='both',padx=3, pady=0) self.receptorListbox.component('listbox').bind('<ButtonRelease-1>', self.loadreceptor) self.receptorListbox.component('listbox').bind('<Button-3>', self._delreceptor) tb = tk.Frame(self._receptors_group.interior()) # single-multi load buttons self.recLoaderMode_single = tk.Radiobutton(tb, text='Single', image = self._ICON_single, indicatoron=False, variable=self.recLoaderMultiMode, value = False, compound='left', height=16, **bset) self.recLoaderMode_single.pack(anchor='n', side='left',pady=1,expand=1,fill='x',padx=1) self.recLoaderMode_multi = tk.Radiobutton(tb, text='Multi', image = self._ICON_multi, indicatoron=False, variable=self.recLoaderMultiMode, value = True, compound='left', height=16, **bset) self.recLoaderMode_multi.pack(anchor='n', side='left',pady=1,expand=1,fill='x',padx=1) tb.pack(expand=0, fill='x',anchor='s',side='bottom',padx=3) self._receptors_group.pack(side='bottom', anchor='n', expand=1, fill='both',ipadx=4,ipady=4, padx=1,pady=0) lframe.pack(side = 'left', anchor='n', expand='n', fill='y', padx=0, pady=0) ###### 3D Viewer rframe = tk.Frame(self.frame) spacer = tk.Frame(rframe, width=5) #, bg='red') spacer.pack(expand=0,fill='y',side='left',anchor='w') spacer.pack_propagate(0) vgroup = Pmw.Group(rframe, tag_text = '3D viewer', tag_font=self.FONTbold,groupchildsite_bg='black', **frame_set) # TOOLBAR vtoolbar = tk.Frame(vgroup.interior()) vtoolbar.pack(side='left', anchor='w', expand=0, fill='y') cb = CallbackFunction(self.centerView, None) tk.Button(vtoolbar, text='Center\nall', image = self._ICON_center_all, width=22, height=22, command=cb, **bset).pack(anchor='n', side='top') cb = CallbackFunction(self.centerView, 'mol') tk.Button(vtoolbar, text='Center\nmol', image = self._ICON_center_mol, width=22, height=22, command=cb, **bset ).pack(anchor='n', side='top') cb = CallbackFunction(self.centerView, 'box') tk.Button(vtoolbar, text='Center\nbox', image = self._ICON_center_box, width=22, height=22, command=cb, **bset ).pack(anchor='n', side='top',pady=1) # 3d Viewer settings XXX TODO #tk.Button(vtoolbar, text='Settings', image = self._ICON_sys, width=22, height=22, **bset).pack(anchor='n', side='top') vgroup.pack(side='right', anchor='e', expand=1, fill='both', padx=0, pady=0) # 3D viewer self.make3Dboxviewer(vgroup.interior()) rframe.pack(side = 'right', anchor='n', expand=1, fill='both',padx=0, pady=0) if self.app.dockengine == 'vina': self.setSearchParmsVina() elif self.app.dockengine == 'autodock': self.setSearchParmsAD() self.frame.pack(expand=1, fill='both',anchor='n', side='top')
def createSpinGui(self): #print "createSpinGui" self.spinGui = Tkinter.Toplevel() self.spinGui.title('Spin Settings') self.spinGui.protocol('WM_DELETE_WINDOW', self.spinGui.withdraw ) mainFrame = Tkinter.Frame(self.spinGui, relief='ridge', borderwidth=3) lLabelSpinBold = Tkinter.Label(mainFrame, text="Spinning only occurs in \"Object\" transform mode", font=(ensureFontCase('helvetica'),10,'bold')) lLabelSpinBold.pack(side='top') lLabelSpin = Tkinter.Label(mainFrame, font=(ensureFontCase('helvetica'),'9'), justify='left', text="""start: release the middle button while the mouse is still moving stop: left click """ ) lLabelSpin.pack(side='top') anglesFrame = Tkinter.Frame(mainFrame, relief='ridge', borderwidth=3) # off/spin/rock radio buttons radioFrame = Tkinter.Frame(anglesFrame)#, relief='ridge', borderwidth=3) radioOff = Tkinter.Radiobutton( radioFrame, text='Off', value=0, variable=self.spinVar, width=8, indicatoron=0, command=self.resetSpinValues, ) radioOff.grid(row=0, column=0, sticky='we') radioSpin = Tkinter.Radiobutton( radioFrame, text='Spin', value=1, variable=self.spinVar, width=8, indicatoron=0, command=self.toggleCycle, ) radioSpin.grid(row=0, column=1, sticky='we') radioBounce = Tkinter.Radiobutton( radioFrame, text='Bounce', value=2, variable=self.spinVar, width=8, indicatoron=0, command=self.toggleCycle, ) radioBounce.grid(row=0, column=2, sticky='we') radioOscillate = Tkinter.Radiobutton( radioFrame, text='Oscillate', value=3, variable=self.spinVar, width=8, indicatoron=0, command=self.toggleCycle, ) radioOscillate.grid(row=0, column=3, sticky='we') radioFrame.pack(side='top') self.spinGui.anglePerFrameThumbwheel = ThumbWheel( anglesFrame, labCfg={'text':'Angular speed (degrees per frame)', 'side':'left'}, showLabel=1, width=90, height=14, min=.01, max=10., type=float, value=self.spinAnglePerFrame, callback=self.setWithSpinGui, continuous=True, oneTurn=5, wheelPad=0, ) self.spinGui.anglePerFrameThumbwheel.pack(side='top', anchor='e') self.spinGui.rockAngleThumbwheel = ThumbWheel( anglesFrame, labCfg={'text':'Rock angle (degrees)', 'side':'left'}, showLabel=1, width=90, height=14, min=1, max=360, type=int, value=self.rockAngle, callback=self.setWithSpinGui, continuous=True, oneTurn=60, wheelPad=0, ) self.spinGui.rockAngleThumbwheel.pack(side='top', anchor='e') def shiftRockCenter(val): lSpinRotMat = self.makeSpinRotationMat(self.spinAxis, -val) c = self.camera() c.viewer.rootObject.ConcatRotation(lSpinRotMat) c.Redraw() vi.afterRedraw() shiftRockCenterThumbwheel.set(0, update=0) shiftRockCenterThumbwheel = ThumbWheel( anglesFrame, labCfg={'text':'Shift rock center', 'side':'left'}, showLabel=0, width=90, height=14, min=-100, max=100, type=int, value=0, callback=shiftRockCenter, continuous=True, oneTurn=90, wheelPad=0, ) shiftRockCenterThumbwheel.pack(side='top', anchor='e') anglesFrame.pack(side='top') self.spinGui.vectorGUI = vectorGUI(mainFrame, size=150, vector=self.spinAxis, callback=self.setWithSpinGui, ) mainFrame.pack(side='top')
def createOwnGui(self): self.ownGui = Tkinter.Toplevel() self.ownGui.title(self.name) self.ownGui.protocol('WM_DELETE_WINDOW', self.ownGui.withdraw ) frame1 = Tkinter.Frame(self.ownGui) frame1.pack(side='top') #unit self.unitsEnt = Pmw.EntryField(frame1, label_text='Units ', labelpos='w', value=self.unitsString, command=self.setWithOwnGui) self.unitsEnt.pack(side='top', fill='x') #glf vector font self.glfFont = Tkinter.StringVar() self.glfFont.set('chicago1.glf') self.glfFontCB = Pmw.ComboBox(frame1, label_text='Font ', labelpos='w', entryfield_value=self.glfFont.get(), scrolledlist_items=self.glfVectorFontList, selectioncommand=self.setWithOwnGui) self.glfFontCB.pack(side='top', fill='x') #fontScale self.fontScaleThumb = ThumbWheel(frame1, labCfg={'text':'font scale ', 'side':'left'}, showLabel=1, width=90, height=14, min=0, max=200, type=int, value=self.fontScale, callback=self.setWithOwnGui, continuous=True, oneTurn=10, wheelPad=0) self.fontScaleThumb.pack(side='top') #label lLabelValuesString = '' for lLabelValue in self.labelValues: lLabelValuesString += str(lLabelValue) + ' ' self.labelValsEnt = Pmw.EntryField( frame1, label_text='Numeric labels ', labelpos='w', value=lLabelValuesString, command=self.setWithOwnGui) self.labelValsEnt.component('entry').config(width=6) self.labelValsEnt.pack(side='top', fill='x') #numOfLabel self.numOfLabelsCtr = ThumbWheel(frame1, labCfg={'text':'Automatic labels', 'side':'left'}, showLabel=1, width=90, height=14, min=0, max=200, type=int, value=self.numOfLabels, callback=self.setWithOwnGui, continuous=True, oneTurn=20, wheelPad=0) self.numOfLabelsCtr.pack(side='top') # Interpolate self.interpVar = Tkinter.IntVar() self.interpVar.set(0) self.checkBoxFrame = Tkinter.Checkbutton( frame1, text='Interpolate', variable=self.interpVar, command=self.setWithOwnGui) self.checkBoxFrame.pack(side='top') # frame self.frameVar = Tkinter.IntVar() self.frameVar.set(1) self.checkBoxFrame = Tkinter.Checkbutton( frame1, text='Frame', variable=self.frameVar, command=self.setWithOwnGui) self.checkBoxFrame.pack(side='top') # invert labels color self.invertLabelsColorVar = Tkinter.IntVar() self.invertLabelsColorVar.set(0) self.checkBoxinvertLabelsColor = Tkinter.Checkbutton( frame1, text='Invert labels color', variable=self.invertLabelsColorVar, command=self.setWithOwnGui) #self.checkBoxFrame.pack(side='top') self.checkBoxinvertLabelsColor.pack(side='top') # colormapguiwidget: self.launchColormapWidget = Tkinter.Button( frame1, text="Show colormap settings", command=self.colormapguiRef().showColormapSettings_cb ) self.launchColormapWidget.pack(side='top', fill='x')
def createOwnGui(self): #print "GlfLabels.createOwnGui", self self.ownGui = Tkinter.Toplevel() self.ownGui.title(self.name) self.ownGui.protocol('WM_DELETE_WINDOW', self.ownGui.withdraw) frame1 = Tkinter.Frame(self.ownGui) frame1.pack(side='top') # label self.ownGui.labelEnt = Pmw.EntryField(frame1, label_text='label', labelpos='w', value=str(self.label), command=self.setWithOwnGui) self.ownGui.labelEnt.pack(side='top', fill='x') # fontName self.ownGui.guiFontNameComboBox = Pmw.ComboBox( frame1, label_text='font name', labelpos='w', entryfield_value=self.fontName, scrolledlist_items=self.glfVectorFontList, selectioncommand=self.setWithOwnGui) self.ownGui.guiFontNameComboBox.pack(side='top', fill='x') # wirefont self.ownGui.wireFontVar = Tkinter.IntVar() self.ownGui.wireFontVar.set(self.wireFont) self.ownGui.guiWireFont = Tkinter.Checkbutton( frame1, text='wire font', variable=self.ownGui.wireFontVar, command=self.setWithOwnGui) self.ownGui.guiWireFont.pack(side='top', fill='x') # fontSpacing self.ownGui.guiFontSpacing = ThumbWheel( frame1, labCfg={ 'text': 'font spacing', 'side': 'left' }, showLabel=1, width=80, height=16, min=0, #max=100, type=float, value=self.fontSpacing, callback=self.setWithOwnGui, continuous=True, oneTurn=1, wheelPad=2) self.ownGui.guiFontSpacing.pack(side='top', fill='x') # font global scale self.ownGui.guiGlobalScale = ThumbWheel( frame1, labCfg={ 'text': 'global scale', 'side': 'left' }, showLabel=1, width=80, height=16, min=0, #max=100, type=float, value=1., callback=self.setWithOwnGui, continuous=True, oneTurn=5, wheelPad=2) self.ownGui.guiGlobalScale.pack(side='top', fill='x') # font scale X self.ownGui.guiFontScaleX = ThumbWheel( frame1, labCfg={ 'text': 'font scale X', 'side': 'left' }, showLabel=1, width=80, height=16, min=0, #max=100, type=int, value=self.fontScales[0], callback=self.setWithOwnGui, continuous=True, oneTurn=20, wheelPad=2) self.ownGui.guiFontScaleX.pack(side='top', fill='x') # font scale Y self.ownGui.guiFontScaleY = ThumbWheel( frame1, labCfg={ 'text': 'font scale Y', 'side': 'left' }, showLabel=1, width=80, height=16, min=0, #max=100, type=int, value=self.fontScales[1], callback=self.setWithOwnGui, continuous=True, oneTurn=20, wheelPad=2) self.ownGui.guiFontScaleY.pack(side='top', fill='x') self.ownGui.guiFramePolygonModeOptionMenu = Pmw.OptionMenu( frame1, label_text='frame PolygonMode', labelpos='w', initialitem=self.framePolygonModeDictRev[self.framePolygonMode], items=self.framePolygonModeDict.keys(), command=self.setWithOwnGui) self.ownGui.guiFramePolygonModeOptionMenu.pack(side='top', fill='x') # frame space X self.ownGui.guiFrameSpaceX = ThumbWheel( frame1, labCfg={ 'text': 'frame space X', 'side': 'left' }, showLabel=1, width=80, height=16, min=0, #max=100, type=float, value=self.frameSpace[0], callback=self.setWithOwnGui, continuous=True, oneTurn=5, wheelPad=2) self.ownGui.guiFrameSpaceX.pack(side='top', fill='x') # frame space Y self.ownGui.guiFrameSpaceY = ThumbWheel( frame1, labCfg={ 'text': 'frame space Y', 'side': 'left' }, showLabel=1, width=80, height=16, min=0, #max=100, type=float, value=self.frameSpace[1], callback=self.setWithOwnGui, continuous=True, oneTurn=5, wheelPad=2) self.ownGui.guiFrameSpaceY.pack(side='top', fill='x') # fontColor self.ownGui.guiColorChooser = ColorChooser( master=frame1, targetDict={ 'fontColor': (self.fontColor, 'RGB', self.setFontColor), 'frameColor': (self.frameColor, 'RGB', self.setFrameColor) }, targetKey='fontColor')
def createOwnGui(self): #print "GlfLabels.createOwnGui", self self.ownGui = Tkinter.Toplevel() self.ownGui.title(self.name) self.ownGui.protocol('WM_DELETE_WINDOW', self.ownGui.withdraw) frame1 = Tkinter.Frame(self.ownGui) frame1.pack(side='top') # labels self.ownGui.labelsEnt = Pmw.EntryField(frame1, label_text='list of labels', labelpos='w', value=str(self.labels), command=self.setWithOwnGui) self.ownGui.labelsEnt.pack(side='top', fill='x') # billboard self.ownGui.billboardVar = Tkinter.IntVar() self.ownGui.billboardVar.set(self.billboard) self.ownGui.guiBillboard = Tkinter.Checkbutton( frame1, text='billboard', variable=self.ownGui.billboardVar, command=self.setWithOwnGui) self.ownGui.guiBillboard.pack(side='top', fill='x') # includeCameraRotationInBillboard self.ownGui.includeCameraRotationInBillboardVar = Tkinter.IntVar() self.ownGui.includeCameraRotationInBillboardVar.set( self.includeCameraRotationInBillboard) self.ownGui.guiIncludeCameraRotationInBillboard = Tkinter.Checkbutton( frame1, text='includeCameraRotationInBillboard', variable=self.ownGui.includeCameraRotationInBillboardVar, command=self.setWithOwnGui) self.ownGui.guiIncludeCameraRotationInBillboard.pack(side='top', fill='x') # # lighting # self.ownGui.lightingVar = Tkinter.IntVar() # self.ownGui.lightingVar.set(self.lighting) # self.ownGui.guiLighting = Tkinter.Checkbutton( # frame1, # text='lighting', # variable=self.ownGui.lightingVar, # command=self.setWithOwnGui) # self.ownGui.guiLighting.pack(side='top', fill='x') # font self.ownGui.guiFontComboBox = Pmw.ComboBox( frame1, label_text='font', labelpos='w', entryfield_value=self.font, scrolledlist_items=self.fontList, selectioncommand=self.setWithOwnGui) self.ownGui.guiFontComboBox.pack(side='top', fill='x') # font style self.ownGui.guiFontStyleComboBox = Pmw.ComboBox( frame1, label_text='font style', labelpos='w', entryfield_value=self.fontStyle, scrolledlist_items=self.fontStyleList, selectioncommand=self.setWithOwnGui) self.ownGui.guiFontStyleComboBox.pack(side='top', fill='x') # font spacing self.ownGui.guiSpacing = ThumbWheel( frame1, labCfg={ 'text': 'font spacing', 'side': 'left' }, showLabel=1, width=80, height=16, min=0, #max=100, type=float, value=self.fontSpacing, callback=self.setWithOwnGui, continuous=True, oneTurn=1, wheelPad=2) self.ownGui.guiSpacing.pack(side='top', fill='x') # font global scale self.ownGui.guiGlobalScale = ThumbWheel( frame1, labCfg={ 'text': 'global scale', 'side': 'left' }, showLabel=1, width=80, height=16, min=0, #max=100, type=float, value=1., callback=self.setWithOwnGui, continuous=True, oneTurn=1, wheelPad=2) self.ownGui.guiGlobalScale.pack(side='top', fill='x') # font scale X self.ownGui.guiScaleX = ThumbWheel( frame1, labCfg={ 'text': 'scale X', 'side': 'left' }, showLabel=1, width=80, height=16, min=0, #max=100, type=float, value=self.fontScales[0], callback=self.setWithOwnGui, continuous=True, oneTurn=1, wheelPad=2) self.ownGui.guiScaleX.pack(side='top', fill='x') # font scale Y self.ownGui.guiScaleY = ThumbWheel( frame1, labCfg={ 'text': 'scale Y', 'side': 'left' }, showLabel=1, width=80, height=16, min=0, #max=100, type=float, value=self.fontScales[1], callback=self.setWithOwnGui, continuous=True, oneTurn=1, wheelPad=2) self.ownGui.guiScaleY.pack(side='top', fill='x') # font scale Z self.ownGui.guiScaleZ = ThumbWheel( frame1, labCfg={ 'text': 'scale Z', 'side': 'left' }, showLabel=1, width=80, height=16, min=0, #max=100, type=float, value=self.fontScales[2], callback=self.setWithOwnGui, continuous=True, oneTurn=1, wheelPad=2) self.ownGui.guiScaleZ.pack(side='top', fill='x') # font Translate X self.ownGui.guiTranslateX = ThumbWheel( frame1, labCfg={ 'text': 'translate X', 'side': 'left' }, showLabel=1, width=80, height=16, #min=0, #max=100, type=float, value=self.fontTranslation[0], callback=self.setWithOwnGui, continuous=True, oneTurn=1, wheelPad=2) self.ownGui.guiTranslateX.pack(side='top', fill='x') # font Translate Y self.ownGui.guiTranslateY = ThumbWheel( frame1, labCfg={ 'text': 'translate Y', 'side': 'left' }, showLabel=1, width=80, height=16, #min=0, #max=100, type=float, value=self.fontTranslation[1], callback=self.setWithOwnGui, continuous=True, oneTurn=1, wheelPad=2) self.ownGui.guiTranslateY.pack(side='top', fill='x') # font Translate Z self.ownGui.guiTranslateZ = ThumbWheel( frame1, labCfg={ 'text': 'translate Z', 'side': 'left' }, showLabel=1, width=80, height=16, #min=0, #max=100, type=float, value=self.fontTranslation[2], callback=self.setWithOwnGui, continuous=True, oneTurn=1, wheelPad=2) self.ownGui.guiTranslateZ.pack(side='top', fill='x') # font Rotate X self.ownGui.guiRotateX = ThumbWheel(frame1, labCfg={ 'text': 'Rotate X', 'side': 'left' }, showLabel=1, width=80, height=16, min=-180, max=180, type=float, value=self.fontRotateAngles[0], callback=self.setWithOwnGui, continuous=True, oneTurn=90, wheelPad=2) self.ownGui.guiRotateX.pack(side='top', fill='x') # font Rotate Y self.ownGui.guiRotateY = ThumbWheel(frame1, labCfg={ 'text': 'Rotate Y', 'side': 'left' }, showLabel=1, width=80, height=16, min=-180, max=180, type=float, value=self.fontRotateAngles[1], callback=self.setWithOwnGui, continuous=True, oneTurn=90, wheelPad=2) self.ownGui.guiRotateY.pack(side='top', fill='x') # font Rotate Z self.ownGui.guiRotateZ = ThumbWheel(frame1, labCfg={ 'text': 'Rotate Z', 'side': 'left' }, showLabel=1, width=80, height=16, min=-180, max=180, type=float, value=self.fontRotateAngles[2], callback=self.setWithOwnGui, continuous=True, oneTurn=90, wheelPad=2) self.ownGui.guiRotateZ.pack(side='top', fill='x')