Page 5 of 6

Posted: Mon May 12, 2008 2:36 pm
by ricardo
ts-soft wrote:
ricardo wrote: 1.- What the purpose of "!wend" in RaEditAddDefBlock(#RaEdit,"while !wend", "wend", #BD_INCLUDELAST)?
This is for ignore both word in one line.

Code: Select all

While a : Wend
Thanks for your explanation :)

Posted: Mon May 19, 2008 10:09 am
by liverol
hi,
i want to redefine the comment symbol(default it use ";"),
so i can use this lib to write a custom script editor for my work.
how can i change the comment symbol?

eg: using "&" to comment a line rather than ";"

appreciate!!

Posted: Sun May 25, 2008 1:05 am
by liverol
anyone will help?

Posted: Sun May 25, 2008 8:15 am
by hallodri

Code: Select all

SendMessage_(GadgetID(#RaEdit), #REM_SETCHARTAB, ';', #CT_NONE)
SendMessage_(GadgetID(#RaEdit), #REM_SETCHARTAB, '&', #CT_CMNTCHAR)

Posted: Tue May 27, 2008 8:18 am
by liverol
thanks,
the first message make symbol ";" nothing,it works,
but the second message didn't work!
the symbol "&" still can't use to comment,also i tried "!","@","$"....

Posted: Tue May 27, 2008 9:48 am
by hallodri
And this ?

Code: Select all

XIncludeFile #PB_Compiler_Home + "include\raedit.pb"

hwnd = OpenWindow(0,#PB_Ignore,#PB_Ignore,280,200,"")

CreateGadgetList(hwnd)
ra = RaEditGadget(0,0,0,280,200,0,0)

font = LoadFont(0,"courier new",10)
SetGadgetFont(0,font)
SetGadgetColor(0,#RAEdit_CommentColor,$0000FF)

SendMessage_(ra, #REM_SETCHARTAB, ';', #CT_NONE)
SendMessage_(ra, #REM_SETCHARTAB, '&', #CT_CMNTCHAR)

SetGadgetText(0,"blaaaaa &blaaaa")



Repeat
  event = WaitWindowEvent()
 
Until event = #PB_Event_CloseWindow

Posted: Tue May 27, 2008 11:58 am
by liverol
works!
appreciate!

Posted: Tue May 27, 2008 5:40 pm
by cabaptista
Hi ts-soft,

Two thinks for you to see (sorry if they were posted before):

1) When you create a new RaEdit object without Definition Blocks (but you don´t say explicitly that you don´t want them), run the code and click on collapse all button it crashes. In raedit.pb, procedure "_raedit_command_callback" you need to test "*RAData\BlockList" if it has something like this

Code: Select all

...
If *RAData\BlockList
            ForEachObject(*RAData\BlockList ,*bd) ; pureobject.inc.pb 
...
2) When creating a RaEdit object with "#PB_Any" it crashes in raedit.pb, procedure "RaEditGadget" in (see comment)

Code: Select all

...
    If (id = #PB_Any)
      *RaEdit\id = result
    Else
      *RaEdit\id = id
    EndIf
    
      RemoveKeyboardShortcut(*RaEdit\id, 9) ; CRASHES !!!!!!
      
	SendMessage_(hwnd, #REM_TABWIDTH,2,1)
...
Thanks in advance,

César Baptista

Posted: Wed May 28, 2008 12:32 am
by hallodri
Thanks for the nice report, please download again.
http://www.realsource.de/downloads/doc_ ... editgadget

Posted: Sat Jun 14, 2008 12:31 pm
by Heathen
One problem is it doesn't seem to be possible to use 2 characters for comments. I'm trying to make an editor for my program which uses LUA, but LUA uses "--". Is there a way around this?

Posted: Thu Jul 03, 2008 6:43 am
by loadstone
Like it !!! :P

panel gadget

Posted: Sun Jul 20, 2008 11:40 am
by sirrab
Hi,

I love your control :D

I am trying to use your control in a panel gadget but i always get an error.

here is my code

Code: Select all


XIncludeFile (#PB_Compiler_Home+"Include\raedit.pb")

IncludeFile "editor includes\editorform.pb"

Open_caspereditor()

Repeat ; Start of the event loop
  
  Event = WaitWindowEvent() ; This line waits until an event is received from Windows
  WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
  GadgetID = EventGadget() ; Is it a gadget event?
  EventType = EventType() ; The event type
  
  
  
  If Event = #PB_Event_Gadget
    
  EndIf
  
Until Event = #PB_Event_CloseWindow ; End of the event loop

End

editorform.pb

Code: Select all

Enumeration
  #caspereditorwin
  #editorpanel
  #RaEdit
  
EndEnumeration


Procedure Open_caspereditor()
  If OpenWindow(#caspereditorwin, 228, 55,1024,768, "CPK Editor",  #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered )
    If CreateGadgetList(WindowID(#caspereditorwin))
      PanelGadget(#editorpanel,0,40,700,500) 
      AddGadgetItem(#editorpanel,-1,"New")
   
    RaEditGadget(#RaEdit, 0,0,700,500)
      RaEditAddDefBlock(#RaEdit,"procedure", "endprocedure", #BD_INCLUDELAST | #BD_DIVIDERLINE)
      SetGadgetAttribute(#RaEdit, #RaEdit_HilightLine, #True)
      SetGadgetAttribute(#RaEdit, #RaEdit_LineNumberBar, #True)
      RaEditSetHiliteWords(#RaEdit,RGB(24, 130, 173),"procedure")
      
      ;CloseGadgetList()

    EndIf
  EndIf
EndProcedure
Thanks
Craig

Posted: Sun Jul 20, 2008 4:34 pm
by ts-soft
In the moment only a workaround:
Remove

Code: Select all

RemoveKeyboardShortcut(GetProp_(*Globals\CurrentWindow, "PB_WindowID")-1, 9)
SendMessage_(hwnd, #REM_TABWIDTH, 2, 1)
at line 1412 - 1413? in raedit.pb


greetings
Thomas

Posted: Mon Jul 21, 2008 7:53 am
by sirrab
Hi TS-Soft,

Thanks for the info, I'll rem it out :D

Craig

Posted: Fri Jul 25, 2008 2:01 am
by newcoder
can some show me some code to actually get the text from ragadget and save into a file. I get it to save into a file, but all text is bunched together


For Example:
Hello
My
Name
is
Newcoder
becomes
HelloMyNameisNewcoder
when I save it. I must be missing something here.