文件选择器-fileselector

描述

_image 文件选择器,父对象为service.ctl,无子对象。用于通过文件浏览器的方式选择文件或者文件夹。该控件从WeStudio 1.9.2最新版本引入。


事件

  • select: 选中,事件函数定义:onSelect(path), path为选中的文件或者文件夹的完整路径


属性

名称

功能说明

脚本例子

textColor

文字颜色,颜色定义参看 控件对象

service.ctl.fileselector.textColor='#ff0000' 设置文字为红色

buttonBackgroundColorType

按钮背景色类型:0-Linear_A, 1-Linear_B, 2-Radial_A, 3-Radial_B, 4-Circle, 5-Pure, 6-No_Color可选

service.ctl.fileselector.buttonBackgroundColorType=4 设置背景颜色类型为Circle

buttonBackgroundColor

按钮背景色

service.ctl.fileselector.buttonBackgroundColor='#a0a0a0' 设置背景为灰色

buttonBorderType

按钮边框类型:0-Inset,1-Outset,2-Dotted,3-Solid,4-No_Border。

service.ctl.fileselector.buttonBorderType=4 设置对象无边框

buttonBorderColor

按钮边框颜色,颜色定义参看 控件对象

service.ctl.fileselector.buttonBorderColor='#ff0000' 设置边框为红色

rootPath

根路径

service.ctl.fileselector.rootPath='/storage'; 设置根路径为/storage

fileFilters

文件过滤器,多种类型使用逗号分隔

service.ctl.fileselector.fileFilters='.txt,.inf,*.json'; 设置文件过滤器

enterButtonText

进入按钮文字

service.ctl.fileselector.enterButtonText='进入'; 设置按钮文字

okButtonText

确认按钮文字

service.ctl.fileselector.okButtonText='确认'; 设置按钮文字

cancelButtonText

取消按钮文字

service.ctl.fileselector.cancelButtonText='取消'; 设置按钮文字

方法

名称

功能说明

脚本例子

chooseFile()

选择文件

service.ctl.fileselector.chooseFile() 选择文件

chooseDirectory()

选择文件夹

service.ctl.fileselector.chooseDirectory() 选择文件夹