void CSettingGitConfig::OnEnChangeGitUsername() { m_ChangeMask |= GIT_NAME; SetModified(); }
void CConfigGeneral::OnBnClickedOptPullupdelete() { m_bPullUpDelete = IsDlgButtonChecked(IDC_OPT_PULLUPDELETE) != 0; SetModified(); }
void CConfigGeneral::OnBnClickedOptSingleInstance() { m_bSingleInstance = IsDlgButtonChecked(IDC_OPT_SINGLEINSTANCE) != 0; SetModified(); }
void CConfigGeneral::OnBnClickedOptHexadecimal() { m_bRowInHex = IsDlgButtonChecked(IDC_OPT_HEXROW) != 0; SetModified(); }
void CConfigGeneral::OnBnClickedOptNodpcmreset() { m_bNoDPCMReset = IsDlgButtonChecked(IDC_OPT_NODPCMRESET) != 0; SetModified(); }
void CConfigGeneral::OnBnClickedOptFreecursor() { m_bFreeCursorEdit = IsDlgButtonChecked(IDC_OPT_FREECURSOR) != 0; SetModified(); }
void CConfigGeneral::OnBnClickedOptKeyrepeat() { m_bKeyRepeat = IsDlgButtonChecked(IDC_OPT_KEYREPEAT) != 0; SetModified(); }
BOOL CPPgStats::OnApply() { //TODO: cache all parameters. stats should be redrawn (deleted) only if really needed if (m_bModified) { bool bInvalidateGraphs = false; if (thePrefs.SetAllStatsColors(m_iStatsColors, m_pdwStatsColors)){ theApp.emuledlg->ShowTransferRate(true); bInvalidateGraphs = true; } if (thePrefs.GetTrafficOMeterInterval() != (UINT)m_iGraphsUpdate){ thePrefs.SetTrafficOMeterInterval(m_iGraphsUpdate); bInvalidateGraphs = true; } if (thePrefs.GetStatsInterval() != (UINT)m_iGraphsAvgTime){ thePrefs.SetStatsInterval(m_iGraphsAvgTime); bInvalidateGraphs = true; } if (thePrefs.GetStatsAverageMinutes() != (UINT)m_iStatsUpdate){ thePrefs.SetStatsAverageMinutes(m_iStatsUpdate); bInvalidateGraphs = true; } TCHAR buffer[20]; GetDlgItem(IDC_CGRAPHSCALE)->GetWindowText(buffer, _countof(buffer)); UINT statsMax = _tstoi(buffer); if (statsMax > thePrefs.GetMaxConnections() + 5) { if (thePrefs.GetStatsMax() != thePrefs.GetMaxConnections() + 5){ thePrefs.SetStatsMax(thePrefs.GetMaxConnections() + 5); bInvalidateGraphs = true; } _sntprintf(buffer, _countof(buffer), _T("%d"), thePrefs.GetStatsMax()); buffer[_countof(buffer) - 1] = _T('\0'); GetDlgItem(IDC_CGRAPHSCALE)->SetWindowText(buffer); } else { if (thePrefs.GetStatsMax() != statsMax){ thePrefs.SetStatsMax(statsMax); bInvalidateGraphs = true; } } int n = m_cratio.GetCurSel(); UINT uRatio = (n == 5) ? 10 : ((n == 6) ? 20 : n + 1); // Index 5 = 1:10 and 6 = 1:20 if (thePrefs.GetStatsConnectionsGraphRatio() != uRatio){ thePrefs.SetStatsConnectionsGraphRatio(uRatio); bInvalidateGraphs = true; } if (thePrefs.GetFillGraphs() != (IsDlgButtonChecked(IDC_FILL_GRAPHS) == BST_CHECKED)){ thePrefs.SetFillGraphs(!thePrefs.GetFillGraphs()); bInvalidateGraphs = true; } // ==> Source Graph - Stulle bool m_bSrcGraph = IsDlgButtonChecked(IDC_SRCGRAPH)!=0; if(thePrefs.GetSrcGraph() != m_bSrcGraph){ thePrefs.m_bSrcGraph = m_bSrcGraph; bInvalidateGraphs = true; } if(GetDlgItem(IDC_STATSHL_MIN)->GetWindowTextLength()) { GetDlgItem(IDC_STATSHL_MIN)->GetWindowText(buffer,20); thePrefs.m_iStatsHLMin = (uint16)((_tstoi(buffer)) ? _tstoi(buffer) : 1); } if(GetDlgItem(IDC_STATSHL_MAX)->GetWindowTextLength()) { GetDlgItem(IDC_STATSHL_MAX)->GetWindowText(buffer,20); thePrefs.m_iStatsHLMax = (uint16)((_tstoi(buffer)) ? _tstoi(buffer) : 1); } thePrefs.m_iStatsHLDif = thePrefs.GetStatsHLMax()-thePrefs.GetStatsHLMin(); // <== Source Graph - Stulle if (bInvalidateGraphs){ theApp.emuledlg->statisticswnd->UpdateConnectionsGraph(); // Set new Y upper bound and Y ratio for active connections. theApp.emuledlg->statisticswnd->Localize(); theApp.emuledlg->statisticswnd->ShowInterval(); } theApp.emuledlg->statisticswnd->RepaintMeters(); theApp.emuledlg->statisticswnd->GetDlgItem(IDC_STATTREE)->EnableWindow(thePrefs.GetStatsInterval() > 0); SetModified(FALSE); } return CPropertyPage::OnApply(); }
void CPPgStats::OnBnClickedFillGraphs() { SetModified(); }
void CSettingGitConfig::OnBnClickedCheckAutocrlf() { m_ChangeMask |= GIT_CRLF; SetModified(); }
void CSettingGitConfig::OnBnClickedCheckSafecrlf() { m_ChangeMask |= GIT_SAFECRLF; SetModified(); }
void CSettingGitConfig::OnBnClickedCheckWarnNoSignedOffBy() { m_ChangeMask |= GIT_WARNNOSIGNEDOFFBY; SetModified(); }
void CSettingGitConfig::OnEnChangeGitUserSigningKey() { m_ChangeMask |= GIT_SIGNINGKEY; SetModified(); }
void CSettingGitConfig::OnEnChangeGitUseremail() { m_ChangeMask |= GIT_EMAIL; SetModified(); }
/** Save the image under a new name * Set the modification flag * \return true on success, false on failure */ bool XPMEditorBase::SaveAs(void) { wxFileName fname; fname.Assign(m_Filename); ConfigManager* mgr = Manager::Get()->GetConfigManager(_T("app")); int StoredIndex = 0; wxString Filters = FileFilters::GetFilterString(); wxString Path = fname.GetPath(); wxString Extension = fname.GetExt(); wxString Filter; if (!Extension.IsEmpty()) { // use the current extension as the filter // Select filter belonging to this file type: Extension.Prepend(_T(".")); Filter = FileFilters::GetFilterString(Extension); } else if(mgr) { // File type is unknown. Select the last used filter: Filter = mgr->Read(_T("/file_dialogs/save_file_as/filter"), _T("bitmap files")); } if(!Filter.IsEmpty()) { // We found a filter, look up its index: int sep = Filter.find(_T("|")); if (sep != wxNOT_FOUND) { Filter.Truncate(sep); } if (!Filter.IsEmpty()) { FileFilters::GetFilterIndexFromName(Filters, Filter, StoredIndex); } } if(mgr && Path.IsEmpty()) { Path = mgr->Read(_T("/file_dialogs/save_file_as/directory"), Path); } wxFileDialog dlg(Manager::Get()->GetAppWindow(), _("Save file"), Path, fname.GetFullName(), Filters, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); dlg.SetFilterIndex(StoredIndex); PlaceWindow(&dlg); if (dlg.ShowModal() != wxID_OK) { // cancelled out return(false); } m_Filename = dlg.GetPath(); Manager::Get()->GetLogManager()->Log(m_Filename); fname.Assign(m_Filename); m_Shortname = fname.GetFullName(); SetTitle(m_Shortname); // invalidate m_pProjectFile, because if kept, it would point to the ProjectFile with old name and // cause ProjectManager::RemoveFileFromProject called via context menu to crash if (m_pProjectFile) m_pProjectFile->SetFileState(fvsNormal); //so the original project file will be shown as unmodified. UpdateModified(); SetProjectFile(0); //Manager::Get()->GetLogManager()->Log(mltDevDebug, "Filename=%s\nShort=%s", m_Filename.c_str(), m_Shortname.c_str()); m_bIsFileNameOK = true; SetModified(true); // store the last used filter and directory if(mgr) { int Index = dlg.GetFilterIndex(); wxString Filter; if(FileFilters::GetFilterNameFromIndex(Filters, Index, Filter)) { mgr->Write(_T("/file_dialogs/save_file_as/filter"), Filter); } wxString Test = dlg.GetDirectory(); mgr->Write(_T("/file_dialogs/save_file_as/directory"), dlg.GetDirectory()); } return(Save()); }
/* ================ rvGEWorkspace::NewWindow Create a new window ================ */ idWindow* rvGEWorkspace::NewWindow ( idDict* state, rvGEWindowWrapper::EWindowType type ) { idWindow* window = new idWindow ( mInterface->GetDesktop()->GetDC(), mInterface ); rvGEWindowWrapper* wrapper; int count; idStr baseName; switch ( type ) { case rvGEWindowWrapper::WT_NORMAL: window = new idWindow ( mInterface->GetDesktop()->GetDC(), mInterface ); break; case rvGEWindowWrapper::WT_BIND: window = new idBindWindow ( mInterface->GetDesktop()->GetDC(), mInterface ); break; case rvGEWindowWrapper::WT_RENDER: window = new idRenderWindow ( mInterface->GetDesktop()->GetDC(), mInterface ); break; case rvGEWindowWrapper::WT_CHOICE: window = new idChoiceWindow ( mInterface->GetDesktop()->GetDC(), mInterface ); break; case rvGEWindowWrapper::WT_EDIT: window = new idEditWindow ( mInterface->GetDesktop()->GetDC(), mInterface ); break; default: assert ( false ); return NULL; } baseName = state ? state->GetString("name","unnamed") : "unnamed"; baseName.StripQuotes ( ); count = 0; if ( mInterface->GetDesktop()->FindChildByName ( baseName ) ) { count = 1; while ( 1 ) { drawWin_t* dw = mInterface->GetDesktop()->FindChildByName ( va("%s%d",baseName.c_str(),count) ); if ( !dw ) { break; } assert ( dw->win ); wrapper = rvGEWindowWrapper::GetWrapper ( dw->win ); if ( wrapper && wrapper->IsDeleted ( ) ) { break; } count++; } } idStr winName; idStr winTemplate; if ( count ) { winName = va("%s%d", baseName.c_str(), count ); } else { winName = baseName; } winTemplate = winName + " { }"; idParser src( winTemplate, winTemplate.Length(), "", LEXFL_ALLOWMULTICHARLITERALS | LEXFL_NOSTRINGCONCAT | LEXFL_ALLOWBACKSLASHSTRINGCONCAT ); window->Parse ( &src ); wrapper = rvGEWindowWrapper::GetWrapper ( window ); if ( state ) { wrapper->SetState ( *state ); } wrapper->SetStateKey ( "name", winName ); wrapper->Finish ( ); SetModified ( true ); return window; }
//@doc SECEdit //@mfunc Internal function. Cuts the text from pStartPos to pEndPos. Never deletes // pStartPos->pLine. //@rdesc int //@parm PTEXTPOS pStartPos //@parm PTEXTPOS pEndPos //@parm BOOL bSaveUndoRecord int SECEdit::Cut(PTEXTPOS pStartPos, PTEXTPOS pEndPos, BOOL bSaveUndoRecord) { int iRval; UNDORECORD UndoRecord; LPSTR lpText; PLINEDESC pFirstDeadLine,pNextDeadLine,pLastDeadLine; TEXTPOS TempPos; ASSERT(pStartPos); ASSERT(pEndPos); iRval = 0; if (m_bReadOnly) return IDS_OE_READONLY; if ((pStartPos->pLine == pEndPos->pLine) && (pStartPos->iOffset == pEndPos->iOffset)) return IDS_OE_NOSELECTION; if ((pStartPos->pLine == NULL) || (pEndPos->pLine == NULL)) return IDS_OE_NOSELECTION; // save the undo record if (bSaveUndoRecord) { UndoRecord.iRow = GetLineNo(pStartPos->pLine); if (pStartPos->pLine == pEndPos->pLine) UndoRecord.iEndRow = UndoRecord.iRow; else UndoRecord.iEndRow = GetLineNo(pEndPos->pLine); UndoRecord.iCol = pStartPos->iOffset; UndoRecord.iEndCol = pEndPos->iOffset; UndoRecord.iUndoType = OE_UNDO_CUT; lpText = Copy(pStartPos, pEndPos, FALSE); } if (pStartPos->pLine == pEndPos->pLine) { iRval = DeleteString(pStartPos, pEndPos->iOffset-pStartPos->iOffset, FALSE); } else { // lop the starting line off at iOffset if (pStartPos->iOffset < (pStartPos->pLine->iTxtSize-m_iLineEndLength)) { pStartPos->pLine->pText[pStartPos->iOffset] = 0; pStartPos->pLine->iTxtSize = pStartPos->iOffset; } // delete the marked part of the last line if (pEndPos->iOffset > pEndPos->pLine->iTxtSize) { pEndPos->iOffset = pEndPos->pLine->iTxtSize; /* (maybe) adjust for OE_CR/OE_LF */ char cFirst,cSecond; cFirst = pEndPos->pLine->pText[pEndPos->pLine->iTxtSize-m_iLineEndLength]; cSecond = m_szLineEnd[0]; if (cFirst == cSecond) { pEndPos->iOffset -= m_iLineEndLength; UndoRecord.iEndCol -= m_iLineEndLength; } } TempPos.pLine = pEndPos->pLine; TempPos.iOffset = 0; iRval = DeleteString(&TempPos, pEndPos->iOffset, FALSE); // link the two together, and unlink the ones in between if ((!iRval) || (iRval == IDS_OE_JOINLINE)) { if (pStartPos->pLine->pNext != pEndPos->pLine) { pFirstDeadLine = pStartPos->pLine->pNext; if (pEndPos->pLine) { pLastDeadLine = pEndPos->pLine->pPrev; pEndPos->pLine->pPrev = pStartPos->pLine; } else pLastDeadLine = NULL; pStartPos->pLine->pNext = pEndPos->pLine; if (pLastDeadLine) pLastDeadLine->pNext = NULL; while (pFirstDeadLine) { pNextDeadLine = pFirstDeadLine->pNext; FreeTextLine(pFirstDeadLine); pFirstDeadLine = pNextDeadLine; } } // join the chopped start with the chopped end iRval = JoinLines(pStartPos, FALSE); if (iRval == IDS_OE_EOF) iRval = 0; } } if (!iRval) { if (bSaveUndoRecord) { SaveUndoRecord(&UndoRecord,lpText); free(lpText); } // set the changed flag SetModified(TRUE); } return iRval; }
/* ================ rvGEWorkspace::AlignSelected Align the selected items to the first one using the given align type ================ */ void rvGEWorkspace::AlignSelected ( EItemAlign align ) { static const char* alignNames[]={"Lefts","Centers","Rights","Tops","Middles","Bottoms" }; int i; idStr modName; rvGEModifierGroup* group; assert ( mSelections.Num() > 1 ); modName = "Align " + idStr(alignNames[align]); group = new rvGEModifierGroup ( ); idRectangle rectTo; rectTo = rvGEWindowWrapper::GetWrapper ( mSelections[0] )->GetScreenRect ( ); // Everything gets aligned to the first selection so run // through all other selections and move them. for ( i = 1; i < mSelections.Num(); i ++ ) { float x; float y; idRectangle rectFrom; rectFrom = rvGEWindowWrapper::GetWrapper ( mSelections[i] )->GetScreenRect ( ); switch ( align ) { case ALIGN_LEFTS: x = rectTo[0] - rectFrom[0]; y = 0; break; case ALIGN_RIGHTS: x = (rectTo[0]+rectTo[2]) - (rectFrom[0]+rectFrom[2]); y = 0; break; case ALIGN_CENTERS: x = (rectTo[0]+rectTo[2]/2) - (rectFrom[0]+rectFrom[2]/2); y = 0; break; case ALIGN_TOPS: y = rectTo[1] - rectFrom[1]; x = 0; break; case ALIGN_BOTTOMS: x = 0; y = (rectTo[1]+rectTo[3]) - (rectFrom[1]+rectFrom[3]); break; case ALIGN_MIDDLES: x = 0; y = (rectTo[1]+rectTo[3]/2) - (rectFrom[1]+rectFrom[3]/2); break; default: assert ( false ); break; } group->Append ( new rvGEMoveModifier ( modName, mSelections[i], x, y ) ); } mModifiers.Append ( group ); // Cant merge alignments mModifiers.BlockNextMerge ( ); SetModified ( true ); }
void CConfigGeneral::OnBnClickedOptWavepreview() { m_bPreviewWAV = IsDlgButtonChecked(IDC_OPT_WAVEPREVIEW) != 0; SetModified(); }
/* ================ rvGEWorkspace::AddModifierSize Adds a size modifier with the given offsets ================ */ void rvGEWorkspace::AddModifierSize ( const char* modName, float l, float t, float r, float b, bool snap ) { idRectangle scaleRect; idRectangle sizeRect; idRectangle newRect; scaleRect = mSelections.GetRect ( ); WindowToWorkspace ( scaleRect ); newRect = scaleRect; newRect.x += l; newRect.y += t; newRect.w += (r - l); newRect.h += (b - t); // Restrict sizing below 1 width if ( newRect.w <= 1 ) { newRect.x = newRect.x - (l ? (1 - newRect.w) : 0); mDragPoint.x = newRect.x; newRect.w = 1; mDragX = false; } else { mDragX = true; } // Restrict sizing below 1 height if ( newRect.h <= 1 ) { newRect.y = newRect.y - (t ? (1 - newRect.h) : 0); mDragPoint.y = newRect.y; newRect.h = 1; mDragY = false; } else { mDragY = true; } if ( snap ) { gApp.GetOptions ().SnapRectToGrid ( newRect, l != 0.0f, t != 0.0f, r != 0.0f, b != 0.0f ); } rvGEModifierGroup* group = new rvGEModifierGroup; for ( int i = 0; i < mSelections.Num(); i ++ ) { sizeRect = rvGEWindowWrapper::GetWrapper ( mSelections[i] )->GetScreenRect ( ); l = (newRect.x + ((sizeRect.x - scaleRect.x) / scaleRect.w) * newRect.w) - sizeRect.x; t = (newRect.y + ((sizeRect.y - scaleRect.y) / scaleRect.h) * newRect.h) - sizeRect.y; r = (sizeRect.w / scaleRect.w * newRect.w) - sizeRect.w + l; b = (sizeRect.h / scaleRect.h * newRect.h) - sizeRect.h + t; // This is sorta crufty but needs to be done. When a parent is being sized at the same // time as a child you will get double movement because the child is relative to the parent. Therefore // we need to subtract out the closest parents sizing. idWindow* parent = mSelections[i]; while ( NULL != (parent = parent->GetParent ( ) ) ) { rvGEWindowWrapper* pwrapper = rvGEWindowWrapper::GetWrapper ( parent ); float offset; if ( !pwrapper->IsSelected ( ) ) { continue; } sizeRect = pwrapper->GetScreenRect ( ); // Subtract out the left and right modifications offset = ((newRect.x + ((sizeRect.x - scaleRect.x) / scaleRect.w) * newRect.w) - sizeRect.x); l -= offset; r -= offset; // Subtract out the top and bottom modifications offset = ((newRect.y + ((sizeRect.y - scaleRect.y) / scaleRect.h) * newRect.h) - sizeRect.y); t -= offset; b -= offset; break; } group->Append ( new rvGESizeModifier ( modName, mSelections[i], l, t, r, b ) ); } mModifiers.Append ( group ); SetModified ( true ); }
void CConfigGeneral::OnBnClickedStyle3() { m_iEditStyle = EDIT_STYLE3; SetModified(); }
void CSetSavedDataPage::OnModified() { SetModified(); }
void CConfigGeneral::OnBnClickedOptFramepreview() { m_bFramePreview = IsDlgButtonChecked(IDC_OPT_FRAMEPREVIEW) != 0; SetModified(); }
BOOL CSetOverlayPage::OnApply() { UpdateData(); Store (m_bOnlyExplorer, m_regOnlyExplorer); if (DWORD(m_regDriveMaskRemovable) != DWORD(m_bRemovable)) m_restart = Restart_Cache; Store (m_bRemovable, m_regDriveMaskRemovable); if (DWORD(m_regDriveMaskFloppy) != DWORD(m_bFloppy)) m_restart = Restart_Cache; Store (m_bFloppy, m_regDriveMaskFloppy); if (DWORD(m_regDriveMaskRemote) != DWORD(m_bNetwork)) m_restart = Restart_Cache; Store (m_bNetwork, m_regDriveMaskRemote); if (DWORD(m_regDriveMaskFixed) != DWORD(m_bFixed)) m_restart = Restart_Cache; Store (m_bFixed, m_regDriveMaskFixed); if (DWORD(m_regDriveMaskCDROM) != DWORD(m_bCDROM)) m_restart = Restart_Cache; Store (m_bCDROM, m_regDriveMaskCDROM); if (DWORD(m_regDriveMaskRAM) != DWORD(m_bRAM)) m_restart = Restart_Cache; Store (m_bRAM, m_regDriveMaskRAM); if (DWORD(m_regDriveMaskUnknown) != DWORD(m_bUnknown)) m_restart = Restart_Cache; Store (m_bUnknown, m_regDriveMaskUnknown); if (m_sExcludePaths.Compare(CString(m_regExcludePaths))) m_restart = Restart_Cache; m_sExcludePaths.Remove('\r'); if (m_sExcludePaths.Right(1).Compare(_T("\n"))!=0) m_sExcludePaths += _T("\n"); Store (m_sExcludePaths, m_regExcludePaths); m_sExcludePaths.Replace(_T("\n"), _T("\r\n")); m_sIncludePaths.Remove('\r'); if (m_sIncludePaths.Right(1).Compare(_T("\n"))!=0) m_sIncludePaths += _T("\n"); if (m_sIncludePaths.Compare(CString(m_regIncludePaths))) m_restart = Restart_Cache; Store (m_sIncludePaths, m_regIncludePaths); m_sIncludePaths.Replace(_T("\n"), _T("\r\n")); if (DWORD(m_regUnversionedAsModified) != DWORD(m_bUnversionedAsModified)) m_restart = Restart_Cache; Store (m_bUnversionedAsModified, m_regUnversionedAsModified); if (DWORD(m_regShowExcludedAsNormal) != DWORD(m_bShowExcludedAsNormal)) m_restart = Restart_Cache; Store (m_bShowExcludedAsNormal, m_regShowExcludedAsNormal); Store (m_dwCacheType, m_regCacheType); if (m_dwCacheType != 1) { // close the possible running cache process HWND hWnd = ::FindWindow(TGIT_CACHE_WINDOW_NAME, TGIT_CACHE_WINDOW_NAME); if (hWnd) { ::PostMessage(hWnd, WM_CLOSE, NULL, NULL); } m_restart = Restart_None; } SetModified(FALSE); return ISettingsPropPage::OnApply(); }
void CConfigGeneral::OnBnClickedOptNostepmove() { m_bNoStepMove = IsDlgButtonChecked(IDC_OPT_NOSTEPMOVE) != 0; SetModified(); }
void CConfigAppearance::OnBnClickedPatterncolors() { m_bPatternColors = IsDlgButtonChecked(IDC_PATTERNCOLORS) != 0; SetModified(); }
void CConfigGeneral::OnBnClickedOptBackups() { m_bBackups = IsDlgButtonChecked(IDC_OPT_BACKUPS) != 0; SetModified(); }
void CConfigAppearance::OnBnClickedDisplayFlats() { m_bDisplayFlats = IsDlgButtonChecked(IDC_DISPLAYFLATS) != 0; SetModified(); }
void CConfigGeneral::OnCbnEditupdatePagelength() { SetModified(); }
void CSettingGitConfig::OnBnClickedCheckGlobal() { SetModified(); }