Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Shortcut Bar
  New Posts New Posts RSS Feed - Rich Edit Control on a CXTPShortcutPane Client
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Rich Edit Control on a CXTPShortcutPane Client

 Post Reply Post Reply
Author
Message
omtara View Drop Down
Groupie
Groupie
Avatar

Joined: 22 December 2007
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote omtara Quote  Post ReplyReply Direct Link To This Post Topic: Rich Edit Control on a CXTPShortcutPane Client
    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
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: 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
Back to Top
omtara View Drop Down
Groupie
Groupie
Avatar

Joined: 22 December 2007
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote omtara Quote  Post ReplyReply Direct Link To This Post 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.
 
 
 
 
Sorry for reporting an inaccurate issue at first,
 
Omtara
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: 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
Back to Top
omtara View Drop Down
Groupie
Groupie
Avatar

Joined: 22 December 2007
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote omtara Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
omtara View Drop Down
Groupie
Groupie
Avatar

Joined: 22 December 2007
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote omtara Quote  Post ReplyReply Direct Link To This Post Posted: 24 December 2007 at 2:46pm

Solved bro...

 

Thanks again for your support,

Omtara

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.143 seconds.