📄 aclfpainter.pas
字号:
else Result:=inherited DefaultSelectionColor;
end;
class function TcxACLookAndFeelPainter.DefaultSelectionTextColor: TColor;
begin
if Skinned then Result:=DefaultManager.GetHighLightFontColor
else Result:=inherited DefaultSelectionTextColor;
end;
class function TcxACLookAndFeelPainter.DefaultSeparatorColor: TColor;
begin
if Skinned then Result:=clRed
else Result:=inherited DefaultSeparatorColor;
end;
class function TcxACLookAndFeelPainter.DefaultFilterBoxColor: TColor;
begin
if Skinned then Result := DefaultManager.GetGlobalColor else Result := inherited DefaultFilterBoxColor
end;
class function TcxACLookAndFeelPainter.DefaultFilterBoxTextColor: TColor;
begin
if Skinned then Result := DefaultManager.GetGlobalFontColor else Result := inherited DefaultFilterBoxTextColor
end;
class function TcxACLookAndFeelPainter.DefaultFixedSeparatorColor: TColor;
begin
if Skinned then Result := clRed else Result := inherited DefaultFixedSeparatorColor;
end;
class function TcxACLookAndFeelPainter.DefaultFooterColor: TColor;
begin
if Skinned then Result := DefaultManager.GetActiveEditColor else Result := inherited DefaultFooterColor
end;
class function TcxACLookAndFeelPainter.DefaultFooterTextColor: TColor;
begin
if Skinned then Result := DefaultManager.GetActiveEditFontColor else Result := inherited DefaultFooterTextColor
end;
class function TcxACLookAndFeelPainter.DefaultGridLineColor: TColor;
begin
if Skinned then Result := clBtnShadow else Result := inherited DefaultGridLineColor;
end;
class function TcxACLookAndFeelPainter.DefaultGroupByBoxColor: TColor;
begin
if Skinned then Result := DefaultManager.GetGlobalColor else Result := inherited DefaultGroupByBoxColor
end;
class function TcxACLookAndFeelPainter.DefaultHeaderTextColor: TColor;
begin
if Skinned then Result := DefaultManager.GetActiveEditFontColor else Result := inherited DefaultHeaderTextColor;
end;
class function TcxACLookAndFeelPainter.DefaultHyperlinkTextColor: TColor;
begin
if Skinned then Result := clRed else Result := inherited DefaultHyperlinkTextColor;
end;
class function TcxACLookAndFeelPainter.DefaultGroupByBoxTextColor: TColor;
begin
if Skinned then Result := DefaultManager.GetGlobalFontColor else Result := inherited DefaultGroupByBoxTextColor
end;
class function TcxACLookAndFeelPainter.DefaultGroupColor: TColor;
begin
if Skinned then Result := DefaultManager.GetGlobalColor else Result := inherited DefaultGroupColor;
end;
class function TcxACLookAndFeelPainter.DefaultGroupTextColor: TColor;
begin
if Skinned then Result := DefaultManager.GetGlobalFontColor else Result := inherited DefaultGroupTextColor
end;
class function TcxACLookAndFeelPainter.DefaultHeaderBackgroundColor: TColor;
begin
if Skinned then Result := DefaultManager.GetGlobalFontColor else Result := inherited DefaultHeaderBackgroundColor
end;
class function TcxACLookAndFeelPainter.DefaultHeaderColor: TColor;
begin
if Skinned then Result := DefaultManager.GetGlobalColor else Result := inherited DefaultHeaderColor
end;
class function TcxACLookAndFeelPainter.DefaultInactiveColor: TColor;
begin
if Skinned then Result := DefaultManager.GetGlobalColor else Result := inherited DefaultInactiveColor
end;
class function TcxACLookAndFeelPainter.DefaultInactiveTextColor: TColor;
begin
if Skinned then Result := DefaultManager.GetGlobalFontColor else Result := inherited DefaultInactiveTextColor
end;
class function TcxACLookAndFeelPainter.DefaultPreviewTextColor: TColor;
begin
if Skinned then Result := clRed else Result := inherited DefaultPreviewTextColor;
end;
class function TcxACLookAndFeelPainter.DefaultRecordSeparatorColor: TColor;
begin
if Skinned then Result := clRed else Result := inherited DefaultRecordSeparatorColor;
end;
class function TcxACLookAndFeelPainter.DefaultTabColor: TColor;
begin
if DefaultManager <> nil then Result := DefaultManager.GetGlobalColor else Result := inherited DefaultTabColor
end;
class function TcxACLookAndFeelPainter.DefaultTabTextColor: TColor;
begin
if Skinned then Result:=clRed
else Result:=inherited DefaultTabTextColor;
end;
class function TcxACLookAndFeelPainter.DefaultTabsBackgroundColor: TColor;
begin
if Skinned then Result := DefaultManager.GetGlobalColor else Result := inherited DefaultTabsBackgroundColor
end;
class function TcxACLookAndFeelPainter.DefaultChartDiagramValueBorderColor: TColor;
begin
if Skinned then Result:=clRed
else Result:=inherited DefaultChartDiagramValueBorderColor;
end;
class function TcxACLookAndFeelPainter.DefaultChartDiagramValueCaptionTextColor: TColor;
begin
if Skinned then Result:=clRed
else Result:=inherited DefaultChartDiagramValueCaptionTextColor;
end;
class function TcxACLookAndFeelPainter.DefaultChartHistogramAxisColor: TColor;
begin
if Skinned then Result:=clRed
else Result:=inherited DefaultChartHistogramAxisColor;
end;
class function TcxACLookAndFeelPainter.DefaultChartHistogramGridLineColor: TColor;
begin
if Skinned then Result:=clRed
else Result:=inherited DefaultChartHistogramGridLineColor;
end;
class function TcxACLookAndFeelPainter.DefaultChartHistogramPlotColor: TColor;
begin
if Skinned then Result:=clRed
else Result:=inherited DefaultChartHistogramPlotColor;
end;
class function TcxACLookAndFeelPainter.DefaultChartPieDiagramSeriesSiteBorderColor: TColor;
begin
if Skinned then Result:=clRed
else Result:=inherited DefaultChartPieDiagramSeriesSiteBorderColor;
end;
class function TcxACLookAndFeelPainter.DefaultChartPieDiagramSeriesSiteCaptionColor: TColor;
begin
if Skinned then Result:=clRed
else Result:=inherited DefaultChartPieDiagramSeriesSiteCaptionColor;
end;
class function TcxACLookAndFeelPainter.DefaultChartPieDiagramSeriesSiteCaptionTextColor: TColor;
begin
if Skinned then Result:=clRed
else Result:=inherited DefaultChartPieDiagramSeriesSiteCaptionTextColor;
end;
class function TcxACLookAndFeelPainter.DefaultChartToolBoxDataLevelInfoBorderColor: TColor;
begin
if Skinned then Result:=clRed
else Result:=inherited DefaultChartToolBoxDataLevelInfoBorderColor;
end;
class function TcxACLookAndFeelPainter.DefaultChartToolBoxItemSeparatorColor: TColor;
begin
if Skinned then Result:=clRed
else Result:=inherited DefaultChartToolBoxItemSeparatorColor;
end;
class function TcxACLookAndFeelPainter.DefaultTimeGridMajorScaleTextColor: TColor;
begin
Result := clRed//!!!
end;
class procedure TcxACLookAndFeelPainter.DrawBorder(ACanvas: TcxCanvas; R: TRect);
var
i, m : integer;
begin
if Skinned then begin
i := DefaultManager.GetSkinIndex(s_Edit);
m := DefaultManager.GetMaskIndex(i, s_Edit, s_BordersMask);
if DefaultManager.IsValidImgIndex(m) then begin
PaintConstBorder(2, DefaultManager.ma[m], R, ACanvas);
end;
end
else inherited DrawBorder(ACanvas, R)
end;
Class procedure TcxACLookAndFeelPainter.DrawButton(ACanvas: TcxCanvas; R: TRect; const ACaption: string;
AState: TcxButtonState; ADrawBorder: Boolean = True; AColor: TColor = clDefault;
ATextColor: TColor = clDefault; AWordWrap: boolean = False);
var
i : integer;
TmpBmp : TBitmap;
State : integer;
CI : TCacheInfo;
begin
if Skinned then begin
i := DefaultManager.GetSkinIndex(s_Button);
if DefaultManager.IsValidSkinIndex(i) then begin
case AState of cxbsHot : State := 1; cxbsPressed : State := 2; else State := 0 end;
TmpBmp := CreateBmp24(WidthOf(R), HeightOf(R));
FillDC(TmpBmp.Canvas.Handle, Rect(0, 0, TmpBmp.Width, TmpBmp.Height), DefaultManager.GetGlobalColor);
CI := MakeCacheInfo(TmpBmp);
CI.FillColor := DefaultManager.GetGlobalColor;
CI.Ready := False;
PaintItem(i, s_Button, CI, True, State, Rect(0, 0, TmpBmp.Width, TmpBmp.Height), Point(0, 0), TmpBmp, DefaultManager);
// PaintSmallItem(i, s_Button, CI, True, State, Rect(0, 0, TmpBmp.Width, TmpBmp.Height), Point(0, 0), TmpBmp, DefaultManager);
BitBlt(ACanvas.Handle, R.Left, R.Top, TmpBmp.Width, TmpBmp.Height, TmpBmp.Canvas.Handle, 0, 0, SRCCOPY);
if State = 0
then ACanvas.Font.Color := DefaultManager.gd[i].FontColor[1]
else ACanvas.Font.Color := DefaultManager.gd[i].HotFontColor[1];
ACanvas.Brush.Style := bsClear;
DrawText(ACanvas.Handle, PAnsiChar(ACaption), Length(ACaption), R, DT_EXPANDTABS + DT_VCENTER + DT_CENTER + DT_SINGLELINE);
FreeAndNil(TmpBmp);
end;
end else inherited DrawButton(ACanvas, R, ACaption, AState, ADrawBorder, AColor, ATextColor)
end;
class procedure TcxACLookAndFeelPainter.DrawCheckButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState; ACheckState: TcxCheckBoxState);
var
State, i, w, h, {x, y,} NewLeft, NewTop : integer;
TmpBmp : TBitmap;
begin
if Skinned then begin
case ACheckState of
cbsUnchecked : DefaultManager.GetMaskIndex(DefaultManager.ConstData.IndexGLobalInfo, s_GLobalInfo, s_SmallBoxUnChecked);
cbsChecked : i := DefaultManager.GetMaskIndex(DefaultManager.ConstData.IndexGLobalInfo, s_GLobalInfo, s_SmallBoxChecked);
cbsGrayed : i := DefaultManager.GetMaskIndex(DefaultManager.ConstData.IndexGLobalInfo, s_GLobalInfo, s_SmallBoxGrayed);
end;
if DefaultManager.IsValidImgIndex(i) then begin
TmpBmp := CreateBmp24(WidthOf(R), HeightOf(R));
FillDC(TmpBmp.Canvas.Handle, Rect(0, 0, TmpBmp.Width, TmpBmp.Height), DefaultManager.GetGlobalColor);
case AState of cxbsHot : State := 1; cxbsPressed : State := 2; else State := 0 end;
w := WidthOf(DefaultManager.ma[i].R) div DefaultManager.ma[i].ImageCount;
h := HeightOf(DefaultManager.ma[i].R) div (1 + DefaultManager.ma[i].MaskType);
if State > DefaultManager.ma[i].ImageCount - 1 then State := DefaultManager.ma[i].ImageCount - 1;
NewLeft := {R.Left +} (WidthOf(R) - w) div 2;
Newtop := {R.Top +} (HeightOf(R) - h) div 2;
DrawSkinGlyph(TmpBmp, Point(NewLeft, NewTop), State, 1, DefaultManager.ma[i], MakeCacheInfo(TmpBmp));
BitBlt(ACanvas.Handle, R.Left, R.Top, w, h, TmpBmp.Canvas.Handle, 0, 0, SRCCOPY);
FreeAndNil(TmpBmp);
end;
end else inherited DrawCheckButton(ACanvas, R, AState, ACheckState)
end;
class procedure TcxACLookAndFeelPainter.DrawCheckButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState; AChecked: Boolean);
var
State, i, w, h, NewLeft, NewTop : integer;
TmpBmp : TBitmap;
begin
if Skinned then begin
if AChecked
then i := DefaultManager.GetMaskIndex(DefaultManager.ConstData.IndexGLobalInfo, s_GLobalInfo, s_SmallBoxChecked)
else i := DefaultManager.GetMaskIndex(DefaultManager.ConstData.IndexGLobalInfo, s_GLobalInfo, s_SmallBoxUnChecked);
if DefaultManager.IsValidImgIndex(i) then begin
TmpBmp := CreateBmp24(WidthOf(R), HeightOf(R));
FillDC(TmpBmp.Canvas.Handle, Rect(0, 0, TmpBmp.Width, TmpBmp.Height), DefaultManager.GetGlobalColor);
case AState of cxbsHot : State := 1; cxbsPressed : State := 2; else State := 0 end;
w := WidthOf(DefaultManager.ma[i].R) div DefaultManager.ma[i].ImageCount;
h := HeightOf(DefaultManager.ma[i].R) div (1 + DefaultManager.ma[i].MaskType);
if State > DefaultManager.ma[i].ImageCount - 1 then State := DefaultManager.ma[i].ImageCount - 1;
NewLeft := (WidthOf(R) - w) div 2;
Newtop := (HeightOf(R) - h) div 2;
DrawSkinGlyph(TmpBmp, Point(NewLeft, NewTop), State, 1, DefaultManager.ma[i], MakeCacheInfo(TmpBmp));
BitBlt(ACanvas.Handle, R.Left, R.Top, w, h, TmpBmp.Canvas.Handle, 0, 0, SRCCOPY);
FreeAndNil(TmpBmp);
end;
end else inherited DrawCheckButton(ACanvas, R, AState, AChecked)
end;
class procedure TcxACLookAndFeelPainter.DrawRadioButton(ACanvas: TcxCanvas; X, Y: Integer; AButtonState: TcxButtonState; AChecked, AFocused: Boolean; ABrushColor: TColor; AIsDesigning: Boolean = False);
var
State, i : integer;
TmpBmp : TBitmap;
Size : TSize;
begin
if Skinned then begin
if AChecked
then i := DefaultManager.GetMaskIndex(DefaultManager.ConstData.IndexGLobalInfo, s_GLobalInfo, s_RadioButtonChecked)
else i := DefaultManager.GetMaskIndex(DefaultManager.ConstData.IndexGLobalInfo, s_GLobalInfo, s_RadioButtonUnChecked);
if DefaultManager.IsValidImgIndex(i) then begin
Size.cx := WidthOfImage(DefaultManager.ma[i]);
Size.cy := HeightOfImage(DefaultManager.ma[i]);
TmpBmp := CreateBmp24(Size.cx, Size.cy);
FillDC(TmpBmp.Canvas.Handle, Rect(0, 0, Size.cx, Size.cy), DefaultManager.GetGlobalColor);
case AButtonState of cxbsHot : State := 1; cxbsPressed : State := 2; else State := 0 end;
if State > DefaultManager.ma[i].ImageCount - 1 then State := DefaultManager.ma[i].ImageCount - 1;
DrawSkinGlyph(TmpBmp, Point(0, 0), State, 1, DefaultManager.ma[i], MakeCacheInfo(TmpBmp));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -