home *** CD-ROM | disk | FTP | other *** search
- #ifndef _IFRAME_
- #define _IFRAME_
- /**************************************************************/
- /* CLASS NAME: IFrameWindow */
- /* */
- /* DESCRIPTION : This is the frame window class. */
- /* */
- /* HUNGARIAN: frwnd */
- /* */
- /* CHANGE ACTIVITY: */
- /* DATE: INITIAL: DESCRIPTION */
- /* */
- /* 080892 Kevin Leong Initial design/code */
- /* 170992 Ph Gregoire Added frame control processing */
- /* 061092 Ph Gregoire Moved to BBXX sets */
- /* */
- /**************************************************************/
- /* Copyright (c) IBM Corporation 1991 */
- /**************************************************************/
- class IFrameWindow;
- class IResourceMgr;
- class IFrameControlDesc;
- class IExposeEvent;
-
- #ifdef _USEBB_
- #ifndef _ISET_H
- #include <iset.h>
- #endif
- #else
- #ifndef _ISET_
- #include <iset.hpp>
- #endif
- declare(IGSet1,IFrameControlDesc);
- #endif
-
- #ifndef _IAPPWIN_
- #include <iappwin.hpp>
- #endif
- #ifndef _IRECT_
- #include<irect.hpp>
- #endif
- #ifndef _IFRCTLAT_
- #include <IFrCtlAt.hpp>
- #endif
- #ifndef _IFRCTLDS_
- #include <iFrCtlDs.hpp>
- #endif
-
- class IFrameWindow : public IApplicationWindow
- {
- typedef IApplicationWindow Inherited;
- public:
-
- INESTEDBITFLAGCLASSDEF1(Style, IFrameWindow, IWindow);
- static const Style
- animate,
- maximized,
- minimized;
-
- INESTEDBITFLAGCLASSDEF0(Flag, IFrameWindow);
- static const Flag
- noFlag,
- defaultFlag,
- border,
- maxButton,
- minButton,
- hideButton,
- mouseAlign,
- noByteAlign,
- noMoveWithOwner,
- screenAlign,
- shellPosition,
- sizeBorder,
- systemMenu,
- systemModal,
- titleBar,
- windowList;
-
- // static const ISize
- // borderSize(),
- // sizeBorderSize();
-
- IFrameWindow(unsigned long windowId,
- const IWindow* parent = desktopWindow(),
- const IWindow* owner = 0,
- const IRectangle& initial = IRectangle(),
- Style s = animate | IWindow::clipChildren,
- Flag f = defaultFlag);
-
- virtual ~IFrameWindow();
-
- // set a control as client
- Boolean setClient(IWindow* pwndControl)
- { return(addControl(pwndControl,
- IFrCtlAttr::centerArea,
- 0,None,0));
- };
-
- // add a window as a frame control
- Boolean addControl(
- IWindow* pwndControl, // Control IWindow
- IFrCtlAttr fcatPlace, // Control placement flags
- // If the 'adjust' flag is set, the
- // dimension of the control will be
- // re-adjusted after all controls have
- // been positionned and shrunk.
- // Setting the flag this may leave holes
- // in the frame.
- // The 'behind' flag controls whether
- // the control is to be placed behind
- // the relative window or on top.
- const IWindow* pwndRelative, // Window relative to which to place
- // control. If NULL, it is relative
- // to a std FID_
- IEDefFrameCtl fctRelative, // If above is NULL, relative frame
- // control id
- unsigned long ulDimension, // Dimension of the control, for the
- // one not fixed by relative (i.e.,
- // for RIGHT or LEFT this is the width,
- // for TOP or BOTTOM it is the height
- const IPair& pairDimMult= // Multiplier for dimension, will be
- IPair(0,1), // multiplied to the relative window's
- // dimension and added to ulDimension.
- // For example, to get three quarters,
- // specify IPair(3,4). Must be <1,
- // i.e., integer part < frac part
- // Defaults to no shrinking
- Boolean bNoUpdate= // If true, do not update frame
- false);
-
- // add a window as frame control relative to another IWindow
- Boolean addControl(IWindow* pwndControl,
- IFrCtlAttr fcatPlace,
- const IWindow* pwndRelative,
- unsigned long ulDimension,
- const IPair& pairDimMult=IPair(0,1),
- Boolean bNoUpdate= false)
- { return(addControl(pwndControl,fcatPlace,pwndRelative,
- None,ulDimension,pairDimMult,bNoUpdate));
- };
-
- // add a window as frame control relative a std frame control
- Boolean addControl(IWindow* pwndControl,
- IFrCtlAttr fcatPlace,
- IEDefFrameCtl fctRelative,
- unsigned long ulDimension,
- const IPair& pairDimMult=IPair(0,1),
- Boolean bNoUpdate= false)
- { return(addControl(pwndControl,fcatPlace,0,fctRelative,
- ulDimension,pairDimMult,bNoUpdate));
- };
-
- Boolean removeControl(
- const IWindow* pwndControl,
- Boolean bNoUpdate=false);
-
-
- protected:
-
- virtual Boolean handleWindowEvent(IEvent& evt);
-
- private:
- #ifdef _USEBB_
- typedef ISet<IFrameControlDesc*> IFrCtlDescSet;
- #else
- typedef IGSet1(IFrameControlDesc) IFrCtlDescSet;
- #endif
-
- IFrameWindow(const IFrameWindow&);
- IFrameWindow &operator=(const IFrameWindow&);
-
- // method to find a given control descriptor in the list
- IFrameControlDesc* findControl(const IWindow *pwndCtl,
- IFrCtlDescSet::Cursor& cursFrCtlDs);
-
- // method to paint the frame controls' separator lines if any
- void paintSeparatorLines(const IPresSpaceHandle& pshFrame);
- IFrameControlDesc* isOnSplitBar(const IPoint& pt, Boolean& bHorz);
-
- void updateFrame();
- // method used to reply to WM_QUERYFRAMECTLCOUNT
- long countControls();
-
- // method to process format frame messages
- // returns the count of additional frame controls actually added
- long formatControls(void* pSwp, const IRectangle& rect,
- unsigned long ulDefCnt);
-
- // Collection of control descriptors // !PHG!: would require an IKeySet
- IFrCtlDescSet setClFrCtlDs;
- Boolean bClSplitBar; // true if there is a splitbar
- };
-
- INESTEDBITFLAGCLASSFUNCS(Style, IFrameWindow);
- #endif /* _IFRAME_ */