home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
- CStaticTextPane.c
-
- Class for displaying static text. NOTE: The superclass is CTextPane; this
- should be changed to CEditText for other applications.
-
- Copyright (C) 1992 by Brown University. All rights reserved.
-
- Permission is granted to any individual or institution to use, copy,
- or redistribute the binary version of this software and its
- documentation provided this notice and the copyright notices are
- retained. Permission is granted to any individual or non-profit
- institution to use, copy, modify, or redistribute the source files
- of this software provided this notice and the copyright notices are
- retained. This software may not be distributed for profit, either
- in original form or in derivative works, nor can the source be
- distributed to other than an individual or a non-profit institution.
- Any individual or group interested in seeing and/or using these
- source files but who are prevented from doing so by the above
- constraints should contact Don Wolfe, Vice-President for Computer
- Systems at Brown University, (401) 863-7247, for possible
- software licensing of the source developed at Brown.
-
- Brown University and Andrew James Gilmartin make no representations
- about the suitability of this software for any purpose.
-
- BROWN UNIVERSITY AND ANDREW JAMES GILMARTIN GIVE NO WARRANTY, EITHER
- EXPRESS OR IMPLIED, FOR THE PROGRAM AND/OR DOCUMENTATION PROVIDED,
- INCLUDING, WITHOUT LIMITATION, WARRANTY OF MERCHANTABILITY AND
- WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE.
-
- AUTHOR: Andrew_Gilmartin@Brown.Edu
- REVISION: 1
-
- ******************************************************************************/
-
- #include <Exceptions.h>
- #include <Commands.h>
- #include <Constants.h>
- #include <CBartender.h>
- #include "CStaticTextPane.h"
- #include "IsCursorKey.h"
-
-
- extern CBartender* gBartender;
-
-
-
- /******************************************************************************
- IStaticTextPane
-
- ******************************************************************************/
-
- void CStaticTextPane::IStaticTextPane
- ( CView *anEnclosure, CBureaucrat *aSupervisor, short lineWidth )
- {
- ITextPane( anEnclosure, aSupervisor, lineWidth );
-
- } /* IStaticTextPane */
-
-
-
- /******************************************************************************
- UpdateMenus
-
- Can't modify the content so make sure cut, paste, and clear menu items
- are disabled. NOTE: A use can copy content.
- ******************************************************************************/
-
- void CStaticTextPane::UpdateMenus( void )
- {
- inherited::UpdateMenus();
-
- gBartender->DisableCmd( cmdCut );
- gBartender->DisableCmd( cmdPaste );
- gBartender->DisableCmd( cmdClear );
-
- } /* UpdateMenus */
-
-
-
- /******************************************************************************
- DoCommand
-
- Just in case DoCommand is called with cut, paste, or clear commands
- ignore them. Perhaps this should be an assert, but suspect this will
- not work in practice.
- ******************************************************************************/
-
- void CStaticTextPane::DoCommand( long theCommand )
- {
- if ( theCommand != cmdPaste && theCommand != cmdCut && theCommand != cmdClear )
- inherited::DoCommand( theCommand );
-
- } /* DoCommand */
-
-
-
- /******************************************************************************
- DoKeyDown
-
- The user can use the navigation keys to move around the text, but not
- keys that modify the text.
- ******************************************************************************/
-
- void CStaticTextPane::DoKeyDown
- ( char theChar, Byte keyCode, EventRecord *macEvent )
- {
- if ( IsNavigationKey( theChar, keyCode ) )
- inherited::DoKeyDown( theChar, keyCode, macEvent );
-
- } /* DoKeyDown */
-
-
-
- /******************************************************************************
- DoAutoKey
-
- The user can use the navigation keys to move around the text, but not
- keys that modify the text. Perhaps I should just call DoKeyDown().
- ******************************************************************************/
-
- void CStaticTextPane::DoAutoKey
- ( char theChar, Byte keyCode, EventRecord *macEvent )
- {
- if ( IsNavigationKey( theChar, keyCode ) )
- inherited::DoAutoKey( theChar, keyCode, macEvent );
-
- } /* DoAutoKey */
-