From 5b8b47f01ec2259d9a0e38d5f92aa7a445154eda Mon Sep 17 00:00:00 2001 From: ll Date: Sat, 10 Jul 2021 20:32:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E5=90=88=E6=A1=86=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\350\243\205\346\265\213\350\257\225.json" | 1537 +++++++++++++++++ ...01\350\243\205\346\265\213\350\257\225.py" | 94 + pyefun/wxefun/component/ComboBox.py | 62 +- pyefun/wxefun/evt.py | 13 + 4 files changed, 1690 insertions(+), 16 deletions(-) create mode 100644 "example/wxpython/\347\273\204\345\220\210\346\241\206\347\273\204\344\273\266\345\260\201\350\243\205\346\265\213\350\257\225.json" create mode 100644 "example/wxpython/\347\273\204\345\220\210\346\241\206\347\273\204\344\273\266\345\260\201\350\243\205\346\265\213\350\257\225.py" diff --git "a/example/wxpython/\347\273\204\345\220\210\346\241\206\347\273\204\344\273\266\345\260\201\350\243\205\346\265\213\350\257\225.json" "b/example/wxpython/\347\273\204\345\220\210\346\241\206\347\273\204\344\273\266\345\260\201\350\243\205\346\265\213\350\257\225.json" new file mode 100644 index 0000000..36c3f7e --- /dev/null +++ "b/example/wxpython/\347\273\204\345\220\210\346\241\206\347\273\204\344\273\266\345\260\201\350\243\205\346\265\213\350\257\225.json" @@ -0,0 +1,1537 @@ +{ + "窗口1": { + "自有属性": { + "标题": { + "数据类型": "文本型", + "描述": "本属性指定窗口的标题文本", + "设定值": "易函数视窗编程系统", + "属性值": "" + }, + "边框": { + "数据类型": "选择列表型", + "描述": "本属性指定窗口边框的类型", + "设定值": 1, + "属性值": [ + "无边框", + "普通可调边框", + "普通固定边框" + ] + }, + "底图": { + "数据类型": "图片文件型", + "描述": "本属性指定显示在窗口背景上的图片", + "设定值": "", + "属性值": "" + }, + "底图方式": { + "数据类型": "选择列表型", + "描述": "如果设定了底图,本属性指定窗口背景上底图的显示方式", + "设定值": 0, + "属性值": [ + "图片居左上", + "图片平铺", + "图片居中", + "缩放图片" + ] + }, + "背景音乐": { + "数据类型": "字节集", + "描述": "本属性指定当窗口调入时自动开始播放的音乐", + "设定值": "", + "属性值": "" + }, + "播放次数": { + "数据类型": "选择列表型", + "描述": "本属性指定背景音乐的播放次数", + "设定值": 0, + "属性值": [ + "循环播放", + "仅播放一次", + "不播放" + ] + }, + "控制按钮": { + "数据类型": "逻辑型", + "描述": "本属性设置是否显示窗口上的所有控制按钮及窗口控制菜单", + "属性值": true, + "设定值": true + }, + "最大化按钮": { + "数据类型": "逻辑型", + "描述": "本属性设置是否显示窗口右上角的最大化或还原按钮", + "属性值": false, + "设定值": false + }, + "最小化按钮": { + "数据类型": "逻辑型", + "描述": "本属性设置是否显示窗口右上角的最小化按钮", + "属性值": true, + "设定值": true + }, + "位置": { + "数据类型": "选择列表型", + "描述": "本属性设置窗口的位置及状态。注意如果欲设置为“最大化”,“边框”属性必须不为固定类边框", + "设定值": 0, + "属性值": [ + "通常", + "居中", + "最小化", + "最大化" + ] + }, + "可否移动": { + "数据类型": "逻辑型", + "描述": "本属性设置窗口位置能否被移动", + "设定值": false, + "属性值": false + }, + "图标": { + "数据类型": "图片文件型", + "描述": "本属性设置窗口左上角所显示的图标", + "设定值": "", + "属性值": "" + }, + "回车下移焦点": { + "数据类型": "逻辑型", + "描述": "本属性如果设置为真,运行时当用户在本窗口上按下回车键后,将自动将当前焦点转移到下一个组件。本属性如果设置为假,当用户在本窗口上按下回车键后,将等同于按下具有“默认”属性的按钮", + "属性值": false, + "设定值": false + }, + "Esc键关闭": { + "数据类型": "逻辑型", + "描述": "本属性设置运行时用户是否可以用 Esc 键关闭本窗口", + "属性值": false, + "设定值": false + }, + "在任务条中显示": { + "数据类型": "逻辑型", + "描述": "设置本窗口是否出现在 Windows 系统的任务条中", + "属性值": true, + "设定值": true + }, + "随意移动": { + "数据类型": "逻辑型", + "描述": "设置当用户在窗口上任何位置按下鼠标左键后是否进入窗口整体移动模式。注意如果本属性设置为真,则在本窗口及其中所有不能接收输入焦点的子组件上均不能再接收到“鼠标左键被按下”和“鼠标左键被放开”事件", + "属性值": false, + "设定值": false + }, + "总在最前": { + "数据类型": "逻辑型", + "描述": "设置本窗口永远位于其它窗口的前面", + "属性值": false, + "设定值": false + } + }, + "自有方法": { + "取窗口句柄": { + "参数个数": "0", + "描述": "取出本窗口或窗口组件的窗口句柄(即HWND)", + "返回值类型": "整数型" + }, + "销毁": { + "参数个数": "1", + "描述": "销毁本窗口或窗口组件。窗口被销毁后,所有在载入本窗口之后对本窗口及其内窗口组件所进行的修改或设置都将被抛弃,窗口被销毁后如想再次使用必须重新装载。注意:当窗口调用本方法进行销毁时,窗口并不会被立即销毁,而会被推迟到其它所有现存窗口事件处理完毕后才会被真正销毁", + "返回值类型": "无" + }, + "获取焦点": { + "参数个数": "0", + "描述": "将焦点移动到窗口组件。如果对窗口使用本方法,窗口将自动把焦点转移到第一个有能力保留焦点的窗口组件上去", + "返回值类型": "无" + }, + "可有焦点": { + "参数个数": "0", + "描述": "如果当前窗口组件具有焦点,则返回真,否则返回假", + "返回值类型": "逻辑型" + }, + "取用户区宽度": { + "参数个数": "0", + "描述": "返回窗口或窗口组件用户区域的宽度,单位为像素点。对窗口而言,用户区域为窗口区域减去标题栏、菜单栏、边框后的区域;对窗口组件而言,用户区域等同于其窗口组件区域", + "返回值类型": "整数型" + }, + "取用户区高度": { + "参数个数": "0", + "描述": "返回窗口或窗口组件用户区域的高度,单位为像素点。对窗口而言,用户区域为窗口区域减去标题栏、菜单栏、边框后的区域;对窗口组件而言,用户区域等同于其窗口组件区域", + "返回值类型": "整数型" + }, + "禁止重画": { + "参数个数": "0", + "描述": "禁止窗口或窗口组件重画,以避免当频繁进行操作时引起闪烁。注意调用本命令后必须调用“允许重画”命令进行恢复", + "返回值类型": "无" + }, + "允许重画": { + "参数个数": "0", + "描述": "重新允许被禁止的窗口或窗口组件重画", + "返回值类型": "无" + }, + "重画": { + "参数个数": "0", + "描述": "通知 Windows 系统本窗口或窗口组件上的显示内容需要在以后被全部重画", + "返回值类型": "无" + }, + "部分重画": { + "参数个数": "4", + "描述": "通知 Windows 系统本窗口或窗口组件上的显示内容需要在以后被部分重画", + "返回值类型": "无" + }, + "取消重画": { + "参数个数": "0", + "描述": "通知 Windows 系统本窗口或窗口组件不再需要被重画,保留现有的全部显示内容", + "返回值类型": "无" + }, + "刷新显示": { + "参数个数": "0", + "描述": "如果本窗口或窗口组件上的显示内容需要被全部或部分重画,则立即进行重画更新,否则不进行任何操作直接返回", + "返回值类型": "无" + }, + "移动": { + "参数个数": "4", + "描述": "改变窗口或窗口组件的位置或尺寸", + "返回值类型": "无" + }, + "调整层次": { + "参数个数": "1", + "描述": "改变窗口或窗口组件的现行所处层次", + "返回值类型": "无" + }, + "弹出菜单": { + "参数个数": "3", + "描述": "用于在窗口上的当前鼠标位置或指定坐标位置显示弹出式菜单,如果调用对象为窗口组件,则自动使用其所在的窗口", + "返回值类型": "无" + }, + "发送信息": { + "参数个数": "3", + "描述": "将指定信息发送到窗口或窗口组件,并等待且取回信息反馈值", + "返回值类型": "整数型" + }, + "投递信息": { + "参数个数": "3", + "描述": "将指定信息发送到窗口或窗口组件,不等待直接返回", + "返回值类型": "无" + }, + "取标记组件": { + "参数个数": "1", + "描述": "返回当前窗口中具有指定标记数值文本的组件。如果不存在,将产生运行时错误", + "返回值类型": "通用型" + }, + "置外形图片": { + "参数个数": "2", + "描述": "使用图片来设置窗口的外形,注意图片类型不能为图标及鼠标指针。另外,图片的轮廓应该尽量简单,以免影响窗口的刷新速度。如果调用对象为窗口组件,将自动使用其所在的窗口。成功返回真,失败返回假", + "返回值类型": "逻辑型" + }, + "激活": { + "参数个数": "0", + "描述": "", + "返回值类型": "无" + }, + "置托盘图标": { + "参数个数": "2", + "描述": "设置本程序在系统托盘中的图标", + "返回值类型": "无" + }, + "弹出托盘菜单": { + "参数个数": "1", + "描述": "在当前鼠标位置弹出指定菜单,本命令一般用作支持托盘菜单的弹出", + "返回值类型": "无" + }, + "置父窗口": { + "参数个数": "1", + "描述": "设置指定窗口或窗口组件为本对象窗口或窗口组件的父窗口", + "返回值类型": "无" + } + }, + "自有事件": { + "创建完毕": { + "描述": "当窗口及其中的所有组件均被创建后在显示之前产生此事件,用户可以在响应此事件期间做一些初始化工作。本事件为该窗口的第一个事件", + "事件参数": "0", + "事件返回值": "无", + "设定值": "" + }, + "可否被关闭": { + "描述": "在窗口及计算机被关闭之前产生此事件,用于询问该关闭操作是否允许被继续。如果返回假则不允许关闭,返回真或不返回值允许关闭", + "事件参数": "0", + "事件返回值": "无", + "设定值": "" + }, + "将被销毁": { + "描述": "当窗口将被销毁前产生此事件。窗口被销毁后所有对此窗口及其内部组件的修改都将被作废", + "事件参数": "0", + "事件返回值": "无", + "设定值": "" + }, + "位置被改变": { + "描述": "当窗口的位置被改变时产生此事件", + "事件参数": "0", + "事件返回值": "无", + "设定值": "" + }, + "尺寸被改变": { + "描述": "当窗口的尺寸被改变后产生此事件", + "事件参数": "0", + "事件返回值": "无", + "设定值": "" + }, + "被激活": { + "描述": "当窗口转换为激活状态时产生此事件", + "事件参数": "0", + "事件返回值": "无", + "设定值": "" + }, + "被取消激活": { + "描述": "当窗口转换为非激活状态时产生此事件", + "事件参数": "0", + "事件返回值": "无", + "设定值": "" + }, + "空闲": { + "描述": "当系统正处于空闲状态时产生此事件,用户可以在响应此事件时做一些后台处理工作。如果事件处理子程序返回假或者不返回值,在此次空闲期间系统将不再产生空闲事件(可以降低 CPU 占用率)。如果返回真,系统将继续产生空闲事件", + "事件参数": "1", + "事件返回值": "无", + "设定值": "" + }, + "首次激活": { + "描述": "当窗口创建完毕后被首次激活显示时产生此事件,在此事件及此事件后用户可以开始在窗口内的画板组件上写出内容", + "事件参数": "0", + "事件返回值": "无", + "设定值": "" + }, + "托盘事件": { + "描述": "当用户用鼠标单击或双击本窗口对象“置托盘图标”方法所设置的图标后即产生本事件", + "事件参数": "1", + "事件返回值": "无", + "设定值": "" + }, + "被显示": { + "描述": "当窗口被显示时产生此事件", + "事件参数": "0", + "事件返回值": "无", + "设定值": "" + }, + "被隐藏": { + "描述": "当窗口被隐藏时产生此事件", + "事件参数": "0", + "事件返回值": "无", + "设定值": "" + }, + "窗口可否被关闭": { + "描述": "在窗口被关闭之前产生此事件,用于询问窗口可否被关闭。如果返回假则不允许窗口被关闭,返回真或不返回值允许关闭", + "事件参数": "0", + "事件返回值": "无", + "设定值": "" + } + }, + "公共属性": { + "左边": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 957 + }, + "顶边": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 402 + }, + "宽度": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 380 + }, + "高度": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 250 + }, + "标记": { + "数据类型": "文本型", + "描述": "", + "属性值": "", + "设定值": "" + }, + "可视": { + "数据类型": "逻辑型", + "描述": "", + "属性值": true, + "设定值": true + }, + "禁止": { + "数据类型": "逻辑型", + "描述": "", + "属性值": false, + "设定值": false + }, + "鼠标指针": { + "数据类型": "选择列表型", + "描述": "", + "设定值": 0, + "属性值": [ + "默认型", + "标准箭头型", + "十字型", + "文本编辑型", + "沙漏型", + "箭头及问号型", + "箭头及沙漏型", + "禁止符型", + "四向箭头型", + "北东箭头型", + "北南箭头型", + "北西箭头型", + "西东箭头型", + "向上箭头", + "手型" + ] + }, + "字体": { + "数据类型": "字体", + "描述": "", + "属性值": "", + "设定值": [ + 9, + 74, + 90, + 400, + false, + "Microsoft YaHei UI", + -1 + ] + }, + "文本颜色": { + "数据类型": "颜色型", + "描述": "", + "属性值": "", + "设定值": "(0, 0, 0, 255)" + }, + "背景颜色": { + "数据类型": "颜色型", + "描述": "", + "属性值": "", + "设定值": "(171, 171, 171, 255)" + } + }, + "公共事件": { + "鼠标左键被按下": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标左键被放开": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "被双击": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标右键被按下": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标右键被放开": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标位置被移动": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "获得焦点": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "失去焦点": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "按下某键": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "放开某键": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "字符输入": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "滚轮被滚动": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + } + }, + "名称": "窗口1", + "组件名称": "窗口", + "组件id": null, + "组件对象": null, + "方块": null, + "画笔": null + }, + "按钮1": { + "自有属性": { + "图片": { + "数据类型": "图片文件型", + "描述": "本属性指定显示在按钮上的图片", + "属性值": "", + "设定值": "" + }, + "类型": { + "数据类型": "选择列表型", + "描述": "当在窗口上按下Enter键时,如果没有将窗口的“回车下移输入点”属性设置为真,则等同于按下了具有“默认”类型的按钮。因此具有“默认”类型的按钮在同一窗口上应当只有一个。“通常”类型的按钮无对应的操作默认键", + "属性值": [ + "通常", + "默认" + ], + "设定值": 0 + }, + "标题": { + "数据类型": "文本型", + "描述": "标题只有在图片为空时才有效,如果希望某一字符成为此按钮的访问键,可以在该字符前面加上一个 & 字符", + "属性值": "", + "设定值": "测试" + }, + "文字对齐方式": { + "数据类型": "选择列表型", + "描述": "", + "设定值": 0, + "属性值": [ + "文字在居中", + "文字在顶部", + "文字在底部", + "文字在左边", + "文字在右边", + "文字在左上角", + "文字在右上角", + "文字在左下角", + "文字在右下角" + ] + } + }, + "自有方法": {}, + "自有事件": { + "被单击": { + "描述": "当单击按钮后即产生此事件", + "事件参数": "0", + "事件返回值": "无", + "设定值": "按钮1_被单击" + } + }, + "公共属性": { + "左边": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 241 + }, + "顶边": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 63 + }, + "宽度": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 97 + }, + "高度": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 30 + }, + "标记": { + "数据类型": "文本型", + "描述": "", + "属性值": "", + "设定值": "" + }, + "可视": { + "数据类型": "逻辑型", + "描述": "", + "属性值": true, + "设定值": true + }, + "禁止": { + "数据类型": "逻辑型", + "描述": "", + "属性值": false, + "设定值": false + }, + "鼠标指针": { + "数据类型": "选择列表型", + "描述": "", + "设定值": 0, + "属性值": [ + "默认型", + "标准箭头型", + "十字型", + "文本编辑型", + "沙漏型", + "箭头及问号型", + "箭头及沙漏型", + "禁止符型", + "四向箭头型", + "北东箭头型", + "北南箭头型", + "北西箭头型", + "西东箭头型", + "向上箭头", + "手型" + ] + }, + "字体": { + "数据类型": "字体", + "描述": "", + "属性值": "", + "设定值": [ + 9, + 74, + 90, + 400, + false, + "Microsoft YaHei UI", + -1 + ] + }, + "文本颜色": { + "数据类型": "颜色型", + "描述": "", + "属性值": "", + "设定值": "(0, 0, 0, 255)" + }, + "背景颜色": { + "数据类型": "颜色型", + "描述": "", + "属性值": "", + "设定值": "(240, 240, 240, 255)" + } + }, + "公共事件": { + "鼠标左键被按下": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标左键被放开": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "被双击": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标右键被按下": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标右键被放开": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标位置被移动": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "获得焦点": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "失去焦点": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "按下某键": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "放开某键": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "字符输入": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "滚轮被滚动": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + } + }, + "画笔": null, + "方块": null, + "名称": "按钮1", + "组件名称": "按钮", + "组件id": null, + "组件对象": null + }, + "组合框1": { + "自有属性": { + "类型": { + "数据类型": "选择列表型", + "描述": "注意: 修改本属性会丢失动态添加的项目(以原静态项目覆盖)", + "属性值": [ + "可编辑列表式", + "可编辑下拉式", + "不可编辑下拉式" + ], + "设定值": 1 + }, + "内容": { + "数据类型": "文本型", + "描述": "本属性指定在下拉列表框编辑部分中的文本内容。当类型为“不可编辑下拉式”时,本属性无效", + "属性值": "", + "设定值": "123" + }, + "自动排序": { + "数据类型": "逻辑型", + "描述": "", + "属性值": false, + "设定值": true + }, + "现行选中项": { + "数据类型": "整数型", + "描述": "本属性指定下拉列表框中现行被选中的列表项目的位置,位置值从 0 开始, -1 表示现行没有被选中的列表项", + "属性值": 0, + "设定值": 0 + }, + "列表项目": { + "数据类型": "列表项目型", + "描述": "本属性指定各列表项目", + "属性值": 0, + "设定值": 0 + } + }, + "自有方法": { + "取顶端可见项目": { + "参数个数": "0", + "描述": "返回组合框列表部分中当前最顶端可见项目的索引。0 为项目一,1 为项目二,如此类推。失败返回 -1 ", + "返回值类型": "整数型" + }, + "置顶端可见项目": { + "参数个数": "1", + "描述": "设置组合框列表部分中当前最顶端的可见项目,必要时将自动滚动组合框的列表部分。成功返回真,失败返回假", + "返回值类型": "逻辑型" + }, + "取项目数": { + "参数个数": "0", + "描述": "", + "返回值类型": "整数型" + }, + "取项目数值": { + "参数个数": "1", + "描述": "返回与指定项目相关联的数值。如果指定项目不存在,将返回 -1 ", + "返回值类型": "整数型" + }, + "置项目数值": { + "参数个数": "2", + "描述": "设置与指定项目相关联的数值。成功返回真,失败返回假", + "返回值类型": "逻辑型" + }, + "取项目文本": { + "参数个数": "1", + "描述": "返回指定项目的文本。如果指定项目不存在,将返回空文本", + "返回值类型": "文本型" + }, + "置项目文本": { + "参数个数": "2", + "描述": "设置指定项目的文本。成功返回真,失败返回假", + "返回值类型": "逻辑型" + }, + "加入项目": { + "参数个数": "2", + "描述": "加入指定项目到组合框列表部分的尾部,成功返回加入后该项目所处的位置,失败返回 -1 ", + "返回值类型": "整数型" + }, + "插入项目": { + "参数个数": "3", + "描述": "插入指定项目到组合框列表部分的指定位置处,成功返回插入后该项目所处的位置,失败返回 -1 ", + "返回值类型": "整数型" + }, + "删除项目": { + "参数个数": "1", + "描述": "删除组合框列表部分指定位置处的项目。成功返回真,失败返回假", + "返回值类型": "逻辑型" + }, + "清空": { + "参数个数": "0", + "描述": "删除组合框列表部分中的所有项目", + "返回值类型": "无" + }, + "选择": { + "参数个数": "1", + "描述": "在所有项目中寻找首部包含指定文本的项目,如找到,则选中它,并返回该项目的位置索引,否则返回 -1", + "返回值类型": "整数型" + } + }, + "自有事件": { + "列表项被选择": { + "描述": "", + "事件参数": "0", + "事件返回值": "无", + "设定值": "组合框1_列表项被选择" + }, + "编辑内容被改变": { + "描述": "", + "事件参数": "0", + "事件返回值": "无", + "设定值": "组合框1_编辑内容被改变" + }, + "将弹出列表": { + "描述": "在将弹出组合框的列表部分之前产生此事件。在处理此事件时,可以即时填充组合框中的列表项目", + "事件参数": "0", + "事件返回值": "无", + "设定值": "组合框1_将弹出列表" + }, + "列表被关闭": { + "描述": "在关闭被弹出的组合框列表部分后产生此事件", + "事件参数": "0", + "事件返回值": "无", + "设定值": "组合框1_列表被关闭" + } + }, + "公共属性": { + "左边": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 23 + }, + "顶边": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 20 + }, + "宽度": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 179 + }, + "高度": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 36 + }, + "标记": { + "数据类型": "文本型", + "描述": "", + "属性值": "", + "设定值": "" + }, + "可视": { + "数据类型": "逻辑型", + "描述": "", + "属性值": true, + "设定值": true + }, + "禁止": { + "数据类型": "逻辑型", + "描述": "", + "属性值": false, + "设定值": false + }, + "鼠标指针": { + "数据类型": "选择列表型", + "描述": "", + "设定值": 0, + "属性值": [ + "默认型", + "标准箭头型", + "十字型", + "文本编辑型", + "沙漏型", + "箭头及问号型", + "箭头及沙漏型", + "禁止符型", + "四向箭头型", + "北东箭头型", + "北南箭头型", + "北西箭头型", + "西东箭头型", + "向上箭头", + "手型" + ] + }, + "字体": { + "数据类型": "字体", + "描述": "", + "属性值": "", + "设定值": [ + 9, + 74, + 90, + 400, + false, + "Microsoft YaHei UI", + -1 + ] + }, + "文本颜色": { + "数据类型": "颜色型", + "描述": "", + "属性值": "", + "设定值": "(0, 0, 0, 255)" + }, + "背景颜色": { + "数据类型": "颜色型", + "描述": "", + "属性值": "", + "设定值": "(255, 255, 255, 255)" + } + }, + "公共事件": { + "鼠标左键被按下": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标左键被放开": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "被双击": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标右键被按下": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标右键被放开": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标位置被移动": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "获得焦点": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "失去焦点": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "按下某键": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "放开某键": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "字符输入": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "滚轮被滚动": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + } + }, + "画笔": null, + "方块": null, + "名称": "组合框1", + "组件名称": "组合框", + "组件id": null, + "组件对象": null + }, + "按钮2": { + "自有属性": { + "图片": { + "数据类型": "图片文件型", + "描述": "本属性指定显示在按钮上的图片", + "属性值": "", + "设定值": "" + }, + "类型": { + "数据类型": "选择列表型", + "描述": "当在窗口上按下Enter键时,如果没有将窗口的“回车下移输入点”属性设置为真,则等同于按下了具有“默认”类型的按钮。因此具有“默认”类型的按钮在同一窗口上应当只有一个。“通常”类型的按钮无对应的操作默认键", + "属性值": [ + "通常", + "默认" + ], + "设定值": 0 + }, + "标题": { + "数据类型": "文本型", + "描述": "标题只有在图片为空时才有效,如果希望某一字符成为此按钮的访问键,可以在该字符前面加上一个 & 字符", + "属性值": "", + "设定值": "清空" + }, + "文字对齐方式": { + "数据类型": "选择列表型", + "描述": "", + "设定值": 0, + "属性值": [ + "文字在居中", + "文字在顶部", + "文字在底部", + "文字在左边", + "文字在右边", + "文字在左上角", + "文字在右上角", + "文字在左下角", + "文字在右下角" + ] + } + }, + "自有方法": {}, + "自有事件": { + "被单击": { + "描述": "当单击按钮后即产生此事件", + "事件参数": "0", + "事件返回值": "无", + "设定值": "按钮2_被单击" + } + }, + "公共属性": { + "左边": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 243 + }, + "顶边": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 22 + }, + "宽度": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 97 + }, + "高度": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 30 + }, + "标记": { + "数据类型": "文本型", + "描述": "", + "属性值": "", + "设定值": "" + }, + "可视": { + "数据类型": "逻辑型", + "描述": "", + "属性值": true, + "设定值": true + }, + "禁止": { + "数据类型": "逻辑型", + "描述": "", + "属性值": false, + "设定值": false + }, + "鼠标指针": { + "数据类型": "选择列表型", + "描述": "", + "设定值": 0, + "属性值": [ + "默认型", + "标准箭头型", + "十字型", + "文本编辑型", + "沙漏型", + "箭头及问号型", + "箭头及沙漏型", + "禁止符型", + "四向箭头型", + "北东箭头型", + "北南箭头型", + "北西箭头型", + "西东箭头型", + "向上箭头", + "手型" + ] + }, + "字体": { + "数据类型": "字体", + "描述": "", + "属性值": "", + "设定值": [ + 9, + 74, + 90, + 400, + false, + "Microsoft YaHei UI", + -1 + ] + }, + "文本颜色": { + "数据类型": "颜色型", + "描述": "", + "属性值": "", + "设定值": "(0, 0, 0, 255)" + }, + "背景颜色": { + "数据类型": "颜色型", + "描述": "", + "属性值": "", + "设定值": "(240, 240, 240, 255)" + } + }, + "公共事件": { + "鼠标左键被按下": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标左键被放开": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "被双击": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标右键被按下": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标右键被放开": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标位置被移动": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "获得焦点": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "失去焦点": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "按下某键": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "放开某键": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "字符输入": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "滚轮被滚动": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + } + }, + "画笔": null, + "方块": null, + "名称": "按钮2", + "组件名称": "按钮", + "组件id": null, + "组件对象": null + }, + "按钮3": { + "自有属性": { + "图片": { + "数据类型": "图片文件型", + "描述": "本属性指定显示在按钮上的图片", + "属性值": "", + "设定值": "" + }, + "类型": { + "数据类型": "选择列表型", + "描述": "当在窗口上按下Enter键时,如果没有将窗口的“回车下移输入点”属性设置为真,则等同于按下了具有“默认”类型的按钮。因此具有“默认”类型的按钮在同一窗口上应当只有一个。“通常”类型的按钮无对应的操作默认键", + "属性值": [ + "通常", + "默认" + ], + "设定值": 0 + }, + "标题": { + "数据类型": "文本型", + "描述": "标题只有在图片为空时才有效,如果希望某一字符成为此按钮的访问键,可以在该字符前面加上一个 & 字符", + "属性值": "", + "设定值": "加入项目测试" + }, + "文字对齐方式": { + "数据类型": "选择列表型", + "描述": "", + "设定值": 0, + "属性值": [ + "文字在居中", + "文字在顶部", + "文字在底部", + "文字在左边", + "文字在右边", + "文字在左上角", + "文字在右上角", + "文字在左下角", + "文字在右下角" + ] + } + }, + "自有方法": {}, + "自有事件": { + "被单击": { + "描述": "当单击按钮后即产生此事件", + "事件参数": "0", + "事件返回值": "无", + "设定值": "按钮3_被单击" + } + }, + "公共属性": { + "左边": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 236 + }, + "顶边": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 117 + }, + "宽度": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 97 + }, + "高度": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 30 + }, + "标记": { + "数据类型": "文本型", + "描述": "", + "属性值": "", + "设定值": "" + }, + "可视": { + "数据类型": "逻辑型", + "描述": "", + "属性值": true, + "设定值": true + }, + "禁止": { + "数据类型": "逻辑型", + "描述": "", + "属性值": false, + "设定值": false + }, + "鼠标指针": { + "数据类型": "选择列表型", + "描述": "", + "设定值": 0, + "属性值": [ + "默认型", + "标准箭头型", + "十字型", + "文本编辑型", + "沙漏型", + "箭头及问号型", + "箭头及沙漏型", + "禁止符型", + "四向箭头型", + "北东箭头型", + "北南箭头型", + "北西箭头型", + "西东箭头型", + "向上箭头", + "手型" + ] + }, + "字体": { + "数据类型": "字体", + "描述": "", + "属性值": "", + "设定值": [ + 9, + 74, + 90, + 400, + false, + "Microsoft YaHei UI", + -1 + ] + }, + "文本颜色": { + "数据类型": "颜色型", + "描述": "", + "属性值": "", + "设定值": "(0, 0, 0, 255)" + }, + "背景颜色": { + "数据类型": "颜色型", + "描述": "", + "属性值": "", + "设定值": "(240, 240, 240, 255)" + } + }, + "公共事件": { + "鼠标左键被按下": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标左键被放开": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "被双击": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标右键被按下": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标右键被放开": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标位置被移动": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "获得焦点": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "失去焦点": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "按下某键": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "放开某键": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "字符输入": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "滚轮被滚动": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + } + }, + "画笔": null, + "方块": null, + "名称": "按钮3", + "组件名称": "按钮", + "组件id": null, + "组件对象": null + }, + "按钮4": { + "自有属性": { + "图片": { + "数据类型": "图片文件型", + "描述": "本属性指定显示在按钮上的图片", + "属性值": "", + "设定值": "" + }, + "类型": { + "数据类型": "选择列表型", + "描述": "当在窗口上按下Enter键时,如果没有将窗口的“回车下移输入点”属性设置为真,则等同于按下了具有“默认”类型的按钮。因此具有“默认”类型的按钮在同一窗口上应当只有一个。“通常”类型的按钮无对应的操作默认键", + "属性值": [ + "通常", + "默认" + ], + "设定值": 0 + }, + "标题": { + "数据类型": "文本型", + "描述": "标题只有在图片为空时才有效,如果希望某一字符成为此按钮的访问键,可以在该字符前面加上一个 & 字符", + "属性值": "", + "设定值": "遍历所有项目" + }, + "文字对齐方式": { + "数据类型": "选择列表型", + "描述": "", + "设定值": 0, + "属性值": [ + "文字在居中", + "文字在顶部", + "文字在底部", + "文字在左边", + "文字在右边", + "文字在左上角", + "文字在右上角", + "文字在左下角", + "文字在右下角" + ] + } + }, + "自有方法": {}, + "自有事件": { + "被单击": { + "描述": "当单击按钮后即产生此事件", + "事件参数": "0", + "事件返回值": "无", + "设定值": "按钮4_被单击" + } + }, + "公共属性": { + "左边": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 245 + }, + "顶边": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 169 + }, + "宽度": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 97 + }, + "高度": { + "数据类型": "整数型", + "描述": "", + "属性值": 0, + "设定值": 30 + }, + "标记": { + "数据类型": "文本型", + "描述": "", + "属性值": "", + "设定值": "" + }, + "可视": { + "数据类型": "逻辑型", + "描述": "", + "属性值": true, + "设定值": true + }, + "禁止": { + "数据类型": "逻辑型", + "描述": "", + "属性值": false, + "设定值": false + }, + "鼠标指针": { + "数据类型": "选择列表型", + "描述": "", + "设定值": 0, + "属性值": [ + "默认型", + "标准箭头型", + "十字型", + "文本编辑型", + "沙漏型", + "箭头及问号型", + "箭头及沙漏型", + "禁止符型", + "四向箭头型", + "北东箭头型", + "北南箭头型", + "北西箭头型", + "西东箭头型", + "向上箭头", + "手型" + ] + }, + "字体": { + "数据类型": "字体", + "描述": "", + "属性值": "", + "设定值": [ + 9, + 74, + 90, + 400, + false, + "Microsoft YaHei UI", + -1 + ] + }, + "文本颜色": { + "数据类型": "颜色型", + "描述": "", + "属性值": "", + "设定值": "(0, 0, 0, 255)" + }, + "背景颜色": { + "数据类型": "颜色型", + "描述": "", + "属性值": "", + "设定值": "(240, 240, 240, 255)" + } + }, + "公共事件": { + "鼠标左键被按下": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标左键被放开": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "被双击": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标右键被按下": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标右键被放开": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "鼠标位置被移动": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "获得焦点": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "失去焦点": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "按下某键": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "放开某键": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "字符输入": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + }, + "滚轮被滚动": { + "代码模板": "def {函数名}(self,event):", + "设定值": "" + } + }, + "画笔": null, + "方块": null, + "名称": "按钮4", + "组件名称": "按钮", + "组件id": null, + "组件对象": null + } +} \ No newline at end of file diff --git "a/example/wxpython/\347\273\204\345\220\210\346\241\206\347\273\204\344\273\266\345\260\201\350\243\205\346\265\213\350\257\225.py" "b/example/wxpython/\347\273\204\345\220\210\346\241\206\347\273\204\344\273\266\345\260\201\350\243\205\346\265\213\350\257\225.py" new file mode 100644 index 0000000..6465e7a --- /dev/null +++ "b/example/wxpython/\347\273\204\345\220\210\346\241\206\347\273\204\344\273\266\345\260\201\350\243\205\346\265\213\350\257\225.py" @@ -0,0 +1,94 @@ +import pyefun.wxefun as wx + + +class 窗口1(wx.窗口): + def __init__(self): + self.初始化界面() + + def 初始化界面(self): + #########以下是创建的组件代码######### + wx.窗口.__init__(self, None, title='易函数视窗编程系统', size=(380, 250), name='frame', + style=wx.窗口边框.普通可调边框 & ~(wx.MAXIMIZE_BOX)) + self.容器 = wx.容器(self) + self.Centre() + self.窗口1 = self + + self.窗口1.播放次数 = wx.播放次数.循环播放 + self.窗口1.位置 = wx.窗口位置.通常 + self.按钮1 = wx.按钮(self.容器, size=(97, 30), pos=(241, 63), label='测试') + self.按钮1.绑定事件(wx.事件.被单击, self.按钮1_被单击) + self.组合框1 = wx.组合框(self.容器, value='', pos=(23, 20), choices=[], style=wx.组合框样式.可编辑下拉式 | wx.组合框样式.自动排序) + self.组合框1.SetSize((179, 36)) + self.组合框1.置列表项目([]) + self.组合框1.绑定事件(wx.事件.列表项被选择, self.组合框1_列表项被选择) + self.组合框1.绑定事件(wx.事件.编辑内容被改变, self.组合框1_编辑内容被改变) + self.组合框1.绑定事件(wx.事件.将弹出列表, self.组合框1_将弹出列表) + self.组合框1.绑定事件(wx.事件.列表被关闭, self.组合框1_列表被关闭) + self.按钮2 = wx.按钮(self.容器, size=(97, 30), pos=(243, 22), label='清空') + self.按钮2.绑定事件(wx.事件.被单击, self.按钮2_被单击) + self.按钮3 = wx.按钮(self.容器, size=(97, 30), pos=(236, 117), label='加入项目测试') + self.按钮3.绑定事件(wx.事件.被单击, self.按钮3_被单击) + self.按钮4 = wx.按钮(self.容器, size=(97, 30), pos=(245, 169), label='遍历所有项目') + self.按钮4.绑定事件(wx.事件.被单击, self.按钮4_被单击) + #########以上是创建的组件代码########## + # self.组合框1 = wx.组合框(self.容器, value='', pos=(23, 20), choices=[], style=wx.CB_SIMPLE) + # self.组合框1 = wx.组合框(self.容器, value='', pos=(23, 20), choices=[], style=wx.CB_DROPDOWN) + # self.组合框1 = wx.组合框(self.容器, value='', pos=(23, 20), choices=[], style=wx.CB_READONLY) + # self.组合框1 = wx.组合框(self.容器, value='', pos=(23, 20), choices=[], style=wx.CB_SORT) + # self.组合框1 = wx.组合框(self.容器, value='', pos=(23, 20), choices=[], style=wx.TE_PROCESS_ENTER) + self.组合框1.列表项目 = ["a", "b", "c", "d", "apple", "e"] + self.组合框1.现行选中项 = 0 + self.组合框1.内容 = "aaaaaaaaaaaaaaa" + + # self.组合框1.置列表项目(["a", "b", "c", "d", "e"]) + + #########以下是组件绑定的事件代码######### + + def 按钮1_被单击(self, event): + print("按钮1_被单击") + print(self.组合框1.内容) + self.组合框1.内容 = "aaaaaaaaa" + + def 组合框1_列表项被选择(self, event): + print("组合框1_列表项被选择") + print(self.组合框1.现行选中项) + print(self.组合框1.取项目文本(self.组合框1.现行选中项)) + + def 组合框1_编辑内容被改变(self, event): + print("组合框1_编辑内容被改变") + + def 组合框1_将弹出列表(self, event): + print("组合框1_将弹出列表") + + def 组合框1_列表被关闭(self, event): + print("组合框1_列表被关闭") + print(self.组合框1.现行选中项) + print(self.组合框1.取项目文本(self.组合框1.现行选中项)) + + def 按钮2_被单击(self, event): + print("按钮2_被单击") + self.组合框1.清空() + + def 按钮3_被单击(self, event): + print("按钮3_被单击") + for i in range(100): + self.组合框1.加入项目(str(i)) + + def 按钮4_被单击(self, event): + print("按钮4_被单击") + for i in range(self.组合框1.取项目数()): + print(i, self.组合框1.取项目文本(i)) + + #########以上是组件绑定的事件代码######### + + +class 应用(wx.App): + def OnInit(self): + self.窗口1 = 窗口1() + self.窗口1.Show(True) + return True + + +if __name__ == '__main__': + app = 应用() + app.MainLoop() diff --git a/pyefun/wxefun/component/ComboBox.py b/pyefun/wxefun/component/ComboBox.py index 2cc5ac4..427eb57 100644 --- a/pyefun/wxefun/component/ComboBox.py +++ b/pyefun/wxefun/component/ComboBox.py @@ -3,7 +3,6 @@ class 组合框(wx.ComboBox, 公用方法): - pass @property def 宽度(self): @@ -27,6 +26,31 @@ def 高度(self, value): size[1] = value self.SetSize(-1, -1, size[0], value) + @property + def 现行选中项(self): + return self.GetSelection() + + @现行选中项.setter + def 现行选中项(self, value): + self.SetSelection(value) + + @property + def 列表项目(self): + return [] + + @列表项目.setter + def 列表项目(self, value): + print(value) + self.Set(value) + + @property + def 内容(self): + return self.GetValue() + + @内容.setter + def 内容(self, value): + self.SetValue(value) + @组件_异常检测 def 取指定项目索引(self, 项目文本, 是否区分大小写=False): return self.FindString(项目文本, 是否区分大小写) @@ -44,7 +68,7 @@ def 取选中范围(self): return self.GetTextSelection() @组件_异常检测 - def 取指定项目文本(self, 索引): + def 取项目文本(self, 索引): return self.GetString(索引) def 取选中项文本(self): @@ -53,11 +77,14 @@ def 取选中项文本(self): def 列表项是否为空(self): return self.IsListEmpty() + def 文本是否为空(self): + return self.IsTextEmpty() + def 弹出列表(self): self.Popup() @组件_异常检测 - def 置指定项目文本(self, 索引, 文本): + def 置项目文本(self, 索引, 文本): self.SetString(索引, 文本) @组件_异常检测 @@ -77,7 +104,11 @@ def 选中范围文本(self, 开始位置, 结束位置): '如果两个参数都等于-1,则选择控件中的所有文本' self.SetTextSelection(开始位置, 结束位置) - def 清空表项(self): + @组件_异常检测 + def 清空(self): + """ + 删除组合框列表部分中的所有项目。 + """ self.Clear() @组件_异常检测 @@ -86,24 +117,23 @@ def 置项目列表(self, 项目列表): self.SetItems(项目列表) @组件_异常检测 - def 加入项目(self, 项目): + def 加入项目(self, 项目文本: str): '支持单个或多个项目,多个项目使用列表传入,加入后会返回最后一个项目索引' - return self.Append(项目) + return self.Append(项目文本) @组件_异常检测 - def 加入项目2(self, 项目): - '支持单个或多个项目,多个项目使用列表传入' - self.AppendItems(项目) + def 删除项目(self, 项目索引): + self.Delete(项目索引) @组件_异常检测 - def 删除指定项目(self, 索引): - self.Delete(索引) + def 插入项目(self, 欲插入的位置, 欲插入项目的文本): + return self.Insert(欲插入项目的文本, 欲插入的位置) @组件_异常检测 - def 插入项目(self, 插入位置, 项目列表): - return self.Insert(项目列表, 插入位置) - def 置列表项目(self, 列表项目列表): + """ + 用给定的项目替换当前控件内容。 + 请注意,如果您需要添加大量项目,调用此方法通常比将它们一个一个地附加起来要快得多。 + """ self.Clear() - for v in 列表项目列表: - self.Append(v) + self.Set(列表项目列表) diff --git a/pyefun/wxefun/evt.py b/pyefun/wxefun/evt.py index 17ba51f..69d71ec 100644 --- a/pyefun/wxefun/evt.py +++ b/pyefun/wxefun/evt.py @@ -164,6 +164,11 @@ class 事件: 狀态被改变 = wx.EVT_CHECKBOX 选中列表项 = wx.EVT_COMBOBOX 列表项被选择 = wx.EVT_COMBOBOX + 编辑内容被改变 = wx.EVT_TEXT + 编辑框按下回车 = wx.EVT_TEXT_ENTER + 将弹出列表 = wx.EVT_COMBOBOX_DROPDOWN + 列表被关闭 = wx.EVT_COMBOBOX_CLOSEUP + 双击选择 = wx.EVT_RIGHT_DCLICK 文本发生变化 = wx.EVT_TEXT 弹出列表项 = wx.EVT_COMBOBOX_DROPDOWN 收起列表项 = wx.EVT_COMBOBOX_CLOSEUP @@ -377,3 +382,11 @@ class 标签样式: 省略号在开头 = wx.ST_ELLIPSIZE_START # :如果labeltext宽度超过控件宽度,则用省略号替换标签的开头;用途wx.Control.Ellipsize。 省略号在中间 = wx.ST_ELLIPSIZE_MIDDLE # :如果标签文本的宽度超过控件的宽度,则用省略号替换标签的中间;用途wx.Control.Ellipsize。 省略号在末尾 = wx.ST_ELLIPSIZE_END # :如果标签文本的宽度超过控件的宽度,请用省略号替换标签的末尾;用途wx.Control.Ellipsize。 + +class 组合框样式: + 可编辑列表式 = wx.CB_SIMPLE #:创建一个带有永久显示列表的组合框。仅限 Windows。 + 可编辑下拉式 = wx.CB_DROPDOWN #:创建一个带有下拉列表的组合框。仅 MSW 和 Motif。 + 不可编辑下拉式 = wx.CB_READONLY #:具有这种样式的组合框的行为类似于wx .Choice (并且可能看起来也相同,尽管这取决于平台),即它允许用户从选项列表中进行选择但不允许输入列表中不存在的值。 + 自动排序 = wx.CB_SORT #:按字母顺序对列表中的条目进行排序。 + 接收按下回车事件 = wx.TE_PROCESS_ENTER#: 控件会产生 程序可以处理的事件 。否则,即如果根本没有指定此样式,或者使用它,但没有此事件的事件处理程序或调用的事件处理程序 以避免覆盖默认处理,则按 Enter 键要么由控件内部处理,要么使用激活对话框的默认按钮(如果有)。wxEVT_TEXT_ENTERwx.Event.Skip +