FbEdit

User projects written in or related to FreeBASIC.
Cherry
Posts: 351
Joined: Oct 23, 2007 12:06
Location: Austria
Contact:

Re: FbEdit

Postby Cherry » Jun 16, 2015 9:57

I was reluctant because I changed some things without updating the UI, but never mind, here it is: https://www.dropbox.com/s/ekq76lyncvoat ... ry.7z?dl=0

Most importantly, you probably have to adjust the paths for help files, etc. to your needs, and you also have to adjust the EnvironPaths themselves. However, I now added support for certain environment variables within the definition of others (and paths), but these cannot be set through the UI because there is still the folder selection dialog. You have to change the INI file directly.
Last edited by Cherry on Jun 17, 2015 9:22, edited 1 time in total.
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: FbEdit

Postby sancho2 » Jun 17, 2015 1:56

Hey thanks very much. However the download is coming in at 0k. There is some kind of problem with it.
Cherry
Posts: 351
Joined: Oct 23, 2007 12:06
Location: Austria
Contact:

Re: FbEdit

Postby Cherry » Jun 17, 2015 9:22

Yeah, it appears there are a few issues with my server atm.

Another link: https://www.dropbox.com/s/ekq76lyncvoat ... ry.7z?dl=0
integer
Posts: 373
Joined: Feb 01, 2007 16:54
Location: usa

Re: FbEdit

Postby integer » Jun 17, 2015 18:40

Thank you Cherry.

2 little questions:

1) When exiting the FbEdit, a dialog box pops up and says that the instruction at 0x5ad71531 references address at 0x00000014 and cannot be read. What is that?
[I know you're temped to say it's a hexadecimal number and the equivalent decimal value is ...]

Is this a normal exit for the program (FbEdit) ?


2) I went through the tutorials but cannot find (maybe went to fast) a way to tell FbEdit the path to the fbc.exe.
Which means (obviously) nothing compiles.
How do I set the compiler path for FbEdit?

Thanks.
fxm
Posts: 8508
Joined: Apr 22, 2009 12:46
Location: Paris (suburbs), FRANCE

Re: FbEdit

Postby fxm » Jun 17, 2015 19:25

integer wrote:How do I set the compiler path for FbEdit?

Options / Path Option / Compiler Path
nimdays
Posts: 212
Joined: May 29, 2014 22:01
Location: ID

Re: FbEdit

Postby nimdays » Jun 17, 2015 20:02

I don't know , but something wrong for me
"tre4 load error - is tre4.dll available?"
Yes the dll is there , mine is xp sp3
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: FbEdit

Postby sancho2 » Jun 18, 2015 0:20

Many thanks Cherry. Just trying it out now.
integer wrote:1) When exiting the FbEdit, a dialog box pops up and says that the instruction at 0x5ad71531 references address at 0x00000014 and cannot be read.
Is this a normal exit for the program (FbEdit) ?

@Integer - I am seeing this on exit as well. No this is not a normal exit. However it doesn't seem to affect anything. My settings get saved and there does not seem to be a process stranded. I can live with this minor issue.
@nimDays - I do not get that error. I am on xp sp3 as well. It would seem that the code is looking for tre4.dll in the wrong place. I don't know what tre4 does but I would double check the environment paths.
Thanks again Cherry.
nimdays
Posts: 212
Joined: May 29, 2014 22:01
Location: ID

Re: FbEdit

Postby nimdays » Jun 20, 2015 0:33

@sancho2 i don't know , maybe you're right
Problem solved by CFF Explorer(dependecy walker) ,install visual c 2008 redistribute.
Tourist Trap
Posts: 2387
Joined: Jun 02, 2015 16:24

Re: FbEdit

Postby Tourist Trap » Jul 14, 2015 18:23

Hello,

I use very often FBEdit now, so I would need to increase my control over its interface. My present focus is about the Tools menu, that contains buttons to activate many utilities, programs, like calculator, snippets etc.. So I wanted to know :
  • if it is possible (and how) to add one other external tool, like Hexedit for instance,
  • if it is possible to add a user defined shortcut to launch a menu item (code snippets comes bound to F11 for instance)
  • if it is possible, and this would be really nice, to add one of the items of the tools menu to the command bar (drag/drop or any other way)

Thanks very much.
St_W
Posts: 1435
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: FbEdit

Postby St_W » Jul 14, 2015 19:34

Tourist Trap wrote:- if it is possible (and how) to add one other external tool, like Hexedit for instance,

Use the tool options to add/edit entries in the "Tools" menu. You can find this in the Menu: "Options" -> "Tools Menu"

Tourist Trap wrote:- if it is possible to add a user defined shortcut to launch a menu item (code snippets comes bound to F11 for instance)
- if it is possible, and this would be really nice, to add one of the items of the tools menu to the command bar (drag/drop or any other way)

This is only possible by writing a addin for FBedit (Code Snippets is an addin for example). Same for adding items to the command bar. Drag and Drop is not possible.
Tourist Trap
Posts: 2387
Joined: Jun 02, 2015 16:24

Re: FbEdit

Postby Tourist Trap » Jul 20, 2015 16:52

Sorry if it has already been signaled, but in order to get this corrected some day... I have found this bug recently that I cant get rid of. Here how :
    Menu View--->Split screen
    Ctrl W--->Full screen
    Menu View--->Split screen (on the split zone, performing so Unsplit
    Ctrl W--->Leave full screen
As a result of those rather normal operations I've got half of the FBEdit work zone grayed and disabled...

Hope it can be fixed. However any workaround to get enabled back the whole work zone is welcome. I have to add that under full screen things are ok, but of course you loose menus, tabs views and other stuff.

[Edit: Found a workaround, use view --> Dual pane, it cancels the grey bank - hope it can help someone else also]
[Edit2: Today not grey bank but can't even get anything split or dualpaned in fullscreen... weird]
spartacus13012
Posts: 18
Joined: Nov 30, 2014 12:37
Location: FRANCE

Re: FbEdit

Postby spartacus13012 » Jul 23, 2015 14:42

Greeting of France,

I would like to develop an addin for FBedit, is what there is a material or a tutorial.

thank you in advance
St_W
Posts: 1435
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: FbEdit

Postby St_W » Jul 24, 2015 9:24

spartacus13012 wrote:I would like to develop an addin for FBedit, is what there is a material or a tutorial.

No, I don't think so. Once there was a forum at http://fbedit.freebasic.net but there was not much information either.

Anyway, a tutorial probably wouldn't help as you have to look into the FBedit source code either way to find out how you can implement your idea. For getting started you can/should look at existing addins. There are many of them that ship with FBedit and can be found in the FBedit sources on sourceforge (unfortunately sourceforge currently has major storage system issues and you cannot access the code at the moment until they have restored their service). I have also written some plugins several years ago, like TextFormat, HideSplash and NoPaste.

btw, FBedit development is inactive since already about 5 years - you might consider that before starting to write a plugin for it.
spartacus13012
Posts: 18
Joined: Nov 30, 2014 12:37
Location: FRANCE

Re: FbEdit

Postby spartacus13012 » Aug 16, 2015 18:57

Greeting of France,

I do not know if I am on good subject, but since I said it in a post precedent, I wanted to make out a will and ecrire an addin. I ended up making that I wanted: one which opens as ' encodes snipplets ' and which shows every ' TODO: contained in a file.

Now I would like to see the functioning of an addin which would intercept evenements keyboard and mouse in editeur of text of fbedit.

A generous ame would have it deja had resoudre has this probleme.

Thank you in advance

I have test this but it's give nothing.

Code: Select all

   '---------------------------------------------------------------------------
   #Include once "windows.bi"
   #include once "win\commctrl.bi"
   #include Once "addins.bi"

   dim SHARED hInstance as HINSTANCE
   dim SHARED hooks as ADDINHOOKS
   dim SHARED lpHandles as ADDINHANDLES ptr
   dim SHARED lpFunctions as ADDINFUNCTIONS ptr
   dim SHARED lpData as ADDINDATA ptr

   Dim Shared lpOldWndProcEdit      As Any Ptr
   '---------------------------------------------------------------------------
   Sub LOC_messageOutput(ByVal msg_ As String)        ' affiche message
      SendMessage(lpHandles->hout, EM_REPLACESEL, FALSE, _
                     Cast(Integer, StrPtr(msg_)))
      SendMessage(lpHandles->hout, EM_REPLACESEL, FALSE, _
                     Cast(Integer, StrPtr(Chr(13))))
   End Sub
   
   Function WndProcEdit(ByVal hWin_ As HWND, _
               ByVal uMsg_   As UINT, _
               ByVal wParam_    As WPARAM, _
               ByVal lParam_    As LPARAM) As Integer
      
      LOC_messageOutput("4 bouton souris dans edit")
      
      Select Case uMsg_
         Case WM_LBUTTONDOWN
            LOC_messageOutput("2 bouton souris dans edit") 
      End Select
   
      Return CallWindowProc(lpOldWndProcEdit, hWin_, uMsg_, wParam_, lParam_)
   End Function
   '---------------------------------------------------------------------------
   function InstallDll CDECL alias "InstallDll" (byval hWin as HWND, _
               ByVal hInst as HINSTANCE) as ADDINHOOKS ptr EXPORT
      ' The dll's instance
      hInstance=hInst
      
      ' Get pointer to ADDINHANDLES
      lpHandles=Cast(ADDINHANDLES ptr,SendMessage(hWin,AIM_GETHANDLES,0,0))
      
      ' Get pointer to ADDINDATA
      lpData=Cast(ADDINDATA ptr,SendMessage(hWin,AIM_GETDATA,0,0))
      
      ' Get pointer to ADDINFUNCTIONS
      lpFunctions=Cast(ADDINFUNCTIONS ptr,SendMessage(hWin,AIM_GETFUNCTIONS,0,0))
      
      ' Messages this addin will hook into
      hooks.hook1=HOOK_COMMAND
      hooks.hook2=0
      hooks.hook3=0
      hooks.hook4=0
      
      lpOldWndProcEdit = Cast(Any Ptr, SetWindowLong(lpHANDLES->hred, _ 'TODO:
                           GWL_WNDPROC, Cast(Integer, @WndProcEdit)))
      
      return @hooks
   End function

   function DllFunction CDECL alias "DllFunction" (byval hWin as HWND,
byval uMsg as UINT,byval wParam as WPARAM,byval lParam as LPARAM) as bool EXPORT
      select case uMsg
         case AIM_COMMAND
            '
         case AIM_CLOSE
            '
      end select
   
      return FALSE
   end function
   '---------------------------------------------------------------------------
St_W
Posts: 1435
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: FbEdit

Postby St_W » Aug 17, 2015 15:26

spartacus13012 wrote:[..] I ended up making that I wanted: one which opens as ' encodes snipplets ' and which shows every ' TODO: contained in a file.

Now I would like to see the functioning of an addin which would intercept evenements keyboard and mouse in editeur of text of fbedit.
A generous ame would have it deja had resoudre has this probleme.

Your approach does not work because of multiple reasons:
1. there is no single edit control - a new edit control is created for each new file opened. lpHANDLES->hred is zero at plugin initialization
2. the RAEdit control consists of multiple child-windows, which receive and handle most window messages. the probably most important one is RAEditChild, which contains the editor window. For some reason there are 2 such RAEditChild windows - you could look into the RAEdit source code to find out why and what it does.

You can do it like this:
1. specify HOOK_CREATEEDIT to receive notifications on RAEdit control creation
2. handle AIM_CREATEEDIT:
2.a: Retrieve RAEditChild window handles from RAEdit window handle (passed as wParam)
2.b: Subclass the child window
2.c: Save the old wndProc
3. Call the old wndProc in the new wndProc

Some concept code:

Code: Select all

#Include Once "windows.bi"
#include once "win/richedit.bi"
#include once "win/commctrl.bi"

#Include Once "fbedit/raedit.bi"
#Include Once "fbedit/addins.bi"


Dim Shared As Integer lpOldWndProcEdit

'FBedit Addin Variables
Dim Shared hooks as ADDINHOOKS
Dim Shared lpHandles as ADDINHANDLES ptr
Dim Shared lpFunctions as ADDINFUNCTIONS ptr
Dim Shared lpData as ADDINDATA Ptr


Function InstallDll CDECL alias "InstallDll" (byval hWin as HWND,byval hInst as HINSTANCE) as ADDINHOOKS ptr EXPORT

   lpHandles = Cast(ADDINHANDLES ptr, SendMessage(hWin, AIM_GETHANDLES, 0, 0))
   lpData = Cast(ADDINDATA ptr, SendMessage(hWin, AIM_GETDATA, 0, 0))
   lpFunctions = Cast(ADDINFUNCTIONS ptr, SendMessage(hWin,AIM_GETFUNCTIONS, 0, 0))
   
   OutputDebugString("TEST: Install")
   'DebugBreak()
   

   Dim tmp As String
   tmp = Str(lpHandles->hred)
   OutputDebugString(StrPtr(tmp))

   hooks.hook1 = HOOK_CREATEEDIT
   hooks.hook2 = 0
   hooks.hook3 = 0
   hooks.hook4 = 0
   return @hooks

End Function


Function WndProcEdit(ByVal hWin_ As HWND, _
              ByVal uMsg_ As UINT, _
              ByVal wParam_   As WPARAM, _
              ByVal lParam_   As LPARAM) As Integer
             
  'Dim As String wmName
  'wmName = "TEST: edit ctl wndProc "+getWMName(uMsg_)
  'OutputDebugString(StrPtr(wmname))
 
  Select Case uMsg_
      Case WM_LBUTTONDOWN
          OutputDebugString("TEST: 2 bouton souris dans edit") 
  End Select

  Return CallWindowProc(lpOldWndProcEdit, hWin_, uMsg_, wParam_, lParam_)
End Function
   

Function DllFunction CDECL alias "DllFunction" (byval hWin as HWND,byval uMsg as UINT,byval wParam as WPARAM,byval lParam as LPARAM) as bool EXPORT
   
   Select Case uMsg
                  
      Case AIM_CREATEEDIT
         OutputDebugString("TEST: EditCreated")
         Dim As String tmp
         tmp = "TEST: Edit Ctl hWnd " + hex(wParam, 8)
         OutputDebugString(StrPtr(tmp))
         Dim As HWND editChildhWnd, editChildhWnd2
         editChildhWnd = FindWindowEx(wParam, 0, @"RAEditChild", 0)
         editChildhWnd2 = FindWindowEx(wParam, editChildhWnd, @"RAEditChild", 0)
         tmp = "TEST: Edit Child 1 Ctl hWnd " + Hex(editChildhWnd, 8)
         OutputDebugString(StrPtr(tmp))
         tmp = "TEST: Edit Child 2 Ctl hWnd " + Hex(editChildhWnd2, 8)
         OutputDebugString(StrPtr(tmp))
         
         lpOldWndProcEdit = SetWindowLong(editChildhWnd2, GWL_WNDPROC, @WndProcEdit)
         

   end select
   return FALSE
End Function

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 4 guests