|
Post by vovchik on Apr 27, 2018 10:29:31 GMT 1
Dear all, I worked a bit on hug-fltk and added a few widgets (mac-style gettabs and a dragbar) and a popup menu. The demos and an updated hug-fltk are in the archive. I hope they work for you. If not, please let me know. Thanks. With kind regards, vovchik UPDATED: Originally, I forgot to include images-evolution.bac. It i now in the archive. Sorry. Attachments:
extra-widgets.tar.gz (85.16 KB)
|
|
|
Post by rikky on Apr 27, 2018 22:40:25 GMT 1
Well Ja, They all work, as promised. I personally like the Simple System Stats. Unfortunately , I'm not yet ready to dive into this. I find the normal Hug still difficult, and I am a slow learner. But in time, somewhere in the future, no doubt. Rik.
|
|
|
Post by vovchik on Apr 28, 2018 0:25:07 GMT 1
Dear Rik, Thanks for testing. I also prefer plain notebook tabs to gels in vsss, but I put them there just to show that geltabs can work as easy drop-in replacements. Don't get me wrong, I still like HUG, gtk2 and gtk3, but fltk is relatively new to me, so I am experimenting and trying to make hug-fltk both versatile and easy to use. And soon we will have to learn Alex's gui syntax, too. With kind regards, vovchik
|
|
|
Post by vovchik on May 7, 2018 10:12:29 GMT 1
Dear all, Here is a little image viewer I cobbled together using some c++ source I found somewhere. I modded it a bit and added support for SVG display. Let me know whether it works for you. Thanks. With kind regards, vovchik Attachments:bfiv-src.tar.gz (25.06 KB)
|
|
|
Post by Pjot on May 7, 2018 20:29:33 GMT 1
Hi vovchik, Compiles and works on my 6bit Linux Mint! One remark: I tried to open a GIF file, which, as I found out later, appeared to be corrupted, but then the program hangs... I had to kill it manually BR Peter
|
|
|
Post by vovchik on May 7, 2018 21:35:07 GMT 1
Dear Peter, Thanks for testing. I still have to build in some kind of validity checking, obviously. I tested with a few normal gifs, and everything worked there, as with the other formats. And I created on bad SVG. Will have to work on that checking a bit. Also, if you use the numpad keys and make an image too small, you will get a runtime sefgault. I also have to look at ways of preventing infinite scaling. With kind regards, vovchik
|
|
|
Post by vovchik on Jun 1, 2018 23:24:54 GMT 1
Dear all, When writing Gxlat link, I noticed that there was a bit of time - because of the network and the API - that elapsed between the time I pressed the Xlat button and got the result back from Google Translate in the upper window. The user should probably know that some network event is in progress. I can show this with a dummy progress bar but think that an animated throbber is a useful widget. Here is a prototpye that I want to use in hug-fltk. Let me know if it works for you and whether you have any suggestiions for improvement. With kind regards, vovchik UPDATED: Thanks Peter. Added a BUTTON_TOGGLE to hug_fltk and included a button in the second demo to control (start/stop) the animation. Also changed the widget from a button to a plain old box in the second demo, since we do not usually want a throbber responsive to mouse clicks (although maybe sometimes). UPDATED AGAIN: Added fifth throbber at bottom middle that is hidden when the pause button is pressed. This is the way it might most often be used (maybe). Attachments:
throbber-src.tar.gz (25.37 KB)
|
|
|
Post by Pjot on Jun 2, 2018 8:27:53 GMT 1
Thanks vovchik,
Works perfectly fine, and I like the idea of an animated widget! It sure helps the user with his interaction with the GUI.
Best regards Peter
|
|
|
Post by rikky on Jun 2, 2018 9:27:54 GMT 1
Yes, it works, flawlessly on the Raspi. The code could not have been more simple, I suppose. But somehow I can not figure out where you've got this arrow from. Rik
|
|
|
Post by vovchik on Jun 2, 2018 12:35:33 GMT 1
Dear Rik and Peter, Thanks for trying. I am glad it is working for you. As for the arrows and where they come from, FLTK has predefined, named symbols that, when put into a string and preceded by a "@" symbol, appear, as if by magic (and they can be rotated, scaled and styled). They are described somwhere in the documentation and are all enumerated in an FLTK H file (can't remember the exact name right now). This allows for some rather nice, simple animation without too much code. And rather than hiding the arrow, as in the last demo, I could make it grey and stop animation - meaning that it would show, but just appear inactive and greyed out.I'll have to try that before committing the throbber widget to hug-fltk. With kind regards, vovchik @ Rik: I found the place where those symbols are explained (under Labels and Label Types): symbols.
|
|
|
Post by vovchik on Jun 3, 2018 23:39:55 GMT 1
Dear all, A few more examples are in the attached archive, including a pulsating circle. With kind regards, vovchik
|
|
|
Post by vovchik on Jun 10, 2018 6:59:47 GMT 1
Dear all, Here is a little countdown demo that makes use of fl_lighten and a timer. Let me know whether it works for you. Thanks. With kind regards, vovchik Attachments:
countdown-src.tar.gz (26.57 KB)
|
|
|
Post by rikky on Jun 10, 2018 7:09:28 GMT 1
Yep, works perfectly on the Rpi.
|
|
|
Post by vovchik on Jun 10, 2018 15:19:27 GMT 1
Dear Rik, Thanks for testing and the positive feedback. I have added a new version to the archive above that has a wee bit more animation, just to demonstrate how easy it is. Cheers. With kind regards, vovchik
|
|
|
Post by bigbass on Jun 10, 2018 16:21:38 GMT 1
Hello guys
Note to vovchik all of those demos look great! and have a unique way of showing the progress very creative
To get back in the swing of things after some time off here is a progressbar demo that shows how to do a port from fltk to BaCon to get an idea of what is going on step by step of the porting process
I used the arrow operator approach -> for the port since it seems easier to adapt the code for other fluid /fltk widgets later
Joe
'--- progressbar demo ported and adapted for BaCon by bigbass '--- link to original source code http://seriss.com/people/erco/fltk/#Progress
PRAGMA INCLUDE <iostream> PRAGMA INCLUDE <unistd.h> PRAGMA INCLUDE <FL/Fl.H> PRAGMA INCLUDE <FL/Fl_Double_Window.H> PRAGMA INCLUDE <FL/Fl_Button.H> PRAGMA INCLUDE <FL/Fl_Progress.H>
PRAGMA LDFLAGS -lfltk PRAGMA COMPILER g++ PRAGMA OPTIONS -Wno-write-strings -Wno-pointer-arith
OPTION PARSE FALSE TRAP LOCAL
'---------------------------------------------- SUB BUTTON_CB(Fl_Widget *butt, void *data) '----------------------------------------------
PRINT "in the callback now" DECLARE progress TYPE Fl_Progress* DECLARE WIN TYPE Fl_Double_Window* DECLARE percent[10] TYPE char
'--- Deactivate the button '--- prevent button from being pressed again BUTT->deactivate()
'--- give fltk some cpu to gray out button Fl::check()
'--- access parent DOUBLE window '--- Make the progress bar '--- Fl_Double_Window *w = (Fl_Double_Window*)data WIN = (Fl_Double_Window*)data
WIN->begin() '--- add progress bar to it.. progress = new Fl_Progress(10,100,200,30) '--- set progress range to be 0.0 ~ 1.0 progress->minimum(0) progress->maximum(1) '--- background color progress->color(0x88888800) '--- progress bar color progress->selection_color(0x4444ff00) '--- percent text color progress->labelcolor(FL_WHITE) WIN->end() '--- Computation loop.. FOR t = 1 TO 500 progress->value(t/500.0) '---char percent[10] declared above sprintf(percent, "%d%%", int((t/500.0)*100.0)) progress->label(percent) Fl::check() usleep(5000) NEXT
'--- Cleanup '--- remove progress bar from window WIN->remove(progress) '--- deallocate it delete(progress) '--- reactivate button BUTT->activate() '--- tell window to redraw now that progress was removed WIN->redraw() END SUB
DECLARE BUTT TYPE Fl_Button* '--- must have unique names for the window and button not o or w WIN = new Fl_Double_Window(290, 175,"Progress bar demo") BUTT = new Fl_Button(25, 25, 115, 25,"Press") '--- must have a window as arg2 or will seg fault BUTT->callback(BUTTON_CB,WIN) WIN->show() Fl::run()
|
|