Recent

Author Topic: Tutorial: Animating desktop widgets  (Read 3374 times)

sysrpl

  • Sr. Member
  • ****
  • Posts: 315
    • Get Lazarus
Tutorial: Animating desktop widgets
« on: March 25, 2015, 09:30:59 am »
I've written up another short tutorial related to creating cross platform animated desktop widgets. This tutorial deals with vector graphics which can be used to scale animated widgets to any size.

A video clip and walk through is located here:

http://www.getlazarus.org/forums/viewtopic.php?f=18&t=40

This is the location of my previous tutorial on animating with easings:

http://www.getlazarus.org/forums/viewtopic.php?f=18&t=39

mangakissa

  • Hero Member
  • *****
  • Posts: 1131
Re: Tutorial: Animating desktop widgets
« Reply #1 on: March 25, 2015, 09:45:51 am »
Nice tutorial. But one thing. It's built on FPC 3.0. Most users of lazarus including me still working with the release version, whitch has FPC 2.6.4 in it. Even when a new release will be deployed FPC 3.0 will not be distributed,

Yes, I know you can install FPC 3.0, but most users don't.
If I'm wrong and every user is 'upgrading' to the latest trunk of FPC, the release builders will making a mistake to not deploy it.
Lazarus 2.06 (64b) / FPC 3.0.4 / Windows 10
stucked on Delphi 10.3.1

sysrpl

  • Sr. Member
  • ****
  • Posts: 315
    • Get Lazarus
Re: Tutorial: Animating desktop widgets
« Reply #2 on: March 25, 2015, 09:58:49 am »
The website this article is listed on, which I run is called "getlazarus.org". The main page provides a link to this:

http://www.getlazarus.org/setup/

Which is my own customized version of Lazarus, that installs on Windows, Mac, and Linux platforms, and is specifically designed to run in parallel and not interfere in any way with any other Lazarus or FPC software on users system. For Mac users it's especially nice because it sets up the XCode and other dependencies automatically.

In addition to developing the Cross Codebot library, I also maintain Bare Game (http://www.baregame.org), which also requires FPC fixes_3_0, so believe me I am well aware of the requirements. And this why I make getting recent Lazarus versions easy.

sysrpl

  • Sr. Member
  • ****
  • Posts: 315
    • Get Lazarus
Re: Tutorial: Animating desktop widgets
« Reply #3 on: March 26, 2015, 01:46:00 am »
I've updated the original article with a video capture of the widget running using the same code on Linux. I didn't test this particular project on Linux previous to my original post. I copied over the project, built it without modifying a thing, and it just worked. See for yourself in the video at the project page (the 2nd video was captured on Linux).

A note on my Linux computer, it's a 2007 laptop (that's old) with a Core 2 Duo T9800 CPU, GeForce 8600M GT video card, and 4GB of RAM. It's running Ubuntu 14.04 64bit. Hopefully this gives you people some perspective on hardware/performance. Also, the screen capture imposes some limits on performance when running overlay windows, but you'd never know that judging by the video capture I posted.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Tutorial: Animating desktop widgets
« Reply #4 on: February 13, 2019, 09:33:55 am »
I have tried to follow the clock widget tutorial, and although at first look it seamed very nice, I must admit that it was a pain to follow. I struggled having many issues. I managed to compile after all, but it took me too much time. Many assumptions had to be made (I had to dig into the lib code to figure out), and probably not all were the correct ones. It was probably me, but I would have really appreciated if there were downloadable projects for animated desktop widgets tutorials. Did I miss them somehow? If not then such a shame there weren't any finished tutorial projects to download.

I attach here lazarus project from the clock desktop widget tutorial if anyone else face similar issues.

Original Codebot lib examples clock project can not be compiled under Windows because of linuxgtk ifdefs for TWidget and TFloatingForm. Is TWidget intended only for Linux? I saw some commented Windows ifdefs so I have tried to make TFloatingForm work under Windows but no luck.

I still think CodeBot has some amazing and very interesting features. Thank you for sharing the code. Great job. Unfortunately, license is pure LGPL (without linking exception) so it is unusable for most of my work.

Btw, some strange StockPriceChanged method is shown instead of clock Widget.Move example code in the clock tutorial.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Tutorial: Animating desktop widgets
« Reply #5 on: February 13, 2019, 09:51:46 am »
4 years old articles, but seems impressive for what they do.

Why use float type btw and what does it mean, 32bit? It's not even listed in the type guide
https://www.freepascal.org/docs-html/prog/progsu159.html
I'd recommend single for 32-bit and double 64-bit (only when accuracy of single isn't enough).

 

TinyPortal © 2005-2018