XTPReportControl.h
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:150k
- //-----------------------------------------------------------------------
- void AllowEdit(BOOL bAllowEdit);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to specify whether a CXTPReportRecordItem can be edited by
- // single-clicking on the item.
- // Parameters:
- // bEditOnClick - If TRUE, when the CXTPReportRecordItem is single-clicked,
- // the item will become editable. The entire ReportControl
- // or the specific CXTPReportRecordItem must have the bAllowEdit
- // property set to TRUE for this to work.
- // If FALSE, the item must be double-clicked to become editable.
- // See Also: AllowEdit, IsAllowEdit, IsEditOnClick
- //-----------------------------------------------------------------------
- void EditOnClick(BOOL bEditOnClick);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine whether items are edited with a single-click.
- // Returns:
- // TRUE it items can be edited with a single-click, FALSE is a
- // double-click is needed to edit items.
- // See Also: AllowEdit, IsAllowEdit, EditOnClick
- //-----------------------------------------------------------------------
- BOOL IsEditOnClick() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to enable auto check mode for check box items.
- // Parameters:
- // bAutoCheck - TRUE to enable auto check mode, FALSE to disable auto check mode.
- // Remarks:
- // When TRUE, the check box will become checked or unchecked automatically when the
- // user clicks on the check box.
- // See Also: IsAutoCheckItems, CXTPReportRecordItem::OnClick, CXTPReportRecordItem::OnChar
- //-----------------------------------------------------------------------
- void SetAutoCheckItems(BOOL bAutoCheck);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine id auto check mode for check box items is enabled.
- // Remarks:
- // If TRUE is returned, the check box will become checked or unchecked automatically when the
- // user clicks on the check box.
- // Returns:
- // TRUE if auto check mode is enabled, FALSE if auto check mode is disable.
- // See Also: SetAutoCheckItems, CXTPReportRecordItem::OnClick, CXTPReportRecordItem::OnChar
- //-----------------------------------------------------------------------
- BOOL IsAutoCheckItems() const;
- //-----------------------------------------------------------------------
- // Summary:
- // This method is called to start editing a report cell.
- // It makes a specified cell focused and starts in-place editing
- // control which was specified there.
- // Remarks:
- // Note that all editing options should be enabled for this method
- // to be executed successfully.
- // Parameters:
- // pItemArgs - Arguments of item to be edit.
- // Remarks:
- // Call this method with NULL as parameter to stop item edit.
- // See Also: AllowEdit, CXTPReportColumn::SetEditable
- //-----------------------------------------------------------------------
- void EditItem(XTP_REPORTRECORDITEM_ARGS* pItemArgs);
- //-----------------------------------------------------------------------
- // Summary:
- // Retrieves in-place edit pointer
- // Returns:in-place
- // Pointer to in-place edit control
- //-----------------------------------------------------------------------
- CXTPReportInplaceEdit* GetInplaceEdit() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Retrieves in-place buttons of report control
- // Returns:
- // Collection of in-place buttons.
- //-----------------------------------------------------------------------
- CXTPReportInplaceButtons* GetInplaceButtons() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Retrieves in-place list of report controls
- // Returns:
- // Pointer to in-place list.
- //-----------------------------------------------------------------------
- CXTPReportInplaceList* GetInplaceList() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine if the ReportControl has focus.
- // Returns:
- // TRUE if the ReportControl has focus, FALSE otherwise.
- //-----------------------------------------------------------------------
- BOOL HasFocus() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to retrieve the currently active item, which
- // is the item that has focus.
- // Returns:
- // A pointer to the currently active(focused) CXTPReportRecordItem.
- //-----------------------------------------------------------------------
- CXTPReportRecordItem* GetActiveItem() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to specifies the indentation placed before the
- // text of each child node in a hierarchical tree structure.
- // Parameters:
- // nIndent - Indentation used when displaying child nodes.
- //-----------------------------------------------------------------------
- void SetTreeIndent(int nIndent);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to enable virtual mode of the control
- // Parameters:
- // pVirtualRecord - record to be used as virtual for all rows.
- // nCount - Count of virtual records.
- // Example:
- // <code>
- // class CVirtualRecord : public CXTPReportRecord
- // {
- // public:
- // CVirtualRecord()
- // {
- // AddItem(new CXTPReportRecordItem());
- // AddItem(new CXTPReportRecordItem());
- // AddItem(new CXTPReportRecordItem());
- // }
- //
- // void GetItemMetrics (XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pItemMetrics)
- // {
- // // Draw virtual record
- // }
- // }
- // ...
- // m_wndReport.SetVirtualMode(new CVirtualRecord(), 540);
- // </code>
- // See Also: IsVirtualMode
- //-----------------------------------------------------------------------
- void SetVirtualMode(CXTPReportRecord* pVirtualRecord, int nCount);
- //-----------------------------------------------------------------------
- // Summary:
- // Determines if control in virtual mode
- // Returns;
- // TRUE if virtual mode is enabled; FALSE otherwise.
- // See Also: IsVirtualMode
- //-----------------------------------------------------------------------
- BOOL IsVirtualMode() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Returns the text from the associated filter edit control.
- // Returns:
- // Text string entered by user inside filter edit control.
- // See Also: SetFilterText
- //-----------------------------------------------------------------------
- virtual CString GetFilterText();
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to set new filter for control.
- // Parameters:
- // strFilterText - Filter text to be applied for control.
- // Remarks:
- // You must call Populate method to update rows.
- // See Also: GetFilterText, Populate
- //-----------------------------------------------------------------------
- virtual void SetFilterText(LPCTSTR strFilterText);
- //-----------------------------------------------------------------------
- // Summary:
- // Determine if control search filter text in hidden columns too.
- // This option is disabled by default.
- // Returns;
- // TRUE if control search filter text in hidden columns; FALSE otherwise.
- // See Also: SetFilterHiddenColumns, GetFilterText, SetFilterText
- //-----------------------------------------------------------------------
- virtual BOOL IsFilterHiddenColumns() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to enable or disable search filter text in hidden
- // columns.
- // Parameters:
- // bFilterHidden - TRUE to search filter text in hidden columns;
- // FALSE to search in visible columns only.
- // Remarks:
- // This option is disabled by default.
- // You must call Populate method to update rows.
- // See Also: IsFilterHiddenColumns, GetFilterText, SetFilterText, Populate
- //-----------------------------------------------------------------------
- virtual void SetFilterHiddenColumns(BOOL bFilterHidden);
- //-----------------------------------------------------------------------
- // Summary:
- // Register the window class if it has not already been registered.
- // Parameters:
- // hInstance - Instance of resource where control is located
- // Returns:
- // TRUE if the window class was successfully registered.
- //-----------------------------------------------------------------------
- BOOL RegisterWindowClass(HINSTANCE hInstance = NULL);
- //-----------------------------------------------------------------------
- // Summary:
- // Returns TRUE if one or more records are selected indicating the
- // Cut command can be used.
- // See Also:
- // CanPaste, Cut, Copy, Paste.
- //-----------------------------------------------------------------------
- virtual BOOL CanCut();
- //-----------------------------------------------------------------------
- // Summary:
- // Returns TRUE if one or more records are selected indicating the
- // Copy command can be used.
- // See Also:
- // CanPaste, Cut, Copy, Paste.
- //-----------------------------------------------------------------------
- virtual BOOL CanCopy();
- //-----------------------------------------------------------------------
- // Summary:
- // Returns TRUE if BinaryRecords or Text data exists in the clipboard.
- // See Also:
- // CanCut, CanCopy, Cut, Copy, Paste.
- //-----------------------------------------------------------------------
- virtual BOOL CanPaste();
- //-----------------------------------------------------------------------
- // Summary:
- // Copy selected records data (in the Binary and Text data formats) to
- // the clipboard and delete records.
- // See Also:
- // CanCut, CanCopy, CanPaste, Copy, Paste,
- // OnBeforeCopyToText, OnBeforePasteFromText, OnBeforePaste.
- //-----------------------------------------------------------------------
- virtual void Cut();
- //-----------------------------------------------------------------------
- // Summary:
- // Copy selected records data (in the Binary and Text data formats) to
- // the clipboard.
- // See Also:
- // CanCut, CanCopy, CanPaste, Cut, Paste,
- // OnBeforeCopyToText, OnBeforePasteFromText, OnBeforePaste.
- //-----------------------------------------------------------------------
- virtual void Copy();
- //-----------------------------------------------------------------------
- // Summary:
- // Reads records from the clipboard and add them to records collection.
- // The Binary data format is used rather than Text format.
- // See Also:
- // CanCut, CanCopy, CanPaste, Cut, Copy,
- // OnBeforeCopyToText, OnBeforePasteFromText, OnBeforePaste.
- //-----------------------------------------------------------------------
- virtual void Paste();
- //-----------------------------------------------------------------------
- // Summary:
- // Returns TRUE if inplace edit control is active (visible and focused),
- // FALSE otherwise.
- // See Also:
- // GetInplaceEdit.
- //-----------------------------------------------------------------------
- virtual BOOL IsEditMode();
- //-----------------------------------------------------------------------
- // Summary:
- // Set compare function to sort.
- // Parameters:
- // pCompareFunc - A T_CompareFunc function pointer that is used
- // to compare rows or NULL to use the default one.
- // Remarks:
- // This method uses Visual C++ run-time library (MSVCRT)
- // implementation of the quick-sort function, qsort, for sorting
- // stored CXTPReportRow objects.
- // If pCompareFunc = NULL the default compare function is used.
- // Call Populate() method to resort items.
- //
- // See Also:
- // SortRows, CXTPReportRows::SortEx, CXTPReportRows::Sort,
- // CXTPReportRows::T_CompareFunc
- //-----------------------------------------------------------------------
- virtual void SetRowsCompareFunc(CXTPReportRows::T_CompareFunc pCompareFunc);
- //-----------------------------------------------------------------------
- // Summary:
- // Use this function to determine is sort order applied for record children.
- // Returns:
- // TRUE if sort order applied for record children, FALSE otherwise.
- //-----------------------------------------------------------------------
- virtual BOOL IsSortRecordChilds();
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to apply sort order for record children
- // Parameters:
- // bSortRecordChilds - TRUE to sort record children.
- //-----------------------------------------------------------------------
- virtual void SetSortRecordChilds(BOOL bSortRecordChilds);
- //-----------------------------------------------------------------------
- // Summary:
- // Use this function to get horizontal scrolling step.
- // Returns:
- // Horizontal scrolling step in pixels.
- //-----------------------------------------------------------------------
- virtual int GetHScrollStep();
- //-----------------------------------------------------------------------
- // Summary:
- // Use this function to set horizontal scrolling step.
- // Parameters:
- // nStep - Horizontal scrolling step in pixels.
- //-----------------------------------------------------------------------
- virtual void SetHScrollStep(int nStep);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to allow the text in all CXTPReportRecordItem(s) to be edited (for header records only).
- // 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: IsHeaderRowsAllowEdit, EditOnClick, IsEditOnClick
- //-----------------------------------------------------------------------
- void HeaderRowsAllowEdit(BOOL bAllowEdit);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to allow the text in all CXTPReportRecordItem(s) to be edited (for footer records only).
- // 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: IsFooterRowsAllowEdit, EditOnClick, IsEditOnClick
- //-----------------------------------------------------------------------
- void FooterRowsAllowEdit(BOOL bAllowEdit);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine if the CXTPReportRecordItem(s) are editable (for header records only).
- // Returns:
- // TRUE is the CXTPReportRecordItem(s) are editable, FALSE otherwise.
- // See Also: HeaderRowsAllowEdit, EditOnClick, IsEditOnClick
- //-----------------------------------------------------------------------
- BOOL IsHeaderRowsAllowEdit() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine if the CXTPReportRecordItem(s) are editable (for footer records only).
- // Returns:
- // TRUE is the CXTPReportRecordItem(s) are editable, FALSE otherwise.
- // See Also: FooterRowsAllowEdit, EditOnClick, IsEditOnClick
- //-----------------------------------------------------------------------
- BOOL IsFooterRowsAllowEdit() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine if rows selection is enabled.
- // Returns:
- // TRUE if rows selection is enabled, FALSE otherwise.
- // See Also: SelectionEnable
- //-----------------------------------------------------------------------
- BOOL IsSelectionEnabled() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to enable rows selection.
- // Parameters:
- // bEnable - TRUE to enable rows selection.
- // FALSE to disable rows selection.
- // See Also: IsSelectionEnabled
- //-----------------------------------------------------------------------
- void SelectionEnable(BOOL bEnable);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine if the row focus is visible.
- // Returns:
- // TRUE if the the row focus is visible, FALSE otherwise.
- // See Also: ShowRowFocus
- //-----------------------------------------------------------------------
- BOOL IsRowFocusVisible() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to enable showing the row focus.
- // Parameters:
- // bEnable - TRUE to enable showing the row focus.
- // FALSE to disable showing the row focus.
- // See Also: IsRowFocusVisible
- //-----------------------------------------------------------------------
- void ShowRowFocus(BOOL bShow);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to allow user moving the selection to header rows.
- // Parameters:
- // bAllowAccess - TRUE - selection of header rows is allowed, FALSE otherwise.
- // See Also: IsHeaderRowsAllowAccess
- //-----------------------------------------------------------------------
- void HeaderRowsAllowAccess(BOOL bAllowAccess);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to allow user moving the selection to footer rows.
- // Parameters:
- // bAllowAccess - TRUE - selection of footer rows is allowed, FALSE otherwise.
- // See Also: IsFooterRowsAllowAccess
- //-----------------------------------------------------------------------
- void FooterRowsAllowAccess(BOOL bAllowAccess);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine if user can move selection to header rows.
- // Returns:
- // TRUE if user can move selection to header rows, FALSE otherwise.
- // See Also: HeaderRowsAllowAccess.
- //-----------------------------------------------------------------------
- BOOL IsHeaderRowsAllowAccess() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine if user can move selection to footer rows.
- // Returns:
- // TRUE if user can move selection to footer rows, FALSE otherwise.
- // See Also: FooterRowsAllowAccess.
- //-----------------------------------------------------------------------
- BOOL IsFooterRowsAllowAccess() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to enable selection in header rows.
- // Parameters:
- // bEnable - TRUE - selection of header rows is enabled, FALSE otherwise.
- // See Also: IsHeaderRowsSelectionEnabled
- //-----------------------------------------------------------------------
- void HeaderRowsEnableSelection(BOOL bEnable);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine if selection in header rows is enabled.
- // Returns:
- // TRUE if selection in header rows is enabled, FALSE otherwise.
- // See Also: HeaderRowsEnableSelection.
- //-----------------------------------------------------------------------
- BOOL IsHeaderRowsSelectionEnabled() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to enable selection in footer rows.
- // Parameters:
- // bEnable - TRUE - selection of footer rows is enabled, FALSE otherwise.
- // See Also: IsFooterRowsSelectionEnabled
- //-----------------------------------------------------------------------
- void FooterRowsEnableSelection(BOOL bEnable);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine if selection in footer rows is enabled.
- // Returns:
- // TRUE if selection in footer rows is enabled, FALSE otherwise.
- // See Also: FooterRowsEnableSelection.
- //-----------------------------------------------------------------------
- BOOL IsFooterRowsSelectionEnabled() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to determine current watermark alignment flags.
- // Returns:
- // Current watermark alignment.
- // See Also: XTPReportWatermarkAlignment, SetWatermarkAlignment.
- //-----------------------------------------------------------------------
- int GetWatermarkAlignment() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Call this member to set watermark alignment flags.
- // Parameters:
- // nWatermarkAlignment - watermark alignment flags.
- // See Also: XTPReportWatermarkAlignment, GetWatermarkAlignment.
- //-----------------------------------------------------------------------
- void SetWatermarkAlignment(int nWatermarkAlignment);
- protected:
- //-----------------------------------------------------------------------
- // Summary:
- // Sets new operational control mouse mode.
- // Parameters:
- // nMode - New mouse mode. For available values, see XTPReportMouseMode enum.
- // See Also: XTPReportMouseMode overview, GetMouseMode
- //-----------------------------------------------------------------------
- void SetMouseMode(XTPReportMouseMode nMode);
- //-----------------------------------------------------------------------
- // Summary:
- // Returns the current control mouse mode.
- // Returns:
- // Current control mouse mode.
- // For available values, see XTPReportMouseMode enum.
- // See Also: XTPReportMouseMode overview, SetMouseMode
- //-----------------------------------------------------------------------
- XTPReportMouseMode GetMouseMode() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Performs all drawing logic.
- // Parameters:
- // pDC - Provided DC to draw control image with.
- //-----------------------------------------------------------------------
- virtual void OnDraw(CDC* pDC);
- //-----------------------------------------------------------------------
- // Summary:
- // Draws all rows on the provided DC.
- // Parameters:
- // pDC - Provided DC to draw rows image with.
- // rcClient - A rectangle to draw rows image into.
- //-----------------------------------------------------------------------
- virtual void DrawRows(CDC* pDC, CRect& rcClient);
- //-----------------------------------------------------------------------
- // Summary:
- // Draws 'NoItems' text on the provided DC.
- // Parameters:
- // pDC - Provided DC to draw text.
- // rcClient - A rectangle to draw text into.
- //-----------------------------------------------------------------------
- virtual void DrawNoItems(CDC* pDC, const CRect& rcClient);
- //-----------------------------------------------------------------------
- // Summary:
- // Returns changed status flag of the control. Used for caching control image drawing.
- // Returns:
- // TRUE if the internal control state was changed since last drawing, FALSE otherwise.
- //-----------------------------------------------------------------------
- BOOL IsChanged() const;
- //-----------------------------------------------------------------------
- // Summary:
- // Sets new changed status flag for the control. Used for caching control image drawing.
- // Parameters:
- // bChanged - TRUE when something was changed in the control contents and control needs to be republished.
- //-----------------------------------------------------------------------
- void SetChanged(BOOL bChanged = TRUE);
- //-----------------------------------------------------------------------
- // Summary:
- // Sorts rows corresponding to the sort order taken from columns.
- // Parameters:
- // pRows - A rows collection to sort.
- //-----------------------------------------------------------------------
- virtual void SortRows(CXTPReportRows* pRows);
- //-----------------------------------------------------------------------
- // Summary:
- // Sorts rows tree corresponding to the sort order taken from columns.
- // Parameters:
- // pTree - A rows tree collection to sort.
- //-----------------------------------------------------------------------
- virtual void SortTree(CXTPReportRows* pTree);
- //-----------------------------------------------------------------------
- // Summary:
- // ReSorts rows tree corresponding to the sort order taken from columns.
- // Works faster than Populate.
- //-----------------------------------------------------------------------
- virtual void ReSortRows();
- //-----------------------------------------------------------------------
- // Summary:
- // Update field chooser control with its content.
- //-----------------------------------------------------------------------
- void UpdateSubList();
- //-----------------------------------------------------------------------
- // Summary:
- // Builds rows tree based on provided data record.
- // Parameters:
- // pTree - Rows tree to add items into.
- // pParentRow - Parent tree row.
- // pRecords - Records collection for transferring to rows.
- // Remarks:
- // Builds rows tree based on provided data record.
- // Recursively calls itself when build nested branches of rows
- //-----------------------------------------------------------------------
- virtual void BuildTree(CXTPReportRows* pTree, CXTPReportRow* pParentRow, CXTPReportRecords* pRecords);
- //-----------------------------------------------------------------------
- // Summary:
- // Collapses all children of the specified row.
- // Parameters:
- // pRow - A row to collapse.
- //-----------------------------------------------------------------------
- virtual void _DoCollapse(CXTPReportRow* pRow);
- //-----------------------------------------------------------------------
- // Summary:
- // Expands all children of the specified row.
- // Parameters:
- // nIndex - An index to insert rows from.
- // pRow - A row to expand.
- // Returns:
- // A count of the newly added rows or void.
- //-----------------------------------------------------------------------
- virtual int _DoExpand(int nIndex, CXTPReportRow* pRow);
- virtual void _DoExpand(CXTPReportRow* pRow); // <COMBINE CXTPReportControl::_DoExpand@int@CXTPReportRow*>
- //-----------------------------------------------------------------------
- // Summary:
- // Inserts the specified row at the specified position.
- // Parameters:
- // nIndex - A position to insert row at.
- // pRow - A row to insert.
- // Remarks:
- // Inserts the specified row to the rows array at the specified position
- // with all its children expanded. Use _DoExpand() to expand
- // all child items
- // Returns:
- // A number of the inserted rows.
- //-----------------------------------------------------------------------
- virtual int InsertRow(int nIndex, CXTPReportRow* pRow);
- //-----------------------------------------------------------------------
- // Summary:
- // Recalculates indexes of all rows.
- // Parameters:
- // bAdjustLayout - If TRUE, layout is adjusted.
- // bReverseOrder - If TRUE, row indices are updated in reverse order, starting from the last row.
- //-----------------------------------------------------------------------
- virtual void RefreshIndexes(BOOL bAdjustLayout = TRUE, BOOL bReverseOrder = FALSE);
- virtual void _RefreshIndexes(BOOL bAdjustLayout = TRUE, BOOL bReverseOrder = FALSE);
- //-----------------------------------------------------------------------
- // Summary:
- // Checks a record for filter text.
- // Parameters:
- // pRecord - A record to apply filter to.
- // strFilterText - Filter string text.
- // bIncludePreview - Include preview item in filtering or not.
- // Remarks:
- // This member function represents filter functionality. First, it parses
- // the input text of a filter string by tokens; second it enumerates all visible
- // columns to find text matching to the filter string. Returns TRUE if
- // matching found, FALSE otherwise
- // Returns:
- // TRUE if record is filtered with the specified filter,
- // FALSE otherwise.
- //-----------------------------------------------------------------------
- virtual BOOL ApplyFilter(CXTPReportRecord* pRecord, CString strFilterText, BOOL bIncludePreview);
- //-----------------------------------------------------------------------
- // Summary:
- // This member function is called after a user selects a row or a column
- // Remarks:
- // After user selects row or column, ReportControl sends notification to the
- // parent window by calling OnSelectionChanged()
- // See Also: XTP_NM_REPORT_SELCHANGED, SendNotifyMessage()
- //-----------------------------------------------------------------------
- virtual void OnSelectionChanged();
- //-----------------------------------------------------------------------
- // Summary:
- // This member function is called before the focus change
- // Parameters:
- // pNewRow - A pointer to row object which been focused;
- // pNewCol - A pointer to column object which been focused;
- // Remarks:
- // Before user changes focused row or column, ReportControl sends notification to the
- // parent window by calling OnFocusChanging()
- // Returns:
- // Returns True if selection changing is OK, False if selection is to be
- // canceled.
- // See Also: XTP_NM_REPORT_FOCUS_CHANGING, SendNotifyMessage(), OnFocusChanged
- //-----------------------------------------------------------------------
- virtual BOOL OnFocusChanging(CXTPReportRow* pNewRow, CXTPReportColumn* pNewCol);
- //-----------------------------------------------------------------------
- // Summary:
- // Returns drawing metrics for the row.
- // Parameters:
- // pDrawArgs - Pointer to the provided draw arguments structure for calculating metrics.
- // pItemMetrics - Pointer to the metrics structure to fill.
- //-----------------------------------------------------------------------
- virtual void GetItemMetrics(XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pItemMetrics);
- //-----------------------------------------------------------------------
- // Summary:
- // This method is called to create new CXTPReportRow object. Overwrite it
- // to use derived CXTPReportRow class.
- // Returns:
- // New CXTPReportRow object.
- //-----------------------------------------------------------------------
- virtual CXTPReportRow* CreateRow();
- //-----------------------------------------------------------------------
- // Summary:
- // This method is called to create new CXTPReportGroupRow object. Overwrite it
- // to use derived CXTPReportGroupRow class.
- // Returns:
- // New CXTPReportGroupRow object.
- //-----------------------------------------------------------------------
- virtual CXTPReportGroupRow* CreateGroupRow();
- //-----------------------------------------------------------------------
- // Summary:
- // This method is called to create new CXTPReportRow object for
- // header/footer rows. Overwrite it to use derived CXTPReportRow class.
- // Returns:
- // New CXTPReportRow object.
- //-----------------------------------------------------------------------
- virtual CXTPReportRow* CreateHeaderFooterRow();
- //-----------------------------------------------------------------------
- // Summary:
- // This method is called when user start drag row
- // Parameters:
- // point - Drag point
- // Remarks:
- // Use can override this method or catch LVN_BEGINDRAG message to proceed drag
- // operations.
- //-----------------------------------------------------------------------
- virtual void OnBeginDrag(CPoint point);
- //-----------------------------------------------------------------------
- // Summary:
- // This method is called before add record text data to the clipboard.
- // Parameters:
- // pRecord - [in] A pointer to source record;
- // rarStrings - [in/out] Reference to strings array with record items
- // values. By default this array contains visible items
- // captions.
- // Remarks:
- // If you would like to customize text data for the clipboard you can
- // change rarStrings as you need.
- //
- // Default implementation sends XTP_NM_REPORT_BEFORE_COPY_TOTEXT
- // notification.
- // Returns:
- // TRUE to cancel copying this record to the clipboard in text format,
- // FALSE to continue.
- // See Also:
- // OnBeforePasteFromText, OnBeforePaste, Cut, Copy, Paste.
- //-----------------------------------------------------------------------
- virtual BOOL OnBeforeCopyToText(CXTPReportRecord* pRecord, CStringArray& rarStrings);
- //-----------------------------------------------------------------------
- // Summary:
- // This method is called before creating new record using text data
- // from the clipboard.
- // Parameters:
- // arStrings - [in] Strings array with record items values.
- // ppRecord - [out] A pointer to new record pointer;
- // Remarks:
- // If you would like to customize creating new record from text data
- // you have to create new record object with record items and fill
- // them using default values and strings provided in arStrings parameter.
- //
- // If new record will not be set to ppRecord parameter, control will
- // create CXTPReportRecord object with
- // CXTPReportRecordItemVariant items and fill visible items using
- // strings provided in arStrings parameter.
- //
- // Default implementation sends XTP_NM_REPORT_BEFORE_PASTE_FROMTEXT
- // notification.
- // Returns:
- // TRUE to cancel adding this record, FALSE to continue.
- // See Also:
- // OnBeforeCopyToText, OnBeforePaste, Cut, Copy, Paste.
- //-----------------------------------------------------------------------
- virtual BOOL OnBeforePasteFromText(CStringArray& arStrings, CXTPReportRecord** ppRecord);
- //-----------------------------------------------------------------------
- // Summary:
- // This method is called after creating new record using binary data
- // from the clipboard, but before add it to records collection.
- // Parameters:
- // ppRecord - [in/out] A pointer to new record pointer;
- // Remarks:
- // If you would like to customize new record created from binary data
- // you may to create new or change provided record using
- // ppRecord parameter.
- //
- // Default implementation sends XTP_NM_REPORT_BEFORE_PASTE
- // notification.
- // Returns:
- // TRUE to cancel adding this record, FALSE to continue.
- // See Also:
- // OnBeforeCopyToText, OnBeforePasteFromText, Cut, Copy, Paste.
- //-----------------------------------------------------------------------
- virtual BOOL OnBeforePaste(CXTPReportRecord** ppRecord);
- //-----------------------------------------------------------------------
- // Summary:
- // This method is called before processing OnKeyDown event.
- // Parameters:
- // rnChar - [in/out] A reference to variable which specifies
- // the virtual key code of the given key. For a list of
- // of standard virtual key codes, see Winuser.h.
- // nRepCnt - [in] Repeat count (the number of times the keystroke
- // is repeated as a result of the user holding down the key).
- // nFlags - [in] Specifies the scan code, key-transition code,
- // previous key state, and context code.
- // Remarks:
- // If you would like to customize keyboard behavior you can change
- // rnChar parameter value or perform your logic and return FALSE to
- // disable default processing.
- //
- // Default implementation sends XTP_NM_REPORT_PREVIEWKEYDOWN
- // notification.
- // Returns:
- // TRUE to continue processing key, FALSE to cancel.
- // See Also:
- // OnKeyDown, CWnd::OnKeyDown, XTP_NM_REPORT_PREVIEWKEYDOWN.
- //-----------------------------------------------------------------------
- virtual BOOL OnPreviewKeyDown(UINT& rnChar, UINT nRepCnt, UINT nFlags);
- //-----------------------------------------------------------------------
- // Summary:
- // This method is used by the report control to calculate BestFit
- // column width.
- // Parameters:
- // pColumn - Pointer to a column for width calculation.
- // Returns:
- // BestFit column width (or zero).
- //-----------------------------------------------------------------------
- virtual int OnGetColumnDataBestFitWidth(CXTPReportColumn* pColumn);
- //-----------------------------------------------------------------------
- // Summary:
- // This method is used by the report control to calculate items
- // captions maximum width.
- // Parameters:
- // pDC - Pointer to a compatible CDC object.
- // pRows - Pointer to a rows collection.
- // pColumn - Pointer to a column for width calculation.
- // Returns:
- // Items captions maximum width.
- //-----------------------------------------------------------------------
- virtual int OnGetItemsCaptionMaxWidth(CDC* pDC, CXTPReportRows* pRows,
- CXTPReportColumn* pColumn);
- //-----------------------------------------------------------------------
- // Summary:
- // This method is used to enable monitoring mouse position for automatic
- // vertical scrolling.
- // Remarks:
- // Used when dragging records.
- // See Also:
- // EnsureStopAutoVertScroll, DoAutoVertScrollIfNeed
- //-----------------------------------------------------------------------
- virtual void EnsureStartAutoVertScroll();
- //-----------------------------------------------------------------------
- // Summary:
- // This method is used to stop monitoring mouse position for automatic
- // vertical scrolling.
- // Remarks:
- // Used when dragging records.
- // See Also:
- // EnsureStartAutoVertScroll, DoAutoVertScrollIfNeed
- //-----------------------------------------------------------------------
- virtual void EnsureStopAutoVertScroll();
- //-----------------------------------------------------------------------
- // Summary:
- // This method is used to monitoring mouse position. If mouse
- // will be moved to 20 pixels before top or before bottom report borders
- // the control will be scrolled vertically.
- // Parameters:
- // ptClick - Coordinates of initial click (or mouse down).
- // pt - Current mouse position.
- // Remarks:
- // Used when dragging records.
- // See Also:
- // EnsureStartAutoVertScroll, EnsureStopAutoVertScroll
- //-----------------------------------------------------------------------
- virtual void DoAutoVertScrollIfNeed(CPoint ptClick, CPoint pt);
- //-----------------------------------------------------------------------
- // Summary:
- // Draws fixed rows on the provided DC.
- // Parameters:
- // pDC - Provided DC to draw header rows image with.
- // rcClient - A rectangle to draw header rows image into.
- // pRows - Pointer to header/footer record rows.
- //-----------------------------------------------------------------------
- virtual void DrawFixedRows(CDC* pDC, CRect& rcClient, CXTPReportRows* pRows);
- //-----------------------------------------------------------------------
- // Summary:
- // Returns calculated rows height.
- // Parameters:
- // pDC - Pointer to the used Device Context.
- // nTotalWidth - Width of the row
- // nMaxHeight - The maximum rows height to stop calculation.
- // Set this parameter as -1 to calculate all rows height.
- // Returns:
- // The height of the default rectangle where row's items will draw.
- // Example:
- // <code>int nHeaderRowsHeight = GetRowHeight(pDC, pRow)</code>
- //-----------------------------------------------------------------------
- virtual int GetRowsHeight(CXTPReportRows* pRows, int nTotalWidth, int nMaxHeight = -1);
- //-----------------------------------------------------------------------
- // Summary:
- // Returns header divider height.
- // Parameters:
- // pDC - Pointer to the used Device Context.
- // Returns:
- // The height of the header divider, depending on the chosen header divider style.
- // See Also:
- // XTPReportFixedRowsDividerStyle in XTPReportPaintManager.h
- //-----------------------------------------------------------------------
- virtual int GetHeaderRowsDividerHeight();
- //-----------------------------------------------------------------------
- // Summary:
- // Returns footer divider height.
- // Parameters:
- // pDC - Pointer to the used Device Context.
- // Returns:
- // The height of the header divider, depending on the chosen footer divider style.
- // See Also:
- // XTPReportFixedRowsDividerStyle in XTPReportPaintManager.h
- //-----------------------------------------------------------------------
- virtual int GetFooterRowsDividerHeight();
- //-----------------------------------------------------------------------
- // Summary:
- // Sets a watermark bitmap to be shown in the report control background.
- // Parameters:
- // hBitmap - bitmap handle.
- // szPath - path to bitmap file.
- // Transparency - transparency value.
- // Returns:
- // TRUE if watermark bitmap successfully added or removed, FALSE otherwise.
- //-----------------------------------------------------------------------
- virtual BOOL SetWatermarkBitmap(HBITMAP hBitmap, BYTE Transparency);
- virtual BOOL SetWatermarkBitmap(LPCTSTR szPath, BYTE Transparency); //<COMBINE SetWatermarkBitmap@HBITMAP@BYTE>
- //-----------------------------------------------------------------------
- // Summary:
- // Draws fixed rows divider on the provided DC.
- // Parameters:
- // pDC - Provided DC to draw fixed rows divider image with.
- // rcClient - A rectangle to draw fixed rows divider into.
- // bHeaderRows - TRUE if the divider is under header rows; FALSE - if above footer rows.
- //-----------------------------------------------------------------------
- void DrawFixedRecordsDivider(CDC* pDC, CRect& rcClient, BOOL bHeaderRows);
- //-----------------------------------------------------------------------
- // Summary:
- // This method is used to notify about changing constraint selection.
- // Parameters:
- // pRow - A pointer to current row object;
- // pItem - A pointer to current record item object;
- // pColumn - A pointer to current column object;
- // pConstraint - A pointer to hot selected constraint;
- // Remarks:
- // Send for every selection change before new selection applied or canceled.
- // Returns:
- // TRUE if notification successfully sent, FALSE otherwise.
- //-----------------------------------------------------------------------
- virtual BOOL OnConstraintSelecting(CXTPReportRow* pRow, CXTPReportRecordItem* pItem, CXTPReportColumn* pColumn,
- CXTPReportRecordItemConstraint* pConstraint);
- //-----------------------------------------------------------------------
- // Summary:
- // This method is used to notify about changing constraint selection.
- // Parameters:
- // pRow - A pointer to current row object;
- // pItem - A pointer to current record item object;
- // rstrToolTipText - A reference to CString object to customize tool tip
- // text. It contains default tool tip text;
- // Remarks:
- // If rstrToolTipText set to empty - the default tool tip will be shown
- // when not enough space to draw item text.
- // If rstrToolTipText set to single space (" ") no tool tip will be shown.
- // Returns:
- // A reference to XTP_NM_REPORTTOOLTIPINFO structure.
- //-----------------------------------------------------------------------
- virtual const XTP_NM_REPORTTOOLTIPINFO& OnGetToolTipInfo(CXTPReportRow* pRow, CXTPReportRecordItem* pItem, CString& rstrToolTipText);
- //-----------------------------------------------------------------------
- // Summary:
- // Call this method to retrieve report element rectangle.
- // Returns:
- // Report element rectangle.
- //-----------------------------------------------------------------------
- CRect GetElementRect(int nElement) const;
- protected:
- //{{AFX_CODEJOCK_PRIVATE
- virtual CString _GetSelectedRowsVisibleColsText();
- BOOL _GetSelectedRows(CXTPReportRecords* pRecords, CXTPInternalCollectionT<CXTPReportRow> * pRows = NULL);
- void _SelectRows(CXTPReportRecords* pRecords);
- virtual BOOL _ReadRecodsFromText(LPCTSTR pcszText, CXTPReportRecords& rarRecords);
- virtual CXTPReportRecord* _CreateRecodFromText(LPCTSTR pcszRecord);
- virtual BOOL _WriteSelectedRowsData(CXTPPropExchange* pPX);
- virtual BOOL _ReadRecodsFromData(CXTPPropExchange* pPX, CXTPReportRecords& rarRecords);
- BOOL _WriteRecordsData(CXTPPropExchange* pPX, CXTPReportRecords* pRecords);
- virtual void DrawDropMarker(CDC* pDC);
- //}}AFX_CODEJOCK_PRIVATE
- protected:
- //-----------------------------------------------------------------------
- // Summary:
- // Adjust control indentation properties depending on current tree depth.
- // See Also: GetIndent
- //-----------------------------------------------------------------------
- void AdjustIndentation();
- protected:
- //-----------------------------------------------------------------------
- // Summary:
- // This member is called when an item is dragged over the report control.
- // Parameters:
- // pDataObject - Points to the COleDataObject being dragged over the
- // drop target.
- // dwKeyState - State of keys on keyboard. Contains the state of the
- // modifier keys. This is a combination of any number of
- // the following: MK_CONTROL, MK_SHIFT, MK_ALT, MK_LBUTTON,
- // MK_MBUTTON, and MK_RBUTTON.
- // point - The current mouse position relative to the report control.
- // nState - The transition state (0 - enter, 1 - leave, 2 - over).
- // Returns:
- // A value from the DROPEFFECT enumerated type, which indicates the type
- // of drop that would occur if the user dropped the object at this
- // position. The type of drop often depends on the current key state as
- // indicated by dwKeyState. A standard mapping of keystates to DROPEFFECT
- // values is:
- // * <b>DROPEFFECT_NONE</b> The data object cannot be dropped in this
- // window.
- // * <b>DROPEFFECT_COPY</b> for <b>MK_CONTROL</b> Creates a copy of
- // the dropped object.
- // * <b>DROPEFFECT_MOVE</b> for <b>MK_ALT</b> Creates a copy of the dropped
- // object and delete the original object.
- // This is typically the default drop effect,
- // when the view can accept the data object.
- //-----------------------------------------------------------------------
- virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point, int nState);
- //-----------------------------------------------------------------------
- // Summary:
- // This member is called when an item has been dropped into the report control.
- // Parameters:
- // pDataObject - Points to the COleDataObject that is dropped into the drop target.
- // dropEffect - The drop effect that the user has requested. Can be any of the values listed in the Remarks section.
- // point - The current mouse position relative to the report control.
- // Remarks:
- // The <i>dropEffect</i> parameter can be one of the following values:
- // * <b>DROPEFFECT_COPY</b> Creates a copy of the data object being dropped.
- // * <b>DROPEFFECT_MOVE</b> Moves the data object to the current mouse location.
- // Returns:
- // TRUE if the drop was successful, otherwise FALSE.
- //-----------------------------------------------------------------------
- virtual BOOL OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point);
- protected:
- //{{AFX_CODEJOCK_PRIVATE
- DECLARE_MESSAGE_MAP()
- //{{AFX_VIRTUAL(CXTPReportControl)
- virtual BOOL PreTranslateMessage(MSG* pMsg);
- virtual BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult);
- virtual INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
- virtual CScrollBar* GetScrollBarCtrl(int nBar) const;
- //{{AFX_VIRTUAL(CXTPReportControl)
- //{{AFX_MSG(CXTPReportControl)
- afx_msg void OnPaint();
- afx_msg LRESULT OnPrintClient(WPARAM wParam, LPARAM /*lParam*/);
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
- afx_msg void OnContextMenu(CWnd* pWnd, CPoint pos);
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
- afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) ;
- afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
- afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
- afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnLButtonDblClk(UINT nFlags, CPoint ptDblClick);
- afx_msg void OnCaptureChanged(CWnd* pWnd);
- afx_msg void OnSysColorChange();
- afx_msg void OnSetFocus(CWnd* pOldWnd);
- afx_msg void OnKillFocus (CWnd* pNewWnd);
- afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnSysKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg UINT OnGetDlgCode();
- afx_msg void OnChar(UINT nChar, UINT nRepCntr, UINT nFlags);
- afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
- afx_msg void OnMouseLeave();
- afx_msg void OnStyleChanged(int nStyleType, LPSTYLESTRUCT lpStyleStruct);
- afx_msg void OnEnable(BOOL bEnable);
- afx_msg void OnTimer(UINT_PTR uTimerID);
- //}}AFX_MSG
- //}}AFX_CODEJOCK_PRIVATE
- //{{AFX_CODEJOCK_PRIVATE
- static UINT AFX_CDECL GetMouseScrollLines();
- virtual void RelayToolTipEvent(UINT message);
- virtual CXTPReportColumn* GetNextFocusableColumn(CXTPReportRow* pRow, int nColumnIndex, int nDirection);
- //}}AFX_CODEJOCK_PRIVATE
- private:
- BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
- void DrawDefaultGrid(CDC* pDC, CRect rcClient, int nRowHeight, int nLeftOffset);
- protected:
- BOOL m_bChanged; // Internal member for storing changed flag.
- BOOL m_bRefreshIndexes; // TRUE when it is required to refresh items indexes.
- int m_nLockUpdateCount; // A counter of the update locks. An image will be redrawn only when the lock counter is equal to zero.
- CRect m_rcGroupByArea; // The area occupied by Group By item.
- CRect m_rcHeaderArea; // The area occupied by the header.
- CRect m_rcFooterArea; // The area occupied by the footer.
- CRect m_rcReportArea; // The area occupied by rows.
- CRect m_rcHeaderRecordsArea; // The area occupied by the header records.
- CRect m_rcFooterRecordsArea; // The area occupied by the footer records.
- CRect m_rcHeaderRecordsDividerArea; // The area occupied by the header records divider.
- CRect m_rcFooterRecordsDividerArea; // The area occupied by the footer records divider.
- CXTPReportRows* m_pRows; // Virtual list rows container. Used for changing order, etc.
- CXTPReportRows* m_pPlainTree; // Tree rows container.
- CXTPReportRecords* m_pRecords; // List records container.
- CXTPReportColumns* m_pColumns; // List columns container.
- CXTPReportRecords* m_pHeaderRecords; // Header records container.
- CXTPReportRecords* m_pFooterRecords; // Footer records container.
- CXTPReportRows* m_pHeaderRows; // Virtual list of header rows container.
- CXTPReportRows* m_pFooterRows; // Virtual list of footer rows container.
- CXTPReportPaintManager* m_pPaintManager; // Paint manager.
- CXTPReportNavigator* m_pNavigator; // Navigator
- int m_nTopRow; // Current top row in the visible area.
- int m_nLeftOffset; // Horizontal scroll position.
- int m_nFreezeColumnsCount; // Count of none-scrolled columns at the left side.
- int m_nDisableReorderColumnsCount; // Count of columns at the left side where reordering is disabled.
- int m_nHScrollStep; // Horizontal scroll step (in pixels).
- BOOL m_bFullColumnScrolling; // Store Full Column Scrolling mode for horizontal scrolling.
- int m_nFocusedRow; // Pointer to the currently focused row.
- int m_nFocusedHeaderRow; // Pointer to the currently focused header row.
- int m_nFocusedFooterRow; // Pointer to the currently focused footer row.
- CXTPReportSelectedRows* m_pSelectedRows; // Container for the currently selected rows.
- CXTPReportRow* m_pHotRow; // Hot row
- int m_nRowsPerWheel; // Amount of rows to scroll by mouse wheel.
- CXTPReportTip m_wndTip; // Tip window.
- CBitmap m_bmpCache; // Cached window bitmap.
- BOOL m_bGroupByEnabled; // TRUE if Group By box is enabled
- BOOL m_bSortRecordChilds; // TRUE to apply sort order for Record children.
- XTPReportMouseMode m_mouseMode; // Current mouse operation mode
- BOOL m_bMultipleSelection; // TRUE if multiple selection enabled.
- BOOL m_bMultiSelectionMode; // TRUE if multiselection mode enabled (i.e. VK_CTRL is always on).
- BOOL m_bShowTooltips; // TRUE if showing tool tips enabled.
- BOOL m_bAutoCheckItems; // TRUE to enable auto check mode, FALSE to disable auto check mode.
- CXTPImageManager* m_pImageManager; // Contains image list for report control
- BOOL m_bSkipGroupsFocus; // TRUE if group rows are skipped when navigating rows with the Up and Down arrow keys
- BOOL m_bFocusSubItems; // TRUE if sub-items can receive focus.
- BOOL m_bEditOnClick; // TRUE if sub-items become editable on a single-click
- BOOL m_bAllowEdit; // TRUE if sub-items can be edited.
- BOOL m_bHeaderAllowEdit; // TRUE if sub-items of header rows can be edited.
- BOOL m_bFooterAllowEdit; // TRUE if sub-items of footer rows can be edited.
- BOOL m_bHeaderVisible; // TRUE if column headers are visible.
- BOOL m_bFooterVisible; // TRUE if column footer are visible.
- BOOL m_bHeaderRecordsVisible; // TRUE if header records are visible.
- BOOL m_bFooterRecordsVisible; // TRUE if footer records are visible.
- BOOL m_bPinFooterRecords; // TRUE if footer records are drawn immediately after the body rows.
- BOOL m_bSelectionEnable; // TRUE if selection enabled.
- BOOL m_bRowFocusVisible; // TRUE if showing focused row rectangle enabled.
- BOOL m_bHeaderRowsAllowAccess; // TRUE if a header row can be selected by user.
- BOOL m_bFooterRowsAllowAccess; // TRUE if a footer row can be selected by user.
- BOOL m_bHeaderRowsSelectionEnable; // TRUE if header row selection enabled.
- BOOL m_bFooterRowsSelectionEnable; // TRUE if footer row selection enabled.
- CXTPReportColumn* m_pFocusedColumn; // Pointer to the currently focused CXTPReportColumn.
- CXTPToolTipContext* m_pToolTipContext; // Tool tip Context.
- CXTPReportRecordItem* m_pActiveItem; // Pointer to the currently focused CXTPReportRecordItem.
- CXTPReportInplaceEdit* m_pInplaceEdit; // In-place edit pointer
- CXTPReportInplaceButtons* m_pInplaceButtons;// In-place buttons pointer
- CXTPReportInplaceList* m_pInplaceList; // In-place list pointer
- BOOL m_bVScrollBarVisible; // TRUE if vertical scroll bar is visible
- BOOL m_bHScrollBarVisible; // TRUE if horizontal scroll bar is visible
- CPoint m_pointDrag; // Drag position
- BOOL m_bPrepareDrag; // TRUE if user click the report control and doesn't release button.
- CXTPReportRows m_arrScreenRows; // Rows currently presented on screen.
- CString m_strFilterText; // Filter text.
- BOOL m_bFilterHiddenColumns; // Search filter text in hidden columns too.
- CXTPReportHeader* m_pReportHeader; // List header member.
- int m_nPopulatedRecordsCount; // Current number of records in the report after using m_strFilterText.
- CLIPFORMAT m_cfReport; // Report Clipboard format for drag/drop operations
- CReportDropTarget* m_pDropTarget; // Internal drag/drop helper.
- BOOL m_bDragMode; // TRUE if records currently dragging
- DWORD m_dwDragDropFlags; // Drag/drop flags.
- int m_nDropPos; // Position of records to be dropped
- CXTPReportRecords* m_pDropRecords; // Drop records.
- CXTPReportRow* m_pSelectOnUpRow; // Row to select on mouse up. Can be null.
- BOOL m_bOnSizeRunning; // TRUE if OnSize handler is entered, FALSE otherwise. Used to prevent OnSize reenter and stack overflow in Win95/98/ME.
- UINT_PTR m_uAutoScrollTimerID; // Auto scroll timer ID or 0.
- //{{AFX_CODEJOCK_PRIVATE
- long m_nOLEDropMode; // Store OLE drop mode.
- //}}AFX_CODEJOCK_PRIVATE
- CXTPReportRow* m_ptrVirtualEditingRow; // Currently editing row in virtual mode.
- CXTPReportRows::T_CompareFunc m_pRowsCompareFunc; // Pointer to rows compare function.
- HBITMAP m_hbmpWatermark; // Watermark bitmap handle.
- BYTE m_WatermarkTransparency; // Watermark bitmap transparency value.
- BITMAP m_bmWatermark; // Watermark bitmap info.
- XTPReportWatermarkAlignment m_WatermarkAlignment; // Watermark alignment flags.
- int m_nEnsureVisibleRowIdx; // Ensure visible row index.
- int m_nEnsureVisibleColumnIdx; // Ensure visible column index.
- private:
- XTP_NM_REPORTTOOLTIPINFO* m_pCachedToolTipInfo;
- friend class CReportControlCtrl;
- friend class CReportDropTarget;
- };
- //===========================================================================
- // Summary:
- // Helper class with static member functions to control active locale for
- // Report Control and perform some locale dependent tasks.
- //===========================================================================
- class _XTP_EXT_CLASS CXTPReportControlLocale
- {
- private:
- CXTPReportControlLocale(){};
- public:
- //-----------------------------------------------------------------------
- // Summary:
- // Determine which locale is used active locale: current user locale
- // or resource file locale.
- // Returns:
- // TRUE if resource file locale is used active locale, FALSE otherwise.
- // See Also:
- // SetUseResourceFileLocale, CXTPResourceManager::GetResourcesLangID,
- // GetActiveLCID, LOCALE_USER_DEFAULT
- //-----------------------------------------------------------------------
- static BOOL AFX_CDECL IsUseResourceFileLocale();
- //-----------------------------------------------------------------------
- // Summary:
- // Used to set which locale is used active locale: current user locale
- // or resource file locale.
- // Parameters:
- // bUseResourceFileLocale - If TRUE resource file locale will be used,
- // if FALSE current user locale will be used.
- // See Also:
- // IsUseResourceFileLocale, CXTPResourceManager::GetResourcesLangID,
- // GetActiveLCID, LOCALE_USER_DEFAULT
- //-----------------------------------------------------------------------
- static void AFX_CDECL SetUseResourceFileLocale(BOOL bUseResourceFileLocale);
- //-----------------------------------------------------------------------
- // Summary:
- // Returns active locale ID (current user locale or resource file locale)
- // Returns:
- // LOCALE_USER_DEFAULT or resource file locale ID.
- // See Also:
- // IsUseResourceFileLocale, SetUseResourceFileLocale,
- // CXTPResourceManager::GetResourcesLangID, LOCALE_USER_DEFAULT
- //-----------------------------------------------------------------------
- static LCID AFX_CDECL GetActiveLCID();
- //-----------------------------------------------------------------------
- // Summary:
- // Use to change VARIANT type using active locale ID.
- // Parameters:
- // rVarValue - [in, out] Reference to VARIANT value to change type.
- // vartype - [in] new variant type.
- // bThrowError - [in] if FALSE function returns TRUE or FALSE,
- // if TRUE function throw exception in case of error.
- // Returns:
- // TRUE if successful, FALSE otherwise.
- // See Also:
- // GetActiveLCID, ::VariantChangeTypeEx API function.
- //-----------------------------------------------------------------------
- static BOOL AFX_CDECL VariantChangeTypeEx(VARIANT& rVarValue, VARTYPE vartype, BOOL bThrowError = TRUE);
- //-----------------------------------------------------------------------
- // Summary:
- // Format a string using strftime() function format specifiers.
- // The active locale ID is used.
- // Parameters:
- // dt - [in] A COleDateTime object with date and time value to format.
- // lpcszFormatString - [in] Format-control string.
- // Returns:
- // A string which contains date-time formatted using active locale ID.
- // See Also:
- // GetActiveLCID, strftime
- //-----------------------------------------------------------------------
- static CString AFX_CDECL FormatDateTime(const COleDateTime& dt, LPCTSTR lpcszFormatString);
- private:
- static BOOL s_bUseResourceFileLocale;
- private:
- static CString AFX_CDECL _FormatDateTime(const COleDateTime& dt, LPCTSTR lpcszFormatString, LCID lcLocaleID);
- static void AFX_CDECL _InitMappedSpecs();
- static void AFX_CDECL _ProcessMappedSpecs(CString& rstrFormat, const SYSTEMTIME* pST, LCID lcLocaleID);
- static void AFX_CDECL _ProcessDateTimeSpecs(CString& rstrFormat, const SYSTEMTIME* pST, LCID lcLocaleID);
- static void AFX_CDECL __ProcessDate_x(CString& rstrFormat, const SYSTEMTIME* pST, LCID lcLocaleID);
- static void AFX_CDECL __ProcessTime_X(CString& rstrFormat, const SYSTEMTIME* pST, LCID lcLocaleID);
- static void AFX_CDECL _ProcessOtherSpecs(CString& rstrFormat, const COleDateTime& dt);
- private:
- struct XTP_TIMESPEC
- {
- LPCTSTR pcszSpec;
- LPCTSTR pcszFormat;
- BOOL bTime;
- };
- static CArray<XTP_TIMESPEC, XTP_TIMESPEC&> s_arMappedSpecs;
- static void AFX_CDECL _AddsMappedSpec(LPCTSTR pcszSpec, LPCTSTR pcszFormat, BOOL bTime);
- };
- //////////////////////////////////////////////////////////////////////////
- AFX_INLINE CXTPReportPaintManager* CXTPReportControl::GetPaintManager() const {
- return m_pPaintManager;
- }
- AFX_INLINE CXTPReportNavigator* CXTPReportControl::GetNavigator() const {
- return m_pNavigator;
- }
- AFX_INLINE CXTPReportSelectedRows* CXTPReportControl::GetSelectedRows() const{
- return m_pSelectedRows;
- }
- AFX_INLINE CXTPReportRows* CXTPReportControl::GetRows() const{
- return m_pRows;
- }
- AFX_INLINE CXTPReportRecords* CXTPReportControl::GetRecords() const{
- return m_pRecords;
- }
- AFX_INLINE CXTPReportColumns* CXTPReportControl::GetColumns() const{
- return m_pColumns;
- }
- AFX_INLINE XTPReportMouseMode CXTPReportControl::GetMouseMode() const {
- return m_mouseMode;
- }
- AFX_INLINE void CXTPReportControl::SetGridStyle(BOOL bVertical, XTPReportGridStyle gridStyle) {
- m_pPaintManager->SetGridStyle(bVertical, gridStyle);
- AdjustScrollBars();
- }
- AFX_INLINE XTPReportGridStyle CXTPReportControl::GetGridStyle(BOOL bVertical) const{
- return bVertical ? m_pPaintManager->m_verticalGridStyle : m_pPaintManager->m_horizontalGridStyle;
- }
- AFX_INLINE COLORREF CXTPReportControl::SetGridColor(COLORREF clrGridLine) {
- return m_pPaintManager->SetGridColor(clrGridLine);
- }
- AFX_INLINE void CXTPReportControl::EnablePreviewMode(BOOL bIsPreviewMode) {
- m_pPaintManager->EnablePreviewMode(bIsPreviewMode);
- }
- AFX_INLINE BOOL CXTPReportControl::IsPreviewMode() const{
- return m_pPaintManager->IsPreviewMode();
- }
- AFX_INLINE BOOL CXTPReportControl::IsChanged() const{
- return m_bChanged;
- }
- AFX_INLINE void CXTPReportControl::SetChanged(BOOL bChanged) {
- m_bChanged = bChanged;
- }
- AFX_INLINE void CXTPReportControl::ShowGroupBy(BOOL bEnable) {
- ASSERT(!IsVirtualMode());
- m_bGroupByEnabled = bEnable;
- AdjustLayout();
- AdjustScrollBars();
- }
- AFX_INLINE BOOL CXTPReportControl::IsGroupByVisible() const {
- return m_bGroupByEnabled;
- }
- AFX_INLINE void CXTPReportControl::ShowHeader(BOOL bShow /*= TRUE*/) {
- m_bHeaderVisible = bShow;
- AdjustLayout();
- AdjustScrollBars();
- }
- AFX_INLINE BOOL CXTPReportControl::IsHeaderVisible()const {
- return m_bHeaderVisible;
- }
- AFX_INLINE void CXTPReportControl::ShowFooter(BOOL bShow /*= TRUE*/) {
- m_bFooterVisible = bShow;
- AdjustLayout();
- AdjustScrollBars();
- }
- AFX_INLINE BOOL CXTPReportControl::IsFooterVisible()const {
- return m_bFooterVisible;
- }
- AFX_INLINE void CXTPReportControl::ShadeGroupHeadings(BOOL bEnable) {
- if (m_pPaintManager)
- m_pPaintManager->m_bShadeGroupHeadings = bEnable;
- AdjustScrollBars();
- }
- AFX_INLINE BOOL CXTPReportControl::IsShadeGroupHeadingsEnabled() const{
- return m_pPaintManager ? m_pPaintManager->m_bShadeGroupHeadings : FALSE;
- }
- AFX_INLINE void CXTPReportControl::SetGroupRowsBold(BOOL bBold) {
- if (m_pPaintManager)
- m_pPaintManager->m_bGroupRowTextBold = bBold;
- }
- AFX_INLINE BOOL CXTPReportControl::IsGroupRowsBold() const {
- return m_pPaintManager ? m_pPaintManager->m_bGroupRowTextBold : FALSE;
- }
- AFX_INLINE CRect CXTPReportControl::GetReportRectangle() const{
- return m_rcReportArea;
- }
- AFX_INLINE BOOL CXTPReportControl::IsMultipleSelection() const {
- return m_bMultipleSelection;
- }
- AFX_INLINE void CXTPReportControl::SetMultipleSelection(BOOL bMultipleSelection) {
- m_bMultipleSelection = bMultipleSelection;
- SetFocusedRow(GetFocusedRow());
- }
- AFX_INLINE BOOL CXTPReportControl::IsMultiSelectionMode() const {
- return m_bMultiSelectionMode;
- }
- AFX_INLINE void CXTPReportControl::SetMultiSelectionMode(BOOL bMultiSelectionMode) {
- m_bMultiSelectionMode = bMultiSelectionMode;
- }
- AFX_INLINE void CXTPReportControl::EnableToolTips(BOOL bEnable) {
- m_bShowTooltips = bEnable;
- }
- AFX_INLINE void CXTPReportControl::SkipGroupsFocus(BOOL bSkipFocus) {
- m_bSkipGroupsFocus = bSkipFocus;
- }
- AFX_INLINE BOOL CXTPReportControl::IsSkipGroupsFocusEnabled()const {
- return m_bSkipGroupsFocus;
- }
- AFX_INLINE CXTPImageManager* CXTPReportControl::GetImageManager() const{
- return m_pImageManager;
- }
- AFX_INLINE CXTPReportColumn* CXTPReportControl::GetFocusedColumn() const{
- return m_pFocusedColumn;
- }
- AFX_INLINE void CXTPReportControl::FocusSubItems(BOOL bFocusSubItems) {
- m_bFocusSubItems = bFocusSubItems;
- m_pFocusedColumn = NULL;
- }
- AFX_INLINE BOOL CXTPReportControl::IsAllowEdit() const{
- return m_bAllowEdit;
- }
- AFX_INLINE CXTPReportInplaceEdit* CXTPReportControl::GetInplaceEdit() const{
- return m_pInplaceEdit;
- }
- AFX_INLINE CXTPReportInplaceButtons* CXTPReportControl::GetInplaceButtons() const{
- return m_pInplaceButtons;
- }
- AFX_INLINE CXTPReportInplaceList* CXTPReportControl::GetInplaceList() const{
- return m_pInplaceList;
- }
- AFX_INLINE CXTPReportRecordItem* CXTPReportControl::GetActiveItem() const{
- return m_pActiveItem;
- }
- AFX_INLINE void CXTPReportControl::AllowEdit(BOOL bAllowEdit) {
- m_bAllowEdit = bAllowEdit;
- }
- AFX_INLINE BOOL CXTPReportControl::IsFocusSubItems() const{
- return m_bFocusSubItems;
- }
- AFX_INLINE void CXTPReportControl::EditOnClick(BOOL bEditOnClick) {
- m_bEditOnClick = bEditOnClick;
- }
- AFX_INLINE BOOL CXTPReportControl::IsEditOnClick() const{
- return m_bEditOnClick;
- }
- AFX_INLINE BOOL CXTPReportControl::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) {
- return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
- }
- AFX_INLINE CString CXTPReportControl::GetFilterText() {
- return m_strFilterText;
- }
- AFX_INLINE void CXTPReportControl::SetFilterText(LPCTSTR strFilterText) {
- m_strFilterText = strFilterText;
- }
- AFX_INLINE CXTPReportHeader* CXTPReportControl::GetReportHeader() const {
- return m_pReportHeader;
- }
- AFX_INLINE long CXTPReportControl::GetTopRowIndex() const{
- return m_nTopRow;
- }
- AFX_INLINE void CXTPReportControl::SetAutoCheckItems(BOOL bAutoCheck) {
- m_bAutoCheckItems = bAutoCheck;
- }
- AFX_INLINE BOOL CXTPReportControl::IsAutoCheckItems() const {
- return m_bAutoCheckItems;
- }
- AFX_INLINE int CXTPReportControl::GetFreezeColumnsCount() const {
- return m_nFreezeColumnsCount;
- }
- AFX_INLINE int CXTPReportControl::GetDisableReorderColumnsCount() const {
- return m_nDisableReorderColumnsCount;
- }
- AFX_INLINE void CXTPReportControl::SetFreezeColumnsCount(int nCount) {
- ASSERT(nCount >= 0);
- m_nFreezeColumnsCount = nCount;
- }
- AFX_INLINE void CXTPReportControl::SetDisableReorderColumnsCount(int nCount) {
- ASSERT(nCount >= 0);
- m_nDisableReorderColumnsCount = nCount;
- }
- AFX_INLINE int CXTPReportControl::GetLockUpdateCount() const {
- return m_nLockUpdateCount;
- }
- AFX_INLINE void CXTPReportControl::SetRowsCompareFunc(CXTPReportRows::T_CompareFunc pCompareFunc) {
- m_pRowsCompareFunc = pCompareFunc;
- }
- AFX_INLINE BOOL CXTPReportControl::IsFullColumnScrolling() const {
- return m_bFullColumnScrolling;
- }
- AFX_INLINE int CXTPReportControl::GetHScrollStep() {
- return m_nHScrollStep;
- }
- AFX_INLINE void CXTPReportControl::SetHScrollStep(int nStep) {
- ASSERT(nStep > 0);
- m_nHScrollStep = max(1, nStep);
- }
- AFX_INLINE CXTPReportRecords* CXTPReportControl::GetHeaderRecords() const{
- return m_pHeaderRecords;
- }
- AFX_INLINE CXTPReportRecords* CXTPReportControl::GetFooterRecords() const{
- return m_pFooterRecords;
- }
- AFX_INLINE CXTPReportRows* CXTPReportControl::GetHeaderRows() const{
- return m_pHeaderRows;
- }
- AFX_INLINE CXTPReportRows* CXTPReportControl::GetFooterRows() const{
- return m_pFooterRows;
- }
- AFX_INLINE CRect CXTPReportControl::GetHeaderRowsRect() const{
- return m_rcHeaderRecordsArea;
- }
- AFX_INLINE CRect CXTPReportControl::GetFooterRowsRect() const{
- return m_rcFooterRecordsArea;
- }
- AFX_INLINE void CXTPReportControl::ShowHeaderRows(BOOL bShow /*= TRUE*/) {
- m_bHeaderRecordsVisible = bShow;
- if(!bShow)
- GetNavigator()->SetCurrentFocusInHeadersRows(FALSE);
- AdjustLayout();
- AdjustScrollBars();
- }
- AFX_INLINE void CXTPReportControl::ShowFooterRows(BOOL bShow /*= TRUE*/) {
- m_bFooterRecordsVisible = bShow;
- if(!bShow)
- GetNavigator()->SetCurrentFocusInFootersRows(FALSE);
- AdjustLayout();
- AdjustScrollBars();
- }
- AFX_INLINE void CXTPReportControl::PinFooterRows(BOOL bPin /*= TRUE*/) {
- m_bPinFooterRecords = bPin;
- AdjustLayout();
- AdjustScrollBars();
- }
- AFX_INLINE BOOL CXTPReportControl::IsHeaderRowsVisible() const {
- return m_bHeaderRecordsVisible;
- }
- AFX_INLINE BOOL CXTPReportControl::IsFooterRowsVisible() const {
- return m_bFooterRecordsVisible;
- }
- AFX_INLINE BOOL CXTPReportControl::IsFooterRowsPinned() const {
- return m_bPinFooterRecords;
- }
- AFX_INLINE BOOL CXTPReportControl::IsHeaderRowsAllowEdit() const{
- return m_bHeaderAllowEdit;
- }
- AFX_INLINE BOOL CXTPReportControl::IsFooterRowsAllowEdit() const{
- return m_bFooterAllowEdit;
- }
- AFX_INLINE void CXTPReportControl::HeaderRowsAllowEdit(BOOL bAllowEdit) {
- m_bHeaderAllowEdit = bAllowEdit;
- }
- AFX_INLINE void CXTPReportControl::FooterRowsAllowEdit(BOOL bAllowEdit) {
- m_bFooterAllowEdit = bAllowEdit;
- }
- AFX_INLINE void CXTPReportControl::SetSortRecordChilds(BOOL bSortRecordChilds) {
- m_bSortRecordChilds = bSortRecordChilds;
- }
- AFX_INLINE BOOL CXTPReportControl::IsSortRecordChilds() {
- return m_bSortRecordChilds;
- }
- AFX_INLINE BOOL CXTPReportControl::IsFilterHiddenColumns() const {
- return m_bFilterHiddenColumns;
- }
- AFX_INLINE void CXTPReportControl::SetFilterHiddenColumns(BOOL bFilterHidden) {
- m_bFilterHiddenColumns = bFilterHidden;
- }
- AFX_INLINE BOOL CXTPReportControl::IsSelectionEnabled() const{
- return m_bSelectionEnable;
- }
- AFX_INLINE void CXTPReportControl::SelectionEnable(BOOL bEnable) {
- m_bSelectionEnable = bEnable;
- if(!m_bSelectionEnable)
- m_pSelectedRows->Clear();
- }
- AFX_INLINE BOOL CXTPReportControl::IsRowFocusVisible() const{
- return m_bRowFocusVisible;
- }
- AFX_INLINE void CXTPReportControl::ShowRowFocus(BOOL bShow) {
- m_bRowFocusVisible = bShow;
- }
- AFX_INLINE BOOL CXTPReportControl::IsHeaderRowsAllowAccess() const{
- return m_bHeaderRowsAllowAccess;
- }
- AFX_INLINE BOOL CXTPReportControl::IsFooterRowsAllowAccess() const{
- return m_bFooterRowsAllowAccess;
- }
- AFX_INLINE void CXTPReportControl::HeaderRowsAllowAccess(BOOL bAllowAccess) {
- m_bHeaderRowsAllowAccess = bAllowAccess;
- }
- AFX_INLINE void CXTPReportControl::FooterRowsAllowAccess(BOOL bAllowAccess) {
- m_bFooterRowsAllowAccess = bAllowAccess;
- }
- AFX_INLINE void CXTPReportControl::HeaderRowsEnableSelection(BOOL bEnable) {
- m_bHeaderRowsSelectionEnable = bEnable;
- }
- AFX_INLINE BOOL CXTPReportControl::IsHeaderRowsSelectionEnabled() const{
- return m_bHeaderRowsSelectionEnable;
- }
- AFX_INLINE void CXTPReportControl::FooterRowsEnableSelection(BOOL bEnable) {
- m_bFooterRowsSelectionEnable = bEnable;
- }
- AFX_INLINE BOOL CXTPReportControl::IsFooterRowsSelectionEnabled() const{
- return m_bFooterRowsSelectionEnable;
- }
- AFX_INLINE int CXTPReportControl::GetWatermarkAlignment() const{
- return m_WatermarkAlignment;
- }
- AFX_INLINE void CXTPReportControl::SetWatermarkAlignment(int nWatermarkAlignment) {
- m_WatermarkAlignment = (XTPReportWatermarkAlignment)nWatermarkAlignment;
- }
- #endif //#if !defined(__XTPREPORTCONTROL_H__)