Martijn Laan 4 лет назад
Родитель
Сommit
20b837d47c
1 измененных файлов с 14 добавлено и 2 удалено
  1. 14 2
      Components/NewCheckListBox.pas

+ 14 - 2
Components/NewCheckListBox.pas

@@ -1502,8 +1502,14 @@ begin
 end;
 end;
 
 
 procedure TNewCheckListBox.SetItemFontStyle(Index: Integer; const AItemFontStyle: TFontStyles);
 procedure TNewCheckListBox.SetItemFontStyle(Index: Integer; const AItemFontStyle: TFontStyles);
+var
+  R: TRect;
 begin
 begin
-  ItemStates[Index].ItemFontStyle := AItemFontStyle;
+  if ItemStates[Index].ItemFontStyle <> AItemFontStyle then begin
+    ItemStates[Index].ItemFontStyle := AItemFontStyle;
+    R := ItemRect(Index);
+    InvalidateRect(Handle, @R, True);
+  end;
 end;
 end;
 
 
 procedure TNewCheckListBox.SetObject(Index: Integer; const AObject: TObject);
 procedure TNewCheckListBox.SetObject(Index: Integer; const AObject: TObject);
@@ -1556,8 +1562,14 @@ begin
 end;
 end;
 
 
 procedure TNewCheckListBox.SetSubItemFontStyle(Index: Integer; const ASubItemFontStyle: TFontStyles);
 procedure TNewCheckListBox.SetSubItemFontStyle(Index: Integer; const ASubItemFontStyle: TFontStyles);
+var
+  R: TRect;
 begin
 begin
-  ItemStates[Index].SubItemFontStyle := ASubItemFontStyle;
+  if ItemStates[Index].SubItemFontStyle <> ASubItemFontStyle then begin
+    ItemStates[Index].SubItemFontStyle := ASubItemFontStyle;
+    R := ItemRect(Index);
+    InvalidateRect(Handle, @R, True);
+  end;
 end;
 end;
 
 
 procedure TNewCheckListBox.Toggle(Index: Integer);
 procedure TNewCheckListBox.Toggle(Index: Integer);