导航

描述:定义一个属性PartColor, 添加到Part类上去。
 
1、 create dir/src/part.met 文件,添加如下内容:
    define attribute PartColor;
    store PartColor as name value table;
    display PartColor as "Color";
    attach attribute to Part;
    attach attribute to DPrtCre;
    attach attribute to DPrtUpd;
    attach attribute to DPrtGetI usage is output;
    o:attach message SetDialogDefaults to DPrtCre in server bbksvr;
 
2、create dir/src/part.mth 文件,添加如下内容:
    message DPrtCre:SetDialogDefaults(...)
    {
       if ( dstat = SetDialogDefaultsAtParent(DPrtCreClass,...) )
          goto EXIT;
 
       if ( dstat = objNameValueSet(thisObj, PartColorAttr, "Red", "-") )
          goto EXIT;
       if ( dstat = objNameValueSet(thisObj, PartColorAttr, "Green", "-") )
          goto EXIT;
       if ( dstat = objNameValueSet(thisObj, PartColorAttr, "Blue", "-") )
          goto EXIT;
       if ( dstat = objNameValueSet(thisObj, PartColorAttr, "White", "+") )
          goto EXIT;
    }
 
3、edit dir/src/srccusmk.def, include "part.met" & "part.mth"
 
4、at dir/src:
   nmake clobber clean
   cnvdef
   nmake init
   nmake all
 
5、更新数据库架构
   at dir/src, updatedb -o tmti.bak -n svr\tmti.prd
 
6、编辑对话框(详细见对话框编辑)