|
@@ -269,6 +269,9 @@ export class SBaseIconTextEdit extends SGraphEdit {
|
|
|
|
|
|
textItemList: SBaseTextEdit[] = [];
|
|
|
|
|
|
+
|
|
|
+ curTextItem: SBaseTextEdit | null = null;
|
|
|
+
|
|
|
|
|
|
* 构造体
|
|
|
*
|
|
@@ -326,6 +329,7 @@ export class SBaseIconTextEdit extends SGraphEdit {
|
|
|
obj.isTransform = false;
|
|
|
obj.showSelect = false;
|
|
|
obj.color = new SColor(item.color);
|
|
|
+ obj.connect('textSelect', this, this.textSelectChange)
|
|
|
textItemList.push(obj)
|
|
|
})
|
|
|
this.textItemList = textItemList;
|
|
@@ -380,19 +384,26 @@ export class SBaseIconTextEdit extends SGraphEdit {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ * 选中的文本item变化
|
|
|
+ */
|
|
|
+ textSelectChange(item: SBaseTextEdit): void {
|
|
|
+ this.curTextItem = item;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
* 鼠标按下事件
|
|
|
*
|
|
|
* @param event 事件对象
|
|
|
* @return 是否处理事件
|
|
|
*/
|
|
|
onMouseDown(event: SMouseEvent): boolean {
|
|
|
+ this.curTextItem = null;
|
|
|
if (this.status == SItemStatus.Normal) {
|
|
|
super.onMouseDown(event)
|
|
|
return true;
|
|
|
} else if (this.status == SItemStatus.Edit) {
|
|
|
return super.onMouseDown(event);
|
|
|
}
|
|
|
-
|
|
|
return true;
|
|
|
}
|
|
|
|