XTPReportControl.h
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:150k
- // XTPReportControl.h: interface for the CXTPReportControl class.
- //
- // This file is a part of the XTREME REPORTCONTROL MFC class library.
- // (c)1998-2008 Codejock Software, All Rights Reserved.
- //
- // THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
- // RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
- // CONSENT OF CODEJOCK SOFTWARE.
- //
- // THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
- // IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
- // YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
- // SINGLE COMPUTER.
- //
- // CONTACT INFORMATION:
- // support@codejock.com
- // http://www.codejock.com
- //
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_CODEJOCK_PRIVATE
- #if !defined(__XTPREPORTCONTROL_H__)
- #define __XTPREPORTCONTROL_H__
- //}}AFX_CODEJOCK_PRIVATE
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "XTPReportDefines.h"
- #include "XTPReportRow.h"
- #include "XTPReportRows.h"
- #include "XTPReportPaintManager.h"
- #include "XTPReportTip.h"
- #include "XTPReportNavigator.h"
- #include "Common/XTPSmartPtrInternalT.h"
- struct XTP_REPORTRECORDITEM_DRAWARGS;
- struct XTP_REPORTRECORDITEM_METRICS;
- class CXTPReportRecords;
- class CXTPReportRecordItem;
- class CXTPReportColumns;
- class CXTPReportGroups;
- class CXTPReportColumn;
- class CXTPReportRecord;
- class CXTPReportRows;
- class CXTPReportPaintManager;
- class CXTPReportColumnOrder;
- class CXTPImageManager;
- class CXTPReportInplaceEdit;
- class CXTPReportInplaceButtons;
- class CXTPReportInplaceList;
- class CXTPPropExchange;
- class CXTPToolTipContext;
- class CXTPReportNavigator;
- class CXTPReportRecordItemConstraint;
- class CXTPMarkupContext;
- struct XTP_REPORTRECORDITEM_ARGS;
- struct XTP_NM_REPORTTOOLTIPINFO;
- //===========================================================================
- // Summary:
- // This structure is sent to Main window in a WM_NOTIFY message from Item
- // and provides all parameters that are needed in processing control specific
- // notifications by the main window
- // Example:
- // <code>
- // BEGIN_MESSAGE_MAP(CReportSampleView, CXTPReportView)
- // ON_NOTIFY(XTP_NM_REPORT_GETITEMMETRICS, XTP_ID_REPORT_CONTROL, OnReportGetItemMetrics)
- // END_MESSAGE_MAP()
- //
- // void CReportSampleView::OnReportGetItemMetrics(NMHDR* pNotifyStruct, LRESULT* /*result*/)
- // {
- // XTP_NM_REPORTITEMMETRICS* pItemNotify = (XTP_NM_REPORTITEMMETRICS*)pNotifyStruct;
- //
- // ASSERT(pItemNotify->pDrawArgs);
- // ASSERT(pItemNotify->pDrawArgs->pControl);
- // ASSERT(pItemNotify->pDrawArgs->pRow);
- //
- // // pItemNotify->pDrawArgs->pColumn - may be NULL (for a group row)
- // // pItemNotify->pDrawArgs->pItem - may be NULL (for a group row)
- //
- // ASSERT(pItemNotify->pItemMetrics);
- //
- // // TODO: customize members of pItemNotify->pItemMetrics.
- // }
- // </code>
- // See Also:
- // CXTPReportControl, CXTPReportControl::GetItemMetrics(),
- // XTP_NM_REPORT_GETITEMMETRICS
- //===========================================================================
- struct XTP_NM_REPORTITEMMETRICS
- {
- NMHDR hdr; // Standard structure, containing information about a notification message.
- XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs; // Pointer to XTP_REPORTRECORDITEM_DRAWARGS structure.
- XTP_REPORTRECORDITEM_METRICS* pItemMetrics; // Pointer to XTP_REPORTRECORDITEM_METRICS structure to be filled.
- };
- //===========================================================================
- // Summary:
- // This structure is sent to main window in a WM_NOTIFY message from from report control
- // to determine Records was dragged or dropped
- // Example:
- // <code>
- // BEGIN_MESSAGE_MAP(CReportSampleView, CXTPReportView)
- // ON_NOTIFY(XTP_NM_REPORT_BEGINDRAG, XTP_ID_REPORT_CONTROL, OnReportBeginDrag)
- // END_MESSAGE_MAP()
- //
- // void CReportSampleView::OnReportBeginDrag(NMHDR* pNotifyStruct, LRESULT* /*result*/)
- // {
- // XTP_NM_REPORTDRAGDROP* pItemNotify = (XTP_NM_REPORTDRAGDROP*)pNotifyStruct;
- //
- // ASSERT(pItemNotify->pRecords);
- // }
- // </code>
- // See Also:
- // XTP_NM_REPORT_DROP, XTP_NM_REPORT_BEGINDRAG, CXTPReportControl::EnableDragDrop
- //===========================================================================
- struct XTP_NM_REPORTDRAGDROP
- {
- NMHDR hdr; // Standard structure, containing information about a notification message.
- CXTPReportRecords* pRecords; // Records will be dragged/dropped
- CXTPReportRecord* pTargetRecord; // Target record (if any)
- BOOL bAbove; // Where to insert (relative to the target record)
- DROPEFFECT dropEffect; // The DropEffect flags.
- CPoint pt; // The current location of the cursor in client coordinates.
- int nState; // The transition state (0 - enter, 1 - leave, 2 - over).
- };
- //===========================================================================
- // Summary:
- // This structure is sent to Main window in a WM_NOTIFY message before
- // processing OnKeyDown event.
- // See Also:
- // CXTPReportControl::OnPreviewKeyDown, XTP_NM_REPORT_PREVIEWKEYDOWN,
- // CXTPReportControl::OnKeyDown, CWnd::OnKeyDown.
- //===========================================================================
- struct XTP_NM_REPORTPREVIEWKEYDOWN
- {
- NMHDR hdr; // Standard structure, containing information about a notification message.
- // OnKeyDown parameters
- UINT nChar; // [in/out] Specifies the virtual key code of the given key.
- UINT nRepCnt; // [in] Repeat count.
- UINT nFlags; // [in] Specifies the scan code, key-transition code, previous key state, and context code.
- BOOL bCancel; // [out] TRUE to cancel processing key, FALSE to continue.
- };
- //===========================================================================
- // Summary:
- // Enumeration of operational mouse modes.
- // Remarks:
- // ReportControl has several
- // Mouse states that handled by control. This enumeration helps to
- // clearly identify each of these
- // - Sends Notifications:
- // - Sends Messages:
- // See Also: CXTPReportControl::SetMouseMode, CXTPReportControl::GetMouseMode
- //
- // <KEYWORDS xtpReportMouseNothing, xtpReportMouseOverColumnDivide, xtpReportMousePrepareDragColumn, xtpReportMouseDraggingColumn>
- //===========================================================================
- enum XTPReportMouseMode
- {
- xtpReportMouseNothing, // User is just watching to the list.
- xtpReportMouseOverColumnDivide, // User watching, but mouse is under column divider.
- xtpReportMousePrepareDragColumn, // User holds mouse button pressed on the column header.
- xtpReportMouseDraggingColumn // User is dragging column header.
- };
- //-----------------------------------------------------------------------
- // Summary:
- // Enumeration of drag and drop flags
- // Remarks:
- // Call CXTPReportControl::EnableDragDrop to allow drag/drop operations
- // Example:
- // <code>m_wndReport.EnableDragDrop("MyApplication", xtpReportAllowDrop | xtpReportAllowDrag);</code>
- // See Also: CXTPReportControl::EnableDragDrop
- //-----------------------------------------------------------------------
- enum XTPReportDragDrop
- {
- xtpReportAllowDrop = 1, // Allow Drop records to report
- xtpReportAllowDragCopy = 2, // Allow copy records from report
- xtpReportAllowDragMove = 4, // Allow move records from report
- xtpReportAllowDrag = 6 // Allow copy and move records from report
- };
- //-----------------------------------------------------------------------
- // Summary:
- // Enumeration of watermark alignment flags
- // Remarks:
- // Call CXTPReportControl::SetWatermarkAlignment to modify watermark alignment
- // Example:
- // <code>m_wndReport.SetWatermarkAlignment(xtpWatermarkCenter | xtpWatermarkBottom);</code>
- // See Also: CXTPReportControl::SetWatermarkAlignment, GetWatermarkAlignment
- //-----------------------------------------------------------------------
- enum XTPReportWatermarkAlignment
- {
- xtpReportWatermarkUnknown = 0, // Unknown (empty) value.
- xtpReportWatermarkLeft = 0x0001, // Horizontal alignment: left side of report control client rect.
- xtpReportWatermarkCenter = 0x0002, // Horizontal alignment: center of report control client rect.
- xtpReportWatermarkRight = 0x0004, // Horizontal alignment: right side of report control client rect.
- xtpReportWatermarkHmask = 0x000F, // A mask for horizontal alignment flags.
- xtpReportWatermarkTop = 0x0010, // Vertical alignment: top side of report control client rect.
- xtpReportWatermarkVCenter = 0x0020, // Vertical alignment: center of report control client rect.
- xtpReportWatermarkBottom = 0x0040, // Vertical alignment: bottom side of report control client rect.
- xtpReportWatermarkVmask = 0x00F0, // A mask for vertical alignment flags.
- xtpReportWatermarkStretch = 0x0100, // Stretch watermark to entire report control client rect.
- xtpReportWatermarkEnlargeOnly = 0x0200, // Watermark can be enlarged only, shrinking is disabled.
- xtpReportWatermarkShrinkOnly = 0x0400, // Watermark can be shrinked only, enlarging is disabled.
- xtpReportWatermarkPreserveRatio = 0x0800, // Watermark aspect ratio is preserved.
- };
- //-----------------------------------------------------------------------
- // Summary:
- // Enumeration of GetElementRect flags
- // Remarks:
- // Call CXTPReportControl::GetElementRect to get report element rectangle
- // Example:
- // <code>m_wndReport.GetElementRect(xtpReportRectGroupByArea, rc);</code>
- // See Also: CXTPReportControl::GetElementRect
- //-----------------------------------------------------------------------
- enum XTPReportElementRect
- {
- xtpReportElementRectReportArea = 0, // report area rectangle
- xtpReportElementRectGroupByArea, // report area rectangle
- xtpReportElementRectHeaderArea, // report area rectangle
- xtpReportElementRectFooterArea, // report area rectangle
- xtpReportElementRectHeaderRecordsArea, // report area rectangle
- xtpReportElementRectFooterRecordsArea, // report area rectangle
- xtpReportElementRectHeaderRecordsDividerArea, // report area rectangle
- xtpReportElementRectFooterRecordsDividerArea, // report area rectangle
- };
- //===========================================================================
- // Summary:
- // The CXTPReportControl class provides an implementation of
- // the Report control.
- //
- // Remarks:
- // A "report control" is a window that displays a hierarchical list
- // of items, such as emails in the inbox. Each item is called a CXTPReportRow
- // and consists of its properties and corresponding CXTPReportRecord,
- // which contains all the corresponding data (mostly text).
- // Each Row item (as well as Record) can have a list of sub-items
- // associated with it. By clicking a Row item, the user can expand and
- // collapse the associated list of sub-items.
- //
- // The CXTPReportRecords collection holds all the CXTPReportRecord objects
- // that are assigned to the Report control. It could be accessible via
- // GetRecords() method. The records in this collection
- // are referred to as the root records. Any record that is subsequently
- // added to a root record is referred to as a child record. Because each
- // CXTPReportRecord can contain a collection of other CXTPReportRecord
- // objects, you might find it difficult to determine your location in the
- // tree structure when you iterate through the collection.
- //
- // Record nodes can be expanded to display the next level of child records.
- // The user can expand the CXTPReportRecord by clicking the plus-sign (+)
- // button, if one is displayed, or you can expand the CXTPReportRecord by
- // calling the CXTPReportRecord::SetExpanded method.
- // To expand all the child records, call the ExpandAll method.
- // You can collapse the child CXTPReportRecord level by calling the
- // CXTPReportRecord::SetExpanded(FALSE) method, or the user can press
- // the minus-sign (-) button, if one is displayed. You can also call
- // CollapseAll method to collapse all child records.
- //
- // Each record contains an array of record items which are implemented
- // with CXTPReportRecordItem and its descendants. You can create your own
- // types of items simply by inheritance from the base record item class.
- //
- // Each record item has an association with corresponding CXTPReportColumn
- // item. The item will be shown below the corresponding column header
- // depending on its position in report control columns array. If a column
- // has not an associated item in the record, there will be an empty item
- // shown in the corresponding cell.
- //
- // Columns array is represented by CXTPReportColumns collection and could
- // be accessed via GetColumns() method.
- //
- // As a finalization of adding data to the report control, which means
- // adding columns and records, Populate() method should be called. It
- // performs population of control rows with data - creates a rows tree if
- // necessary, rebuilds groups if grouping if enabled, and sorts rows
- // on a specified manner. See Also an example below.
- //
- // Handling notification messages sent by the control to the parent
- // window is allowed with ON_NOTIFY handler. The control is using
- // SendMessageToParent function to send notifications. See below for
- // the example of how messages could be handled in a parent window:
- //
- // <code>
- // ON_NOTIFY(NM_CLICK, ID_REPORT_CONTROL, OnReportItemClick)
- // ON_NOTIFY(NM_RCLICK, ID_REPORT_CONTROL, OnReportItemRClick)
- // ON_NOTIFY(NM_DBLCLK, ID_REPORT_CONTROL, OnReportItemDblClick)
- // ON_NOTIFY(XTP_NM_SHOWFIELDCHOOSER, ID_REPORT_CONTROL, OnShowFieldChooser)
- // ON_NOTIFY(XTP_NM_HEADER_RCLICK, ID_REPORT_CONTROL, OnReportColumnRClick)
- // ON_NOTIFY(NM_KEYDOWN, ID_REPORT_CONTROL, OnReportKeyDown)
- // </code>
- //
- // You can also change the appearance of the CXTPReportControl control
- // by setting some of its display and style properties.
- //
- // Also Report control has an ability to store and restore its
- // settings, which includes all columns with their settings, and some
- // required control's settings. It is implemented via standard MFC and XTP
- // serialization and available with the member functions
- // SerializeState(CArchive& ar), DoPropExchange(CXTPPropExchange* pPX);
- //
- // Report control supports Copy/Paste clipboard operations.
- // See methods: CanCut(), CanCopy(), CanPaste(), Cut(), Copy(), Paste().
- // There are 2 clipboard formats are supported:
- // Binary - contains all record(s) data;
- // Text - contains visible columns texts.
- //
- // To support binary format the XTP serialization is used -
- // DoPropExchange() methods are implemented for CXTPReportRecord,
- // CXTPReportRecordItem and derived CXTPReportRecordItemXXX classes.
- // Also some part of standard MFC serialization is used
- // (see DECLARE_SERIAL macro) to automatically create classes when
- // loading from the data source.
- //
- // If you are creating custom records and records items classes you have
- // to use DECLARE_SERIAL macro and may need to override DoPropExchange()
- // methods to serialize custom data as well as standard records data.
- //
- // The storing records way is simple: CXTPReportRecord (or derived class)
- // is stored first, then record items (CXTPReportRecordItemXXX classes)
- // are stored one by one.
- // The class information, which allow to create object instances when
- // loading, is stored for all classes. See CArchive::WriteClass(),
- // CArchive::ReadClass() and other CArchive members for more details
- // about this idea.
- //
- // When report control loads records from the data source:
- // The record class is created automatically (using stored
- // class information).
- // Then items collection cleared and record items are created
- // automatically and added to items collection.
- // For example see ReportSample project: CMessageRecord class.
- //
- // We support text format with 't' dividers for record items and
- // "rn" dividers for records (simple tab-separated text).
- // Such format is also supported by Excel and some other applications.
- //
- // There are few methods and corresponding notifications which allow to
- // customize copy/paste operations:
- // OnBeforeCopyToText(); OnBeforePasteFromText(); OnBeforePaste();
- //
- // See Also:
- // CXTPReportView, CXTPReportHeader, CXTPReportRow, CXTPReportRecord,
- // CXTPReportColumn,
- // CXTPReportRecords, CXTPReportRows, CXTPReportColumns,
- // CXTPReportSubListControl, CXTPReportFilterEditControl
- //===========================================================================
- class _XTP_EXT_CLASS CXTPReportControl : public CWnd
- {
- //{{AFX_CODEJOCK_PRIVATE
- DECLARE_DYNCREATE(CXTPReportControl)
- friend class CXTPReportSubListControl;
- friend class CXTPReportRow;
- friend class CXTPReportGroupRow;
- friend class CXTPReportHeader;
- friend class CXTPReportNavigator;
- friend class CXTPReportInplaceEdit;
- friend class CXTPReportHeaderDragWnd;
- friend class CXTPReportInplaceList;
- friend class CXTPReportColumn;
- friend class CXTPReportView;
- class CReportDropTarget;
- //}}AFX_CODEJOCK_PRIVATE
- public:
- //===========================================================================
- // Summary:
- // Internal report update helper.
- //===========================================================================
- class _XTP_EXT_CLASS CUpdateContext
- {
- public:
- //-----------------------------------------------------------------------
- // Summary:
- // Constructs a CXTPReportControlUpdateContext object.
- // Parameters:
- // pControl - Pointer to a Report Control object.
- //-----------------------------------------------------------------------
- CUpdateContext(CXTPReportControl* pControl)
- {
- m_pControl = pControl;
- pControl->BeginUpdate();
- }
- //-------------------------------------------------------------------------
- // Summary:
- // Destroys a CXTPReportControlUpdateContext object, handles cleanup and deallocation.
- //-------------------------------------------------------------------------
- ~CUpdateContext()
- {
- m_pControl->EndUpdate();
- }
- protected:
- CXTPReportControl* m_pControl; // Updated report control pointer
- };
- public:
- //-------------------------------------------------------------------------
- // Summary:
- // Call this function to use custom heap feature.
- //
- // Remarks:
- // If it is enabled, report data will be allocated in custom (separate)
- // heap instead of standard application heap. This optimize memory
- // using (fragmentation) for big amount of data.
- // For custom heap used for classes derived from CXTPHeapObjectT template,
- // like CXTPReportRecord, CXTPReportRecordItem, CXTPReportRow and so others.
- // This template just overrides operators new and delete.
- // <P>It must be called on initialization before any allocations of classes
- // which use custom heap. OnInitInstance is a fine place for this.
- // Returns:
- // TRUE if custom heap feature is enabled for all report allocators,
- // FALSE otherwise.
- //-------------------------------------------------------------------------
- static BOOL AFX_CDECL UseReportCustomHeap();
- //-------------------------------------------------------------------------
- // Summary:
- // Call this function to enable batch allocation feature for report rows.
- //
- // Remarks:
- // Batch allocation means that memory allocated not for one object only,
- // but for many objects at one time (for 1024 objects by default).
- // Next allocations take memory from this big block. New blocks allocated
- // when necessary. This increase performance and reduce heap fragmentation.
- // Batch allocation mechanism responsible for allocation/deallocation
- // blocks of memory from heap and internally organize free/busy lists of
- // memory pieces. When object deleted, its memory stored in free list and
- // used for new objects.
- // When all memory pieces from block free, it may be deallocated from
- // heap automatically (this depends on options in _TBatchAllocData)
- // or by FreeExtraData call,
- // <P>It must be called on initialization before any allocations of classes
- // which use batch allocation. OnInitInstance is a fine place for this.
- // Returns:
- // TRUE if batch allocation feature is enabled for report rows,
- // FALSE otherwise.
- //-------------------------------------------------------------------------
- static BOOL AFX_CDECL UseRowBatchAllocation();
- //-----------------------------------------------------------------------
- // Summary:
- // This member function when rows batch allocation enabled to check
- // all allocated blocks and deallocate which are completely free.
- // See Also:
- // UseRowBatchAllocation, CXTPBatchAllocObjT
- //-----------------------------------------------------------------------
- static void AFX_CDECL FreeRowBatchExtraData();
- public:
- //-----------------------------------------------------------------------
- // Summary:
- // Constructs a CXTPReportControl object.
- // Remarks:
- // You construct a CXTPReportControl object in two steps.
- // First, call the constructor CXTPReportControl and then call
- // Create method, which initializes the window.
- //
- // Example:
- // <code>
- // // Declare a local CXTPReportControl object.
- // CXTPReportControl myReport;
- //
- // // Declare a dynamic CXTPReportControl object.
- // CXTPReportControl* pMyReport = new CXTPReportControl();
- //
- // if (!myReport.Create(WS_CHILD | WS_TABSTOP | WS_VISIBLE | WM_VSCROLL, CRect(0, 0, 0, 0), this, ID_REPORT_CONTROL))
- // {
- // TRACE(_T("Failed to create view windown"));
- // }
- // </code>
- // See Also: Create
- //-----------------------------------------------------------------------
- CXTPReportControl();
- //-----------------------------------------------------------------------
- // Summary:
- // Destroys a CXTPReportControl object, handles cleanup and deallocation.
- //-----------------------------------------------------------------------
- virtual ~CXTPReportControl();
- //-----------------------------------------------------------------------
- // Summary:
- // This method is called to create a report control.
- // Parameters:
- // dwStyle - Specifies the window style attributes.
- // It could be a combination of standard window styles.
- // rect - The size and position of the window, in client
- // coordinates of pParentWnd.
- // pParentWnd - Specifies the report control parent window.
- // nID - Specifies the report control identifier.
- // pContext - The create context of the window.
- // Remarks:
- // You construct a CXTPReportControl object in two steps.
- // First, call the constructor CXTPReportControl and then call
- // Create method, which initializes the window.
- // Example:
- // See the example for CXTPReportControl::CXTPReportControl
- // Returns:
- // Nonzero if successful; otherwise 0.
- // See Also: CXTPReportControl::CXTPReportControl
- //-----------------------------------------------------------------------
- BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
- //-----------------------------------------------------------------------
- // Summary:
- // (Re)Stores control configuration to/from the provided archive stream.
- // Parameters:
- // ar - Archive stream for serializing.
- //-----------------------------------------------------------------------
- virtual void SerializeState(CArchive& ar);
- //-----------------------------------------------------------------------
- // Summary:
- // Reads or writes configuration to/from the provided data source.
- // Parameters:
- // pPX - A CXTPPropExchange object to serialize to or from.
- //----------------------------------------------------------------------
- virtual void DoPropExchange(CXTPPropExchange* pPX);
- public:
- //-----------------------------------------------------------------------
- // Summary:
- // Adds new column to the end of the columns array.
- // Parameters:
- // pColumn - Pointer to the specified column class object.
- // Remarks:
- // Call this member function if you want to add a new column
- // to a report control. It will be added to the end of the columns array.
- // Example:
- // <code>
- // // this function adds a column with "Subject" caption and 250 pixels initial width
- // void AddSubjectColumn(CXTPReportControl* pReportCtrl)
- // {
- // pReportCtrl->AddColumn(new CXTPReportColumn(1, _T("Subject"), 250));
- // }
- // </code>
- // See Also: CXTPReportColumn overview
- //-----------------------------------------------------------------------
- CXTPReportColumn* AddColumn(CXTPReportColumn* pColumn);
- //-----------------------------------------------------------------------
- // Summary:
- // Adds record to records collection.
- // Parameters:
- // pRecord - Record data with items.
- // Remarks:
- // Call this member function if you want to add a data record to the
- // report control's internal storage.
- // Example:
- // <code>
- // // this function adds 2 empty records to a report control
- // void Add2Empties(CXTPReportControl* pReportCtrl)
- // {
- // pReportCtrl->AddRecord(new CXTPReportRecord());
- // pReportCtrl->AddRecord(new CXTPReportRecord());
- // }
- // </code>
- // Returns:
- // Pointer to the recently added record object.
- // See Also: CXTPReportRecord overview, GetRecords
- //-----------------------------------------------------------------------
- virtual CXTPReportRecord* AddRecord(CXTPReportRecord* pRecord);
- //-----------------------------------------------------------------------
- // Summary:
- // Adds record to records collection and associates a row with it.
- // Parameters:
- // pRecord - Record data with items.
- // pParentRecord - Parent record.
- // nChildIndex - child index a record to be inserted at.
- // Remarks:
- // Call this member function if you want to add a data record to the
- // report control's internal storage and associate a row with it.
- // Example:
- // <code>
- // // this function adds 2 empty records to a report control
- // void Add2Empties(CXTPReportControl* pReportCtrl)
- // {
- // pReportCtrl->AddRecordEx(new CXTPReportRecord());
- // pReportCtrl->AddRecordEx(new CXTPReportRecord());
- // }
- // </code>
- // See Also: CXTPReportRecord overview, GetRecords, RemoveRecordEx, RemoveRowEx
- // UpdateRecord
- //-----------------------------------------------------------------------
- virtual void AddRecordEx(CXTPReportRecord* pRecord, CXTPReportRecord* pParentRecord = NULL, int nChildIndex = -1);
- //-----------------------------------------------------------------------
- // Summary:
- // Removes record with data and associated row. It also remove all
- // children records and their rows.
- // Parameters:
- // pRecord - Pointer to a record object.
- // bAdjustLayout - If TRUE AdjustLayout will be called.
- // bRemoveFromParent - If TRUE the record is to be removed from the parent.
- // Remarks:
- // Call this member function if you want to remove record on the fly,
- // without Populate call.
- // Returns:
- // TRUE if operation succeeded, FALSE otherwise.
- // See Also: RemoveRowEx, AddRecordEx, CXTPReportRecords::RemoveRecord,
- // UpdateRecord
- //-----------------------------------------------------------------------
- virtual BOOL RemoveRecordEx(CXTPReportRecord* pRecord, BOOL bAdjustLayout = TRUE, BOOL bRemoveFromParent = TRUE);
- //-----------------------------------------------------------------------
- // Summary:
- // Removes row and associated record. It also remove all
- // children records and rows.
- // Parameters:
- // pRow - Pointer to a row object.
- // bAdjustLayout - If TRUE AdjustLayout will be called.
- // Remarks:
- // Call this member function if you want to remove row and record on the fly,
- // without Populate call.
- // Returns:
- // TRUE if operation succeeded, FALSE otherwise.
- // See Also: RemoveRecordEx, AddRecordEx, CXTPReportRecords::RemoveRecord,
- // UpdateRecord
- //-----------------------------------------------------------------------
- virtual BOOL RemoveRowEx(CXTPReportRow* pRow, BOOL bAdjustLayout = TRUE);
- //-----------------------------------------------------------------------
- // Summary:
- // Updates record.
- // Parameters:
- // pRecord - Record data with items.
- // bUpdateChildren - If TRUE the children will be updated as well.
- // Remarks:
- // Call this member function if you modified a record and want it
- // to be updated accordingly to the current grouping and sorting.
- // See Also: CXTPReportRecord overview, GetRecords
- //-----------------------------------------------------------------------
- virtual void UpdateRecord(CXTPReportRecord* pRecord, BOOL bUpdateChildren);
- //-----------------------------------------------------------------------
- // Summary:
- // Prevents the control from redrawing until the EndUpdate
- // method is called.
- // Remarks:
- // If you want to add items one at a time using the AddRecord method,
- // or to make some another operations in a single sequence,
- // you can use the BeginUpdate method to prevent the control
- // from repainting the CXTPReportControl each time an item is added.
- // Once you have completed the task of adding items to the control,
- // call the EndUpdate method to enable the CXTPReportControl to repaint.
- // This way of adding items can prevent flickered drawing of
- // the CXTPReportControl when a large number of items are being
- // added to the control.
- // Example:
- // <code>
- // // This function collapses all rows for the specified report control
- // void CollapseAll(CXTPReportControl* pReportCtrl)
- // {
- // pReportCtrl->BeginUpdate();
- // for (int i = pReportCtrl->GetRows()->GetCount() - 1; i >= 0; i --)
- // pReportCtrl->GetRows()->GetAt(i)->SetExpanded(FALSE);
- //
- // pReportCtrl->EndUpdate();
- // }
- // </code>
- // See Also: EndUpdate, RedrawControl, AddRecord
- //-----------------------------------------------------------------------
- void BeginUpdate();
- //-----------------------------------------------------------------------
- // Summary:
- // This method deletes all rows and records from Report Control.
- // Parameters:
- // bUpdateControl - Set TRUE to redraw control, otherwise FALSE.
- //-----------------------------------------------------------------------
- void ResetContent(BOOL bUpdateControl = TRUE);
- //-----------------------------------------------------------------------
- // Summary:
- // Resumes drawing of the report control after drawing is
- // suspended by the BeginUpdate method.
- // Remarks:
- // If you want to add items one at a time using the AddRecord method,
- // or to make some other operations in a single sequence,
- // you can use the BeginUpdate method to prevent the control
- // from repainting the CXTPReportControl each time an item is added.
- // Once you have completed the task of adding items to the control,
- // call the EndUpdate method to enable the CXTPReportControl to repaint.
- // This way of adding items can prevent flickered drawing of
- // the CXTPReportControl when a large number of items are being
- // added to the control.
- // Example: See example for CXTPReportControl::BeginUpdate method.
- // See Also: BeginUpdate, RedrawControl
- //-----------------------------------------------------------------------
- void EndUpdate();
- //-----------------------------------------------------------------------
- // Summary:
- // Returns TRUE if control in Update state.
- //-----------------------------------------------------------------------
- int GetLockUpdateCount() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Initiates report control redrawing.
- // Remarks:
- // Call this member function if you want to initialize the
- // report control redrawing. The control will be redrawn taking
- // into account its latest state.
- // See Also: BeginUpdate, EndUpdate
- //-----------------------------------------------------------------------
- void RedrawControl();
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to get tooltip context pointer.
- //-----------------------------------------------------------------------
- CXTPToolTipContext* GetToolTipContext() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to enable built in drag and drop operations
- // Parameters:
- // lpszClipboardFormat - Name of clipboard format to be used for Report Control
- // dwFlags - Combination of XTPReportDragDrop flags, can be one or more of following:
- // <b>xtpReportAllowDrop</b> - Allow Drop records to report
- // <b>xtpReportAllowDragCopy</b> - Allow copy records from report
- // <b>xtpReportAllowDragMove</b> - Allow move records from report
- // <b>xtpReportAllowDrag</b> - Allow copy and move records from report
- // Returns:
- // Clipboard format that will be used with Report Control
- // See Also: XTPReportDragDrop
- //-----------------------------------------------------------------------
- CLIPFORMAT EnableDragDrop(LPCTSTR lpszClipboardFormat, DWORD dwFlags);
- //-----------------------------------------------------------------------
- // Summary:
- // Set or clear grid drawing style.
- // Parameters:
- // bVertical - TRUE for changing vertical grid style,
- // FALSE for changing horizontal grid style.
- // gridStyle - New grid style. Can be any of the values listed in the Remarks section.
- // Remarks:
- // Call this member function if you want to change a style
- // of report grid lines.
- //
- // Possible grid line styles are the following:
- // * <b>xtpReportGridNoLines</b> Empty line
- // * <b>xtpReportGridSmallDots</b> Line is drawn with small dots
- // * <b>xtpReportGridLargeDots</b> Line is drawn with large dots
- // * <b>xtpReportGridDashes</b> Line is drawn with dashes
- // * <b>xtpReportGridSolid</b> Draws solid line
- //
- // See Also: XTPReportGridStyle overview, GetGridStyle, SetGridColor
- //-----------------------------------------------------------------------
- void SetGridStyle(BOOL bVertical, XTPReportGridStyle gridStyle);
- //-----------------------------------------------------------------------
- // Summary:
- // Returns current grid drawing mode.
- // Parameters:
- // bVertical - TRUE for vertical grid style,
- // FALSE for horizontal grid style.
- // Remarks:
- // Call this member function if you want to retrieve current
- // grid lines drawing style for the report control.
- // Returns:
- // Current grid drawing style.
- // See Also: XTPReportGridStyle overview, SetGridStyle, SetGridColor
- //-----------------------------------------------------------------------
- XTPReportGridStyle GetGridStyle(BOOL bVertical) const;
- //-----------------------------------------------------------------------
- // Summary:
- // Change color of GridLines.
- // Parameters:
- // clrGridLine - New Grid Lines color.
- // Remarks:
- // Call this member function if you want to change a color of
- // report control grid lines.
- // Returns:
- // Old Grid Lines color.
- // See Also: SetGridStyle, GetGridStyle
- //-----------------------------------------------------------------------
- COLORREF SetGridColor(COLORREF clrGridLine);
- //-----------------------------------------------------------------------
- // Summary:
- // Returns the collection of the data records.
- // Returns:
- // The data records collection.
- // Remarks:
- // Call this member function if you want to retrieve an access
- // to the collection of report records. You may then perform
- // standard operations on the collection like adding, removing, etc.
- // See Also: CXTPReportRecords overview, AddRecord
- //-----------------------------------------------------------------------
- CXTPReportRecords* GetRecords() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Returns the collection of the report rows
- // Remarks:
- // Use this member function to retrieve an access to the collection
- // of report rows, representing current control view.
- //
- // Note that rows collection could be rebuilt automatically
- // on executing Populate method.
- // Returns:
- // The report rows collection.
- // Example:
- // See example for CXTPReportControl::BeginUpdate method.
- // See Also: CXTPReportRows overview, Populate
- //-----------------------------------------------------------------------
- CXTPReportRows* GetRows() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Interface for accessing list columns.
- // Remarks:
- // Use this member function to retrieve an access to the collection
- // of report columns.
- // Returns:
- // The report Columns collection.
- // Example:
- // <code>
- // // this function adds a column with "Subject" caption and 250 pixels initial width
- // void AddSubjectColumn(CXTPReportControl* pReportCtrl)
- // {
- // pReportCtrl->GetColumns()->Add(new CXTPReportColumn(1, _T("Subject"), 250));
- // }
- // </code>
- // See Also: CXTPReportColumns overview
- //-----------------------------------------------------------------------
- CXTPReportColumns* GetColumns() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Returns the currently used control's Paint Manager.
- // Remarks:
- // Call this member function to get the paint manager object used
- // for drawing a report control window.
- // Returns:
- // Pointer to the paint manager object.
- // See Also: CXTPReportPaintManager overview
- //-----------------------------------------------------------------------
- CXTPReportPaintManager* GetPaintManager() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to set custom paint manager.
- // Parameters:
- // pPaintManager - A pointer to the custom paint manager.
- //-----------------------------------------------------------------------
- void SetPaintManager(CXTPReportPaintManager* pPaintManager);
- //-----------------------------------------------------------------------
- // Summary:
- // Returns the control's Navigator.
- // Remarks:
- // Call this member function to get the navigator object used
- // for cell navigation.
- // Returns:
- // Pointer to the navigator object.
- // See Also: CXTPReportNavigator overview
- //-----------------------------------------------------------------------
- CXTPReportNavigator* GetNavigator() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Performs control population, creating view from the data.
- // Remarks:
- // Call this member function to populate control's Rows collection
- // with the data containing in Records collection.
- // It automatically creates Tree View references if necessary
- // (for example, in Grouping mode).
- // , it is the main function which should be called for
- // (re)populating all data changes that you have made into the
- // Records collection.
- // See Also: CXTPReportPaintManager overview
- //-----------------------------------------------------------------------
- virtual void Populate();
- //-----------------------------------------------------------------------
- // Summary:
- // Performs control's header rows population, creating view from the data.
- // Remarks:
- // Call this member function to populate control's header rows collection
- // with the data containing in HeaderRecords collection. Useful when main
- // rows are controlled through AddRecordEx/RemoveRecordEx/UpdateRecord
- // methods.
- // See Also: Populate, PopulateFooterRows, AddRecordEx, RemoveRecordEx, UpdateRecord
- //-----------------------------------------------------------------------
- virtual void PopulateHeaderRows();
- //-----------------------------------------------------------------------
- // Summary:
- // Performs control's footer rows population, creating view from the data.
- // Remarks:
- // Call this member function to populate control's footer rows collection
- // with the data containing in FooterRecords collection. Useful when main
- // rows are controlled through AddRecordEx/RemoveRecordEx/UpdateRecord
- // methods.
- // See Also: Populate, PopulateHeaderRows, AddRecordEx, RemoveRecordEx, UpdateRecord
- //-----------------------------------------------------------------------
- virtual void PopulateFooterRows();
- //-----------------------------------------------------------------------
- // Summary:
- // Ensures that a report control row is at least partially visible.
- // Parameters:
- // pCheckRow - A pointer to the row that is to be visible.
- // Remarks:
- // Ensures that a report row item is at least partially visible.
- // The list view control is scrolled if necessary.
- // See Also: MoveDown, MoveUp, MovePageDown, MovePageUp, MoveFirst, MoveLast
- //-----------------------------------------------------------------------
- void EnsureVisible(CXTPReportRow* pCheckRow);
- //-----------------------------------------------------------------------
- // Summary:
- // Ensures that a report control column is at least partially visible.
- // Parameters:
- // pCheckColumn - A pointer to the column that is to be visible.
- // Remarks:
- // Ensures that a report column item is at least partially visible.
- // The list view control is scrolled if necessary.
- // See Also: MoveRight, MoveLeft, MoveToColumn, MoveFirstColumn, MoveLastColumn
- //-----------------------------------------------------------------------
- void EnsureVisible(CXTPReportColumn* pCheckColumn);
- //-----------------------------------------------------------------------
- // Summary:
- // Determines which report row item, if any, is at a specified position.
- // Parameters:
- // pt - A point to test.
- // Returns:
- // The row item at the position specified by pt, if any,
- // or NULL otherwise.
- //-----------------------------------------------------------------------
- CXTPReportRow* HitTest(CPoint pt) const;
- //-----------------------------------------------------------------------
- // Summary:
- // Returns the collection of the selected rows.
- // Remarks:
- // Use this member function to retrieve an access to the collection
- // of currently selected report rows.
- // Returns:
- // The selected rows collection.
- // See Also: CXTPReportSelectedRows overview.
- //-----------------------------------------------------------------------
- CXTPReportSelectedRows* GetSelectedRows() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Retrieves the index of the row that currently has focus
- // in the report control's view.
- // Returns:
- // Returns pointer to the focused row, or NULL otherwise.
- // See Also: SetFocusedRow
- //-----------------------------------------------------------------------
- CXTPReportRow* GetFocusedRow() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Makes the provided row as currently focused.
- // Parameters:
- // pRow - The row to set as focused to.
- // bIgnoreSelection - TRUE if select new focused row.
- // bSelectBlock - TRUE when selecting rows up to new focused row,
- // FALSE otherwise.
- // Returns:
- // TRUE if specified row has been focused, FALSE otherwise.
- // See Also: GetFocusedRow
- //-----------------------------------------------------------------------
- BOOL SetFocusedRow(CXTPReportRow* pRow, BOOL bIgnoreSelection = FALSE);
- BOOL SetFocusedRow(CXTPReportRow* pRow, BOOL bSelectBlock, BOOL bIgnoreSelection);// <COMBINE CXTPReportControl::SetFocusedRow@CXTPReportRow*@BOOL>
- //-----------------------------------------------------------------------
- // Summary:
- // Returns rows from the visible report area.
- // Parameters:
- // nStartRow - Row index to start calculating from.
- // bMoveDown - Rows moving direction.
- // Remarks:
- // Call this member function if you want to calculate the amount
- // of currently visible rows between nStartRow and the top/bottom
- // of the current view.
- // Returns:
- // Visible row index starting from.
- // See Also: MovePageDown, MovePageUp
- //-----------------------------------------------------------------------
- int GetReportAreaRows(int nStartRow, BOOL bMoveDown);
- //-----------------------------------------------------------------------
- // Summary:
- // Force provided row to the top.
- // Parameters:
- // nIndex - An index of the row to force.
- // Remarks:
- // The system scrolls the report control view until either the
- // item specified by nIndex appears at the top of the view
- // the maximum scroll range has been reached.
- // See Also: GetReportAreaRows, EnsureVisible
- //-----------------------------------------------------------------------
- void SetTopRow(int nIndex);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to retrieve top row index.
- // Returns:
- // Top row index.
- // See Also: SetTopRow
- //-----------------------------------------------------------------------
- long GetTopRowIndex() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to set horizontal scroll position.
- // Parameters:
- // nOffset - Horizontal scroll position.
- // Remarks:
- // This method takes effect only if auto column sizing is disable
- // See Also: CXTPReportHeader::SetAutoColumnSizing
- //-----------------------------------------------------------------------
- void SetLeftOffset(int nOffset);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to set right-to-left mode.
- // Parameters:
- // bRightToLeft - TRUE to set right-to-left reading-order properties.
- //-----------------------------------------------------------------------
- void SetLayoutRTL(BOOL bRightToLeft);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to get right-to-left mode.
- // Returns:
- // TRUE if layout is RTL, FALSE - otherwise.
- //-----------------------------------------------------------------------
- BOOL IsLayoutRTL();
- //-----------------------------------------------------------------------
- // Summary:
- // Enable/disable preview mode for the control.
- // Parameters:
- // bIsPreviewMode - TRUE for enabling preview mode,
- // FALSE for disabling.
- // Remarks:
- // Call this member function if you want to hide or show the
- // row preview item.
- // See Also: IsPreviewMode
- //-----------------------------------------------------------------------
- void EnablePreviewMode(BOOL bIsPreviewMode);
- //-----------------------------------------------------------------------
- // Summary:
- // Returns current preview mode.
- // Remarks:
- // Call this member function if you want to determine whether the
- // row preview item is shown or not.
- // Returns:
- // TRUE when preview mode is enabled,
- // FALSE when preview mode is disabled.
- // See Also: EnablePreviewMode
- //-----------------------------------------------------------------------
- BOOL IsPreviewMode() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Shows/hides Group By control area.
- // Parameters:
- // bEnable - TRUE for showing GroupBy area,
- // FALSE for hiding GroupBy area.
- // Remarks:
- // Call this member function if you want to hide or show
- // Group By area in the report header.
- // See Also: IsGroupByVisible
- //-----------------------------------------------------------------------
- void ShowGroupBy(BOOL bEnable = TRUE);
- //-----------------------------------------------------------------------
- // Summary:
- // Returns current Group By area mode.
- // Remarks:
- // Call this member function if you want to determine whether
- // Group By area in the report header is visible or not.
- // Returns:
- // TRUE when Group By area is shown on the control,
- // when Group By area is hidden.
- // See Also: ShowGroupBy
- //-----------------------------------------------------------------------
- BOOL IsGroupByVisible() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to hide/show column headers.
- // Parameters:
- // bShow - TRUE is column headers will be displayed, FALSE to hide column headers.
- // See Also: IsHeaderVisible, ShowFooter
- //-----------------------------------------------------------------------
- void ShowHeader(BOOL bShow = TRUE);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine is column headers are currently visible.
- // Returns:
- // TRUE is column headers are visible, FALSE is column headers are hidden.
- // See Also: ShowHeader
- //-----------------------------------------------------------------------
- BOOL IsHeaderVisible() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to hide/show report footers.
- // Parameters:
- // bShow - TRUE is column footers will be displayed, FALSE to hide column footers.
- // See Also: IsFooterVisible, ShowHeader
- //-----------------------------------------------------------------------
- void ShowFooter(BOOL bShow = TRUE);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine is column footers are currently visible.
- // Returns:
- // TRUE is column footers are visible, FALSE is column footers are hidden.
- // See Also: ShowHeader
- //-----------------------------------------------------------------------
- BOOL IsFooterVisible() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Enable/disable group shade.
- // Parameters:
- // bEnable - TRUE for enabling group items shade,
- // FALSE for disabling.
- // Remarks:
- // Call this member function if you want to hide or show
- // group rows' headings.
- // See Also:
- // IsShadeGroupHeadingsEnabled, IsGroupRowsBold, SetGroupRowsBold,
- // GetItemMetrics
- //-----------------------------------------------------------------------
- void ShadeGroupHeadings(BOOL bEnable = TRUE);
- //-----------------------------------------------------------------------
- // Summary:
- // Returns current group shade mode.
- // Remarks:
- // Call this member function if you want to determine whether
- // group rows' headings are enabled or not.
- // Returns:
- // TRUE when group items shading is enabled,
- // FALSE when it is disabled.
- // See Also:
- // ShadeGroupHeadings, IsGroupRowsBold, SetGroupRowsBold,
- // GetItemMetrics
- //-----------------------------------------------------------------------
- BOOL IsShadeGroupHeadingsEnabled() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Set group rows text style: bold or normal.
- // Parameters:
- // bBold - TRUE for bold text style, FALSE for normal.
- // Remarks:
- // Call this member function if you want to change group rows
- // bold text style.
- // See Also:
- // IsGroupRowsBold, ShadeGroupHeadings, IsShadeGroupHeadingsEnabled,
- // GetItemMetrics
- //-----------------------------------------------------------------------
- void SetGroupRowsBold(BOOL bBold = TRUE);
- //-----------------------------------------------------------------------
- // Summary:
- // Returns current group rows text bold style.
- // Remarks:
- // Call this member function if you want to determine whether
- // group rows' text are bold or normal.
- // Returns:
- // TRUE when group text are bold,
- // FALSE when it is normal.
- // See Also:
- // SetGroupRowsBold, ShadeGroupHeadings, IsShadeGroupHeadingsEnabled,
- // GetItemMetrics
- //-----------------------------------------------------------------------
- BOOL IsGroupRowsBold() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to retrieve count of none-scrolled columns
- // at the left side.
- // Returns:
- // Count of none-scrolled columns
- // at the left side.
- //-----------------------------------------------------------------------
- int GetFreezeColumnsCount() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to retrieve count of the columns at the left side
- // where reordering is disabled.
- // Returns:
- // Count of drop-disable columns
- // at the left side.
- //-----------------------------------------------------------------------
- int GetDisableReorderColumnsCount() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to set count of none-scrolled columns
- // at the left side.
- // Parameters:
- // nCount - Count of none-scrolled columns at the left side.
- //-----------------------------------------------------------------------
- void SetFreezeColumnsCount(int nCount);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to set count of the columns at the left side
- // where reordering is disabled.
- // Parameters:
- // nCount - Count of reorder-disabled columns at the left side.
- //-----------------------------------------------------------------------
- void SetDisableReorderColumnsCount(int nCount);
- //-----------------------------------------------------------------------
- // Summary:
- // Get horizontal scrolling mode.
- // Returns:
- // Returns TRUE if horizontal scrolling is by full columns,
- // otherwise horizontal scrolling is by pixels.
- // See Also: SetFullColumnScrolling
- //-----------------------------------------------------------------------
- BOOL IsFullColumnScrolling() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Set horizontal scrolling mode.
- // Parameters:
- // bSet - If TRUE full columns scrolling mode is set,
- // if FALSE horizontal scrolling by pixels mode is set.
- // See Also: IsFullColumnScrolling
- //-----------------------------------------------------------------------
- void SetFullColumnScrolling(BOOL bSet);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to remove all items and column in specified position.
- // Parameters:
- // nIndex - Index of item to remove.
- //-----------------------------------------------------------------------
- void ReleaseItem(int nIndex);
- //-----------------------------------------------------------------------
- // Summary:
- // Returns the collection of the header records.
- // Returns:
- // The header records collection.
- // Remarks:
- // Call this member function if you want to retrieve an access
- // to the collection of report header records. You may then perform
- // standard operations on the collection like adding, removing, etc.
- // See Also: CXTPReportRecords overview, AddRecord
- //-----------------------------------------------------------------------
- CXTPReportRecords* GetHeaderRecords() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Returns the collection of the footer records.
- // Returns:
- // The footer records collection.
- // Remarks:
- // Call this member function if you want to retrieve an access
- // to the collection of report footer records. You may then perform
- // standard operations on the collection like adding, removing, etc.
- // See Also: CXTPReportRecords overview, AddRecord
- //-----------------------------------------------------------------------
- CXTPReportRecords* GetFooterRecords() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Returns the collection of the report header rows
- // Remarks:
- // Use this member function to retrieve an access to the collection
- // of report header rows, representing current control view.
- //
- // Note that rows collection could be rebuilt automatically
- // on executing Populate method.
- // Returns:
- // The report header rows collection.
- // Example:
- //
- // See Also: CXTPReportRows overview, Populate
- //-----------------------------------------------------------------------
- CXTPReportRows* GetHeaderRows() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Returns the collection of the report footer rows
- // Remarks:
- // Use this member function to retrieve an access to the collection
- // of report footer rows.
- //
- // Note that rows collection could be rebuilt automatically
- // on executing Populate method.
- // Returns:
- // The report footer rows collection.
- // Example:
- //
- // See Also: CXTPReportRows overview, Populate
- //-----------------------------------------------------------------------
- CXTPReportRows* GetFooterRows() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to hide/show header records.
- // Parameters:
- // bShow - TRUE is header records will be displayed, FALSE to hide header records.
- // See Also: IsHeaderRowsVisible, ShowFooterRows
- //-----------------------------------------------------------------------
- void ShowHeaderRows(BOOL bShow = TRUE);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to hide/show footer records.
- // Parameters:
- // bShow - TRUE is footer records will be displayed, FALSE to hide footer records.
- // See Also: IsFooterRowsVisible, ShowHeaderRows
- //-----------------------------------------------------------------------
- void ShowFooterRows(BOOL bShow = TRUE);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine if header records are currently visible.
- // Returns:
- // TRUE if header records are visible, FALSE if header records are hidden.
- // See Also: ShowHeaderRows
- //-----------------------------------------------------------------------
- BOOL IsHeaderRowsVisible() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine if footer records are currently visible.
- // Returns:
- // TRUE if footer records are visible, FALSE if footer records are hidden.
- // See Also: ShowFooterRows
- //-----------------------------------------------------------------------
- BOOL IsFooterRowsVisible() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to pin footer records to the last body row.
- // By default, footer records are docked to the footer.
- // Parameters:
- // bPin - TRUE is footer records will be displayed immediately after the body rows.
- // See Also: IsFooterRowsVisible, ShowFooterRows
- //-----------------------------------------------------------------------
- void PinFooterRows(BOOL bPin = FALSE);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine if footer records are pinned to the body rows.
- // Returns:
- // TRUE if footer records are pinned to the body rows. FALSE if footer records are docked to the footer.
- // See Also: PinFooterRows
- //-----------------------------------------------------------------------
- BOOL IsFooterRowsPinned() const;
- public:
- //-------------------------------------------------------------------------
- // Summary:
- // Call this method to enable markup for tab captions
- // Parameters:
- // bEnable - TRUE to enable markup
- //-------------------------------------------------------------------------
- void EnableMarkup(BOOL bEnable = TRUE);
- //-------------------------------------------------------------------------
- // Summary:
- // Returns markup context
- //-------------------------------------------------------------------------
- CXTPMarkupContext* GetMarkupContext() const;
- public:
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to get a pointer to the image manager of Report Control.
- // Returns:
- // Pointer to the image manager of Report Control.
- // See Also: SetImageManager
- //-----------------------------------------------------------------------
- CXTPImageManager* GetImageManager() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to set new image manager.
- // Parameters:
- // pImageManager - Image manager to be set
- // Example:
- // <code>
- // CXTPImageManager* pImageManager = new CXTPImageManager();
- // pImageManager->SetIcons(IDR_MAINFRAME);
- // m_wndReport.SetImageManager(pImageManager);
- // </code>
- // See Also: GetImageManager
- //-----------------------------------------------------------------------
- void SetImageManager(CXTPImageManager* pImageManager);
- //-----------------------------------------------------------------------
- // Summary:
- // Initiates ImageList of Paint Manager.
- // Parameters:
- // pImageList - Image list.
- // Remarks:
- // You use this function to set up your own ImageList
- // with set bitmaps that represent various states of rows
- // and depict any other information.
- // Note:
- // Recommended to use SetImageManager/GetImageManager methods instead.
- // Example:
- // <code>
- // CImageList listIcons;
- // listIcons.Create(16, 16, ILC_COLOR24 | ILC_MASK, 0, 1));
- // CBitmap bmp;
- // // load bitmap by id
- // bmp.LoadBitmap(IDB_BMREPORT);
- // ilIcons.Add(&bmp, RGB(255, 0, 255));
- // m_wndReport.SetImageList(&lIcons);
- // </code>
- // See Also: GetImageManager
- //-----------------------------------------------------------------------
- void SetImageList(CImageList* pImageList);
- public:
- //-----------------------------------------------------------------------
- // Summary:
- // Returns a pointer to the associated report header object.
- // Remarks:
- // Call this member function if you want to retrieve access
- // to the report header object properties and methods.
- // Returns:
- // A pointer to the associated report header.
- // See Also: CXTPReportHeader overview
- //-----------------------------------------------------------------------
- CXTPReportHeader* GetReportHeader() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to change report header of Report Control
- // Parameters:
- // pReportHeader - Report header to be set
- // Example:
- // <code>m_wndReport.SetReportHeader(new CMyReportHeader());</code>
- // See Also: CXTPReportHeader overview
- //-----------------------------------------------------------------------
- void SetReportHeader(CXTPReportHeader* pReportHeader);
- //-----------------------------------------------------------------------
- // Summary:
- // Returns indentation for the tree view row of the specified depth level.
- // Parameters:
- // nLevel - Tree depth level.
- // Remarks:
- // Calculates row indentation in pixels based on the provided
- // indentation level.
- // Returns:
- // Row indentation in pixels.
- // See Also: Populate
- //-----------------------------------------------------------------------
- int GetIndent(int nLevel) const;
- //-----------------------------------------------------------------------
- // Summary:
- // Notifies parent control of some event that has happened.
- // Parameters:
- // pRow - Specified row of event if used.
- // pItem - Specified item of event if used.
- // pColumn - Specified column of event if used.
- // nMessage - A message to sent to parent window.
- // pPoint - A point where the message was sent from in
- // client coordinates.
- // nHyperlink - Hyperlink order number, where the message was sent
- // from (-1 if message was not send from the hyperlink).
- // Remarks:
- // Sends a message to the parent in the form of a WM_NOTIFY message
- // with a specific structure attached.
- // Returns:
- // The result of the message processing;
- // its value depends on the message sent. (see CWnd::SendMessage)
- // See Also: CXTPReportControl overview, SendNotifyMessage
- //-----------------------------------------------------------------------
- LRESULT SendMessageToParent(CXTPReportRow* pRow, CXTPReportRecordItem* pItem, CXTPReportColumn* pColumn, UINT nMessage, CPoint* pPoint, int nHyperlink = -1) const;
- //-----------------------------------------------------------------------
- // Summary:
- // Sends the specified message to the window.
- // Parameters:
- // nMessage - The message to be sent.
- // pNMHDR - Notify header
- // Returns:
- // Nonzero if successful; otherwise returns zero.
- //-----------------------------------------------------------------------
- LRESULT SendNotifyMessage(UINT nMessage, NMHDR* pNMHDR = NULL) const;
- //-----------------------------------------------------------------------
- // Summary:
- // Collapses all rows.
- // Remarks:
- // The CollapseAll method collapses all the CXTPReportRow objects,
- // including all the child rows, that are in the report control.
- // See Also: ExpandAll, CXTPReportRow::SetExpanded
- //-----------------------------------------------------------------------
- void CollapseAll();
- //-----------------------------------------------------------------------
- // Summary:
- // Expands all rows.
- // Remarks:
- // The ExpandAll method expands all the CXTPReportRow objects,
- // including all the child rows, that are in the report control.
- // See Also: CollapseAll, CXTPReportRow::SetExpanded
- //-----------------------------------------------------------------------
- void ExpandAll();
- //-----------------------------------------------------------------------
- // Summary:
- // Determines if the report allows multiple selections.
- // Returns:
- // TRUE if the report allows multiple selections.
- // See Also: SetMultipleSelection, GetSelectedRows
- //-----------------------------------------------------------------------
- BOOL IsMultipleSelection() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Changes allowing multiple selections for the control.
- // Parameters:
- // bMultipleSelection - TRUE for enabling, FALSE for disabling.
- // Remarks:
- // Sets the flag that determines whether the report allows multiple selections.
- // See Also: IsMultipleSelection, GetSelectedRows
- //-----------------------------------------------------------------------
- void SetMultipleSelection(BOOL bMultipleSelection);
- //-----------------------------------------------------------------------
- // Summary:
- // Determines if the multiple selection mode is enabled.
- // Returns:
- // TRUE if the multiple selection mode is enabled.
- // See Also: SetMultiSelectionMode
- //-----------------------------------------------------------------------
- BOOL IsMultiSelectionMode() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Enables/disables the multiple selection mode for the control.
- // Parameters:
- // bMultiSelectionMode - TRUE for enabling, FALSE for disabling.
- // Remarks:
- // Sets the flag that determines whether the report is in multiple selection mode.
- // See Also: IsMultiSelectionMode
- //-----------------------------------------------------------------------
- void SetMultiSelectionMode(BOOL bMultiSelectionMode);
- //-----------------------------------------------------------------------
- // Summary:
- // Enables/disables showing tooltips for the control.
- // Parameters:
- // bEnable - TRUE for enabling, FALSE for disabling.
- // Remarks:
- // Call this member function to enable or disable tooltips
- // show for the report control window.
- //-----------------------------------------------------------------------
- void EnableToolTips(BOOL bEnable);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to specify whether groups are skipped when navigating
- // the ReportControl with the Up and Down keys.
- // Parameters:
- // bSkipFocus - If TRUE, when navigating the rows with the Up and Down
- // keys in the ReportControl the group headings will be skipped
- // and the next non-group heading row will be selected.
- // If FALSE, when navigating the rows with the Up and Down
- // keys in the ReportControlall rows will be selected,
- // even group headings.
- //-----------------------------------------------------------------------
- void SkipGroupsFocus(BOOL bSkipFocus);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine is groups are skipped when navigating the
- // with the Up and Down arrow keys.
- // Returns:
- // TRUE if groups are skipped, FALSE is groups receive focus when navigating
- // the report control with the Up and Down arrow keys.
- //-----------------------------------------------------------------------
- BOOL IsSkipGroupsFocusEnabled() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to retrieve indentation of the header
- // Returns:
- // Header indent.
- //-----------------------------------------------------------------------
- int GetHeaderIndent() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to retrieve Report bounding rectangle.
- // Returns:
- // Report bounding rectangle.
- //-----------------------------------------------------------------------
- CRect GetReportRectangle() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Adjusts scroll bars depending on currently visible rows.
- //-----------------------------------------------------------------------
- virtual void AdjustScrollBars();
- //-----------------------------------------------------------------------
- // Summary:
- // Adjusts main control areas depending on current control size.
- //-----------------------------------------------------------------------
- void AdjustLayout();
- public:
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to retrieve Header records bounding rectangle.
- // Returns:
- // Header records bounding rectangle.
- //-----------------------------------------------------------------------
- CRect GetHeaderRowsRect() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to retrieve footer rows bounding rectangle.
- // Returns:
- // Footer rows bounding rectangle.
- //-----------------------------------------------------------------------
- CRect GetFooterRowsRect() const;
- public:
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to retrieve a pointer to the currently selected column.
- // Returns:
- // A pointer to the currently selected item.
- //-----------------------------------------------------------------------
- CXTPReportColumn* GetFocusedColumn() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to set selected column.
- // Parameters:
- // pColumn - column to be selected.
- // Returns:
- // TRUE if specified column has been focused, FALSE otherwise.
- //-----------------------------------------------------------------------
- BOOL SetFocusedColumn(CXTPReportColumn* pColumn);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to specify whether each individual CXTPReportRecordItem
- // will show focus when the item in a row is clicked.
- // Parameters:
- // bFocusSubItems - If TRUE, when a ReportRecordItem is clicked, the
- // entire row will become highlighted except the individual
- // item that was clicked.
- // If FALSE, the entire row will become highlighted when
- // an item is clicked, including the item that was clicked.
- // See Also: IsFocusSubItems
- //-----------------------------------------------------------------------
- void FocusSubItems(BOOL bFocusSubItems);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine if individual CXTPReportRecordItem(s) will
- // receive focus when that item in the CXTPReportRow that they belong to is clicked.
- // Returns:
- // TRUE if individual items can receive focus, FALSE if only the entire row can receive focus.
- // See Also: FocusSubItems
- //-----------------------------------------------------------------------
- BOOL IsFocusSubItems() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine if the CXTPReportRecordItem(s)are editable.
- // Returns:
- // TRUE is the CXTPReportRecordItem(s) are editable, FALSE otherwise.
- // See Also: AllowEdit, EditOnClick, IsEditOnClick
- //-----------------------------------------------------------------------
- BOOL IsAllowEdit() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to allow the text in all CXTPReportRecordItem(s) to be edited. This will
- // add an edit box to the item where the text can be edited.
- // Parameters:
- // bAllowEdit - TRUE to add an edit box to the CXTPReportRecordItem(s) so they are editable.
- // FALSE to remove the edit box and not allow them to be edited.
- // See Also: IsAllowEdit, EditOnClick, IsEditOnClick