[Lazarus] Toolbar divider issues

Vojtěch Čihák vojtech.cihak at atlas.cz
Sun Nov 9 14:45:29 CET 2014


Hi,
 
@Is that expected, or it must be considered a bug?
 
That depends. Bugreport title is "ToolBar separator can't change width."
Now all dividers and separators on TToolBar can have different width.
 
Therefore, saying "when created in code both Separator and 
divider are 23 pixels,..." is meaningless, because now, what you set is what you get:
 
procedure TForm1.Button2Click(Sender: TObject);
var aTBtn: TToolButton;
begin
 aTBtn:=TToolButton.Create(self);
 aTBtn.Style:=tbsSeparator;
aTBtn.Width:=10;
 aTBtn.Parent:=ToolBar1;
end;

procedure TForm1.Button3Click(Sender: TObject);
var aTBtn: TToolButton;
begin
 aTBtn:=TToolButton.Create(self);
 aTBtn.Style:=tbsDivider;
aTBtn.Width:=5;
 aTBtn.Parent:=ToolBar1;
end;
 
Currently, there's probably nothing like default width of separator or divider.
 
I can look on it, maybe adding code to Style setter would solve it:
 
procedure TToolButton.SetStyle(Value: TToolButtonStyle);
begin
  if FStyle = Value then exit;
  FStyle := Value;
  if Value = tbsSeparator then Width := 10;
  if Value = tbsDivider then Width := 5;
  InvalidatePreferredSize;
  if IsControlVisible then
  UpdateVisibleToolbar;
end;  
 
I'll test it. 
 
Vojtěch 
______________________________________________________________

> Od: Giuliano Colla <giuliano.colla at fastwebnet.it>
> Komu: Lazarus mailing list <lazarus at lists.lazarus.freepascal.org>
> Datum: 09.11.2014 11:57
> Předmět: [Lazarus] Toolbar divider issues
>
With rev 46741 (patch from bug 25291) the default width of Toolbar 
Divider and Separator has become inconsistent.

Before the patch, both from IDE designer and from component created in 
code, Separator width was 10 pixels, and Divider width 5 pixels.

After the patch, from IDE designer Separator width has become 23 pixels, 
and Divider width 3 pixels; when created in code both Separator and 
divider are 23 pixels, as it can be seen in Editortoolbar.

Giuliano
_______________________________________________
Lazarus mailing list
Lazarus at lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus <http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20141109/ea9e6915/attachment-0003.html>


More information about the Lazarus mailing list