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

📄 guihandles.c

📁 精通Matlab与C_C++混合程序设计.rar 是精通Matlab与C_C++混合程序设计 这本书的配套源码
💻 C
📖 第 1 页 / 共 3 页
字号:
         */
        #line 82 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
        mclMline(82);
        #line 82 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
        mlfAssign(&fig, mlfNGet(1, mclVa(fig, "fig"), mxCreateString("parent"), NULL));
    /*
     * end
     */
    #line 83 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mclMline(83);
    #line 83 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    }
    #line 83 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mclValidateOutput(fig, 1, nargout_, "fig", "guihandles/getParentFigure");
    #line 83 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mclSetCurrentLocalFunctionTable(save_local_function_table_);
    #line 83 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mclMlineFunctionReturn()
    #line 83 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    return fig;
    /*
     * 
     * 
     */
    #line 85 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mclMlineExitFunctionReturn();
    #line 85 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
}

/*
 * The function "Mguihandles_createHandles" is the implementation version of the "guihandles/createHandles" M-function from file "d:\matlab6p5\toolbox\matlab\uitools\guihandles.m" (lines 86-111). It contains the actual compiled code for that M-function. It is a static function and must only be called from one of the interface functions, appearing below.
 */
/*
 * function handles = createHandles(fig)
 */
#line 86 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
static mxArray * Mguihandles_createHandles(int nargout_, mxArray * fig) {
    #line 86 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mclMlineEnterFunction("d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m", "guihandles/createHandles")
    #line 86 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mexLocalFunctionTable save_local_function_table_ = mclSetCurrentLocalFunctionTable(&_local_function_table_guihandles);
    #line 86 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mxArray * handles = NULL;
    #line 86 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mxArray * prev_h = NULL;
    #line 86 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mxArray * tag = NULL;
    #line 86 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mxArray * this_h = NULL;
    #line 86 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mxArray * all_h = NULL;
    #line 86 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mclCopyArray(&fig);
    /*
     * % Assemble a struct using all the legal tag names in the figure as
     * % fieldnames.  Each field contains the handles of the objects using
     * % that tag.
     * all_h = findall(fig);
     */
    #line 90 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mclMline(90);
    #line 90 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mlfAssign(&all_h, mlfFindall(mclVa(fig, "fig"), NULL));
    /*
     * handles = [];
     */
    #line 91 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mclMline(91);
    #line 91 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mlfAssign(&handles, mclCreateEmptyArray());
    /*
     * 
     * % loop across all objects in figure, looking for legal tags:
     * for this_h = all_h'
     */
    #line 94 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mclMline(94);
    #line 94 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    {
        #line 94 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
        mclForLoopIterator viter__;
        #line 94 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
        for (mclForStart(&viter__, mlfCtranspose(mclVv(all_h, "all_h")), NULL, NULL); mclForNext(&viter__, &this_h); ) {
            /*
             * tag = get(this_h,'tag');
             */
            #line 95 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
            mclMline(95);
            #line 95 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
            mlfAssign(&tag, mlfNGet(1, mclVv(this_h, "this_h"), mxCreateString("tag"), NULL));
            /*
             * if ~isempty(tag) & isvarname(tag) % can it be used as a fieldname?
             */
            #line 96 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
            mclMline(96);
            #line 96 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
            {
                #line 96 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                mxArray * a_ = mclInitialize(mclNot(mlfIsempty(mclVv(tag, "tag"))));
                #line 96 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                if (mlfTobool(a_) && mlfTobool(mclAnd(a_, mlfIsvarname(mclVv(tag, "tag"))))) {
                    #line 96 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                    mxDestroyArray(a_);
                    /*
                     * 
                     * % if a field of this name already exists, get its contents
                     * if isfield(handles, tag)
                     */
                    #line 99 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                    mclMline(99);
                    #line 99 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                    if (mlfTobool(mlfIsfield(mclVv(handles, "handles"), mclVv(tag, "tag")))) {
                        /*
                         * prev_h = handles.(tag);
                         */
                        #line 100 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                        mclMline(100);
                        #line 100 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                        mlfAssign(&prev_h, mlfIndexRef(mclVv(handles, "handles"), ".(?)", mclVv(tag, "tag")));
                    /*
                     * else
                     */
                    #line 101 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                    mclMline(101);
                    #line 101 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                    } else {
                        /*
                         * prev_h = [];
                         */
                        #line 102 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                        mclMline(102);
                        #line 102 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                        mlfAssign(&prev_h, mclCreateEmptyArray());
                    /*
                     * end
                     */
                    #line 103 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                    mclMline(103);
                    #line 103 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                    }
                    /*
                     * 
                     * % append our handle to whatever was there before. If nothing
                     * % was there before, SETFIELD will create the field.
                     * handles.(tag) = [prev_h this_h];
                     */
                    #line 107 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                    mclMline(107);
                    #line 107 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                    mlfIndexAssign(&handles, ".(?)", mclVv(tag, "tag"), mlfHorzcat(mclVv(prev_h, "prev_h"), mclVv(this_h, "this_h"), NULL));
                #line 107 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                } else {
                    #line 107 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                    mxDestroyArray(a_);
                #line 107 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
                }
            /*
             * 
             * end % if legal tag
             */
            #line 109 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
            mclMline(109);
            #line 109 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
            }
        /*
         * end % loop
         */
        #line 110 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
        mclMline(110);
        #line 110 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
        }
        #line 110 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
        mclDestroyForLoopIterator(viter__);
    #line 110 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    }
    #line 110 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mclValidateOutput(handles, 1, nargout_, "handles", "guihandles/createHandles");
    #line 110 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mxDestroyArray(all_h);
    #line 110 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mxDestroyArray(this_h);
    #line 110 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mxDestroyArray(tag);
    #line 110 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mxDestroyArray(prev_h);
    #line 110 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mxDestroyArray(fig);
    #line 110 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mclSetCurrentLocalFunctionTable(save_local_function_table_);
    #line 110 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mclMlineFunctionReturn()
    #line 110 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    return handles;
    #line 110 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
    mclMlineExitFunctionReturn();
    #line 110 "d:\\matlab6p5\\toolbox\\matlab\\uitools\\guihandles.m"
}

⌨️ 快捷键说明

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