VOID CAboutDlg::SetCtrlFont(INT IDC_STATIC_CTRL,UINT nFontSize) { CStatic *pStatic = reinterpret_cast<CStatic *>(GetDlgItem(IDC_STATIC_CTRL)); ASSERT(pStatic); CFont pFont; VERIFY(pFont.CreateFont( nFontSize, // nHeight 0, // nWidth 0, // nEscapement 0, // nOrientation FW_BLACK, // nWeight FALSE, // bItalic FALSE, // bUnderline FALSE, // cStrikeOut ANSI_CHARSET, // nCharSet OUT_DEFAULT_PRECIS, // nOutPrecision CLIP_DEFAULT_PRECIS, // nClipPrecision DEFAULT_QUALITY, // nQuality DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily _T("Microsoft Sans Serif"))); // lpszFacename pStatic->SetFont(&pFont, TRUE); }
void CHotelDialog::OnShowWindow(BOOL bShow, UINT nStatus) { CDialog::OnShowWindow(bShow, nStatus); if ( bShow ) { if ( m_hotelInfo && (m_numOfHotelInfo > 0) ) { CEdit *ep; ep = (CEdit *)GetDlgItem( IDC_EDIT_SID ); ep->SetWindowText( m_sid ); ep = (CEdit *)GetDlgItem( IDC_EDIT_PID ); ep->SetWindowText( m_pid ); m_currentHotelInfo = 1; showHotelInfo(); } } LOGFONT tLogFont; CFont *cWndFont; cWndFont = GetFont(); cWndFont->GetLogFont( &tLogFont ); tLogFont.lfUnderline = 1; m_cFont.CreateFontIndirect( &tLogFont ); CStatic *s = (CStatic *)GetDlgItem( IDC_AFFILIATE_URL ); s->SetFont( &m_cFont, TRUE ); }
BOOL CAboutDlg::OnInitDialog() { CDialog::OnInitDialog(); // IDC_STATIC_APPNAME 的字体变粗 CStatic *pStatic = (CStatic*)GetDlgItem(IDC_STATIC_APPNAME); LOGFONT LogFont; pStatic->GetFont()->GetLogFont(&LogFont); LogFont.lfWeight = FW_BOLD; m_AppNameFont.CreateFontIndirect(&LogFont); pStatic->SetFont(&m_AppNameFont); // 设置文本 pStatic = (CStatic*)GetDlgItem(IDC_STATIC_APPNAME); pStatic->SetWindowText(FormatString(TEXT("%s v%s"), APP_NAME, APP_VERSION)); // 创建图标 m_EmailIcon.Create(NULL, WS_CHILD | WS_VISIBLE | SS_ICON, CRect(62, 86, 0, 0), this); HICON hIcon = (HICON)::LoadImage(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_ICON_EMAIL), IMAGE_ICON, 16, 16, 0); m_EmailIcon.SetIcon(hIcon); m_HomepageIcon.Create(NULL, WS_CHILD | WS_VISIBLE | SS_ICON, CRect(62, 105, 0, 0), this); hIcon = (HICON)::LoadImage(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_ICON_HOMEPAGE), IMAGE_ICON, 16, 16, 0); m_HomepageIcon.SetIcon(hIcon); // 设置超链接 m_EmailLink.SetWindowText(APP_EMAIL); m_EmailLink.SetUrl(CString(TEXT("mailto:")) + APP_EMAIL); m_HomepageLink.SetWindowText(APP_HOMEPAGE); m_HomepageLink.SetUrl(APP_HOMEPAGE); return TRUE; }
LRESULT CPropertyView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { RECT rcClient; GetClientRect(&rcClient); m_ctrlToolbar.SubclassWindow( CFrameWindowImplBase<>::CreateSimpleToolBarCtrl(m_hWnd, IDR_TB_PROPVIEW, FALSE, ATL_SIMPLE_TOOLBAR_STYLE | CCS_NODIVIDER | CCS_NOPARENTALIGN | TBSTYLE_FLAT) ); m_ctrlToolbar.LoadTrueColorToolBar(IDR_TB1_PROPVIEW); m_ctrlToolbar.MoveWindow(0,0, rcClient.right - rcClient.left, 10); m_ctrlComboBox.SubclassWindow(GetDlgItem(IDC_COMBO)); m_ctrlComboBox.SetMultiSelection(); m_ctrlComboBox.LoadStatesBitmap(IDB_COMBO_ICONS, IDB_COMBO_ICONS); m_ctrlComboBox.AddIcon("Icon"); static CFont font; CLogFont lf = GetFont(); lf.SetBold(); font.CreateFontIndirect(&lf); CStatic ctrlTitle = GetDlgItem(IDC_TITLE); ctrlTitle.SetFont(font); m_ctrlList.SubclassWindow(GetDlgItem(IDC_LIST)); m_ctrlList.SetExtendedListStyle(PLS_EX_CATEGORIZED | PLS_EX_XPLOOK); // Set the minimum width and height of the content m_nMinWidth = 100; m_nMinHeight = 120; m_hWndLinked = NULL; DlgResize_Init(false, true, WS_CLIPCHILDREN); return TRUE; }
// VerConfig 消息处理程序 BOOL VerConfig::OnInitDialog() { CDialog::OnInitDialog(); CStatic *hStatic; CString strout; static CFont font; font.CreatePointFont(100, font_list[font_index]); hStatic = (CStatic*)GetDlgItem(IDC_STATIC_VERCFG); strout.Format(""); strout.Format(strout + "SAVE_TICK %d\n", SAVE_TICK); strout.Format(strout + "CONFIG_MAX_AUTO_MAIL %d\n", CONFIG_MAX_AUTO_MAIL); strout.Format(strout + "PROGRAM_VERSION %s\n", PROGRAM_VERSION); strout.Format(strout + "EMAIL_TITLE %s\n", EMAIL_TITLE); strout.Format(strout + "PROGRAM_TITLE %s\n", PROGRAM_TITLE); hStatic->SetFont(&font); hStatic->SetWindowText(strout); SetWindowText("软件配置信息"); return true; }
void CFontasticDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Center icon in client rectangle int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon dc.DrawIcon(x, y, m_hIcon); } else { CFont fTemp; CStatic *pStatic = (CStatic *)GetDlgItem(IDC_PREVIEW); fTemp.CreateFontIndirect(&gFont); pStatic->SetFont(&fTemp); CDialog::OnPaint(); } }
void CZhfPalette::AddControls() { acDocManager->lockDocument(curDoc(), AcAp::kWrite, NULL, NULL, true) ; CRect rect ; GetClientRect(&rect) ; int iWidth = rect.Width() ; int iHeight = rect.Height() ; CFont * pFont = new CFont; pFont->CreateFont(14, // nHeight 0, // nWidth 0, // nEscapement 0, // nOrientation FW_NORMAL , // nWeight FALSE, // bItalic FALSE, // bUnderline 0, // cStrikeOut ANSI_CHARSET, // nCharSet OUT_DEFAULT_PRECIS, // nOutPrecision CLIP_DEFAULT_PRECIS, // nClipPrecision DEFAULT_QUALITY, // nQuality DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily _T("Arial")); // lpszFac int iIndex = 0 ; int iCount = m_strArrayFile.GetCount() ; for (int i=0; i<iCount; i++) { CString strFile = m_strArrayFile.GetAt(i) ; CGsPreviewCtrl* pCtrl = new CGsPreviewCtrl() ; pCtrl->m_iIndex = iIndex ; pCtrl->m_strDwgFile = strFile ; m_pArrayPreviewCtrl.Add(pCtrl) ; pCtrl->Create(_T(""), WS_CHILD|WS_VISIBLE|SS_CENTER|SS_SUNKEN, CRect(10, 10, 110, 110), this) ; AcDbDatabase* pDbSrc = new AcDbDatabase(false) ; if(Acad::eOk==pDbSrc->readDwgFile(strFile)) { AcDbDatabase* pDbTo = new AcDbDatabase() ; this->Wblock(pDbSrc, pDbTo) ; this->FilterDb(pDbTo, m_nArrayFilterMode.GetAt(i)) ; pCtrl->SetDatabase(pDbTo); } delete pDbSrc ; CStatic* pCtrlStatic = new CStatic() ; CString strFileName ; strFileName.Format(_T("%s"), m_strArrayFileName.GetAt(i)) ; m_pArrayStatic.Add(pCtrlStatic) ; pCtrlStatic->Create(strFileName, WS_CHILD|WS_VISIBLE|SS_CENTER, CRect(10, 10, 40, 110), this) ; pCtrlStatic->SetFont(pFont) ; iIndex++ ; } acDocManager->unlockDocument(curDoc()) ; this->OnSize(0, iWidth, iHeight) ; }
void COpPropertyDlg::addLabel(RECT &client, const std::string &str) { CStatic *label = new CStatic; string tmp = str; if (!tmp.empty()) tmp[0] = toupper (tmp[0]); label->Create (tmp.c_str(), WS_CHILD|SS_LEFT|SS_CENTERIMAGE|WS_VISIBLE, client, this); label->SetFont (GetFont()); Others.push_back(label); }
HRESULT CPropertyEditWindow::CreatePropertyLabel(DWORD dwPropertyInfoIndex, CAtlStringW strLabelText, RECT& rectLabel) { HRESULT hr = S_OK; CStatic* pStatic = new CStatic(); CHECK_ALLOC( pStatic ); pStatic->Create(m_hWnd, &rectLabel, strLabelText, WS_CHILD | WS_VISIBLE); pStatic->SetFont(m_hLabelFont); m_arrPropertyInfoDisplay[dwPropertyInfoIndex]->m_arrLabels.Add(pStatic); Cleanup: return hr; }
void CAboutDlg::OnShowWindow(BOOL bShow, UINT nStatus) { CDialog::OnShowWindow(bShow, nStatus); if ( bShow ) { // Web の URLとメールアドレスを下線付きで表示する LOGFONT tLogFont; CFont *cWndFont; cWndFont = GetFont(); cWndFont->GetLogFont( &tLogFont ); tLogFont.lfUnderline = 1; m_cFont.CreateFontIndirect( &tLogFont ); CStatic *s = (CStatic *)GetDlgItem( IDC_JBOOKLET_MAIL_ADDR ); s->SetFont( &m_cFont, TRUE ); s = (CStatic *)GetDlgItem( IDC_JBOOKLET_WEB_URL ); s->SetFont( &m_cFont, TRUE ); CString str; str.LoadString( IDS_JBOOKLET_VERSION ); str = "JBOOKlet Version " + str; s = (CStatic *)GetDlgItem( IDC_JBOOKLET_VERSION ); s->SetWindowText( str ); // OpenSSL 版数表示 char buf[BUFSIZ]; size_t sz = BUFSIZ; s = (CStatic *)GetDlgItem( IDC_OPENSSL ); s->SetWindowText( getOpenSSLversion( buf, sz ) ); // iconv 版数表示 s = (CStatic *)GetDlgItem( IDC_ICONV ); s->SetWindowText( getIconvVersion( buf, sz ) ); } }
BOOL CPPgWiz1Welcome::OnInitDialog() { CFont fontVerdanaBold; CreatePointFont(fontVerdanaBold, 12*10, _T("Verdana Bold")); LOGFONT lf; fontVerdanaBold.GetLogFont(&lf); lf.lfWeight = FW_BOLD; m_FontTitle.CreateFontIndirect(&lf); CStatic* pStatic = (CStatic*)GetDlgItem(IDC_WIZ1_TITLE); pStatic->SetFont(&m_FontTitle); CDlgPageWizard::OnInitDialog(); InitWindowStyles(this); GetDlgItem(IDC_WIZ1_TITLE)->SetWindowText(GetResString(IDS_WIZ1_WELCOME_TITLE)); GetDlgItem(IDC_WIZ1_ACTIONS)->SetWindowText(GetResString(IDS_WIZ1_WELCOME_ACTIONS)); GetDlgItem(IDC_WIZ1_BTN_HINT)->SetWindowText(GetResString(IDS_WIZ1_WELCOME_BTN_HINT)); return TRUE; }
// 現在の「設定」を取得 void CSettingHatenaHaiku::LoadSetting() { if ( !m_initialized ) { if ( m_chirrup ) { TIMELINE_INFO sFriendsTimeline; TIMELINE_INFO sPublicTimeline; TIMELINE_INFO sUserTimeline; m_chirrup->GetHatenaHaiku( m_username, m_password, m_checkMultiPost, sFriendsTimeline, sPublicTimeline, sUserTimeline ); getTimelineInfo( sFriendsTimeline, m_logFile_friendsTimeline, m_checkFriendsTimeline, m_checkLogFileFriendsTimeline ); getTimelineInfo( sPublicTimeline, m_logFile_publicTimeline, m_checkPublicTimeline, m_checkLogFilePublicTimeline ); getTimelineInfo( sUserTimeline, m_logFile_userTimeline, m_checkUserTimeline, m_checkLogFileUserTimeline ); } LOGFONT tLogFont; CFont *cWndFont; cWndFont = GetFont(); cWndFont->GetLogFont( &tLogFont ); tLogFont.lfUnderline = 1; m_cFont.CreateFontIndirect( &tLogFont ); CStatic *s = (CStatic *)GetDlgItem( IDC_URL_HATENAHAIKU_SETTING ); s->SetFont( &m_cFont, TRUE ); } }
void CModifyDlg::CreateCtrl() { CRect rcClient; GetClientRect(&rcClient); int top = rcClient.top + TOPINCREMENT; int Left = rcClient.left + LEFTINCREMENT; CRect CTRRECT; if (PUBLIC == m_tableType || INCODE == m_tableType){ for (int i = 0;i < m_vHead.size();i++){ CStatic *Static = new CStatic; CTRRECT = SetCtrlPos(Left,top,88,CTRLHEIGHT); Static->Create(m_vHead[i],WS_CHILD|WS_VISIBLE,CTRRECT,this); Static->SetFont(GetFont()); Left += 88 + HINCREMENT; CEdit *Edit = new CEdit; CTRRECT = SetCtrlPos(Left,top - 3,380,EDITHEIGHT); Edit->Create(WS_CHILD|WS_VISIBLE|WS_TABSTOP|WS_BORDER|ES_MULTILINE|ES_AUTOVSCROLL,CTRRECT,this,IDC_MODIFY_EDIT); Edit->SetFont(GetFont()); Edit->SetWindowText(m_vData[i]); top += VINCREMENT + CTRLHEIGHT ; Left = rcClient.left + LEFTINCREMENT; if (i == 0){ Static->EnableWindow(FALSE); Edit->EnableWindow(FALSE); } if (i == m_vHead.size()-1 && INCODE == m_tableType) { CStatic *Static1 = new CStatic; CTRRECT = SetCtrlPos(Left,top,450,CTRLHEIGHT); Static1->Create("调度规则 1:最大空闲时间调度 2:最短会话时间调度 3:最高优先级调度",WS_CHILD|WS_VISIBLE,CTRRECT,this); Static1->SetFont(GetFont()); m_StaticObject.push_back(Static1); } m_StaticObject.push_back(Static); m_EidtObject.push_back(Edit); } } if (TP == m_tableType) SetTPRuleCtrl(); }
// add text to the specified column of this row void CCustomListRowWnd::AddText(INT32 col, CString text) { ASSERT(m_ColumnObjects[col] == NULL); CStatic* pStat = new CStatic(); m_ColumnObjects[col] = pStat ; CRect cr; GetClientRect(&cr); CRect srect; srect.left= m_Parent->m_Parent->m_ColumnOffsetsArray[col] ; if( col < CCustomList::MAXCOLUMNS && m_Parent->m_Parent->m_ColumnOffsetsArray[col + 1] > 0) srect.right= m_Parent->m_Parent->m_ColumnOffsetsArray[col + 1] ; else srect.right= cr.right; srect.top = (CCustomList::ROWHEIGHT - CCustomList::FONTHEIGHT)/2; srect.bottom = srect.top + CCustomList::FONTHEIGHT; pStat->Create(text, WS_CHILD|WS_VISIBLE|WS_EX_LEFT, srect, this); pStat->SetFont(&m_Parent->m_Font); }
HRESULT CPropertyEditWindow::CreateTitle(DWORD dwPropertyInfoIndex, RECT& labelRect) { HRESULT hr = S_OK; LPWSTR szName = NULL; TED_ATTRIBUTE_CATEGORY Category; IFC( m_arrPropertyInfo[dwPropertyInfoIndex]->GetPropertyInfoName(&szName, &Category) ); CStatic* pStatic = new CStatic(); CHECK_ALLOC( pStatic ); pStatic->Create(m_hWnd, &labelRect, szName, WS_CHILD | WS_VISIBLE); pStatic->SetFont(m_hLabelFont); m_arrTitles.Add(pStatic); labelRect.top += ms_LabelHeight; labelRect.bottom += ms_LabelHeight; Cleanup: CoTaskMemFree(szName); return hr; }
BOOL CModelInputDlg::Create(const CModelInputParameterDefVector& variables, const CRect& rectMI, const CString& modelName, CWnd* pParentWnd, bool bForTest) { BOOL rep = false; ResetCtrl(); m_variables = variables; CRect rectDlg(rectMI); CAppOption option; option.SetCurrentProfile(_T("ModelsWindowsPosition")); CPoint defaultPos = option.GetProfilePoint(modelName, CPoint(430, 0)); option.SetCurrentProfile(_T("WindowsPosition")); defaultPos += option.GetProfilePoint(_T("ModelInputEditor"), CPoint(30, 30)); rectDlg += defaultPos; UtilWin::EnsureRectangleOnDisplay(rectDlg); CWinApp* pApp = AfxGetApp(); CString strWndClass = AfxRegisterWndClass( 0, pApp->LoadStandardCursor(IDC_ARROW), (HBRUSH)(COLOR_3DFACE + 1), pApp->LoadIcon(IDI_HEART)); if (bForTest) rep = CWnd::CreateEx(WS_EX_CLIENTEDGE, strWndClass, modelName, WS_DLGFRAME | WS_OVERLAPPED | WS_BORDER | WS_CAPTION | WS_VISIBLE | WS_SYSMENU, rectDlg, pParentWnd, NULL, NULL); else rep = CWnd::CreateEx(WS_EX_CLIENTEDGE, strWndClass, modelName, WS_DLGFRAME | WS_OVERLAPPED | WS_BORDER | WS_CAPTION | WS_VISIBLE, rectDlg, pParentWnd, NULL, NULL); CFont* pFont = CFont::FromHandle((HFONT)GetStockObject(DEFAULT_GUI_FONT)); // SYSTEM_FONT ANSI_VAR_FONT for (size_t i = 0; i < m_variables.size(); i++) { //create title CStatic* pStatic = (CStatic*) new CStatic; CRect rect = m_variables[i].GetItemRect(0); //rect.top += 3; //rect.bottom += 3; pStatic->Create(CString(m_variables[i].m_caption.c_str()), WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, rect, this, IDC_STATIC); pStatic->SetFont(pFont); m_titleCtrlArray.Add(pStatic); //create control switch (m_variables[i].GetType()) { case CModelInputParameterDef::kMVBool: { CCFLComboBox* pCombo = (CCFLComboBox*) new CCFLComboBox; CRect rect = m_variables[i].GetItemRect(1); rect.bottom += 3 * rect.Height(); pCombo->Create(WS_TABSTOP | WS_BORDER | WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST, rect, this, GetID(i)); pCombo->SetFont(pFont); CString str; str.LoadString(IDS_STR_YES); pCombo->AddString(str); str.LoadString(IDS_STR_NO); pCombo->AddString(str); m_varCtrlArray.Add(pCombo); break; } case CModelInputParameterDef::kMVInt: { CIntEdit* pIntEdit = (CIntEdit*) new CIntEdit; CRect rect = m_variables[i].GetItemRect(1); pIntEdit->CreateEx(WS_EX_CLIENTEDGE, _T("EDIT"), NULL, WS_TABSTOP | WS_CHILD | WS_VISIBLE | WS_BORDER, rect, this, GetID(i)); pIntEdit->SetFont(pFont); m_varCtrlArray.Add(pIntEdit); break; } case CModelInputParameterDef::kMVReal: { CFloatEdit* pFloatEdit = (CFloatEdit*) new CFloatEdit; CRect rect = m_variables[i].GetItemRect(1); pFloatEdit->CreateEx(WS_EX_CLIENTEDGE, _T("EDIT"), NULL, WS_TABSTOP | WS_CHILD | WS_VISIBLE | WS_BORDER, rect, this, GetID(i)); pFloatEdit->SetFont(pFont); m_varCtrlArray.Add(pFloatEdit); break; } case CModelInputParameterDef::kMVString: { CCFLEdit* pEdit = (CCFLEdit*) new CCFLEdit; CRect rect = m_variables[i].GetItemRect(1); pEdit->CreateEx(WS_EX_CLIENTEDGE, _T("EDIT"), NULL, WS_TABSTOP | WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL, rect, this, GetID(i)); pEdit->SetFont(pFont); m_varCtrlArray.Add(pEdit); break; } case CModelInputParameterDef::kMVFile: { CModelInputBrowseCtrl* pEdit = new CModelInputBrowseCtrl; pEdit->m_appPath = m_appPath; pEdit->m_projectPath = m_projectPath; CRect rect = m_variables[i].GetItemRect(1); pEdit->Create(WS_TABSTOP | WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL, rect, this, GetID(i)); pEdit->EnableFileBrowseButton(); pEdit->SetFont(pFont); m_varCtrlArray.Add(pEdit); break; } case CModelInputParameterDef::kMVListByPos: case CModelInputParameterDef::kMVListByString: case CModelInputParameterDef::kMVListByCSV: { //int defPos = WBSF::ToInt(m_variables[i].m_default); //if (CModelInputParameterDef::kMVListByCSV) StringVector listOfValues = m_variables[i].GetList(GetFM().GetAppPath(), GetFM().GetProjectPath()); bool bFromFile = m_variables[i].IsExtendedList();//listOfValues[0] == "FROM_CSV_FILE" && listOfValues.size() == 4; CCFLComboBox* pCombo = (CCFLComboBox*) new CCFLComboBox; CRect rect = m_variables[i].GetItemRect(1); rect.bottom += 10 * rect.Height(); UINT style = bFromFile ? WS_TABSTOP | WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT : WS_TABSTOP | WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST; pCombo->Create(style, rect, this, GetID(i)); pCombo->SetFont(pFont); pCombo->SetExtendedUI(true); /*if (bFromFile) { string filePath = CModelInput::SpecialPath2FilePath(listOfValues[1], m_appPath, m_projectPath); int col = WBSF::ToInt(listOfValues[2]); listOfValues.clear(); ifStream file; if (file.open(filePath)) { for (CSVIterator loop(file, ",; \t"); loop != CSVIterator(); ++loop) { if (col < loop.Header().size() && col < (*loop).size()) { listOfValues.push_back((*loop)[col]); } } } }*/ for (size_t pos = 0; pos < listOfValues.size(); pos++) { int index = pCombo->AddString(CString(listOfValues[pos].c_str())); pCombo->SetItemData(index, pos); } if (m_variables[i].GetType() == CModelInputParameterDef::kMVListByPos) pCombo->SetCurSel(WBSF::ToInt(m_variables[i].m_default)); else pCombo->SelectStringExact(0, m_variables[i].m_default); m_varCtrlArray.Add(pCombo); break; } case CModelInputParameterDef::kMVTitle: case CModelInputParameterDef::kMVStaticText: { CTitleCtrl* pStatic = (CTitleCtrl*) new CTitleCtrl; CRect rect = m_variables[i].GetItemRect(1); pStatic->Create(CString(m_variables[i].m_caption.c_str()), WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, rect, this, IDC_STATIC); if (m_variables[i].GetType() == CModelInputParameterDef::kMVStaticText) pStatic->SetFont(pFont); m_varCtrlArray.Add(pStatic); break; } case CModelInputParameterDef::kMVLine: { CStaticLineCtrl* pStatic = (CStaticLineCtrl*) new CStaticLineCtrl;//hiden control CRect rect = m_variables[i].GetItemRect(1); //rect.bottom = rect.top + 5; pStatic->Create(_T(""), WS_CHILD | WS_VISIBLE, rect, this, IDC_STATIC); m_varCtrlArray.Add(pStatic); break; } default: ASSERT(false); } } Invalidate(); return rep; }
LRESULT CAboutDialog::OnInitDialog(HWND hWnd, LPARAM lParam) { BOOL fSuccess = FALSE; CenterWindow(GetParent()); m_wndHyperLink.SubclassWindow(GetDlgItem(IDC_LINK)); CString strHyperLink; strHyperLink.LoadString(IDS_ABOUTDLG_HYPERLINK); m_wndHyperLink.SetHyperLink(strHyperLink); CString strAppVer, strProdVer; pGetVersionStrings(strAppVer, strProdVer); CString strProdVerText; TCHAR szProdVerFmt[256] = {0}; CStatic wndProdVer; wndProdVer.Attach(GetDlgItem(IDC_PRODVER)); wndProdVer.GetWindowText(szProdVerFmt, 256); strProdVerText.FormatMessage(szProdVerFmt, strProdVer); wndProdVer.SetWindowText(strProdVerText); CStatic wndProdName; wndProdName.Attach(GetDlgItem(IDC_PRODNAME)); wndProdName.SetFont(pGetTitleFont()); CListViewCtrl wndListView(GetDlgItem(IDC_COMPVER)); CString colName[2]; fSuccess = colName[0].LoadString(IDS_ABOUTDLG_COL_COMPONENT); ATLASSERT(fSuccess); fSuccess = colName[1].LoadString(IDS_ABOUTDLG_COL_VERSION); ATLASSERT(fSuccess); wndListView.AddColumn(colName[0], 0); wndListView.AddColumn(colName[1], 1); wndListView.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT); CString strAppTitle; strAppTitle.LoadString(IDS_MAIN_TITLE); wndListView.AddItem(0, 0, strAppTitle); wndListView.SetItemText(0, 1, strAppVer); CRect rcListView; wndListView.GetClientRect(rcListView); wndListView.SetColumnWidth(0, LVSCW_AUTOSIZE); wndListView.SetColumnWidth(1, rcListView.Width() - wndListView.GetColumnWidth(0)); // // Image Header // m_pix.LoadFromResource( _Module.GetResourceInstance(), IDB_ABOUT_HEADER, _T("IMAGE")); // // Enable/Disable Check for update button // m_wndUpdate.Attach(GetDlgItem(IDC_CHECK_UPDATE)); AutoHModule hUpdateDLL = ::LoadLibrary(_T("ndupdate.dll")); if (NULL != (HMODULE)hUpdateDLL) { } else { m_wndUpdate.ShowWindow(FALSE); } return TRUE; }
BOOL CAboutDlg::OnInitDialog() { CDialog::OnInitDialog(); m_SiteLink.SetFont(&m_Font); return (TRUE); }
BOOL CBaseDlg::OnInitDialog() { //CDialog::OnInitDialog(); if (m_hIcon) { SetIcon(m_hIcon, TRUE); // 设置大图标 SetIcon(m_hIcon, FALSE); // 设置小图标 } m_bInit = TRUE; for (int i = 0; i < m_vecCtrl.size(); i++) { switch (m_vecCtrl[i].type) { case BASE_BUTTON: case BASE_CHECK_BUTTON: { CButton* pCtrl = (CButton*)m_vecCtrl[i].pCtrl; pCtrl->Create(m_vecCtrl[i].sCaption, m_vecCtrl[i].dwStyle, m_vecCtrl[i].rect, m_vecCtrl[i].pParent, m_vecCtrl[i].nID); pCtrl->SetFont(&mFont); break; } case BASE_COMMOM_BUTTON: { CCommonButton* pCtrl = (CCommonButton*)m_vecCtrl[i].pCtrl; pCtrl->Create(m_vecCtrl[i].sCaption, m_vecCtrl[i].dwStyle, m_vecCtrl[i].rect, m_vecCtrl[i].pParent, m_vecCtrl[i].nID); pCtrl->SetFont(&mFont); break; } case BASE_STATIC: { CStatic* pCtrl = (CStatic*)m_vecCtrl[i].pCtrl; pCtrl->Create(m_vecCtrl[i].sCaption, m_vecCtrl[i].dwStyle, m_vecCtrl[i].rect, m_vecCtrl[i].pParent, m_vecCtrl[i].nID); pCtrl->SetFont(&mFont); break; } case BASE_MY_CHECK_BUTTON: { CMyCheckButton* pCtrl = (CMyCheckButton*)m_vecCtrl[i].pCtrl; pCtrl->Create(m_vecCtrl[i].sCaption, m_vecCtrl[i].dwStyle, m_vecCtrl[i].rect, m_vecCtrl[i].pParent, m_vecCtrl[i].nID); pCtrl->SetFont(&mFont); break; } case BASE_INDICATOR: { CIndicator* pCtrl = (CIndicator*)m_vecCtrl[i].pCtrl; pCtrl->Create(m_vecCtrl[i].sCaption, m_vecCtrl[i].dwStyle, m_vecCtrl[i].rect, m_vecCtrl[i].pParent, m_vecCtrl[i].nID); pCtrl->SetFont(&mFont); break; } case BASE_GROUPBOX: { CGroupBox* pCtrl = (CGroupBox*)m_vecCtrl[i].pCtrl; pCtrl->Create(m_vecCtrl[i].sCaption, m_vecCtrl[i].dwStyle, m_vecCtrl[i].rect, m_vecCtrl[i].pParent, m_vecCtrl[i].nID); pCtrl->SetFont(&mFont); break; } case BASE_EDIT_CSTRING: case BASE_EDIT_DOUBLE: { CEdit* pCtrl = (CEdit*)m_vecCtrl[i].pCtrl; pCtrl->Create(m_vecCtrl[i].dwStyle, m_vecCtrl[i].rect, m_vecCtrl[i].pParent, m_vecCtrl[i].nID); pCtrl->SetFont(&mFont); break; } case BASE_COLOR_TEXT: { CColorText* pCtrl = (CColorText*)m_vecCtrl[i].pCtrl; pCtrl->Create(m_vecCtrl[i].sCaption, m_vecCtrl[i].dwStyle, m_vecCtrl[i].rect, m_vecCtrl[i].pParent, m_vecCtrl[i].nID); break; } case BASE_DRAWVIEW: { CDrawView* pCtrl = (CDrawView*)m_vecCtrl[i].pCtrl; pCtrl->Create(m_vecCtrl[i].rect, m_vecCtrl[i].pParent, m_vecCtrl[i].nID); break; } case BASE_LIST: { CListCtrl* pCtrl = (CListCtrl*)m_vecCtrl[i].pCtrl; pCtrl->Create(m_vecCtrl[i].dwStyle, m_vecCtrl[i].rect, m_vecCtrl[i].pParent, m_vecCtrl[i].nID); break; } case BASE_TABVIEW: { CTabViewCtrl* pCtrl = (CTabViewCtrl*)m_vecCtrl[i].pCtrl; pCtrl->Create(m_vecCtrl[i].dwStyle, m_vecCtrl[i].rect, m_vecCtrl[i].pParent, m_vecCtrl[i].nID); break; } case BASE_GRADIENT_BACKGROUND: { CGradientBackground* pCtrl = (CGradientBackground*)m_vecCtrl[i].pCtrl; pCtrl->Create(m_vecCtrl[i].sCaption, m_vecCtrl[i].dwStyle, m_vecCtrl[i].rect, m_vecCtrl[i].pParent, m_vecCtrl[i].nID); break; } case BASE_COMBOBOX: { CComboBox* pCtrl = (CComboBox*)m_vecCtrl[i].pCtrl; pCtrl->Create(m_vecCtrl[i].dwStyle, m_vecCtrl[i].rect, m_vecCtrl[i].pParent, m_vecCtrl[i].nID); pCtrl->SetFont(&mFont); CString caption = m_vecCtrl[i].sCaption; for (int j = 0; j < m_vecCtrl[i].nDataCount; j++) { int endpos = caption.Find(L"\n"); CString item = caption.Mid(0, endpos); pCtrl->AddString(item); caption = caption.Right(caption.GetLength()-endpos-1); } pCtrl->SetCurSel(0); break; } case BASE_PROGRESS: { CProgressCtrl* pCtrl = (CProgressCtrl*)m_vecCtrl[i].pCtrl; pCtrl->Create(m_vecCtrl[i].dwStyle, m_vecCtrl[i].rect, m_vecCtrl[i].pParent, m_vecCtrl[i].nID); if (m_vecCtrl[i].pInOutData != NULL) { pCtrl->SetRange32((int)m_vecCtrl[i].dMinVal,(int)m_vecCtrl[i].dMaxVal); } break; } case BASE_SLIDER: { CSliderCtrl* pCtrl = (CSliderCtrl*)m_vecCtrl[i].pCtrl; pCtrl->Create(m_vecCtrl[i].dwStyle, m_vecCtrl[i].rect, m_vecCtrl[i].pParent, m_vecCtrl[i].nID); if (m_vecCtrl[i].pInOutData != NULL) { pCtrl->SetRangeMax((int)m_vecCtrl[i].dMaxVal); pCtrl->SetRangeMin((int)m_vecCtrl[i].dMinVal); } break; } case BASE_SLIDER_GROUP: { CSliderGroup* pCtrl = (CSliderGroup*)m_vecCtrl[i].pCtrl; pCtrl->Create(m_vecCtrl[i].sCaption, m_vecCtrl[i].dwStyle, m_vecCtrl[i].rect, m_vecCtrl[i].pParent, m_vecCtrl[i].nID); if (m_vecCtrl[i].pInOutData!=NULL) { pCtrl->GetSlider()->SetRangeMax((int)m_vecCtrl[i].dMaxVal); pCtrl->GetSlider()->SetRangeMin((int)m_vecCtrl[i].dMinVal); } break; } default: break; } } UpdateData(FALSE); return TRUE; }
//*********************************************************************************** void CLocatedBindableDialog::init(CParticleDlg* pParent) { Create(IDD_LOCATED_BINDABLE, pParent); ShowWindow(SW_SHOW); _ParticleDlg = pParent; NL3D::CParticleSystem *ps = _Bindable->getOwner()->getOwner(); if (ps->isSharingEnabled()) { GetDlgItem(IDC_NO_AUTO_LOD)->ShowWindow(TRUE); if (ps->isAutoLODEnabled() == false) { GetDlgItem(IDC_NO_AUTO_LOD)->EnableWindow(FALSE); } else { ((CButton *) GetDlgItem(IDC_NO_AUTO_LOD))->SetCheck(NLMISC::safe_cast<NL3D::CPSParticle *>(_Bindable)->isAutoLODDisabled()); } } else { GetDlgItem(IDC_NO_AUTO_LOD)->ShowWindow(FALSE); } uint yPos = 60; const uint xPos = 5; RECT rect; // control at the top of the sheet are not available for meshs & constraint meshes, so use that extra space if (dynamic_cast<NL3D::CPSMesh *>(_Bindable) || dynamic_cast<NL3D::CPSConstraintMesh *>(_Bindable)) { yPos = 0; } // has the particle a material ? if (dynamic_cast<NL3D::CPSMaterial *>(_Bindable)) { NL3D::CPSMaterial *material = dynamic_cast<NL3D::CPSMaterial *>(_Bindable); // blending mode m_BlendingMode.SetCurSel((uint) material->getBlendingMode() ); // z-test ((CButton *) GetDlgItem(IDC_ZTEST))->SetCheck(material->isZTestEnabled() ? BST_CHECKED : BST_UNCHECKED); // z-bias GetDlgItem(IDC_ZBIAS)->SetWindowText(NLMISC::toString("%.2f", -material->getZBias()).c_str()); } else { m_BlendingMode.ShowWindow(SW_HIDE); GetDlgItem(IDC_BLENDING_MODE_STATIC)->ShowWindow(SW_HIDE); GetDlgItem(IDC_ZTEST)->ShowWindow(SW_HIDE); GetDlgItem(IDC_ZBIAS)->ShowWindow(SW_HIDE); GetDlgItem(IDC_ZBIAS_TEXT)->ShowWindow(SW_HIDE); } GetDlgItem(IDC_ALIGN_ON_MOTION)->ShowWindow(SW_HIDE); GetDlgItem(IDC_ZALIGN)->ShowWindow(SW_HIDE); // enable disable z-test // if (dynamic_cast<NL3D::CPSParticle *>(_Bindable)) { NL3D::CPSParticle *p = (NL3D::CPSParticle *) _Bindable; // check support for lighting if (p->supportGlobalColorLighting()) { GetDlgItem(ID_GLOBAL_COLOR_LIGHTING)->ShowWindow(SW_SHOW); // if global color lighting is forced for all objects, don't allow to modify GetDlgItem(ID_GLOBAL_COLOR_LIGHTING)->EnableWindow(ps->getForceGlobalColorLightingFlag() ? FALSE : TRUE); ((CButton *) GetDlgItem(ID_GLOBAL_COLOR_LIGHTING))->SetCheck(p->usesGlobalColorLighting() ? 1 : 0); } else { GetDlgItem(ID_GLOBAL_COLOR_LIGHTING)->ShowWindow(SW_HIDE); } // check support for color if (dynamic_cast<NL3D::CPSColoredParticle *>(_Bindable)) { CAttribDlgRGBA *ad = new CAttribDlgRGBA("PARTICLE_COLOR", _Node); pushWnd(ad); _ColorWrapper.S = dynamic_cast<NL3D::CPSColoredParticle *>(_Bindable); ad->setWrapper(&_ColorWrapper); ad->setSchemeWrapper(&_ColorWrapper); HBITMAP bmh = LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_PARTICLE_COLOR)); ad->init(bmh, xPos, yPos, this); ad->GetClientRect(&rect); yPos += rect.bottom + 3; } // init size ctrl _SizeCtrlX = xPos; _SizeCtrlY = yPos; yPos += updateSizeControl(); // check support for angle 2D if (dynamic_cast<NL3D::CPSRotated2DParticle *>(_Bindable)) { CAttribDlgFloat *ad = new CAttribDlgFloat("PARTICLE_ANGLE2D", _Node, 0.f, 256.f); pushWnd(ad); _Angle2DWrapper.S = dynamic_cast<NL3D::CPSRotated2DParticle *>(_Bindable); ad->setWrapper(&_Angle2DWrapper); ad->setSchemeWrapper(&_Angle2DWrapper); HBITMAP bmh = LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_PARTICLE_ANGLE)); ad->init(bmh, xPos, yPos, this); ad->GetClientRect(&rect); yPos += rect.bottom + 3; } CAttribDlgPlaneBasis *pb = NULL; // check support for plane basis if (dynamic_cast<NL3D::CPSRotated3DPlaneParticle *>(_Bindable)) { pb = new CAttribDlgPlaneBasis("PARTICLE_PLANE_BASIS", _Node); pushWnd(pb); _PlaneBasisWrapper.S = dynamic_cast<NL3D::CPSRotated3DPlaneParticle *>(_Bindable); pb->setWrapper(&_PlaneBasisWrapper); pb->setSchemeWrapper(&_PlaneBasisWrapper); HBITMAP bmh = LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BASIS)); pb->init(bmh, xPos, yPos, this); pb->GetClientRect(&rect); yPos += rect.bottom + 3; } // check support for precomputed rotations if (dynamic_cast<NL3D::CPSHintParticleRotateTheSame *>(_Bindable)) { CPrecomputedRotationsDlg *pr = new CPrecomputedRotationsDlg(_Node, dynamic_cast<NL3D::CPSHintParticleRotateTheSame *>(_Bindable), pb); pushWnd(pr); pr->init(this, xPos, yPos); pr->GetClientRect(&rect); yPos += rect.bottom + 3; } // if we're dealing with a face look at, motion blur can be tuned if (dynamic_cast<NL3D::CPSFaceLookAt *>(_Bindable)) { NL3D::CPSFaceLookAt *fla = static_cast<NL3D::CPSFaceLookAt *>(_Bindable); CEditableRangeFloat *mbc = new CEditableRangeFloat(std::string("MOTION_BLUR_COEFF"), _Node, 0, 5); pushWnd(mbc); _MotionBlurWnd.push_back(mbc); _MotionBlurCoeffWrapper.P = fla; mbc->setWrapper(&_MotionBlurCoeffWrapper); mbc->init(xPos + 140, yPos, this); CStatic *s = new CStatic; pushWnd(s); _MotionBlurWnd.push_back(s); s->Create("Fake motion blur coeff.", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); mbc->GetClientRect(&rect); yPos += rect.bottom + 3; mbc = new CEditableRangeFloat(std::string("MOTION_BLUR_THRESHOLD"), _Node, 0, 5); pushWnd(mbc); _MotionBlurWnd.push_back(mbc); _MotionBlurThresholdWrapper.P = fla; mbc->setWrapper(&_MotionBlurThresholdWrapper); mbc->init(xPos + 140, yPos, this); s = new CStatic; pushWnd(s); _MotionBlurWnd.push_back(s); s->Create("Fake motion blur threshold.", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); mbc->GetClientRect(&rect); yPos += rect.bottom + 3; GetDlgItem(IDC_ALIGN_ON_MOTION)->ShowWindow(SW_SHOW); GetDlgItem(IDC_ZALIGN)->ShowWindow(SW_SHOW); ((CButton *) GetDlgItem(IDC_ALIGN_ON_MOTION))->SetCheck(fla->getAlignOnMotion()); ((CButton *) GetDlgItem(IDC_ZALIGN))->SetCheck(fla->getAlignOnZAxis()); updateValidWndForAlignOnMotion(fla->getAlignOnMotion()); } // if we're dealing with a shockwave, we add dlg for the radius cut, and the number of segments if (dynamic_cast<NL3D::CPSShockWave *>(_Bindable)) { NL3D::CPSShockWave *sw = static_cast<NL3D::CPSShockWave *>(_Bindable); CEditableRangeFloat *rc = new CEditableRangeFloat(std::string("RADIUS CUT"), _Node, 0, 1); pushWnd(rc); _RadiusCutWrapper.S = sw; rc->setWrapper(&_RadiusCutWrapper); rc->init(xPos + 140, yPos, this); CStatic *s = new CStatic; pushWnd(s); s->Create("Radius cut.", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); rc->GetClientRect(&rect); yPos += rect.bottom + 3; CEditableRangeUInt *snbs = new CEditableRangeUInt(std::string("SHOCK WAVE NB SEG"), _Node, 3, 24); pushWnd(snbs); _ShockWaveNbSegWrapper.S = sw; snbs->enableLowerBound(3, false); snbs->setWrapper(&_ShockWaveNbSegWrapper); snbs->init(xPos + 140, yPos, this); s = new CStatic; pushWnd(s); s->Create("Nb segs", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->ShowWindow(SW_SHOW); snbs->GetClientRect(&rect); yPos += rect.bottom + 3; CEditableRangeFloat *uvd = new CEditableRangeFloat(std::string("TEX UFACTOR"), _Node, 0, 5); pushWnd(uvd); _ShockWaveUFactorWrapper.S = sw; uvd->setWrapper(&_ShockWaveUFactorWrapper); uvd->init(xPos + 140, yPos, this); s = new CStatic; pushWnd(s); s->Create("Texture U factor :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->ShowWindow(SW_SHOW); uvd->GetClientRect(&rect); yPos += rect.bottom + 3; } // fanlight if (dynamic_cast<NL3D::CPSFanLight *>(_Bindable)) { CEditableRangeUInt *nbf = new CEditableRangeUInt(std::string("NB_FANS"), _Node, 3, 127); pushWnd(nbf); nbf->enableLowerBound(3, false); nbf->enableUpperBound(128, true); _FanLightWrapper.P = dynamic_cast<NL3D::CPSFanLight *>(_Bindable); nbf->setWrapper(&_FanLightWrapper); nbf->init(xPos + 140, yPos, this); CStatic *s = new CStatic; pushWnd(s); s->Create("Nb fan lights :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); nbf->GetClientRect(&rect); yPos += rect.bottom + 3; nbf = new CEditableRangeUInt(std::string("PHASE_SMOOTHNESS"), _Node, 0, 31); pushWnd(nbf); nbf->enableUpperBound(32, true); _FanLightSmoothnessWrapper.P = static_cast<NL3D::CPSFanLight *>(_Bindable); nbf->setWrapper(&_FanLightSmoothnessWrapper); nbf->init(xPos + 140, yPos, this); s = new CStatic; pushWnd(s); s->Create("Phase smoothnes:", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->ShowWindow(SW_SHOW); nbf->GetClientRect(&rect); yPos += rect.bottom + 3; CEditableRangeFloat *nbfp = new CEditableRangeFloat(std::string("FAN_LIGHT_PHASE"), _Node, 0, 4.f); pushWnd(nbfp); _FanLightPhaseWrapper.P = static_cast<NL3D::CPSFanLight *>(_Bindable); nbfp->setWrapper(&_FanLightPhaseWrapper); nbfp->init(xPos + 140, yPos, this); s = new CStatic; pushWnd(s); s->Create("Fan light speed :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->ShowWindow(SW_SHOW); nbf->GetClientRect(&rect); yPos += rect.bottom + 3; nbfp = new CEditableRangeFloat(std::string("FAN_LIGHT_INTENSITY"), _Node, 0, 4.f); pushWnd(nbfp); _FanLightIntensityWrapper.P = static_cast<NL3D::CPSFanLight *>(_Bindable); nbfp->setWrapper(&_FanLightIntensityWrapper); nbfp->init(xPos + 140, yPos, this); s = new CStatic; pushWnd(s); s->Create("Fan light intensity:", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->ShowWindow(SW_SHOW); nbf->GetClientRect(&rect); yPos += rect.bottom + 3; } // tail particle if (dynamic_cast<NL3D::CPSTailParticle *>(_Bindable)) { CEditableRangeUInt *nbs; if (!dynamic_cast<NL3D::CPSRibbonLookAt *>(_Bindable)) { nbs = new CEditableRangeUInt(std::string("TAIL_NB_SEGS_"), _Node, 2, 16); nbs->enableLowerBound(1, true); } else { nbs = new CEditableRangeUInt(std::string("LOOKAT_RIBBON_TAIL_NB_SEGS_"), _Node, 2, 16); nbs->enableLowerBound(1, true); } pushWnd(nbs); if (dynamic_cast<NL3D::CPSTailDot *>(_Bindable)) { nbs->enableUpperBound(256, true); } _TailParticleWrapper.P = dynamic_cast<NL3D::CPSTailParticle *>(_Bindable); nbs->setWrapper(&_TailParticleWrapper); nbs->init(xPos + 140, yPos, this); CStatic *s = new CStatic; pushWnd(s); s->Create("Nb segs :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); nbs->GetClientRect(&rect); yPos += rect.bottom + 3; CTailParticleDlg *tpd = new CTailParticleDlg(_Node, dynamic_cast<NL3D::CPSTailParticle *>(_Bindable)); pushWnd(tpd); tpd->init(this, xPos, yPos); tpd->GetClientRect(&rect); yPos += rect.bottom + 3; } // shape particle if (dynamic_cast<NL3D::CPSShapeParticle *>(_Bindable)) { CMeshDlg *md = new CMeshDlg(_Node, dynamic_cast<NL3D::CPSShapeParticle *>(_Bindable), _ParticleDlg); md->init(this, xPos, yPos); md->GetClientRect(&rect); yPos += rect.bottom + 3; pushWnd(md); } // constraint mesh particle if (dynamic_cast<NL3D::CPSConstraintMesh *>(_Bindable)) { CConstraintMeshDlg *cmd = new CConstraintMeshDlg(static_cast<NL3D::CPSConstraintMesh *>(_Bindable)); cmd->init(xPos, yPos, this); cmd->GetClientRect(&rect); yPos += rect.bottom + 3; CConstraintMeshTexDlg *cmtd = new CConstraintMeshTexDlg(static_cast<NL3D::CPSConstraintMesh *>(_Bindable), this); cmtd->init(xPos, yPos, this); cmtd->GetClientRect(&rect); yPos += rect.bottom + 3; pushWnd(cmd); pushWnd(cmtd); } // check support for animated texture if (dynamic_cast<NL3D::CPSTexturedParticle *>(_Bindable)) { CTextureAnimDlg *td = new CTextureAnimDlg(_Node, dynamic_cast<NL3D::CPSTexturedParticle *>(_Bindable), dynamic_cast<NL3D::CPSMultiTexturedParticle *>(_Bindable) ); pushWnd(td); td->init(xPos, yPos, this); td->GetClientRect(&rect); yPos += rect.bottom + 3; } // unanimated texture if (dynamic_cast<NL3D::CPSTexturedParticleNoAnim *>(_Bindable)) { NL3D::CPSTexturedParticleNoAnim *tp = dynamic_cast<NL3D::CPSTexturedParticleNoAnim *>(_Bindable); _TextureNoAnimWrapper.TP = tp; CTextureChooser *tc = new CTextureChooser(dynamic_cast<NL3D::CPSMultiTexturedParticle *>(_Bindable), _Node); tc->enableRemoveButton(); tc->setWrapper(&_TextureNoAnimWrapper); pushWnd(tc); tc->init(xPos, yPos, this); tc->GetClientRect(&rect); yPos += rect.bottom + 3; } // ribbon texture (doesn't support texture animation for now) if (dynamic_cast<NL3D::CPSRibbon *>(_Bindable)) { // add dialog for uv tuning with ribbon CEditableRangeFloat *uvd = new CEditableRangeFloat(std::string("RIBBON UFACTOR"), _Node, 0, 5); pushWnd(uvd); _RibbonUFactorWrapper.R = static_cast<NL3D::CPSRibbon *>(_Bindable); uvd->setWrapper(&_RibbonUFactorWrapper); uvd->init(xPos + 140, yPos, this); CStatic *s = new CStatic; pushWnd(s); s->Create("Texture U factor :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); uvd->GetClientRect(&rect); yPos += rect.bottom + 3; uvd = new CEditableRangeFloat(std::string("RIBBON VFACTOR"), _Node, 0, 5); pushWnd(uvd); _RibbonVFactorWrapper.R = static_cast<NL3D::CPSRibbon *>(_Bindable); uvd->setWrapper(&_RibbonVFactorWrapper); uvd->init(xPos + 140, yPos, this); s = new CStatic; pushWnd(s); s->Create("Texture V factor :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); uvd->GetClientRect(&rect); yPos += rect.bottom + 3; } if (dynamic_cast<NL3D::CPSRibbonBase *>(_Bindable)) { // add dialog for uv tuning with ribbon CEditableRangeFloat *sd = new CEditableRangeFloat(std::string("SEGMENT DURATION"), _Node, 0.05f, 0.5f); sd->enableLowerBound(0, true); pushWnd(sd); _SegDurationWrapper.R = static_cast<NL3D::CPSRibbonLookAt *>(_Bindable); sd->setWrapper(&_SegDurationWrapper); sd->init(xPos + 140, yPos, this); CStatic *s = new CStatic; pushWnd(s); s->Create("Seg Duration :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); sd->GetClientRect(&rect); yPos += rect.bottom + 3; } // 'look at' independant sizes bool isLookAt = dynamic_cast<NL3D::CPSFaceLookAt *>(_Bindable) != NULL; GetDlgItem(IDC_INDE_SIZES)->ShowWindow(isLookAt ? SW_SHOW : SW_HIDE); GetDlgItem(IDC_SIZE_WIDTH)->ShowWindow(isLookAt ? SW_SHOW : SW_HIDE); GetDlgItem(IDC_SIZE_HEIGHT)->ShowWindow(isLookAt ? SW_SHOW : SW_HIDE); GetDlgItem(IDC_WIDTH_HEIGHT_BOX)->ShowWindow(isLookAt ? SW_SHOW : SW_HIDE); ((CButton *) GetDlgItem(IDC_SIZE_WIDTH))->SetCheck(1); if (isLookAt) { NL3D::CPSFaceLookAt *la = static_cast<NL3D::CPSFaceLookAt *>(_Bindable); m_IndependantSizes = la->hasIndependantSizes(); ((CButton *) GetDlgItem(IDC_INDE_SIZES))->SetCheck(m_IndependantSizes); updateIndependantSizes(); } /// new ribbon base class if (dynamic_cast<NL3D::CPSRibbonBase *>(_Bindable)) { CRibbonDlg *rd = new CRibbonDlg(_Node, static_cast<NL3D::CPSRibbonBase *>(_Bindable), this); rd->init(this, xPos, yPos); pushWnd(rd); rd->GetClientRect(&rect); yPos += rect.bottom + 3; } } UpdateData(); }