[Lazarus] toolbar and toolbutton issues

Graeme Geldenhuys graeme at geldenhuys.co.uk
Wed Dec 5 15:33:49 CET 2012


Hi,

I was looking at various GUI toolkits to draw inspiration for a Toolbar
widget for fpGUI. Up until now I have simply used a Bevel and Buttons
(though fpGUI's buttons have more functionality that LCL's TButton).
This works well, but I thought I would created a dedicated widget for
the task.

The following criteria was given to me:

  * easily add buttons
  * easily add images
  * set toolbar style. Controlling the visual aspect for text only,
    images only, text below images, text to the side, adhere to
    desktop environment preferences.

While looking at LCL's Toolbar and ToolButton functionality, and trying
the simple ideas listed above, I can across some flaws or bugs in LCL.
I'm using the Lazarus 1.0.4 release.

What works:
  - Adding buttons are easy
  - Adding images are easy

Problems:
  - I used a set of 24x24 PNG images, but the images get clipped in
    the ImageList Property Editor. Right and Bottom of images are
    clipped in the image preview area. It looks like the ImageList is
    hardcoded to 16x16 images only! Why the 16px size limit?
  - Image are also clipped on the toolbar buttons. The default toolbar
    button size appear to be too small for the images used.
  - I then resized the heigh of the toolbar - toolbuttons don't resize?
    So what does the AutoSize property do?
  - I then set AutoSize = True of each toolbutton, but the buttons
    don't change size at all???
  - Why does the Toolbar have a Caption property??
  - Where do I set the toolbar style? I only found Toolbar.ShowCaptions,
    but nowhere do I see, text only, image only, text below image, text
    to right of image, adhere to desktop preference (Gnome & KDE at
    least).


See attached screenshot showing the clipping and resize issues.


I thought I would raise these issues in the mailing list first, before I
report them all as bugs in Mantis.



Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot at 2012-12-05 14:13:53.png
Type: image/png
Size: 5817 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20121205/ade11d2d/attachment-0002.png>


More information about the Lazarus mailing list