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

📄 dialog.cxx

📁 eCos1.31版
💻 CXX
📖 第 1 页 / 共 2 页
字号:
                    CdlParse::report_error(interp, "A dialog should have only one `update_proc' property.");                }                if (new_dialog->count_properties(CdlPropertyId_DisplayProc) != 1) {                    CdlParse::report_error(interp, "A dialog should have one `display_proc' property.");                }                if (new_dialog->count_properties(CdlPropertyId_ConfirmProc) != 1) {                    CdlParse::report_error(interp, "A dialog should have one `confirm_proc' property.");                }                if (new_dialog->count_properties(CdlPropertyId_CancelProc) != 1) {                    CdlParse::report_error(interp, "A dialog should have one `cancel_proc' property.");                }            }                    } catch(...) {            if (0 != new_dialog) {                delete new_dialog;            }            if (0 != old_node) {                interp->pop_node(old_node);            }            if (0 != old_commands) {                interp->pop_commands(old_commands);            }            throw;        }    }        CYG_REPORT_RETVAL(result);    return result;}// ----------------------------------------------------------------------------// Syntax: display_proc <tclcode>intCdlDialogBody::parse_display_proc(CdlInterpreter interp, int argc, char** argv){    CYG_REPORT_FUNCNAMETYPE("parse_display_proc", "result %d");    int result = CdlParse::parse_tclcode_property(interp, argc, argv, CdlPropertyId_DisplayProc, 0, 0);        CYG_REPORT_RETVAL(result);    return result;}// ----------------------------------------------------------------------------// Syntax: update_proc <tclcode>intCdlDialogBody::parse_update_proc(CdlInterpreter interp, int argc, char** argv){    CYG_REPORT_FUNCNAMETYPE("parse_update_proc", "result %d");    int result = CdlParse::parse_tclcode_property(interp, argc, argv, CdlPropertyId_UpdateProc, 0, 0);        CYG_REPORT_RETVAL(result);    return result;}//}}}//{{{  Persistence                      // ----------------------------------------------------------------------------// For now there is no information in a custom dialog that should end// up in a save file, but it is still desirable to override the base// class member function.voidCdlDialogBody::save(CdlInterpreter interp, Tcl_Channel chan, int indentation, bool minimal)    throw(CdlInputOutputException, std::bad_alloc){    CYG_REPORT_FUNCNAME("CdlDialog::save");    CYG_REPORT_FUNCARG5XV(this, interp, chan, indentation, minimal);    CYG_PRECONDITION_THISC();    CYG_UNUSED_PARAM(CdlInterpreter, interp);    CYG_UNUSED_PARAM(Tcl_Channel, chan);    CYG_UNUSED_PARAM(int, indentation);    CYG_UNUSED_PARAM(bool, minimal);        CYG_REPORT_RETURN();}//}}}//{{{  Data access                      // ----------------------------------------------------------------------------boolCdlDialogBody::has_init_proc() const{    CYG_REPORT_FUNCNAMETYPE("CdlDialog::has_init_proc", "result %d");    CYG_REPORT_FUNCARG1XV(this);    CYG_PRECONDITION_THISC();    bool result = has_property(CdlPropertyId_InitProc);    CYG_REPORT_RETVAL(result);    return result;}boolCdlDialogBody::has_update_proc() const{    CYG_REPORT_FUNCNAMETYPE("CdlDialog::has_update_proc", "result %d");    CYG_REPORT_FUNCARG1XV(this);    CYG_PRECONDITION_THISC();    bool result = has_property(CdlPropertyId_UpdateProc);    CYG_REPORT_RETVAL(result);    return result;}const cdl_tcl_code&CdlDialogBody::get_init_proc() const{    CYG_REPORT_FUNCNAME("CdlDialog::get_init_proc");    CYG_REPORT_FUNCARG1XV(this);    CYG_PRECONDITION_THISC();    static cdl_tcl_code null_result = "";    cdl_tcl_code& result = null_result;    CdlProperty prop = get_property(CdlPropertyId_InitProc);    if (0 != prop) {        CdlProperty_TclCode tclprop = dynamic_cast<CdlProperty_TclCode>(prop);        CYG_ASSERT_CLASSC(tclprop);        result = tclprop->get_code();    }    CYG_REPORT_RETURN();    return result;}const cdl_tcl_code&CdlDialogBody::get_update_proc() const{    CYG_REPORT_FUNCNAME("CdlDialog::get_update_proc");    CYG_REPORT_FUNCARG1XV(this);    CYG_PRECONDITION_THISC();    static cdl_tcl_code null_result = "";    cdl_tcl_code& result = null_result;    CdlProperty prop = get_property(CdlPropertyId_UpdateProc);    if (0 != prop) {        CdlProperty_TclCode tclprop = dynamic_cast<CdlProperty_TclCode>(prop);        CYG_ASSERT_CLASSC(tclprop);        result = tclprop->get_code();    }    CYG_REPORT_RETURN();    return result;}const cdl_tcl_code&CdlDialogBody::get_display_proc() const{    CYG_REPORT_FUNCNAME("CdlDialog::get_display_proc");    CYG_REPORT_FUNCARG1XV(this);    CYG_PRECONDITION_THISC();    CdlProperty prop = get_property(CdlPropertyId_DisplayProc);    CYG_ASSERT_CLASSC(prop);    CdlProperty_TclCode tclprop = dynamic_cast<CdlProperty_TclCode>(prop);    CYG_ASSERT_CLASSC(tclprop);    const cdl_tcl_code& result = tclprop->get_code();    CYG_REPORT_RETURN();    return result;}const cdl_tcl_code&CdlDialogBody::get_confirm_proc() const{    CYG_REPORT_FUNCNAME("CdlDialog::get_display_proc");    CYG_REPORT_FUNCARG1XV(this);    CYG_PRECONDITION_THISC();    CdlProperty prop = get_property(CdlPropertyId_ConfirmProc);    CYG_ASSERT_CLASSC(prop);    CdlProperty_TclCode tclprop = dynamic_cast<CdlProperty_TclCode>(prop);    CYG_ASSERT_CLASSC(tclprop);    const cdl_tcl_code& result = tclprop->get_code();    CYG_REPORT_RETURN();    return result;}const cdl_tcl_code&CdlDialogBody::get_cancel_proc() const{    CYG_REPORT_FUNCNAME("CdlDialog::get_display_proc");    CYG_REPORT_FUNCARG1XV(this);    CYG_PRECONDITION_THISC();    CdlProperty prop = get_property(CdlPropertyId_CancelProc);    CYG_ASSERT_CLASSC(prop);    CdlProperty_TclCode tclprop = dynamic_cast<CdlProperty_TclCode>(prop);    CYG_ASSERT_CLASSC(tclprop);    const cdl_tcl_code& result = tclprop->get_code();    CYG_REPORT_RETURN();    return result;}//}}}//{{{  check_this()                     // ----------------------------------------------------------------------------// check_this(). There is very little data associated with a dialog itself.// most of the checks happen in the base class.boolCdlDialogBody::check_this(cyg_assert_class_zeal zeal) const{    if (CdlDialogBody_Magic != cdldialogbody_cookie) {        return false;    }    CYGDBG_MEMLEAK_CHECKTHIS();    return CdlUserVisibleBody::check_this(zeal);}//}}}//{{{  misc                             // ----------------------------------------------------------------------------std::stringCdlDialogBody::get_class_name() const{    CYG_REPORT_FUNCNAME("CdlDialog::get_class_name");    CYG_PRECONDITION_THISC();    CYG_REPORT_RETURN();    return "dialog";}//}}}

⌨️ 快捷键说明

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