Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CXTPEdit does not disable Cut and Past in readonly
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPEdit does not disable Cut and Past in readonly

 Post Reply Post Reply
Author
Message
inmaurik View Drop Down
Groupie
Groupie


Joined: 13 July 2007
Location: Netherlands
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote inmaurik Quote  Post ReplyReply Direct Link To This Post Topic: CXTPEdit does not disable Cut and Past in readonly
    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).
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.