IDE: Editor-Color opts - Allow setting priorities

git-svn-id: trunk@41419 -
This commit is contained in:
martin 2013-05-26 13:34:29 +00:00
parent 384aab7b08
commit 11c4892506
14 changed files with 1334 additions and 323 deletions

View File

@ -8,34 +8,41 @@
<Globals Version="6">
<SchemeDefault>
<ahaDefault Background="clWhite" Foreground="clBlack"/>
<ahaTextBlock Background="clNavy" Foreground="clWhite"/>
<ahaExecutionPoint Background="clGray" Foreground="clWhite"/>
<ahaEnabledBreakpoint Background="clRed" Foreground="clBlack"/>
<ahaDisabledBreakpoint Background="clGreen" Foreground="clBlack"/>
<ahaInvalidBreakpoint Background="clOlive" Foreground="clGreen"/>
<ahaUnknownBreakpoint Background="clRed" Foreground="clBlack"/>
<ahaErrorLine Background="5284095" Foreground="clBlack"/>
<ahaIncrementalSearch Background="3199088" Foreground="clWhite"/>
<ahaHighlightAll Background="clYellow"/>
<ahaBracketMatch Style="fsBold"/>
<ahaMouseLink Foreground="clBlue"/>
<ahaExecutionPoint Background="clGray" Foreground="clWhite" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaEnabledBreakpoint Background="clRed" Foreground="clBlack" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaDisabledBreakpoint Background="clGreen" Foreground="clBlack" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaInvalidBreakpoint Background="clOlive" Foreground="clGreen" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaUnknownBreakpoint Background="clRed" Foreground="clBlack" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaErrorLine Background="5284095" Foreground="clBlack" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaLineHighlight ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaWordGroup FrameColor="clRed" ForePriority="3000" BackPriority="3000" FramePriority="3000"/>
<ahaBracketMatch Style="fsBold" ForePriority="3000" BackPriority="3000" FramePriority="3000"/>
<ahaHighlightWord Background="15132390" FrameColor="clSilver" ForePriority="3000" BackPriority="3000" FramePriority="3000"/>
<ahaIncrementalSearch Background="3199088" Foreground="clWhite" ForePriority="4000" BackPriority="4000" FramePriority="4000"/>
<ahaHighlightAll Background="clYellow" ForePriority="4000" BackPriority="4000" FramePriority="4000"/>
<ahaTemplateEditCur FrameColor="clAqua" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaTemplateEditSync FrameColor="clFuchsia" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaTemplateEditOther FrameColor="clMaroon" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditCur FrameColor="clFuchsia" ForePriority="2000" BackPriority="2000" FramePriority="2000"/>
<ahaSyncroEditSync FrameColor="clRed" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditOther FrameColor="9744532" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditArea Background="clMoneyGreen" ForePriority="2000" BackPriority="2000" FramePriority="2000"/>
<ahaTextBlock Background="clNavy" Foreground="clWhite" ForePriority="7000" BackPriority="7000" FramePriority="7000"/>
<ahaMouseLink Foreground="clBlue" ForePriority="7500" BackPriority="7500" FramePriority="7500"/>
<ahaFoldedCode Background="clWhite" Foreground="clSilver" FrameColor="clSilver" ForePriority="8000" BackPriority="8000" FramePriority="8000"/>
<ahaSpecialVisibleChars ForePriority="8100" BackPriority="8100" FramePriority="8100"/>
<ahaTopInfoHint Background="clActiveCaption" Foreground="clBlack" FrameColor="clMaroon" FrameStyle="slsDashed" FrameEdges="sfeBottom" ForePriority="8500" BackPriority="8500" FramePriority="8500"/>
<ahaIfDefBlockInactive Foreground="clSilver" ForeAlpha="165" ForePriority="9050" BackPriority="9050" FramePriority="9050"/>
<ahaIfDefBlockActive ForePriority="9000" BackPriority="9000" FramePriority="9000"/>
<ahaIfDefBlockTmpActive ForePriority="9000" BackPriority="9000" FramePriority="9000"/>
<ahaIfDefNodeActive ForePriority="9050" BackPriority="9050" FramePriority="9050"/>
<ahaIfDefNodeInactive ForePriority="9150" BackPriority="9150" FramePriority="9150"/>
<ahaIfDefNodeTmpActive ForePriority="9050" BackPriority="9050" FramePriority="9050"/>
<ahaModifiedLine Foreground="clGreen" FrameColor="59900"/>
<ahaCodeFoldingTree Background="clWhite" Foreground="clSilver"/>
<ahaHighlightWord Background="15132390" FrameColor="clSilver"/>
<ahaFoldedCode Background="clWhite" Foreground="clSilver" FrameColor="clSilver"/>
<ahaWordGroup FrameColor="clRed"/>
<ahaTemplateEditCur FrameColor="clAqua"/>
<ahaTemplateEditSync FrameColor="clFuchsia"/>
<ahaTemplateEditOther FrameColor="clMaroon"/>
<ahaSyncroEditCur FrameColor="clFuchsia"/>
<ahaSyncroEditSync FrameColor="clRed"/>
<ahaSyncroEditOther FrameColor="9744532"/>
<ahaSyncroEditArea Background="clMoneyGreen"/>
<ahaGutterSeparator Background="clWhite" Foreground="clGray"/>
<ahaGutter Background="clBtnFace"/>
<ahaRightMargin Foreground="clSilver"/>
<ahaTopInfoHint Background="clActiveCaption" Foreground="clBlack" FrameColor="clMaroon" FrameStyle="slsDashed" FrameEdges="sfeBottom"/>
<ahaIfDefBlockInactive Foreground="clSilver" ForeAlpha="165"/>
</SchemeDefault>
</Globals>
<LangObjectPascal Version="6">

View File

@ -7,36 +7,42 @@
</Names>
<Globals Version="6">
<SchemeDelphi>
<ahaTextBlock Background="10841427" Foreground="clWhite"/>
<ahaExecutionPoint Background="10066380" Foreground="clBlack"/>
<ahaEnabledBreakpoint Background="16762823" Foreground="clBlack"/>
<ahaDisabledBreakpoint Background="16762823" Foreground="clGray"/>
<ahaInvalidBreakpoint Background="clGreen" Foreground="clWhite"/>
<ahaUnknownBreakpoint Background="16762823" Foreground="clBlack"/>
<ahaErrorLine Background="clRed" Foreground="clWhite"/>
<ahaIncrementalSearch Background="clBlack" Foreground="16580045"/>
<ahaHighlightAll Background="clYellow"/>
<ahaBracketMatch Background="clAqua" FrameColor="13421782"/>
<ahaMouseLink Foreground="clBlue"/>
<ahaExecutionPoint Background="10066380" Foreground="clBlack" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaEnabledBreakpoint Background="16762823" Foreground="clBlack" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaDisabledBreakpoint Background="16762823" Foreground="clGray" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaInvalidBreakpoint Background="clGreen" Foreground="clWhite" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaUnknownBreakpoint Background="16762823" Foreground="clBlack" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaErrorLine Background="clRed" Foreground="clWhite" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaLineHighlight Background="15138810" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaWordGroup FrameColor="clRed" ForePriority="3000" BackPriority="3000" FramePriority="3000"/>
<ahaBracketMatch Background="clAqua" FrameColor="13421782" ForePriority="3000" BackPriority="3000" FramePriority="3000"/>
<ahaHighlightWord FrameColor="13421782" ForePriority="3000" BackPriority="3000" FramePriority="3000"/>
<ahaIncrementalSearch Background="clBlack" Foreground="16580045" ForePriority="4000" BackPriority="4000" FramePriority="4000"/>
<ahaHighlightAll Background="clYellow" ForePriority="4000" BackPriority="4000" FramePriority="4000"/>
<ahaTemplateEditCur FrameColor="clAqua" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaTemplateEditSync FrameColor="clFuchsia" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaTemplateEditOther FrameColor="clMaroon" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditCur FrameColor="clFuchsia" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditSync FrameColor="clRed" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditOther FrameColor="clBlue" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditArea Background="16449510" ForePriority="2000" BackPriority="2000" FramePriority="2000"/>
<ahaTextBlock Background="10841427" Foreground="clWhite" ForePriority="7000" BackPriority="7000" FramePriority="7000"/>
<ahaMouseLink Foreground="clBlue" ForePriority="7500" BackPriority="7500" FramePriority="7500"/>
<ahaFoldedCode Foreground="13408665" FrameColor="13408665" ForePriority="8000" BackPriority="8000" FramePriority="8000"/>
<ahaSpecialVisibleChars ForePriority="8100" BackPriority="8100" FramePriority="8100"/>
<ahaTopInfoHint Background="clActiveCaption" Foreground="clBlack" FrameColor="clMaroon" FrameStyle="slsDashed" FrameEdges="sfeBottom" ForePriority="8500" BackPriority="8500" FramePriority="8500"/>
<ahaIfDefBlockInactive Foreground="clSilver" ForeAlpha="165" ForePriority="9050" BackPriority="9050" FramePriority="9050"/>
<ahaIfDefBlockActive ForePriority="9000" BackPriority="9000" FramePriority="9000"/>
<ahaIfDefBlockTmpActive ForePriority="9000" BackPriority="9000" FramePriority="9000"/>
<ahaIfDefNodeActive ForePriority="9050" BackPriority="9050" FramePriority="9050"/>
<ahaIfDefNodeInactive ForePriority="9150" BackPriority="9150" FramePriority="9150"/>
<ahaIfDefNodeTmpActive ForePriority="9050" BackPriority="9050" FramePriority="9050"/>
<ahaLineNumber Background="16053492" Foreground="13408665"/>
<ahaLineHighlight Background="15138810"/>
<ahaModifiedLine Background="16053492" Foreground="clLime" FrameColor="clYellow"/>
<ahaCodeFoldingTree Background="16053492" Foreground="13408665"/>
<ahaHighlightWord FrameColor="13421782"/>
<ahaFoldedCode Foreground="13408665" FrameColor="13408665"/>
<ahaWordGroup FrameColor="clRed"/>
<ahaTemplateEditCur FrameColor="clAqua"/>
<ahaTemplateEditSync FrameColor="clFuchsia"/>
<ahaTemplateEditOther FrameColor="clMaroon"/>
<ahaSyncroEditCur FrameColor="clFuchsia"/>
<ahaSyncroEditSync FrameColor="clRed"/>
<ahaSyncroEditOther FrameColor="clBlue"/>
<ahaSyncroEditArea Background="16449510"/>
<ahaGutterSeparator Background="clWhite" Foreground="clGray"/>
<ahaGutter Background="clBtnFace"/>
<ahaRightMargin Foreground="clSilver"/>
<ahaTopInfoHint Background="clActiveCaption" Foreground="clBlack" FrameColor="clMaroon" FrameStyle="slsDashed" FrameEdges="sfeBottom"/>
<ahaIfDefBlockInactive Foreground="clSilver" ForeAlpha="165"/>
</SchemeDelphi>
</Globals>
<LangObjectPascal Version="6">

View File

@ -8,34 +8,41 @@
<Globals Version="6">
<SchemeOcean>
<ahaDefault Background="clNavy" Foreground="clYellow"/>
<ahaTextBlock Background="clWhite" Foreground="clBlack"/>
<ahaExecutionPoint Background="clBlue" Foreground="clWhite"/>
<ahaEnabledBreakpoint Background="clRed" Foreground="clWhite"/>
<ahaDisabledBreakpoint Background="clLime" Foreground="clRed"/>
<ahaInvalidBreakpoint Background="clOlive" Foreground="clGreen"/>
<ahaUnknownBreakpoint Background="clRed" Foreground="clBlack"/>
<ahaErrorLine Background="5284095" Foreground="clBlack"/>
<ahaIncrementalSearch Background="3199088" Foreground="clWhite"/>
<ahaHighlightAll Background="clYellow"/>
<ahaBracketMatch Style="fsBold"/>
<ahaMouseLink Foreground="clBlue"/>
<ahaExecutionPoint Background="clBlue" Foreground="clWhite" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaEnabledBreakpoint Background="clRed" Foreground="clWhite" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaDisabledBreakpoint Background="clLime" Foreground="clRed" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaInvalidBreakpoint Background="clOlive" Foreground="clGreen" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaUnknownBreakpoint Background="clRed" Foreground="clBlack" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaErrorLine Background="5284095" Foreground="clBlack" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaLineHighlight ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaWordGroup FrameColor="clRed" ForePriority="3000" BackPriority="3000" FramePriority="3000"/>
<ahaBracketMatch Style="fsBold" ForePriority="3000" BackPriority="3000" FramePriority="3000"/>
<ahaHighlightWord FrameColor="clSilver" ForePriority="3000" BackPriority="3000" FramePriority="3000"/>
<ahaIncrementalSearch Background="3199088" Foreground="clWhite" ForePriority="4000" BackPriority="4000" FramePriority="4000"/>
<ahaHighlightAll Background="clYellow" ForePriority="4000" BackPriority="4000" FramePriority="4000"/>
<ahaTemplateEditCur FrameColor="clAqua" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaTemplateEditSync FrameColor="clFuchsia" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaTemplateEditOther FrameColor="clMaroon" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditCur FrameColor="clFuchsia" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditSync FrameColor="clRed" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditOther FrameColor="9744532" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditArea Background="clMoneyGreen" ForePriority="2000" BackPriority="2000" FramePriority="2000"/>
<ahaTextBlock Background="clWhite" Foreground="clBlack" ForePriority="7000" BackPriority="7000" FramePriority="7000"/>
<ahaMouseLink Foreground="clBlue" ForePriority="7500" BackPriority="7500" FramePriority="7500"/>
<ahaFoldedCode Foreground="clSilver" FrameColor="clSilver" ForePriority="8000" BackPriority="8000" FramePriority="8000"/>
<ahaSpecialVisibleChars ForePriority="8100" BackPriority="8100" FramePriority="8100"/>
<ahaTopInfoHint Background="clPurple" Foreground="clYellow" FrameColor="clOlive" FrameStyle="slsDashed" ForePriority="8500" BackPriority="8500" FramePriority="8500"/>
<ahaIfDefBlockInactive Foreground="clBlack" ForeAlpha="150" ForePriority="9050" BackPriority="9050" FramePriority="9050"/>
<ahaIfDefBlockActive ForePriority="9000" BackPriority="9000" FramePriority="9000"/>
<ahaIfDefBlockTmpActive ForePriority="9000" BackPriority="9000" FramePriority="9000"/>
<ahaIfDefNodeActive ForePriority="9050" BackPriority="9050" FramePriority="9050"/>
<ahaIfDefNodeInactive ForePriority="9150" BackPriority="9150" FramePriority="9150"/>
<ahaIfDefNodeTmpActive ForePriority="9050" BackPriority="9050" FramePriority="9050"/>
<ahaModifiedLine Foreground="clGreen" FrameColor="59900"/>
<ahaCodeFoldingTree Foreground="clSilver"/>
<ahaHighlightWord FrameColor="clSilver"/>
<ahaFoldedCode Foreground="clSilver" FrameColor="clSilver"/>
<ahaWordGroup FrameColor="clRed"/>
<ahaTemplateEditCur FrameColor="clAqua"/>
<ahaTemplateEditSync FrameColor="clFuchsia"/>
<ahaTemplateEditOther FrameColor="clMaroon"/>
<ahaSyncroEditCur FrameColor="clFuchsia"/>
<ahaSyncroEditSync FrameColor="clRed"/>
<ahaSyncroEditOther FrameColor="9744532"/>
<ahaSyncroEditArea Background="clMoneyGreen"/>
<ahaGutterSeparator Background="clWhite" Foreground="clGray"/>
<ahaGutter Background="clBtnFace"/>
<ahaRightMargin Foreground="clSilver"/>
<ahaTopInfoHint Background="clPurple" Foreground="clYellow" FrameColor="clOlive" FrameStyle="slsDashed"/>
<ahaIfDefBlockInactive Foreground="clBlack" ForeAlpha="150"/>
</SchemeOcean>
</Globals>
<LangObjectPascal Version="6">

View File

@ -8,33 +8,40 @@
<Globals Version="6">
<SchemePascal_Classic>
<ahaDefault Background="clNavy" Foreground="clYellow"/>
<ahaTextBlock Background="clBlue" Foreground="clWhite"/>
<ahaExecutionPoint Background="clAqua" Foreground="clBlack"/>
<ahaEnabledBreakpoint Background="clRed" Foreground="clWhite"/>
<ahaDisabledBreakpoint Background="clLime" Foreground="clRed"/>
<ahaInvalidBreakpoint Background="clOlive" Foreground="clLime"/>
<ahaErrorLine Background="clMaroon" Foreground="clWhite"/>
<ahaIncrementalSearch Background="3199088" Foreground="clWhite"/>
<ahaHighlightAll Background="clYellow"/>
<ahaBracketMatch Style="fsBold"/>
<ahaMouseLink Foreground="clBlue"/>
<ahaExecutionPoint Background="clAqua" Foreground="clBlack" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaEnabledBreakpoint Background="clRed" Foreground="clWhite" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaDisabledBreakpoint Background="clLime" Foreground="clRed" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaInvalidBreakpoint Background="clOlive" Foreground="clLime" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaErrorLine Background="clMaroon" Foreground="clWhite" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaLineHighlight ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaWordGroup FrameColor="clRed" ForePriority="3000" BackPriority="3000" FramePriority="3000"/>
<ahaBracketMatch Style="fsBold" ForePriority="3000" BackPriority="3000" FramePriority="3000"/>
<ahaHighlightWord FrameColor="clSilver" ForePriority="3000" BackPriority="3000" FramePriority="3000"/>
<ahaIncrementalSearch Background="3199088" Foreground="clWhite" ForePriority="4000" BackPriority="4000" FramePriority="4000"/>
<ahaHighlightAll Background="clYellow" ForePriority="4000" BackPriority="4000" FramePriority="4000"/>
<ahaTemplateEditCur FrameColor="clAqua" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaTemplateEditSync FrameColor="clFuchsia" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaTemplateEditOther FrameColor="clMaroon" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditCur FrameColor="clFuchsia" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditSync FrameColor="clRed" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditOther FrameColor="9744532" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditArea Background="clMoneyGreen" ForePriority="2000" BackPriority="2000" FramePriority="2000"/>
<ahaTextBlock Background="clBlue" Foreground="clWhite" ForePriority="7000" BackPriority="7000" FramePriority="7000"/>
<ahaMouseLink Foreground="clBlue" ForePriority="7500" BackPriority="7500" FramePriority="7500"/>
<ahaFoldedCode Foreground="clSilver" FrameColor="clSilver" ForePriority="8000" BackPriority="8000" FramePriority="8000"/>
<ahaSpecialVisibleChars ForePriority="8100" BackPriority="8100" FramePriority="8100"/>
<ahaTopInfoHint Background="clPurple" Foreground="clYellow" FrameColor="clOlive" FrameStyle="slsDashed" ForePriority="8500" BackPriority="8500" FramePriority="8500"/>
<ahaIfDefBlockInactive Foreground="clBlack" ForeAlpha="150" ForePriority="9050" BackPriority="9050" FramePriority="9050"/>
<ahaIfDefBlockActive ForePriority="9000" BackPriority="9000" FramePriority="9000"/>
<ahaIfDefBlockTmpActive ForePriority="9000" BackPriority="9000" FramePriority="9000"/>
<ahaIfDefNodeActive ForePriority="9050" BackPriority="9050" FramePriority="9050"/>
<ahaIfDefNodeInactive ForePriority="9150" BackPriority="9150" FramePriority="9150"/>
<ahaIfDefNodeTmpActive ForePriority="9050" BackPriority="9050" FramePriority="9050"/>
<ahaModifiedLine Foreground="clGreen" FrameColor="59900"/>
<ahaCodeFoldingTree Foreground="clSilver"/>
<ahaHighlightWord FrameColor="clSilver"/>
<ahaFoldedCode Foreground="clSilver" FrameColor="clSilver"/>
<ahaWordGroup FrameColor="clRed"/>
<ahaTemplateEditCur FrameColor="clAqua"/>
<ahaTemplateEditSync FrameColor="clFuchsia"/>
<ahaTemplateEditOther FrameColor="clMaroon"/>
<ahaSyncroEditCur FrameColor="clFuchsia"/>
<ahaSyncroEditSync FrameColor="clRed"/>
<ahaSyncroEditOther FrameColor="9744532"/>
<ahaSyncroEditArea Background="clMoneyGreen"/>
<ahaGutterSeparator Background="clWhite" Foreground="clGray"/>
<ahaGutter Background="clBtnFace"/>
<ahaRightMargin Foreground="clSilver"/>
<ahaTopInfoHint Background="clPurple" Foreground="clYellow" FrameColor="clOlive" FrameStyle="slsDashed"/>
<ahaIfDefBlockInactive Foreground="clBlack" ForeAlpha="150"/>
</SchemePascal_Classic>
</Globals>
<LangObjectPascal Version="6">

View File

@ -8,34 +8,41 @@
<Globals Version="6">
<SchemeTwilight>
<ahaDefault Background="clBlack" Foreground="clWhite"/>
<ahaTextBlock Background="clWhite" Foreground="clBlack"/>
<ahaExecutionPoint Background="clBlue" Foreground="clWhite"/>
<ahaEnabledBreakpoint Background="clRed" Foreground="clWhite"/>
<ahaDisabledBreakpoint Background="clLime" Foreground="clRed"/>
<ahaInvalidBreakpoint Background="clOlive" Foreground="clGreen"/>
<ahaUnknownBreakpoint Background="clRed" Foreground="clBlack"/>
<ahaErrorLine Background="5284095" Foreground="clBlack"/>
<ahaIncrementalSearch Background="3199088" Foreground="clWhite"/>
<ahaHighlightAll Background="clYellow"/>
<ahaBracketMatch Style="fsBold"/>
<ahaMouseLink Foreground="clBlue"/>
<ahaExecutionPoint Background="clBlue" Foreground="clWhite" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaEnabledBreakpoint Background="clRed" Foreground="clWhite" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaDisabledBreakpoint Background="clLime" Foreground="clRed" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaInvalidBreakpoint Background="clOlive" Foreground="clGreen" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaUnknownBreakpoint Background="clRed" Foreground="clBlack" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaErrorLine Background="5284095" Foreground="clBlack" ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaLineHighlight ForePriority="500" BackPriority="500" FramePriority="500"/>
<ahaWordGroup FrameColor="clRed" ForePriority="3000" BackPriority="3000" FramePriority="3000"/>
<ahaBracketMatch Style="fsBold" ForePriority="3000" BackPriority="3000" FramePriority="3000"/>
<ahaHighlightWord Background="3158064" FrameColor="clSilver" ForePriority="3000" BackPriority="3000" FramePriority="3000"/>
<ahaIncrementalSearch Background="3199088" Foreground="clWhite" ForePriority="4000" BackPriority="4000" FramePriority="4000"/>
<ahaHighlightAll Background="clYellow" ForePriority="4000" BackPriority="4000" FramePriority="4000"/>
<ahaTemplateEditCur FrameColor="clAqua" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaTemplateEditSync FrameColor="clFuchsia" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaTemplateEditOther FrameColor="clMaroon" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditCur FrameColor="clFuchsia" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditSync FrameColor="clRed" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditOther FrameColor="9744532" ForePriority="6000" BackPriority="6000" FramePriority="6000"/>
<ahaSyncroEditArea Background="clMoneyGreen" ForePriority="2000" BackPriority="2000" FramePriority="2000"/>
<ahaTextBlock Background="clWhite" Foreground="clBlack" ForePriority="7000" BackPriority="7000" FramePriority="7000"/>
<ahaMouseLink Foreground="clBlue" ForePriority="7500" BackPriority="7500" FramePriority="7500"/>
<ahaFoldedCode Foreground="clSilver" FrameColor="clSilver" ForePriority="8000" BackPriority="8000" FramePriority="8000"/>
<ahaSpecialVisibleChars ForePriority="8100" BackPriority="8100" FramePriority="8100"/>
<ahaTopInfoHint Background="clPurple" Foreground="clYellow" FrameColor="clOlive" FrameStyle="slsDashed" ForePriority="8500" BackPriority="8500" FramePriority="8500"/>
<ahaIfDefBlockInactive Foreground="clBlack" ForeAlpha="150" ForePriority="9050" BackPriority="9050" FramePriority="9050"/>
<ahaIfDefBlockActive ForePriority="9000" BackPriority="9000" FramePriority="9000"/>
<ahaIfDefBlockTmpActive ForePriority="9000" BackPriority="9000" FramePriority="9000"/>
<ahaIfDefNodeActive ForePriority="9050" BackPriority="9050" FramePriority="9050"/>
<ahaIfDefNodeInactive ForePriority="9150" BackPriority="9150" FramePriority="9150"/>
<ahaIfDefNodeTmpActive ForePriority="9050" BackPriority="9050" FramePriority="9050"/>
<ahaModifiedLine Foreground="clGreen" FrameColor="59900"/>
<ahaCodeFoldingTree Foreground="clSilver"/>
<ahaHighlightWord Background="3158064" FrameColor="clSilver"/>
<ahaFoldedCode Foreground="clSilver" FrameColor="clSilver"/>
<ahaWordGroup FrameColor="clRed"/>
<ahaTemplateEditCur FrameColor="clAqua"/>
<ahaTemplateEditSync FrameColor="clFuchsia"/>
<ahaTemplateEditOther FrameColor="clMaroon"/>
<ahaSyncroEditCur FrameColor="clFuchsia"/>
<ahaSyncroEditSync FrameColor="clRed"/>
<ahaSyncroEditOther FrameColor="9744532"/>
<ahaSyncroEditArea Background="clMoneyGreen"/>
<ahaGutterSeparator Background="clWhite" Foreground="clGray"/>
<ahaGutter Background="clBtnFace"/>
<ahaRightMargin Foreground="clSilver"/>
<ahaTopInfoHint Background="clPurple" Foreground="clYellow" FrameColor="clOlive" FrameStyle="slsDashed"/>
<ahaIfDefBlockInactive Foreground="clBlack" ForeAlpha="150"/>
</SchemeTwilight>
</Globals>
<LangObjectPascal Version="6">

View File

@ -273,6 +273,7 @@ type
procedure ApplyTo(aDest: TSynHighlighterAttributes; aDefault: TColorSchemeAttribute = nil);
procedure Assign(Src: TPersistent); override;
function Equals(Other: TColorSchemeAttribute): Boolean; reintroduce;
function GetStoredValuesForAttrib: TColorSchemeAttribute; // The IDE default colors from the resources
function GetSchemeGlobal: TColorSchemeAttribute;
procedure LoadFromXml(aXMLConfig: TRttiXMLConfig; aPath: String;
Defaults: TColorSchemeAttribute; Version: Integer);
@ -313,6 +314,7 @@ type
procedure Clear;
procedure Assign(Src: TColorSchemeLanguage); reintroduce;
function Equals(Other: TColorSchemeLanguage): Boolean; reintroduce;
function GetStoredValuesForLanguage: TColorSchemeLanguage; // The IDE default colors from the resources
function IndexOfAttr(AnAttr: TColorSchemeAttribute): Integer;
procedure LoadFromXml(aXMLConfig: TRttiXMLConfig; aPath: String; Defaults: TColorSchemeLanguage;
ColorVersion: Integer; aOldPath: String = '');
@ -345,6 +347,7 @@ type
constructor CreateFromXml(aXMLConfig: TRttiXMLConfig; const AName, aPath: String);
destructor Destroy; override;
procedure Assign(Src: TColorScheme); reintroduce;
function GetStoredValuesForScheme: TColorScheme; // The IDE default colors from the resources
procedure LoadFromXml(aXMLConfig: TRttiXMLConfig; aPath: String;
Defaults: TColorScheme; aOldPath: String = '');
procedure SaveToXml(aXMLConfig: TRttiXMLConfig; aPath: String; Defaults: TColorScheme);
@ -1207,6 +1210,8 @@ type
const
EditorUserDefinedWordsKeyCatName = 'User defined word markup';
MARKUP_USER_DEF_PRIOR = 3500;
var
EditorUserDefinedWordsGlobalId: string = 'a';
@ -1993,6 +1998,7 @@ begin
FColorAttr := TColorSchemeAttribute.Create(nil, '');
FColorAttr.Features := [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior,hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask];
FColorAttr.Group := agnText;
FColorAttr.SetAllPriorities(MARKUP_USER_DEF_PRIOR);
FKeyAddSelectSmart := True;
end;
@ -2047,6 +2053,7 @@ begin
def.Free;
ColorDef := TColorSchemeAttribute.Create(nil, '');
ColorDef.SetAllPriorities(MARKUP_USER_DEF_PRIOR);
FColorAttr.StoredName := 'c1';
FColorAttr.LoadFromXml(XMLConfig, Path + 'Color/', ColorDef, EditorOptsFormatVersion);
ColorDef.Free;
@ -2128,6 +2135,7 @@ begin
def.Free;
ColorDef := TColorSchemeAttribute.Create(nil, '');
ColorDef.SetAllPriorities(MARKUP_USER_DEF_PRIOR);
FColorAttr.StoredName := 'c1';
FColorAttr.SaveToXml(XMLConfig, Path + 'Color/', ColorDef);
ColorDef.Free;
@ -2648,6 +2656,21 @@ begin
' mrCancel, mrIgnore: dec(X);'#13+
' end;'#13+
' ListBox1.Items.Add(IntToStr(X));'#13 +
//{$IFDEF WithSynMarkupIfDef}
// ' {$IFDEF Foo}' +
// ' X := X + 1.0; {$R-} { Error line }'#13 +
// ' {$DEFINE a}' +
// ' case ModalResult of'#13+
// ' mrOK: inc(X);'#13+
// ' mrCancel, mrIgnore: dec(X);'#13+
// ' end;'#13+
// ' {$ELSE}' +
// ' {%region teset}'#13 +
// ' {%endregion}'#13 +
// ' with self do'#13 +
// ' X := 10;'#13 +
// ' {$ENDIF}' +
//{$ENDIF}
' end;'#13 +
'end;'#13 + #13;
AddAttrSampleLines[ahaDisabledBreakpoint] := 20;
@ -5650,6 +5673,15 @@ begin
TSynHighlighterAttributesModifier(aDest).ForeAlpha := Src.ForeAlpha;
TSynHighlighterAttributesModifier(aDest).BackAlpha := Src.BackAlpha;
TSynHighlighterAttributesModifier(aDest).FrameAlpha := Src.FrameAlpha;
if hafPrior in Src.Features then begin
TSynHighlighterAttributesModifier(aDest).ForePriority := Src.ForePriority;
TSynHighlighterAttributesModifier(aDest).BackPriority := Src.BackPriority;
TSynHighlighterAttributesModifier(aDest).FramePriority := Src.FramePriority;
TSynHighlighterAttributesModifier(aDest).BoldPriority := Src.BoldPriority;
TSynHighlighterAttributesModifier(aDest).ItalicPriority := Src.ItalicPriority;
TSynHighlighterAttributesModifier(aDest).UnderlinePriority := Src.UnderlinePriority;
end;
end;
if not (aDest is TSynSelectedColor) then begin
@ -5713,6 +5745,13 @@ begin
(Features = Other.Features);
end;
function TColorSchemeAttribute.GetStoredValuesForAttrib: TColorSchemeAttribute;
begin
Result := nil;
if (FOwner <> nil) and (FOwner.GetStoredValuesForLanguage <> nil) then
Result := FOwner.GetStoredValuesForLanguage.Attribute[StoredName];
end;
procedure TColorSchemeAttribute.LoadFromXml(aXMLConfig: TRttiXMLConfig; aPath: String;
Defaults: TColorSchemeAttribute; Version: Integer);
var
@ -5775,6 +5814,12 @@ begin
Style := Defaults.Style;
StyleMask := Defaults.StyleMask;
UseSchemeGlobals := Defaults.UseSchemeGlobals;
ForePriority := Defaults.ForePriority;
BackPriority := Defaults.BackPriority;
FramePriority := Defaults.FramePriority;
BoldPriority := Defaults.BoldPriority;
ItalicPriority := Defaults.ItalicPriority;
UnderlinePriority := Defaults.UnderlinePriority;
end;
if (Version <= 5) and (Defaults = Self) then // Data was loaded above (Vers < 5)
UseSchemeGlobals := False;
@ -5853,6 +5898,13 @@ begin
Result := GetEnumName(TypeInfo(TAdditionalHilightAttribute), ord(aha));
end;
function TColorSchemeLanguage.GetStoredValuesForLanguage: TColorSchemeLanguage;
begin
Result := nil;
if (FOwner <> nil) and (FOwner.GetStoredValuesForScheme <> nil) then
Result := FOwner.GetStoredValuesForScheme.ColorScheme[FLanguage];
end;
constructor TColorSchemeLanguage.Create(const AGroup: TColorScheme;
const ALang: TLazSyntaxHighlighter; IsSchemeDefault: Boolean = False);
begin
@ -5875,7 +5927,7 @@ end;
constructor TColorSchemeLanguage.CreateFromXml(const AGroup: TColorScheme;
const ALang: TLazSyntaxHighlighter; aXMLConfig: TRttiXMLConfig; aPath: String;
IsSchemeDefault: Boolean = False);
IsSchemeDefault: Boolean);
var
csa: TColorSchemeAttribute;
i: Integer;
@ -5910,7 +5962,7 @@ begin
FormatVersion := aXMLConfig.GetValue(aPath + 'Version', 0);
LoadFromXml(aXMLConfig, aPath, nil, FormatVersion);
AttributeByEnum[ahaMouseLink].FramePriority := 9999;
end;
destructor TColorSchemeLanguage.Destroy;
@ -5999,10 +6051,14 @@ begin
TmpPath := aPath + 'Lang' + StrToValidXMLName(FLanguageName) + '/'
else
TmpPath := aPath;
FormatVersion := aXMLConfig.GetValue(TmpPath + 'Version', 0);
if FormatVersion > ColorVersion then
FormatVersion := ColorVersion;
if FIsSchemeDefault and (FormatVersion < 6) then
if aXMLConfig.HasChildPaths(TmpPath) then begin
FormatVersion := aXMLConfig.GetValue(TmpPath + 'Version', 0);
if FormatVersion > ColorVersion then
FormatVersion := ColorVersion;
if FIsSchemeDefault and (FormatVersion < 6) then
FormatVersion := 6;
end
else
FormatVersion := 6;
TmpPath := TmpPath + 'Scheme' + StrToValidXMLName(Name) + '/';
@ -6272,23 +6328,29 @@ begin
Result := nil;
end;
function TColorScheme.GetStoredValuesForScheme: TColorScheme;
begin
ColorSchemeFactory.ColorSchemeGroup[Name];
end;
constructor TColorScheme.Create(AName: String);
begin
inherited Create;
FName := AName;
end;
constructor TColorScheme.CreateFromXml(aXMLConfig: TRttiXMLConfig; const AName,
aPath: String);
constructor TColorScheme.CreateFromXml(aXMLConfig: TRttiXMLConfig; const AName, aPath: String);
var
i: TLazSyntaxHighlighter;
begin
Create(AName);
FDefaultColors := TColorSchemeLanguage.CreateFromXml(Self, lshNone, aXMLConfig, aPath + 'Globals/', True);
FDefaultColors := TColorSchemeLanguage.CreateFromXml(Self, lshNone, aXMLConfig,
aPath + 'Globals/', True);
for i := low(TLazSyntaxHighlighter) to high(TLazSyntaxHighlighter) do
// do not create duplicates
if CompatibleLazSyntaxHilighter[i] = i then
FColorSchemes[i] := TColorSchemeLanguage.CreateFromXml(Self, i, aXMLConfig, aPath)
FColorSchemes[i] := TColorSchemeLanguage.CreateFromXml(Self, i, aXMLConfig,
aPath)
else
FColorSchemes[i] := nil;
end;
@ -6467,8 +6529,7 @@ begin
end
end;
procedure TColorSchemeFactory.RegisterScheme(aXMLConfig: TRttiXMLConfig; AName,
aPath: String);
procedure TColorSchemeFactory.RegisterScheme(aXMLConfig: TRttiXMLConfig; AName, aPath: String);
var
i, j: integer;
lMapping: TColorScheme;

Binary file not shown.

View File

@ -7,8 +7,8 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
ClientWidth = 640
TabOrder = 0
Visible = False
DesignLeft = 420
DesignTop = 200
DesignLeft = 401
DesignTop = 103
object pnlElementAttributes: TPanel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = PnlTop2
@ -18,13 +18,13 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 200
Top = 243
Height = 192
Top = 251
Width = 640
Anchors = [akLeft, akRight, akBottom]
AutoSize = True
BevelOuter = bvNone
ClientHeight = 200
ClientHeight = 192
ClientWidth = 640
Constraints.MinHeight = 192
TabOrder = 1
@ -65,7 +65,7 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
end
object tbtnLocal: TToolButton
Tag = 1
Left = 74
Left = 65
Top = 0
AutoSize = True
Caption = 'tbtnLocal'
@ -74,18 +74,44 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
Style = tbsCheck
end
object SetAttributeToDefaultButton: TToolButton
Left = 150
Left = 249
Top = 0
OnClick = SetAttributeToDefaultButtonClick
ShowCaption = False
end
object ToolButton3: TToolButton
Left = 140
Left = 239
Top = 0
Width = 10
Caption = 'ToolButton3'
Style = tbsSeparator
end
object ToolButton1: TToolButton
Left = 123
Top = 0
Width = 10
Caption = 'ToolButton1'
Style = tbsSeparator
end
object tbnColor: TToolButton
Left = 133
Top = 0
AutoSize = True
Caption = 'tbnColor'
Down = True
Grouped = True
OnClick = tbnColorClick
Style = tbsCheck
end
object tbnPrior: TToolButton
Left = 188
Top = 0
AutoSize = True
Caption = 'tbnPrior'
Grouped = True
OnClick = tbnColorClick
Style = tbsCheck
end
end
inline SynColorAttrEditor1: TSynColorAttrEditor
AnchorSideLeft.Control = pnlElementAttributes
@ -95,165 +121,342 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = pnlElementAttributes
AnchorSideBottom.Side = asrBottom
Height = 159
Height = 151
Top = 41
Width = 640
Anchors = [akTop, akLeft, akRight, akBottom]
ClientHeight = 159
ClientHeight = 151
ClientWidth = 640
TabOrder = 1
inherited ForeGroundLabel: TLabel
Top = 8
Width = 107
end
inherited BackGroundLabel: TLabel
Top = 35
Width = 109
end
inherited ForeGroundUseDefaultCheckBox: TCheckBox
AnchorSideLeft.Control = SynColorAttrEditor1
Height = 21
Width = 228
end
inherited ForegroundColorBox: TColorBox
AnchorSideTop.Control = SynColorAttrEditor1
AnchorSideRight.Control = SynColorAttrEditor1
Left = 240
Height = 24
Width = 200
end
inherited BackGroundColorBox: TColorBox
AnchorSideRight.Control = SynColorAttrEditor1
Left = 240
Height = 24
Top = 30
Width = 200
end
inherited BackGroundUseDefaultCheckBox: TCheckBox
Height = 21
Top = 32
Width = 230
AnchorSideLeft.Control = SynColorAttrEditor1
end
inherited FrameColorBox: TColorBox
AnchorSideRight.Control = SynColorAttrEditor1
Left = 240
Height = 24
Top = 57
Width = 200
end
inherited FrameColorUseDefaultCheckBox: TCheckBox
Height = 21
Top = 59
Width = 224
AnchorSideLeft.Control = SynColorAttrEditor1
end
inherited pnlUnderline: TPanel
Height = 44
Top = 111
Width = 169
ClientHeight = 44
ClientWidth = 169
inherited TextUnderlineRadioPanel: TPanel
AnchorSideLeft.Control = SynColorAttrEditor1
end
inherited ForeAlphaLabel: TLabel
Left = 414
end
inherited BackAlphaLabel: TLabel
Left = 414
end
inherited FrameAlphaLabel: TLabel
Left = 414
end
inherited ForeAlphaSpin: TSpinEdit
Left = 502
end
inherited BackAlphaSpin: TSpinEdit
Left = 504
end
inherited FrameAlphaSpin: TSpinEdit
Left = 512
end
inherited ForePriorLabel: TLabel
Left = 567
end
inherited BackPriorLabel: TLabel
Left = 569
end
inherited FramePriorLabel: TLabel
Left = 577
end
inherited ForePriorSpin: TSpinEdit
Left = 649
end
inherited BackPriorSpin: TSpinEdit
Left = 653
end
inherited FramePriorSpin: TSpinEdit
Left = 669
end
end
object PriorityEditor: TPanel
AnchorSideLeft.Control = pnlElementAttributes
AnchorSideTop.Control = ToolBar1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = pnlElementAttributes
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = pnlElementAttributes
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 151
Top = 41
Width = 640
Anchors = [akTop, akLeft, akRight, akBottom]
ClientHeight = 151
ClientWidth = 640
Constraints.MinHeight = 140
TabOrder = 2
object ForePriorPanel: TPanel
Left = 1
Height = 149
Top = 1
Width = 170
Align = alLeft
ClientHeight = 149
ClientWidth = 170
TabOrder = 0
object ForePriorLabel: TLabel
Left = 1
Height = 15
Top = 1
Width = 168
Align = alTop
Caption = 'ForePriorLabel'
ParentColor = False
end
object ForePriorList: TTreeView
Left = 1
Height = 108
Top = 16
Width = 168
Align = alClient
AutoExpand = True
DefaultItemHeight = 18
ReadOnly = True
ScrollBars = ssAutoVertical
ShowButtons = False
ShowLines = False
ShowRoot = False
SortType = stData
TabOrder = 0
OnAdvancedCustomDrawItem = ColorElementTreeAdvancedCustomDrawItem
OnClick = ForePriorListClick
OnCompare = ForePriorListCompare
Options = [tvoAutoExpand, tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoToolTips, tvoNoDoubleClickExpand, tvoThemedDraw]
TreeLinePenStyle = psClear
end
object ForePriorValPanel: TPanel
Left = 1
Height = 23
Top = 21
Width = 155
Top = 125
Width = 168
Align = alBottom
AutoSize = True
BorderSpacing.Top = 1
BevelOuter = bvNone
ClientHeight = 23
ClientWidth = 155
inherited TextUnderlineRadioOn: TRadioButton
Height = 21
Width = 42
ClientWidth = 168
TabOrder = 1
object ForePriorEdit: TEdit
AnchorSideRight.Control = ForePriorUpDown
Left = 1
Height = 23
Top = 1
Width = 147
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Right = 3
OnEditingDone = ForePriorEditChange
OnKeyPress = ForePriorEditKeyPress
TabOrder = 0
Text = '0'
end
inherited TextUnderlineRadioOff: TRadioButton
Left = 49
Height = 21
Width = 42
object ForePriorUpDown: TUpDown
AnchorSideTop.Control = ForePriorValPanel
AnchorSideRight.Control = ForePriorValPanel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = ForePriorValPanel
AnchorSideBottom.Side = asrBottom
Left = 151
Height = 23
Top = 0
Width = 17
Anchors = [akTop, akRight, akBottom]
Min = 0
Position = 0
TabOrder = 1
Wrap = False
OnClick = ForePriorUpDownClick
end
inherited TextUnderlineRadioInvert: TRadioButton
Left = 94
Height = 21
Width = 60
end
end
inherited TextUnderlineCheckBox: TCheckBox
Height = 21
Width = 169
end
end
inherited pnlBold: TPanel
Left = 181
Height = 44
Top = 111
Width = 155
ClientHeight = 44
ClientWidth = 155
inherited TextBoldRadioPanel: TPanel
object BackPriorPanel: TPanel
Left = 177
Height = 149
Top = 1
Width = 170
Align = alLeft
BorderSpacing.Left = 6
ClientHeight = 149
ClientWidth = 170
TabOrder = 1
object BackPriorLabel: TLabel
Left = 1
Height = 15
Top = 1
Width = 168
Align = alTop
Caption = 'Label1'
ParentColor = False
end
object BackPriorList: TTreeView
Left = 1
Height = 108
Top = 16
Width = 168
Align = alClient
AutoExpand = True
DefaultItemHeight = 18
ReadOnly = True
ScrollBars = ssAutoVertical
ShowButtons = False
ShowLines = False
ShowRoot = False
SortType = stData
TabOrder = 0
OnAdvancedCustomDrawItem = ColorElementTreeAdvancedCustomDrawItem
OnClick = ForePriorListClick
OnCompare = ForePriorListCompare
Options = [tvoAutoExpand, tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoToolTips, tvoNoDoubleClickExpand, tvoThemedDraw]
TreeLinePenStyle = psClear
end
object BackPriorValPanel: TPanel
Left = 1
Height = 23
Top = 21
Width = 155
Top = 125
Width = 168
Align = alBottom
AutoSize = True
BorderSpacing.Top = 1
BevelOuter = bvNone
ClientHeight = 23
ClientWidth = 155
inherited TextBoldRadioInvert: TRadioButton
Left = 94
Height = 21
Width = 60
ClientWidth = 168
TabOrder = 1
object BackPriorEdit: TEdit
AnchorSideRight.Control = BackPriorUpDown
Left = 0
Height = 23
Top = 0
Width = 148
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Right = 3
OnEditingDone = ForePriorEditChange
OnKeyPress = ForePriorEditKeyPress
TabOrder = 0
Text = '0'
end
inherited TextBoldRadioOn: TRadioButton
Height = 21
Width = 42
object BackPriorUpDown: TUpDown
AnchorSideTop.Control = BackPriorValPanel
AnchorSideRight.Control = BackPriorValPanel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = BackPriorValPanel
AnchorSideBottom.Side = asrBottom
Left = 151
Height = 23
Top = 0
Width = 17
Anchors = [akTop, akRight, akBottom]
Min = 0
Position = 0
TabOrder = 1
Wrap = False
OnClick = ForePriorUpDownClick
end
inherited TextBoldRadioOff: TRadioButton
Left = 49
Height = 21
Width = 42
end
end
inherited TextBoldCheckBox: TCheckBox
Height = 21
Width = 136
end
end
inherited pnlItalic: TPanel
Left = 342
Height = 44
Top = 111
Width = 155
ClientHeight = 44
ClientWidth = 155
inherited TextItalicRadioPanel: TPanel
object FramePriorPanel: TPanel
Left = 353
Height = 149
Top = 1
Width = 170
Align = alLeft
BorderSpacing.Left = 6
ClientHeight = 149
ClientWidth = 170
TabOrder = 2
object FramePriorLabel: TLabel
Left = 1
Height = 15
Top = 1
Width = 168
Align = alTop
Caption = 'Label1'
ParentColor = False
end
object FramePriorList: TTreeView
Left = 1
Height = 108
Top = 16
Width = 168
Align = alClient
AutoExpand = True
DefaultItemHeight = 18
ReadOnly = True
ScrollBars = ssAutoVertical
ShowButtons = False
ShowLines = False
ShowRoot = False
SortType = stData
TabOrder = 0
OnAdvancedCustomDrawItem = ColorElementTreeAdvancedCustomDrawItem
OnClick = ForePriorListClick
OnCompare = ForePriorListCompare
Options = [tvoAutoExpand, tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoToolTips, tvoNoDoubleClickExpand, tvoThemedDraw]
TreeLinePenStyle = psClear
end
object FramePriorValPanel: TPanel
Left = 1
Height = 23
Top = 21
Width = 155
Top = 125
Width = 168
Align = alBottom
AutoSize = True
BorderSpacing.Top = 1
BevelOuter = bvNone
ClientHeight = 23
ClientWidth = 155
inherited TextItalicRadioInvert: TRadioButton
Left = 94
Height = 21
Width = 60
ClientWidth = 168
TabOrder = 1
object FramePriorEdit: TEdit
AnchorSideRight.Control = FramePriorUpDown
Left = 0
Height = 23
Top = 0
Width = 148
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Right = 3
OnEditingDone = ForePriorEditChange
OnKeyPress = ForePriorEditKeyPress
TabOrder = 0
Text = '0'
end
inherited TextItalicRadioOn: TRadioButton
Height = 21
Width = 42
end
inherited TextItalicRadioOff: TRadioButton
Left = 49
Height = 21
Width = 42
object FramePriorUpDown: TUpDown
AnchorSideTop.Control = FramePriorValPanel
AnchorSideRight.Control = FramePriorValPanel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = FramePriorValPanel
AnchorSideBottom.Side = asrBottom
Left = 151
Height = 23
Top = 0
Width = 17
Anchors = [akTop, akRight, akBottom]
Min = 0
Position = 0
TabOrder = 1
Wrap = False
OnClick = ForePriorUpDownClick
end
end
inherited TextItalicCheckBox: TCheckBox
Height = 21
Width = 138
end
end
inherited FrameStyleBox: TComboBox
Left = 343
Height = 24
Top = 84
end
inherited FrameEdgesBox: TComboBox
Left = 240
Height = 24
Top = 84
end
inherited ColumnPosBevel: TPanel
Left = 240
Top = 158
end
end
end
@ -283,17 +486,17 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = pnlElementAttributes
Left = 0
Height = 218
Height = 226
Top = 25
Width = 640
Anchors = [akTop, akLeft, akRight, akBottom]
BevelOuter = bvNone
ClientHeight = 218
ClientHeight = 226
ClientWidth = 640
TabOrder = 2
object ColorElementTree: TTreeView
Left = 0
Height = 212
Height = 220
Top = 6
Width = 200
Align = alLeft
@ -322,7 +525,7 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
AnchorSideBottom.Control = ColorElementTree
AnchorSideBottom.Side = asrBottom
Left = 207
Height = 212
Height = 220
Top = 6
Width = 433
BorderSpacing.Left = 1
@ -338,7 +541,7 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
TabStop = False
OnMouseUp = ColorPreviewMouseUp
BookMarkOptions.Xoffset = 30
Gutter.Width = 61
Gutter.Width = 59
Gutter.MouseActions = <
item
ClickCount = ccAny
@ -753,33 +956,42 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
'ColorPreview'
)
VisibleSpecialChars = [vscSpace, vscTabAtLast]
SelectedColor.FrameEdges = sfeAround
SelectedColor.BackPriority = 50
SelectedColor.ForePriority = 50
SelectedColor.FramePriority = 50
SelectedColor.BoldPriority = 50
SelectedColor.ItalicPriority = 50
SelectedColor.UnderlinePriority = 50
SelectedColor.StrikeOutPriority = 50
IncrementColor.FrameEdges = sfeAround
HighlightAllColor.FrameEdges = sfeAround
BracketHighlightStyle = sbhsBoth
BracketMatchColor.Background = clNone
BracketMatchColor.Foreground = clNone
BracketMatchColor.FrameEdges = sfeAround
BracketMatchColor.Style = [fsBold]
FoldedCodeColor.Background = clNone
FoldedCodeColor.Foreground = clGray
FoldedCodeColor.FrameColor = clGray
FoldedCodeColor.FrameEdges = sfeAround
MouseLinkColor.Background = clNone
MouseLinkColor.Foreground = clBlue
MouseLinkColor.FrameEdges = sfeAround
LineHighlightColor.Background = clNone
LineHighlightColor.Foreground = clNone
LineHighlightColor.FrameEdges = sfeAround
inline TSynGutterPartList
object TSynGutterMarks
Width = 24
MouseActions = <>
end
object TSynGutterLineNumber
Width = 21
Width = 19
MouseActions = <>
MarkupInfo.Background = clBtnFace
MarkupInfo.Foreground = clNone
MarkupInfo.FrameEdges = sfeAround
DigitCount = 2
ShowOnlyLineNumbersMultiplesOf = 1
ZeroStart = False
@ -796,6 +1008,7 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
MouseActions = <>
MarkupInfo.Background = clWhite
MarkupInfo.Foreground = clGray
MarkupInfo.FrameEdges = sfeAround
end
object TSynGutterCodeFolding
MouseActions = <
@ -826,6 +1039,7 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
end>
MarkupInfo.Background = clNone
MarkupInfo.Foreground = clGray
MarkupInfo.FrameEdges = sfeAround
MouseActionsExpanded = <
item
ClickCount = ccAny
@ -852,7 +1066,7 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
end
object Splitter1: TSplitter
Left = 201
Height = 218
Height = 226
Top = 0
Width = 5
end
@ -904,7 +1118,7 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
Top = 0
Width = 139
BorderSpacing.Top = 3
ItemHeight = 0
ItemHeight = 15
Items.Strings = (
'pp;pas;inc;lpr;lrs;dpr;dpk'
'pp;pas;inc;lpr;lrs'

View File

@ -25,8 +25,8 @@ unit editor_color_options;
interface
uses
Classes, Controls, StdCtrls, sysutils, ExtCtrls, Graphics, GraphUtil,
ColorBox, ComCtrls, LCLProc, LCLType, LCLIntf, Dialogs, Menus, SynEdit,
Classes, windows, Controls, StdCtrls, sysutils, ExtCtrls, Graphics, GraphUtil,
ColorBox, ComCtrls, LCLProc, LCLType, LCLIntf, Dialogs, Menus, Spin, maskedit, SynEdit,
SynEditMiscClasses, SynGutterCodeFolding, SynGutterLineNumber, SynEditTypes,
SynGutterChanges, SynEditMouseCmds, SynEditHighlighter, SynTextDrawer,
DividerBevel, Laz2_XMLCfg, EditorOptions, IDEOptionsIntf,
@ -35,12 +35,31 @@ uses
type
// for priority
TMarkupField = (mfForeGround, mfBackGround, mfFrame, mfUnknown);
{ TEditorColorOptionsFrame }
TEditorColorOptionsFrame = class(TAbstractIDEOptionsEditor)
BackPriorList: TTreeView;
BackPriorValPanel: TPanel;
bvlAttributeSection: TDividerBevel;
BackPriorEdit: TEdit;
FramePriorEdit: TEdit;
ForePriorEdit: TEdit;
FileExtensionsComboBox: TComboBox;
ExportSaveDialog: TSaveDialog;
ForePriorLabel: TLabel;
BackPriorLabel: TLabel;
ForePriorList: TTreeView;
ForePriorValPanel: TPanel;
FramePriorLabel: TLabel;
ForePriorPanel: TPanel;
BackPriorPanel: TPanel;
FramePriorList: TTreeView;
FramePriorPanel: TPanel;
FramePriorValPanel: TPanel;
PriorityEditor: TPanel;
PnlTop2: TPanel;
pnlTop: TPanel;
LanguageMenu: TPopupMenu;
@ -52,7 +71,13 @@ type
ToolBar1: TToolBar;
tbtnGlobal: TToolButton;
tbtnLocal: TToolButton;
ToolButton1: TToolButton;
ToolButton3: TToolButton;
tbnColor: TToolButton;
tbnPrior: TToolButton;
ForePriorUpDown: TUpDown;
BackPriorUpDown: TUpDown;
FramePriorUpDown: TUpDown;
UseSyntaxHighlightCheckBox: TToolButton;
ToolButton2: TToolButton;
LanguageButton: TToolButton;
@ -73,6 +98,12 @@ type
Shift: TShiftState; X, Y: Integer);
procedure ColorSchemeButtonClick(Sender: TObject);
procedure DoColorChanged(Sender: TObject);
procedure ForePriorEditKeyPress(Sender: TObject; var Key: char);
procedure ForePriorListClick(Sender: TObject);
procedure ForePriorListCompare(Sender: TObject; Node1, Node2: TTreeNode;
var Compare: Integer);
procedure ForePriorEditChange(Sender: TObject);
procedure ForePriorUpDownClick(Sender: TObject; Button: TUDBtnType);
procedure GeneralCheckBoxOnChange(Sender: TObject);
procedure ComboBoxOnExit(Sender: TObject);
procedure LanguageButtonClick(Sender: TObject);
@ -80,6 +111,7 @@ type
procedure SetAttributeToDefaultButtonClick(Sender: TObject);
procedure ComboBoxOnChange(Sender: TObject);
procedure ComboBoxOnKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure tbnColorClick(Sender: TObject);
procedure tglGlobalChange(Sender: TObject);
private
FTempColorSchemeSettings: TColorSchemeFactory;
@ -92,9 +124,21 @@ type
FCurrentHighlighter: TSrcIDEHighlighter;
FCurrentColorScheme: TColorSchemeLanguage;
FIsEditingDefaults: Boolean;
FIsEditingDefaults, FInPriorUpdating: Boolean;
CurLanguageID: Integer;
procedure FillPriorEditor;
procedure SelectCurInPriorEditor;
function AttrForNode(ANode: TTreeNode): TColorSchemeAttribute;
function PriorSenderToField(ASender: TObject): TMarkupField;
function PriorEditForField(AField: TMarkupField): TEdit;
function PriorListForField(AField: TMarkupField): TTreeView;
procedure SetAttrPriorVal(AnAttr: TColorSchemeAttribute; AField: TMarkupField; AValue: Integer);
function GetAttrPriorVal(AnAttr: TColorSchemeAttribute; AField: TMarkupField): Integer;
procedure SetPriorEditVal(AnEdit: TEdit; AValue: Integer);
function GetPriorEditVal(AnEdit: TEdit): Integer;
function GetCurFileExtensions(const LanguageName: String): String;
procedure SetCurFileExtensions(const LanguageName, FileExtensions: String);
procedure ShowCurAttribute;
@ -137,6 +181,8 @@ implementation
const
COLOR_NODE_PREFIX = ' abc ';
MAX_PRIOR = 9999;
MIN_PRIOR = 0;
function DefaultToNone(AColor: TColor): TColor;
begin
@ -172,10 +218,13 @@ var
AttriIdx: LongInt;
c: TColor;
s: String;
TheTree: TCustomTreeView;
begin
DefaultDraw := (node.Data = nil) or not (stage=cdPostPaint);
if DefaultDraw then exit;
TheTree := TCustomTreeView(Sender);
Attri := TColorSchemeAttribute(node.Data);
if Attri.IsUsingSchemeGlobals then
Attri := Attri.GetSchemeGlobal;
@ -186,17 +235,17 @@ begin
// Draw node background and name
if cdsSelected in State then begin
ColorElementTree.Canvas.Brush.Color := ColorElementTree.SelectionColor;
ColorElementTree.Canvas.Font.Color := InvertColor(ColorElementTree.SelectionColor);
TheTree.Canvas.Brush.Color := TheTree.SelectionColor;
TheTree.Canvas.Font.Color := InvertColor(TheTree.SelectionColor);
end else begin
ColorElementTree.Canvas.Brush.Color := ColorElementTree.BackgroundColor;
ColorElementTree.Canvas.Font.Color := Font.Color;
TheTree.Canvas.Brush.Color := TheTree.BackgroundColor;
TheTree.Canvas.Font.Color := Font.Color;
end;
NodeRect := Node.DisplayRect(true);
FullAbcWidth := ColorElementTree.Canvas.TextExtent(COLOR_NODE_PREFIX).cx;
TextY := (NodeRect.Top + NodeRect.Bottom - ColorElementTree.Canvas.TextHeight(Node.Text)) div 2;
ColorElementTree.Canvas.FillRect(NodeRect);
ColorElementTree.Canvas.TextOut(NodeRect.Left+FullAbcWidth, TextY, Attri.Name);
FullAbcWidth := TheTree.Canvas.TextExtent(COLOR_NODE_PREFIX).cx;
TextY := (NodeRect.Top + NodeRect.Bottom - TheTree.Canvas.TextHeight(Node.Text)) div 2;
TheTree.Canvas.FillRect(NodeRect);
TheTree.Canvas.TextOut(NodeRect.Left+FullAbcWidth, TextY, copy(Node.Text, 1+length(COLOR_NODE_PREFIX), MaxInt)); // Attri.Name);
// Draw preview box - Background
c := clNone;
@ -214,25 +263,25 @@ begin
c := FCurrentColorScheme.DefaultAttribute.Background;
if (c = clNone) or (c = clDefault) then
c := ColorPreview.Color;
ColorElementTree.Canvas.Brush.Color := c;
ColorElementTree.Canvas.FillRect(NodeRect.Left+2, NodeRect.Top+2, NodeRect.Left+FullAbcWidth-2, NodeRect.Bottom-2);
TheTree.Canvas.Brush.Color := c;
TheTree.Canvas.FillRect(NodeRect.Left+2, NodeRect.Top+2, NodeRect.Left+FullAbcWidth-2, NodeRect.Bottom-2);
// Special draw Modified line gutter
if AttriIdx = ord(ahaModifiedLine) then begin
TextY := NodeRect.Bottom - NodeRect.Top - 4;
ColorElementTree.Canvas.Brush.Color := Attri.Foreground;
ColorElementTree.Canvas.FillRect(NodeRect.Left+2, NodeRect.Top+2, NodeRect.Left+5, NodeRect.Bottom-2);
ColorElementTree.Canvas.Brush.Color := Attri.FrameColor;
ColorElementTree.Canvas.FillRect(NodeRect.Left+2, NodeRect.Top+2+ (TextY div 2), NodeRect.Left+5, NodeRect.Bottom-2);
TheTree.Canvas.Brush.Color := Attri.Foreground;
TheTree.Canvas.FillRect(NodeRect.Left+2, NodeRect.Top+2, NodeRect.Left+5, NodeRect.Bottom-2);
TheTree.Canvas.Brush.Color := Attri.FrameColor;
TheTree.Canvas.FillRect(NodeRect.Left+2, NodeRect.Top+2+ (TextY div 2), NodeRect.Left+5, NodeRect.Bottom-2);
exit;
end;
// Draw preview Frame
ColorElementTree.Canvas.Pen.Color := Attri.FrameColor;
TheTree.Canvas.Pen.Color := Attri.FrameColor;
if (hafFrameColor in Attri.Features) and (AttriIdx <> ord(ahaCodeFoldingTree)) and
(Attri.FrameColor <> clDefault) and (Attri.FrameColor <> clNone)
then
ColorElementTree.Canvas.Rectangle(NodeRect.Left+2, NodeRect.Top+2,
TheTree.Canvas.Rectangle(NodeRect.Left+2, NodeRect.Top+2,
NodeRect.Left+FullAbcWidth-2, NodeRect.Bottom-2);
// Draw preview ForeGround
@ -250,37 +299,37 @@ begin
TextY := NodeRect.Bottom - NodeRect.Top - 8;
// [-]
ColorElementTree.Canvas.Pen.Color := c;
ColorElementTree.Canvas.Rectangle(NodeRect.Left+4, NodeRect.Top+4,
TheTree.Canvas.Pen.Color := c;
TheTree.Canvas.Rectangle(NodeRect.Left+4, NodeRect.Top+4,
NodeRect.Left+4+TextY, NodeRect.Bottom-4);
ColorElementTree.Canvas.MoveTo(NodeRect.Left+6, NodeRect.Top+4+(TextY div 2));
ColorElementTree.Canvas.LineTo(NodeRect.Left+4+TextY-2, NodeRect.Top+4+(TextY div 2));
ColorElementTree.Canvas.MoveTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-4);
ColorElementTree.Canvas.LineTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-2);
TheTree.Canvas.MoveTo(NodeRect.Left+6, NodeRect.Top+4+(TextY div 2));
TheTree.Canvas.LineTo(NodeRect.Left+4+TextY-2, NodeRect.Top+4+(TextY div 2));
TheTree.Canvas.MoveTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-4);
TheTree.Canvas.LineTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-2);
// [+]
inc(NodeRect.Left, TextY+2);
ColorElementTree.Canvas.MoveTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-4);
ColorElementTree.Canvas.LineTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-2);
TheTree.Canvas.MoveTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-4);
TheTree.Canvas.LineTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-2);
if (Attri.FrameColor <> clNone) and (Attri.FrameColor <> clDefault) then
ColorElementTree.Canvas.Pen.Color := Attri.FrameColor;
ColorElementTree.Canvas.Rectangle(NodeRect.Left+4, NodeRect.Top+4,
TheTree.Canvas.Pen.Color := Attri.FrameColor;
TheTree.Canvas.Rectangle(NodeRect.Left+4, NodeRect.Top+4,
NodeRect.Left+4+TextY, NodeRect.Bottom-4);
ColorElementTree.Canvas.MoveTo(NodeRect.Left+6, NodeRect.Top+4+(TextY div 2));
ColorElementTree.Canvas.LineTo(NodeRect.Left+4+TextY-2, NodeRect.Top+4+(TextY div 2));
ColorElementTree.Canvas.MoveTo(NodeRect.Left+4+(TextY div 2), NodeRect.Top+6);
ColorElementTree.Canvas.LineTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-6);
ColorElementTree.Canvas.Brush.Style := bsSolid;
TheTree.Canvas.MoveTo(NodeRect.Left+6, NodeRect.Top+4+(TextY div 2));
TheTree.Canvas.LineTo(NodeRect.Left+4+TextY-2, NodeRect.Top+4+(TextY div 2));
TheTree.Canvas.MoveTo(NodeRect.Left+4+(TextY div 2), NodeRect.Top+6);
TheTree.Canvas.LineTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-6);
TheTree.Canvas.Brush.Style := bsSolid;
end
else if AttriIdx = ord(ahaGutterSeparator) then begin
ColorElementTree.Canvas.Pen.Color := c;
ColorElementTree.Canvas.MoveTo(NodeRect.Left+6, NodeRect.Top+2);
ColorElementTree.Canvas.LineTo(NodeRect.Left+6, NodeRect.Bottom-2);
TheTree.Canvas.Pen.Color := c;
TheTree.Canvas.MoveTo(NodeRect.Left+6, NodeRect.Top+2);
TheTree.Canvas.LineTo(NodeRect.Left+6, NodeRect.Bottom-2);
end
else if AttriIdx = ord(ahaRightMargin) then begin
ColorElementTree.Canvas.Pen.Color := c;
ColorElementTree.Canvas.MoveTo(NodeRect.Left+FullAbcWidth-6, NodeRect.Top+2);
ColorElementTree.Canvas.LineTo(NodeRect.Left+FullAbcWidth-6, NodeRect.Bottom-2);
TheTree.Canvas.Pen.Color := c;
TheTree.Canvas.MoveTo(NodeRect.Left+FullAbcWidth-6, NodeRect.Top+2);
TheTree.Canvas.LineTo(NodeRect.Left+FullAbcWidth-6, NodeRect.Bottom-2);
end
else begin
s := 'abc';
@ -288,17 +337,17 @@ begin
s:= '...';
if AttriIdx = ord(ahaLineNumber) then
s:= '123';
ColorElementTree.Canvas.Font.Color := c;
ColorElementTree.Canvas.Font.Style := Attri.Style;
ColorElementTree.Canvas.Font.Height := -(NodeRect.Bottom - NodeRect.Top - 7);
TheTree.Canvas.Font.Color := c;
TheTree.Canvas.Font.Style := Attri.Style;
TheTree.Canvas.Font.Height := -(NodeRect.Bottom - NodeRect.Top - 7);
TextY := (NodeRect.Top + NodeRect.Bottom - canvas.TextHeight(s)) div 2;
AbcWidth := ColorElementTree.Canvas.TextExtent(s).cx;
SetBkMode(ColorElementTree.Canvas.Handle, TRANSPARENT);
ColorElementTree.Canvas.TextOut(NodeRect.Left+(FullAbcWidth - AbcWidth) div 2, TextY, s);
SetBkMode(ColorElementTree.Canvas.Handle, OPAQUE);
AbcWidth := TheTree.Canvas.TextExtent(s).cx;
SetBkMode(TheTree.Canvas.Handle, TRANSPARENT);
TheTree.Canvas.TextOut(NodeRect.Left+(FullAbcWidth - AbcWidth) div 2, TextY, s);
SetBkMode(TheTree.Canvas.Handle, OPAQUE);
ColorElementTree.Canvas.Font.Height := Font.Height;
ColorElementTree.Canvas.Font.Style := [];
TheTree.Canvas.Font.Height := Font.Height;
TheTree.Canvas.Font.Style := [];
end;
end;
end;
@ -446,6 +495,269 @@ begin
UpdateCurrentScheme;
end;
procedure TEditorColorOptionsFrame.ForePriorEditKeyPress(Sender: TObject; var Key: char);
begin
if not (Key in ['0'..'9', #8 ,#9, #10, #13]) then Key := #0;
if key = #13 then ForePriorEditChange(Sender);
end;
procedure TEditorColorOptionsFrame.ForePriorListClick(Sender: TObject);
var
Node, N2: TTreeNode;
begin
Node := TTreeView(Sender).Selected;
if Node = nil then
exit;
FCurHighlightElement := TColorSchemeAttribute(Node.Data);
N2 := ColorElementTree.Items.FindNodeWithData(FCurHighlightElement);
if N2 <> nil then
N2.Selected := True;
//i := (Node.Index - TTreeView(Sender).TopItem.Index);
//if (i < 0) or (i >= TTreeView(Sender).Height div Node.Height) then
// i := Max(0, (TTreeView(Sender).Height div Node.Height div 2) - 1);
FInPriorUpdating := True;
ShowCurAttribute;
SelectCurInPriorEditor;
FInPriorUpdating := False;
//TTreeView(Sender).TopItem := TTreeView(Sender).Items[Max(0, Node.Index - i)];
end;
procedure TEditorColorOptionsFrame.ForePriorListCompare(Sender: TObject; Node1,
Node2: TTreeNode; var Compare: Integer);
var
a1, a2: TColorSchemeAttribute;
p1, p2: Integer;
f: TMarkupField;
begin
a1 := TColorSchemeAttribute(Node1.Data);
a2 := TColorSchemeAttribute(Node2.Data);
f := PriorSenderToField(Sender);
p1 := GetAttrPriorVal(a1, f);
p2 := GetAttrPriorVal(a2, f);
Compare := p2 - p1;
if (Compare = 0) and (FCurrentColorScheme <> nil) then
Compare := FCurrentColorScheme.IndexOfAttr(a1) - FCurrentColorScheme.IndexOfAttr(a2);
end;
procedure TEditorColorOptionsFrame.ForePriorEditChange(Sender: TObject);
var
List: TTreeView;
Node: TTreeNode;
Attr: TColorSchemeAttribute;
i: Integer;
f: TMarkupField;
begin
if FInPriorUpdating then
exit;
f := PriorSenderToField(Sender);
List := PriorListForField(f);
if List = nil then
exit;
Node := List.Selected;
Attr := AttrForNode(Node);
if Attr = nil then
exit;
i := GetPriorEditVal(Sender as TEdit);
if i < MIN_PRIOR then begin
i := MIN_PRIOR;
SetPriorEditVal(Sender as TEdit, i);
end;
if i > MAX_PRIOR then begin
i := MAX_PRIOR;
SetPriorEditVal(Sender as TEdit, i);
end;
SetAttrPriorVal(Attr, f, i);
Node.Text := Format('%s%-3d %s', [COLOR_NODE_PREFIX, i, Attr.Name]);
i := (Node.Index - List.TopItem.Index);
if (i < 0) or (i >= List.Height div Node.Height) then
i := Max(0, (List.Height div Node.Height div 2) - 1);
List.AlphaSort;
// Update SynColorAttrEditor1;
DoColorChanged(nil);
List.TopItem := List.Items[Max(0, Node.Index - i)];
end;
procedure TEditorColorOptionsFrame.ForePriorUpDownClick(Sender: TObject; Button: TUDBtnType);
procedure ShiftUpNodes(ANode: TTreeNode; AField: TMarkupField);
var
Attr: TColorSchemeAttribute;
Prior, NextPrior: Integer;
begin
Attr := AttrForNode(ANode);
if Attr = nil then exit;
NextPrior := GetAttrPriorVal(Attr, AField);
Prior := NextPrior;
while Prior >= NextPrior do begin
Prior := NextPrior + 1;
if Prior > MAX_PRIOR then exit;
SetAttrPriorVal(Attr, AField, Prior);
ANode.Text := Format('%s%-3d %s', [COLOR_NODE_PREFIX, Prior, Attr.Name]);
ANode := ANode.GetPrev;
Attr := AttrForNode(ANode);
if Attr = nil then exit;
NextPrior := GetAttrPriorVal(Attr, AField);
end;
end;
procedure ShiftDownNodes(ANode: TTreeNode; AField: TMarkupField);
var
Attr: TColorSchemeAttribute;
Prior, NextPrior: Integer;
begin
Attr := AttrForNode(ANode);
if Attr = nil then exit;
NextPrior := GetAttrPriorVal(Attr, AField);
Prior := NextPrior;
while Prior <= NextPrior do begin
Prior := NextPrior - 1;
if Prior < MIN_PRIOR then exit;
SetAttrPriorVal(Attr, AField, Prior);
ANode.Text := Format('%s%-3d %s', [COLOR_NODE_PREFIX, Prior, Attr.Name]);
ANode := ANode.GetNext;
Attr := AttrForNode(ANode);
if Attr = nil then exit;
NextPrior := GetAttrPriorVal(Attr, AField);
end;
end;
function CanShiftUp(ANode: TTreeNode; AField: TMarkupField): Boolean;
var
Attr: TColorSchemeAttribute;
begin
Result := False;
Attr := AttrForNode(ANode);
if Attr = nil then
exit;
Result := GetAttrPriorVal(Attr, AField) + ANode.Index < MAX_PRIOR
end;
function CanShiftDown(ANode: TTreeNode; AField: TMarkupField): Boolean;
var
Attr: TColorSchemeAttribute;
begin
Result := False;
Attr := AttrForNode(ANode);
if Attr = nil then
exit;
Result := GetAttrPriorVal(Attr, AField) - (ANode.TreeView.Items.Count - ANode.Index - 1) > MIN_PRIOR;
end;
var
TheEdit: TEdit;
List: TTreeView;
Node, Node2, Node3: TTreeNode;
CurPrior, NewPrior, d, i, j: Integer;
Attr, Attr2, Attr3, Attr3s: TColorSchemeAttribute;
f: TMarkupField;
begin
f := PriorSenderToField(Sender);
List := PriorListForField(f);
TheEdit := PriorEditForField(f);
if List = nil then
exit;
CurPrior := GetPriorEditVal(TheEdit);
//if CurPrior = 0 then
// exit;
case Button of
btNext: d := 1;
btPrev: d := -1;
end;
NewPrior := CurPrior + d;
try
Node := List.Selected;
Attr := AttrForNode(Node);
if Attr = nil then
exit;
case Button of
btNext: Node2 := Node.GetPrev;
btPrev: Node2 := Node.GetNext;
end;
Attr2 := AttrForNode(Node2);
if Attr2 = nil then
exit;
NewPrior := GetAttrPriorVal(Attr2, f) + d;
Node.Index := Node.Index - d; // must be possible, or node2 would be nil
if NewPrior < MIN_PRIOR then begin // btPrev;
NewPrior := MIN_PRIOR;
if CanShiftUp(Node2, f) then
ShiftUpNodes(Node2, f);
exit;
end;
if NewPrior > MAX_PRIOR then begin // btNext;
NewPrior := MAX_PRIOR;
if CanShiftDown(Node2, f) then
ShiftDownNodes(Node2, f);
exit;
end;
case Button of
btNext: Node3 := Node.GetPrev; // Since Node was shifted, NOde2 is now Node.GetNext
btPrev: Node3 := Node.GetNext; // Since Node was shifted, NOde2 is now Node.GetPrev
end;
Attr3 := AttrForNode(Node3);
if Attr3 = nil then
exit;
i := GetAttrPriorVal(Attr3, f);
if NewPrior <> i then
exit;
Attr3s := Attr3.GetStoredValuesForAttrib;
j := -1;
if (Attr3s<> nil) then
j := GetAttrPriorVal(Attr3s, f);
case Button of
btNext: begin
if ((j = i) or not CanShiftUp(Node3, f)) and CanShiftDown(Node2, f)
then begin
NewPrior := NewPrior - d;
ShiftDownNodes(Node2, f);
end
else
if CanShiftUp(Node3, f) then
ShiftUpNodes(Node3, f);
end;
btPrev: begin
if ((j = i) or not CanShiftDown(Node3, f)) and CanShiftUp(Node2, f)
then begin
NewPrior := NewPrior - d;
ShiftUpNodes(Node2, f);
end
else
if CanShiftDown(Node3, f) then
ShiftDownNodes(Node3, f);
end;
end;
finally
if NewPrior < MIN_PRIOR then NewPrior := MIN_PRIOR;
if NewPrior > MAX_PRIOR then NewPrior := MAX_PRIOR;
SetPriorEditVal(TheEdit, NewPrior);
ForePriorEditChange(TheEdit);
end;
end;
procedure TEditorColorOptionsFrame.GeneralCheckBoxOnChange(Sender: TObject);
begin
if Sender = UseSyntaxHighlightCheckBox then
@ -513,11 +825,213 @@ begin
else
SynColorAttrEditor1.CurHighlightElement := FCurHighlightElement;
//SynColorAttrEditor1.UpdateAll;
FillPriorEditor;
finally
EnableAlign;
end;
end;
procedure TEditorColorOptionsFrame.FillPriorEditor;
function IsEnabled(AnAttr: TColorSchemeAttribute; AnSelector: TMarkupField): Boolean;
begin
Result := False;
if AnAttr.IsUsingSchemeGlobals then
AnAttr := AnAttr.GetSchemeGlobal;
//if AnAttr.StoredName = 'ahaDefault' then
// exit;
if not (hafPrior in AnAttr.Features) then
exit;
case AnSelector of
mfForeGround: Result := (hafForeColor in AnAttr.Features) and
(AnAttr.Foreground <> clNone) and
(AnAttr.Foreground <> clDefault);
mfBackGround: Result := (hafBackColor in AnAttr.Features) and
(AnAttr.Background <> clNone) and
(AnAttr.Background <> clDefault);
mfFrame: Result := (hafFrameColor in AnAttr.Features) and
(AnAttr.FrameColor <> clNone) and
(AnAttr.FrameColor <> clDefault);
end
end;
procedure FillList(AList: TTreeView; ASelector: TMarkupField);
var
i, p: Integer;
Attr: TColorSchemeAttribute;
begin
AList.BeginUpdate;
AList.Items.Clear;
for i := 0 to FCurrentColorScheme.AttributeCount - 1 do begin
Attr := FCurrentColorScheme.AttributeAtPos[i];
if IsEnabled(Attr, ASelector) then begin
p := GetAttrPriorVal(Attr, ASelector);
AList.Items.Add(nil, Format('%s%-3d %s', [COLOR_NODE_PREFIX, p, Attr.Name])).Data := Attr;
end;
end;
AList.EndUpdate;
AList.AlphaSort;
end;
begin
if (not PriorityEditor.Visible) or (FCurHighlightElement = nil) or FInPriorUpdating
then
exit;
FInPriorUpdating := True;
FillList(ForePriorList, mfForeGround);
FillList(BackPriorList, mfBackGround);
FillList(FramePriorList, mfFrame);
SelectCurInPriorEditor;
FInPriorUpdating := False;
end;
procedure TEditorColorOptionsFrame.SelectCurInPriorEditor;
var
n: TTreeNode;
i: Integer;
begin
n := ForePriorList.Items.FindNodeWithData(FCurHighlightElement);
ForePriorValPanel.Enabled := n <> nil;
if (n <> nil) and not(n.Selected) then begin
n.Selected := True;
i := Max(0, n.Index - Max(0, (ForePriorList.Height div n.Height div 2) -1 ));
ForePriorList.TopItem := ForePriorList.Items[i];
end
else
if n = nil then
ForePriorList.Selected := nil;
SetPriorEditVal(ForePriorEdit, GetAttrPriorVal(FCurHighlightElement, mfForeGround));
n := BackPriorList.Items.FindNodeWithData(FCurHighlightElement);
BackPriorValPanel.Enabled := n <> nil;
if (n <> nil) and not(n.Selected) then begin
n.Selected := True;
i := Max(0, n.Index - Max(0, (BackPriorList.Height div n.Height div 2) - 1));
BackPriorList.TopItem := BackPriorList.Items[i];
end
else
if n = nil then
BackPriorList.Selected := nil;
SetPriorEditVal(BackPriorEdit, GetAttrPriorVal(FCurHighlightElement, mfBackGround));
n := FramePriorList.Items.FindNodeWithData(FCurHighlightElement);
FramePriorValPanel.Enabled := n <> nil;
if (n <> nil) and not(n.Selected) then begin
n.Selected := True;
i := Max(0, n.Index - Max(0, (FramePriorList.Height div n.Height div 2) - 1));
FramePriorList.TopItem := FramePriorList.Items[i];
end
else
if n = nil then
FramePriorList.Selected := nil;
SetPriorEditVal(FramePriorEdit, GetAttrPriorVal(FCurHighlightElement, mfFrame));
end;
function TEditorColorOptionsFrame.AttrForNode(ANode: TTreeNode): TColorSchemeAttribute;
begin
Result := nil;
if ANode = nil then exit;
Result := TColorSchemeAttribute(ANode.Data);
if (Result <> nil) and Result.IsUsingSchemeGlobals then
Result := Result.GetSchemeGlobal;
end;
function TEditorColorOptionsFrame.PriorSenderToField(ASender: TObject): TMarkupField;
begin
If ASender = ForePriorEdit then
Result := mfForeGround
else
If ASender = BackPriorEdit then
Result := mfBackGround
else
If ASender = FramePriorEdit then
Result := mfFrame
else
if ASender = ForePriorUpDown then
Result := mfForeGround
else
if ASender = BackPriorUpDown then
Result := mfBackGround
else
if ASender = FramePriorUpDown then
Result := mfFrame
else
if ASender = ForePriorList then
Result := mfForeGround
else
if ASender = BackPriorList then
Result := mfBackGround
else
if ASender = FramePriorList then
Result := mfFrame
else
Result := mfUnknown;
end;
function TEditorColorOptionsFrame.PriorEditForField(AField: TMarkupField): TEdit;
begin
Result := nil;
case AField of
mfForeGround: Result := ForePriorEdit;
mfBackGround: Result := BackPriorEdit;
mfFrame: Result := FramePriorEdit;
end;
end;
function TEditorColorOptionsFrame.PriorListForField(AField: TMarkupField): TTreeView;
begin
Result := nil;
case AField of
mfForeGround: Result := ForePriorList;
mfBackGround: Result := BackPriorList;
mfFrame: Result := FramePriorList;
end;
end;
procedure TEditorColorOptionsFrame.SetAttrPriorVal(AnAttr: TColorSchemeAttribute;
AField: TMarkupField; AValue: Integer);
begin
if AnAttr.IsUsingSchemeGlobals then
AnAttr := AnAttr.GetSchemeGlobal;
case AField of
mfForeGround: AnAttr.ForePriority := AValue;
mfBackGround: AnAttr.BackPriority := AValue;
mfFrame: AnAttr.FramePriority := AValue
end;
end;
function TEditorColorOptionsFrame.GetAttrPriorVal(AnAttr: TColorSchemeAttribute;
AField: TMarkupField): Integer;
begin
Result := 0;
if AnAttr = nil then exit;
if AnAttr.IsUsingSchemeGlobals then
AnAttr := AnAttr.GetSchemeGlobal;
case AField of
mfForeGround: Result := AnAttr.ForePriority;
mfBackGround: Result := AnAttr.BackPriority;
mfFrame: Result := AnAttr.FramePriority
end;
end;
procedure TEditorColorOptionsFrame.SetPriorEditVal(AnEdit: TEdit; AValue: Integer);
begin
AnEdit.Tag := AValue;
AnEdit.Text := IntToStr(AValue);
end;
function TEditorColorOptionsFrame.GetPriorEditVal(AnEdit: TEdit): Integer;
begin
Result := StrToIntDef(AnEdit.Text, -1);
if Result = -1 then begin
Result := AnEdit.Tag;
AnEdit.Text := IntToStr(Result);
end;
end;
procedure TEditorColorOptionsFrame.FindCurHighlightElement;
begin
if (ColorElementTree.Selected <> nil) and
@ -675,6 +1189,7 @@ begin
if not FIsEditingDefaults then begin
FCurrentHighlighter := FCurrentColorScheme.Highlighter;
SynColorAttrEditor1.CurrentColorScheme := FCurrentColorScheme;
FillPriorEditor;
end;
ApplyCurrentScheme;
FillColorElementListBox;
@ -888,9 +1403,17 @@ begin
tbtnGlobal.Caption := dlgUseSchemeDefaults;
tbtnLocal.Caption := dlgUseSchemeLocal;
tbnColor.Caption := dlgColors;
tbnPrior.Caption := dlgPriorities;
ForePriorLabel.Caption := dlgForecolor;
BackPriorLabel.Caption := dlgBackColor;
FramePriorLabel.Caption := dlgFrameColor;
bvlAttributeSection.Caption := dlgElementAttributes;
SynColorAttrEditor1.Setup;
SynColorAttrEditor1.OnChanged := @DoColorChanged;
SynColorAttrEditor1.ShowPrior := False;
with GeneralPage do
AddPreviewEdit(ColorPreview);
@ -940,6 +1463,7 @@ begin
SetLanguageItem(FCurrentHighlighter.LanguageName);
SetColorSchemeItem(GetColorSchemeForLang(FCurrentHighlighter.LanguageName));
tbnColorClick(nil);
ShowCurAttribute;
UpdateCurrentScheme;
end;
@ -1006,6 +1530,13 @@ begin
ComboBoxOnExit(Sender);
end;
procedure TEditorColorOptionsFrame.tbnColorClick(Sender: TObject);
begin
PriorityEditor.Visible := tbnPrior.Down;
SynColorAttrEditor1.Visible := not tbnPrior.Down;
FillPriorEditor;
end;
procedure TEditorColorOptionsFrame.tglGlobalChange(Sender: TObject);
begin
if (FCurHighlightElement = nil) then

View File

@ -26,7 +26,7 @@ interface
uses
Classes, SysUtils, LCLProc, LCLType, StdCtrls, Controls, ExtCtrls, Graphics,
EditorOptions, LazarusIDEStrConsts, IDEProcs, IDEOptionsIntf,
EditorOptions, LazarusIDEStrConsts, IDEProcs, SourceSynEditor, IDEOptionsIntf,
SynEdit, SynBeautifier, SynHighlighterPas, DividerBevel;
type

View File

@ -674,6 +674,7 @@ end;
procedure TEditorMarkupUserDefinedFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
begin
SynColorAttrEditor1.Setup;
SynColorAttrEditor1.ShowPrior := True;
tbNewList.Caption := dlgMarkupUserDefinedListNew;
tbDeleteList.Caption := dlgMarkupUserDefinedListDel;
lbListName.Caption := dlgMarkupUserDefinedListName;

View File

@ -1640,6 +1640,7 @@ resourcestring
dlgColor = 'Color';
dlgColors = 'Colors';
dlgColorNotModified = 'Not modified';
dlgPriorities = 'Priorities';
dlgForecolor = 'Foreground';
dlgFrameColor = 'Text-mark';
@ -5716,6 +5717,7 @@ resourcestring
lisMMCustomOption = 'Custom Option';
lisMMIDEMacro = 'IDE Macro';
lisMMOverrideOutputDirectory = 'Override output directory (-FU)';
lisPriority = 'Priority';
implementation

View File

@ -2,10 +2,11 @@ object SynColorAttrEditor: TSynColorAttrEditor
Left = 0
Height = 145
Top = 0
Width = 517
Width = 690
ClientHeight = 145
ClientWidth = 517
ClientWidth = 690
Constraints.MinHeight = 140
LCLVersion = '1.1'
OnResize = pnlElementAttributesResize
TabOrder = 0
DesignLeft = 399
@ -54,7 +55,7 @@ object SynColorAttrEditor: TSynColorAttrEditor
Left = 204
Height = 22
Top = 3
Width = 141
Width = 160
DefaultColorColor = clWhite
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbIncludeDefault, cbCustomColor, cbPrettyNames, cbCustomColors]
OnGetColors = ForegroundColorBoxGetColors
@ -74,7 +75,7 @@ object SynColorAttrEditor: TSynColorAttrEditor
Left = 204
Height = 22
Top = 28
Width = 141
Width = 160
DefaultColorColor = clWhite
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbIncludeDefault, cbCustomColor, cbPrettyNames, cbCustomColors]
OnGetColors = ForegroundColorBoxGetColors
@ -108,7 +109,7 @@ object SynColorAttrEditor: TSynColorAttrEditor
Left = 204
Height = 22
Top = 53
Width = 141
Width = 160
DefaultColorColor = clWhite
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbIncludeDefault, cbCustomColor, cbPrettyNames, cbCustomColors]
OnGetColors = ForegroundColorBoxGetColors
@ -478,7 +479,7 @@ object SynColorAttrEditor: TSynColorAttrEditor
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ForegroundColorBox
AnchorSideTop.Side = asrCenter
Left = 355
Left = 374
Height = 15
Top = 7
Width = 82
@ -491,7 +492,7 @@ object SynColorAttrEditor: TSynColorAttrEditor
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = BackGroundColorBox
AnchorSideTop.Side = asrCenter
Left = 355
Left = 374
Height = 15
Top = 32
Width = 84
@ -504,7 +505,7 @@ object SynColorAttrEditor: TSynColorAttrEditor
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = FrameColorBox
AnchorSideTop.Side = asrCenter
Left = 355
Left = 374
Height = 15
Top = 57
Width = 92
@ -517,7 +518,7 @@ object SynColorAttrEditor: TSynColorAttrEditor
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ForeAlphaLabel
AnchorSideTop.Side = asrCenter
Left = 443
Left = 462
Height = 23
Top = 3
Width = 55
@ -526,6 +527,8 @@ object SynColorAttrEditor: TSynColorAttrEditor
MinValue = 1
OnChange = ForeAlphaSpinChange
OnEditingDone = ForeAlphaSpinChange
OnEnter = ForeAlphaSpinEnter
OnExit = ForeAlphaSpinChange
OnResize = ForeAlphaSpinChange
TabOrder = 2
Value = 256
@ -535,7 +538,7 @@ object SynColorAttrEditor: TSynColorAttrEditor
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = BackAlphaLabel
AnchorSideTop.Side = asrCenter
Left = 445
Left = 464
Height = 23
Top = 28
Width = 55
@ -544,6 +547,8 @@ object SynColorAttrEditor: TSynColorAttrEditor
MinValue = 1
OnChange = ForeAlphaSpinChange
OnEditingDone = ForeAlphaSpinChange
OnEnter = ForeAlphaSpinEnter
OnExit = ForeAlphaSpinChange
OnResize = ForeAlphaSpinChange
TabOrder = 5
Value = 256
@ -553,7 +558,7 @@ object SynColorAttrEditor: TSynColorAttrEditor
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = FrameAlphaLabel
AnchorSideTop.Side = asrCenter
Left = 453
Left = 472
Height = 23
Top = 53
Width = 55
@ -562,8 +567,100 @@ object SynColorAttrEditor: TSynColorAttrEditor
MinValue = 1
OnChange = ForeAlphaSpinChange
OnEditingDone = ForeAlphaSpinChange
OnEnter = ForeAlphaSpinEnter
OnExit = ForeAlphaSpinChange
OnResize = ForeAlphaSpinChange
TabOrder = 8
Value = 256
end
object ForePriorLabel: TLabel
AnchorSideLeft.Control = ForeAlphaSpin
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ForegroundColorBox
AnchorSideTop.Side = asrCenter
Left = 527
Height = 15
Top = 7
Width = 76
BorderSpacing.Left = 10
Caption = 'ForePriorLabel'
ParentColor = False
end
object BackPriorLabel: TLabel
AnchorSideLeft.Control = BackAlphaSpin
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = BackGroundColorBox
AnchorSideTop.Side = asrCenter
Left = 529
Height = 15
Top = 32
Width = 78
BorderSpacing.Left = 10
Caption = 'BackPriorLabel'
ParentColor = False
end
object FramePriorLabel: TLabel
AnchorSideLeft.Control = FrameAlphaSpin
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = FrameColorBox
AnchorSideTop.Side = asrCenter
Left = 537
Height = 15
Top = 57
Width = 86
BorderSpacing.Left = 10
Caption = 'FramePriorLabel'
ParentColor = False
end
object ForePriorSpin: TSpinEdit
AnchorSideLeft.Control = ForePriorLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ForePriorLabel
AnchorSideTop.Side = asrCenter
Left = 609
Height = 23
Top = 3
Width = 55
BorderSpacing.Left = 6
MaxValue = 9999
OnChange = ForePriorSpinChange
OnEditingDone = ForePriorSpinChange
OnExit = ForePriorSpinChange
TabOrder = 15
Value = 1
end
object BackPriorSpin: TSpinEdit
AnchorSideLeft.Control = BackPriorLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = BackPriorLabel
AnchorSideTop.Side = asrCenter
Left = 613
Height = 23
Top = 28
Width = 55
BorderSpacing.Left = 6
MaxValue = 9999
OnChange = ForePriorSpinChange
OnEditingDone = ForePriorSpinChange
OnExit = ForePriorSpinChange
TabOrder = 16
Value = 1
end
object FramePriorSpin: TSpinEdit
AnchorSideLeft.Control = FramePriorLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = FrameAlphaLabel
AnchorSideTop.Side = asrCenter
Left = 629
Height = 23
Top = 53
Width = 55
BorderSpacing.Left = 6
MaxValue = 9999
OnChange = ForePriorSpinChange
OnEditingDone = ForePriorSpinChange
OnExit = ForePriorSpinChange
TabOrder = 17
Value = 1
end
end

View File

@ -18,9 +18,15 @@ type
{ TSynColorAttrEditor }
TSynColorAttrEditor = class(TFrame)
BackPriorLabel: TLabel;
BackPriorSpin: TSpinEdit;
BackGroundColorBox: TColorBox;
BackGroundLabel: TLabel;
ColumnPosBevel: TPanel;
ForePriorLabel: TLabel;
ForePriorSpin: TSpinEdit;
FramePriorSpin: TSpinEdit;
FramePriorLabel: TLabel;
FrameStyleBox: TComboBox;
FrameEdgesBox: TComboBox;
FrameColorBox: TColorBox;
@ -54,8 +60,10 @@ type
ForeGroundLabel: TLabel;
ForeGroundUseDefaultCheckBox: TCheckBox;
procedure ForeAlphaSpinChange(Sender: TObject);
procedure ForeAlphaSpinEnter(Sender: TObject);
procedure ForegroundColorBoxChange(Sender: TObject);
procedure ForegroundColorBoxGetColors(Sender: TCustomColorBox; Items: TStrings);
procedure ForePriorSpinChange(Sender: TObject);
procedure FrameEdgesBoxDrawItem(Control: TWinControl; Index: Integer; ARect: TRect;
State: TOwnerDrawState);
procedure FrameStyleBoxDrawItem(Control: TWinControl; Index: Integer; ARect: TRect;
@ -68,18 +76,22 @@ type
FCurHighlightElement: TColorSchemeAttribute;
FCurrentColorScheme: TColorSchemeLanguage;
FOnChanged: TNotifyEvent;
FShowPrior: Boolean;
UpdatingColor: Boolean;
procedure SetCurHighlightElement(AValue: TColorSchemeAttribute);
procedure DoChanged;
procedure SetShowPrior(AValue: Boolean);
public
{ public declarations }
constructor Create(TheOwner: TComponent); override;
procedure Setup;
procedure UpdateAll;
// CurrentColorScheme must be set before CurHighlightElement
property CurHighlightElement: TColorSchemeAttribute read FCurHighlightElement write SetCurHighlightElement;
property CurrentColorScheme: TColorSchemeLanguage read FCurrentColorScheme write FCurrentColorScheme;
property OnChanged: TNotifyEvent read FOnChanged write FOnChanged;
property ShowPrior: Boolean read FShowPrior write SetShowPrior;
end;
implementation
@ -167,6 +179,14 @@ begin
DoChanged;
end;
procedure TSynColorAttrEditor.ForeAlphaSpinEnter(Sender: TObject);
begin
UpdatingColor := True;
If TSpinEdit(Sender).Value = 256 then
TSpinEdit(Sender).Caption := '256';
UpdatingColor := False;
end;
procedure TSynColorAttrEditor.ForegroundColorBoxGetColors(Sender: TCustomColorBox; Items: TStrings);
var
i: longint;
@ -178,6 +198,25 @@ begin
end;
end;
procedure TSynColorAttrEditor.ForePriorSpinChange(Sender: TObject);
var
v: Integer;
begin
if (FCurHighlightElement = nil) then
exit;
v := TSpinEdit(Sender).Value;
if Sender = ForePriorSpin then
FCurHighlightElement.ForePriority := v;
if Sender = BackPriorSpin then
FCurHighlightElement.BackPriority := v;
if Sender = FramePriorLabel then
FCurHighlightElement.FramePriority := v;
DoChanged;
end;
procedure TSynColorAttrEditor.FrameEdgesBoxDrawItem(Control: TWinControl; Index: Integer; ARect: TRect;
State: TOwnerDrawState);
var
@ -483,6 +522,12 @@ begin
else
ForeAlphaSpin.Value := FCurHighlightElement.ForeAlpha;
ForePriorSpin.Visible := ForegroundColorBox.Visible and FShowPrior and
(hafPrior in FCurHighlightElement.Features);
ForePriorLabel.Visible := ForePriorSpin.Visible;
ForePriorSpin.Value := FCurHighlightElement.ForePriority;
// BackGround
BackGroundLabel.Visible := (hafBackColor in FCurHighlightElement.Features) and
(FCurHighlightElement.Group = agnDefault);
@ -507,6 +552,11 @@ begin
else
BackAlphaSpin.Value := FCurHighlightElement.BackAlpha;
BackPriorSpin.Visible := ForegroundColorBox.Visible and FShowPrior and
(hafPrior in FCurHighlightElement.Features);
BackPriorLabel.Visible := BackPriorSpin.Visible;
BackPriorSpin.Value := FCurHighlightElement.BackPriority;
// Frame
FrameColorUseDefaultCheckBox.Visible := hafFrameColor in FCurHighlightElement.Features;
FrameColorBox.Visible := hafFrameColor in FCurHighlightElement.Features;
@ -534,6 +584,11 @@ begin
else
FrameAlphaSpin.Value := FCurHighlightElement.FrameAlpha;
FramePriorSpin.Visible := ForegroundColorBox.Visible and FShowPrior and
(hafPrior in FCurHighlightElement.Features);
FramePriorLabel.Visible := FramePriorSpin.Visible;
FramePriorSpin.Value := FCurHighlightElement.FramePriority;
// Styles
TextBoldCheckBox.Visible := hafStyle in FCurHighlightElement.Features;
TextItalicCheckBox.Visible := hafStyle in FCurHighlightElement.Features;
@ -607,6 +662,19 @@ begin
FOnChanged(Self);
end;
procedure TSynColorAttrEditor.SetShowPrior(AValue: Boolean);
begin
if FShowPrior = AValue then Exit;
FShowPrior := AValue;
UpdateAll;
end;
constructor TSynColorAttrEditor.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
FShowPrior := False;
end;
procedure TSynColorAttrEditor.Setup;
begin
UpdatingColor := False;
@ -619,6 +687,9 @@ begin
ForeAlphaLabel.Caption := lisAlpha;
BackAlphaLabel.Caption := lisAlpha;
FrameAlphaLabel.Caption := lisAlpha;
ForePriorLabel.Caption := lisPriority;
BackPriorLabel.Caption := lisPriority;
FramePriorLabel.Caption := lisPriority;
TextBoldCheckBox.Caption := dlgEdBold;
TextBoldRadioOn.Caption := dlgEdOn;