/** * @file XTPGridFilterEditControl.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ /** @cond */ #if !defined(__XTPGRIDFILTEREDITCONTROL_H__) # define __XTPGRIDFILTEREDITCONTROL_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * The CXTPGridFilterEditControl class provides the functionality of the * filter string edit control associated to the main Grid control window. * @details * It has all the functionality of the CEdit control, as well as some * specific additions. * This control should be instantiated in the user's application. To use * a field chooser within an existing dialog box in your application, * add a standard list box to your dialog template using the dialog * editor and then initialize your CXTPGridSubListControl object inside * the dialog OnInitialUpdate handler. See the example below: * * Example: *
 * // CXTPGridFilterEditControl wndFilter;
 * wndFilter.SubclassDlgItem(IDC_FILTEREDIT, &pFilterDialog);
 * // CXTPGridControl wndGrid;
 * wndGrid.GetColumns()->GetGridHeader()->SetFilterEditCtrl(&wndFilter);
 * 
* @see * CEdit, CXTPGridHeader::SetFilterEditCtrl */ class _XTP_EXT_CLASS CXTPGridFilterEditControl : public CEdit { public: /** * @brief * Constructs a CXTPGridFilterEditControl object. * @details * You construct a CXTPGridFilterEditControl object in two steps. * First, call the CXTPGridFilterEditControl constructor. * Second, call Create. This initializes the Windows edit box and * attaches it to the CXTPGridFilterEditControl. * * Example: *
	 * // Declare a local CXTPGridFilterEditControl object.
	 * CXTPGridFilterEditControl myFilterEdit;
	 *
	 * // Declare a dynamic CXTPGridFilterEditControl object.
	 * CXTPGridFilterEditControl* pMyFilterEdit = new CXTPGridFilterEditControl;
	 * 
* * @see * CEdit, SetGridCtrl, CXTPGridHeader::SetFilterEditCtrl */ CXTPGridFilterEditControl(); /** * @brief * Destroys a CXTPGridFilterEditControl object, handles cleanup and deallocation. */ ~CXTPGridFilterEditControl(); public: /** * @brief * Sets the associated Grid control. * @param pGridCtrl Pointer to the associated Grid control to be set. * @details * Usually this method should not be called by the user. Instead * the user should call CXTPGridHeader::SetFilterEditCtrl. * @return * TRUE if the associated Grid control was set successfully, * otherwise FALSE. * @see * CXTPGridHeader::SetFilterEditCtrl, GetGridCtrl */ BOOL SetGridCtrl(CXTPGridControl* pGridCtrl); /** @cond */ _XTP_DEPRECATED_IN_FAVOR(SetGridCtrl) BOOL SetReportCtrl(CXTPGridControl* pGridCtrl); /** @endcond */ /** * @brief * Gets the associated Grid control. * @return * A pointer to the associated Grid control. * @see * CXTPGridHeader::SetFilterEditCtrl, SetGridCtrl */ CXTPGridControl* GetGridCtrl(); /** @cond */ _XTP_DEPRECATED_IN_FAVOR(GetGridCtrl) CXTPGridControl* GetReportCtrl(); /** @endcond */ /** * @brief * Sets the edit control text. * @param lpszText New edit control text to be set. */ void SetText(const CString& lpszText); /** * @brief * Gets the edit control text. * @return * The edit control text. */ CString GetText() const; /** * @brief * Sets the edit hint for the control (i.e. the grayed-out text * displayed in the edit control that provides a helpful * description of what the control is used for). * @param lpszHint Edit hint to be set. * * Example: *
pEdit->SetHint(_T("Click to find a contact");
* @see * GetHint */ void SetHint(LPCTSTR lpszHint); /** * @brief * Gets the edit hint of the control (i.e. the grayed-out text * displayed in the edit control that provides a helpful * description of what the control is used for). * @return * The edit hint of the control. * @see * SetHint */ CString GetHint() const; protected: /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_MSG(CXTPGridFilterEditControl) afx_msg BOOL OnChange(); afx_msg void OnPaint(); //}}AFX_MSG /** @endcond */ protected: CXTPGridControl* m_pGridCtrl; /**< Pointer to the main Grid control. */ CString m_strHint; /**< Grayed-out text displayed in the edit control to show a helpful description like "Enter filter text here". */ }; /** @cond */ AFX_INLINE BOOL CXTPGridFilterEditControl::SetReportCtrl(CXTPGridControl* pGridCtrl) { return SetGridCtrl(pGridCtrl); } AFX_INLINE CXTPGridControl* CXTPGridFilterEditControl::GetReportCtrl() { return GetGridCtrl(); } # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPGRIDFILTEREDITCONTROL_H__) /** @endcond */