Print Page | Close Window

Rich Edit Control on a CXTPShortcutPane Client

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Shortcut Bar
Forum Description: Topics Related to Codejock Shortcut Bar
URL: http://forum.codejock.com/forum_posts.asp?TID=9170
Printed Date: 29 April 2024 at 9:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Rich Edit Control on a CXTPShortcutPane Client
Posted By: omtara
Subject: Rich Edit Control on a CXTPShortcutPane Client
Date Posted: 22 December 2007 at 12:24pm
I am having problems attaching a CRichEditCtrl to a CXTPShortcutPane. When replaced by a CEdit control, everything works fine.
 
I have also tried to use the exact creation code in a CDialog and the CRichEdit is functioning properly.
 
In my code, I am overriding the "Create" function of the "CXTPShortcutPane" derived class and have added the following code:
 
 
////////////////////////////////////////////////////

BOOL CInfoViewPane::Create(LPCTSTR lpszCaption, CXTPShortcutBar* pParent)
{
   if (!CXTPShortcutBarPane::Create(lpszCaption, pParent))
      return FALSE;
 
   SetIndent(0,0,0,0);
   CXTPShortcutBarPaneItem* pPane;
 
   DWORD w_RichEd = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_VSCROLL | ES_AUTOVSCROLL | WS_HSCROLL | ES_AUTOHSCROLL | ES_MULTILINE;
 
   m_richedit.Create(w_RichEd, CRect(0,0,0,0), this, IDC_INFO_BOX);
  
   m_richedit.LimitText(1000);
 
   DWORD REOptions = (ECO_AUTOVSCROLL | ECO_AUTOHSCROLL | ECO_NOHIDESEL | ECO_SAVESEL | ECO_SELECTIONBAR);
 
   m_richedit.SetOptions(ECOOP_OR, REOptions);
   m_richedit.SetBackgroundColor(FALSE, GetSysColor(COLOR_3DFACE));
  
   CHARFORMAT cfm;
   cfm.cbSize = sizeof(cfm);
   cfm.dwMask = CFM_COLOR | CFM_BOLD | CFM_SIZE | CFM_FACE;
   cfm.dwEffects = 0;
   cfm.yHeight = 200;
   cfm.crTextColor = RGB(0,0,0);
   _tcscpy (cfm.szFaceName, _T("Trebuchet MS"));
   m_richedit.SetDefaultCharFormat(cfm);
 
   pPane = AddItem(_T("Info"), &m_richedit, 115);
 
   return TRUE;
}

/////////////////////////////////////////////////

The problem is that the pane containing a richedit control is not updated when its shortcut it is supposed to.
 
Please note that my CXTPShortcutBar derived class is also derived from CView and is attached to a splitter frame when the program starts.

I have been working on this problem for three days with no clue.

Thanks in advance,
 
Omtara



Replies:
Posted By: Oleg
Date Posted: 23 December 2007 at 3:17am
Hi,
 
try to reproduce this problem with our smple and attach project here.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: omtara
Date Posted: 24 December 2007 at 1:02pm

Thanks for your time,

When trying to reproduce the problem with the Shortcutbar example, I finally found out that the problem is because I am using a right-to-left layout for my entire program.
 
I was able to reproduce the problem in the Scribble multi-language example.  I simply changed the main view to a CRichEditView class and added the neccesary translation files (Scribble.ResourceArSa.dll and .xml)
 
I have attached the modified project for your convienience. I had to change some of the project settings to make everything work in a single directory. You may need to specify the directory for the XTP lib folder.
 
To check out the issue, you can run the example and switch to Arabic from the command bar. When the layout becomes right-to-left, the rich edit control malfunctions.
 
 
  https://forum.codejock.com/uploads/temp/20071224_132330_ScribbleMultiLa.zip - uploads/temp/20071224_132330_ScribbleMultiLa.zip
 
 
Sorry for reporting an inaccurate issue at first,
 
Omtara


Posted By: Oleg
Date Posted: 24 December 2007 at 2:17pm
RichEdit doesn't support WS_EX_LAYOUTRTL. try WS_EX_RIGHT style instead.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: omtara
Date Posted: 24 December 2007 at 2:35pm
Thanks for the prompt reply,
 
Do you know where I could do such a change while keeping everything RTL (Menus, Commandbars, etc..) and have the Rich edit control work fine?
 
 
Thanks in advance,
 
Omtara


Posted By: omtara
Date Posted: 24 December 2007 at 2:46pm

Solved bro...

 

Thanks again for your support,

Omtara




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