void CDocObj::draw_property_obj(CMFCPropertyGridCtrl* PropList) { PropList->EnableHeaderCtrl(FALSE); PropList->EnableDescriptionArea(); PropList->SetVSDotNetLook(); CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("通用")); CMFCPropertyGridProperty* pLocation = new CMFCPropertyGridProperty(_T("对象位置"), 0, TRUE); CMFCPropertyGridProperty* p = new CMFCPropertyGridProperty(_T("X"), (_variant_t)m_obj->m_x, _T("世界坐标中X的位置")); pLocation->AddSubItem(p); p = new CMFCPropertyGridProperty(_T("Y"), (_variant_t)m_obj->m_y, _T("世界坐标中Y的位置")); pLocation->AddSubItem(p); p = new CMFCPropertyGridProperty(_T("Z"), (_variant_t)m_obj->m_z, _T("世界坐标中Z的位置")); pLocation->AddSubItem(p); pLocation->AllowEdit(FALSE); pGroup1->AddSubItem(pLocation); CMFCPropertyGridProperty* pSize = new CMFCPropertyGridProperty(_T("对象大小"), 0, TRUE); p = new CMFCPropertyGridProperty(_T("长"), (_variant_t)m_obj->m_l, _T("物体的长度")); pSize->AddSubItem(p); p = new CMFCPropertyGridProperty(_T("宽"), (_variant_t)m_obj->m_w, _T("物体的宽度")); pSize->AddSubItem(p); p = new CMFCPropertyGridProperty(_T("高"), (_variant_t)m_obj->m_h, _T("物体的高度")); pSize->AddSubItem(p); pSize->AllowEdit(FALSE); pGroup1->AddSubItem(pSize); CMFCPropertyGridProperty* pAngle = new CMFCPropertyGridProperty(_T("对象旋转角度"), 0, TRUE); p = new CMFCPropertyGridProperty(_T("X轴角度"), (_variant_t)m_obj->m_angle_x, _T("物体的X轴方向旋转角度")); pAngle->AddSubItem(p); p = new CMFCPropertyGridProperty(_T("Y轴角度"), (_variant_t)m_obj->m_angle_y, _T("物体的Y轴方向旋转角度")); pAngle->AddSubItem(p); p = new CMFCPropertyGridProperty(_T("Z轴角度"), (_variant_t)m_obj->m_angle_z, _T("物体的Z轴方向旋转角度")); pAngle->AddSubItem(p); pAngle->AllowEdit(FALSE); pGroup1->AddSubItem(pAngle); PropList->AddProperty(pGroup1); CMFCPropertyGridProperty* pGroup2 = new CMFCPropertyGridProperty(_T("纹理")); CMFCPropertyGridProperty* whether_texture = new CMFCPropertyGridProperty(_T("是否纹理"), (_variant_t)m_whether_texture, _T("指是否选择纹理")); pGroup2->AddSubItem(whether_texture); if (m_whether_texture == true) { pGroup2->AddSubItem(new CMFCPropertyGridFileProperty(_T("选择纹理文件"), TRUE, m_texture_file_name, _T("bmp"), NULL, _T("bmp Files(*.bmp)|*.bmp|"), _T("选择bmp文件")));//选择文件按钮 } PropList->AddProperty(pGroup2); }
void CReflectiveUI::AddPropertyToGrid(CMFCPropertyGridProperty* root, RTTIObject* pObject, BaseProperty* pProp) { CMFCPropertyGridProperty* pGrid; TypedProperty<T>* pTypedProperty = (TypedProperty<T>*)pProp; EValueSpecify e = pProp->GetValueSpecify(); const std::vector<std::string>& Values = pProp->GetSpeValues(); if ( e == eValueRange ) { T s = TypeValueFromString<T>(Values[0]); T e = TypeValueFromString<T>(Values[1]); pGrid = new CMFCPropertyGridProperty( pTypedProperty->GetName().c_str() , (_variant_t)pTypedProperty->GetValue( pObject ) , pTypedProperty->GetDescription().c_str() ); pGrid->EnableSpinControl(TRUE, s, e); } else if ( e == eValueList ) { pGrid = new CMFCPropertyGridProperty( pTypedProperty->GetName().c_str() , (_variant_t)pTypedProperty->GetValue( pObject ) , pTypedProperty->GetDescription().c_str() ); for (size_t t = 0; t < Values.size(); ++t) { pGrid->AddOption(Values[t].c_str()); } pGrid->AllowEdit(FALSE); } else if ( e == eFilePathName ) { pGrid = new CMFCPropertyGridFileProperty( pTypedProperty->GetName().c_str() , (_variant_t)pTypedProperty->GetValue( pObject ) , pTypedProperty->GetDescription().c_str() ); } else if ( e == eValueColor ) { } else { pGrid = new CMFCPropertyGridProperty( pTypedProperty->GetName().c_str() , (_variant_t)pTypedProperty->GetValue( pObject ) , pTypedProperty->GetDescription().c_str() ); } root->AddSubItem( pGrid ); CReflectiveUI::SPropertyObject PO(pProp, pObject); _GridPropertyMap[pGrid] = PO; }
int ControllerProperty::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (BaseProperty::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code here DebuggingProcessProp * process = (DebuggingProcessProp *)this->target; CString strMode; if (process->traceMode == DebuggingProcessProp::MODE_TRACE_GRAPH) strMode.SetString(L"display data"); else strMode.SetString(L"raw data"); CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty(_T("Trace Type"), strMode.GetBuffer(), _T("Specifies the trace type of the track bar")); pProp->AddOption(_T("display data")); pProp->AddOption(_T("raw data")); pProp->AllowEdit(FALSE); this->AddProperty(pProp); //pProp = new CMFCPropertyGridProperty( _T("Threshold"), (_variant_t) process->threshold, _T("Specifies the threshold for the channel circular buffer")); //this->AddProperty(pProp); return 0; }
void xRenderSettingPane::_ToCtrl(CMFCPropertyGridProperty * gp, IPropertyObj * obj, const Property * p) { if (p->type == PT_Bool) { bool data = p->AsBool(obj->GetPropertyData(p)); gp->AddSubItem(new CMFCPropertyGridProperty(p->name.c_str(), (_variant_t)(data), "")); } else if (p->type == PT_Int) { int val = p->AsInt(obj->GetPropertyData(p)); const cEnum * e = p->enumObj->GetEnum(val); CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty(p->name.c_str(), e->name.c_str()); for (int i = 0; i < p->enumObj->GetEnumCount(); ++i) { e = p->enumObj->GetEnum(i); pProp->AddOption(e->name.c_str()); } pProp->AllowEdit(FALSE); gp->AddSubItem(pProp); } }
void COptionWnd::loadMaterialTemplateAndCity() { CMainFrame* pMain=(CMainFrame*)AfxGetApp()->m_pMainWnd; CBuildLightAnalysisDoc* pDoc = (CBuildLightAnalysisDoc*)pMain->GetActiveDocument(); CString strMat; vector<Material>& mats = pDoc->getMaterials(); CMFCPropertyGridProperty* pOutWallMaterial = m_wndPropList.GetProperty(OPTION_OUTWALL_MAT);pOutWallMaterial->AllowEdit(FALSE); CMFCPropertyGridProperty* pInWallMaterial = m_wndPropList.GetProperty(OPTION_INWALL_MAT);pInWallMaterial->AllowEdit(FALSE); CMFCPropertyGridProperty* pWindowMaterial = m_wndPropList.GetProperty(OPTION_WINDOW_MAT);pWindowMaterial->AllowEdit(FALSE); CMFCPropertyGridProperty* pFloorMaterial = m_wndPropList.GetProperty(OPTION_FLOOR_MAT);pFloorMaterial->AllowEdit(FALSE); CMFCPropertyGridProperty* pRoofMaterial = m_wndPropList.GetProperty(OPTION_ROOF_MAT);pRoofMaterial->AllowEdit(FALSE); for (int i = 0; i < mats.size(); i++) { strMat = StringToCString(mats[i].name); pOutWallMaterial->AddOption(strMat); pInWallMaterial->AddOption(strMat); pWindowMaterial->AddOption(strMat); pFloorMaterial->AddOption(strMat); pRoofMaterial->AddOption(strMat); } CMFCPropertyGridProperty* pCitys = m_wndPropList.GetProperty(OPTION_CITY); vector<CString>& citys = pDoc->getCitys(); for (int i = 0; i < citys.size(); i++) { pCitys->AddOption(citys[i]); } pCitys->AllowEdit(FALSE); }
void CFileView::OnGroupAddprop() { HTREEITEM hGroupItem = GetSelectItemGroup(); ASSERT(hGroupItem != NULL); CMFCPropertyGridProperty* pPropGroup = new CMFCPropertyGridProperty(_T("PROPERTY")); CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty(_T("NAME"), (COleVariant)_T("New")); pPropGroup->AddSubItem(pProp); pProp = new CMFCPropertyGridProperty(_T("TYPE"), (COleVariant)_T("Combo"), _T(""), PROP_DATA_TYPE); pProp->AddOption(_T("Combo")); pProp->AddOption(_T("Number")); pProp->AddOption(_T("Text")); pProp->AllowEdit(FALSE); pPropGroup->AddSubItem(pProp); pProp = new CMFCPropertyGridProperty(_T("VALUE"), (COleVariant)_T("No")); pPropGroup->AddSubItem(pProp); pProp = new CMFCPropertyGridProperty(_T("ITEMS"), PROP_DATA_ITEMS, TRUE); pPropGroup->AddSubItem(pProp); CString strValues[2] = { _T("Yes"), _T("No") }; for (int i = 0; i < 2; i++) { CMFCPropertyGridProperty* pPropItem = new CMFCPropertyGridProperty(_T("ITEM"), 0, TRUE); pProp->AddSubItem(pPropItem); pProp->Expand(TRUE); CMFCPropertyGridProperty* pPropChild = new CMFCPropertyGridProperty(_T("VALUE"), (COleVariant)strValues[i]); pPropItem->AddSubItem(pPropChild); pPropChild = new CMFCPropertyGridProperty(_T("SHORT"), (COleVariant)_T("")); pPropItem->AddSubItem(pPropChild); pPropChild = new CMFCPropertyGridProperty(_T("PREVIEW"), (COleVariant)_T("")); pPropItem->AddSubItem(pPropChild); pPropItem->Expand(TRUE); } HTREEITEM hItem = m_wndFileView.InsertItem(_T("New"), 2, 2, hGroupItem); m_wndFileView.SetItemData(hItem, (DWORD_PTR)pPropGroup); if (hGroupItem) { m_wndFileView.Expand(hGroupItem, TVE_EXPAND); m_wndFileView.SelectItem(hItem); } }
CMFCPropertyGridProperty * ChannelGrid::CreateRemote() { CMFCPropertyGridProperty* pGroup = new CMFCPropertyGridProperty(_T("设备端口")); CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty(_T("类型"), _T("串口"), _T("信道类型选择")); pProp->AddOption(_T("串口")); pProp->AddOption(_T("TCP客户端")); pProp->AddOption(_T("TCP服务器")); pProp->AddOption(_T("UDP")); pProp->AddOption(_T("插件")); pProp->AddOption(_T("测试")); pProp->AllowEdit(FALSE); pGroup->AddSubItem(pProp); return pGroup; }
void CPropertiesWnd::InitPropList() { //SetPropListFont(); m_wndPropList.EnableHeaderCtrl(FALSE); m_wndPropList.EnableDescriptionArea(FALSE); m_wndPropList.SetVSDotNetLook(); m_wndPropList.MarkModifiedProperties(); return; CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("Appearance")); pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("3D Look"), (_variant_t) false, _T("Specifies the window's font will be non-bold and controls will have a 3D border"))); CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty(_T("Border"), _T("Dialog Frame"), _T("One of: None, Thin, Resizable, or Dialog Frame")); pProp->AddOption(_T("None")); pProp->AddOption(_T("Thin")); pProp->AddOption(_T("Resizable")); pProp->AddOption(_T("Dialog Frame")); pProp->AllowEdit(FALSE); pGroup1->AddSubItem(pProp); pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("Caption"), (_variant_t) _T("About"), _T("Specifies the text that will be displayed in the window's title bar"))); m_wndPropList.AddProperty(pGroup1); CMFCPropertyGridProperty* pSize = new CMFCPropertyGridProperty(_T("Window Size"), 0, TRUE); pProp = new CMFCPropertyGridProperty(_T("Height"), (_variant_t) 250l, _T("Specifies the window's height")); pProp->EnableSpinControl(TRUE, 50, 300); pSize->AddSubItem(pProp); pProp = new CMFCPropertyGridProperty( _T("Width"), (_variant_t) 150l, _T("Specifies the window's width")); pProp->EnableSpinControl(TRUE, 50, 200); pSize->AddSubItem(pProp); m_wndPropList.AddProperty(pSize); CMFCPropertyGridProperty* pGroup2 = new CMFCPropertyGridProperty(_T("Font")); LOGFONT lf; CFont* font = CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)); font->GetLogFont(&lf); lstrcpy(lf.lfFaceName, _T("Arial")); pGroup2->AddSubItem(new CMFCPropertyGridFontProperty(_T("Font"), lf, CF_EFFECTS | CF_SCREENFONTS, _T("Specifies the default font for the window"))); pGroup2->AddSubItem(new CMFCPropertyGridProperty(_T("Use System Font"), (_variant_t) true, _T("Specifies that the window uses MS Shell Dlg font"))); m_wndPropList.AddProperty(pGroup2); CMFCPropertyGridProperty* pGroup3 = new CMFCPropertyGridProperty(_T("Misc")); pProp = new CMFCPropertyGridProperty(_T("(Name)"), _T("Application")); pProp->Enable(FALSE); pGroup3->AddSubItem(pProp); CMFCPropertyGridColorProperty* pColorProp = new CMFCPropertyGridColorProperty(_T("Window Color"), RGB(210, 192, 254), NULL, _T("Specifies the default window color")); pColorProp->EnableOtherButton(_T("Other...")); pColorProp->EnableAutomaticButton(_T("Default"), ::GetSysColor(COLOR_3DFACE)); pGroup3->AddSubItem(pColorProp); static const TCHAR szFilter[] = _T("Icon Files(*.ico)|*.ico|All Files(*.*)|*.*||"); pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("Icon"), TRUE, _T(""), _T("ico"), 0, szFilter, _T("Specifies the window icon"))); pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("Folder"), _T("c:\\"))); m_wndPropList.AddProperty(pGroup3); CMFCPropertyGridProperty* pGroup4 = new CMFCPropertyGridProperty(_T("Hierarchy")); CMFCPropertyGridProperty* pGroup41 = new CMFCPropertyGridProperty(_T("First sub-level")); pGroup4->AddSubItem(pGroup41); CMFCPropertyGridProperty* pGroup411 = new CMFCPropertyGridProperty(_T("Second sub-level")); pGroup41->AddSubItem(pGroup411); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("Item 1"), (_variant_t) _T("Value 1"), _T("This is a description"))); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("Item 2"), (_variant_t) _T("Value 2"), _T("This is a description"))); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("Item 3"), (_variant_t) _T("Value 3"), _T("This is a description"))); pGroup4->Expand(FALSE); m_wndPropList.AddProperty(pGroup4); }
void CParticleModelParamGridProperty::SetModelParamType(CString sType,BOOL bNotify) { if(m_sParamType==sType&&bNotify) return ; unsigned int i; for(i=0;i<m_PropertyVector.size();++i) RemoveSubItem(m_PropertyVector[i]); m_PropertyVector.clear(); if(sType=="Default") { CMFCPropertyGridProperty *pDefaultValue; if(m_bRGBA) pDefaultValue=new CMFCPropertyGridProperty("Default Value",COleVariant((long)(m_fDefaultVal*255))); else if(m_bAngle) pDefaultValue=new CMFCPropertyGridProperty("Default Value",COleVariant((long)(m_fDefaultVal*180/float_Pi))); else pDefaultValue=new CMFCPropertyGridProperty("Default Value",COleVariant(m_fDefaultVal)); pDefaultValue->AllowEdit(FALSE); m_PropertyVector.push_back(pDefaultValue); m_pInterpolatorType->Show(FALSE,FALSE); for(i=0;i<m_InterpolatorVector.size();++i) RemoveSubItem(m_InterpolatorVector[i]); m_InterpolatorVector.clear(); } else if(sType=="Constant") { CMFCPropertyGridProperty* pValue; if(m_bRGBA) pValue=new CMFCPropertyGridProperty("Value",COleVariant((long)(m_fDefaultVal*255)),m_sDescription); else if(m_bAngle) pValue=new CMFCPropertyGridProperty("Value",COleVariant((long)(m_fDefaultVal*180/float_Pi)),m_sDescription); else pValue=new CMFCPropertyGridProperty("Value",COleVariant(m_fDefaultVal),m_sDescription); m_PropertyVector.push_back(pValue); m_pInterpolatorType->Show(FALSE,FALSE); for(i=0;i<m_InterpolatorVector.size();++i) RemoveSubItem(m_InterpolatorVector[i]); m_InterpolatorVector.clear(); } else if(sType=="Random") { if(m_bRGBA) { m_PropertyVector.push_back(new CMFCPropertyGridProperty("Min Value",COleVariant((long)(m_fDefaultVal*255)),m_sDescription)); m_PropertyVector.push_back(new CMFCPropertyGridProperty("Max Value",COleVariant((long)(m_fDefaultVal*255)),m_sDescription)); } else if(m_bAngle) { m_PropertyVector.push_back(new CMFCPropertyGridProperty("Min Value",COleVariant((long)(m_fDefaultVal*180/float_Pi)),m_sDescription)); m_PropertyVector.push_back(new CMFCPropertyGridProperty("Max Value",COleVariant((long)(m_fDefaultVal*180/float_Pi)),m_sDescription)); } else { m_PropertyVector.push_back(new CMFCPropertyGridProperty("Min Value",COleVariant(m_fDefaultVal),m_sDescription)); m_PropertyVector.push_back(new CMFCPropertyGridProperty("Max Value",COleVariant(m_fDefaultVal),m_sDescription)); } m_pInterpolatorType->Show(FALSE,FALSE); for(i=0;i<m_InterpolatorVector.size();++i) RemoveSubItem(m_InterpolatorVector[i]); m_InterpolatorVector.clear(); } else if(sType=="Mutable") { if(m_bRGBA) { m_PropertyVector.push_back(new CMFCPropertyGridProperty("Birth Value",COleVariant((long)(m_fDefaultVal*255)),m_sDescription)); m_PropertyVector.push_back(new CMFCPropertyGridProperty("Death Value",COleVariant((long)(m_fDefaultVal*255)),m_sDescription)); } else if(m_bAngle) { m_PropertyVector.push_back(new CMFCPropertyGridProperty("Birth Value",COleVariant((long)(m_fDefaultVal*180/float_Pi)),m_sDescription)); m_PropertyVector.push_back(new CMFCPropertyGridProperty("Death Value",COleVariant((long)(m_fDefaultVal*180/float_Pi)),m_sDescription)); } else { m_PropertyVector.push_back(new CMFCPropertyGridProperty("Birth Value",COleVariant(m_fDefaultVal),m_sDescription)); m_PropertyVector.push_back(new CMFCPropertyGridProperty("Death Value",COleVariant(m_fDefaultVal),m_sDescription)); } m_pInterpolatorType->Show(FALSE,FALSE); for(i=0;i<m_InterpolatorVector.size();++i) RemoveSubItem(m_InterpolatorVector[i]); m_InterpolatorVector.clear(); } else if(sType=="Mutable And Random") { if(m_bRGBA) { m_PropertyVector.push_back(new CMFCPropertyGridProperty("Birth MinVal",COleVariant((long)(m_fDefaultVal*255)),m_sDescription)); m_PropertyVector.push_back(new CMFCPropertyGridProperty("Birth MaxVal",COleVariant((long)(m_fDefaultVal*255)),m_sDescription)); m_PropertyVector.push_back(new CMFCPropertyGridProperty("Death MinVal",COleVariant((long)(m_fDefaultVal*255)),m_sDescription)); m_PropertyVector.push_back(new CMFCPropertyGridProperty("Death MaxVal",COleVariant((long)(m_fDefaultVal*255)),m_sDescription)); } else if(m_bAngle) { m_PropertyVector.push_back(new CMFCPropertyGridProperty("Birth MinVal",COleVariant((long)(m_fDefaultVal*180/float_Pi)),m_sDescription)); m_PropertyVector.push_back(new CMFCPropertyGridProperty("Birth MaxVal",COleVariant((long)(m_fDefaultVal*180/float_Pi)),m_sDescription)); m_PropertyVector.push_back(new CMFCPropertyGridProperty("Death MinVal",COleVariant((long)(m_fDefaultVal*180/float_Pi)),m_sDescription)); m_PropertyVector.push_back(new CMFCPropertyGridProperty("Death MaxVal",COleVariant((long)(m_fDefaultVal*180/float_Pi)),m_sDescription)); } else { m_PropertyVector.push_back(new CMFCPropertyGridProperty("Birth MinVal",COleVariant(m_fDefaultVal),m_sDescription)); m_PropertyVector.push_back(new CMFCPropertyGridProperty("Birth MaxVal",COleVariant(m_fDefaultVal),m_sDescription)); m_PropertyVector.push_back(new CMFCPropertyGridProperty("Death MinVal",COleVariant(m_fDefaultVal),m_sDescription)); m_PropertyVector.push_back(new CMFCPropertyGridProperty("Death MaxVal",COleVariant(m_fDefaultVal),m_sDescription)); } m_pInterpolatorType->Show(FALSE,FALSE); for(i=0;i<m_InterpolatorVector.size();++i) RemoveSubItem(m_InterpolatorVector[i]); m_InterpolatorVector.clear(); } else if(sType=="Interpolator") { m_pInterpolatorType->Show(TRUE,FALSE); SetInterpolatorType(m_pInterpolatorType->GetValue(),FALSE); } else ASSERT(FALSE); m_sParamType=sType; for(i=0;i<m_PropertyVector.size();++i) AddSubItem(m_PropertyVector[i]); if(bNotify) m_pWndList->GetParent()->PostMessage(UM_UPDATE_PROPERTYCTRL); }
void CPropertiesWnd::InitPropList() { SetPropListFont(); m_wndPropList.EnableHeaderCtrl(FALSE); m_wndPropList.EnableDescriptionArea(); m_wndPropList.SetVSDotNetLook(); m_wndPropList.MarkModifiedProperties(); CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("모양")); pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("3D 모양"), (_variant_t) false, _T("창에 굵은 글꼴이 아닌 글꼴을 지정하고, 컨트롤에 3D 테두리를 지정합니다."))); CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty(_T("테두리"), _T("Dialog Frame"), _T("None, Thin, Resizable 또는 Dialog Frame 중 하나를 지정합니다.")); pProp->AddOption(_T("None")); pProp->AddOption(_T("Thin")); pProp->AddOption(_T("Resizable")); pProp->AddOption(_T("Dialog Frame")); pProp->AllowEdit(FALSE); pGroup1->AddSubItem(pProp); pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("캡션"), (_variant_t) _T("정보"), _T("창의 제목 표시줄에 표시되는 텍스트를 지정합니다."))); m_wndPropList.AddProperty(pGroup1); CMFCPropertyGridProperty* pSize = new CMFCPropertyGridProperty(_T("창 크기"), 0, TRUE); pProp = new CMFCPropertyGridProperty(_T("높이"), (_variant_t) 250l, _T("창의 높이를 지정합니다.")); pProp->EnableSpinControl(TRUE, 50, 300); pSize->AddSubItem(pProp); pProp = new CMFCPropertyGridProperty( _T("너비"), (_variant_t) 150l, _T("창의 너비를 지정합니다.")); pProp->EnableSpinControl(TRUE, 50, 200); pSize->AddSubItem(pProp); m_wndPropList.AddProperty(pSize); CMFCPropertyGridProperty* pGroup2 = new CMFCPropertyGridProperty(_T("글꼴")); LOGFONT lf; CFont* font = CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)); font->GetLogFont(&lf); lstrcpy(lf.lfFaceName, _T("맑은 고딕")); pGroup2->AddSubItem(new CMFCPropertyGridFontProperty(_T("글꼴"), lf, CF_EFFECTS | CF_SCREENFONTS, _T("창의 기본 글꼴을 지정합니다."))); pGroup2->AddSubItem(new CMFCPropertyGridProperty(_T("시스템 글꼴을 사용합니다."), (_variant_t) true, _T("창에서 MS Shell Dlg 글꼴을 사용하도록 지정합니다."))); m_wndPropList.AddProperty(pGroup2); CMFCPropertyGridProperty* pGroup3 = new CMFCPropertyGridProperty(_T("기타")); pProp = new CMFCPropertyGridProperty(_T("(이름)"), _T("응용 프로그램")); pProp->Enable(FALSE); pGroup3->AddSubItem(pProp); CMFCPropertyGridColorProperty* pColorProp = new CMFCPropertyGridColorProperty(_T("창 색상"), RGB(210, 192, 254), NULL, _T("창의 기본 색상을 지정합니다.")); pColorProp->EnableOtherButton(_T("기타...")); pColorProp->EnableAutomaticButton(_T("기본값"), ::GetSysColor(COLOR_3DFACE)); pGroup3->AddSubItem(pColorProp); static TCHAR BASED_CODE szFilter[] = _T("아이콘 파일(*.ico)|*.ico|모든 파일(*.*)|*.*||"); pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("아이콘"), TRUE, _T(""), _T("ico"), 0, szFilter, _T("창 아이콘을 지정합니다."))); pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("폴더"), _T("c:\\"))); m_wndPropList.AddProperty(pGroup3); CMFCPropertyGridProperty* pGroup4 = new CMFCPropertyGridProperty(_T("계층")); CMFCPropertyGridProperty* pGroup41 = new CMFCPropertyGridProperty(_T("첫번째 하위 수준")); pGroup4->AddSubItem(pGroup41); CMFCPropertyGridProperty* pGroup411 = new CMFCPropertyGridProperty(_T("두 번째 하위 수준")); pGroup41->AddSubItem(pGroup411); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("항목 1"), (_variant_t) _T("값 1"), _T("설명입니다."))); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("항목 2"), (_variant_t) _T("값 2"), _T("설명입니다."))); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("항목 3"), (_variant_t) _T("값 3"), _T("설명입니다."))); pGroup4->Expand(FALSE); m_wndPropList.AddProperty(pGroup4); }
void CPropertiesWnd::UpdateProperties(GitRevLoglist* pRev) { if (pRev) { if (pRev->m_ParentHash.empty()) { if (pRev->GetParentFromHash(pRev->m_CommitHash)) MessageBox(pRev->GetLastErr(), _T("TortoiseGit"), MB_ICONERROR); } CString hash = pRev->m_CommitHash.ToString(); m_CommitHash->SetValue(hash); m_AuthorName->SetValue(pRev->GetAuthorName()); CString authorDate = pRev->GetAuthorDate().Format(_T("%Y-%m-%d %H:%M")); m_AuthorDate->SetValue(authorDate); m_AuthorEmail->SetValue(pRev->GetAuthorEmail()); m_CommitterName->SetValue(pRev->GetAuthorName()); m_CommitterEmail->SetValue(pRev->GetCommitterEmail()); CString committerDate = pRev->GetCommitterDate().Format(_T("%Y-%m-%d %H:%M")); m_CommitterDate->SetValue(committerDate); m_Subject->SetValue(pRev->GetSubject()); m_Body->SetValue(pRev->GetBody().Trim()); RemoveParent(); CLogDataVector *pLogEntry = &((CMainFrame*)AfxGetApp()->GetMainWnd())->m_wndOutput.m_LogList.m_logEntries; CGitHashMap & hashMap = pLogEntry->m_pLogCache->m_HashMap; for (size_t i = 0; i < pRev->m_ParentHash.size(); ++i) { CString str; CString parentsubject; auto it = hashMap.find(pRev->m_ParentHash[i]); if (it != hashMap.end()) parentsubject = it->second.GetSubject(); str.Format(_T("%u - %s\n%s"), i, (LPCTSTR)pRev->m_ParentHash[i].ToString(), (LPCTSTR)parentsubject); CMFCPropertyGridProperty *pProperty = new CMFCPropertyGridProperty(pRev->m_ParentHash[i].ToString().Left(8), parentsubject, str); pProperty->AllowEdit(FALSE); m_ParentGroup->AddSubItem(pProperty); } m_ParentGroup->Expand(); for (int i = 0; i < m_BaseInfoGroup->GetSubItemsCount(); ++i) m_BaseInfoGroup->GetSubItem(i)->SetDescription(m_BaseInfoGroup->GetSubItem(i)->GetValue()); } else { m_CommitHash->SetValue(_T("")); m_AuthorName->SetValue(_T("")); m_AuthorDate->SetValue(_T("")); m_AuthorEmail->SetValue(_T("")); m_CommitterName->SetValue(_T("")); m_CommitterEmail->SetValue(_T("")); m_CommitterDate->SetValue(_T("")); m_Subject->SetValue(_T("")); m_Body->SetValue(_T("")); RemoveParent(); for (int i = 0; i < m_BaseInfoGroup->GetSubItemsCount(); ++i) m_BaseInfoGroup->GetSubItem(i)->SetDescription(_T("")); } m_wndPropList.AdjustLayout(); }
void CPropertiesWnd::InitPropList() { SetPropListFont(); m_wndPropList.EnableHeaderCtrl(FALSE); m_wndPropList.EnableDescriptionArea(); m_wndPropList.SetVSDotNetLook(); m_wndPropList.MarkModifiedProperties(); CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("表示")); pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("3D 表示"), (_variant_t) false, _T("ウィンドウのフォントが太字以外になり、また、コントロールが 3D ボーダーで描画されます"))); CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty(_T("罫線"), _T("ダイアログ枠"), _T("次のうちのどれかです : なし、細枠、サイズ変更可能枠、ダイアログ枠")); pProp->AddOption(_T("なし")); pProp->AddOption(_T("細枠")); pProp->AddOption(_T("サイズ変更可能枠")); pProp->AddOption(_T("ダイアログ枠")); pProp->AllowEdit(FALSE); pGroup1->AddSubItem(pProp); pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("キャプション"), (_variant_t) _T("バージョン情報"), _T("ウィンドウのタイトル バーに表示されるテキストを指定します"))); m_wndPropList.AddProperty(pGroup1); CMFCPropertyGridProperty* pSize = new CMFCPropertyGridProperty(_T("ウィンドウ サイズ"), 0, TRUE); pProp = new CMFCPropertyGridProperty(_T("高さ"), (_variant_t) 250l, _T("ウィンドウの高さを指定します")); pProp->EnableSpinControl(TRUE, 50, 300); pSize->AddSubItem(pProp); pProp = new CMFCPropertyGridProperty( _T("幅"), (_variant_t) 150l, _T("ウィンドウの幅を指定します")); pProp->EnableSpinControl(TRUE, 50, 200); pSize->AddSubItem(pProp); m_wndPropList.AddProperty(pSize); CMFCPropertyGridProperty* pGroup2 = new CMFCPropertyGridProperty(_T("フォント")); LOGFONT lf; CFont* font = CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)); font->GetLogFont(&lf); lstrcpy(lf.lfFaceName, _T("MS Pゴシック")); pGroup2->AddSubItem(new CMFCPropertyGridFontProperty(_T("フォント"), lf, CF_EFFECTS | CF_SCREENFONTS, _T("ウィンドウの既定フォントを指定します"))); pGroup2->AddSubItem(new CMFCPropertyGridProperty(_T("システム フォントを使用する"), (_variant_t) true, _T("ウィンドウで MS Shell Dlg フォントを使用するように指定します"))); m_wndPropList.AddProperty(pGroup2); CMFCPropertyGridProperty* pGroup3 = new CMFCPropertyGridProperty(_T("その他")); pProp = new CMFCPropertyGridProperty(_T("(名前)"), _T("アプリケーション")); pProp->Enable(FALSE); pGroup3->AddSubItem(pProp); CMFCPropertyGridColorProperty* pColorProp = new CMFCPropertyGridColorProperty(_T("ウィンドウの色"), RGB(210, 192, 254), NULL, _T("ウィンドウの既定の色を指定します")); pColorProp->EnableOtherButton(_T("その他...")); pColorProp->EnableAutomaticButton(_T("既定値"), ::GetSysColor(COLOR_3DFACE)); pGroup3->AddSubItem(pColorProp); static const TCHAR szFilter[] = _T("アイコン ファイル (*.ico)|*.ico|すべてのファイル (*.*)|*.*||"); pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("アイコン"), TRUE, _T(""), _T("ico"), 0, szFilter, _T("ウィンドウ アイコンを指定します"))); pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("フォルダー"), _T("c:\\"))); m_wndPropList.AddProperty(pGroup3); CMFCPropertyGridProperty* pGroup4 = new CMFCPropertyGridProperty(_T("階層")); CMFCPropertyGridProperty* pGroup41 = new CMFCPropertyGridProperty(_T("1 番目のサブレベル")); pGroup4->AddSubItem(pGroup41); CMFCPropertyGridProperty* pGroup411 = new CMFCPropertyGridProperty(_T("2 番目のサブレベル")); pGroup41->AddSubItem(pGroup411); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("項目 1"), (_variant_t) _T("値 1"), _T("これは説明です"))); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("項目 2"), (_variant_t) _T("値 2"), _T("これは説明です"))); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("項目 3"), (_variant_t) _T("値 3"), _T("これは説明です"))); pGroup4->Expand(FALSE); m_wndPropList.AddProperty(pGroup4); }
void CPropertiesWnd::UpdatePropertyPanel() { int nSel = m_wndObjectCombo.GetCurSel(); m_wndPropList.RemoveAll(); //Log File if (nSel == 0) { if (!m_logFileProperty.isNull()) { CMFCPropertyGridProperty* basicInformation = new CMFCPropertyGridProperty(_T("Basic Information")); //File path CMFCPropertyGridProperty* pFilePathPro = new CMFCPropertyGridProperty(_T("Path"), m_logFileProperty->m_strFileName.c_str(), _T("")); pFilePathPro->AllowEdit(FALSE); basicInformation->AddSubItem(pFilePathPro); //File Size char buff[64]; sprintf(buff, "%d KB", m_logFileProperty->m_nFileSize/1024); CMFCPropertyGridProperty* pFileSizePro = new CMFCPropertyGridProperty(_T("Size"), buff, _T("")); pFilePathPro->AllowEdit(FALSE); basicInformation->AddSubItem(pFileSizePro); m_wndPropList.AddProperty(basicInformation); } } //Component else if (nSel == 1) { if (!m_componentProperty.isNull()) { CMFCPropertyGridProperty* basicInformation = new CMFCPropertyGridProperty(_T("Basic Information")); //Component Name CMFCPropertyGridProperty* pCompName = new CMFCPropertyGridProperty(_T("Name"), m_componentProperty->m_strComponentName.c_str(), _T("")); pCompName->AllowEdit(FALSE); basicInformation->AddSubItem(pCompName); //Trace Log char buff[64]; sprintf(buff, "%d", m_componentProperty->m_nLogTraceCount); CMFCPropertyGridProperty* pCompTraceCount = new CMFCPropertyGridProperty(_T("Trace Count"), buff, _T("")); pCompTraceCount->AllowEdit(FALSE); basicInformation->AddSubItem(pCompTraceCount); m_wndPropList.AddProperty(basicInformation); } } //Setting else if (nSel == 2) { if (!m_currentSelUISetting.isNull()) { CMFCPropertyGridProperty* basicInformation = new CMFCPropertyGridProperty(_T("Basic Information")); { //Name CMFCPropertyGridProperty* proName = new CMFCPropertyGridProperty(_T("Name"), m_currentSelUISetting->getName().c_str(), _T("")); proName->AllowEdit(FALSE); basicInformation->AddSubItem(proName); //Regular expression CMFCPropertyGridProperty* proRE = new CMFCPropertyGridProperty(_T("Regular Expression"), m_currentSelUISetting->GetRegularExpression().c_str(), _T("")); proRE->AllowEdit(FALSE); basicInformation->AddSubItem(proRE); } m_wndPropList.AddProperty(basicInformation); //Components CMFCPropertyGridProperty* components = new CMFCPropertyGridProperty(_T("Components")); { const std::vector<Poco::SharedPtr<CVirtualComponent>>& componentDefs = m_currentSelUISetting->GetAllComponent(); for (int i = 0; i < componentDefs.size(); ++i) { CMFCPropertyGridProperty* component = new CMFCPropertyGridProperty(_T("Component")); { //Name CMFCPropertyGridProperty* proName = new CMFCPropertyGridProperty(_T("Name"), componentDefs.at(i)->GetComponentName().c_str(), componentDefs.at(i)->GetEnable() ? _T("This component is enabled.") : _T("This compoent is disabled.")); proName->AllowEdit(FALSE); component->AddSubItem(proName); //Keyword CMFCPropertyGridProperty* keyWord = new CMFCPropertyGridProperty(_T("Name"), componentDefs.at(i)->GetCondition().c_str(), componentDefs.at(i)->GetEnable() ? _T("This component is enabled") : _T("This compoent is disable.")); keyWord->AllowEdit(FALSE); component->AddSubItem(keyWord); } components->AddSubItem(component); } } m_wndPropList.AddProperty(components); //Paths CMFCPropertyGridProperty* pathes = new CMFCPropertyGridProperty(_T("Source Code path")); { const std::vector<Poco::SharedPtr<CSourceCoePath>>& pathDefs = m_currentSelUISetting->GetAllSourceCodePath(); for (int i = 0; i < pathDefs.size(); ++i) { CMFCPropertyGridProperty* path = new CMFCPropertyGridProperty(_T("Path")); { //Name CMFCPropertyGridProperty* proName = new CMFCPropertyGridProperty(_T("Condition"), pathDefs.at(i)->m_strCondition.c_str(), pathDefs.at(i)->m_bEnable ? _T("This path definition is enabled.") : _T("This path defition is disabled.")); proName->AllowEdit(FALSE); path->AddSubItem(proName); //Keyword CMFCPropertyGridProperty* keyWord = new CMFCPropertyGridProperty(_T("Path"), pathDefs.at(i)->m_strSourceCodePath.c_str(), pathDefs.at(i)->m_bEnable ? _T("This path definition is enabled.") : _T("This path definition is disabled.")); keyWord->AllowEdit(FALSE); path->AddSubItem(keyWord); } pathes->AddSubItem(path); } } m_wndPropList.AddProperty(pathes); } } }
int CWorkspaceBar::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CDockablePane::OnCreate(lpCreateStruct) == -1) return -1; CRect rectDummy; rectDummy.SetRectEmpty (); if (!m_wndPropList.Create (WS_VISIBLE | WS_CHILD, rectDummy, this, 1)) { TRACE0("Failed to create Properies Grid \n"); return -1; // fail to create } m_wndPropList.EnableHeaderCtrl (FALSE); m_wndPropList.EnableDescriptionArea (); m_wndPropList.SetVSDotNetLook (); CMFCPropertyGridProperty* pMDITabsProp = new CMFCPropertyGridProperty (_T("Enable MDI Tabs"), lpszMDITabsStyles [1], _T("Enable or disable either the standard MDI Tabs feature, or MDI Tabbed Groups feature"), idShowMDITabs); pMDITabsProp->AddOption (_T ("None")); pMDITabsProp->AddOption (_T ("MDI Tabs (Standard)")); pMDITabsProp->AddOption (_T ("MDI Tabbed Groups")); int i = 0; for (i = 0; lpszMDITabsStyles [i] != NULL; i++) { pMDITabsProp->AddOption (lpszMDITabsStyles [i]); } switch (theApp.m_Options.m_nMDITabsType) { case CMDITabOptions::None: pMDITabsProp->SetValue (lpszMDITabsStyles [0]); break; case CMDITabOptions::MDITabsStandard: pMDITabsProp->SetValue (lpszMDITabsStyles [1]); break; case CMDITabOptions::MDITabbedGroups: pMDITabsProp->SetValue (lpszMDITabsStyles [2]); theApp.m_Options.m_bMaximizeMDIChild = TRUE; break; } pMDITabsProp->AllowEdit (FALSE); m_wndPropList.AddProperty (pMDITabsProp); m_wndPropList.AddProperty (new CMFCPropertyGridProperty (_T("Maximize child"), (_variant_t) (theApp.m_Options.m_bMaximizeMDIChild == TRUE), _T("Always maximize MDI child windows"), idMaximizeMDIChild)); m_wndPropList.AddProperty (new CMFCPropertyGridProperty (_T("Tabs on top"), (_variant_t) (theApp.m_Options.m_bTabsOnTop == TRUE), _T("Show MDI tabs on top"), idTabsOnTop)); m_wndPropList.AddProperty (new CMFCPropertyGridProperty (_T("Active tab \"Close\" button"), (_variant_t) (theApp.m_Options.m_bActiveTabCloseButton == TRUE), _T("Show \"Close\" button on the active tab right side"), idActiveTabCloseButton)); CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty (_T("MDI Tabs style"), _T(""), _T("One of: VS.NET, OneNote or Visual Studio 2005"), idTabsStyle); for (i = 0; lpszStyles [i] != NULL; i++) { pProp->AddOption (lpszStyles [i]); } switch (theApp.m_Options.m_nTabsStyle) { case CMFCTabCtrl::STYLE_3D_SCROLLED: pProp->SetValue (lpszStyles [0]); break; case CMFCTabCtrl::STYLE_3D_ONENOTE: pProp->SetValue (lpszStyles [1]); break; case CMFCTabCtrl::STYLE_3D_VS2005: pProp->SetValue (lpszStyles [2]); break; } pProp->AllowEdit (FALSE); m_wndPropList.AddProperty (pProp); m_wndPropList.AddProperty (new CMFCPropertyGridProperty (_T("Tabs auto-color"), (_variant_t) (theApp.m_Options.m_bTabsAutoColor == TRUE), _T("Set MDI tabs automatic color"), idTabsAutoColor)); m_wndPropList.AddProperty (new CMFCPropertyGridProperty (_T("Tab icons"), (_variant_t) (theApp.m_Options.m_bMDITabsIcons == TRUE), _T("Show document icons on MDI tabs"), idMDITabsIcons)); m_wndPropList.AddProperty (new CMFCPropertyGridProperty (_T("Tabs document menu"), (_variant_t) (theApp.m_Options.m_bMDITabsDocMenu == TRUE), _T("Show menu with a list of opened documents"), idMDITabsDocMenu)); m_wndPropList.AddProperty (new CMFCPropertyGridProperty (_T("Drag tabs"), (_variant_t) (theApp.m_Options.m_bDragMDITabs == TRUE), _T("Enable MDI tabs order changing"), idDragMDITabs)); m_wndPropList.AddProperty (new CMFCPropertyGridProperty (_T("Context Menu"), (_variant_t) (theApp.m_Options.m_bMDITabsContextMenu == TRUE), _T("Enable MDI tabs context menu"), idMDITabsContextMenu)); CMFCPropertyGridProperty* pBorderProp = new CMFCPropertyGridProperty (_T("Border Size"), (_variant_t) ((short) theApp.m_Options.m_nMDITabsBorderSize), _T("Set MDI border"), idMDITabsBorderSize); pBorderProp->EnableSpinControl (TRUE, 0, 10); m_wndPropList.AddProperty (pBorderProp); m_wndPropList.AddProperty (new CMFCPropertyGridProperty (_T("No optimize MDI child redraw"), (_variant_t) (theApp.m_Options.m_bDisableMDIChildRedraw == TRUE), _T("Disable MDI Child redraw optimization"), idDisableMDIChildRedraw)); m_wndPropList.AddProperty (new CMFCPropertyGridProperty (_T("Flat Frame"), (_variant_t) (theApp.m_Options.m_bFlatFrame == TRUE), _T("Enable or disable 3D frame around MDI client area"), idFlatFrame)); m_wndPropList.AddProperty (new CMFCPropertyGridProperty (_T("Custom Tooltips"), (_variant_t) (theApp.m_Options.m_bCustomTooltips == TRUE), _T("Enable MDI tabs custom tooltips"), idCustomTooltips)); SetPropState (); return 0; }
void CLegoBrickPropertiesWnd::Update() { m_wndPropList.RemoveAll(); CMainFrame* pFrame = (CMainFrame*) AfxGetMainWnd(); HTREEITEM hSelected = pFrame->GetClassView()->GetTreeView()->GetSelectedItem(); if (hSelected == NULL) { m_wndPropList.RedrawWindow(); return; } CString str = pFrame->GetClassView()->GetTreeView()->GetItemText(hSelected); CString str1 = pFrame->GetClassView()->GetTreeView()->GetItemText(pFrame->GetClassView()->hRoot1); CString str2 = pFrame->GetClassView()->GetTreeView()->GetItemText(pFrame->GetClassView()->hRoot2); if (str == str1 || str == str2) { m_wndPropList.RedrawWindow(); return; } LBInfoNode* pBrickNode = (LBInfoNode*)pFrame->GetClassView()->GetTreeView()->GetItemData(hSelected); BricksInfo* pBrick = &(pBrickNode->bi); CMFCPropertyGridProperty* pG = new CMFCPropertyGridProperty(_T("Lego")); pGroup = pG; int i; for (i=0; i<NUMOFBRICKTYPE; i++) { if (strmap[i].bt == pBrick->brick.type) break; } CMFCPropertyGridProperty* pT = new CMFCPropertyGridProperty(_T("brick type"), strmap[i].str, _T("brick type")); pPropType = pT; for (i=0; i<NUMOFBRICKTYPE; i++) pT->AddOption(strmap[i].str, TRUE); //TRUE to add the list item only if it does not already exist; // CClientDC dc(&m_wndPropList); // pT->OnDrawValue(&dc, NULL); pT->AllowEdit(FALSE); pG->AddSubItem(pT); /* // CMFCPropertyGridColorProperty *pC = new CMFCPropertyGridColorProperty(_T("Color"), RGB(255, 0, 0), NULL, _T("set LEGO brick color")); CMFCPropertyGridColorProperty *pC = new CMFCPropertyGridColorProperty(_T("Color"), pBrick->brick.color, NULL, _T("set LEGO brick color")); pPropColor = pC; // pC->AddOption(_T("Lego Color"), TRUE); // no use pC->EnableOtherButton(_T("Other color")); // pC->EnableAutomaticButton(_T("Default"), ::GetSysColor(COLOR_3DFACE)); pC->SetColor(RGB(255,0,0)); pC->SetColumnsNumber(6); // pPropColor->EnableAutomaticButton(_T("預設"), ::GetSysColor(COLOR_3DFACE)); pG->AddSubItem(pC); */ CPHPropertyGridColorProperty *pPH; if (pBrick->brick.pLegoColor != NULL) pPH = new CPHPropertyGridColorProperty(_T("Color"), pBrick->brick.pLegoColor->rgb); else pPH = new CPHPropertyGridColorProperty(_T("Color"), pBrick->brick.color); pPropColor = pPH; pG->AddSubItem(pPH); CMFCPropertyGridProperty *pN = new CMFCPropertyGridProperty(_T("num bricks"), (_variant_t) pBrick->numBricks, _T("number of bricks: -1 for unlimited")); pPropNum = pN; pG->AddSubItem(pN); m_wndPropList.AddProperty(pG); // m_wndPropList.RedrawWindow(); return; }
void CPropertiesWnd::InitPropList() { SetPropListFont(); m_wndPropList.EnableHeaderCtrl(FALSE); m_wndPropList.EnableDescriptionArea(); m_wndPropList.SetVSDotNetLook(); m_wndPropList.MarkModifiedProperties(); CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("图像属性"));//图像属性 m_filename = new CMFCPropertyGridProperty(_T("文件名"), (_variant_t) _T(""), _T("文件名")); m_filename->AllowEdit(FALSE); pGroup1->AddSubItem(m_filename); CMFCPropertyGridProperty* pGroupSize = new CMFCPropertyGridProperty(_T("图像大小"), 0, TRUE); pProp_w = new CMFCPropertyGridProperty(_T("高度"), _T("")); pProp_w ->AllowEdit(FALSE); pGroupSize->AddSubItem(pProp_w); pProp_h = new CMFCPropertyGridProperty( _T("宽度"), _T("")); pProp_h ->AllowEdit(FALSE); pGroupSize->AddSubItem(pProp_h); pGroupSize->AllowEdit(FALSE); pGroup1->AddSubItem(pGroupSize); m_XXS = new CMFCPropertyGridProperty( _T("信息熵"), _T("")); m_XXS ->AllowEdit(FALSE); m_XXS->Show(FALSE,TRUE); m_SNR = new CMFCPropertyGridProperty( _T("信噪比"), _T("")); m_SNR ->AllowEdit(FALSE); m_SNR->Show(FALSE,TRUE); m_MAG = new CMFCPropertyGridProperty( _T("平均梯度"), _T("")); m_MAG ->AllowEdit(FALSE); m_MAG->Show(FALSE,TRUE); m_GRAY = new CMFCPropertyGridProperty( _T("平均灰度"), _T("")); m_GRAY ->AllowEdit(FALSE); m_GRAY->Show(FALSE,TRUE); m_IAC = new CMFCPropertyGridProperty( _T("平均对比度"), _T("")); m_IAC ->AllowEdit(FALSE); m_IAC->Show(FALSE,TRUE); m_SAR = new CMFCPropertyGridProperty( _T("灰度方差"), _T("")); m_SAR ->AllowEdit(FALSE); m_SAR->Show(FALSE,TRUE); m_EME = new CMFCPropertyGridProperty( _T("图像增强测量"), _T("")); m_EME ->AllowEdit(FALSE); m_EME->Show(FALSE,TRUE); m_TMQI = new CMFCPropertyGridProperty( _T("色阶保真度"), _T("")); m_TMQI ->AllowEdit(FALSE); m_TMQI->Show(FALSE,TRUE); pGroup1->AddSubItem(m_XXS); pGroup1->AddSubItem(m_SNR); pGroup1->AddSubItem(m_MAG); pGroup1->AddSubItem(m_GRAY); pGroup1->AddSubItem(m_IAC); pGroup1->AddSubItem(m_SAR); pGroup1->AddSubItem(m_EME); pGroup1->AddSubItem(m_TMQI); m_wndPropList.AddProperty(pGroup1); }
void CPropertiesWnd::InitPropList() { SetPropListFont(); m_wndPropList.EnableHeaderCtrl(FALSE); m_wndPropList.EnableDescriptionArea(); m_wndPropList.SetVSDotNetLook(); m_wndPropList.MarkModifiedProperties(); CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("外观")); pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("三维外观"), (_variant_t) false, _T("指定窗口的字体不使用粗体,并且控件将使用三维边框"))); CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty(_T("边框"), _T("对话框外框"), _T("其中之一: “无”、“细”、“可调整大小”或“对话框外框”")); pProp->AddOption(_T("无")); pProp->AddOption(_T("细")); pProp->AddOption(_T("可调整大小")); pProp->AddOption(_T("对话框外框")); pProp->AllowEdit(FALSE); pGroup1->AddSubItem(pProp); pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("标题"), (_variant_t) _T("关于"), _T("指定窗口标题栏中显示的文本"))); m_wndPropList.AddProperty(pGroup1); CMFCPropertyGridProperty* pSize = new CMFCPropertyGridProperty(_T("窗口大小"), 0, TRUE); pProp = new CMFCPropertyGridProperty(_T("高度"), (_variant_t) 250l, _T("指定窗口的高度")); pProp->EnableSpinControl(TRUE, 50, 300); pSize->AddSubItem(pProp); pProp = new CMFCPropertyGridProperty( _T("宽度"), (_variant_t) 150l, _T("指定窗口的宽度")); pProp->EnableSpinControl(TRUE, 50, 200); pSize->AddSubItem(pProp); m_wndPropList.AddProperty(pSize); CMFCPropertyGridProperty* pGroup2 = new CMFCPropertyGridProperty(_T("字体")); LOGFONT lf; CFont* font = CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)); font->GetLogFont(&lf); _tcscpy_s(lf.lfFaceName, _T("宋体, Arial")); pGroup2->AddSubItem(new CMFCPropertyGridFontProperty(_T("字体"), lf, CF_EFFECTS | CF_SCREENFONTS, _T("指定窗口的默认字体"))); pGroup2->AddSubItem(new CMFCPropertyGridProperty(_T("使用系统字体"), (_variant_t) true, _T("指定窗口使用“MS Shell Dlg”字体"))); m_wndPropList.AddProperty(pGroup2); CMFCPropertyGridProperty* pGroup3 = new CMFCPropertyGridProperty(_T("杂项")); pProp = new CMFCPropertyGridProperty(_T("(名称)"), _T("应用程序")); pProp->Enable(FALSE); pGroup3->AddSubItem(pProp); CMFCPropertyGridColorProperty* pColorProp = new CMFCPropertyGridColorProperty(_T("窗口颜色"), RGB(210, 192, 254), NULL, _T("指定默认的窗口颜色")); pColorProp->EnableOtherButton(_T("其他...")); pColorProp->EnableAutomaticButton(_T("默认"), ::GetSysColor(COLOR_3DFACE)); pGroup3->AddSubItem(pColorProp); static const TCHAR szFilter[] = _T("图标文件(*.ico)|*.ico|所有文件(*.*)|*.*||"); pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("图标"), TRUE, _T(""), _T("ico"), 0, szFilter, _T("指定窗口图标"))); pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("文件夹"), _T("c:\\"))); m_wndPropList.AddProperty(pGroup3); CMFCPropertyGridProperty* pGroup4 = new CMFCPropertyGridProperty(_T("层次结构")); CMFCPropertyGridProperty* pGroup41 = new CMFCPropertyGridProperty(_T("第一个子级")); pGroup4->AddSubItem(pGroup41); CMFCPropertyGridProperty* pGroup411 = new CMFCPropertyGridProperty(_T("第二个子级")); pGroup41->AddSubItem(pGroup411); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("项 1"), (_variant_t) _T("值 1"), _T("此为说明"))); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("项 2"), (_variant_t) _T("值 2"), _T("此为说明"))); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("项 3"), (_variant_t) _T("值 3"), _T("此为说明"))); pGroup4->Expand(FALSE); m_wndPropList.AddProperty(pGroup4); }
void CPropertiesWnd::InitPropList() { SetPropListFont(); m_wndPropList.EnableHeaderCtrl(FALSE); m_wndPropList.EnableDescriptionArea(); m_wndPropList.SetVSDotNetLook(); m_wndPropList.MarkModifiedProperties(); CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("Вид")); pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("Трехмерный вид"), (_variant_t) false, _T("В окне используется обычный (не жирный) шрифт, а у элементов управления есть визуально трехмерная граница."))); CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty(_T("Граница"), _T("Диалоговое окно"), _T("Одно из значений: \"Нет\", \"Тонкая\", \"Изменяемая\" или \"Диалоговое окно\"")); pProp->AddOption(_T("Нет")); pProp->AddOption(_T("Тонкая")); pProp->AddOption(_T("Изменяемая")); pProp->AddOption(_T("Диалоговое окно")); pProp->AllowEdit(FALSE); pGroup1->AddSubItem(pProp); pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("Заголовок"), (_variant_t) _T("О программе"), _T("Указывает текст, который будет отображаться в строке заголовка окна"))); m_wndPropList.AddProperty(pGroup1); CMFCPropertyGridProperty* pSize = new CMFCPropertyGridProperty(_T("Размер окна"), 0, TRUE); pProp = new CMFCPropertyGridProperty(_T("Высота"), (_variant_t) 250l, _T("Указывает высоту окна")); pProp->EnableSpinControl(TRUE, 50, 300); pSize->AddSubItem(pProp); pProp = new CMFCPropertyGridProperty( _T("Ширина"), (_variant_t) 150l, _T("Указывает ширину окна")); pProp->EnableSpinControl(TRUE, 50, 200); pSize->AddSubItem(pProp); m_wndPropList.AddProperty(pSize); CMFCPropertyGridProperty* pGroup2 = new CMFCPropertyGridProperty(_T("Шрифт")); LOGFONT lf; CFont* font = CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)); font->GetLogFont(&lf); lstrcpy(lf.lfFaceName, _T("Arial")); pGroup2->AddSubItem(new CMFCPropertyGridFontProperty(_T("Шрифт"), lf, CF_EFFECTS | CF_SCREENFONTS, _T("Указывает шрифт окна по умолчанию"))); pGroup2->AddSubItem(new CMFCPropertyGridProperty(_T("Использование системного шрифта"), (_variant_t) true, _T("Указывает, что в окне используется шрифт MS Shell Dlg"))); m_wndPropList.AddProperty(pGroup2); CMFCPropertyGridProperty* pGroup3 = new CMFCPropertyGridProperty(_T("Разное")); pProp = new CMFCPropertyGridProperty(_T("(Имя)"), _T("Приложение")); pProp->Enable(FALSE); pGroup3->AddSubItem(pProp); CMFCPropertyGridColorProperty* pColorProp = new CMFCPropertyGridColorProperty(_T("Цвет окна"), RGB(210, 192, 254), NULL, _T("Указывает цвет окна по умолчанию")); pColorProp->EnableOtherButton(_T("Другое...")); pColorProp->EnableAutomaticButton(_T("По умолчанию"), ::GetSysColor(COLOR_3DFACE)); pGroup3->AddSubItem(pColorProp); static const TCHAR szFilter[] = _T("Файлы значков(*.ico)|*.ico|Все файлы(*.*)|*.*||"); pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("Значок"), TRUE, _T(""), _T("ico"), 0, szFilter, _T("Указывает значок окна"))); pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("Папка"), _T("c:\\"))); m_wndPropList.AddProperty(pGroup3); CMFCPropertyGridProperty* pGroup4 = new CMFCPropertyGridProperty(_T("Иерархия")); CMFCPropertyGridProperty* pGroup41 = new CMFCPropertyGridProperty(_T("Первый подуровень")); pGroup4->AddSubItem(pGroup41); CMFCPropertyGridProperty* pGroup411 = new CMFCPropertyGridProperty(_T("Второй подуровень")); pGroup41->AddSubItem(pGroup411); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("Элемент 1"), (_variant_t) _T("Значение 1"), _T("Это описание"))); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("Элемент 2"), (_variant_t) _T("Значение 2"), _T("Это описание"))); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("Элемент 3"), (_variant_t) _T("Значение 3"), _T("Это описание"))); pGroup4->Expand(FALSE); m_wndPropList.AddProperty(pGroup4); }