Derived from: BWindow
Declared in: windowGuts.h
Library: not currently in a library--someday I hope!
The WindowGuts Class is a BWindow wrapper class. It knows about LayoutMatrices and LayoutMatrixItems. It knows how big to make itself based upon all the items it contains, and their font sensitive sizes. If it's size would be larger than screen size, it limits itself to what will fit nicely on the screen and activates scroll gadgets as needed. It recalls it's past position, so it will return to where you last put it. You derive all your application windows from this class.
This is the constructor. The first parameter, paramBound, lets the window know where to put itself on screen. This value is stored by the preference routine (see Preferences) and you ask preferences for this value and pass it in as a parameter.
The second parameter, paramWindowTitle is the title which will display in the window's title tab. The window will try it's best to size itself to accommodate the length of the title, but will never exceed the maximum width of the screen.
The third parameter, paramScrollViewName is an internal name used for the windows scrolling view (it might be important for scripting), and is used by the window for communications. It must not be NULL.
The final parameter, paramNamePrefFrame is used by preferences to identify this window's stored data. It must be unique across all the application's windows.
This is the destructor. It just deletes the scroll view name.
This is the real work horse of the class construction. It calculates all it's sizes and position. It creates a custom scroll view (see ScrollView) and attaches it's menu (all window's must have a menu--at least a minimal "About" item). If this is too restraining, the first few lines of code may be surrounded by an if(pMenuBar){} statement. Then add to the CTOR of the class bool bUsingMenus, then instead of doing a pMenuBar(new BMenu...) in the initializer list, move the call into the code section and surround it with a similar if statement; menus will then become optional. I do not do this because I think it important for all window to have access to the preference panels and an "About" menu item.
This is an internally called function. You might want to play around with the calculations which I made to determine the value of the size of a scroll due to an arrow press, or a hit off the knob in the scroll bar's container.
This is an internally called function. It overrides the normal BWindow version and intentionally does not call it inherited version.
This overrides the normal BWindow version and calls it inherited version if everything is normal. The window's preferred size and location are stored.
This overrides the normal BWindow version and calls it inherited version. You will also override this version in any derived class to get that window's specific messages, calling this version in your derived class for any messages you do not handle.
This is used internally by the LayoutMatrix Class.
Overview
[method summary]
WindowGuts()
WindowGuts(BRect paramBound,
const char * paramWindowTitle,
const char * paramScrollViewName,
const char * paramNamePrefFrame);
~WindowGuts()
~WindowGuts();
Initialize()
bool Initialize(void);
UpdateScrollBars()
void UpdateScrollBars(void);
FrameResized()
void FrameResized(float,
float);
QuitRequested()
bool QuitRequested(void);
MessageReceived()
void MessageReceived(BMessage * pparamMessage);
AddToLayoutMatrixList()
void AddToLayoutMatrixList(LayoutMatrix * pparamLayoutMatrix);
for version 0.4.2
Copyright © 1998 Ed Musgrove Be Developer #2076. All rights reserved.
edgar@harbornet.com
emusgrov@linknet.kitsap.lib.wa.us
Last modified November 25, 1998.