Esempio n. 1
0
    def __init__(self,
                 guiParent,
                 basePopup,
                 borderRelief='raised',
                 text=' ',
                 justify='left',
                 width=None,
                 font=None,
                 height=None,
                 *args,
                 **kw):

        # Base popup required to handle notification of data model changes
        # e.g. new peak lists, so that the GUI can update to the latest
        # state
        self.basePopup = basePopup
        self.guiParent = guiParent
        self.borderRelief = borderRelief
        self.text = text
        self.justify = justify
        self.width = width
        self.font = font
        self.height = height

        self.registerNotify = basePopup.registerNotify
        self.unregisterNotify = basePopup.unregisterNotify

        LabelFrame.__init__(self, guiParent, borderRelief, text, justify,
                            width, font, height, *args, **kw)

        # set up the grid

        self.grid_columnconfigure(0, weight=0, minsize=20)

        self.grid_rowconfigure(0, weight=0, minsize=5)
        self.grid_rowconfigure(1, weight=0, minsize=10)
        self.grid_rowconfigure(2, weight=0, minsize=10)
        self.grid_rowconfigure(3, weight=0, minsize=10)

        # build up the body.

        self.nameLabel = Label(self, text='Exp Type:')
        self.nameLabel.grid(row=1, column=0, padx=2, sticky='nw')

        self.nameText = Text(self, width=15, height=1)
        self.nameText.grid(row=1, column=1, sticky='nw')

        self.clearButton = Button(self,
                                  text='Clear',
                                  command=self.clear_filter,
                                  width=7,
                                  height=1)
        self.clearButton.grid(row=2, column=0, columnspan=2, sticky='nw')

        self.filterButton = Button(self,
                                   text='Go',
                                   command=self.tmpCall,
                                   width=7,
                                   height=1)
        self.filterButton.grid(row=2, column=1, columnspan=2, sticky='ne')
Esempio n. 2
0
    def __init__(self,
                 guiParent,
                 basePopup,
                 borderRelief='raised',
                 text=' ',
                 justify='left',
                 width=None,
                 font=None,
                 height=None,
                 *args,
                 **kw):

        # Base popup required to handle notification of data model changes
        # e.g. new peak lists, so that the GUI can update to the latest
        # state
        self.basePopup = basePopup
        self.guiParent = guiParent
        self.borderRelief = borderRelief
        self.text = text
        self.justify = justify
        self.width = width
        self.font = font
        self.height = height

        # get a port proxy instance
        # this should probably belong to the repository directly

        loc = SharedBeanServiceLocator()
        self.port = loc.getSharedBean()

        self.registerNotify = basePopup.registerNotify
        self.unregisterNotify = basePopup.unregisterNotify

        LabelFrame.__init__(self, guiParent, borderRelief, text, justify,
                            width, font, height, *args, **kw)

        # set up the grid

        self.grid_columnconfigure(0, weight=0, minsize=20)

        self.grid_rowconfigure(0, weight=0, minsize=5)
        self.grid_rowconfigure(1, weight=0, minsize=10)
        self.grid_rowconfigure(2, weight=0, minsize=10)
        self.grid_rowconfigure(3, weight=0, minsize=10)

        # build up the body.

        self.nameLabel = Label(self, text='Name:')
        self.nameLabel.grid(row=1, column=0, padx=2, sticky='nw')

        self.nameText = Text(self, width=20, height=1)
        self.nameText.grid(row=1, column=1, sticky='nw')

        self.dateLabel = Label(self, text='Date:')
        self.dateLabel.grid(row=2, column=0, padx=2, sticky='nw')

        self.dateText = Text(self, width=20, height=1)
        self.dateText.grid(row=2, column=1, sticky='nw')

        self.userLabel = Label(self, text='User:'******'nw')

        self.userText = Text(self, width=20, height=1)
        self.userText.grid(row=3, column=1, sticky='nw')

        self.clearButton = Button(self,
                                  text='Clear',
                                  command=self.clear_filter,
                                  width=10,
                                  height=1)
        self.clearButton.grid(row=4, column=0, columnspan=2, sticky='nw')

        self.filterButton = Button(self,
                                   text='Go',
                                   command=self.tmpCall,
                                   width=10,
                                   height=1)
        self.filterButton.grid(row=4, column=1, columnspan=2, sticky='ne')
Esempio n. 3
0
  def __init__(self, guiParent, basePopup, borderRelief='raised', text=' ', justify='left',
               width=None, font=None, height=None, *args, **kw):

    # Base popup required to handle notification of data model changes
    # e.g. new peak lists, so that the GUI can update to the latest
    # state
    self.basePopup = basePopup
    self.guiParent = guiParent
    self.borderRelief = borderRelief
    self.text = text
    self.justify = justify
    self.width = width
    self.font = font
    self.height = height

    self.registerNotify=basePopup.registerNotify
    self.unregisterNotify=basePopup.unregisterNotify


    LabelFrame.__init__(self, guiParent, borderRelief, text, justify,
                        width, font, height, *args, **kw)
  

    # set up the grid

    self.grid_columnconfigure(0, weight=0, minsize=20)

    self.grid_rowconfigure(0, weight=0, minsize=5)
    self.grid_rowconfigure(1, weight=0, minsize=10)
    self.grid_rowconfigure(2, weight=0, minsize=10)
    self.grid_rowconfigure(3, weight=0, minsize=10)


    # FIXME
    # should be an enumerated list
    self.statusLabel = Label(self,text='Type:')
    self.statusText = Text(self, width=20, height=1)

    # FIXME
    # should be an enumerated list
    self.typeLabel = Label(self,text='Type:')
    self.typeText = Text(self, width=20, height=1)

    # FIXME
    # should be an enumerated list
    self.projLabel = Label(self,text='Project:')
    self.projText = Text(self, width=20, height=1)

    # FIXME
    # should be an enumerated list
    self.userLabel = Label(self,text='User:'******'Clear', command=self.clear_filter, width=10, height=1)
    self.filterButton = Button(self, text='Go', command=self.refresh_filter, width=10, height=1)


    self.statusLabel.grid(row=2, column=0, padx=2, sticky='nw')
    self.statusText.grid(row=2, column=1, sticky='nw')
    self.typeLabel.grid(row=3, column=0, padx=2, sticky='nw')
    self.typeText.grid(row=3, column=1, sticky='nw')
    self.projLabel.grid(row=4, column=0, padx=2, sticky='nw')
    self.projText.grid(row=4, column=1, sticky='nw')
    self.userLabel.grid(row=5, column=0, padx=2, sticky='nw')
    self.userText.grid(row=5, column=1, sticky='nw')
    
    self.clearButton.grid(row=6, column=0, columnspan=2, sticky='nw')
    self.filterButton.grid(row=6, column=1, columnspan=2, sticky='ne')
Esempio n. 4
0
    def __init__(self,
                 parent,
                 getOption=None,
                 setOption=None,
                 text='Print Options',
                 haveTicks=False,
                 doOutlineBox=True,
                 *args,
                 **kw):

        self.getOption = getOption
        self.setOption = setOption
        self.haveTicks = haveTicks
        self.doOutlineBox = doOutlineBox

        LabelFrame.__init__(self, parent=parent, text=text, *args, **kw)

        self.file_select_popup = None

        self.getOptionValues()

        try:
            size_index = self.paper_types.index(self.paper_type)
        except:
            size_index = 0

        try:
            other_unit_index = self.paper_units.index(self.other_unit)
        except:
            other_unit_index = 0

        try:
            orientation_index = self.paper_orientations.index(self.orientation)
        except:
            orientation_index = 0

        try:
            style_index = self.style_choices.index(self.output_style)
        except:
            style_index = 0

        try:
            format_index = self.format_choices.index(self.output_format)
        except:
            format_index = 0

        if haveTicks:
            try:
                tick_location_index = self.tick_locations.index(
                    self.tick_location)
            except:
                tick_location_index = 0

        self.grid_columnconfigure(2, weight=1)

        row = 0
        label = Label(self, text='File:')
        label.grid(row=row, column=0, sticky='e')
        self.file_entry = Entry(self, width=40, text=self.file_name)
        self.file_entry.grid(row=row, column=1, columnspan=2, sticky='ew')
        button = Button(self, text='Choose File', command=self.findFile)
        button.grid(row=row, column=3, rowspan=2, sticky='nsew')

        row += 1
        label = Label(self, text='Title:')
        label.grid(row=row, column=0, sticky='e')
        self.title_entry = Entry(self, width=40, text=self.title)
        self.title_entry.grid(row=row, column=1, columnspan=2, sticky='ew')

        row += 1
        frame = Frame(self)
        frame.grid(row=row, column=0, columnspan=4, sticky='ew')
        frame.grid_columnconfigure(4, weight=1)

        label = Label(frame, text='Paper size:')
        label.grid(row=0, column=0, sticky='e')
        entries = []
        for t in paper_types:
            if t == Output.other_paper_type:
                entry = t
            else:
                (w, h, u) = paper_sizes[t]
                entry = t + ' (%2.1f %s x %2.1f %s)' % (w, u, h, u)
            entries.append(entry)
        self.size_menu = PulldownList(frame,
                                      callback=self.changedSize,
                                      texts=entries,
                                      index=size_index)
        self.size_menu.grid(row=0, column=1, sticky='w')

        self.other_frame = Frame(frame)

        self.other_frame.grid_columnconfigure(0, weight=1)
        self.other_entry = FloatEntry(self.other_frame,
                                      text=self.other_size,
                                      isArray=True)
        self.other_entry.grid(row=0, column=0, sticky='ew')
        self.other_unit_menu = PulldownList(self.other_frame,
                                            texts=paper_units,
                                            index=other_unit_index)
        self.other_unit_menu.grid(row=0, column=1, sticky='ew')

        row += 1
        frame = Frame(self)
        frame.grid(row=row, column=0, columnspan=4, sticky='ew')
        frame.grid_columnconfigure(1, weight=1)
        frame.grid_columnconfigure(3, weight=1)
        frame.grid_columnconfigure(5, weight=1)

        label = Label(frame, text='Orientation:')
        label.grid(row=0, column=0, sticky='e')
        self.orientation_menu = PulldownList(frame,
                                             texts=paper_orientations,
                                             index=orientation_index)
        self.orientation_menu.grid(row=0, column=1, sticky='w')

        label = Label(frame, text='  Style:')
        label.grid(row=0, column=2, sticky='e')
        self.style_menu = PulldownList(frame,
                                       texts=style_choices,
                                       index=style_index)
        self.style_menu.grid(row=0, column=3, sticky='w')

        label = Label(frame, text='  Format:')
        label.grid(row=0, column=4, sticky='e')
        self.format_menu = PulldownList(frame,
                                        callback=self.changedFormat,
                                        texts=format_choices,
                                        index=format_index)

        self.format_menu.grid(row=0, column=5, sticky='w')

        if haveTicks:

            row += 1
            frame = Frame(self)
            frame.grid(row=row, column=0, columnspan=4, sticky='ew')
            frame.grid_columnconfigure(1, weight=1)
            frame.grid_columnconfigure(3, weight=1)

            label = Label(frame, text='Tick Location:')
            label.grid(row=0, column=0, sticky='e')
            self.tick_menu = PulldownList(frame,
                                          texts=tick_locations,
                                          index=tick_location_index)
            self.tick_menu.grid(row=0, column=1, sticky='w')

            label = Label(frame, text='  Tick Placement:')
            label.grid(row=0, column=2, sticky='e')
            self.tick_buttons = CheckButtons(frame,
                                             entries=tick_placements,
                                             selected=self.tick_placement)
            self.tick_buttons.grid(row=0, column=3, sticky='w')

        row += 1
        frame = Frame(self)
        frame.grid(row=row, column=0, columnspan=4, sticky='ew')
        frame.grid_columnconfigure(3, weight=1)

        label = Label(frame, text='Include:')
        label.grid(row=0, column=0, sticky='e')
        self.border_buttons = CheckButtons(frame,
                                           entries=border_decorations,
                                           selected=self.border_decoration)
        self.border_buttons.grid(row=0, column=1, sticky='w')

        label = Label(frame, text='  Scaling:')
        label.grid(row=0, column=2, sticky='e')
        self.scaling_scale = Scale(frame,
                                   orient=Tkinter.HORIZONTAL,
                                   value=self.scaling)
        self.scaling_scale.grid(row=0, column=3, sticky='ew')