Skip to main content

Command Palette

Search for a command to run...

[js宏]wps演示中多顶点矩形

Published
1 min readView as Markdown
 function CreateDialog_CommandButton1_Click()

{

    let nodesAdd=CreateDialog.SpinButton1.Value-4;

    let linesAdd=nodesAdd==0?0:nodesAdd/2;

    let myDocument = Application.ActivePresentation.Slides.Item(1)

    let theShape=myDocument.Shapes.AddShape(msoShapeRectangle, 50, 50, 200, 20)

    theShape.TextFrame.TextRange.Text="New Shape"

    var subShapes=new Array();

    subShapes.push(theShape.Name);

    var subL=theShape.Left;

    var subT=theShape.Top;

    var subH=theShape.Height

    let subGap=theShape.Width/(linesAdd+1);

    for(i=1;i<linesAdd+1;i++){

        subL+=subGap;

        var shape1=myDocument.Shapes.AddShape(msoShapeRectangle,subL,subT,1,subH);

        shape1.Fill.Transparency=1.0;

        shape1.Line.Transparency=1.0;

        subShapes.push(shape1.Name);

    }

    if(linesAdd>0){

        myDocument.Shapes.Range(subShapes).Group();

    }

   CreateDialog.Close();

}

More from this blog

解决QWidget用winId获取HWND而导致Qt程序无事件消息的问题

问题原因: 当对一个QWidget调用winId时,默认情况下,Qt会对该窗口进行Native化,从而导致如鼠标等事件被其它原生窗口接管,表现出来的现像就是窗口不响应任何事件 解决思路: 防止Qt窗口Native化 解决办法: 第一步,在创建QApplication对象之前设置: QApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); //注意:Qt::AA_NativeWindows受环境变量 QT_USE_NATI...

Jul 7, 20251 min read

雷的部落格威力缩小版

30 posts

雷的部落格威力缩小版