MCPcopy Create free account
hub / github.com/RainingComputers/whipFTP / mouse_select

Method mouse_select

whipFTP_FileDialogs.py:773–788  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

771 self.canvas.yview_scroll(delta(event), 'units')
772
773 def mouse_select(self, event):
774 #Check for directory mode
775 if(self.directory_mode is True and not isfile(self.file_list[self.current_file_index])):
776 self.change_dir(event)
777 return
778 #Store start position for drag select
779 self.start_x = self.x_cell_pos
780 self.start_y = self.y_cell_pos
781 #Deselect everything
782 self.deselect_everything()
783 #Set selected only if valid index
784 if(self.current_file_index >= 0 and self.current_file_index < len(self.file_list) and self.mouse_x < self.max_width):
785 #Draw a 'selected' highlighting rectangle and save a reference to the rectangle in selected file dictionary
786 self.selected_file_indices[self.current_file_index] = self.canvas.create_rectangle(self.x_cell_pos*self.cell_width+2, self.y_cell_pos*35+2,
787 (self.x_cell_pos+1)*self.cell_width-1, (self.y_cell_pos+1)*35-1,
788 fill = '', outline = 'Red')
789
790 def ctrl_select(self, event):
791 #Check for directory mode

Callers

nothing calls this directly

Calls 2

change_dirMethod · 0.95
deselect_everythingMethod · 0.95

Tested by

no test coverage detected