tools module
- class tools.TextInsertWindow(app, *args, **kwargs)[source]
Bases:
CTkFrame
Custom Widget that handles the insertion of text items into the canvas.
- check_if_overlay()[source]
Decorator that checks if the current active canvas is the base canvas or the overlay canvas.
- handle_insert_text_btn(event=None)[source]
Inserts the text from the widget onto the canvas.
- Parameters:
event (tkinter.Event) –
- Returns:
None
- new_font_pixel_size = -50
- on_combobox_select(choice)[source]
Called on selecting an option from the dropdown combobox.
- Parameters:
choice (str) – Name of the font.
- Returns:
None
- on_listbox_select(event=0, file_name=None)[source]
Called on selecting a font name from the listbox. Assigns the Text font as the selected font.
- Parameters:
event (tkinter.Event,optional) – Mouse click event.
file_name (str,optional) – Font filename to use.
- Returns:
None
- populate_listbox()[source]
Loads the fonts from the ‘fonts’ folder in the program directory and lists the fonts in the widget list box. :returns: None
- reveal_text_insert_window(event=None)[source]
Displays the text_insert_window widget.
- Parameters:
event (tkinter.Event,optional) –
- Returns:
None
- selected_font = ''
- selected_font_file = ''
- selected_font_index = 0
- selected_font_size = -50
- stored_text_position = None
- stored_text_size: int = None
- class tools.Tools(app, canvas, graphics_manager)[source]
Bases:
object
Class that handles the different tools in the main app.
- create_tool_button_dict()[source]
Creates a dictionary consisting of the tool index as keys and the buttons as values. For ease of configuring the buttons. :returns: None
- current_tool = 1
- decimate_factor = 1.5
- disable_all_modifiers()[source]
Sets the state of all modifier checkbox to ‘disabled’.
- Returns:
None
- endcap = 'round'
- fill_color = '#FF0000'
- fill_color_checkbox_handler()[source]
Gets the state of the fill checkbox and sets the shape_fill variable accordingly.
- Returns:
None
- flat_cap_checkbox_handler()[source]
Gets the state of the flatcap checkbox and sets the endcap variable accordingly.
- Returns:
None
- highlight_checkbox_handler()[source]
Gets the state of the highlight checkbox and sets the stipple variable accordingly.
- Returns:
None
- previous_tool = 0
- reset_tool_variables()[source]
Resets all tool variables like width, fill, constraint to the default state. Returns:
- shape_constraint = False
- shape_fill = False
- stipple = ''
- stroke_width = 10