GIDForums  

Go Back   GIDForums > Computer Programming Forums > FLTK Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 02-Jul-2005, 16:34
maverick maverick is offline
New Member
 
Join Date: Jul 2005
Posts: 3
maverick is on a distinguished road

dial display


Basically I need such a widget in my FLTK GUI: a display dial that shows different angle ranges, e.g., 20 to 30 degrees, and 48-120 degrees.., etc. FLTK has a slider dial but it can only display a single range, plus it is an input widget. I am just wondering maybe I have to use an output widget such as "label",
reshape it into a round, and write my own code to draw those ranges. But I couldn't locate any drawing functions. Any suggestions are appreciated!
  #2  
Old 02-Jul-2005, 20:39
cable_guy_67's Avatar
cable_guy_67 cable_guy_67 is offline
Senior Member
 
Join Date: Oct 2004
Location: Nescopeck, PA
Posts: 1,109
cable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the rough
Hello and Welcome to GIDForums maverick. I have a few questions.
  • what version of FLTK
  • what target platform
  • what have to tried so far
  • could we see your code to date

Quote:
Originally Posted by maverick
Basically I need such a widget in my FLTK GUI: a display dial that shows different angle ranges, e.g., 20 to 30 degrees, and 48-120 degrees.., etc. FLTK has a slider dial but it can only display a single range, plus it is an input widget. I am just wondering maybe I have to use an output widget such as "label",
reshape it into a round, and write my own code to draw those ranges. But I couldn't locate any drawing functions. Any suggestions are appreciated!

I like the sounds of this. Could be a place for a composit widget of some sort. If you could mock up an image to give me a better idea that would be nice. The drawing functions are in Fl/fl_draw.H (in 1.1.x).

Thanks for coming by. This sounds like it could be an interesting project for people to follow along with.

Mark
__________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work."
--Thomas Alva Edison
"Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety."
--Benjamin Franklin
"A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes."
--Hugh Downs
  #3  
Old 02-Jul-2005, 21:29
maverick maverick is offline
New Member
 
Join Date: Jul 2005
Posts: 3
maverick is on a distinguished road
Thanks Mark
Quote:
Originally Posted by cable_guy_67
  • what version of FLTK
  • what target platform
  • what have to tried so far
  • could we see your code to date
I use 1.1 on Windows XP + Visual C 6.0. Actually I just started designing the GUI. Maybe I can upload the initial draft later on.


Quote:
Originally Posted by cable_guy_67
I like the sounds of this. Could be a place for a composit widget of some sort. If you could mock up an image to give me a better idea that would be nice. The drawing functions are in Fl/fl_draw.H (in 1.1.x).
Mark

More specifically, it is like a distribution pie chart
www.rwjf.org
  #4  
Old 02-Jul-2005, 21:53
cable_guy_67's Avatar
cable_guy_67 cable_guy_67 is offline
Senior Member
 
Join Date: Oct 2004
Location: Nescopeck, PA
Posts: 1,109
cable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the rough
Good, you are using 1.1.x. One thing I tell everyone is to make sure your version is as current as possible. For all intensive purposes the subversion repository at www.fltk.org is 1.1.7. It is very stable and has all the updates that you can have. If you don't have subversion use one of the up to date snapshots or at the very least the 1.1.6 stable release. That will take care of most of the real aggrivating bugs.

Now for your widget.

How do you want it to act? Should it read info from somewhere and display itself accordingly. Should you be able to add 'slices' as by picking them? You see where I am going with this.

Give a synopsis of the widgets interaction with the user. It sounds, from your original description that it is just a display widget. By that I mean, it will get its info and divide itself accordingly based on percentages of a whole. Sometimes it could be 10 divisions sometime 3 (or whatever) and perhaps display the number in a related output widget? Using your attached example you have 6 varying divisions. Where will the percentage be displayed? Will the user be able to select a division to get feedback on the division?

That sort of thing. This really does sound like an interesting widget to design. I will look around to see if I can find any examples of anything that may be helpful. But for now, the fireworks are about to start so it is out the the yard for an independence day (well, midnight here) firework show.

Mark
__________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work."
--Thomas Alva Edison
"Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety."
--Benjamin Franklin
"A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes."
--Hugh Downs
  #5  
Old 04-Jul-2005, 16:27
maverick maverick is offline
New Member
 
Join Date: Jul 2005
Posts: 3
maverick is on a distinguished road
Quote:
Originally Posted by cable_guy_67
How do you want it to act? Should it read info from somewhere and display itself accordingly. Should you be able to add 'slices' as by picking them? You see where I am going with this.
Right now I just want a display dial, which reads user selections from slider bars, and shows selection area on the pie. The number doesn't have to be displayed. Maybe later feedback from the dial would be needed.
I did a search but couldn't find any customed widget I can borrow. Maybe I'll first try drawing with OpenGL.

BTW: I have one more question regarding to filechooser. I used fl_dir_chooser() to let users specify the desired diretory. Next thing I would like to do is to read all file names in that directory. I found such a function named fl_filename_list(), which returns a list of dirent structures that could contain the info I need. But looks like these structres are defined in BSD only, not on windows. Does that mean I have to write win32 APIs to handel the job? Thanks!
  #6  
Old 04-Jul-2005, 16:46
cable_guy_67's Avatar
cable_guy_67 cable_guy_67 is offline
Senior Member
 
Join Date: Oct 2004
Location: Nescopeck, PA
Posts: 1,109
cable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the rough
Quote:
Originally Posted by maverick
Right now I just want a display dial, which reads user selections from slider bars, and shows selection area on the pie. The number doesn't have to be displayed. Maybe later feedback from the dial would be needed.
It sounds like a job for a specialized group of widgets. You could tie the action together with the callbacks easy enough. Or you could created a custom widget that inherits from Fl_Group and/or whatever is needed. Look for my post on Deriving Custom Widget Classes for a simple startup for that type. It also overrides the draw() method for a return button. Not terribly useful (or really all that good) but I wanted to see how to do it. All it really does is uses a slightly different method for changing the color on the arrow. One of the neat things with that is you can pass your derived group off as a built in group when you use that method.

Quote:
Originally Posted by maverick
BTW: I have one more question regarding to filechooser. I used fl_dir_chooser() to let users specify the desired diretory. Next thing I would like to do is to read all file names in that directory. I found such a function named fl_filename_list(), which returns a list of dirent structures that could contain the info I need. But looks like these structres are defined in BSD only, not on windows. Does that mean I have to write win32 APIs to handel the job? Thanks!

That's a good question. Since fl_dir_chooser() can display the files they exist in the widget. You could just see how fl_dir_chooser() gets it and see about grabbing the item in the same manner. Oddly enough, I have been working on a directory searching class for the last day or so. I use CygWin with W2K so dirent.h does exist. I guess that would fall into the Quasi-Standard group though. FLTK in it's cross platform way usually allows for everything for everyone. The Win side may just be handled elsewhere. Or does fl_filename_list() not exist with a WIN32 compiled version? Like I said, I compile mine to use CygWin (since in seems to work better on my home machine) and have my brother burn WIN32 binaries if need be. You got my interest up with is last bit though. I would like to see how it is done.

One thing to note. I had some very unusual results last time I compiled for the MS not CygWin side with paths. Perhaps it is not fully implemented (although I really doubt that).

Mark
__________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work."
--Thomas Alva Edison
"Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety."
--Benjamin Franklin
"A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes."
--Hugh Downs
 
 

Recent GIDBlogToyota - 2008 November Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problems with a text display in a tab maveganzones FLTK Forum 2 23-Mar-2005 03:26
Displaying node attributes in an XML tree display njp01u MS Visual C++ / MFC Forum 2 07-Feb-2005 18:42
How do I display <filename>.bmp on the screen? oriharel MS Visual C++ / MFC Forum 1 01-Dec-2004 15:51
uisng php to display php dopee MySQL / PHP Forum 6 14-May-2004 19:40

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 04:46.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.