RaEditGadget Userlib

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post 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 :)
liverol
User
User
Posts: 26
Joined: Sat Jul 14, 2007 3:21 am

Post 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!!
liverol
User
User
Posts: 26
Joined: Sat Jul 14, 2007 3:21 am

Post by liverol »

anyone will help?
User avatar
hallodri
Enthusiast
Enthusiast
Posts: 208
Joined: Tue Nov 08, 2005 7:59 am
Location: Germany
Contact:

Post by hallodri »

Code: Select all

SendMessage_(GadgetID(#RaEdit), #REM_SETCHARTAB, ';', #CT_NONE)
SendMessage_(GadgetID(#RaEdit), #REM_SETCHARTAB, '&', #CT_CMNTCHAR)
liverol
User
User
Posts: 26
Joined: Sat Jul 14, 2007 3:21 am

Post 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 "!","@","$"....
User avatar
hallodri
Enthusiast
Enthusiast
Posts: 208
Joined: Tue Nov 08, 2005 7:59 am
Location: Germany
Contact:

Post 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
liverol
User
User
Posts: 26
Joined: Sat Jul 14, 2007 3:21 am

Post by liverol »

works!
appreciate!
User avatar
cabaptista
User
User
Posts: 86
Joined: Sun Nov 30, 2003 11:42 pm
Location: Lisboa, Portugal

Post 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
User avatar
hallodri
Enthusiast
Enthusiast
Posts: 208
Joined: Tue Nov 08, 2005 7:59 am
Location: Germany
Contact:

Post by hallodri »

Thanks for the nice report, please download again.
http://www.realsource.de/downloads/doc_ ... editgadget
Heathen
Enthusiast
Enthusiast
Posts: 498
Joined: Tue Sep 27, 2005 6:54 pm
Location: At my pc coding..

Post 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?
I love Purebasic.
User avatar
loadstone
User
User
Posts: 97
Joined: Wed Jan 16, 2008 11:28 am
Location: china

Post by loadstone »

Like it !!! :P
User avatar
sirrab
Enthusiast
Enthusiast
Posts: 106
Joined: Thu Dec 07, 2006 8:52 am
Location: New Zealand

panel gadget

Post 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
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post 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
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
sirrab
Enthusiast
Enthusiast
Posts: 106
Joined: Thu Dec 07, 2006 8:52 am
Location: New Zealand

Post by sirrab »

Hi TS-Soft,

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

Craig
newcoder
User
User
Posts: 13
Joined: Tue Nov 25, 2003 11:34 pm

Post 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.
Post Reply