def __init__(self,notebook,groupName):
        Frame.__init__(self,notebook) 
        self.groupName = groupName
        self.enableCheckButtonInt = IntVar()
        Checkbutton(self, text='Enabled', variable=self.enableCheckButtonInt).grid(row=0, column=0, columnspan=3, sticky=N+W)

        Label(self,text="Head Filters").grid(row=1,column=0,sticky=N+S+E+W)
        Label(self,text="Jaw Filters").grid(row=1,column=1,sticky=N+S+E+W)
        Label(self,text="Modules").grid(row=1,column=2,sticky=N+S+E+W)

        headFilterList = jsonHelper.getHeadFiltersListForGroup(groupName)
        jawFilterList = jsonHelper.getJawFiltersListForGroup(groupName)
        moduleList = jsonHelper.getModuleListForGroup(groupName)

        self.columnconfigure(0,weight=1)
        self.columnconfigure(1,weight=1)
        self.columnconfigure(2,weight=1)

        self.rowconfigure(0,weight=1)
        self.rowconfigure(1,weight=1)

        for i in range(len(headFilterList)):
            Label(self,text=objectHelper.getHeadFilterNameFromHeadFilterFilename(headFilterList[i])).grid(row=2+i,column=0,sticky=N+S+E+W)
            self.rowconfigure(2+i,weight=1)

        for i in range(len(jawFilterList)):
            Label(self,text=objectHelper.getJawFilterNameFromJawFilterFilename(jawFilterList[i])).grid(row=2+i,column=1,sticky=N+S+E+W)
            self.rowconfigure(2+i,weight=1)

        for i in range(len(moduleList)):
            Label(self,text=objectHelper.getModuleNameFromModuleFilename(moduleList[i])).grid(row=2+i,column=2,sticky=N+S+E+W)
            self.rowconfigure(2+i,weight=1)
Ejemplo n.º 2
0
    def setupHeadDropDown(self):

        headFilterTypeFilenameList = jsonHelper.getAllHeadFiltersFileNames()
        headFilterNameList = [objectHelper.getHeadFilterNameFromHeadFilterFilename(filename) for filename in headFilterTypeFilenameList]
        dropFtTitle = StringVar()
        dropFtTitle.set('Select Head Filter Type')
        ftDropMenu = OptionMenu(self,dropFtTitle,*headFilterNameList,command=self.headFilterTypeSelectedFromOptionsMenu)
        ftDropMenu.grid(row=1, column=0, columnspan=4, sticky='ew')
    def __init__(self,parent,headFilterFilenameList,jawFilterFilenameList,moduleFilenameList):
        Frame.__init__(self,parent) 

        Label(self,text="Head Filters").grid(row=0,column=0,sticky=N+S+E+W)
        Label(self,text="Jaw Filters").grid(row=0,column=1,sticky=N+S+E+W)
        Label(self,text="Modules").grid(row=0,column=2,sticky=N+S+E+W)

        self.columnconfigure(0,weight=1)
        self.columnconfigure(1,weight=1)
        self.columnconfigure(2,weight=1)

        self.rowconfigure(0,weight=1)

        self.headFilterFilenameList = headFilterFilenameList;
        self.jawFilterFilenameList = jawFilterFilenameList;
        self.moduleFilenameList = moduleFilenameList;

        self.headIntVarList = [];
        self.jawIntVarList = [];
        self.moduleIntVarList = [];

        for i in range(len(headFilterFilenameList)):
            tmpFrame = Frame(self);
            tmpFrame.grid(row=1+i,column=0,sticky=N+S+E+W)
            tmpFrame.rowconfigure(0,weight=1)
            tmpFrame.columnconfigure(0,weight=1)
            tmpFrame.columnconfigure(1,weight=1)
            checkButtonIntVar = IntVar();
            self.headIntVarList.append(checkButtonIntVar)
            Checkbutton(tmpFrame,variable=checkButtonIntVar).grid(row=0, column=0, sticky=E)
            Label(tmpFrame,text=objectHelper.getHeadFilterNameFromHeadFilterFilename(headFilterFilenameList[i])).grid(row=0,column=1,sticky=W)
            self.rowconfigure(1+i,weight=1)

        for i in range(len(jawFilterFilenameList)):
            tmpFrame = Frame(self);
            tmpFrame.grid(row=1+i,column=1,sticky=N+S+E+W)
            tmpFrame.rowconfigure(0,weight=1)
            tmpFrame.columnconfigure(0,weight=1)
            tmpFrame.columnconfigure(1,weight=1)
            checkButtonIntVar = IntVar();
            self.jawIntVarList.append(checkButtonIntVar)
            Checkbutton(tmpFrame,variable=checkButtonIntVar).grid(row=0, column=0, sticky=E)
            Label(tmpFrame,text=objectHelper.getJawFilterNameFromJawFilterFilename(jawFilterFilenameList[i])).grid(row=0,column=1,sticky=W)
            self.rowconfigure(1+i,weight=1)

        for i in range(len(moduleFilenameList)):
            tmpFrame = Frame(self);
            tmpFrame.grid(row=1+i,column=2,sticky=N+S+E+W)
            tmpFrame.rowconfigure(0,weight=1)
            tmpFrame.columnconfigure(0,weight=1)
            tmpFrame.columnconfigure(1,weight=1)
            checkButtonIntVar = IntVar();
            self.moduleIntVarList.append(checkButtonIntVar)
            Checkbutton(tmpFrame,variable=checkButtonIntVar).grid(row=0, column=0, sticky=E)
            Label(tmpFrame,text=objectHelper.getModuleNameFromModuleFilename(moduleFilenameList[i])).grid(row=0,column=1,sticky=W)
            self.rowconfigure(1+i,weight=1)
Ejemplo n.º 4
0
    def headFilterTypeSelectedFromOptionsMenu(self, value):

        if value != self.currentHeadFilterTypeValue:
            self.currentHeadFilterTypeValue = value

            for i in range(2, self.grid_size()[1]):
                for element in self.grid_slaves(i, None):
                    element.grid_forget()

            headFileNameList = jsonHelper.getAllHeadFiltersFileNames()

            selectedHeadFileName = None

            for headFileName in headFileNameList:
                if objectHelper.getHeadFilterNameFromHeadFilterFilename(headFileName) == value:
                    selectedHeadFileName = headFileName
                    break

            if selectedHeadFileName:
                self.setupSelectedFilterType(selectedHeadFileName, "Head")