Example #1
0
    def generate_sub_window(self):

        if self.form_dict_is_valid_Q():
            self.window = self.create_window("Gem5 script runner *.gem",
                                             SCRIPT_RUN_MENU_WINSIZE)
            self.window.resizable(FALSE, FALSE)
            self.frameTop = Frame(self.window, height=200)
            self.frameScale = Frame(self.window, height=100)
            self.frameMiddle = Frame(self.window, height=200)
            self.frameBottom = Frame(self.window, height=200)

            self.frameTop.grid(row=1)
            self.frameScale.grid(row=2)
            self.frameMiddle.grid(row=3)
            self.frameBottom.grid(row=4)

            #top frame widgets
            cur_row = 0
            cur_row = self.add_file_browser_and_textbar(self.frameTop, cur_row)
            MsgPanel(self.frameTop,
                     ["Default config file: " + self.config_file_str],
                     row=cur_row,
                     column=0)
            #add scale of processes frame
            self.add_process_amount_bar(self.frameScale)
            #middle fram widgets
            cur_row = 0
            cur_row = self.add_buttons(self.frameMiddle)
            #TODO load number of parallel processes
            #bottom frame widgets
        else:
            messagebox.showerror("Error", "One of the file is incomplete")
Example #2
0
 def add_file_browser_and_textbar(self, frame, row):
     MsgPanel(frame, ["Choose script file to run multiple gem5 tests"], row,
              0)
     self.txtBox = Text(frame, width=80, height=1, state=NORMAL)
     self.txtBox.delete(1.0, END)
     self.txtBox.insert(END, self.dict_properties[PATH_TO_SCRIPT])
     self.txtBox['state'] = DISABLED
     self.BrowseButton = Button(
         frame,
         text='Browse',
         command=lambda: self.browse(self.window, self.txtBox,
                                     PATH_TO_SCRIPT))
     row += 1
     self.txtBox.grid(row=row, column=0, padx=5)
     self.BrowseButton.grid(row=row, column=1)
     row += 1
     MsgPanel(frame,
              ["Choose output folder or mark the default statistics"], row,
              0)
     self.txtBoxOutputDir = Text(frame, width=80, height=1, state=NORMAL)
     self.txtBoxOutputDir.delete(1.0, END)
     if OUTPUT_DIR not in self.dict_properties.keys():
         self.dict_properties[OUTPUT_DIR] = DEFAULT_OUTPUT_DIR
     self.txtBoxOutputDir.insert(END, self.dict_properties[OUTPUT_DIR])
     self.txtBoxOutputDir['state'] = DISABLED
     self.BrowseButtonOutputDir = Button(
         frame,
         text='Browse',
         command=lambda: self.browse(self.window, self.txtBoxOutputDir,
                                     OUTPUT_DIR, True))
     self.default_out_dir_var = IntVar()
     self.default_out_dir_var.set(0)
     self.DefaultOutdirCheckButton = Checkbutton(
         frame,
         text="Default Dir",
         variable=self.default_out_dir_var,
         command=self.default_dir_checkbutton_action)
     row += 1
     self.txtBoxOutputDir.grid(row=row, column=0, padx=5)
     self.BrowseButtonOutputDir.grid(row=row, column=1)
     row += 1
     self.DefaultOutdirCheckButton.grid(row=row, column=0)
     row += 1
     return row
Example #3
0
    def _create_widgets(self):
        if self.isapp:
            MsgPanel(self, [
                "Drag the 'sash' between the two scrolled windows ",
                "to resize them."
            ])

            SeeDismissPanel(self)

        self._create_demo_panel()
Example #4
0
 def _create_widgets(self):
     if self.isapp:
         MsgPanel(self, 
                  ["This window displays a canvas widget containing ",
                   "a simple 2-dimensional plot.  You can doctor the ",
                   "data by dragging any of the points with mouse button 1."])
         
         SeeDismissPanel(self)
     
     self._create_demo_panel()
    def _create_widgets(self):
        if self.isapp:
            MsgPanel(self, [
                "This demonstration shows off a nested set of themed paned ",
                "windows. Their sizes can be changed by grabbing the area ",
                "between each contained pane and dragging the divider."
            ])

            SeeDismissPanel(self)

        self._create_demo_panel()
Example #6
0
    def _create_widgets(self):
        if self.isapp:
            MsgPanel(self, [
                "An arrow and a vertical scale are displayed below. ",
                "If you click or drag mouse button 1 in the scale, you ",
                "can change the length of the arrow."
            ])

            SeeDismissPanel(self)

        self._create_demo_panel()
Example #7
0
 def _create_widgets(self):
     if self.isapp:
         MsgPanel(self,
                  ["Three different spin-boxes are displayed below. ",
                   "The first, which is 'read only', displays a different ",
                   "background colour.\n",
                   "Select a value using the up/down arrowhead keys ",
                   "or keyboard up/down arrow keys."])
          
         SeeDismissPanel(self)
      
     self._create_demo_panel()
Example #8
0
 def add_progress_bar(self, frame, row, column, process_id):
     name_frame = MsgPanel(frame, ["P-" + str(process_id)], row, column)
     row += 1
     progress_var = DoubleVar()
     progress_var.set(0)
     pb = Progressbar(frame,
                      mode='determinate',
                      length=200,
                      variable=progress_var,
                      maximum=100)
     pb.grid(row=row, column=column, pady=5, padx=5)
     return (process_id, pb, progress_var)
Example #9
0
 def _create_widgets(self): 
     if self.isapp: 
         MsgPanel(self,  
                  ["Three different spin-boxes are displayed below. ", 
                   "The first is fully editable, pressing 'Return' adds ", 
                   "the entered text to the list. The second is disabled. ", 
                   "The third is a pre-defined, non-editable list.\n", 
                   "Select a value using the up/down arrowhead keys or ", 
                   "keyboard up/down arrow keys."]) 
           
         SeeDismissPanel(self) 
       
     self._create_demo_panel() 
Example #10
0
 def _create_widgets(self):
     if self.isapp:
         MsgPanel(self,
                  [ "One of the new Ttk widgets is a tree widget ",
                   "which can be configured to display multiple columns of data without ",
                   "displaying the tree itself. This is a simple way to build a listbox that has multiple ",
                   "columns.\n\n",
                   "Click a column heading to re-sort the data. ",
                   "Drag a column boundary to resize a column."])
          
         SeeDismissPanel(self)
      
     self._create_demo_panel()
Example #11
0
 def _create_widgets(self):
     if self.isapp:
         MsgPanel(self, ["One of the new Tk themed widgets is a tree widget, which allows ",
                         "the user to browse a hierarchical data-set such as a file system. ",
                         "The tree widget not only allows for the tree part itself, but it ",
                         "also supports an arbitrary number of additional columns which can ",
                         "show additional data (in this case, the size of the files found ",
                         "on your file system). You can also change the width of the columns ",
                         "by dragging the boundary between them."])
         
         SeeDismissPanel(self)
     
     self._create_demo_panel()
Example #12
0
    def _create_widgets(self):
        if self.isapp:
            MsgPanel(self, [
                "Below are two progress bars. The top one is a \u201Cdeterminate\u201D ",
                "progress bar, which is used for showing how far through a defined task ",
                "the program has got. The bottom one is an \u201Cindeterminate\u201D ",
                "progress bar, which is used to show that the program is busy but does ",
                "not know how long for. Both are run here in self-animated mode, which ",
                "can be turned on and off using the buttons underneath."
            ])

            SeeDismissPanel(self)

        self._create_demo_panel()
Example #13
0
    def _create_widgets(self):
        if self.isapp:
            self.msgPanel = MsgPanel(self, [
                "Instruction:\n",
                "   - Click on any of the pieces next to the space and that\n",
                "     piece will slide over the space.\n",
                "   -  Continue this until the pieces are arranged in\n",
                "      numerical order. Refer 4x4 result below.\n\n",
                "The end result in 4x4 puzzle:\n", " 1    2    3    4\n",
                "12  13  14   5\n", "11        15   6\n", "10   9    8    7"
            ])
            self.seeDismissPanel = SeeDismissPanel(self)

        self._create_demo_panel()
Example #14
0
    def _create_widgets(self):
        if self.isapp:
            MsgPanel(self, [
                "This widget allows you to experiment with different ",
                "widths and arrowhead shapes for lines in canvases.  ",
                "To change the line width or the shape of the arrowhead, ",
                "drag any of the three boxes attached to the oversized ",
                "arrow.  The arrows on the right give examples at normal ",
                "scale.  The text at the bottom shows the configuration ",
                "options as you'd enter them for a canvas line item."
            ])

            SeeDismissPanel(self)

        self._create_demo_panel()
    def _create_widgets(self):
        if self.isapp:
            MsgPanel(self, [
                "Three groups of radiobuttons are displayed below.  If you click on a button then ",
                "the button will become selected exclusively among all the buttons in its group. ",
                "A control variable is associated with each group to indicate which of the group's ",
                "buttons is selected.\n\n",
                "Selecting a Point Size or Color changes the associated Labelframe text.\n\n",
                "Selecting an Alignment repositions the graphic with respect ",
                "to the label i.e. 'Bottom' puts the graphic 'below' the label."
            ])

            SeeDismissPanel(self)

        self._create_demo_panel()
Example #16
0
    def _create_widgets(self):
        if self.isapp:
            MsgPanel(self, [
                "This demonstration shows how Tkinter can be used to carry out animations ",
                "that are linked to simulations of physical systems. In the left canvas ",
                "is a graphical representation of the physical system itself, a simple ",
                "pendulum, and in the right canvas is a graph of the phase space of the ",
                "system, which is a plot of the angle (relative to the vertical) against ",
                "the angular velocity. The pendulum bob may be repositioned by clicking ",
                "and dragging anywhere on the left canvas."
            ])

            SeeDismissPanel(self)

        self._create_demo_panel()
Example #17
0
 def add_process_amount_bar(self, frame):
     cur_row = 0
     MsgPanel(frame, ["Select # of processes:"], row=cur_row, column=1)
     cur_row += 1
     slider = IntVar()
     slider.set(1)
     self.processes_available = 1
     self.processes_label = Label(frame,
                                  textvariable=slider).grid(row=cur_row,
                                                            column=1)
     cur_row += 1
     self.processes_scale = Scale(
         frame,
         from_=1,
         to_=20,
         length=300,
         variable=slider,
         command=lambda x: self.discrete_scale(slider)).grid(row=cur_row,
                                                             column=1)
Example #18
0
 def _create_widgets(self):
     if self.isapp:    
         MsgPanel(self,
                  ["This is a demonstration of how to do ",
                   "a toolbar that is styled correctly and which ",
                   "can be torn off. The buttons are configured ",
                   "to be 'toolbar style' buttons by ",
                   "telling them that they are to use the Toolbutton ",
                   "style. At the left end of the toolbar is a ",
                   "simple marker, on mouse over, the cursor changes to a ",
                   "movement icon; drag that away from the ",
                   "toolbar to tear off the whole toolbar into a ",
                   "separate toplevel widget. When the dragged-off ",
                   "toolbar is no longer needed, just close it like ",
                   "any normal toplevel and it will reattach to the ",
                   "window it was torn from."])       
         SeeDismissPanel(self)
     
     self._create_demo_panel()
Example #19
0
    def _create_widgets(self):
        if self.isapp:
            MsgPanel(self, [
                "Ttk is the new Tk themed widget set. This is a Ttk themed label, ",
                "and below are three groups of Ttk widgets in Ttk labelframes.\n\n",
                "The first group are all buttons that set the current application ",
                "theme when pressed. Note the message box does not change as it uses ",
                "a standard tkinter Label to hold the message.\n",
                "The second group contains three sets of checkbuttons, ",
                "with a separator widget between the sets. ",
                "Note that the 'Enabled' button controls whether or not all the other ",
                "buttons are in the disabled state.\n",
                "The third group has a collection of linked radiobuttons."
            ])

            SeeDismissPanel(self)

        self._create_demo_panel()
        self.allBtns = self.ttkbut + self.cbs[1:] + self.rb