跳转至

pyguiadapter.widgets.pathseditor

控件配置类

PathsEditorConfig dataclass

Bases: CommonParameterWidgetConfig

Source code in pyguiadapter\widgets\extend\pathseditor.py
@dataclasses.dataclass(frozen=True)
class PathsEditorConfig(CommonParameterWidgetConfig):
    default_value: List[str] = dataclasses.field(default_factory=list)

    editor_button_text: str = "Edit({} paths in list)"
    """编辑按钮的文本"""

    editor_title: str = ""
    """路径列表编辑器的标题"""

    editor_size: Tuple[int, int] = (750, 600)
    """路径列表编辑器窗口的大小"""

    file_list_title: str = "Paths"
    """路径列表区域的标题"""

    add_file: bool = True
    """是否开启添加文件功能"""

    add_dir: bool = True
    """是否开启添加文件夹功能"""

    add_file_button_text: str = "File..."
    """添加文件按钮的文本"""

    file_filters: str = ""
    """文件过滤器,用于选择文件对话框"""

    add_dir_button_text: str = "Folder..."
    """添加文件夹按钮的文本"""

    start_dir: str = ""
    """文件对话框的初始目录"""

    path_as_posix: bool = True
    """是否将选择的文件或文件夹的路径以 Posix 格式保存"""

    edit_button_text: str = "Edit"
    """编辑按钮的文本"""

    remove_button_text: str = "Remove"
    """移除按钮的文本"""

    clear_button_text: str = "Clear"
    """清空按钮的文本"""

    up_button_text: str = "Up"
    """上移按钮的文本"""

    down_button_text: str = "Down"
    """下移按钮的文本"""

    file_dialog_title: str = "Select File"
    """选择文件对话框的标题"""

    dir_dialog_title: str = "Select Directory"
    """选择文件夹对话框的标题"""

    confirm_dialog_title: str = "Confirm"
    """确认对话框的标题"""

    warning_dialog_title: str = "Warning"
    """警告对话框的标题"""

    confirm_clear_message: Optional[str] = "Remove all the paths from the list?"
    """清空文件列表的确认消息文本,如果为 None 则不显示确认消息,直接清空文件列表"""

    confirm_remove_message: Optional[str] = "Remove the selected path(s) from the list?"
    """移除当前选中项的确认消息文本,如果为 None 则不显示确认消息,直接移除当前选中项"""

    no_items_selected_message: Optional[str] = "No path selected!"
    """没有选中任何项时的提示消息"""

    no_items_added_message: Optional[str] = "No path added!"
    """没有添加任何项时的提示消息"""

    double_click_to_edit: bool = True
    """是否允许双击列表项进行编辑"""

    path_item_editor_title: str = "Edit Path"
    """路径编辑对话框的标题"""

    path_item_editor_center_container_title: str = "Path"
    """路径编辑对话框中中心容器的标题"""

    @classmethod
    def target_widget_config(cls) -> Type["PathsEditor"]:
        return PathsEditor

add_dir: bool = True class-attribute instance-attribute

是否开启添加文件夹功能

add_dir_button_text: str = 'Folder...' class-attribute instance-attribute

添加文件夹按钮的文本

add_file: bool = True class-attribute instance-attribute

是否开启添加文件功能

add_file_button_text: str = 'File...' class-attribute instance-attribute

添加文件按钮的文本

clear_button_text: str = 'Clear' class-attribute instance-attribute

清空按钮的文本

confirm_clear_message: Optional[str] = 'Remove all the paths from the list?' class-attribute instance-attribute

清空文件列表的确认消息文本,如果为 None 则不显示确认消息,直接清空文件列表

confirm_dialog_title: str = 'Confirm' class-attribute instance-attribute

确认对话框的标题

confirm_remove_message: Optional[str] = 'Remove the selected path(s) from the list?' class-attribute instance-attribute

移除当前选中项的确认消息文本,如果为 None 则不显示确认消息,直接移除当前选中项

dir_dialog_title: str = 'Select Directory' class-attribute instance-attribute

选择文件夹对话框的标题

double_click_to_edit: bool = True class-attribute instance-attribute

是否允许双击列表项进行编辑

down_button_text: str = 'Down' class-attribute instance-attribute

下移按钮的文本

edit_button_text: str = 'Edit' class-attribute instance-attribute

编辑按钮的文本

editor_button_text: str = 'Edit({} paths in list)' class-attribute instance-attribute

编辑按钮的文本

editor_size: Tuple[int, int] = (750, 600) class-attribute instance-attribute

路径列表编辑器窗口的大小

editor_title: str = '' class-attribute instance-attribute

路径列表编辑器的标题

file_dialog_title: str = 'Select File' class-attribute instance-attribute

选择文件对话框的标题

file_filters: str = '' class-attribute instance-attribute

文件过滤器,用于选择文件对话框

file_list_title: str = 'Paths' class-attribute instance-attribute

路径列表区域的标题

no_items_added_message: Optional[str] = 'No path added!' class-attribute instance-attribute

没有添加任何项时的提示消息

no_items_selected_message: Optional[str] = 'No path selected!' class-attribute instance-attribute

没有选中任何项时的提示消息

path_as_posix: bool = True class-attribute instance-attribute

是否将选择的文件或文件夹的路径以 Posix 格式保存

path_item_editor_center_container_title: str = 'Path' class-attribute instance-attribute

路径编辑对话框中中心容器的标题

path_item_editor_title: str = 'Edit Path' class-attribute instance-attribute

路径编辑对话框的标题

remove_button_text: str = 'Remove' class-attribute instance-attribute

移除按钮的文本

start_dir: str = '' class-attribute instance-attribute

文件对话框的初始目录

up_button_text: str = 'Up' class-attribute instance-attribute

上移按钮的文本

warning_dialog_title: str = 'Warning' class-attribute instance-attribute

警告对话框的标题

控件类

PathsEditor

对应参数数据类型

  • paths_t -> PathsEditor