home *** CD-ROM | disk | FTP | other *** search
- //
- // MiscNibController.h -- an abstract superclass to load .nib files with
- // windows in them
- // Written by Mike Ferris Copyright (c) 1994 by Mike Ferris.
- // Modified from original MOKit "MOController" class by Don Yacktman.
- // Version 1.0. All rights reserved.
- //
- // This notice may not be removed from this source code.
- //
- // This object is included in the MiscKit by permission from the author
- // and its use is governed by the MiscKit license, found in the file
- // "LICENSE.rtf" in the MiscKit distribution. Please refer to that file
- // for a list of all applicable permissions and restrictions.
- //
-
-
- // This class is meant to be a File's owner for a .nib. Typically, you
- // will probably want to subclass this class to add outlets and other
- // added features; this class just provides a mechanism to load .nib files.
- // Use +setClassNib: to change the .nib file name that will be used when
- // loading; each subclass can change the name. If it doesn't, the default
- // is to use [class name].nib... note that the .nib name is a true class
- // variable, so each subclass will have it's own value for it.
-
- #import <appkit/appkit.h>
-
- // Forward declarations of class names we'll use for static typing.
- @class MiscString;
-
- @interface MiscNibController:Object
- {
- id window; // IB outlet
- MiscString *frameName; // name for frame of "window" to save in defaults
-
- BOOL nibIsLoaded; // true if .nib has been loaded already
- }
-
- // setting up and cleaning up the class
- + initialize;
- + startUnloading;
-
- // setting the name of the .nib loaded by this class (or subclass)
- + setClassNib:(const char *)nibName;
- + (const char *)classNib;
-
- // initializing and freeing
- - init;
- - initWithFrameName:(const char *)theFrameName;
- - free;
-
- // archiving to a stream
- - awake;
- - read:(NXTypedStream *)strm;
- - write:(NXTypedStream *)strm;
-
- // handling window's with (autosave) frame names automatically...
- - setFrameName:(const char *)theFrameName;
- - (const char *)frameName;
-
- // the main outlet set when the .nib is loaded is "window"
- - window;
- - window:(BOOL)loadFlag;
- - showWindow:sender;
-
- // the core methods which do all the interesting work
- - loadNibIfNeeded;
- - loadNib:(const char *)name withOwner:owner fromBundle:(NXBundle *)bundle;
-
- // cover methods: (are any of these actually useful?)
- - loadNib;
- - loadNib:(const char *)name;
- - loadNib:(const char *)name withOwner:owner;
- - loadNib:(const char *)name fromBundle:bundle;
-
- // Override these to hook into the guts of operations...be sure to call super!
- - nibWillLoad;
- - nibDidLoad;
-
- @end
-
-