Page 4 of 6
					
				Re: RichEdit Functions (OOP) New: with Image-Support
				Posted: Sat Feb 09, 2013 4:13 pm
				by RichardL
				Thanks but...
The values of 'startpos' and 'endpos' are memory addresses' and I need to read (a) the contents of the line in the HEX editor (to recover the offset address) and (b) the highlighted section that the user has identified. 
I suppose I could search backwards or forwards from 'startpos' until I find an address (which is identifiable because it has a lot of digits with no spaces) but that is a bit of a kludge!
Richard
			 
			
					
				Re: RichEdit Functions (OOP) New: with Image-Support
				Posted: Tue Oct 08, 2013 10:54 pm
				by VB6_to_PBx
				ts-soft ,
How can i Open a regular .TXT file with your RichEdit Software ??
i would like to Open and Edit a regular .TXT file with your RichEdit Software ,
then make some RichText changes to that .TXT file content, ( such as Bold or Font Color changes , etc. )
and then be able to Save that file along with any Rich Text changes i've made
and Save it with .RTF extension , as a real .RTF file.
-----------
i know i can open a .TXT file then Copy its Text to the ClipBoard
and then Paste it into your RichEdit software
but i would like to just Open a TXT file and do Rich Text editing inside your software
then Save it as .RTF File
			 
			
					
				Re: RichEdit Functions (OOP) New: with Image-Support
				Posted: Tue Oct 08, 2013 11:46 pm
				by rsts
				Did you try renaming the .txt to .rtf?
Just asking. I have not tried it myself.
cheers
			 
			
					
				Re: RichEdit Functions (OOP) New: with Image-Support
				Posted: Wed Oct 09, 2013 12:22 am
				by VB6_to_PBx
				rsts wrote:Did you try renaming the .txt to .rtf?
Just asking. I have not tried it myself.
cheers
i had tried that too, but it does not work .
the only other way is too Paste text from the ClipBoard
 
			 
			
					
				Re: RichEdit Functions (OOP) New: with Image-Support
				Posted: Wed Oct 09, 2013 6:07 am
				by ts-soft
				Code: Select all
RichEdit_LoadText()
RichEdit_SaveRTF()
?
 
			 
			
					
				Re: RichEdit Functions (OOP) New: with Image-Support
				Posted: Wed Oct 09, 2013 7:53 am
				by VB6_to_PBx
				ts-soft wrote:Code: Select all
RichEdit_LoadText()
RichEdit_SaveRTF()
?
 
i changed your Code to this :   Edit\LoadText(File)   
Code: Select all
    Case #PB_Event_Menu
      Select EventMenu()
        Case #mnu_New
          Edit\Clear()
          SetStatusbarText()
          DisableToolBarButton(0, #mnu_Undo, Edit\CanUndo() ! 1)
          DisableToolBarButton(0, #mnu_Redo, #True)
        Case #mnu_Open
          File = OpenFileRequester(Lang(23), "", "RichText (*.rtf)|*.rtf | Text (*.txt)|*.txt", 0)
          If File
            Edit\LoadRTF(File)
            Edit\LoadText(File)
            SetStatusbarText()
            DisableToolBarButton(0, #mnu_Undo, Edit\CanUndo() ! 1)
            DisableToolBarButton(0, #mnu_Redo, #True) 
          EndIf
 
is that OK or proper way to modify your Code ??
any problems doing that way ??
Also when you Save a File it does not automatically add the .RTF extension
One more Problem occurs if i try your RichText software in new PB version 5.20
but not in older v5.11
the PB v5.20 ERROR is Line = #CFM_SUPERSCRIPT
[01:52:36] [COMPILER] Line 106: Constant already declared with a different value: #CFM_SUPERSCRIPT.
 
			 
			
					
				Re: RichEdit Functions (OOP) New: with Image-Support
				Posted: Wed Oct 09, 2013 8:09 am
				by ts-soft
				VB6_to_PBx wrote:Also when you Save a File it does not automatically add the .RTF extension
This is a feature  

 (not everybody use the rtf extension)
VB6_to_PBx wrote:the PB v5.20 ERROR is Line = #CFM_SUPERSCRIPT
[01:52:36] [COMPILER] Line 106: Constant already declared with a different value: #CFM_SUPERSCRIPT.
Add a compilerdirective with CompilerIf Defined around the declaration.
 
			 
			
					
				Re: RichEdit Functions (OOP) New: with Image-Support
				Posted: Sun Nov 03, 2013 2:22 pm
				by ts-soft
				Update:
History wrote:; Version 2.2, October 31, 2013
; modified for PB 5.20
; modified: GetRTFStreamCallback
; Version 2.3, November 03, 2013
; changed to Module (RichEdit)
; some bugfixes
Special thanks to ozzie for his suggestions/fixes
 
			 
			
					
				Re: RichEdit Functions (OOP) New: with Image-Support
				Posted: Wed Feb 25, 2015 4:06 pm
				by ASI
				I know this is an old thread but anyone downloading this may still get an error from
#CFM_SUPERSCRIPT already defined with different value
Because the constant is declared again a little further down the list of constants
just after the CFE constants
#CFM_SUBSCRIPT = #CFE_SUBSCRIPT | #CFE_SUPERSCRIPT
So the first definition can be commented out and everything will be ok.
			 
			
					
				Re: RichEdit Functions (OOP) New: with Image-Support
				Posted: Wed Feb 25, 2015 4:55 pm
				by ts-soft
				@ASI
from first page:
ts-soft wrote:Attention:
The new version breaks the limit of 60000 chars from the forum,
please download it.
Current is Version 2.3 from 2013/11/03
here the link (is also in the first page):
http://www.realsource.de/downloads/doc_ ... edit-class 
			 
			
					
				Re: RichEdit Functions (OOP) New: with Image-Support
				Posted: Fri Feb 27, 2015 5:21 pm
				by ASI
				Yes i know links are on the first page.
Appologies for confusion caused. And not meant to offend,
I thank you for creating this in the first place.
I have been using the code for a while in a project.
			 
			
					
				Re: RichEdit Functions (OOP) New: with Image-Support
				Posted: Fri Feb 27, 2015 5:31 pm
				by ts-soft
				I mean, there is no problem with constants in v 2.3?
Code: Select all
  #CFM_ALLCAPS = $80
  #CFM_ANIMATION = $40000
  #CFM_BACKCOLOR = $4000000
  #CFM_BOLD = $1
  #CFM_CHARSET = $8000000
  #CFM_COLOR = $40000000
  #CFM_DISABLED = $2000
  #CFM_EMBOSS = $800
  #CFM_FACE = $20000000
  #CFM_HIDDEN = $100
  #CFM_IMPRINT = $1000
  #CFM_ITALIC = $2
  #CFM_KERNING = $100000
  #CFM_LCID = $2000000
  #CFM_LINK = $20
  #CFM_OFFSET = $10000000
  #CFM_OUTLINE = $200
  #CFM_PROTECTED = $10
  #CFM_REVAUTHOR = $8000
  #CFM_REVISED = $4000
  #CFM_SHADOW = $400
  #CFM_SIZE = $80000000
  #CFM_SMALLCAPS = $40
  #CFM_SPACING = $200000
  #CFM_STRIKEOUT = $8
  #CFM_STYLE = $80000
  CompilerIf Defined(CFM_SUPERSCRIPT, #PB_Constant) = #False
    #CFM_SUPERSCRIPT =  $20000; #CFM_SUBSCRIPT
  CompilerEndIf
  #CFM_UNDERLINE = $4
  #CFM_UNDERLINETYPE = $800000
  #CFM_WEIGHT = $400000
  
  #CFE_ALLCAPS = #CFM_ALLCAPS
  #CFE_AUTOBACKCOLOR = #CFM_BACKCOLOR
  #CFE_AUTOCOLOR = $40000000
  #CFE_BOLD = #CFM_BOLD
  #CFE_DISABLED = #CFM_DISABLED
  #CFE_EMBOSS = #CFM_EMBOSS
  #CFE_HIDDEN = #CFM_HIDDEN
  #CFE_IMPRINT = #CFM_IMPRINT
  #CFE_ITALIC = #CFM_ITALIC
  #CFE_LINK = #CFM_LINK
  #CFE_OUTLINE = #CFM_OUTLINE
  #CFE_PROTECTED = #CFM_PROTECTED
  #CFE_REVISED = #CFM_REVISED
  #CFE_SHADOW = #CFM_SHADOW
  #CFE_SMALLCAPS = #CFM_SMALLCAPS
  #CFE_STRIKEOUT = $8
  #CFE_SUBSCRIPT = $10000
  #CFE_SUPERSCRIPT = $20000
  #CFE_UNDERLINE = $4
  #CFM_SUBSCRIPT = #CFE_SUBSCRIPT | #CFE_SUPERSCRIPT
  
  #ENM_LINK = $04000000
  
  #PFA_JUSTIFY = 4  ;New paragraph-alignment option 2.0
  
  #ST_DEFAULT = 0
  #ST_KEEPUNDO = 1
  #ST_SELECTION = 2
 
			 
			
					
				Re: RichEdit Functions (OOP) New: with Image-Support
				Posted: Sun Mar 15, 2015 6:00 pm
				by Ferdinand
				Just downloaded and experimented with this.
I didn't get any error messages.
And I think this is really impressive.  
 
thanks for the work on it, ts-soft.
 
			 
			
					
				Re: RichEdit Functions (OOP) New: with Image-Support
				Posted: Tue Mar 15, 2016 7:40 am
				by HanPBF
				Hello Thomas!
Just needed an RTF-converting to raw text.
Seems that SetText and GetText do this easily as PB can show RTF.
So, thanks a lot for sharing!!!
			 
			
					
				Re: RichEdit Functions (OOP) New: with Image-Support
				Posted: Tue Jun 07, 2016 5:27 am
				by DjPoke
				Thanks for this usefull and great work.
This is a lot of time i wait for something like this.
I noticed in the spellchecker example that if the first word at top/left is wrong, correcting it will make its first letter to be doubled.
I also noticed that the Chr(13) separator seems to not be recognised in the "Tokenise" functions.
For example, if i delete the randomly generated text, and put a wrong word at the first line and a wrong word at the second line, a right click on the first word will give me a correction based on the two words.
EDIT:
The first bug was that at three times, you should use #WB_MOVEWORDLEFT, not #WB_LEFTBREAK.
This is the three procedures to edit :
Code: Select all
RichEdit_GetWordUnderMouse( *this.RichEditClassTemplate, x.i, y.i )
RichEdit_GetCurrentWord(*this.RichEditClassTemplate)
RichEdit_GetWordAtPosition(*this.RichEditClassTemplate, Pos.i)