wxGauge - Marquee implementation

If you have a cool piece of software to share, but you are not hosting it officially yet, please dump it in here. If you have code snippets that are useful, please donate!
leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio »

lowjoel wrote:@leio I know this is old, but you have any idea what code is for gtk? I'm a win32 person... If i have no choice :P
http://developer.gnome.org/doc/API/2.0/ ... ssBar.html

Essentially you just call gtk_progress_bar_pulse each time there is some kind of activity, to make the block move by a little bit (amount changeable with set_pulse_step).

You could implement the thing on win32 with a suitable (cross-platform) API addition on top of wxGauge, and I can take care of the gtk2 part in due time.
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
lowjoel
Part Of The Furniture
Part Of The Furniture
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel »

IMO the wxwidgets philosophy is that you use native, I have 2 functions, StartMarquee and StopMarquee. Using wxGA_MARQUEE makes a marguee gauge... I dont know if that's what you mean.
leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio »

There are two ways of updating a progress bar in gtk+.
You either tell it to pulse, which will put the progress bar automatically into "marquee" mode if it wasn't. Or you call a function that tells how many percentages (0.0 to 1.0) the progress is done, which will make it be the usual progress bar that we know from wx, if it wasn't.

What I like about this, is the power to move the block when you need to - you are ought to do that when some kind of unmeasurable progress just had happened. With your approach, I believe you can simply tell it to start, and it will pounce back and forth at a constant speed, not giving any real feedback of activity speed, merely that something is going on, and the developer should have used a busy cursor or something instead.
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
lowjoel
Part Of The Furniture
Part Of The Furniture
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel »

programmatically step the marquee?
leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio »

Yes. That's how it is in gtk+ API.
It would be possible to do that inside a timer (implementation detail) and have it continous automatically, but I haven't thought on which way is better (automatic or programmatic)
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
lowjoel
Part Of The Furniture
Part Of The Furniture
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel »

in windows its a ::SendMessage(hwnd, something STEPIT) IIRC... and yea thats a dilemma. i wanted to implement a gauge that will "auto increment" every few seconds or so
priyank_bolia
wxWorld Domination!
wxWorld Domination!
Posts: 1339
Joined: Wed Aug 03, 2005 8:10 am
Location: BANGALORE, INDIA
Contact:

Post by priyank_bolia »

Can somebody provide me the source files, I don;t know how to apply that patch.
Post Reply