Page 1 of 1
					
				rich text editor examples?
				Posted: Tue Apr 15, 2008 8:38 pm
				by hagibaba
				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.
			 
			
					
				
				Posted: Tue Apr 15, 2008 9:14 pm
				by hagibaba
				Never mind, I'll figure it out myself. I just had a little panic attack. Damn StickyWindow command.
			 
			
					
				
				Posted: Tue Apr 15, 2008 9:58 pm
				by hagibaba
				Ok, here's a sane question... or is it?
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
 
			 
			
					
				
				Posted: Wed Apr 16, 2008 3:13 am
				by Rook Zimbabwe
				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.  
 
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
 
			 
			
					
				
				Posted: Wed Apr 16, 2008 3:24 am
				by Sparkie
				Why not use PB's EditorGadget in place of API RichEdit20A?
			 
			
					
				
				Posted: Wed Apr 16, 2008 3:34 am
				by rsts
				Yes, I use a PB editor gadget in a splitter and everything seems to work fine.
cheers
			 
			
					
				
				Posted: Wed Apr 16, 2008 3:07 pm
				by hagibaba
				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.
			 
			
					
				
				Posted: Wed Apr 16, 2008 3:21 pm
				by gnozal
				hagibaba wrote:I don't know much about the editor gadget. The help file doesn't even say it's a rich text gadget.
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...
 
			 
			
					
				
				Posted: Wed Apr 16, 2008 3:27 pm
				by Sparkie
				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)
 
			 
			
					
				
				Posted: Wed Apr 16, 2008 3:45 pm
				by rsts
				Sparkie wrote: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)
 
Mighty nice to know.
Thanks.
cheers
 
			 
			
					
				
				Posted: Wed Apr 16, 2008 3:50 pm
				by Sparkie
				You're welcome. I don't remember who I picked that one up from... most likely it was freak.  

 
			 
			
					
				
				Posted: Thu Apr 17, 2008 2:35 am
				by hagibaba
				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...
Yay! This is what I was hoping. Thanks gnozal.
Thanks for the tip Sparkie.
I'm now rewriting the program to use the EditorGadget.