| Header file: | statusbar.h |
| Object name: | fSTATUSBAR |
| Object index: | 1 of 1 Object |
The fSTATUSBAR is a simple component that displays text at the bottom of the screen as status. I'm sure that we are all familiar with status bars, so I shant explain them any more here.
This component is derived from _GUIBASE, and inherits the properties from that.
This component does not have any primary or secondary options. You will not need to pass any options (not that there is any provision for extra options).
Before I go any further, here is a definition that you should know. A section is a part of the statusbar that is independant of the other sections that display text. You can have as many sections as you want on the status bar - and have them independently displaying different text. Each section also can have a different size.
| Prototype | Description |
|
void CreateWin(fFORM* Parent, char* Caption); void CreateWin(fFORM* Parent, char* Caption, int ID); void CreateWin(HWND Parent, char* Caption); void CreateWin(HWND Parent, char* Caption, int ID); | These functions all create a statusbar. The only reason that they are mentioned here is that they differ to the usual prototype. Parent is the parent window (the window on which the statusbar will be shown on). Caption is a caption for the whole status bar - but will only be shown until you break up the statusbar. ID, if used, is the ID of the window - but if you are using AutoID, then you do not need to worry about using it. |
| void SetNoSections(int Num); | This function sets the number of sections on the statusbar, and creates the appropriate memory for internal use by this class. |
| void SetSectionSize(int Section, int Size); | This function sets the size in pixels of the specified section. Section numbers start at 0 (Zero) and move upward. Size is in pixels. |
| void SetSectionText(int Section, char* Text); | This function sets the text for a particular section. Section numbers start at 0 (Zero) and move upward. Text is the text to set for that section. |
| char* GetSectionText(int Section); | This function gets the text of a particular section. Section starts at 0 (Zero) and moves upward. |
| int GetNoSections(void); | This function returns the number of sections on the statusbar. |
| int GetSectionSize(int Section); | This function returns the size of a particular section. Section numbers start at 0 (Zero) and move upwards. |
| void AutoResize(void); | This function causes the statusbar to automatically resize itself to the parent window. You might like to call this after you (or the user) resizes the window - otherwise you will see some rather interesting effects... |
The following snippet gives a basic idea of how to use this component.
//Create a statusbar...
fSTATUSBAR Status;
Status.CreateWin(Window.GetHandle(), "This is a statusbar...",
STATUS_ID);
//Now split it up, size the sections, add some text.
Status.SetNoSections(4);
Status.SetSectionSize(0, 50);
Status.SetSectionSize(1, 50);
Status.SetSectionSize(2, 100);
Status.SetSectionSize(3, -1); //-1 means to use remaining space.
Status.SetSectionText(0, "This is");
Status.SetSectionText(1, "a status");
Status.SetSectionText(2, "bar split into");
Status.SetSectionText(3, "four seperate parts!");
//Please note that the statusbar will automatically fit
//itself to the bottom of the screen. After a window resize,
//you might like to make it fit the bottom again.
Status.AutoResize();
| Back to index | The FreeFoote Foundation Classes Documentation |