Recent

Author Topic: TColorListbox problem with clNone - mark is not crossed  (Read 1593 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2406
    • UVviewsoft
TColorListbox problem with clNone - mark is not crossed
« on: December 01, 2018, 08:24:48 pm »
Gtk2 and Win32.
Color marks for clNone are Not crossed. They must. LCL has code to cross clNone items:

colorbox.pas
Code: Pascal  [Select][+][-]
  1.   if NewColor = clNone then
  2.   begin
  3.     NewColor := NoneColorColor;
  4.     noFill := true;
  5.   end
  6. ..
  7.  
  8.   Canvas.Brush.Color := NewColor;
  9.   Canvas.Pen.Color := clBlack;
  10.  
  11. ..
  12.   if noFill then
  13.   begin
  14.     Canvas.Line(r.Left, r.Top, r.Right-1, r.Bottom-1);
  15.     Canvas.Line(r.Left, r.Bottom-1, r.Right-1, r.Top);
  16.   end;
  17.  

Example app: it has ColorListbox and OnCreate event:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   List.Items.Clear;
  4.   List.Items.AddObject('test clNone', TObject(clNone));
  5.   List.Items.AddObject('test yellow', TObject(clYellow));
  6. end;
  7.  

property NoneColorColor set to white.

AlexTP

  • Hero Member
  • *****
  • Posts: 2406
    • UVviewsoft
Re: TColorListbox problem with clNone - mark is not crossed
« Reply #1 on: December 01, 2018, 08:45:23 pm »
Added patch for this. same as TColorBox does. same code.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: TColorListbox problem with clNone - mark is not crossed
« Reply #2 on: December 01, 2018, 09:15:53 pm »
Maybe you should add this (both the first post and the patch) to the bug tracker. Just saying. :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018