rich text editor examples?
rich text editor examples?
Hi, I'm stuck.
Are there any code examples of how to create a rich text editor inside a scroll area, inside a splitter gadget with a listviewgadget to the right side. I've got some of my old code converted to PB 4 but now it's just driving me nuts and I want to start from scratch... I hope you understood that. Thanks.
Are there any code examples of how to create a rich text editor inside a scroll area, inside a splitter gadget with a listviewgadget to the right side. I've got some of my old code converted to PB 4 but now it's just driving me nuts and I want to start from scratch... I hope you understood that. Thanks.
Ok, here's a sane question... or is it?
How can I put a Win32 richedit window into a splitter gadget?
How can I put a Win32 richedit window into a splitter gadget?
Code: Select all
If OpenWindow(0, 0, 0, 230, 180, "SplitterGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If CreateGadgetList(WindowID(0))
#ListViewGadget = 1
#Splitter = 2
RichEditGadget = CreateWindowEx_(#WS_EX_WINDOWEDGE,"RichEdit20A",0,#Flags, 0, 0, 0, 0, WindowID(0), #GADGET_RICHTEXT, GetModuleHandle_(0), 0)
ListViewGadget(#ListViewGadget, 10, 10, 250, 120)
SplitterGadget(#Splitter, 5, 5, 220, 120, RichEditGadget, #ListViewGadget, #PB_Splitter_Separator)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
EndIf
- Rook Zimbabwe
- Addict
- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
I think your problem may have to do with HOW you created your rich edit gadget...
Though I can'tt see why you would want to do this.
Though I can'tt see why you would want to do this.

Code: Select all
Enumeration
#ListViewGadget0
#ListViewGadget1
#Splitter
EndEnumeration
If OpenWindow(0, 0, 0, 230, 180, "SplitterGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If CreateGadgetList(WindowID(0))
ListViewGadget(#ListViewGadget0, 0, 0, 0, 0)
ListViewGadget(#ListViewGadget1, 0, 0, 0, 0)
SplitterGadget(#Splitter, 5, 5, 220, 120, #ListViewGadget0, #ListViewGadget1, #PB_Splitter_Separator)
TextGadget(3, 10, 135, 210, 40, "Above GUI part shows two automatically resizing buttons inside the 230x130 SplitterGadget area.",#PB_Text_Center )
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
EndIf
I don't know much about the editor gadget. The help file doesn't even say it's a rich text gadget. Where can I find out more about the editor gadget? Is there a limit to how much text it can contain? I use the RichEdit dll for 2 reasons:
1. All the old code is written for the RichEdit window.
2. I know it opens very large text files, several MBs.
1. All the old code is written for the RichEdit window.
2. I know it opens very large text files, several MBs.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
PB's EditorGadget is a RichEdit control on Windows (class = "RichEdit20A" here on NT4).hagibaba wrote:I don't know much about the editor gadget. The help file doesn't even say it's a rich text gadget.
So you can use any code written for RicheEdit controls, with #EM_* messages, #EN_* notifications, etc...
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Large files should not be a problem as long as you extend the default 32,767 text limit with
Code: Select all
SendMessage_(GadgetID(#EditorGadget), #EM_LIMITTEXT, -1, 0)
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
Mighty nice to know.Sparkie wrote:Large files should not be a problem as long as you extend the default 32,767 text limit withCode: Select all
SendMessage_(GadgetID(#EditorGadget), #EM_LIMITTEXT, -1, 0)
Thanks.
cheers
Yay! This is what I was hoping. Thanks gnozal.gnozal wrote: PB's EditorGadget is a RichEdit control on Windows (class = "RichEdit20A" here on NT4).
So you can use any code written for RicheEdit controls, with #EM_* messages, #EN_* notifications, etc...
Thanks for the tip Sparkie.
I'm now rewriting the program to use the EditorGadget.