* Replace StrechMaskBlit by BitBlt in XP header painting

* Cleanup check images draw code

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@211 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blikblum
2007-07-09 13:10:37 +00:00
parent 2418e96d91
commit d5bf30839b
6 changed files with 51 additions and 69 deletions

View File

@ -8638,32 +8638,31 @@ begin
Width := ButtonR.Right - ButtonR.Left;
if Width <= 32 then
begin
//todo: replace StretchMask by BitBlt
StretchMaskBlt(DC, ButtonR.Right - 16, ButtonR.Bottom - 3, UtilityImageSize, 3, UtilityImages.Canvas.Handle,
8 * UtilityImageSize, 0, UtilityImageSize, 3, UtilityImages.MaskHandle, 0, 0, 0);
BitBlt(DC, ButtonR.Right - 16, ButtonR.Bottom - 3, UtilityImageSize, 3, UtilityImages.Canvas.Handle,
8 * UtilityImageSize, 0, SRCCOPY);
//ImageList_DrawEx(UtilityImages.Handle, 8, DC, ButtonR.Right - 16, ButtonR.Bottom - 3, 16, 3, CLR_NONE, CLR_NONE,
// ILD_NORMAL);
StretchMaskBlt(DC, ButtonR.Left, ButtonR.Bottom - 3, Width div 2, 3, UtilityImages.Canvas.Handle,
6 * UtilityImageSize, 0, Width div 2, 3, UtilityImages.MaskHandle, 0, 0, 0);
BitBlt(DC, ButtonR.Left, ButtonR.Bottom - 3, Width div 2, 3, UtilityImages.Canvas.Handle,
6 * UtilityImageSize, 0, SRCCOPY);
//ImageList_DrawEx(UtilityImages.Handle, 6, DC, ButtonR.Left, ButtonR.Bottom - 3, Width div 2, 3, CLR_NONE,
// CLR_NONE, ILD_NORMAL);
end
else
begin
StretchMaskBlt(DC, ButtonR.Left, ButtonR.Bottom - 3, UtilityImageSize, 3, UtilityImages.Canvas.Handle,
6 * UtilityImageSize, 0, UtilityImageSize, 3, UtilityImages.MaskHandle, 0, 0, 0);
BitBlt(DC, ButtonR.Left, ButtonR.Bottom - 3, UtilityImageSize, 3, UtilityImages.Canvas.Handle,
6 * UtilityImageSize, 0, SRCCOPY);
//ImageList_DrawEx(UtilityImages.Handle, 6, DC, ButtonR.Left, ButtonR.Bottom - 3, 16, 3, CLR_NONE, CLR_NONE,
// ILD_NORMAL);
// Replicate inner part as many times as need to fill up the button rectangle.
XPos := ButtonR.Left + 16;
repeat
StretchMaskBlt(DC, XPos, ButtonR.Bottom - 3, UtilityImageSize, 3, UtilityImages.Canvas.Handle,
7 * UtilityImageSize, 0, UtilityImageSize, 3, UtilityImages.MaskHandle, 0, 0, 0);
BitBlt(DC, XPos, ButtonR.Bottom - 3, UtilityImageSize, 3, UtilityImages.Canvas.Handle,
7 * UtilityImageSize, 0, SRCCOPY);
//ImageList_DrawEx(UtilityImages.Handle, 7, DC, XPos, ButtonR.Bottom - 3, 16, 3, CLR_NONE, CLR_NONE, ILD_NORMAL);
Inc(XPos, 16);
until XPos + 16 >= ButtonR.Right;
StretchMaskBlt(DC, ButtonR.Right - 16, ButtonR.Bottom - 3, UtilityImageSize, 3, UtilityImages.Canvas.Handle,
8 * UtilityImageSize, 0, UtilityImageSize, 3, UtilityImages.MaskHandle, 0, 0, 0);
BitBlt(DC, ButtonR.Right - 16, ButtonR.Bottom - 3, UtilityImageSize, 3, UtilityImages.Canvas.Handle,
8 * UtilityImageSize, 0, SRCCOPY);
//ImageList_DrawEx(UtilityImages.Handle, 8, DC, ButtonR.Right - 16, ButtonR.Bottom - 3, 16, 3, CLR_NONE, CLR_NONE,
// ILD_NORMAL);
end;
@ -22170,9 +22169,8 @@ end;
procedure TBaseVirtualTree.PaintCheckImage(const PaintInfo: TVTPaintInfo);
var
ForegroundColor: COLORREF;
{$ifdef ThemeSupport}
var
R: TRect;
Details: TThemedElementDetails;
{$endif ThemeSupport}
@ -22214,22 +22212,8 @@ begin
{$endif ThemeSupport}
with FCheckImages do
begin
//todo: see what means ForegroundColor
if (vsSelected in Node.States) and not Ghosted then
begin
if Focused or (toPopupMode in FOptions.FPaintOptions) then
ForegroundColor := ColorToRGB(FColors.FocusedSelectionColor)
else
ForegroundColor := ColorToRGB(FColors.UnfocusedSelectionColor);
end
else
//ForegroundColor := GetRGBColor(BlendColor);
ForegroundColor := ColorToRGB(FColors.UnfocusedSelectionColor);
StretchMaskBlt(PaintInfo.Canvas.Handle, XPos, YPos, Height, Height, Canvas.Handle,
Index * Height, 0, Height, Height, MaskHandle, 0, 0, 0);
//ImageList_DrawEx(Handle, Index, Canvas.Handle, XPos, YPos, 0, 0, GetRGBColor(BkColor), ForegroundColor,
// ILD_TRANSPARENT);
end;
end;
Logger.ExitMethod([lcCheck],'PaintCheckImage');

View File

@ -1,7 +1,7 @@
object Form1: TForm1
Left = 604
Left = 272
Height = 458
Top = 358
Top = 234
Width = 538
HorzScrollBar.Page = 537
VertScrollBar.Page = 457

View File

@ -1,8 +1,8 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TForm1','FORMDATA',[
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'\'#2#6'Height'#3#202#1#3'Top'#3'f'#1#5'Wi'
+'dth'#3#26#2#18'HorzScrollBar.Page'#3#25#2#18'VertScrollBar.Page'#3#201#1#13
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#16#1#6'Height'#3#202#1#3'Top'#3#234#0#5'W'
+'idth'#3#26#2#18'HorzScrollBar.Page'#3#25#2#18'VertScrollBar.Page'#3#201#1#13
+'ActiveControl'#7#4'VST1'#7'Caption'#6#11'VT - Images'#12'ClientHeight'#3#202
+#1#11'ClientWidth'#3#26#2#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Se'
+'rif'#8'OnCreate'#7#10'FormCreate'#0#18'TVirtualStringTree'#4'VST1'#6'Height'

View File

@ -18,7 +18,6 @@ object MainForm: TMainForm
Top = 8
Width = 171
Caption = 'Last operation duration:'
Color = clNone
ParentColor = False
end
object VST: TVirtualStringTree

View File

@ -7,32 +7,32 @@ LazarusResources.Add('TMainForm','FORMDATA',[
+'mo'#12'ClientHeight'#3#230#1#11'ClientWidth'#3#171#1#11'Font.Height'#2#245#9
+'Font.Name'#6#13'MS Sans Serif'#8'OnCreate'#7#10'FormCreate'#0#6'TLabel'#6'L'
+'abel1'#4'Left'#2#10#6'Height'#2#17#3'Top'#2#8#5'Width'#3#171#0#7'Caption'#6
+#24'Last operation duration:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#18
+'TVirtualStringTree'#3'VST'#4'Left'#2#10#6'Height'#3'h'#1#3'Top'#2#24#5'Widt'
+'h'#3#154#1#11'BorderStyle'#7#8'bsSingle'#18'Colors.BorderColor'#7#12'clWind'
+'owText'#15'Colors.HotColor'#7#7'clBlack'#5'Ctl3D'#9#20'Header.AutoSizeIndex'
+#2#255#18'Header.Font.Height'#2#245#16'Header.Font.Name'#6#13'MS Sans Serif'
+#17'Header.MainColumn'#2#255#14'Header.Options'#11#14'hoColumnResize'#6'hoDr'
+'ag'#0#13'HintAnimation'#7#7'hatNone'#17'IncrementalSearch'#7#5'isAll'#13'Ro'
+'otNodeCount'#2'd'#8'TabOrder'#2#0#28'TreeOptions.AnimationOptions'#11#16'to'
+'AnimatedToggle'#0#23'TreeOptions.AutoOptions'#11#16'toAutoDropExpand'#22'to'
+'AutoTristateTracking'#0#23'TreeOptions.MiscOptions'#11#10'toEditable'#12'to'
+'InitOnSave'#18'toToggleOnDblClick'#14'toWheelPanning'#0#24'TreeOptions.Pain'
+'tOptions'#11#13'toShowButtons'#10'toShowRoot'#15'toShowTreeLines'#12'toThem'
+'eAware'#18'toUseBlendedImages'#0#28'TreeOptions.SelectionOptions'#11#13'toM'
+'ultiSelect'#22'toCenterScrollIntoView'#0#10'OnFreeNode'#7#11'VSTFreeNode'#9
+'OnGetText'#7#10'VSTGetText'#10'OnInitNode'#7#11'VSTInitNode'#7'Columns'#14#0
+#0#0#7'TButton'#11'ClearButton'#4'Left'#2'a'#6'Height'#2#25#3'Top'#3#196#1#5
+'Width'#3#183#0#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#10'Clear tree'
+#7'OnClick'#7#16'ClearButtonClick'#8'TabOrder'#2#1#0#0#7'TButton'#12'AddOneB'
+'utton'#4'Left'#2'a'#6'Height'#2#25#3'Top'#3#136#1#5'Width'#3#183#0#25'Borde'
+'rSpacing.InnerBorder'#2#4#7'Caption'#6#19'Add node(s) to root'#7'OnClick'#7
+#14'AddButtonClick'#8'TabOrder'#2#2#0#0#5'TEdit'#5'Edit1'#4'Left'#2#10#6'Hei'
+'ght'#2#21#3'Top'#3#136#1#5'Width'#2'O'#8'TabOrder'#2#3#4'Text'#6#1'1'#0#0#7
+'TButton'#7'Button1'#3'Tag'#2#1#4'Left'#2'`'#6'Height'#2#25#3'Top'#3#166#1#5
+'Width'#3#184#0#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#23'Add node(s'
+') as children'#7'OnClick'#7#14'AddButtonClick'#8'TabOrder'#2#4#0#0#7'TButto'
+'n'#11'CloseButton'#4'Left'#3'Y'#1#6'Height'#2#25#3'Top'#3#196#1#5'Width'#2
+'K'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#5'Close'#7'OnClick'#7#16
+'CloseButtonClick'#8'TabOrder'#2#5#0#0#0
+#24'Last operation duration:'#11'ParentColor'#8#0#0#18'TVirtualStringTree'#3
+'VST'#4'Left'#2#10#6'Height'#3'h'#1#3'Top'#2#24#5'Width'#3#154#1#11'BorderSt'
+'yle'#7#8'bsSingle'#18'Colors.BorderColor'#7#12'clWindowText'#15'Colors.HotC'
+'olor'#7#7'clBlack'#5'Ctl3D'#9#20'Header.AutoSizeIndex'#2#255#18'Header.Font'
+'.Height'#2#245#16'Header.Font.Name'#6#13'MS Sans Serif'#17'Header.MainColum'
+'n'#2#255#14'Header.Options'#11#14'hoColumnResize'#6'hoDrag'#0#13'HintAnimat'
+'ion'#7#7'hatNone'#17'IncrementalSearch'#7#5'isAll'#13'RootNodeCount'#2'd'#8
+'TabOrder'#2#0#28'TreeOptions.AnimationOptions'#11#16'toAnimatedToggle'#0#23
+'TreeOptions.AutoOptions'#11#16'toAutoDropExpand'#22'toAutoTristateTracking'
+#0#23'TreeOptions.MiscOptions'#11#10'toEditable'#12'toInitOnSave'#18'toToggl'
+'eOnDblClick'#14'toWheelPanning'#0#24'TreeOptions.PaintOptions'#11#13'toShow'
+'Buttons'#10'toShowRoot'#15'toShowTreeLines'#12'toThemeAware'#18'toUseBlende'
+'dImages'#0#28'TreeOptions.SelectionOptions'#11#13'toMultiSelect'#22'toCente'
+'rScrollIntoView'#0#10'OnFreeNode'#7#11'VSTFreeNode'#9'OnGetText'#7#10'VSTGe'
+'tText'#10'OnInitNode'#7#11'VSTInitNode'#7'Columns'#14#0#0#0#7'TButton'#11'C'
+'learButton'#4'Left'#2'a'#6'Height'#2#25#3'Top'#3#196#1#5'Width'#3#183#0#25
+'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#10'Clear tree'#7'OnClick'#7#16
+'ClearButtonClick'#8'TabOrder'#2#1#0#0#7'TButton'#12'AddOneButton'#4'Left'#2
+'a'#6'Height'#2#25#3'Top'#3#136#1#5'Width'#3#183#0#25'BorderSpacing.InnerBor'
+'der'#2#4#7'Caption'#6#19'Add node(s) to root'#7'OnClick'#7#14'AddButtonClic'
+'k'#8'TabOrder'#2#2#0#0#5'TEdit'#5'Edit1'#4'Left'#2#10#6'Height'#2#21#3'Top'
+#3#136#1#5'Width'#2'O'#8'TabOrder'#2#3#4'Text'#6#1'1'#0#0#7'TButton'#7'Butto'
+'n1'#3'Tag'#2#1#4'Left'#2'`'#6'Height'#2#25#3'Top'#3#166#1#5'Width'#3#184#0
+#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#23'Add node(s) as children'#7
+'OnClick'#7#14'AddButtonClick'#8'TabOrder'#2#4#0#0#7'TButton'#11'CloseButton'
+#4'Left'#3'Y'#1#6'Height'#2#25#3'Top'#3#196#1#5'Width'#2'K'#25'BorderSpacing'
+'.InnerBorder'#2#4#7'Caption'#6#5'Close'#7'OnClick'#7#16'CloseButtonClick'#8
+'TabOrder'#2#5#0#0#0
]);

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<PathDelim Value="/"/>
<Version Value="5"/>
<General>
<Flags>
@ -9,7 +9,7 @@
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<IconPath Value=".\"/>
<IconPath Value="./"/>
<TargetFileExt Value=".exe"/>
</General>
<VersionInfo>
@ -23,7 +23,7 @@
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="2">
@ -52,7 +52,6 @@
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<PathDelim Value="\"/>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>