void DialogAFProperties::OnEnChangeEditContents() { if ( EditControlEnterHit( &m_editContents ) ) { UpdateFile(); if ( file && file->bodies.Num() && MessageBox( "Apply to all bodies ?", "Contents", MB_YESNO | MB_ICONQUESTION ) == IDYES ) { for ( int i = 0; i < file->bodies.Num(); i++ ) { file->bodies[i]->contents = file->contents; } bodyDlg->LoadFile( file ); } } }
void DialogAFConstraintUniversal::OnDeltaposSpinUniversalLimitYaw(NMHDR *pNMHDR, LRESULT *pResult) { LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR); if ( pNMUpDown->iDelta < 0 ) { m_limitYaw += 1.0f; } else { m_limitYaw -= 1.0f; } UpdateData( FALSE ); UpdateFile(); *pResult = 0; }
void DialogAFConstraintSpring::OnDeltaposSpinLimitMaxLength(NMHDR *pNMHDR, LRESULT *pResult) { LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR); if ( pNMUpDown->iDelta < 0 ) { m_maxLength += 1.0f; } else { m_maxLength -= 1.0f; } UpdateData( FALSE ); UpdateFile(); *pResult = 0; }
void DialogAFBody::OnDeltaposSpinAnglesRoll( NMHDR *pNMHDR, LRESULT *pResult ) { LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>( pNMHDR ); if( pNMUpDown->iDelta < 0 ) { cm_angles_roll += 1; } else { cm_angles_roll -= 1; } cm_angles_roll = idMath::AngleNormalize360( cm_angles_roll ); UpdateData( FALSE ); UpdateFile(); *pResult = 0; }
void DialogAFConstraintHinge::OnDeltaposSpinHingeLimitAngle3(NMHDR *pNMHDR, LRESULT *pResult) { LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR); if ( pNMUpDown->iDelta < 0 ) { m_limitAngle3 += 1.0f; } else { m_limitAngle3 -= 1.0f; } UpdateData( FALSE ); UpdateFile(); *pResult = 0; }
void DialogAFConstraintBallAndSocket::OnDeltaposSpinBasLimitAxisPitch(NMHDR *pNMHDR, LRESULT *pResult) { LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR); if ( pNMUpDown->iDelta < 0 ) { m_limitAxisPitch += 1.0f; } else { m_limitAxisPitch -= 1.0f; } UpdateData( FALSE ); UpdateFile(); *pResult = 0; }
void DialogAFConstraintBallAndSocket::OnDeltaposSpinBasLimitPyramidAngle1(NMHDR *pNMHDR, LRESULT *pResult) { LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR); if ( pNMUpDown->iDelta < 0 ) { m_pyramidAngle1 += 1.0f; } else if ( m_pyramidAngle1 > 0.0f ) { m_pyramidAngle1 -= 1.0f; } UpdateData( FALSE ); UpdateFile(); *pResult = 0; }
void DialogAFBody::OnDeltaposSpinAfVectorZ(NMHDR *pNMHDR, LRESULT *pResult) { LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR); if ( pNMUpDown->iDelta < 0 ) { cm_origin_z += 1; } else { cm_origin_z -= 1; } UpdateData( FALSE ); UpdateFile(); *pResult = 0; }
void DialogAFBody::OnDeltaposSpinCmWidth(NMHDR *pNMHDR, LRESULT *pResult) { LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR); if ( pNMUpDown->iDelta < 0 ) { cm_width += 1.0f; } else if ( cm_width >= 2.0f ) { cm_width -= 1.0f; } ValidateCollisionModelWidth( true ); UpdateFile(); *pResult = 0; }
void DialogAFConstraintUniversal::OnDeltaposSpinUniversalLimitPyramidAngle2(NMHDR *pNMHDR, LRESULT *pResult) { LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR); if ( pNMUpDown->iDelta < 0 ) { m_pyramidAngle2 += 1.0f; } else if ( m_pyramidAngle2 > 0.0f ) { m_pyramidAngle2 -= 1.0f; } UpdateData( FALSE ); UpdateFile(); *pResult = 0; }
void DialogAFBody::OnDeltaposSpinCmNumsides(NMHDR *pNMHDR, LRESULT *pResult) { LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR); if ( pNMUpDown->iDelta < 0 ) { cm_numSides += 1; } else if ( cm_numSides > 3 ) { cm_numSides -= 1; } ValidateCollisionModelNumSides( true ); UpdateFile(); *pResult = 0; }
void EM_UserInfo::SetGroupName(LPCTSTR lpszGroupName) { if (strlen(lpszGroupName) >= DISPLAY_NAME) { // Badly error ::MessageBox(0, "Group Name too long", 0, 0); } ZeroMemory(m_szGroupName, DISPLAY_NAME); strcpy(m_szGroupName, lpszGroupName); // 写进文件 UpdateFile(); }
void DialogAFProperties::OnBnClickedCheckSelfcollision() { UpdateFile(); if ( file && file->bodies.Num() && MessageBox( "Apply to all bodies ?", "Self Collision", MB_YESNO | MB_ICONQUESTION ) == IDYES ) { for ( int i = 0; i < file->bodies.Num(); i++ ) { file->bodies[i]->selfCollision = file->selfCollision; } bodyDlg->LoadFile( file ); } }
void DialogAFProperties::OnEnChangeEditAngularfriction() { if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_ANGULARFRICTION ) ) ) { UpdateFile(); if ( file && file->bodies.Num() && MessageBox( "Apply to all bodies ?", "Angular Friction", MB_YESNO | MB_ICONQUESTION ) == IDYES ) { for ( int i = 0; i < file->bodies.Num(); i++ ) { file->bodies[i]->angularFriction = file->defaultAngularFriction; } bodyDlg->LoadFile( file ); } } else { m_angularFriction = EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_ANGULARFRICTION ), false ); } }
EM_UserInfo::EM_UserInfo(char *szDisplayName, char *szGender, char *szGroupName) { char buf[1024]; // 把用户信息COPY过来 strcpy(m_szDisplayName, szDisplayName); strcpy(m_szGender, szGender); strcpy(m_szGroupName, szGroupName); GetLocalHostName(buf); strcpy(m_szHostName, buf); GetLocalHostIP(buf); strcpy(m_szIP, buf); // 写进文件 UpdateFile(); }
void DialogAFProperties::OnEnChangeEditConstraintfriction() { if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_CONSTRAINTFRICTION ) ) ) { UpdateFile(); if ( file && file->constraints.Num() && MessageBox( "Apply to all constraints ?", "Constraint Friction", MB_YESNO | MB_ICONQUESTION ) == IDYES ) { for ( int i = 0; i < file->constraints.Num(); i++ ) { file->constraints[i]->friction = file->defaultConstraintFriction; } constraintDlg->LoadFile( file ); } } else { EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_CONSTRAINTFRICTION ), false ); } }
//--------------------------------------------------------------------------- TMYIniFile::~TMYIniFile() { try { if( bChange ) UpdateFile(); } catch(...) { IniError = 1; bAnyError = true; } delete list; list = NULL; }
void EM_UserInfo::SetDisplayName(LPCTSTR lpszDisplayName) { if (NULL == lpszDisplayName) { ::EM_Error("EM_UserInfo::SetDisplayName szDisplayName == NULL.", 0); return; } if (strlen(lpszDisplayName) >= DISPLAY_NAME) { // Badly error. ::MessageBox(0, "Display too long", 0, 0); } strcpy(m_szDisplayName, lpszDisplayName); // 写进文件 UpdateFile(); }
// ビデオ入力ボタン void CRsfSimpleForm::OnButtonVideo() { // TODO: この位置にコントロール通知ハンドラ用のコードを追加してください /// ビデオファイルの特定 CTPsetup tps(theApp.m_strDataFolder); tps.SetCallerId(m_strSenderId); CString strFile = tps.RsfVideoFileName(_T("$")); /// 画面の表示 CRsfVideoDialog dlg; dlg.SetFile(strFile); if (dlg.DoModal() == IDOK) { /// RSFファイルの更新 if (!UpdateFile()) return; /// 画面の更新 UpdateForm(); } }
int ProcessUpdate(AGPS_CONFIG_T *AGPSConfig, int ConfigCount) { int i; int UpdateCount = 0; for(i = 0; i < ConfigCount; i++) { if(GetFileWithWGET(AGPSConfig[i]) == SUCCESS) { if(UpdateFile(AGPSConfig[i]) == SUCCESS) { UpdateCount++; } } } // NotifyUpdateInformation(); if(UpdateCount > 0) { NotifyUpdateInformation(); } return UpdateCount; }
// 画像入力ボタン void CRsfSimpleForm::OnButtonImage() { // TODO: この位置にコントロール通知ハンドラ用のコードを追加してください /// 画像ファイルの特定 CTPsetup tps(theApp.m_strDataFolder); tps.SetCallerId(m_strSenderId); CString strFile = tps.FindRsfImgFile(_T("$")); CString strTmp = tps.RsfImgFileName(_T("$"), _T("")); // 拡張子なしファイル /// 画面の表示 CRsfImgDialog dlg; dlg.SetFile(strFile); dlg.SetFileNoExt(strTmp); if (dlg.DoModal() == IDOK) { /// RSFファイルの更新 if (!UpdateFile()) return; /// 画面の更新 UpdateForm(); } }
/*=========================================================================== * * Class CSrLoadDlg Event - void OnDblclkFileList (pNMHDR, pResult); * *=========================================================================*/ void CSrLoadDlg::OnDblclkFileList (NMHDR* pNMHDR, LRESULT* pResult) { srloaddlgfileinfo_t* pFileData; POSITION ItemPos; int ListIndex; /* Get the first, and only, selected item */ ItemPos = m_FileList.GetFirstSelectedItemPosition(); if (ItemPos == NULL) return; ListIndex = m_FileList.GetNextSelectedItem(ItemPos); if (ListIndex < 0) return; pFileData = (srloaddlgfileinfo_t *) m_FileList.GetItemData(ListIndex); if (pFileData == NULL) return; /* Set the check state */ if (m_FileList.GetCheck(ListIndex)) { m_FileList.SetCheck(ListIndex, FALSE); if (pFileData->IsActive && !m_IsFileNew) { pFileData->IsActive = false; m_pLastActiveFile = NULL; } } else { m_FileList.SetCheck(ListIndex, TRUE); if (m_pLastActiveFile == NULL && !pFileData->IsMaster && !m_IsFileNew) { pFileData->IsActive = true; m_pLastActiveFile = pFileData; } } UpdateFile(ListIndex, pFileData); *pResult = 0; }
bool MainFrame::CheckForUpdates() { #ifndef __WXMSW__ int ret = wxMessageBox(_("Online updates are available on Windows only. Please browse this site for updates.\n\nhttps://sourceforge.net/projects/vbam/files/latest/download"), _("Online Update"), wxOK | wxICON_INFORMATION); return true; #endif bool new_update_available = false; wxString update_url = CheckForUpdates(_T("sourceforge.net"), _T("/projects/vbam/files/latest/download")); if (!update_url.IsEmpty()) { wxFileConfig* cfg = wxGetApp().cfg; wxString update_filename = update_url.AfterLast('/'); if (gopts.last_updated_filename != update_filename) { new_update_available = true; int ret = wxMessageBox(_("A new update is available. To update, VisualBoyAdvance-M must be Run as administrator. Would you like to download and update VisualBoyAdvance-M?\n\nhttps://sourceforge.net/projects/vbam/files/latest/download"), _("New Update Available"), wxYES_NO | wxICON_QUESTION); if (ret == wxYES) { wxURL url(update_url); UpdateFile(url.GetServer(), url.GetPath()); ret = wxMessageBox(_("The update has been downloaded and installed. Please restart VisualBoyAdvance-M."), _("Update Downloaded"), wxOK | wxICON_INFORMATION); gopts.last_updated_filename = update_filename; cfg->Write(wxT("General/LastUpdatedFileName"), gopts.last_updated_filename); } } gopts.last_update = wxDateTime::Now().GetTicks(); cfg->Write(wxT("General/LastUpdated"), gopts.last_update); cfg->Flush(); } return new_update_available; }
void DialogAFConstraintUniversal::OnCbnSelchangeComboUniversalLimitJoint2() { CString str; GetSafeComboBoxSelection( &m_comboLimitJoint2, str, -1 ); UnsetSafeComboBoxSelection( &m_comboLimitJoint1, str ); UpdateFile(); }
void DialogAFConstraintUniversal::OnCbnSelchangeComboAnchorJoint() { UpdateFile(); }
void DialogAFConstraintBallAndSocket::OnCbnSelchangeComboBasLimitAxisJoint2() { CString str; GetSafeComboBoxSelection( &m_comboLimitAxisJoint2, str, -1 ); UnsetSafeComboBoxSelection( &m_comboLimitAxisJoint1, str ); UpdateFile(); }
void DialogAFConstraintBallAndSocket::OnCbnSelchangeComboAnchorJoint() { UpdateFile(); }
void DialogAFConstraint::OnCbnSelchangeComboConstraintType() { InitConstraintTypeDlg(); UpdateFile(); }
void DialogAFConstraint::OnDeltaposSpinConstraintFriction(NMHDR *pNMHDR, LRESULT *pResult) { LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR); m_friction = EditSpinFloat( (CEdit *)GetDlgItem( IDC_EDIT_CONSTRAINT_FRICTION ), pNMUpDown->iDelta < 0 ); UpdateFile(); *pResult = 0; }
void DialogAFConstraint::OnCbnSelchangeComboConstraintBody2() { CString str; GetSafeComboBoxSelection( &m_comboBody2List, str, -1 ); UnsetSafeComboBoxSelection( &m_comboBody1List, str ); UpdateFile(); }