增加首选项界面,设置等文本

This commit is contained in:
JackLee 2026-03-24 18:34:01 +08:00
parent 818662eb96
commit 578c486238
25 changed files with 466 additions and 136 deletions

View File

@ -5,87 +5,91 @@
// please include "napi/native_api.h". // please include "napi/native_api.h".
#include "Axis.h" #include "Axis.h"
#include "Quantity_NameOfColor.hxx"
#ifndef NATIVE_TAG #ifndef NATIVE_TAG
#define NATIVE_TAG "AXIS" #define NATIVE_TAG "AXIS"
#endif #endif
namespace NativeOpenCAX { namespace NativeOpenCAX {
Axis::Axis() : axisPlacement(nullptr), axisTrihedron(nullptr) { } Axis::Axis() : axiPlacement(nullptr), axiTrihedron(nullptr), axiViewCube(nullptr) {}
Axis::~Axis() { Axis::~Axis() {}
}
bool Axis::InitAxis(Handle(AIS_InteractiveContext)& context,AXIS_TYPE _axisType) { bool Axis::InitAxis(Handle(AIS_InteractiveContext) & context) {
axisType = _axisType;
switch (axisType) {
case WORLD_AXIS:
return InitWorldAxis(context);
break;
case LOCAL_AXIS:
return InitLocalAxis(context);
break;
}
}
bool Axis::InitWorldAxis(Handle(AIS_InteractiveContext)& context) {
try { try {
// 添加世界坐标系(左下角) // 创建场景中心参考坐标系
axisPlacement = new Geom_Axis2Placement(gp::XOY()); gp_Ax2 theAxis;
axisTrihedron = new AIS_Trihedron(axisPlacement); double theSize = 60; // 大小
axisTrihedron->SetSize(100.0); // 小一点,作为指示器 // 设置原点
axisTrihedron->SetZLayer(Graphic3d_ZLayerId_TopOSD); theAxis.SetLocation(gp_Pnt(10, 10, 10));
axisTrihedron->SetTransformPersistence(new Graphic3d_TransformPers(Graphic3d_TMF_2d, // 2D 模式 // 以世界坐标轴为准,设置Z,X轴方向
Aspect_TOTP_LEFT_LOWER, // 左下角对齐 theAxis.SetDirection(gp_Dir(0, 0, 1));
Graphic3d_Vec2i(100, 100) // 偏移量(像素) theAxis.SetXDirection(gp_Dir(1, 0, 0));
)); gp_Pnt anOrg = theAxis.Location();
axisTrihedron->SetDatumPartColor(Prs3d_DP_XAxis, Quantity_NOC_RED); axiPlacement = new Geom_Axis2Placement(theAxis);
axisTrihedron->SetDatumPartColor(Prs3d_DP_YAxis, Quantity_NOC_GREEN); axiPlacement->SetLocation(gp::Origin());
axisTrihedron->SetDatumPartColor(Prs3d_DP_ZAxis, Quantity_NOC_BLUE); axiTrihedron = new AIS_Trihedron(axiPlacement);
context->Display(axisTrihedron, 0, 0, false); axiTrihedron->SetDatumDisplayMode(Prs3d_DM_Shaded);
HILOG_INFO(NATIVE_TAG, "InitWorldAxis Done"); axiTrihedron->SetDrawArrows(true);
return true; axiTrihedron->Attributes()->DatumAspect()->LineAspect(Prs3d_DP_XArrow)->SetWidth(2);
} catch (std::exception &e) { axiTrihedron->Attributes()->DatumAspect()->LineAspect(Prs3d_DP_YArrow)->SetWidth(2);
HILOG_INFO(NATIVE_TAG, "InitWorldAxis Fail:%{public}d",e.what()); axiTrihedron->Attributes()->DatumAspect()->LineAspect(Prs3d_DP_ZArrow)->SetWidth(2);
return false; axiTrihedron->Attributes()->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetWidth(1.5);
} axiTrihedron->Attributes()->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetWidth(1.5);
axiTrihedron->Attributes()->DatumAspect()->LineAspect(Prs3d_DP_ZAxis)->SetWidth(1.5);
} axiTrihedron->SetDatumPartColor(Prs3d_DP_XArrow, Quantity_NOC_RED2);
bool Axis::InitLocalAxis(Handle(AIS_InteractiveContext)& context) { axiTrihedron->SetDatumPartColor(Prs3d_DP_YArrow, Quantity_NOC_GREEN2);
try { axiTrihedron->SetDatumPartColor(Prs3d_DP_ZArrow, Quantity_NOC_BLUE2);
// 创建场景中心参考坐标系 axiTrihedron->SetDatumPartColor(Prs3d_DP_XAxis, Quantity_NOC_RED2);
axisPlacement = new Geom_Axis2Placement(gp::XOY()); axiTrihedron->SetDatumPartColor(Prs3d_DP_YAxis, Quantity_NOC_GREEN2);
axisTrihedron = new AIS_Trihedron(axisPlacement); axiTrihedron->SetDatumPartColor(Prs3d_DP_ZAxis, Quantity_NOC_BLUE2);
axisTrihedron->SetSize(50.0); axiTrihedron->SetLabel(Prs3d_DP_XAxis, "X");
axisTrihedron->SetDatumPartColor(Prs3d_DP_XAxis, Quantity_NOC_RED); axiTrihedron->SetLabel(Prs3d_DP_YAxis, "Y");
axisTrihedron->SetDatumPartColor(Prs3d_DP_YAxis, Quantity_NOC_GREEN); axiTrihedron->SetLabel(Prs3d_DP_ZAxis, "Z");
axisTrihedron->SetDatumPartColor(Prs3d_DP_ZAxis, Quantity_NOC_BLUE); axiTrihedron->SetSize(theSize);
context->Display(axisTrihedron, 0, 0, true); axiTrihedron->SetTransformPersistence(new Graphic3d_TransformPers(Graphic3d_TMF_ZoomPers, anOrg));
axiTrihedron->Attributes()->SetZLayer(Graphic3d_ZLayerId_Topmost);
axiTrihedron->SetInfiniteState(true);
context->Display(axiTrihedron, true);
HILOG_INFO(NATIVE_TAG, "InitLocalAxis Done"); HILOG_INFO(NATIVE_TAG, "InitLocalAxis Done");
return true; return true;
} catch (std::exception &e) { } catch (std::exception &e) {
HILOG_INFO(NATIVE_TAG, "InitLocalAxis Fail:%{public}d",e.what()); HILOG_INFO(NATIVE_TAG, "InitLocalAxis Fail:%{public}d", e.what());
return false; return false;
} }
} }
void Axis::SetRotationX(float rx){ bool Axis::InitAxisCube(Handle(AIS_InteractiveContext) & context) {
rotationX=rx; try {
} // 视图立方体
void Axis::SetRotationY(float ry){ axiViewCube = new AIS_ViewCube();
rotationX=ry; axiViewCube->SetBoxSideLabel(V3d_Xpos, "Right");
} axiViewCube->SetBoxSideLabel(V3d_Ypos, "Back");
void Axis::SetRotationZ(float rz){ axiViewCube->SetBoxSideLabel(V3d_Zpos, "Top");
rotationX=rz; axiViewCube->SetBoxSideLabel(V3d_Xneg, "Left");
} axiViewCube->SetBoxSideLabel(V3d_Yneg, "Front");
void Axis::SetTranslationX(float tx){ axiViewCube->SetBoxSideLabel(V3d_Zneg, "Bottom");
translationX=tx; axiViewCube->SetDrawAxes(false);
} axiViewCube->SetSize(60, true);
void Axis::SetTranslationY(float ty){ axiViewCube->SetTransparency(0.5);
translationX=ty; axiViewCube->SetTextColor(Quantity_Color(Quantity_NOC_BLUE1));
} axiViewCube->SetFontHeight(30);
void Axis::SetTranslationZ(float tz){ axiViewCube->SetMaterial(Graphic3d_MaterialAspect(Graphic3d_NOM_ALUMINIUM));
translationX=tz; axiViewCube->SetTransformPersistence(
} new Graphic3d_TransformPers(Graphic3d_TMF_TriedronPers, Aspect_TOTP_RIGHT_UPPER, Graphic3d_Vec2i(100, 100)));
void Axis::SetZoomLevel(float level){ context->Display(axiViewCube, Standard_True);
zoomLevel=level; HILOG_INFO(NATIVE_TAG, "Init Axi View Cube Done");
return true;
} catch (std::exception &e) {
HILOG_INFO(NATIVE_TAG, "Init Axi View Cube Fail:%{public}d", e.what());
return false;
}
} }
void Axis::SetRotationX(float rx) { rotationX = rx; }
void Axis::SetRotationY(float ry) { rotationX = ry; }
void Axis::SetRotationZ(float rz) { rotationX = rz; }
void Axis::SetTranslationX(float tx) { translationX = tx; }
void Axis::SetTranslationY(float ty) { translationX = ty; }
void Axis::SetTranslationZ(float tz) { translationX = tz; }
void Axis::SetZoomLevel(float level) { zoomLevel = level; }
} }

View File

@ -7,21 +7,19 @@
#ifndef OPENCAX_AXIS_H #ifndef OPENCAX_AXIS_H
#define OPENCAX_AXIS_H #define OPENCAX_AXIS_H
#include "AIS_ViewCube.hxx"
#include "NativeEGLOCCT/common.h" #include "NativeEGLOCCT/common.h"
#include <AIS_Trihedron.hxx> #include <AIS_Trihedron.hxx>
#include <AIS_InteractiveContext.hxx> #include <AIS_InteractiveContext.hxx>
#include <Geom_Axis2Placement.hxx> #include <Geom_Axis2Placement.hxx>
namespace NativeOpenCAX { namespace NativeOpenCAX {
enum AXIS_TYPE{
WORLD_AXIS,
LOCAL_AXIS
};
class Axis { class Axis {
public: public:
Axis(); Axis();
~Axis(); ~Axis();
bool InitAxis(Handle(AIS_InteractiveContext)& context,AXIS_TYPE _axisType); bool InitAxis(Handle(AIS_InteractiveContext)& context);
bool InitAxisCube(Handle(AIS_InteractiveContext) & context);
void SetRotationX(float x); void SetRotationX(float x);
void SetRotationY(float y); void SetRotationY(float y);
void SetRotationZ(float z); void SetRotationZ(float z);
@ -30,12 +28,10 @@ public:
void SetTranslationZ(float z); void SetTranslationZ(float z);
void SetZoomLevel(float level); void SetZoomLevel(float level);
private: private:
bool InitWorldAxis(Handle(AIS_InteractiveContext)& context); Handle(Geom_Axis2Placement) axiPlacement;
bool InitLocalAxis(Handle(AIS_InteractiveContext)& context); Handle(AIS_Trihedron) axiTrihedron;
private: //定义三面体
AXIS_TYPE axisType; Handle(AIS_ViewCube) axiViewCube;
Handle(Geom_Axis2Placement) axisPlacement;
Handle(AIS_Trihedron) axisTrihedron;
private: private:
//旋转X轴 //旋转X轴
float rotationX=0.0f; float rotationX=0.0f;

View File

@ -17,7 +17,7 @@ Camera::~Camera() {}
bool Camera::InitCamera(Handle(V3d_View)& view) { bool Camera::InitCamera(Handle(V3d_View)& view) {
try { try {
camera = new Graphic3d_Camera; camera = new Graphic3d_Camera;
camera->SetFOVy(30.0); camera->SetFOVy(45.0);
camera->SetZRange(1.0, 1000.0); camera->SetZRange(1.0, 1000.0);
view->SetCamera(camera); view->SetCamera(camera);
HILOG_INFO(NATIVE_TAG, "InitCamera Done"); HILOG_INFO(NATIVE_TAG, "InitCamera Done");

View File

@ -1,4 +1,5 @@
#include "NativeRender.h" #include "NativeRender.h"
#include "Aspect_TypeOfLine.hxx"
#include "STEPControl_Reader.hxx" #include "STEPControl_Reader.hxx"
#ifndef NATIVE_TAG #ifndef NATIVE_TAG
@ -47,14 +48,16 @@ bool NativeRender::init(EGLCore& _eglCore) {
HILOG_ERROR(NATIVE_TAG,"Init Ctx Fail!"); HILOG_ERROR(NATIVE_TAG,"Init Ctx Fail!");
return false; return false;
} }
if(!mAxis->InitAxis(ctx->context, AXIS_TYPE::WORLD_AXIS)){ if(!mAxis->InitAxis(ctx->context)){
HILOG_ERROR(NATIVE_TAG,"Init WORLD_AXIS Fail!"); HILOG_ERROR(NATIVE_TAG,"Init AXIS Fail!");
return false; return false;
} }
if(!nAxis->InitAxis(ctx->context, AXIS_TYPE::LOCAL_AXIS)){
HILOG_ERROR(NATIVE_TAG,"Init LOCAL_AXIS Fail!"); if(!mAxis->InitAxisCube(ctx->context)){
HILOG_ERROR(NATIVE_TAG,"Init AXIS Cuba Fail!");
return false; return false;
} }
if(!win->InitWindow(width,height)){ if(!win->InitWindow(width,height)){
HILOG_ERROR(NATIVE_TAG,"Init Window Fail!"); HILOG_ERROR(NATIVE_TAG,"Init Window Fail!");
return false; return false;
@ -71,6 +74,7 @@ bool NativeRender::init(EGLCore& _eglCore) {
HILOG_ERROR(NATIVE_TAG,"Init Camera Fail!"); HILOG_ERROR(NATIVE_TAG,"Init Camera Fail!");
return false; return false;
} }
vw->ResetView();
return true; return true;
} }
@ -116,11 +120,11 @@ bool NativeRender::loadModel(const std::string& filePath) {
// 设置材质 // 设置材质
Handle(Prs3d_Drawer) drawer = aisShape->Attributes(); Handle(Prs3d_Drawer) drawer = aisShape->Attributes();
Handle(Prs3d_ShadingAspect) shadingAspect = new Prs3d_ShadingAspect(); Handle(Prs3d_ShadingAspect) shadingAspect = new Prs3d_ShadingAspect();
aisShape->SetDisplayMode(1); //aisShape->SetDisplayMode(1);
Handle(Prs3d_LineAspect) aLineAspect = new Prs3d_LineAspect( Handle(Prs3d_LineAspect) aLineAspect = new Prs3d_LineAspect(
Quantity_NOC_BLACK, // 颜色,例如黑色 Quantity_NOC_BLACK, // 颜色,例如黑色
Aspect_TOL_SOLID, // 线型 Aspect_TOL_DASH, // 线型
2.0 // 线宽 3.0 // 线宽
); );
// 随机颜色 // 随机颜色
@ -142,6 +146,7 @@ bool NativeRender::loadModel(const std::string& filePath) {
drawer->SetWireAspect(aLineAspect); drawer->SetWireAspect(aLineAspect);
drawer->SetShadingAspect(shadingAspect); drawer->SetShadingAspect(shadingAspect);
ctx->context->Display(aisShape, Standard_True); ctx->context->Display(aisShape, Standard_True);
//ctx->context->SetDisplayMode(AIS_WireFrame, Standard_False);
shapes_.push_back(aisShape); shapes_.push_back(aisShape);
} }
} }

View File

@ -32,19 +32,21 @@ void View::SetViewOption() {
view->ChangeRenderingParams().IsShadowEnabled = Standard_False; view->ChangeRenderingParams().IsShadowEnabled = Standard_False;
view->ChangeRenderingParams().IsReflectionEnabled = Standard_False; view->ChangeRenderingParams().IsReflectionEnabled = Standard_False;
view->ChangeRenderingParams().IsAntialiasingEnabled = Standard_True; view->ChangeRenderingParams().IsAntialiasingEnabled = Standard_True;
view->ChangeRenderingParams().Resolution = 2; view->ChangeRenderingParams().Resolution = 1;
// 设置背景渐变 // 设置背景渐变
view->SetBgGradientColors(Quantity_Color(Quantity_NOC_GRAY), Quantity_Color(Quantity_NOC_BLACK), view->SetBgGradientColors(Quantity_Color(Quantity_NOC_GRAY), Quantity_Color(Quantity_NOC_BLACK),
Aspect_GFM_VER, // 垂直渐变 Aspect_GFM_VER, // 垂直渐变
Standard_False); Standard_False);
// 设置默认相机位置 // 设置默认相机位置
view->SetProj(V3d_XposYnegZpos); view->SetProj(V3d_XposYnegZpos);
view->FitAll(0.05, Standard_False);
// 可选:显示坐标轴 // 可选:显示坐标轴
view->ZBufferTriedronSetup(); view->ZBufferTriedronSetup();
// 调整相机视角 // 调整相机视角
view->Camera()->SetProjectionType(Graphic3d_Camera::Projection_Perspective); view->Camera()->SetProjectionType(Graphic3d_Camera::Projection_Perspective);
view->SetBackgroundColor(Quantity_NOC_GRAY90); view->SetBackgroundColor(Quantity_NOC_GRAY90);
//左下角默认坐标系
view->TriedronDisplay(Aspect_TOTP_LEFT_LOWER, Quantity_NOC_ALICEBLUE, 0.3, V3d_ZBUFFER);
} }
void View::SetText(Handle(Prs3d_TextAspect) & text) { void View::SetText(Handle(Prs3d_TextAspect) & text) {

View File

@ -7,9 +7,13 @@
#ifndef OPENCAX_VIEW_H #ifndef OPENCAX_VIEW_H
#define OPENCAX_VIEW_H #define OPENCAX_VIEW_H
#include "NativeEGLOCCT/Context/Context.h"
#include "NativeEGLOCCT/common.h" #include "NativeEGLOCCT/common.h"
#include <V3d_View.hxx> #include <V3d_View.hxx>
#include <Aspect_NeutralWindow.hxx> #include <Aspect_NeutralWindow.hxx>
#include <AIS_AnimationCamera.hxx>
#include <V3d.hxx>
namespace NativeOpenCAX{ namespace NativeOpenCAX{
class View{ class View{
@ -25,14 +29,6 @@ public:
void Redraw(); void Redraw();
void ResetView(); void ResetView();
void SwitchView(std::string view); void SwitchView(std::string view);
// void FrontView();
// void TopView();
// void LeftSideView();
// void RightSideView();
// void BottomView();
// void RearView();
// void ISOView();
// void DIMView();
public: public:
Handle(V3d_View) view; Handle(V3d_View) view;
Quantity_Color clearColor; Quantity_Color clearColor;

View File

@ -9,11 +9,13 @@
#ifndef NATIVE_TAG #ifndef NATIVE_TAG
#define NATIVE_TAG "VIEWER" #define NATIVE_TAG "VIEWER"
#endif #endif
#include <V3d_DirectionalLight.hxx>
#include <V3d_AmbientLight.hxx>
namespace NativeOpenCAX { namespace NativeOpenCAX {
Viewer::Viewer() : viewer(nullptr) {} Viewer::Viewer() : viewer(nullptr) {}
Viewer::~Viewer() {} Viewer::~Viewer() {}
bool Viewer::InitViewer(Handle(OpenGl_GraphicDriver)& graphicDriver) { bool Viewer::InitViewer(Handle(OpenGl_GraphicDriver)& graphicDriver) {
try { try {
viewer = new V3d_Viewer(graphicDriver); viewer = new V3d_Viewer(graphicDriver);

View File

@ -33,15 +33,15 @@ export default class EntryAbility extends UIAbility {
const mainWindowHeight: number = screenHeight-200; const mainWindowHeight: number = screenHeight-200;
console.error(`main window Width: mainWindowWidth, Height: mainWindowHeight`); console.error(`main window Width: mainWindowWidth, Height: mainWindowHeight`);
//Init&&Save AppStorageV2 //Init&&Save AppStorageV2
const mainDisplayInfo = AppStorageV2.connect<MainScreenDisplayInfo>(MainScreenDisplayInfo, () => new MainScreenDisplayInfo( const mainDisplayInfo = AppStorageV2.connect<MainScreenDisplayInfo>(MainScreenDisplayInfo, () => new MainScreenDisplayInfo())!;
screenDisplayId,screenWidth,screenHeight const mainWinInfo=AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo())!;
))!; const mainWinStage=AppStorageV2.connect<MainWindowStageInfo>(MainWindowStageInfo, () => new MainWindowStageInfo())!;
const mainWinInfo=AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo( mainDisplayInfo.mainScreenDisplayId=screenDisplayId;
mainWindowWidth,mainWindowHeight mainDisplayInfo.mainScreenWidth=screenWidth;
))!; mainDisplayInfo.mainScreenHeight=screenHeight;
const mainWinStage=AppStorageV2.connect<MainWindowStageInfo>(MainWindowStageInfo, () => new MainWindowStageInfo( mainWinInfo.mainWindowWidth=mainWindowWidth;
windowStage mainWinInfo.mainWindowHeight=mainWindowHeight;
))!; mainWinStage.ws=windowStage;
//Get Main Window //Get Main Window
windowStage.getMainWindow((err, data) => { windowStage.getMainWindow((err, data) => {

View File

@ -180,15 +180,15 @@ export struct SubColumnMenu {
Button(){ Button(){
Row(){ Row(){
Image($r('app.media.'+(this.icon!=undefined ? this.icon:(this.menus[this.curtIndex]as TitleButton).eIcon))) Image($r('app.media.'+(this.icon!=undefined ? this.icon:(this.menus[this.curtIndex]as TitleButton).eIcon)))
.height(mwInfo.mainWindowWidth*0.01)
if(this.name!=undefined){ if(this.name!=undefined){
Text(this.name).fontSize(20) Text(this.name).fontSize(16)
} }
} }
}.width(ebWidth) }.height(mwInfo.mainWindowWidth*0.01)
.height(ebWidth)
.backgroundColor(Color.Transparent) .backgroundColor(Color.Transparent)
.bindMenu(this.BaseMenu) .bindMenu(this.BaseMenu)
.type(ButtonType.Normal) .type(ButtonType.Normal)
}.width(this.name!=undefined ?mwInfo.mainWindowWidth*0.03:ebWidth) }.width(this.name!=undefined ?mwInfo.mainWindowWidth*0.02:mwInfo.mainWindowWidth*0.01)
} }
} }

View File

@ -27,17 +27,17 @@ export struct TextComboBox {
build() { build() {
Row() { Row() {
Text(this.name!=undefined?this.name:'') Text(this.name!=undefined?this.name:'')
.fontSize(18) .fontSize(16)
.width('auto') .width('auto')
Text(this.menu[this.selectIndex].eName) Text(this.menu[this.selectIndex].eName)
.bindMenu(this.EventMenu) .bindMenu(this.EventMenu)
.width('50%') .width('50%')
.fontSize(18) .fontSize(16)
.backgroundColor('#ffe6e6e3') .backgroundColor('#ffe6e6e3')
.height(mwInfo.mainWindowHeight*0.022) .height(mwInfo.mainWindowHeight*0.02)
.margin({ top:0, left: 5, bottom: 0, right: 0 }) .margin({ top:0, left: 5, bottom: 0, right: 0 })
}.width(ebWidth) }.width(ebWidth)
.height(ebHeigth) .height(mwInfo.mainWindowWidth*0.01)
} }
} }
@ComponentV2 @ComponentV2
@ -61,6 +61,6 @@ export struct TextInputComboBox {
TextInput({placeholder:this.selectIndex.toString()}) TextInput({placeholder:this.selectIndex.toString()})
.bindMenu(this.EventMenu) .bindMenu(this.EventMenu)
.type(InputType.Number) .type(InputType.Number)
} }.height(mwInfo.mainWindowWidth*0.01)
} }
} }

View File

@ -1,17 +1,27 @@
import { TitleButton } from '../LayoutInterface/Interface/ButtonInterface'; import { TitleButton } from '../LayoutInterface/Interface/ButtonInterface';
import { OCCTLoadModel } from '../modelView'; import { OCCTLoadModel } from '../modelView';
import { CloseSubWindow, CreateAndShowSubWindow} from './SWBase'; import { CloseSubWindow, CreateAndShowSubWindow, WinInfo} from './SWBase';
import NativeOpenCAX from 'libopencax.so'; import NativeOpenCAX from 'libopencax.so';
import { mwInfo } from '../AppStorageV2Class';
export function ExecuteCommand(event:TitleButton){ export function ExecuteCommand(event:TitleButton){
//事件处理
if(event?.eEvent=='Execute_LoadModel'){ if(event?.eEvent=='Execute_LoadModel'){
OCCTLoadModel(undefined,undefined) OCCTLoadModel(undefined,undefined)
}else if(event?.eEvent=='Execute_CreateSubWindow'){ }
CreateAndShowSubWindow(event.eName,event.ePage); //窗体打开
if(event?.eEvent=='Execute_CreateSubWindow'){
const winInfo:WinInfo=new WinInfo(event.eName,event.ePage,mwInfo.mainWindowWidth*0.3,mwInfo.mainWindowHeight*0.9);
CreateAndShowSubWindow(winInfo);
}else if(event?.eEvent=='Execute_ExitSubWindow'){ }else if(event?.eEvent=='Execute_ExitSubWindow'){
CloseSubWindow(); CloseSubWindow();
} else if(event?.eEvent=='Execute_CreateSubWindow_Options'){
const winInfo:WinInfo=new WinInfo(event.eName,event.ePage,mwInfo.mainWindowWidth*0.6,mwInfo.mainWindowHeight*0.9);
CreateAndShowSubWindow(winInfo);
}else if(event?.eEvent=='Execute_ExitSubWindow_Options'){
CloseSubWindow();
} }
//视图切换
if(event?.eEvent=='CMD_VIEW_FRONT'){ if(event?.eEvent=='CMD_VIEW_FRONT'){
NativeOpenCAX.switchView("CMD_VIEW_FRONT"); NativeOpenCAX.switchView("CMD_VIEW_FRONT");
}else if(event?.eEvent=='CMD_VIEW_TOP'){ }else if(event?.eEvent=='CMD_VIEW_TOP'){

View File

@ -0,0 +1,77 @@
import { OptsBase, OptsInter } from './Opts/OptsInter';
import { OptionsStrData } from './Opts/OptsStr';
import { OptsSub } from './Opts/OptsSub';
//选项设置页面
@Entry
@ComponentV2
export struct Options {
private mainBarTabs: TabsController = new TabsController();
@Local mainBarFocusIndex: number = 0;
build() {
Row({ space: 5 }) {
Column({ space: 0 }) {
Scroll() {
Flex({ direction: FlexDirection.Column }) {
Column({ space: 5 }) {
ForEach(OptionsStrData, (item: OptsInter, index: number) => {
Button(item.sName)
.backgroundImagePosition({ x: '5%', y: '5%' })
.backgroundImageSize({
width: '90%', // 图片宽度占满按钮
height: '90%' // 图片高度占满按钮
})
.width('100%')
.backgroundImage($r('app.media.' + item.sIcon))
.fontWeight(index === this.mainBarFocusIndex ? FontWeight.Bold : FontWeight.Normal)
.type(ButtonType.Normal)
.onClick(() => {
this.mainBarTabs.changeIndex(index);
this.mainBarFocusIndex = index;
})
})
}
Blank().height('95%')
}
}
.align(Alignment.Start)
.scrollable(ScrollDirection.Vertical)
.scrollBar(BarState.Off)
.height('100%')
}.width('10%')
.margin({
top: '0.5%',
left: 0,
bottom: '0.5%',
right: 0
})
Divider()
.vertical(true)
.strokeWidth(1)
.lineCap(LineCapStyle.Round)
.height('99%')
.backgroundColor(Color.Gray)
Column({ space: 1 }) {
Tabs({ barPosition: BarPosition.Start,index: this.mainBarFocusIndex, controller: this.mainBarTabs }) {
ForEach(OptionsStrData, (item: OptsInter, index: number) => {
OptsSub({ subOptions: item.sOptions })
})
}
}.width('90%')
.margin({
top: '0.5%',
left: 0,
bottom: '0.5%',
right: 0
})
}
.margin({
top: 5,
left: 5,
bottom: 5,
right: 5
})
}
}

View File

@ -0,0 +1,18 @@
import { TitleButton } from "../../LayoutInterface/Interface/ButtonInterface";
export interface OptsBase{
//子模块TabBar头
exName:string;
exIcon:string;
exOtions:Array<Array<string>|string|number|TitleButton>
}
export interface OptsInter {
//设置左侧边名字
sName:string
//设置左侧边加载布局页面
sPage:string
//设置Icon图标
sIcon:string
//设置子栏
sOptions:Array<OptsBase>
}

View File

@ -0,0 +1,153 @@
import { OptsInter } from "./OptsInter";
import { ModelType } from "../../LayoutInterface/Layout/ModelType";
export let OptionsStrData:Array<OptsInter>=[
{
sName:'用户设置',
sPage:'',
sIcon:'string',
sOptions:[
{exName:'用户基础设置',exIcon:'',exOtions:
[
{eModel:[ModelType.BASE],eName:"导入用户设置",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"导出用户设置",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"恢复默认用户设置",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]
},
{exName:'用户界面布局',exIcon:'',exOtions:
[
{eModel:[ModelType.BASE],eName:"导入用户界面布局",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"导出用户界面布局",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"恢复默认用户布局",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]
}
]
},
{
sName:'基本环境',
sPage:'',
sIcon:'string',
sOptions:[
{exName:'默认单位',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"英寸",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"毫米",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"自动保存间隔",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'目录',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"默认其实目录",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"默认文档名",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'表达式',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"表达式前缀",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"表达式后缀",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'大模型接口',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"大模型地址",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"Key",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"模型选择",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"知识库设定",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"MCP设定",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"Skills",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
]
},
{
sName:'对象',
sPage:'',
sIcon:'string',
sOptions:[
{exName:'默认',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'直线',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'圆弧',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'二次曲线',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'样条',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'实体',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'片体',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'基准平面',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'点',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'无限长直线',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'坐标系',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'实体和片体',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'基准坐标系',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
]
},
{
sName:'可视化',
sPage:'',
sIcon:'string',
sOptions:[
{exName:'显示',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'图形',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'光顺边',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
{exName:'收敛体',exIcon:'',exOtions:[
{eModel:[ModelType.BASE],eName:"颜色",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线型",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"线宽",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""},
]},
]
}
]

View File

@ -0,0 +1,42 @@
import { OptsBase } from './OptsInter';
//选项设置页面
@Entry
@ComponentV2
export struct OptsSub {
private subBarTabs: TabsController = new TabsController();
@Local subBarFocusIndex: number = 0;
@Param subOptions: Array<OptsBase> = [];
build() {
Column() {
Scroll() {
Flex({ direction: FlexDirection.Row }) {
if (this.subOptions.length > 0) {
Row({ space: 5 }) {
ForEach(this.subOptions, (item: OptsBase, index: number) => {
Button(item.exName)
.backgroundImagePosition({ x: '5%', y: '5%' })
.backgroundImageSize({
width: '90%', // 图片宽度占满按钮
height: '90%' // 图片高度占满按钮
})
.backgroundImage($r('app.media.' + item.exIcon))
.fontWeight(index === this.subBarFocusIndex ? FontWeight.Bold : FontWeight.Normal)
.type(ButtonType.Normal)
})
}
}
}
}.scrollable(ScrollDirection.Vertical)
.scrollBar(BarState.Off)
Column({ space: 1 }) {
Tabs({ barPosition: BarPosition.Start, index:this.subBarFocusIndex,controller: this.subBarTabs }) {
}
}
}.width('100%')
.height('100%')
}
}

View File

@ -4,14 +4,27 @@ import { mwInfo, mwsInfo } from '../AppStorageV2Class';
let subWindow: window.Window | undefined = undefined; let subWindow: window.Window | undefined = undefined;
export async function CreateAndShowSubWindow(name:string,pages:string) { export class WinInfo{
name:string|undefined=undefined;
page:string|undefined=undefined;
width:number=0;
height:number=0;
constructor(name?: string, page?: string,width?: number,height?: number) {
this.name = name??undefined;
this.page = page ?? undefined;
this.width = width ?? 0;
this.height = height ?? 0;
}
}
export async function CreateAndShowSubWindow(winInfo:WinInfo) {
try { try {
if(mwsInfo.ws==null){ if(mwsInfo.ws==null){
console.error('Failed to create the subwindow. Cause: windowStage is null'); console.error('Failed to create the subwindow. Cause: windowStage is null');
return; return;
} }
let options: window.SubWindowOptions = { let options: window.SubWindowOptions = {
title: name, title: winInfo.name as string,
decorEnabled: true, decorEnabled: true,
isModal: false, isModal: false,
maximizeSupported: false, maximizeSupported: false,
@ -27,8 +40,9 @@ export async function CreateAndShowSubWindow(name:string,pages:string) {
//子窗口创建成功后,设置子窗口的位置、大小及相关属性等。 //子窗口创建成功后,设置子窗口的位置、大小及相关属性等。
subWindow.moveWindowTo(25, 25) subWindow.moveWindowTo(25, 25)
//子窗口重置大小 //子窗口重置大小
subWindow.resize(mwInfo.mainWindowWidth*0.3, mwInfo.mainWindowHeight*0.9); console.info("页面路径:", winInfo.page);
subWindow.setUIContent(pages, (err: BusinessError) => { subWindow.resize(winInfo.width,winInfo.height);
subWindow.setUIContent(winInfo.page, (err: BusinessError) => {
if (err.code) { if (err.code) {
console.error("加载页面失败:", err); console.error("加载页面失败:", err);
return; return;
@ -40,6 +54,13 @@ export async function CreateAndShowSubWindow(name:string,pages:string) {
console.error("显示窗口失败:", err); console.error("显示窗口失败:", err);
} }
}); });
//不允许窗口小于默认尺寸
subWindow.on('windowSizeChange', (subWinData) => {
// if Size Change save to AppStorage
if(subWinData.width<winInfo.width||subWinData.height<winInfo.height){
subWindow?.resize(winInfo.width,winInfo.height);
}
});
}) })
} catch (error) { } catch (error) {
console.error('Failed to create or show sub window:', (error as BusinessError).message); console.error('Failed to create or show sub window:', (error as BusinessError).message);

View File

@ -27,7 +27,7 @@ struct Index {
TitleColumnSub(); TitleColumnSub();
} }
.width('100%') .width('100%')
.height(mwInfo.mainWindowHeight * 0.03) .height(mwInfo.mainWindowHeight * 0.02)
.align(Alignment.Start) .align(Alignment.Start)
//分割线 //分割线
Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey) Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey)
@ -58,7 +58,7 @@ struct Index {
}.layoutWeight(1) }.layoutWeight(1)
.align(Alignment.Center) .align(Alignment.Center)
}.width('100%') }.width('100%')
.height(mwInfo.mainWindowHeight * 0.36) .height(mwInfo.mainWindowHeight * 0.39)
//分割线 //分割线
Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey) Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey)
///状态栏 ///状态栏
@ -67,7 +67,7 @@ struct Index {
}.width('100%') }.width('100%')
.align(Alignment.End) .align(Alignment.End)
.alignItems(HorizontalAlign.Start) .alignItems(HorizontalAlign.Start)
.height(mwInfo.mainWindowHeight * 0.05) .height(mwInfo.mainWindowHeight * 0.01)
}.backgroundColor('#f3f3f0') }.backgroundColor('#f3f3f0')
.width('100%') .width('100%')
.height('100%') .height('100%')

View File

@ -29,6 +29,10 @@ export let DevModel:TitleModel= {
[ [
{eModel:[ModelType.BASE],eName:"创建子窗体",eNamed:"",ePage:'pages/EventSubWindow/SWExtrude',eIcon:"base_new_file",eTips:"",eEvent:"Execute_CreateSubWindow"}, {eModel:[ModelType.BASE],eName:"创建子窗体",eNamed:"",ePage:'pages/EventSubWindow/SWExtrude',eIcon:"base_new_file",eTips:"",eEvent:"Execute_CreateSubWindow"},
{eModel:[ModelType.BASE],eName:"关闭子窗体",eNamed:"",ePage:'pages/EventSubWindow/SWExtrude',eIcon:"base_new_file",eTips:"",eEvent:"Execute_ExitSubWindow"}, {eModel:[ModelType.BASE],eName:"关闭子窗体",eNamed:"",ePage:'pages/EventSubWindow/SWExtrude',eIcon:"base_new_file",eTips:"",eEvent:"Execute_ExitSubWindow"},
],
[
{eModel:[ModelType.BASE],eName:"首选项",eNamed:"",ePage:'pages/EventSubWindow/Options',eIcon:"base_new_file",eTips:"",eEvent:"Execute_CreateSubWindow_Options"},
{eModel:[ModelType.BASE],eName:"关闭",eNamed:"",ePage:'pages/EventSubWindow/Options',eIcon:"base_new_file",eTips:"",eEvent:"Execute_ExitSubWindow_Options"},
] ]
],grpMenu:GroupActionMenu}] as Array<TitleGroup> ],grpMenu:GroupActionMenu}] as Array<TitleGroup>
]] ]]

View File

@ -36,8 +36,8 @@ export struct LeftSideTab {
}).margin({ top: 2,left:1,bottom:0,right:2}) }).margin({ top: 2,left:1,bottom:0,right:2})
Scroll() { Scroll() {
Flex({ direction: FlexDirection.Column}) { Flex({ direction: FlexDirection.Column}) {
Column({ space: 5 }) {
ForEach(LeftSideBars, (item: TitleButton, index: number) => { ForEach(LeftSideBars, (item: TitleButton, index: number) => {
Column({ space: 0 }) {
Button() Button()
.borderWidth(1) .borderWidth(1)
.borderColor(Color.Grey) .borderColor(Color.Grey)
@ -57,8 +57,7 @@ export struct LeftSideTab {
this.leftSideBarTabs.changeIndex(index); this.leftSideBarTabs.changeIndex(index);
this.leftSideBarFocusIndex = index; this.leftSideBarFocusIndex = index;
}) })
}.margin({ top: 2,left:0,bottom:0,right:0}) })}
})
Blank().height('95%') Blank().height('95%')
} }
} }

View File

@ -37,10 +37,10 @@ export struct TitleColumnSub {
menus:FileMenuData.aMenus as Array<TitleButton>, icon:'base_shortcut_menu',name:'菜单'}) menus:FileMenuData.aMenus as Array<TitleButton>, icon:'base_shortcut_menu',name:'菜单'})
.margin({ top:0, left: 5, bottom: 0, right: 0 }) .margin({ top:0, left: 5, bottom: 0, right: 0 })
Text('|') Text('|')
.fontSize(20) .fontSize(16)
TextComboBox({name:'拾取类型:',menu:SelectionFilter}) TextComboBox({name:'拾取类型:',menu:SelectionFilter})
Text('图层:') Text('图层:')
.fontSize(20) .fontSize(16)
TextInputComboBox({menu:this.layerArray}).width('10%') TextInputComboBox({menu:this.layerArray}).width('10%')
SubColumnMenu({menus:LayoutSwitch}) SubColumnMenu({menus:LayoutSwitch})
//视角弹窗 //视角弹窗
@ -51,8 +51,8 @@ export struct TitleColumnSub {
this.viewDialog=this.ViewDialog(); this.viewDialog=this.ViewDialog();
} }
this.viewDialog.open(); this.viewDialog.open();
}).width(mwInfo.mainWindowWidth*0.014) }).width(mwInfo.mainWindowWidth*0.01)
.height(mwInfo.mainWindowWidth*0.014) .height(mwInfo.mainWindowWidth*0.01)
.backgroundColor(Color.Transparent) .backgroundColor(Color.Transparent)
.backgroundImage($r('app.media.' + SwitchView[0].eIcon)) .backgroundImage($r('app.media.' + SwitchView[0].eIcon))
.backgroundImageSize({ .backgroundImageSize({

View File

@ -2,6 +2,7 @@
"src": [ "src": [
"pages/Index", "pages/Index",
"pages/EventSubWindow/SWLine", "pages/EventSubWindow/SWLine",
"pages/EventSubWindow/SWExtrude" "pages/EventSubWindow/SWExtrude",
"pages/EventSubWindow/Options"
] ]
} }