13#include <owl/docview.rh>
15#if defined(__BORLANDC__)
41 doc.AttachView(*
this);
53 const auto ok = Doc !=
nullptr;
54 WARN(!ok,
_T(
"TView::~TView: Terminating due to failed precondition."));
55 if (!ok) std::terminate();
57 if (Doc->DetachView(*
this)) {
69 if (&new_doc == Doc)
return;
76 if (Doc && Doc->DetachView(*
this))
81 new_doc.AttachView(*
this);
82 CHECK(Doc == &new_doc);
103 if (tpl && ViewMenu && !tpl->
IsStatic() && *ViewMenu->GetModule() == *tpl->
GetModule())
117static const tchar*
const TView_PropertyNames[] = {
122static const int TView_PropertyFlags[] = {
134 TRACEX(OwlDocView, 0,
_T(
"PropertyName(): index <= PrevProperty!"));
140 TRACEX(OwlDocView, 0,
_T(
"PropertyName(): index >= NextProperty!"));
153 TRACEX(OwlDocView, 0,
_T(
"PropertyFlags(): index <= PrevProperty!"));
159 TRACEX(OwlDocView, 0,
_T(
"PropertyFlags(): index >= NextProperty!"));
174 if (
_tcscmp(TView_PropertyNames[i], name) == 0)
177 TRACEX(OwlDocView, 0,
_T(
"FindProperty: Index of [") << name <<
_T(
"] not found") );
223 TRACEX(OwlDocView, 0,
_T(
"GetProperty(): ") \
224 _T(
"invalid property [") << index <<
_T(
"] specified!") );
229 TRACEX(OwlDocView, 0,
_T(
"GetProperty(): 0-Length buffer specified!"));
233 int srclen = src ?
static_cast<int>(
::_tcslen(src)) : 0;
234 if (textlen > srclen)
237 memcpy(dest, src, textlen*
sizeof(
tchar));
238 *((
tchar *)dest + textlen) = 0;
255#if OWL_PERSISTENT_STREAMS
263 TView* o = GetObject();
282TView::Streamer::Write(
opstream& os)
const
284 TView* o = GetObject();
285 os.writeByte(
uint8(o->ViewMenu ? 1 : 0));
315#if OWL_PERSISTENT_STREAMS
331TWindowView::Streamer::Write(opstream& os)
const
350 TDialog(parent, resId, module),
358 TDialog(parent, dlgTemplate, del, module),
366 TDialog(hTemplate, parent, del, module),
373#if OWL_PERSISTENT_STREAMS
389TDialogView::Streamer::Write(opstream& os)
const
Definition of class TAppDictionary.
Class definition for TBarDescr.
#define WARN(condition, message)
#define PRECONDITION(condition)
#define TRACEX(group, level, message)
Descriptor of Bar Implementation.
Typically used to obtain information from a user, a dialog box is a window inside of which other cont...
TDialog(TWindow *parent, TResId resId, TModule *module=nullptr)
Constructor for a TDialog object.
Derived from TDialog and TView.
TDialogView(TDocument &doc, TWindow *parent, TResId resId, TModule *module=&GetGlobalModule())
TDocTemplate is an abstract base class that contains document template functionality.
bool IsStatic() const
Returns true if the template is statically constructed.
void SetModule(TModule *module)
Sets a module pointer.
TModule *& GetModule()
Returns a module pointer.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Abstract base class for view access from document.
@ ViewClass
Name of the C++ class encapsulating the view. (text).
@ ViewName
Name of the view. (text).
@ PrevProperty
Index of last property in base class.
@ NextProperty
Next index to be used by derived class.
virtual int PropertyFlags(int index)
pfXxxxx bit array
virtual ~TView()
Frees a TView object and calls TDocument's private member function DetachView to detach the view from...
friend class TDocument
needs access to NextView
virtual LPCTSTR PropertyName(int index)
locale invariant name
virtual int FindProperty(LPCTSTR name)
return property index
void SetViewBar(TBarDescr *bar)
Sets the menu descriptor for this view.
TView(TDocument &doc)
Constructs a TView object of the document associated with the view.
void SetDocument(TDocument &)
virtual LPCTSTR GetViewName()=0
Pure virtual function that returns 0.
void SetViewMenu(TMenuDescr *menu)
virtual int GetProperty(int index, void *dest, int textlen=0)
Retrieves the property identified by the given index.
static void BumpNextViewId()
Increments an internal count used by the Doc/View subsystem to identify each view.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
TApplication * GetApplication() const
Gets a pointer to the TApplication object associated with this.
TWindow(TWindow *parent, LPCTSTR title=nullptr, TModule *module=nullptr)
Adds this to the child list of parent if nonzero, and calls EnableAutoCreate so that this will be cre...
Derived from both TWindow and TView, TWindowView is a streamable base class that can be used for deri...
TWindowView(TDocument &doc, TWindow *parent=nullptr)
Constructs a TWindowView interface object associated with the window view.
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
uint8 readByte()
Returns the byte at the current stream position.
Base class for writing streamable objects.
Definition of class TDocManager.
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
void ReadBaseObject(Base *base, ipstream &in)
#define _OBJ_FULLTYPENAME(obj)
void WriteBaseObject(Base *base, opstream &out)
const uint pfGetText
property accessible as text format
const uint pfConstant
property is invariant for object instance
Object Windows Library (OWLNext Core).
IMPLEMENT_STREAMABLE2(TEditView, TEditSearch, TView)
IMPLEMENT_ABSTRACT_STREAMABLE(TDocTemplate)
const uint MinUniqueViewId
DIAG_DECLARE_GROUP(OwlThread)
General definitions used by all ObjectWindows programs.