Skip to content

Latest commit

 

History

History
597 lines (301 loc) · 12.7 KB

PyCDocument.md

File metadata and controls

597 lines (301 loc) · 12.7 KB

PyCDocument

PyCDocument Object

A document class. Encapsulates an MFC CDocument

class

Methods

sentinel 

PyCDocument.DeleteContents

DeleteContents() Call the MFC DeleteContents method.

This routine is provided so a document object which overrides this method

can call the original MFC version if required.

See Also

MFC References

  • CDocument::DeleteContents

DeleteContents() Called by the MFC architecture when a document is newly created or closed.

Comments

If a handler is defined for this function, the base (MFC) function will not

be called. If necessary, the handler must call this function explicitely.

See Also

PyCDocument.DoFileSave

DoFileSave() Checks the file attributes.

If the file is read only, a new name is prompted, else the

file is saved (by calling DoSave)

See Also

Undocumented MFC References

  • CDocument::DoFileSave

DoFileSave() Called by the MFC architecture.

Comments

If a handler is defined for this function, it must call the

base class PyCDocument::DoFileSave method.

See Also

Return Value

TRUE if the document could be saved, else FALSE.

DoSave(fileName, bReplace) Calls the underlying MFC DoSave method.

Parameters

  • fileName : string

    The name of the file to save to.

  • bReplace=1 : int

    Should an existing file be silently replaced?.

Comments

If invalid or no filename, will prompt for a name, else

will perform the actual saving of the document.

See Also

Undocumented MFC References

  • CDocument::DoSave

DoSave(fileName, bReplace

) Called by the MFC architecture to save a document.

Parameters

  • fileName : string

    The name of the file being saved.

  • bReplace : int

    TRUE if the file should be replaced.

Comments

If a handler is defined for this function, it must call the

base class PyCDocument::DoSave method.

See Also

Return Value

TRUE if the document could be saved, else FALSE.

PyCDocument.GetAllViews

[PyCView,...] = GetAllViews() Returns a list of all views for the current document.

MFC References

  • CDocument::GetFirstViewPosition

  • CDocument::GetNextView

PyCDocument.GetDocTemplate

PyCDocTemplate = GetDocTemplate() Returns the template for the document.

MFC References

  • CDocument::GetDocTemplate

PyCDocument.GetFirstView

PyCView = GetFirstView() Returns the first view object attached to this document.

Comments

For more info, see PyCDocument::GetAllViews

shouldnt be possible.

MFC References

  • CDocument::GetFirstViewPosition

  • CDocument::GetNextView

PyCDocument.GetPathName

string = GetPathName() Returns the full path name of the current document.

The string will be empty if no path name has been set.

MFC References

  • CDocument::GetPathName

PyCDocument.GetTitle

string = GetTitle() Returns the title of the current document.

This will often be the file name portion of the path name.

MFC References

  • CDocument::GetTitle

PyCDocument.IsModified

int = IsModified() Return a flag indicating if the document has been modified.

MFC References

  • CDocument::IsModified

PyCDocument.OnChangedViewList

OnChangedViewList() Informs the document when a view is added or removed.

OnChangedViewList() Called by the MFC architecture when after a view is attached.

Comments

If a handler is defined for this function, the base (MFC) function will not

be called. If necessary, the handler must call this function explicitely.

See Also

PyCDocument.OnCloseDocument

OnCloseDocument() Call the MFC OnCloseDocument handler.

This routine is provided so a document object which overrides this method

can call the original MFC version if required.

See Also

MFC References

  • CDocument::OnCloseDocument

OnCloseDocument() Called by the MFC architecture.

Comments

If a handler is defined for this function, the base (MFC) function will not

be called. If necessary, the handler must call this function explicitely.

See Also

PyCDocument.OnNewDocument

OnNewDocument() Call the MFC OnNewDocument handler.

This routine is provided so a document object which overrides this method

can call the original MFC version if required.

See Also

MFC References

  • CDocument::OnNewDocument

OnNewDocument() Called by the MFC architecture.

Comments

If a handler is defined for this function, the base (MFC) function will not

be called. If necessary, the handler must call this function explicitely.

See Also

Return Value

TRUE if a new document could be created, else FALSE.

PyCDocument.OnOpenDocument

OnOpenDocument(pathName) Call the MFC OnOpenDocument handler.

This routine is provided so a document object which overrides this method

can call the original MFC version if required.

Parameters

  • pathName : string

    The full path of the file to open.

MFC References

  • CDocument::OnOpenDocument

OnOpenDocument(fileName) Called by the MFC architecture.

Parameters

  • fileName : string

    The name of the file being opened.

Comments

If a handler is defined for this function, the base (MFC) function will not

be called. If necessary, the handler must call this function explicitely.

See Also

Return Value

TRUE if the document could be opened, else FALSE.

PyCDocument.OnSaveDocument

OnSaveDocument(pathName) Call the MFC OnSaveDocument handler.

This routine is provided so a document object which overrides this method

can call the original MFC version if required.

Parameters

  • pathName : string

    The full path of the file to save.

MFC References

  • CDocument::OnSaveDocument

OnSaveDocument(fileName) Called by the MFC architecture.

Parameters

  • fileName : string

    The name of the file being saved.

Comments

If a handler is defined for this function, the base (MFC) function will not

be called. If necessary, the handler must call this function explicitely.

See Also

Return Value

TRUE if the document could be saved, else FALSE.

PreCloseFrame() Called before the frame window is closed.

Comments

The MFC base implementation is always called after the Python handler returns.

PyCDocument.SaveModified

int = SaveModified() Call the underlying MFC method.

See Also

MFC References

  • CDocument::SaveModified

Return Value

Nonzero if it is safe to continue and close the document; 0 if the document should not be closed.

SaveModified() Called by the MFC architecture when a document is closed.

Comments

If a handler is defined for this function, the base (MFC) function will not

be called. If necessary, the handler must call this function explicitely.

See Also

Return Value

The handler should return TRUE if it is safe to continue and close

the document; 0 if the document should not be closed.

PyCDocument.SetModifiedFlag

SetModifiedFlag(bModified) Set the "dirty" flag for the document.

Parameters

  • bModified=1 : int

    Set dirty flag

MFC References

  • CDocument::SetModifiedFlag

PyCDocument.SetPathName

SetPathName(path) Set the full path name for the document.

Parameters

  • path : string

    The full path of the file.

MFC References

  • CDocument::SetPathName

PyCDocument.SetTitle

SetTitle(title) Set the title of the document (ie, the name

to appear in the window caption for the document.

Parameters

  • title : string

    The new title.

MFC References

  • CDocument::SetTitle

PyCDocument.UpdateAllViews

UpdateAllViews(sender, hint) Informs each view when a document changes.

Parameters

  • sender : PyCView

    The view who initiated the update

  • hint=None : object

    A hint for the update.

MFC References

  • CDocument::UpdateAllViews