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')
예제 #2
0
 def setupAddGroup(self):
     
     groupNameEntry = Entry(self,justify=CENTER);
     groupNameEntry.insert(0, GROUP_DEFAULT_STRING)
     groupNameEntry.bind('<FocusIn>', lambda event:self.on_entry_click(event,groupNameEntry))
     groupNameEntry.bind('<FocusOut>', lambda event:self.on_focusout(event,groupNameEntry))
     groupNameEntry.config(fg = 'grey')
     groupNameEntry.grid(row=1,column=1,columnspan=2,sticky=E+W)
     groupCheckboxFrame = GroupEditCheckboxFrame(self,jsonHelper.getAllHeadFiltersFileNames(),jsonHelper.getAllJawFiltersFileNames(),jsonHelper.getAllModulesFileNames())
     groupCheckboxFrame.grid(row=2, column=0, columnspan=4, sticky=E+W+N+S)
     Button(self,text='Apply & Close',relief=RAISED,command=lambda:self.applyGroupButtonPressed(groupNameEntry.get(),groupCheckboxFrame)).grid(row=3,column=1,columnspan=1,sticky=S+E)
예제 #3
0
    def setupSelectedGroup(self, groupName):

        groupCheckboxFrame = GroupEditCheckboxFrame(
            self,
            jsonHelper.getAllHeadFiltersFileNames(),
            jsonHelper.getAllJawFiltersFileNames(),
            jsonHelper.getAllModulesFileNames(),
        )
        groupCheckboxFrame.setEnabledHeadFilenames(jsonHelper.getHeadFiltersListForGroup(groupName))
        groupCheckboxFrame.setEnabledJawFilenames(jsonHelper.getJawFiltersListForGroup(groupName))
        groupCheckboxFrame.setEnabledModuleFilenames(jsonHelper.getModuleListForGroup(groupName))

        groupCheckboxFrame.grid(row=2, column=0, columnspan=4, sticky=E + W + N + S)
        Button(
            self,
            text="Apply & Close",
            relief=RAISED,
            command=lambda: self.applyGroupButtonPressed(groupName, groupCheckboxFrame),
        ).grid(row=3, column=1, columnspan=1, sticky=S + E)
예제 #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")