⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 movegui.c

📁 精通Matlab与C_C++混合程序设计.rar 是精通Matlab与C_C++混合程序设计 这本书的配套源码
💻 C
📖 第 1 页 / 共 5 页
字号:
     */
    #line 152 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mclMline(152);
    #line 152 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mclAssignAns(&ans, mlfNSet(0, mlfScalar(0), mxCreateString("units"), mxCreateString("pixels"), NULL));
    /*
     * screensize = get(0, 'screensize');
     */
    #line 153 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mclMline(153);
    #line 153 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mlfAssign(&screensize, mlfNGet(1, mlfScalar(0), mxCreateString("screensize"), NULL));
    /*
     * set(0, 'units', old0units);
     */
    #line 154 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mclMline(154);
    #line 154 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mclAssignAns(&ans, mlfNSet(0, mlfScalar(0), mxCreateString("units"), mclVv(old0units, "old0units"), NULL));
    /*
     * swidth = screensize(3);       sheight = screensize(4);
     */
    #line 155 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mclMline(155);
    #line 155 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mlfAssign(&swidth, mlfIndexRef(mclVv(screensize, "screensize"), "(?)", mlfScalar(3)));
    #line 155 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mlfAssign(&sheight, mlfIndexRef(mclVv(screensize, "screensize"), "(?)", mlfScalar(4)));
    /*
     * % make sure the figure is not bigger than the screen size
     * fwidth = min(fwidth, swidth); fheight = min(fheight, sheight);
     */
    #line 157 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mclMline(157);
    #line 157 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mlfAssign(&fwidth, mlfMin(NULL, mclVv(fwidth, "fwidth"), mclVv(swidth, "swidth"), NULL));
    #line 157 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mlfAssign(&fheight, mlfMin(NULL, mclVv(fheight, "fheight"), mclVv(sheight, "sheight"), NULL));
    /*
     * 
     * % swidth - fwidth == remaining width
     * rwidth  = swidth-fwidth;
     */
    #line 160 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mclMline(160);
    #line 160 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mlfAssign(&rwidth, mclMinus(mclVv(swidth, "swidth"), mclVv(fwidth, "fwidth")));
    /*
     * 
     * % sheight - fheight == remaining height
     * rheight = sheight-fheight;
     */
    #line 163 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mclMline(163);
    #line 163 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mlfAssign(&rheight, mclMinus(mclVv(sheight, "sheight"), mclVv(fheight, "fheight")));
    /*
     * 
     * 
     * if isnumeric(position)
     */
    #line 166 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mclMline(166);
    #line 166 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    if (mlfTobool(mlfIsnumeric(mclVv(position, "position")))) {
        /*
         * newpos = position;
         */
        #line 167 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        mclMline(167);
        #line 167 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        mlfAssign(&newpos, mclVv(position, "position"));
        /*
         * if(newpos(1) < 0)	newpos(1) = rwidth + newpos(1); end
         */
        #line 168 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        mclMline(168);
        #line 168 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        if (mlfTobool(mclLt(mlfIndexRef(mclVv(newpos, "newpos"), "(?)", mlfScalar(1)), mlfScalar(0)))) {
            #line 168 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            mlfIndexAssign(&newpos, "(?)", mlfScalar(1), mclPlus(mclVv(rwidth, "rwidth"), mlfIndexRef(mclVv(newpos, "newpos"), "(?)", mlfScalar(1))));
        #line 168 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        }
        /*
         * if(newpos(2) < 0)	newpos(2) = rheight + newpos(2); end
         */
        #line 169 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        mclMline(169);
        #line 169 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        if (mlfTobool(mclLt(mlfIndexRef(mclVv(newpos, "newpos"), "(?)", mlfScalar(2)), mlfScalar(0)))) {
            #line 169 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            mlfIndexAssign(&newpos, "(?)", mlfScalar(2), mclPlus(mclVv(rheight, "rheight"), mlfIndexRef(mclVv(newpos, "newpos"), "(?)", mlfScalar(2))));
        #line 169 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        }
    /*
     * else
     */
    #line 170 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    mclMline(170);
    #line 170 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
    } else {
        /*
         * switch position
         */
        #line 171 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        mxArray * v_ = mclInitialize(mclVv(position, "position"));
        #line 171 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        mclMline(171);
        #line 171 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        if (mclSwitchCompare(v_, mxCreateString("north"))) {
            /*
             * case 'north',	newpos = [rwidth/2,   rheight];
             */
            #line 172 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            mclMline(172);
            #line 172 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            mlfAssign(&newpos, mlfHorzcat(mclMrdivide(mclVv(rwidth, "rwidth"), mlfScalar(2)), mclVv(rheight, "rheight"), NULL));
        /*
         * case 'south',	newpos = [rwidth/2,         0];
         */
        #line 173 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        mclMline(173);
        #line 173 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        } else if (mclSwitchCompare(v_, mxCreateString("south"))) {
            #line 173 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            mlfAssign(&newpos, mlfHorzcat(mclMrdivide(mclVv(rwidth, "rwidth"), mlfScalar(2)), mlfScalar(0), NULL));
        /*
         * case 'east',	newpos = [  rwidth, rheight/2];
         */
        #line 174 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        mclMline(174);
        #line 174 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        } else if (mclSwitchCompare(v_, mxCreateString("east"))) {
            #line 174 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            mlfAssign(&newpos, mlfHorzcat(mclVv(rwidth, "rwidth"), mclMrdivide(mclVv(rheight, "rheight"), mlfScalar(2)), NULL));
        /*
         * case 'west',	newpos = [       0, rheight/2];
         */
        #line 175 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        mclMline(175);
        #line 175 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        } else if (mclSwitchCompare(v_, mxCreateString("west"))) {
            #line 175 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            mlfAssign(&newpos, mlfHorzcat(mlfScalar(0), mclMrdivide(mclVv(rheight, "rheight"), mlfScalar(2)), NULL));
        /*
         * case 'northeast',  newpos = [  rwidth,   rheight];
         */
        #line 176 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        mclMline(176);
        #line 176 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        } else if (mclSwitchCompare(v_, mxCreateString("northeast"))) {
            #line 176 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            mlfAssign(&newpos, mlfHorzcat(mclVv(rwidth, "rwidth"), mclVv(rheight, "rheight"), NULL));
        /*
         * case 'southeast',  newpos = [  rwidth,         0];
         */
        #line 177 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        mclMline(177);
        #line 177 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        } else if (mclSwitchCompare(v_, mxCreateString("southeast"))) {
            #line 177 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            mlfAssign(&newpos, mlfHorzcat(mclVv(rwidth, "rwidth"), mlfScalar(0), NULL));
        /*
         * case 'northwest',  newpos = [       0,   rheight];
         */
        #line 178 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        mclMline(178);
        #line 178 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        } else if (mclSwitchCompare(v_, mxCreateString("northwest"))) {
            #line 178 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            mlfAssign(&newpos, mlfHorzcat(mlfScalar(0), mclVv(rheight, "rheight"), NULL));
        /*
         * case 'southwest',  newpos = [       0,         0];
         */
        #line 179 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        mclMline(179);
        #line 179 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        } else if (mclSwitchCompare(v_, mxCreateString("southwest"))) {
            #line 179 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            mlfAssign(&newpos, mlfDoubleMatrix(1, 2, _array0_, (double *)NULL));
        /*
         * case 'center',	newpos = [rwidth/2, rheight/2];
         */
        #line 180 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        mclMline(180);
        #line 180 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        } else if (mclSwitchCompare(v_, mxCreateString("center"))) {
            #line 180 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            mlfAssign(&newpos, mlfHorzcat(mclMrdivide(mclVv(rwidth, "rwidth"), mlfScalar(2)), mclMrdivide(mclVv(rheight, "rheight"), mlfScalar(2)), NULL));
        /*
         * case 'onscreen'
         */
        #line 181 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        mclMline(181);
        #line 181 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
        } else if (mclSwitchCompare(v_, mxCreateString("onscreen"))) {
            /*
             * if fleft < 0
             */
            #line 182 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            mclMline(182);
            #line 182 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            if (mlfTobool(mclLt(mclVv(fleft, "fleft"), mlfScalar(0)))) {
                /*
                 * fleft = 0;
                 */
                #line 183 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
                mclMline(183);
                #line 183 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
                mlfAssign(&fleft, mlfScalar(0));
            /*
             * end
             */
            #line 184 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            mclMline(184);
            #line 184 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            }
            /*
             * if fbottom < 0
             */
            #line 185 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            mclMline(185);
            #line 185 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
            if (mlfTobool(mclLt(mclVv(fbottom, "fbottom"), mlfScalar(0)))) {
                /*
                 * fbottom = 0;
                 */
                #line 186 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
                mclMline(186);
                #line 186 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\movegui.m"
                mlfAssign(&fbottom, mlfScalar(0));
            /*
             * end
             */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -