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

View File

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

View File

@ -1,8 +1,8 @@
{ This is an automatically generated lazarus resource file } { This is an automatically generated lazarus resource file }
LazarusResources.Add('TForm1','FORMDATA',[ 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' 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#16#1#6'Height'#3#202#1#3'Top'#3#234#0#5'W'
+'dth'#3#26#2#18'HorzScrollBar.Page'#3#25#2#18'VertScrollBar.Page'#3#201#1#13 +'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 +'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' +#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' +'rif'#8'OnCreate'#7#10'FormCreate'#0#18'TVirtualStringTree'#4'VST1'#6'Height'

View File

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

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<PathDelim Value="\"/> <PathDelim Value="/"/>
<Version Value="5"/> <Version Value="5"/>
<General> <General>
<Flags> <Flags>
@ -9,7 +9,7 @@
</Flags> </Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<IconPath Value=".\"/> <IconPath Value="./"/>
<TargetFileExt Value=".exe"/> <TargetFileExt Value=".exe"/>
</General> </General>
<VersionInfo> <VersionInfo>
@ -23,7 +23,7 @@
<RunParams> <RunParams>
<local> <local>
<FormatVersion Value="1"/> <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> </local>
</RunParams> </RunParams>
<RequiredPackages Count="2"> <RequiredPackages Count="2">
@ -52,7 +52,6 @@
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>
<Version Value="5"/> <Version Value="5"/>
<PathDelim Value="\"/>
<CodeGeneration> <CodeGeneration>
<Generate Value="Faster"/> <Generate Value="Faster"/>
</CodeGeneration> </CodeGeneration>