Recent

Author Topic: Progress Bar / GUI advice  (Read 3737 times)

Zitt

  • Newbie
  • Posts: 5
Progress Bar / GUI advice
« on: February 18, 2019, 09:54:33 am »
New here... Been programming in Delphi 3/4 for years … all of my software was designed in Delphi or Pascal... I stopped developing Shareware applications when the day job moved from a hardware focus into a software focus. I get most
 of software jollies from the day job now.

Lately I've been spending more time working on Pinball machines and developing hardware projects for that market. At home I develop purpose built applications for the sole purpose of driving these hardware projects. The one I'm most proud of is a cross/platform interface GUI built in Unity:
http://pinball-mods.com/oscom/modifications-bolt-on-mods-star-trek-gi-dimmer-p-41.html

Anyway - enough ramblin; I'm developing a new project which interfaces with a microcontroller with a native usb 2.0 port. This device connects up to USB and provides a serial port. The configuration app is intended to be cross-platform focusing on Win32/64, but eventually if the product takes off - porting to MAC and/or Linux.

I was going to go with Delphi Berlin or later... but holy crap that tool has gotten obscenly expensive. Ain't no way I'm designing my simple configure app in a 1400 dollar tool. As a result; I've been having a good nostalga moment designing the app in Lazarus and FPC. It's been fun knocking the rust off my Pascal skills.

For the GUI; I'm looking for a specalized "progress bar" type component. While I can just use the existing progress bar; I was hoping the invite the community to make some suggestions. I've been looking via Google and have seen that unlike the hey-day of Delphi... the 3rd party component packs have gone away.

My ideal "progress bar" is something that can be configured with a "tick mark" with a specific label - actually several labels. In this case; I want to show the current draw of the device. On the progress bar; I'd show the existing current with the maximum being some number... let's say 1.2amps. Then i'd have a minimum of two "milestone" tickmarks. The first being the USB2.0 current limit of 500mA... and the second being a "lamp" limit of a standard #555 or #47 bulb ( https://www.flippers.com/lights.html ).

The reason I want to do this is this product has 60 LEDs on it... and it can easily easily exceed the USB and bulb limits and I wanted to reflect those milestones in a graphical way to the end user.

Thoughts? Suggestions? Pipe Dream?

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Progress Bar / GUI advice
« Reply #1 on: February 18, 2019, 10:15:43 am »
Options for customising the standard LCL progressbar are rather limited, since it is implemented using the native widgetset implementation for your platform, and so restricted to the capabilities common to native progressbar APIs and OS theming.
It is relatively straightforward to write a graphical (display-only) component as a TGraphicControl descendant to represent custom data in diagrammatic way using only LCL Canvas routines. There are  examples on this forum.
If you are stuck, give a more detailed specification of what you want, and I'm sure we can get you started with something you can customise exactly how you want.
A control that is user-editable (not read-only) is not much harder to write, but is obviously more complex, since it requires working mouse and keyboard interaction.

« Last Edit: February 18, 2019, 10:17:29 am by howardpc »

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: Progress Bar / GUI advice
« Reply #3 on: February 18, 2019, 04:44:56 pm »
Or the Industrial package (https://sourceforge.net/projects/lazarus-ccr/files/industrialstuff/industrialstuff-0.3.0.zip/download, or install via OnlinePackageManager) if you want something less heavy-weight.

Zitt

  • Newbie
  • Posts: 5
Re: Progress Bar / GUI advice
« Reply #4 on: February 18, 2019, 10:32:43 pm »
Thanks, I looked over the documentation of the controls suggested. Some don't have pictures; so I may have overlooked something.

http://wiki.freepascal.org/Eye-Candy_Controls
Looks like the better choice.
I like TECSlider or maybe TECProgressBar combined with a TECRuler.

Ideally I'd like TECRuler to be overridden to show non-Percentages and only have say three tick marks.

Let me ponder this a bit more to see if I can come up with a more detailed explaination.

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: Progress Bar / GUI advice
« Reply #5 on: February 18, 2019, 11:07:38 pm »
That's easy. Set:
ECProgressBar.Scale.TickLongValue to 50
ECProgressBar.Scale.TickVisible to etvLongOnly
ECProgressBar.Scale.ValueVisible to evvNone
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

AlexTP

  • Hero Member
  • *****
  • Posts: 2402
    • UVviewsoft
Re: Progress Bar / GUI advice
« Reply #6 on: February 19, 2019, 09:08:14 am »
Consider to use http://wiki.freepascal.org/ATGauge
You can ask for some new feature maybe.

 

TinyPortal © 2005-2018