I started putting together a Demonstration Unit of sorts for my personal use. This unit serves as a testbed / playground / fiddle to demonstrate:
- Dynamic TButton property changes at runtime
- Updating Caption and Hint via Edit boxes
- Enabling or disabling AutoSize, Visible, Enabled states
- Choosing button cursor style interactively from a ComboBox
- Changing button font with a FontDialog
- Attaching and detaching a PopupMenu to the button
- Handling PopupMenu item clicks (Hello and Bye)
- Handling mouse events: enter, leave, move, and showing live coordinates
- Showing how to capture keyboard shortcut (Alt + Shift + P) to reveal property panel
- Using a Checkbox to show/hide an extra properties panel with smooth form resizing animation using Timer
- Displaying Linux process ID (PID) using fpGetPid
- Demonstrating checkboxes to enable or disable each individual property or feature
- Using ShowHint and live updating hint label
- Basic Timer usage for animation (scrolling form height)
Intended as an educational demo to show students or developers how different properties and events of TButton (and related controls) work in Lazarus.
When you first run the demo, you’ll see the initial screen as shown in the first screenshot. If you click the checkbox, the button will become enabled, and you can play around with it and test its various features.
Once you’ve had your fill of that, try pressing Alt + Shift + P — as shown in the second screenshot, this will reveal the "Properties" checkbox. When you click this checkbox, the form expands to show even more properties you can adjust and experiment with. So far, everything works as expected.
However, I noticed something curious: if I disable the button and then try to change its caption, it still updates and displays the new caption. Is this the expected and intended behavior?
Lastly, I’m wondering: how can I make the form animation faster and smoother?
Full working source code is attached in the zip. I know am asking a lot but would really appreciate if folks would just test my silly project and see if you get the same behavior. This is Linux and it works fine on Debian so should be fine on any *nix system I cannot say the same for Windows and macOS.