![]() |
CXTPEdit does not disable Cut and Past in readonly |
Post Reply ![]() |
Author | |
inmaurik ![]() Groupie ![]() Joined: 13 July 2007 Location: Netherlands Status: Offline Points: 17 |
![]() ![]() ![]() ![]() ![]() Posted: 09 October 2007 at 2:32am |
I have a command bar with an xtpControlEdit control added to it. The control is also set read only. When you open the context menu, the cut and past commands are enabled while the control is read only. Executing the actions does not do anything but I think it is not correct that the commands are enabled.
In CXTPEdit::IsCommandEnabled you see that there is no check on enabled / read only. Is there a way to make these commands disabled (fixing this function or make it virtual so I can override the function). |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Thanks, Good point.
Pleae replace this method as
BOOL CXTPEdit::IsCommandEnabled(UINT nID)
{ if (nID == ID_EDIT_PASTE) { return ((GetStyle() & (ES_READONLY | WS_DISABLED)) == 0) && ::IsClipboardFormatAvailable(CF_TEXT); } else if (nID == ID_EDIT_CUT || nID == ID_EDIT_COPY) { int nStartChar, nEndChar; GetSel(nStartChar, nEndChar); return (nStartChar != nEndChar) && ((nID == ID_EDIT_COPY) || ((GetStyle() & (ES_READONLY | WS_DISABLED)) == 0)); } return TRUE; } it wil be changed same for next release.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |