News: SPECIAL OFFER: EZGUI Classic (4.0) until May 31, 2013 only $29 ! 

TO REGISTER on Forum, contact tech support: http://cwsof.com/support.html
 
Pages: [1]   Go Down
  Print  
Author Topic: RichText problem  (Read 667 times)
Brian Reynolds
PreRelease 4.5
Sr. Member
*
Posts: 304


View Profile
« on: January 15, 2012, 12:41:49 AM »

According to the docs, "EZ_ForceRichVersion 4" should allow me to get RichText Version 4 to work.
I have put this in my "EZ_MAIN(Vernum&)" subroutine.
The dll "msftedit.dll" is required and I have this in my Windows System32 folder and I've also copied it into my application folder.
The following are codes in my list of RichText Version 4 shortcuts:
Ctrl+E = Center alignment
Ctrl+R = Right alignment
Ctrl+L = Left alignment
But
Ctrl+J = Justify alignment
does not work.
I there some thing else I should be doing? Can someone offer advice?
Logged
Chris Boss
Administrator
Hero Member
*****
Posts: 1812


View Profile
« Reply #1 on: January 15, 2012, 09:52:30 AM »

Rich Edit 4 requires Windows XP service pack 1, so that willbe more minimum OS.

There is no need to copy it to the apps folder, since it is not a redistributable OS DLL. In the system folder should work fine.

It is important though to make sure EZ_ForceRichVersion is called before any form is created and before any richedit control is created, otherwise EZGUI will have already loaded the default richedit control. Once a richedit control has been loaded, you can not change the version EZGUI uses.

Logged
Chris Boss
Administrator
Hero Member
*****
Posts: 1812


View Profile
« Reply #2 on: January 15, 2012, 09:58:28 AM »

Some useful information about the RichEdit control on MSDN:

http://msdn.microsoft.com/en-us/library/windows/desktop/bb787873(v=vs.85).aspx
Logged
Chris Boss
Administrator
Hero Member
*****
Posts: 1812


View Profile
« Reply #3 on: January 15, 2012, 10:07:11 AM »

What is CTRL-J suppose to do ?

I tried WordPad on Windows XP (spk3) and it uses the 4.0 richedit control.

CTRL+R and CTRL+L align right and left.

CTRL+E centers the text.

CTRL+J does nothing at all I can see.

I haven't been able to find any info about how the Richedit versions and how keyboard input may vary yet.
« Last Edit: January 15, 2012, 10:22:23 AM by Chris Boss » Logged
Brian Reynolds
PreRelease 4.5
Sr. Member
*
Posts: 304


View Profile
« Reply #4 on: January 15, 2012, 02:35:59 PM »

Chris,

If you go to the website you mention and look under "Rich Edit Shortcut Keys" it says Ctrl+J = Justify Text.

I have MS Word 2007 and if I open a file with a body of text, highlight that text and use Ctrl-J, it does what I expect Justified Text to look like - Justified full out, left and right, as in a book.

Regarding the use of "EZ_ForceRichVersion 4", there doesn't appear to be anywhere in my code to use it before the SUB EZ_MAIN(Vernum&).

Wordpad gives only icons for Align Left, Align Right and Centre Text. It does not display an icon for full-out justification.

I will have to explore further.
Logged
Chris Boss
Administrator
Hero Member
*****
Posts: 1812


View Profile
« Reply #5 on: January 15, 2012, 04:46:26 PM »

The Designer generates a function called:

Main_Initialize

Which is called just before the startup form is created. That is the best place to put such initialization code.

Also forms get the %EZ_Loading event, so one can put code there and it is executed before a form is created.

In the case of the richedit control as long as you cann EZ_ForceRichVersion before the first rich edit control is created, then it will work. You could call it in the richedit controls %EZ_Loading (not %EZ_Loaded) event.


The make EZGUI generate the %EZ_Loading event for a form or control, there is a property in the form/control property dialog you must select for the designer to generate the proper code.

« Last Edit: January 15, 2012, 04:48:07 PM by Chris Boss » Logged
Brian Reynolds
PreRelease 4.5
Sr. Member
*
Posts: 304


View Profile
« Reply #6 on: May 27, 2012, 07:38:48 PM »

Try as I might, I cannot get Justification in Richedit, using "EZ_ForceRichVersion 4".
I have tried putting it in all sorts of places but when I press Ctrl-J, it simply aligns text on the left, not fully justified as in MS Word 2007.
I have tried the following:
Code:
   IF Main_Initialize(VerNum&) THEN
      EZ_ForceRichVersion 4
Code:
   EZ_ForceRichVersion 4
   IF Main_Initialize(VerNum&) THEN
Code:
SUB FORM1_Events(CID&, CMsg&, CVal&, Cancel&)
   SELECT CASE CID&
      CASE %EZ_Window
         SELECT CASE CMsg&
            CASE %EZ_Loading
               EZ_ForceRichVersion 4
            CASE %EZ_Loaded
            CASE %EZ_Started
            CASE %EZ_Close
            CASE ELSE
         END SELECT
      CASE ELSE
   END SELECT
END SUB
Code:
FUNCTION Main_Initialize(BYVAL VerNum&) AS LONG
   LOCAL RV&
   RV&=1
   FUNCTION=RV&
   EZ_ForceRichVersion 4
END FUNCTION
I cannot get it to work.
Has anyone tried it and got it to work?
Logged
Chris Boss
Administrator
Hero Member
*****
Posts: 1812


View Profile
« Reply #7 on: May 27, 2012, 11:15:19 PM »

CTRL-J appears to have the same effect as CTRL-L (left aligned).

In Wordpad, when I use CTRL-R the text aligns to the right. Now when I use CTRL-J, with the text currently aligned to the right, Wordpad aligns it back to the left. This means CTRL-J does something, but it is the same as CTRL-L.

Since it uses the 4.0 richedit control I would assume this would apply to when we use the 4.0 richedit control in EZGUI.

Logged
Brian Reynolds
PreRelease 4.5
Sr. Member
*
Posts: 304


View Profile
« Reply #8 on: May 28, 2012, 01:11:33 AM »

According to MS docs: "RichEdit 2.0: Paragraphs are justified. Rich edit controls earlier than RichEdit 3.0 display the text aligned with the left margin."
This suggests Wordpad doesn't use Richedit 3 or 4.
Ths interesting thing is that I can justify text on a canvas quite easily using both word spacing and character spacing.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: