Print Page | Close Window

CXTPEdit does not disable Cut and Past in readonly

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=8353
Printed Date: 02 March 2025 at 5:03pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPEdit does not disable Cut and Past in readonly
Posted By: inmaurik
Subject: CXTPEdit does not disable Cut and Past in readonly
Date 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).



Replies:
Posted By: Oleg
Date Posted: 09 October 2007 at 3:00pm
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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net