RichEdit Functions (OOP) New: with Image-Support
Re: RichEdit Functions (OOP) New: with Image-Support
Greetings to all, I'm having much difficulties with this RichEdit concept, perhaps I'm missing something:
Example used with modules here: http://www.realsource.de/downloads/doc_ ... edit-class
IMA's happens on defined RichEdit variables but not initialized by New_RichEdit. So, I'm having a large GUI where gadgets get created dynamically and only if needed. Naturally, EventGadget() that are not created are not fired at all, but for some reason, putting Case Edit\GetID() when Edit is not set with New_RichEdit fires IMA. Is there another approach to this issue? You can try this in RichEdit_Example.pb in last download file. If you comment out lines related to Edit = RichEdit::New_RichEdit and create any other gadget (for example, I added String gadget), compiling triggers IMA automatically, under the Select EventGadget() and Case Edit\GetID() part.
In addition, how can I catch events in RichEditor gadget with GetActiveGadget()? It doesn't seem to be triggered by something like GetActiveGadget() = Edit\GetID()...
Example used with modules here: http://www.realsource.de/downloads/doc_ ... edit-class
IMA's happens on defined RichEdit variables but not initialized by New_RichEdit. So, I'm having a large GUI where gadgets get created dynamically and only if needed. Naturally, EventGadget() that are not created are not fired at all, but for some reason, putting Case Edit\GetID() when Edit is not set with New_RichEdit fires IMA. Is there another approach to this issue? You can try this in RichEdit_Example.pb in last download file. If you comment out lines related to Edit = RichEdit::New_RichEdit and create any other gadget (for example, I added String gadget), compiling triggers IMA automatically, under the Select EventGadget() and Case Edit\GetID() part.
In addition, how can I catch events in RichEditor gadget with GetActiveGadget()? It doesn't seem to be triggered by something like GetActiveGadget() = Edit\GetID()...
-
- Always Here
- Posts: 6425
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: RichEdit Functions (OOP) New: with Image-Support
Broken link Thomas?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- Always Here
- Posts: 6425
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: RichEdit Functions (OOP) New: with Image-Support
Thanks RS
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: RichEdit Functions (OOP) New: with Image-Support
Hi
I've started using your richedit.pbi version 2.4.
But I've noticed what seems a bug:
When I call the RichEdit's Clear function, the text alignment and the bullet stay.
Here is a code to test this which shows the problem:
Unless I'm missing something, there is no way to reset the RTFModified status and the Bulleted state.
I've started using your richedit.pbi version 2.4.
But I've noticed what seems a bug:
When I call the RichEdit's Clear function, the text alignment and the bullet stay.
Here is a code to test this which shows the problem:
Code: Select all
XIncludeFile "RichEdit.pbi"
UseModule RichEdit
Global RTFEditor.RichEdit
If OpenWindow(0, #PB_Ignore, #PB_Ignore, 640, 480, "RichEdit test",
#PB_Window_SystemMenu | #PB_Window_ScreenCentered)
RTFEditor = New_RichEdit(0, 0, 640, 480)
RTFEditor\SetAlignment(#PFA_RIGHT)
RTFEditor\SetBulleted()
RTFEditor\Clear()
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Unless I'm missing something, there is no way to reset the RTFModified status and the Bulleted state.
Last edited by cyril on Sun Feb 23, 2020 8:40 pm, edited 2 times in total.
Re: RichEdit Functions (OOP) New: with Image-Support
I've made some modification to take in consideration my needs.
Here is the modified and added code:
for the SetModified function, I made a parameter, which was hidden, apparent in the list of function :
SetBulleted has an added parameter too:
Here is the modified and added code:
Code: Select all
; Added
Procedure.i RichEdit_GetBulleted(*this.RichEditClassTemplate)
Protected format.PARAFORMAT
format\cbSize = SizeOf(PARAFORMAT)
format\dwMask = #PFM_NUMBERING
format\wNumbering = #PFN_BULLET
;Read first
SendMessage_(*this\hWnd, #EM_GETPARAFORMAT, 0, @format)
ProcedureReturn format\wNumbering
EndProcedure
; Modified
Procedure.i RichEdit_SetBulleted(*this.RichEditClassTemplate, numbering.i = #PFN_BULLET)
; Description .......: Start / Change Slection to Bulleting
Protected format.PARAFORMAT
format\cbSize = SizeOf(PARAFORMAT)
format\dwMask = #PFM_NUMBERING
format\wNumbering = #PFN_BULLET
;Read first
SendMessage_(*this\hWnd, #EM_GETPARAFORMAT, 0, @format)
format\dwMask = #PFM_NUMBERING
format\wNumbering = numbering
ProcedureReturn SendMessage_(*this\hWnd, #EM_SETPARAFORMAT, 0, @format)
EndProcedure
Code: Select all
SetModified.i(state.i=#True)
Code: Select all
SetBulleted.i(numbering.i = #PFN_BULLET)
Re: RichEdit Functions (OOP) New: with Image-Support
Please help friends.
I really like this module, but there is a crash during printing if the document has a table in which a line break occurs.
I don't know how to fix it
I really like this module, but there is a crash during printing if the document has a table in which a line break occurs.
I don't know how to fix it
site created by purebasic work-flow-Initiative
Re: RichEdit Functions (OOP) New: with Image-Support
site created by purebasic work-flow-Initiative
Re: RichEdit Functions (OOP) New: with Image-Support
Thanks, siesit!
Re: RichEdit Functions (OOP) New: with Image-Support
New problem.
on windows 10 tables from opened .rtf files are not displayed
on windows 10 tables from opened .rtf files are not displayed
site created by purebasic work-flow-Initiative
Re: RichEdit Functions (OOP) New: with Image-Support
Hello there,
I use this great module for several projects. With new PB-Versions I have the following problems:
PB 6.01 LTS:
Spell checking shows a black underline instead of the wavy red line.
PB 6.03 LTS:
Spell checking, text alignment and custom fonts don't work anymore.
My OS is Win 11.
Does anybody have a clue?
I use this great module for several projects. With new PB-Versions I have the following problems:
PB 6.01 LTS:
Spell checking shows a black underline instead of the wavy red line.
PB 6.03 LTS:
Spell checking, text alignment and custom fonts don't work anymore.
My OS is Win 11.
Does anybody have a clue?
Stanley decided to go to the meeting room...
- OldSkoolGamer
- Enthusiast
- Posts: 148
- Joined: Mon Dec 15, 2008 11:15 pm
- Location: Nashville, TN
- Contact:
Re: RichEdit Functions (OOP) New: with Image-Support
I also have an issue with this and the latest PB6.03, if you try to catchRTF a stored image in memory it just says "The system cannot find the file specified" Out of my expertise to fix or know what to look at.
Re: RichEdit Functions (OOP) New: with Image-Support
You need to enable the RTF mode for the editogadget. Put this code after the line '\hWnd = GadgetID(\ID)':
Code: Select all
SendMessage_(\hWnd, #EM_SETTEXTMODE, #TM_RICHTEXT, 0)
Re: RichEdit Functions (OOP) New: with Image-Support
and in the responsible procedure there is an 'unknown' value added to the structure member
The MSDN shows some more structue members like
And the color RED is defined like UnderlineColor_Red = 0x05, but that could also be a coincidence.
just my two cents.....
Code: Select all
RichEdit_SetUnderlineWave(*this.RichEditClassTemplate)
; ...
format\bUnderlineType = #CFU_UNDERLINEWAVE ;| $50 ; <-- maybe this is the hack to get the RED (in older versions) ????
; ...
Code: Select all
BYTE bUnderlineColor;
just my two cents.....
Mostly running PureBasic <latest stable version and current alpha/beta> (x64) on Windows 11 Home