|
@@ -205,7 +205,7 @@ procedure Register;
|
|
implementation
|
|
implementation
|
|
|
|
|
|
uses
|
|
uses
|
|
- NewUxTheme.TmSchema, PathFunc, ActiveX, BidiUtils, Types;
|
|
|
|
|
|
+ Themes, NewUxTheme.TmSchema, PathFunc, ActiveX, BidiUtils, Types;
|
|
|
|
|
|
const
|
|
const
|
|
sRadioCantHaveDisabledChildren = 'Radio item cannot have disabled child items';
|
|
sRadioCantHaveDisabledChildren = 'Radio item cannot have disabled child items';
|
|
@@ -720,6 +720,8 @@ const
|
|
(CBS_CHECKEDNORMAL, CBS_CHECKEDHOT, CBS_CHECKEDPRESSED, CBS_CHECKEDDISABLED),
|
|
(CBS_CHECKEDNORMAL, CBS_CHECKEDHOT, CBS_CHECKEDPRESSED, CBS_CHECKEDDISABLED),
|
|
(CBS_MIXEDNORMAL, CBS_MIXEDHOT, CBS_MIXEDPRESSED, CBS_MIXEDDISABLED)
|
|
(CBS_MIXEDNORMAL, CBS_MIXEDHOT, CBS_MIXEDPRESSED, CBS_MIXEDDISABLED)
|
|
);
|
|
);
|
|
|
|
+ FontColorStates: array[Boolean] of TStyleFont = (sfListItemTextDisabled, sfListItemTextNormal);
|
|
|
|
+ CheckListItemStates: array[Boolean] of TThemedCheckListBox = (tclListItemDisabled, tclListItemNormal);
|
|
var
|
|
var
|
|
SavedClientRect: TRect;
|
|
SavedClientRect: TRect;
|
|
|
|
|
|
@@ -773,18 +775,39 @@ begin
|
|
ItemState := ItemStates[Index];
|
|
ItemState := ItemStates[Index];
|
|
UIState := SendMessage(Handle, WM_QUERYUISTATE, 0, 0);
|
|
UIState := SendMessage(Handle, WM_QUERYUISTATE, 0, 0);
|
|
Disabled := not Enabled or not ItemState.Enabled;
|
|
Disabled := not Enabled or not ItemState.Enabled;
|
|
|
|
+
|
|
|
|
+ { Style code below is based on Vcl.StdCtrls' TCustomListBox.CNDrawItem and Vcl.CheckList's
|
|
|
|
+ TCustomCheckListBox.DrawItem }
|
|
|
|
+ var LStyle := StyleServices(Self);
|
|
|
|
+ if not LStyle.Enabled or LStyle.IsSystemStyle then
|
|
|
|
+ LStyle := nil;
|
|
|
|
+
|
|
with Canvas do begin
|
|
with Canvas do begin
|
|
if not FWantTabs and (odSelected in State) and Focused then begin
|
|
if not FWantTabs and (odSelected in State) and Focused then begin
|
|
- Brush.Color := clHighlight;
|
|
|
|
NewTextColor := clHighlightText;
|
|
NewTextColor := clHighlightText;
|
|
- end
|
|
|
|
- else begin
|
|
|
|
- Brush.Color := Self.Color;
|
|
|
|
|
|
+ if (LStyle <> nil) and (seClient in StyleElements) then begin
|
|
|
|
+ Brush.Color := LStyle.GetSystemColor(clHighlight);
|
|
|
|
+ if seFont in StyleElements then
|
|
|
|
+ NewTextColor := LStyle.GetStyleFontColor(sfListItemTextSelected);
|
|
|
|
+ end else
|
|
|
|
+ Brush.Color := clHighlight;
|
|
|
|
+ end else begin
|
|
if Disabled then
|
|
if Disabled then
|
|
NewTextColor := clGrayText
|
|
NewTextColor := clGrayText
|
|
else
|
|
else
|
|
NewTextColor := Self.Font.Color;
|
|
NewTextColor := Self.Font.Color;
|
|
- end;
|
|
|
|
|
|
+ if (LStyle <> nil) and (seClient in StyleElements) then begin
|
|
|
|
+ Brush.Color := LStyle.GetStyleColor(scListBox);
|
|
|
|
+ if seFont in StyleElements then begin
|
|
|
|
+ NewTextColor := LStyle.GetStyleFontColor(FontColorStates[not Disabled]);
|
|
|
|
+ const Details = LStyle.GetElementDetails(CheckListItemStates[Enabled]);
|
|
|
|
+ var LColor: TColor;
|
|
|
|
+ if LStyle.GetElementColor(Details, ecTextColor, LColor) and (LColor <> clNone) then
|
|
|
|
+ NewTextColor := LColor;
|
|
|
|
+ end;
|
|
|
|
+ end else
|
|
|
|
+ Brush.Color := Self.Color;
|
|
|
|
+ end;
|
|
{ Draw threads }
|
|
{ Draw threads }
|
|
if FShowLines then begin
|
|
if FShowLines then begin
|
|
Pen.Color := clGrayText;
|
|
Pen.Color := clGrayText;
|
|
@@ -897,7 +920,7 @@ begin
|
|
lines are drawn -- and we mustn't draw too many. }
|
|
lines are drawn -- and we mustn't draw too many. }
|
|
InternalDrawText(Items[Index], Rect, DrawTextFormat or DT_CALCRECT, False);
|
|
InternalDrawText(Items[Index], Rect, DrawTextFormat or DT_CALCRECT, False);
|
|
FlipRect(Rect, SavedClientRect, FUseRightToLeft);
|
|
FlipRect(Rect, SavedClientRect, FUseRightToLeft);
|
|
- InternalDrawText(Items[Index], Rect, DrawTextFormat, FWantTabs and Disabled);
|
|
|
|
|
|
+ InternalDrawText(Items[Index], Rect, DrawTextFormat, FWantTabs and Disabled and (LStyle = nil));
|
|
{ Draw focus rectangle }
|
|
{ Draw focus rectangle }
|
|
if FWantTabs and not Disabled and (odSelected in State) and Focused and
|
|
if FWantTabs and not Disabled and (odSelected in State) and Focused and
|
|
(UIState and UISF_HIDEFOCUS = 0) then
|
|
(UIState and UISF_HIDEFOCUS = 0) then
|