86 lines
3.1 KiB
Plaintext
86 lines
3.1 KiB
Plaintext
import { TextComboBox,TextInputComboBox } from "../customcontroller/ComboBox";
|
|
import { TitleButton } from "../interface/Interface";
|
|
import { ViewDialog } from "../customcontroller/Dialog"
|
|
import { SwitchView } from "../layout/SwitchView";
|
|
import {SelectionFilter} from "../layout/SelectionFilter"
|
|
import {DisplayMode} from "../layout/DisplayMode"
|
|
import { LayoutSwitch } from "../layout/LayoutSwitch";
|
|
import { FileMenuData } from "../layout/FileMenuData";
|
|
import { mwInfo } from '../displaywindowinfo/DispWinInfo'
|
|
import { SubColumnMenu} from "../customcontroller/Button";
|
|
import { fileIo } from "@kit.CoreFileKit";
|
|
import { common,Want } from "@kit.AbilityKit";
|
|
|
|
@ComponentV2
|
|
export struct TitleColumnSub {
|
|
@Local layerArray: Array<TitleButton> = [];
|
|
@Local dX:number=0;
|
|
@Local dY:number=0;
|
|
@Local viewDialog:CustomDialogController|undefined=undefined;
|
|
@Param subOverlayState: boolean = true;
|
|
@Event $subOverlayState: (val: boolean) => void = (val: boolean) => {};
|
|
//文件操作目录数据初始化
|
|
|
|
private ViewDialog(): CustomDialogController {
|
|
return new CustomDialogController({
|
|
builder: ViewDialog(), // 确保 ViewDialog 组件已正确定义
|
|
width: mwInfo.width*0.06,
|
|
height: mwInfo.width*0.052,
|
|
borderWidth: 1,
|
|
cornerRadius: 5,
|
|
isModal: true,
|
|
alignment: DialogAlignment.TopStart,
|
|
offset: { dx: this.dX, dy: this.dY },
|
|
});
|
|
}
|
|
|
|
build(){
|
|
Row({space:5}){
|
|
SubColumnMenu({
|
|
menus:FileMenuData.aMenus as Array<TitleButton>, icon:'base_shortcut_menu',name:'菜单'})
|
|
.margin({ top:0, left: 5, bottom: 0, right: 0 })
|
|
Text('|')
|
|
.fontSize(16)
|
|
TextComboBox({name:'拾取类型:',menu:SelectionFilter})
|
|
Text('图层:')
|
|
.fontSize(16)
|
|
TextInputComboBox({menu:this.layerArray}).width('10%')
|
|
SubColumnMenu({menus:LayoutSwitch})
|
|
//视角弹窗
|
|
Button().onClick((event) => {
|
|
this.dX=event.windowX
|
|
this.dY=event.windowY
|
|
if(this.viewDialog==undefined){
|
|
this.viewDialog=this.ViewDialog();
|
|
}
|
|
this.viewDialog.open();
|
|
}).width(mwInfo.width*0.012)
|
|
.height(mwInfo.width*0.012)
|
|
.backgroundColor(Color.Transparent)
|
|
.backgroundImage($r('app.media.' + SwitchView[0].btnIcon))
|
|
.backgroundImagePosition({ x: '10%', y: '10%' })
|
|
.backgroundImageSize({
|
|
width: '80%', // 图片宽度占满按钮
|
|
height: '80%' // 图片高度占满按钮
|
|
})
|
|
SubColumnMenu({menus:DisplayMode})
|
|
Blank().layoutWeight(1)
|
|
Button('TabsBar显示/隐藏').onClick(()=>{
|
|
//this.$subOverlayState(!this.subOverlayState);
|
|
let want: Want = {
|
|
deviceId: '',
|
|
bundleName: 'com.example.opencax',
|
|
abilityName: 'SubWinAbility'
|
|
};
|
|
// 调用 context 启动
|
|
let context =getContext(this) as common.UIAbilityContext;
|
|
context.startAbility(want).then(() => {
|
|
console.info('yes');
|
|
})
|
|
})
|
|
}.width('100%')
|
|
.height('100%')
|
|
.backgroundBlurStyle(BlurStyle.Thin,
|
|
{ colorMode: ThemeColorMode.LIGHT, adaptiveColor: AdaptiveColor.DEFAULT, scale: 1.0 })
|
|
}
|
|
} |