MRESULT CreInstDlg::wmInitDlg(HM12){ ::SetSysMenu(hwnd); ::CenterDialog(hwnd); USE_HM12; noassignedprops=0; //counts no of assigned props //assign window handles from their resource id's hwndlbtypes=WinWindowFromID(hwnd ,CMB_CREINSTTYPE); hwndlbprops=WinWindowFromID(hwnd,LB_TYPEPROPS); hwnddatatype=WinWindowFromID(hwnd,DF_DATATYPE); hwndnewvalue=WinWindowFromID(hwnd ,DF_NEWVALUE); hwndpropval=WinWindowFromID(hwnd ,LB_PROPVALS); hwndassignedprop=WinWindowFromID(hwnd ,LB_ASSPROP); hwndviewval=WinWindowFromID(hwnd ,DF_VIEWVAL); //populate cmb box with all types in db populate_types(hwndlbtypes,odb); return FALSE; }
// --------------------------------------------------------------------------- // // ----------- void bToolGeomWithJoin::edit_init(WindowRef wd){ ControlRef c; ControlID cid; bGenericType* tp=NULL; char val[32]; val[1]=0; /* A GERER PAR UN MAP EVENT*/ for(int i=_tp_use.count()+1;i<=_gapp->typesMgr()->count();i++){ tp=NULL; _tp_use.add(&tp); } for(int i=_tp_use.count();i>_gapp->typesMgr()->count();i--){ _tp_use.rmv(i); } /* A GERER PAR UN MAP EVENT*/ cid.signature=kToolGeomWithJoinSign; cid.id=kToolGeomWithJoinUseNeaID; GetControlByID(wd,&cid,&c); SetControl32BitValue(c,_use_nea); cid.id=kToolGeomWithJoinKeyNeaID; GetControlByID(wd,&cid,&c); val[0]=_k_nea; SetTextControlValue(c,val); cid.id=kToolGeomWithJoinUseDirID; GetControlByID(wd,&cid,&c); SetControl32BitValue(c,_use_dir); cid.id=kToolGeomWithJoinKeyDirID; GetControlByID(wd,&cid,&c); val[0]=_k_dir; SetTextControlValue(c,val); cid.id=kToolGeomWithJoinUseAngID; GetControlByID(wd,&cid,&c); SetControl32BitValue(c,_use_ang); cid.id=kToolGeomWithJoinKeyAngID; GetControlByID(wd,&cid,&c); val[0]=_k_ang; SetTextControlValue(c,val); cid.id=kToolGeomWithJoinUseEndID; GetControlByID(wd,&cid,&c); SetControl32BitValue(c,_use_end); cid.id=kToolGeomWithJoinKeyEndID; GetControlByID(wd,&cid,&c); val[0]=_k_end; SetTextControlValue(c,val); if(!_jnea){ cid.id=kToolGeomWithJoinUseNeaID; GetControlByID(wd,&cid,&c); DisableControl(c); cid.id=kToolGeomWithJoinKeyNeaID; GetControlByID(wd,&cid,&c); DisableControl(c); } if(!_jdir){ cid.id=kToolGeomWithJoinUseDirID; GetControlByID(wd,&cid,&c); DisableControl(c); cid.id=kToolGeomWithJoinKeyDirID; GetControlByID(wd,&cid,&c); DisableControl(c); } if(!_jang){ cid.id=kToolGeomWithJoinUseAngID; GetControlByID(wd,&cid,&c); DisableControl(c); cid.id=kToolGeomWithJoinKeyAngID; GetControlByID(wd,&cid,&c); DisableControl(c); } if(!_jend){ cid.id=kToolGeomWithJoinUseEndID; GetControlByID(wd,&cid,&c); DisableControl(c); cid.id=kToolGeomWithJoinKeyEndID; GetControlByID(wd,&cid,&c); DisableControl(c); } cid.id=kToolGeomWithJoinTypesID; GetControlByID(wd,&cid,&c); DataBrowserInit(c,dtb_proc,NULL,(long)this); populate_types(wd); SetDataBrowserPropertyFlags(c,kToolGeomWithJoinTypesCheckProperty,kDataBrowserPropertyIsEditable); }