void CPropertiesWnd::InitPropList() { SetPropListFont(); m_wndPropList.EnableHeaderCtrl(FALSE); m_wndPropList.EnableDescriptionArea(); m_wndPropList.SetVSDotNetLook(); m_wndPropList.MarkModifiedProperties(); 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 CReflectiveUI::BuildUIForObject(CMFCPropertyGridProperty* root, RTTIObject* pObject, const char* szName ) { CMFCPropertyGridProperty* pRoot = new CMFCPropertyGridProperty(szName); if (root) { root->AddSubItem( pRoot ); } else { m_pGrid->AddProperty(pRoot); } std::vector<BaseProperty*> Properties; pObject->GetRTTI()->EnumProperties( Properties ); for ( size_t i = 0; i < Properties.size(); i++ ) { switch ( Properties[i]->GetTypeID() ) { case eptBool: { AddPropertyToGrid<bool>(pRoot, pObject, Properties[i]); break; } case eptByte: { AddPropertyToGrid<char>(pRoot, pObject, Properties[i]); break; } case eptInt: { AddPropertyToGrid<int>(pRoot, pObject, Properties[i]); break; } case eptShort: { AddPropertyToGrid<short>(pRoot, pObject, Properties[i]); break; } case eptLong : { AddPropertyToGrid<long>(pRoot, pObject, Properties[i]); break; } case eptPtr: { TypedProperty<RTTIObject*>* pTypedProperty = (TypedProperty<RTTIObject*>*)Properties[i]; BuildUIForObject(pRoot , pTypedProperty->GetValue( pObject ) , pTypedProperty->GetName().c_str() ); break; } case eptOgreReal: { AddPropertyToGrid<Ogre::Real>(pRoot, pObject, Properties[i]); break; } case eptOgreString: { AddPropertyToGrid_AsString<Ogre::String>(pRoot, pObject, Properties[i]); break; } case eptOgreVector2: { AddPropertyToGrid_AsString<Ogre::Vector2>(pRoot, pObject, Properties[i]); } break; case eptOgreVector3: { AddPropertyToGrid_AsString<Ogre::Vector3>(pRoot, pObject, Properties[i]); } break; case eptOgreVector4: { AddPropertyToGrid_AsString<Ogre::Vector4>(pRoot, pObject, Properties[i]); } break; case eptOgreColorValue: { TypedProperty<Ogre::ColourValue>* pTypedProperty = (TypedProperty<Ogre::ColourValue>*)Properties[i]; Ogre::ColourValue val = pTypedProperty->GetValue(pObject); CMFCPropertyGridProperty* pGrid = new CMFCPropertyGridColorProperty( pTypedProperty->GetName().c_str() , val.getAsRGBA() , 0 , pTypedProperty->GetDescription().c_str() ); pRoot->AddSubItem( pGrid ); CReflectiveUI::SPropertyObject PO(Properties[i], pObject); _GridPropertyMap[pGrid] = PO; } break; case eptOgreQuaternion: { AddPropertyToGrid_AsString<Ogre::Quaternion>(pRoot, pObject, Properties[i]); } break; case eptOgreMatrix3: { AddPropertyToGrid_AsString<Ogre::Matrix3>(pRoot, pObject, Properties[i]); } break; case eptOgreMatrix4: { AddPropertyToGrid_AsString<Ogre::Matrix4>(pRoot, pObject, Properties[i]); } break; }; } pRoot->Expand(); }
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("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("宋体, 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 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::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); _tcscpy_s(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 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::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); } } }
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 CSeriesPropertyGridCtrl::Init() { CMFCPropertyGridCtrl::Init(); RemoveAll(); //static COleVariant Bool((short)VARIANT_FALSE, VT_BOOL); //static COleVariant Int(0l, VT_I4); //static CString String; //static COLORREF Color; CRect rect; GetClientRect(rect); //add all attribute CAppOption options; StringVector propertyHeader(GetString(IDS_STR_PROPERTY_HEADER), ";|"); m_nLeftColumnWidth = options.GetProfileInt(_T("WeatherChartsPropertiesSplitterPos"), rect.Width() / 2); EnableHeaderCtrl(true, CString(propertyHeader[0].c_str()), CString(propertyHeader[1].c_str())); EnableDescriptionArea(true); SetVSDotNetLook(true); MarkModifiedProperties(true); SetAlphabeticMode(false); SetShowDragContext(true); EnableWindow(true); AlwaysShowUserToolTip(); //General // // StringVector section(IDS_DBEDIT_GRAPH_WEATHER, ";|"); StringVector name(IDS_DBEDIT_GRAPH_WEATHER_PROPERTIES, ";|"); StringVector description(IDS_DBEDIT_GRAPH_WEATHER_DESCRIPTION, ";|"); CMFCPropertyGridProperty* pGroup = new CStdGridProperty(section[0]); ASSERT(name.size() == NB_GRAPH_WEATHER_PROPERTIES); ASSERT(description.size() == NB_GRAPH_WEATHER_PROPERTIES); CMFCPropertyGridProperty* pGraph = new CStdGridProperty(section[1]); pGraph->AddSubItem(new CStdGridProperty(name[TITLE], "", description[TITLE], TITLE)); pGraph->AddSubItem(new CStdGridProperty(name[X_AXIS_TITLE], "", description[X_AXIS_TITLE], X_AXIS_TITLE)); pGraph->AddSubItem(new CStdGridProperty(name[Y_LEFT_AXIS_TITLE], "", description[Y_LEFT_AXIS_TITLE], Y_LEFT_AXIS_TITLE)); pGraph->AddSubItem(new CStdGridProperty(name[Y_RIGHT_AXIS_TITLE], "", description[Y_RIGHT_AXIS_TITLE], Y_RIGHT_AXIS_TITLE)); pGraph->AddSubItem(new CStdBoolGridProperty(name[SHOW_LEGEND], true, description[SHOW_LEGEND], SHOW_LEGEND)); pGroup->AddSubItem(pGraph); CMFCPropertyGridProperty* pSeries = new CStdGridProperty(section[2]); CMFCPropertyGridProperty* pGeneral = new CStdGridProperty(section[3]); pGeneral->AddSubItem(new CWeatherVariableProperty(name[VARIABLE], size_t(H_TAIR2), description[VARIABLE], VARIABLE)); pGeneral->AddSubItem(new CStatisticProperty(name[STATISTIC], WBSF::MEAN, description[STATISTIC], STATISTIC)); pGeneral->AddSubItem(new CSerieTypeProperty(name[SERIE_TYPE], WBSF::MEAN, description[SERIE_TYPE], SERIE_TYPE)); pGeneral->AddSubItem(new CYAxisTypeProperty(name[Y_AXIS], CGraphSerie::LEFT_AXIS, description[Y_AXIS], Y_AXIS)); pGeneral->AddSubItem(new CStdBoolGridProperty(name[ENABLE_SHADOW], false, description[ENABLE_SHADOW], ENABLE_SHADOW)); pGeneral->AddSubItem(new CStdGridProperty(name[SHADOW_DEPTH], 3, description[SHADOW_DEPTH], SHADOW_DEPTH)); pGeneral->AddSubItem(new CStdColorProperty(name[SHADOW_COLOR], RGB(220,220,220), description[SHADOW_COLOR], SHADOW_COLOR)); pSeries->AddSubItem(pGeneral); CMFCPropertyGridProperty* pSymbol = new CStdGridProperty(section[4]); pSymbol->AddSubItem(new CSymbolProperty(name[SYMBOL_TYPE], 0, description[SYMBOL_TYPE], SYMBOL_TYPE)); pSymbol->AddSubItem(new CStdColorProperty(name[SYMBOL_COLOR], RGB(0,0,0), description[SYMBOL_COLOR], SYMBOL_COLOR)); pSymbol->AddSubItem(new CStdGridProperty(name[SYMBOL_SIZE_X], 6, description[SYMBOL_SIZE_X], SYMBOL_SIZE_X)); pSymbol->AddSubItem(new CStdGridProperty(name[SYMBOL_SIZE_Y], 6, description[SYMBOL_SIZE_Y], SYMBOL_SIZE_Y)); pSymbol->AddSubItem(new CStdBoolGridProperty(name[SYMBOL_FILLED], false, description[SYMBOL_FILLED], SYMBOL_FILLED)); pSymbol->AddSubItem(new CStdColorProperty(name[SYMBOL_FILL_COLOR], RGB(255,255,255), description[SYMBOL_FILL_COLOR], SYMBOL_FILL_COLOR)); pSeries->AddSubItem(pSymbol); CMFCPropertyGridProperty* pLine = new CStdGridProperty(section[5]); pLine->AddSubItem(new CLineStyleProperty(name[LINE_STYLE], CGraphSerie::lsNone, description[LINE_STYLE], LINE_STYLE)); pLine->AddSubItem(new CStdColorProperty(name[LINE_COLOR], RGB(0,0,0), description[LINE_COLOR], LINE_COLOR)); pLine->AddSubItem(new CStdGridProperty(name[LINE_WIDTH], 1, description[LINE_WIDTH], LINE_WIDTH)); pLine->AddSubItem(new CStdBoolGridProperty(name[LINE_SMOOTHED], false, description[LINE_SMOOTHED], LINE_SMOOTHED)); pSeries->AddSubItem(pLine); CMFCPropertyGridProperty* pFill = new CStdGridProperty(section[6]); pFill->AddSubItem(new CFillStyleProperty(name[FILL_STYLE], 0, description[FILL_STYLE], FILL_STYLE)); pFill->AddSubItem(new CFillDirectionProperty(name[FILL_DIRECTION], CGraphSerie::FILL_BOTTOM, description[FILL_DIRECTION], FILL_DIRECTION)); pFill->AddSubItem(new CStdColorProperty(name[FILL_COLOR], RGB(220,220,220), description[FILL_COLOR], FILL_COLOR)); pSeries->AddSubItem(pFill); CMFCPropertyGridProperty* pHist = new CStdGridProperty(section[7]); pHist->AddSubItem(new CHistDirectionProperty(name[HIST_DIRECTION], 0, description[HIST_DIRECTION], HIST_DIRECTION)); pHist->AddSubItem(new CStdGridProperty(name[HIST_BAR_WIDTH], 12, description[HIST_BAR_WIDTH], HIST_BAR_WIDTH)); pHist->AddSubItem(new CStdColorProperty(name[HIST_BAR_COLOR], RGB(0,100,255), description[HIST_BAR_COLOR], HIST_BAR_COLOR)); pHist->AddSubItem(new CStdGridProperty(name[HIST_BORDER_WIDTH], 1, description[HIST_BORDER_WIDTH], HIST_BORDER_WIDTH)); pHist->AddSubItem(new CStdColorProperty(name[HIST_BORDER_COLOR], RGB(0,0,0), description[HIST_BORDER_COLOR], HIST_BORDER_COLOR)); pSeries->AddSubItem(pHist); pGroup->AddSubItem(pSeries); AddProperty(pGroup); }
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("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); }
BOOL CDlgOMLEditOption::OnInitDialog() { CResizablePage::OnInitDialog(); // TODO: 在此添加额外的初始化 if(m_wndPropertyGrid.GetSafeHwnd() == 0) { if (!m_wndPropertyGrid.Create(WS_VISIBLE | WS_CHILD, CRect(0, 0, 0, 0), this, 2)) { TRACE0("未能创建属性网格\n"); return FALSE; // 未能创建 } m_wndPropertyGrid.SetOwner(this); m_wndPropertyGrid.EnableHeaderCtrl(FALSE); m_wndPropertyGrid.EnableDescriptionArea(); m_wndPropertyGrid.SetVSDotNetLook(); m_wndPropertyGrid.MarkModifiedProperties(); //设置输入提示路径 CMFCPropertyGridProperty* pPropertyHintFile = new CMFCPropertyGridProperty(_T("编辑配置文件")); static TCHAR BASED_CODE szFilter[] = _T("提示文件(*.ohc)|*.ohc|所有文件(*.*)|*.*||"); CMFCPropertyGridFileProperty* pPropertySyntaxWordFileName= new CMFCPropertyGridFileProperty(_T("语法字文件"), TRUE, _T(""), _T("ohc"), 0, szFilter, _T("语法字配置文件")); pPropertySyntaxWordFileName->SetValue(COleVariant(m_strOMLSyntaxWordFileName)); pPropertyHintFile->AddSubItem(pPropertySyntaxWordFileName); CMFCPropertyGridFileProperty* pPropertySelectionListFile = new CMFCPropertyGridFileProperty(_T("选择列表文件"), TRUE, _T(""), _T("ohc"), 0, szFilter, _T("选择列表配置文件")); pPropertySelectionListFile->SetValue(COleVariant(m_strOMLSelectionListFileName)); pPropertyHintFile->AddSubItem(pPropertySelectionListFile); pPropertyHintFile->AddSubItem(new CMFCPropertyGridFileProperty(_T("模板文件目录"), m_strOMLTempletDir,0,_T("代码模板文件所在的目录"))); CMFCPropertyGridFileProperty* pPropertyAutoCompleteFile = new CMFCPropertyGridFileProperty(_T("输入提示文件"), TRUE, _T(""), _T("ohc"), 0, szFilter, _T("输入自动完成提示配置文件")); pPropertyAutoCompleteFile->SetValue(COleVariant(m_strOMLAutoCompleteFileName)); pPropertyHintFile->AddSubItem(pPropertyAutoCompleteFile); CMFCPropertyGridFileProperty* pPropertyTipFile = new CMFCPropertyGridFileProperty(_T("提示信息文件"), TRUE, _T(""), _T("ohc"), 0, szFilter, _T("提示信息配置文件")); pPropertyTipFile->SetValue(COleVariant(m_strOMLTipFileName)); pPropertyHintFile->AddSubItem(pPropertyTipFile); m_wndPropertyGrid.AddProperty(pPropertyHintFile); COLORREF colorDefaultBackGround = ::GetSysColor(COLOR_WINDOW); COLORREF colorDefaultText = ::GetSysColor(COLOR_WINDOWTEXT); //设置语法颜色 CMFCPropertyGridProperty* pPropertySyntaxHighLight = new CMFCPropertyGridProperty(_T("语法着色")); CMFCPropertyGridColorProperty* pPropColor = NULL; #define SyntaxHighLightAddSubItem(name,color,default_color,description) \ pPropColor = new CMFCPropertyGridColorProperty(name, color, NULL, description); \ pPropColor->EnableOtherButton(_T("其他...")); \ pPropColor->EnableAutomaticButton(_T("默认"), default_color); \ pPropertySyntaxHighLight->AddSubItem(pPropColor); SyntaxHighLightAddSubItem((_T("背景颜色")), m_colorBackGround, (colorDefaultBackGround),(_T("默认的背景颜色"))); SyntaxHighLightAddSubItem((_T("文本颜色")), m_colorText, (colorDefaultText), (_T("默认的文本颜色"))); SyntaxHighLightAddSubItem((_T("注释行颜色")), m_colorCommentLine, (RGB(0x00, 0x80, 0x00)), (_T("注释行的文本颜色"))); SyntaxHighLightAddSubItem((_T("注释块颜色")), m_colorCommentBlock, (RGB(0x00, 0x80, 0x00)), (_T("注释块的文本颜色"))); SyntaxHighLightAddSubItem((_T("数字颜色")), m_colorDigital, (RGB(0x00, 0x80, 0x80)), (_T("数字字符的颜色"))); SyntaxHighLightAddSubItem((_T("单字符颜色")), m_colorChar, (RGB(0xC0, 0x20, 0x00)), (_T("单字符的颜色"))); SyntaxHighLightAddSubItem((_T("字符串颜色")), m_colorString, (RGB(0xC0, 0x20, 0x00)), (_T("字符串的颜色"))); SyntaxHighLightAddSubItem((_T("关键字")), m_colorKeyWord, (RGB(0x25, 0x09, 0xF3)), (_T("定义字的颜色"))); SyntaxHighLightAddSubItem((_T("宏标识符颜色")), m_colorMacro, (RGB(0x80, 0x00, 0x39)), (_T("宏标识符的颜色"))); SyntaxHighLightAddSubItem((_T("操作符颜色")), m_colorOperator, (RGB(0x80, 0x80, 0x00)), (_T("操作符的颜色"))); #undef SyntaxHighLightAddSubItem m_wndPropertyGrid.AddProperty(pPropertySyntaxHighLight); //字体 CMFCPropertyGridProperty* pPropertyFont = new CMFCPropertyGridProperty(_T("字体")); pPropertyFont->AddSubItem(new CMFCPropertyGridFontProperty(_T("文本字体"), m_lfTextFont, CF_EFFECTS | CF_SCREENFONTS, _T("指定文本字体"))); m_wndPropertyGrid.AddProperty(pPropertyFont); //左边附加栏 CMFCPropertyGridProperty* pPropertyExtraColumn = new CMFCPropertyGridProperty(_T("附加栏")); pPropertyExtraColumn->AddSubItem(new CMFCPropertyGridProperty(_T("显示行号"), (_variant_t)(m_bShowLineNumber?true:false), _T("显示行号"))); pPropertyExtraColumn->AddSubItem(new CMFCPropertyGridProperty(_T("显示书签"), (_variant_t)(m_bShowBookMarker?true:false), _T("显示书签栏"))); pPropertyExtraColumn->AddSubItem(new CMFCPropertyGridProperty(_T("显示折叠"), (_variant_t)(m_bShowFold?true:false), _T("显示折叠栏"))); m_wndPropertyGrid.AddProperty(pPropertyExtraColumn); //保存 CMFCPropertyGridProperty* pPropertySave = new CMFCPropertyGridProperty(_T("保存")); pPropertySave->AddSubItem(new CMFCPropertyGridProperty(_T("自动保存"), (_variant_t)(m_bAutoSave?true:false), _T("文档被修改后10秒自动保存"))); m_wndPropertyGrid.AddProperty(pPropertySave); } return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE }
void CPropertiesWnd::InitPropList() { SetPropListFont(); m_wndPropList.EnableHeaderCtrl(FALSE); m_wndPropList.EnableDescriptionArea(); m_wndPropList.SetVSDotNetLook(); m_wndPropList.MarkModifiedProperties(); CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("Basic Info")); m_CommitHash = new CMFCPropertyGridProperty( _T("Commit Hash"), _T(""), _T("Commit Hash") ); pGroup1->AddSubItem(m_CommitHash); m_AuthorName = new CMFCPropertyGridProperty( _T("Author"), _T(""), _T("Author") ); pGroup1->AddSubItem(m_AuthorName); m_AuthorDate = new CMFCPropertyGridProperty( _T("Author Date"), _T(""), _T("Author Date") ); pGroup1->AddSubItem(m_AuthorDate); m_AuthorEmail= new CMFCPropertyGridProperty( _T("Author Email"), _T(""), _T("Author Email") ); pGroup1->AddSubItem(m_AuthorEmail); m_CommitterName = new CMFCPropertyGridProperty( _T("Committer Name"), _T(""), _T("Committer Name") ); pGroup1->AddSubItem(m_CommitterName); m_CommitterEmail =new CMFCPropertyGridProperty( _T("Committer Email"), _T(""), _T("Committer Email") ); pGroup1->AddSubItem(m_CommitterEmail); m_CommitterDate = new CMFCPropertyGridProperty( _T("Committer Date"), _T(""), _T("Committer Date") );; pGroup1->AddSubItem(m_CommitterDate); m_Subject = new CMFCPropertyGridProperty( _T("Subject"), _T(""), _T("Subject") );;; pGroup1->AddSubItem(m_Subject); m_Body = new CMFCPropertyGridProperty( _T("Body"), _T(""), _T("Body") );;;; pGroup1->AddSubItem(m_Body); for(int i=0;i<pGroup1->GetSubItemsCount();i++) { pGroup1->GetSubItem(i)->AllowEdit(FALSE); } //std::vector<CMFCPropertyGridProperty*> m_ParentHash; //std::vector<CMFCPropertyGridProperty*> m_ParentSubject; m_wndPropList.AddProperty(pGroup1); m_BaseInfoGroup=pGroup1; m_ParentGroup=new CMFCPropertyGridProperty(_T("Parent")); m_wndPropList.AddProperty(m_ParentGroup); #if 0 pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("Caption"), (_variant_t) _T("About"), _T("Specifies the text that will be displayed in the window's title bar"))); 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, 0, 1000); pSize->AddSubItem(pProp); pProp = new CMFCPropertyGridProperty( _T("Width"), (_variant_t) 150l, _T("Specifies the window's width")); pProp->EnableSpinControl(); 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 TCHAR BASED_CODE 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); #endif }
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); }