home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-12 | 4.3 KB | 144 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Select.cpp
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "IntlTest.hpp"
-
- #ifndef SELECT_H
- #include "Select.h"
- #endif
-
- #ifndef CONTENT_H
- #include "Content.h"
- #endif
-
- #ifndef PART_H
- #include "Part.h"
- #endif
-
- #ifndef DEFINES_K
- #include "Defines.k"
- #endif
-
- // ----- Framework Includes -----
-
- #ifndef FWPRESEN_H
- #include "FWPresen.h"
- #endif
-
- // ----- Foundation Layer -----
-
- #ifndef FWSTRING_H
- #include "FWString.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef SOM_Module_OpenDoc_StdProps_defined
- #include <StdProps.xh>
- #endif
-
- //========================================================================================
- // Runtime information
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment odfIntlTest
- #endif
-
- //========================================================================================
- // Constants
- //========================================================================================
-
- const ODPropertyName kIntlTestPropText = "IntlTest:Property:Text";
-
- //========================================================================================
- // CLASS CIntlTestSelection
- //========================================================================================
-
- FW_DEFINE_AUTO(CIntlTestSelection)
-
- //---------------------------------------------------------------------------------------
- // CIntlTestSelection constructor
- //---------------------------------------------------------------------------------------
-
- CIntlTestSelection::CIntlTestSelection(Environment* ev, CIntlTestPart* testPart) :
- FW_CSelection(ev, false, false),
- fTestPart(testPart),
- fSelectedContent(NULL)
- {
- fSelectedContent = FW_NEW(CIntlTestSelectedContent, (ev, testPart));
- }
-
- //---------------------------------------------------------------------------------------
- // CIntlTestSelection destructor
- //---------------------------------------------------------------------------------------
-
- CIntlTestSelection::~CIntlTestSelection()
- {
- }
-
- //---------------------------------------------------------------------------------------
- // CIntlTestSelection::GetSelectedContent
- //---------------------------------------------------------------------------------------
- // The whole content is always selected
-
- FW_CContent* CIntlTestSelection::GetSelectedContent(Environment*)
- {
- return fSelectedContent;
- }
-
- //---------------------------------------------------------------------------------------
- // CIntlTestSelection::ClearSelection
- //---------------------------------------------------------------------------------------
-
- void CIntlTestSelection::ClearSelection(Environment* ev)
- {
- fSelectedContent->ClearSelectedText(ev);
- }
-
- //---------------------------------------------------------------------------------------
- // CIntlTestSelection::CloseSelection
- //---------------------------------------------------------------------------------------
-
- void CIntlTestSelection::CloseSelection(Environment* ev)
- {
- // Unselect text in the current EditView
- fSelectedContent->SetSelectionRange(ev, 0, 0);
- }
-
- //---------------------------------------------------------------------------------------
- // CIntlTestSelection::IsEmpty
- //---------------------------------------------------------------------------------------
-
- FW_Boolean CIntlTestSelection::IsEmpty(Environment* ev) const
- {
- // Is the current string empty?
- FW_CString selection;
- fSelectedContent->GetSelectedText(ev, selection);
- return (selection.GetByteLength() == 0);
- }
-
- //---------------------------------------------------------------------------------------
- // CIntlTestSelection::SelectAll
- //---------------------------------------------------------------------------------------
-
- void CIntlTestSelection::SelectAll(Environment*)
- {
- // This function is handled by the current EditView
- }
-
- //---------------------------------------------------------------------------------------
- // CIntlTestSelection::SetContentEditView
- //---------------------------------------------------------------------------------------
- void CIntlTestSelection::SetContentEditView(FW_CEditView* editView)
- {
- fSelectedContent->SetEditView(editView);
- }
-
-