Rich Edit Box proposal patched

HMG Unicode versions 3.1.x related

Moderator: Rathinagiri

User avatar
kcarmody
Posts: 152
Joined: Tue Oct 07, 2014 11:13 am
Contact:

Re: Rich Edit Box proposal patched

Post by kcarmody »

srvet_claudio wrote:Wow!!!! Kevin your demo is very nice,
but some changes that you propose are not entirely appropriate to incorporate in HMG, because they deviate from the standard behavior of Windows, for example changes made in RichEditBox_StreamIn() and RichEditBox_StreamOut() functions. And the changes made in HMG_IsUTF8 change the normal behavior of Harbour, the idea of this function is not to detect the true UTF-8 character set, the idea is to determine if it is due to use Unicode functions or not in the process a string.

I do not like OS-based controls that do not work in standard form, because they are often difficult to maintain as it evolves OS.

I think the changes you propose are very good for developing a word processor but not to the general operation of the RichEditBox control, my suggestion is to implement these changes in the demo, but not in the HMG library.

I repeat your demo is very good.
Thank you, Claudio, for your reply and for your very kind comments!

I understand your objections to modifying RichEditBox_StreamIn(), RichEditBox_StreamOut(), and HMG_IsUTF8(). As you recommend, instead of replacing the current versions of these functions, I can create duplicate functions with names such as RichEditBox_StreamInEx(), RichEditBox_StreamOutEx(), and HMG_IsUTF8Ex(), and put them into the demo.

But I notice that there is at least one other HMG application that I think would benefit from these duplicate functions, SAMPLES\Applications\MiniWriter. It is very similar to the Rich Edit demo in its basic purpose, namely to function like WordPad. The main difference is that MiniWriter uses a ribbon interface like the WordPad in Windows 7, whereas the Rich Edit demo uses a menu and icon interface like the WordPad in XP. (MiniWriter has a bug in patch 3 and 3a which I've reported at http://hmgforum.com/viewtopic.php?f=20&t=4686)

Currently, MiniWriter only reads and writes RTF files. If it is ever extended to read and write TXT files, it would need to remove and add the BOM, and perhaps check for UTF8 content, just like the new Rich Edit demo. Therefore, I would like to provide RichEditBox_StreamInEx(), RichEditBox_StreamOutEx(), and HMG_IsUTF8Ex() to all applications and not just mine. So I want to ask you, would you allow these functions to be in c_richeditbox.c and h_UNICODE_String.prg?
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Rich Edit Box proposal patched

Post by srvet_claudio »

The best way is include this functions in separate file as HFCL.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Post Reply