[Gambas-user] A "statusbar" control

Tobias Boege taboege at ...626...
Sun Dec 22 14:56:36 CET 2013


On Sun, 22 Dec 2013, Bruce wrote:
> On Sat, 2013-12-21 at 10:46 +0100, Tobias Boege wrote:
> > On Sat, 21 Dec 2013, Bruce wrote:
> > > Did someone recently speak about having developed a "statusbar" form
> > > control?
> > > 
> > 
> > If you mean[0], then yes, roughly. There was a StatusBar class from
> > Raymond de Bruijne (Gambas2) which I changed to be more Gambas3.
> > 
> > (However, I haven't worked on it since I posed that question because
> > the answer kind of disappointed me. But looking at it again, it seems
> > pretty plausible.) Anyway, do you want to see it? There are at least
> > three versions of this class in use in Hans' projects and I couldn't
> > find the "good" one just now... I'll finish the "StatusbarForm" idea
> > and then publish the thing in a separate article...
> > 
> > Regards,
> > Tobi
> > 
> > [0] http://sourceforge.net/mailarchive/message.php?msg_id=31629361
> > 
> 
> Tobi,
> 
> Yes, that was the mention.
> 
> Having re-read that thread (and I have no idea why the search I did
> failed for it?) and you comments above, it seems to be at the same state
> my old gb2 one was, wherever it is. Or probably a bit better, because if
> I recall correctly, I could not ever really work out what I was trying
> to achieve.
> 
> Since I never got far, I sort of forgot it and got on with life.  I
> remember thinking at the time that it was such a basic idea how come
> there wasn't a native one.  Since then I have discovered that life on
> the planet has actually continued without it.
> 
> But, in fact "Some people seem to like this sort of thing." is exactly
> what happened this week.  "They" want a status bar.
> 
> It's no big deal really. I was just hoping that someone had one that
> might get "them" off my back. So, whenever.
> 
> I had another go yesterday at creating a custom status bar control, but
> yet again, came up against the same problem of deciding what it is I
> actually want.  I know some of the things I want:
> - an IDE configurable number of sub-panels,
> - automatic layout, including "springiness" for at least one of the
> subpanels,
> - user interaction with the statusbar to stretch a sub-panel relative to
> the others,
> - (biggy) event response, so when something happens in the application
> the app can raise an event handled by the statusbar to do/show
> something.
> 

Wow, that's much. All we started from was a container for some Labels. I
have added the feature to automatically resize the labels (every label gets
a float width relative to the container's width, zero meaning "fit to the
rest") when the container resizes and to put the container at the Form's
bottom automatically. That's pretty much what we needed... The main program
programmatically adds Labels and updates them through an interface of the
Statusbar.

I guess your last point can be done like I handle the two points above:
create an observer (typically with After = True) for the Form your Statusbar
lives in and then catch Resize events (in your case, you may add new events
to the Form just to serve your Statusbar).

I'm now struggling at incorporating the Statusbar into the IDE as the
Statusbar class does not inherit any other class but internally manages a
Panel. Labels are added to the statusbar via its Add() method and I don't
think the IDE understands that if I declare the class _IsContainer = True.

OTOH, if I inherit Panel, there would be things like StatusBar.Children
being pulled into the interface which I need to keep away to make the class
behave consistent.

Do you have any ideas?

> 
> p.s. It was 43 degrees here yesterday. That's Celsius, not Fahrenheit.
> Today is a bit better, it's 32 at 3pm.  As such, I may have to go out
> now and find some small quantity of cold liquid refreshment, lest I
> dehydrate! :-)
> 

Funny, we have around 40 degrees Fahrenheit here :-)

Regards,
Tobi




More information about the User mailing list