/** * @file XTPControlEdit.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(__XTPCONTOLEDIT_H__) # define __XTPCONTOLEDIT_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPControlEdit; class CXTPControlComboBoxAutoCompleteWnd; const UINT XTP_FN_SPINUP = 0x1008; /**< Button is spinning up. */ const UINT XTP_FN_SPINDOWN = 0x1009; /**< Button is spinning down. */ const UINT XTP_FN_BUDDYBUTTONCLICK = 0x100A; /**< Buddy button down */ struct NMXTPUPDOWN : public NMXTPCONTROL { int iDelta; }; /** @cond */ # ifndef SHACF_DEFAULT # define SHACF_FILESYSTEM \ 0x00000001 /**< This includes the File System as well as the rest of the shell \ \ \ \ (Desktop\My Computer\Control Panel\) */ # define SHACF_URLALL \ (SHACF_URLHISTORY \ | SHACF_URLMRU) /**< Include the URL's in the users History and Recently Used lists. \ \ \ \ Equivalent to SHACF_URLHISTORY | SHACF_URLMRU.*/ # define SHACF_URLHISTORY 0x00000002 /**< URLs in the User's History*/ # define SHACF_URLMRU 0x00000004 /**< URLs in the User's Recently Used list.*/ # define SHACF_FILESYS_ONLY \ 0x00000010 /**< Include only the file system. Do not include virtual folders such \ \ \ \ Desktop or Control Panel.*/ # define SHACF_USETAB \ 0x00000008 /**< Use the tab to move thru the autocomplete possibilities instead of to \ \ \ \ the next dialog/window control.*/ # endif /** @endcond */ /** * @brief * CXTPCommandBarEditCtrl is a CEdit derived class. It is for internal usage only. */ class _XTP_EXT_CLASS CXTPCommandBarEditCtrl : public CEdit { private: class _XTP_EXT_CLASS CRichEditContext { public: CRichEditContext(); ~CRichEditContext(); public: HINSTANCE m_hInstance; CString m_strClassName; BOOL m_bRichEdit2; }; /** @cond */ DECLARE_DYNCREATE(CXTPCommandBarEditCtrl) /** @endcond */ public: /** * @brief * Constructs a CXTPCommandBarEditCtrl object. */ CXTPCommandBarEditCtrl(); /** * @brief * Called by the framework to route and dispatch command messages * and to handle the update of command user-interface objects. * @param nID Contains the command ID. * @param nCode Identifies the command notification code. * @param pExtra Used according to the value of nCode. * @param pHandlerInfo If not NULL, OnCmdMsg fills in the pTarget and * pmf members of the pHandlerInfo structure instead * of dispatching the command. Typically, this parameter * should be NULL. * @return * Nonzero if the message is handled; otherwise 0. */ virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo); /** * @brief * The framework calls this member function when the user selects * an item from a menu, when a child control sends a notification * message, or when an accelerator keystroke is translated. * @param wParam The low-order word of wParam identifies the command * ID of the menu item, control, or accelerator. The * high-order word of wParam specifies the notification * message if the message is from a control. If the message * is from an accelerator, the high-order word is 1. If * the message is from a menu, the high-order word is 0. * @param lParam Specifies additional message-dependent information. * @return * An application returns nonzero if it processes this message; * otherwise 0. */ virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); /** * @brief * This member function displays a pop-up context menu. * @param pControl Pointer to a CXTPControl control. * @param point CPoint object specifies x- and y- coordinates. * @return * TRUE if successful, otherwise FALSE. */ virtual BOOL ShowContextMenu(CXTPControl* pControl, CPoint point); /** * @brief * This member function displays a pop-up context menu. * @param dwStyle Specifies object's style flags. * @param pParentWnd Pointer to the parent window. * @return * TRUE if successful, otherwise FALSE. */ virtual BOOL CreateEdit(DWORD dwStyle, CWnd* pParentWnd); /** * @brief * This method determines whether the specified character is intended for an edit. * If it is, this method processes the message. * @param nChar Specifies the virtual key code of the given key. * @param lParam Specifies additional message-dependent information. * @return * TRUE if successful, otherwise FALSE. */ BOOL IsDialogCode(UINT nChar, LPARAM lParam); /** * @brief * Returns window text of edit. * @param rString String to return text. */ void GetWindowTextEx(CString& rString); /** * @brief * Sets the window text of edit. * @param lpszString String to set text. */ void SetWindowTextEx(LPCTSTR lpszString); /** * @brief * Determines if the Input Method Editor(IME) is being used. * @return * TRUE if the Input Method Editor(IME) is being used, otherwise FALSE. */ BOOL IsImeMode() const; protected: /** * @brief * Call this method to get rich edit version information. * @return Returns rich edit version information */ CRichEditContext& GetRichEditContext(); protected: /** * @brief * Determines if edit command is enabled. * @param nID Edit command. * @return * TRUE if edit command is enabled, otherwise FALSE. */ BOOL IsCommandEnabled(UINT nID); /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_MSG(CXTPCommandBarEditCtrl) afx_msg void OnImeStartComposition(); afx_msg void OnImeEndComposition(); afx_msg void OnKillFocus(CWnd* pNewWnd); afx_msg void OnPaint(); //}}AFX_MSG /** @endcond */ protected: BOOL m_bImeMode; /**< TRUE if IME editor is currently enabled. */ BOOL m_bComposited; /**< TRUE if control is AERO composited. */ BOOL m_bIgonoreEditChanged; /**< Don't send OnEditChanged. */ }; /** * @brief * Inplace Edit control of CXTPControlEdit. */ class _XTP_EXT_CLASS CXTPControlEditCtrl : public CXTPCommandBarEditCtrl { public: CXTPControlEditCtrl(); /** * @brief * Retrieves the parent CXTPControlEdit object. * @return * Pointer to parent CXTPControlEdit. */ CXTPControlEdit* GetControlEdit() const; protected: /** * @brief * This method is called to refresh the char format of edit control. */ void UpdateCharFormat(); protected: /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_MSG(CXTPControlEditCtrl) afx_msg void OnSetFocus(CWnd* pOldWnd); afx_msg void OnKillFocus(CWnd* pNewWnd); afx_msg void OnMouseMove(UINT nFlags, CPoint point); afx_msg void OnDestroy(); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnRButtonDown(UINT nFlags, CPoint point); afx_msg void OnContextMenu(CWnd* pWnd, CPoint point); afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult); afx_msg LRESULT OnWindowFromPoint(WPARAM, LPARAM); afx_msg void OnEditChanged(); afx_msg LRESULT OnEnableDisable(WPARAM, LPARAM); //}}AFX_MSG /** @endcond */ protected: CXTPControlEdit* m_pControl; /**< Parent edit control */ private: friend class CXTPControlEdit; }; /** * @brief * CXTPControlEdit is a CXTPControl derived class. * It represents an edit control. */ class _XTP_EXT_CLASS CXTPControlEdit : public CXTPControl { public: /** * @brief * Constructs a CXTPControlEdit object. */ CXTPControlEdit(); /** * @brief * Destroys a CXTPControlEdit object, handles cleanup and deallocation. */ virtual ~CXTPControlEdit(); public: /** * @brief * This method creates an edit control. Override it to use inherited * edit control. * @return * A pointer to the newly created CXTPControlEditCtrl object. */ virtual CXTPControlEditCtrl* CreateEditControl(); public: /** * @brief * Call this member to get the edit control. * @return * A pointer to the CEdit control. */ CEdit* GetEditCtrl() const; /** * @brief * Call this member to get the edit control text. * @return * The Edit control text. */ CString GetEditText() const; /** * @brief * Call this member to set the edit control text. * @param strText New text of the edit control. */ void SetEditText(const CString& strText); /** * @brief * Call this member to set the grayed-out text displayed in the edit control * which provides a helpful description of what the control is used for. * @param lpszEditHint Edit hint to be set. * * Example: *
pEdit->SetEditHint(_T("Click to find a contact");
* @see
* GetEditHint
*/
void SetEditHint(LPCTSTR lpszEditHint);
/**
* @brief
* Call this member to get the grayed-out text displayed in the edit control
* which provides a helpful description of what the control is used for.
* @return
* Edit hint of the control.
* @see
* SetEditHint
*/
CString GetEditHint() const;
/**
* @brief
* This member function enables or disables shell auto completion.
* @param dwFlags Flags that will be passed to SHAutoComplete function.
* @details
* Flags can be combined by using the bitwise
* OR (|) operator. It can be one or more of the following:
* SHACF_FILESYSTEM: This includes the File System as well as the rest of the shell
* (Desktop/My Computer/Control Panel/).
* SHACF_URLALL: Include the URL's in the user's History and Recently Used lists.
* Equivalent to SHACF_URLHISTORY | SHACF_URLMRU.
* HACF_URLHISTORY: URLs in the User's History.
* SHACF_URLMRU: URLs in the user's Recently Used list.
* SHACF_FILESYS_ONLY: Include only the file system. Do not include virtual folders
* such as Desktop or Control Panel.
*/
void EnableShellAutoComplete(DWORD dwFlags = SHACF_FILESYSTEM | SHACF_URLALL);
/**
* @brief
* Call this member to show the label of the control.
* @param bShow TRUE to show the label.
*/
void ShowLabel(BOOL bShow);
/**
* @brief
* Call this member to determine if the caption of the control is visible.
* @return
* TRUE if the caption is visible.
*/
virtual BOOL IsCaptionVisible() const;
/**
* @brief
* Determines if the icon is visible for edit control.
* @return
* TRUE if the icon is visible, otherwise FALSE.
*/
BOOL IsImageVisible() const;
/**
* @brief
* Call this member to determine if the control has a visible label.
* @return
* TRUE if the control has a visible label, otherwise FALSE.
*/
BOOL IsLabeled() const;
/**
* @brief
* Call this method to show spin buttons for edit control.
* @param bShow TRUE to show spin buttons.
* @see
* IsSpinButtonsVisible
*/
void ShowSpinButtons(BOOL bShow = TRUE);
/**
* @brief
* Determines if edit control has spin buttons.
* @return
* TRUE if edit control has spin buttons.
* @see
* ShowSpinButtons
*/
BOOL IsSpinButtonsVisible() const;
/**
* @brief
* Call this method to show the command (buddy) button for edit control.
* @param nButtonId Buddy button ID.
* @see
* IsBuddyButtonVisible
*/
void ShowBuddyButton(int nButtonId);
/**
* @brief
* Call this method to check if the buddy button is visible.
* @return
* TRUE if the buddy button is visible.
* @see
* ShowBuddyButton
*/
BOOL IsBuddyButtonVisible() const;
/**
* @brief
* Either reads this object from or writes this object to an archive.
* @param pPX A CXTPPropExchange object to serialize to or from.
*/
void DoPropExchange(CXTPPropExchange* pPX);
/**
* @brief
* This method is called when control's enabled state is changed.
*/
virtual void OnEnabledChanged();
/**
* @brief
* Call this member to get the style of an edit control.
* @return
* The style of the edit control.
* @see
* SetEditStyle
*/
DWORD GetEditStyle() const;
/**
* @brief
* Call this member to set the style of an edit control.
* @param dwStyle The style to be set.
* @see
* GetEditStyle
*/
void SetEditStyle(DWORD dwStyle);
/**
* @brief
* Calls this function to set the read-only state of an edit control.
* @param bReadOnly Specifies whether to set or remove the read-only state of the edit
* control. A value of TRUE sets the state to read-only;
* a value of FALSE sets the state to read/write.
* @see
* GetReadOnly, SetEnabled
*/
void SetReadOnly(BOOL bReadOnly = TRUE);
/**
* @brief
* Call this function to check if an edit control is read-only.
* @return
* TRUE if the control is read-only, otherwise FALSE.
* @see
* SetReadOnly
*/
BOOL GetReadOnly() const;
/**
* @brief
* Call this member to compare controls.
* @param pOther The control to compare with.
* @return
* TRUE if the controls are identical, otherwise FALSE.
*/
virtual BOOL Compare(CXTPControl* pOther);
/**
* @brief
* Call this method to get the width of the label.
* @return
* Width of the label.
* @see
* SetLabelWidth, ShowLabel, IsLabeled
*/
int GetLabelWidth() const;
/**
* @brief
* Call this method to set the width of the label.
* @param nLabelWidth Width of the label to be set.
* @see
* GetLabelWidth, ShowLabel, IsLabeled
*/
void SetLabelWidth(int nLabelWidth);
/**
* @brief
* Call this method to determine if edit control has focus.
* @return True if edit control has focus, false if not
*/
BOOL HasFocus() const;
/**
* @brief
* Call this member to set the focused state of the control.
* @param bFocused TRUE to set focus to the control.
*/
virtual void SetFocused(BOOL bFocused);
/**
* @brief
* Call this member to get the focused state of the control.
* @return
* TRUE if the control has focus, otherwise FALSE.
*/
virtual BOOL IsFocused() const;
/**
* @brief
* Returns spin buttons' bounding rectangle.
* @return
* Spin buttons' bounding rectangle.
*/
CRect GetSpinButtonsRect() const;
CRect GetBuddyButtonRect() const;
int GetBuddyButtonId() const;
/**
* @brief
* This method is called to hide the control.
* @param dwFlags Reasons to hide.
* @see
* XTPControlHideFlags
*/
virtual void SetHideFlags(DWORD dwFlags);
/**
* @brief
* This method is called when an action property is changed.
* @param nProperty Property of the action.
* @see
* OnActionChanging
*/
virtual void OnActionChanged(int nProperty);
/**
* @brief
* This method is called when an action property is about to be changed.
* @param nProperty Property of the action.
* @see
* OnActionChanged
*/
virtual void OnActionChanging(int nProperty);
/**
* @brief
* This method draws the text of a control.
* @param pDC Pointer to a valid device context.
* @param rcText Rectangle to draw.
*/
virtual void DrawEditText(CDC* pDC, CRect rcText);
/**
* @brief
* This method sets the maximum text length that the user may enter
* into an edit control.
* @param nTextLimit Maximum text length user can enter.
* @see
* GetTextLimit
*/
void SetTextLimit(int nTextLimit);
/**
* @brief
* This method gets the maximum text length that the user may enter
* into an edit control.
* @return
* Maximum text length user can enter.
* @see
* SetTextLimit
*/
int GetTextLimit() const;
/**
* @brief
* Call this member to set the edit icon's identifier.
* @param nId Icon's identifier to be set.
*/
void SetEditIconId(int nId);
/**
* @brief
* Call this member to get the edit icon's identifier.
* @return
* Edit icon's identifier.
*/
int GetEditIconId() const;
/**
* @brief
* Call this member to allow only digits to be entered into the edit control.
* @param bNumericOnly TRUE to enable numeric only mode, FALSE otherwise.
* @return
* TRUE if successful, otherwise FALSE.
*/
BOOL SetNumericOnly(BOOL bNumericOnly = TRUE);
/**
* @brief
* Call this member to check if only digits can be entered into the edit control.
* @return
* TRUE if only digits can be entered into the edit control, otherwise FALSE.
*/
BOOL IsNumericOnly() const;
protected:
/**
* @brief
* This method is called to check if a control can accept focus.
* @return True if control can accept focus, false if not
* @see
* SetFocused
*/
virtual BOOL IsFocusable() const;
/**
* @brief
* Called after the mouse hovers over the control.
*/
virtual void OnMouseHover();
/**
* @brief
* This member is called when the mouse cursor moves.
* @param point Specifies the x- and y- coordinates of the cursor.
*/
virtual void OnMouseMove(CPoint point);
/**
* @brief
* This method is called when the edit control gets focus.
* @param pOldWnd Pointer to a CWnd object.
*/
virtual void OnSetFocus(CWnd* pOldWnd);
/**
* @brief
* This method is called when the edit control loses focus.
*/
virtual void OnKillFocus();
/**
* @brief
* This method is called to get the real rect of the edit control of CEdit.
* @param rcControl Rectangle of Edit area.
*/
virtual void DeflateEditRect(CRect& rcControl);
/**
* @brief
* This method is called when the control becomes selected.
* @param bSelected TRUE if the control becomes selected.
* @return
* TRUE if successful, otherwise FALSE.
*/
BOOL OnSetSelected(int bSelected);
/**
* @brief
* Call this member to set the bounding rectangle of the control.
* @param rcControl Bounding rectangle of the control.
*/
void SetRect(CRect rcControl);
/**
* @brief
* This method is called when edit control's text is changed.
*/
virtual void OnEditChanged();
/**
* @brief
* This method is called to get the default char format of rich edit text.
* @return Returns default char format of rich edit text
*/
virtual CHARFORMAT2 GetDefaultCharFormat();
/**
* @brief
* This method is called when the user clicks the control.
* @param bKeyboard TRUE if the control is selected using the keyboard.
* @param pt Mouse cursor position.
*/
void OnClick(BOOL bKeyboard = FALSE, CPoint pt = CPoint(0, 0));
/**
* @brief
* This method is called when the user activates a control using its underline.
*/
virtual void OnUnderlineActivate();
/**
* @brief
* This method is called to copy the control.
* @param pControl Pointer to a source CXTPControl object.
* @param bRecursive TRUE to copy recursively.
*/
void Copy(CXTPControl* pControl, BOOL bRecursive = FALSE);
/**
* @brief
* This method is called when a non-system key is pressed.
* @param nChar Specifies the virtual key code of the given key.
* @param lParam Specifies additional message-dependent information.
* @return
* TRUE if the key was handled, otherwise FALSE.
*/
BOOL OnHookKeyDown(UINT nChar, LPARAM lParam);
/**
* @brief
* This method is called before recalculating the parent command
* bar size to calculate the dimensions of the control.
* @param dwMode Flags used to determine the height and width of the
* dynamic command bar. See Remarks section for a list of
* values.
* @details
* The following predefined flags are used to determine the height and
* width of the dynamic command bar. Use the bitwise-OR (|) operator to
* combine the flags.
*
* LM_STRETCH: Indicates whether the command bar should be
* stretched to the size of the frame. Set if the bar is
* not a docking bar (not available for docking). Not set
* when the bar is docked or floating (available for
* docking). If set, LM_STRETCH returns dimensions based
* on the LM_HORZ state. LM_STRETCH works similarly to
* the the bStretch parameter used in CalcFixedLayout;
* see that member function for more information about
* the relationship between stretching and orientation.
* LM_HORZ: Indicates that the bar is horizontally or
* vertically oriented. Set if the bar is horizontally
* oriented, and if it is vertically oriented, it is not
* set. LM_HORZ works similarly to the the bHorz
* parameter used in CalcFixedLayout; see that member
* function for more information about the relationship
* between stretching and orientation.
* LM_MRUWIDTH: Most Recently Used Dynamic Width. Uses the
* remembered most recently used width.
* LM_HORZDOCK: Horizontal Docked Dimensions. Returns the
* dynamic size with the largest width.
* LM_VERTDOCK: Vertical Docked Dimensions. Returns the dynamic
* size with the largest height.
* LM_COMMIT: Resets LM_MRUWIDTH to current the width of the
* floating command bar.
*
* The framework calls this member function to calculate the dimensions
* of a dynamic command bar.
*
* Override this member function to provide your own layout in classes
* you derive from CXTPControl. XTP classes derived from CXTPControl,
* such as CXTPControlComboBox, override this member function to provide
* their own implementation.
* @see
* CXTPControlComboBox, CXTPControlCustom, CXTPControl,
* CXTPControlWindowList, CXTPControlWorkspaceActions, CXTPControlToolbars,
* CXTPControlOleItems, CXTPControlRecentFileList, CXTPControlSelector,
* CXTPControlListBox
*/
virtual void OnCalcDynamicSize(DWORD dwMode);
/**
* @brief
* This method is called to assign a parent command bar object.
* @param pParent Pointer to a CXTPCommandBar object.
*/
void SetParent(CXTPCommandBar* pParent);
/**
* @brief
* This member checks if the user can resize the control.
* @return
* TRUE if resize is available, otherwise FALSE.
*/
virtual BOOL IsCustomizeResizeAllow() const;
/**
* @brief
* This member returns the minimum width that the edit control
* can be sized to by the user while in customization mode.
* @return
* Width of label + 10 if the edit control's label is visible,
* if label is hidden, then it returns 10.
*/
virtual int GetCustomizeMinWidth() const;
/**
* @brief
* This method is called when a control is removed from the
* parent controls collection.
*/
virtual void OnRemoved();
protected:
/** @cond */
void _SetEditText(const CString& strText);
CString _GetEditText() const;
void TrackSpinButton(CPoint pt);
void TrackBuddyButton(CPoint pt);
virtual void NotifySpinChanged(int increment, int direction);
void OnThemeChanged();
void ShowHideEditControl();
/** @endcond */
protected:
CXTPControlEditCtrl* m_pEdit; /**< Inplace edit control. */
BOOL m_bLabel; /**< TRUE if label is visible. */
BOOL m_bReadOnly; /**< TRUE if edit is read-only. */
int m_nLabelWidth; /**< Width of the label. */
BOOL m_bDelayReposition; /**< Need to reposition control. */
BOOL m_bDelayDestroy; /**< Need to reposition control. */
CString m_strEditHint; /**< Edit hint of the controls. */
BOOL m_bFocused; /**< TRUE if edit has focus. */
CString m_strLastText; /**< Last entered text. */
mutable CString m_strEditText; /**< Edit text. */
mutable BOOL m_bEditChanged; /**< TRUE if Edit Text was changed. */
CXTPControlComboBoxAutoCompleteWnd* m_pAutoCompleteWnd; /**< Auto complete window hook. */
DWORD m_dwShellAutoCompleteFlags; /**< Shell auto complete flags. */
DWORD m_dwEditStyle; /**< Edit style. */
BOOL m_bShowSpinButtons; /**< TRUE to show spin buttons. */
int m_nEditIconId; /**< Edit Icon identifier. */
int m_nTextLimit; /**< The maximum number of characters that can be entered into an edit
control. */
int m_nBuddyButtonId;
BOOL m_bNumericOnly; /**< Allows only digits to be entered into the edit control. */
public:
# ifdef _XTP_COMMANDBARS_ACTIVEX
/** @cond */
DECLARE_DISPATCH_MAP()
DECLARE_INTERFACE_MAP()
DECLARE_OLETYPELIB_EX(CXTPControlEdit);
afx_msg BSTR OleGetText();
afx_msg void OleSetText(LPCTSTR str);
afx_msg int OleGetBuddyButtonId();
afx_msg void OleSetBuddyButtonId(int nValue);
afx_msg HWND OleGetEditHandle();
afx_msg BSTR OleGetEditHint();
afx_msg DWORD OleGetShellAutoComplete();
afx_msg void OleSetShellAutoComplete(DWORD dwShellAutoCompleteFlags);
afx_msg void OleSetEditIconId(int nId);
afx_msg int OleGetEditIconId();
afx_msg VOID OleSetNumericOnly(BOOL Value);
afx_msg BOOL OleGetNumericOnly();
enum
{
dispidShowLabel = 50L,
dispidWidth = 54L,
dispidText = 59L,
};
/** @endcond */
# endif
DECLARE_XTP_CONTROL(CXTPControlEdit)
friend class CXTPControlEditCtrl;
};
//////////////////////////////////////////////////////////////////////////
AFX_INLINE CEdit* CXTPControlEdit::GetEditCtrl() const
{
return m_pEdit;
}
AFX_INLINE void CXTPControlEdit::SetEditIconId(int nId)
{
if (m_nEditIconId != nId)
{
m_nEditIconId = nId;
RedrawParent();
m_bDelayReposition = TRUE;
}
}
AFX_INLINE int CXTPControlEdit::GetEditIconId() const
{
return m_nEditIconId;
}
AFX_INLINE BOOL CXTPControlEdit::IsNumericOnly() const
{
return m_bNumericOnly;
}
AFX_INLINE void CXTPControlEdit::ShowLabel(BOOL bShow)
{
SetStyle(bShow ? xtpButtonCaption : xtpButtonAutomatic);
}
AFX_INLINE BOOL CXTPControlEdit::IsLabeled() const
{
return IsCaptionVisible();
}
AFX_INLINE BOOL CXTPControlEdit::IsCustomizeResizeAllow() const
{
return TRUE;
}
AFX_INLINE int CXTPControlEdit::GetCustomizeMinWidth() const
{
return m_nLabelWidth + 10;
}
AFX_INLINE CXTPControlEdit* CXTPControlEditCtrl::GetControlEdit() const
{
return m_pControl;
}
AFX_INLINE int CXTPControlEdit::GetLabelWidth() const
{
return m_nLabelWidth;
}
AFX_INLINE void CXTPControlEdit::SetLabelWidth(int nLabelWidth)
{
if (m_nLabelWidth != nLabelWidth)
{
m_nLabelWidth = nLabelWidth;
m_bDelayReposition = TRUE;
}
}
/** @cond */
AFX_INLINE void CXTPControlEdit::OnThemeChanged()
{
m_bDelayReposition = TRUE;
}
/** @endcond */
AFX_INLINE void CXTPControlEdit::ShowSpinButtons(BOOL bShow)
{
if (m_bShowSpinButtons != bShow)
{
m_bShowSpinButtons = bShow;
m_bDelayReposition = TRUE;
DelayLayoutParent();
}
}
AFX_INLINE BOOL CXTPControlEdit::IsSpinButtonsVisible() const
{
return m_bShowSpinButtons;
}
AFX_INLINE void CXTPControlEdit::ShowBuddyButton(int nBuddyButtonId)
{
if (m_nBuddyButtonId != nBuddyButtonId)
{
m_nBuddyButtonId = nBuddyButtonId;
m_bDelayReposition = TRUE;
DelayLayoutParent();
}
}
AFX_INLINE BOOL CXTPControlEdit::IsBuddyButtonVisible() const
{
return m_nBuddyButtonId > 0;
}
AFX_INLINE BOOL CXTPControlEdit::GetBuddyButtonId() const
{
return m_nBuddyButtonId;
}
/** @cond */
# include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h"
#endif //#if !defined(__XTPCONTOLEDIT_H__)
/** @endcond */