wxFBE, editor for both Windows and Linux

User projects written in or related to FreeBASIC.
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Re: wxFBE, editor for both Windows and Linux

Postby AGS » Nov 03, 2012 8:25

leodescal wrote:Any update on what's going on?


Yes, you can find all the info you need here:
http://www.freebasic-portal.de/projekte/wxfbe-69.html

Most important bit is at the bottom (description of changes in SVN source repository).
MOD
Posts: 554
Joined: Jun 11, 2009 20:15

Re: wxFBE, editor for both Windows and Linux

Postby MOD » Nov 03, 2012 12:46

Thx AGS for pointing to the relevant page.

Short summary: you can now make projects, add files to the project, mark them as main module (for -m option), modul (normally added to the compile process) or normal file (will be opened but not added compile process, e.g. header files).
It's not complete yet as you can't delete a file from a project again (it's possible by deleting the file from the project xml). Projects should be placed in the wxFBE-project path until I fix the path system for it.
There's also a sample project.

Feel free to post any issues with project support here.
Jonge
Posts: 129
Joined: Jul 17, 2012 17:51
Location: Norway
Contact:

Re: wxFBE, editor for both Windows and Linux

Postby Jonge » Nov 03, 2012 13:18

Looks like you have made much progress lately. Will give it a try tonight :-)
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Postby AGS » Nov 04, 2012 22:10

I've got an idea for the searching function. This is the situation:
--> the user sets the cursor just before, after or inside a word in the source code;
--> the user presses ctrl - f (or selects search from the menu).

The text under the cursor is copied to the search text field of the
search dialogue . It should be enough to:
--> copy all the characters to the left of the cursor position until first white space character to
the left of the cursor position;
--> copy all the characters to the right of the cursor position until first white space character to
the right of the cursor position. If the cursor is at the end of the line there is nothing to copy.

The user gets a pre-filled search field. Which is very usable. It is not uncommon to want to
search for a certain identifier in source code (perhaps find all the calls to function x, y or z).

I think it's an easy feature to implement and I am sure it is a very usable one.

I've taken a look at the latest source and found little has changed to the regex code. I am 100%
sure longest match - searching is 'standard' (every editor I've ever used uses it).
I'll see whether I can fix it and get scintilla to 'behave' (do proper longest match regex matching).

Last but not least: they don't publish binaries (I think) but the people from
wxhaskell are maintaining C bindings to the wxwidgets library.
Could come in handy when the wx.NET people decide to stop maintaining the wx-C bindings.
MOD
Posts: 554
Joined: Jun 11, 2009 20:15

Re: wxFBE, editor for both Windows and Linux

Postby MOD » Nov 05, 2012 17:17

You can select a text and then start searching, the selected text will be used for search. But the help uses such a system.
I think it's easy to fix the issue with searching just by setting the cursor after the selected section before starting the next search.

wxHaskell seems as dead as wx.NET. The best way to go is to fork wx-c from wx.NET. I've set up a repository but had no time so far to do anything. My last tests ended with problems compiling wx-c on Windows with GCC and TDM (ld sucked up all my memory and quit working) and problems compiling wxWidgets on Linux (don't remember the exact problem anymore).
D.J.Peters
Posts: 7711
Joined: May 28, 2005 3:28

Re: wxFBE, editor for both Windows and Linux

Postby D.J.Peters » Nov 05, 2012 22:38

The last 24 hours I tryed to fix the wxWidgets GCC TDM problem without any success :-(
for other problems i have more than one code::blocks compiler sections

code::blocks settings->compiler and debuger-> global compiler settings

For example i can build
Irrlicht 1.7.x with gcc 4.4.1
Irrlicht 1.8.x with gcc 4.6.2 (only)

By the way for the 4.6.x gcc version you should
add this global linker settings
-static-libgcc
-static-libstdc++


Joshy
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Postby AGS » Nov 07, 2012 0:55

I fixed the issue with regular expressions for the 'search all' and 'search down' case
(looking up a text in one file).

For the 'search up' case I cannot get it to work yet.

I added one variable and changed a couple of lines in search.bas.

Line added to function searchThisFile.bas (line 40):

Code: Select all

If searchStarted = WX_FALSE Then
  ags_global = 0


ags_global is a global variable (shared) declared at the top of search.bas

Then I added a bit of code to setting of the current position (replaces code
at line 51/52 of of search.bas). This code is in searchThisFile as well.

Code: Select all

  if ags_global = 0 then
    wxStyledTextCtrl_SetCurrentPos( stcPTR, wxStyledTextCtrl_GetCurrentPos( stcPTR ) + 1 )
    ags_global = 1
  else
     if wxCheckBox_GetValue (searchAndRepDialog.checkboxRegExp) then   
        if direction = 0 orelse direction = 2 then
          wxStyledTextCtrl_SetCurrentPos( stcPTR, wxStyledTextCtrl_GetSelectionEnd( stcPTR ) + 1 )
        else
          ''wxStyledTextCtrl_SetCurrentPos( stcPTR, wxStyledTextCtrl_GetSelectionStart( stcPTR ) - 1 )         
        end if
     else
       wxStyledTextCtrl_SetCurrentPos( stcPTR, wxStyledTextCtrl_GetCurrentPos( stcPTR ) + 1 )
     end if
  end if   
  wxStyledTextCtrl_SearchAnchor( stcPTR )     


The ags_global is there to keep track of whether this is the first attempt at matching using
the current regex or not. If it is then setting the current position should be done as is done
for non - regex searching. Only after the first match should the end of selection be used.

Looking in the up - direction is a lot harder to get right. I have another scintilla based
editor and that editor does not get searching in the upward direction
right either (regex matching in that editor works fine otherwise).

My fix is not 100% perfect. An example.

Code: Select all

dim x as integer
dim y as integer
1000 234555 33322


When searching for \d+ the first selection becomes 1000.
Pressing search again changes the selection to 234555.
Then switch the search regex to [a-zA-Z][a-zA-Z0-9_]*.
Press search again. Message: "no match".
Press search again and the first "dim" gets found.
The 'no match' is incorrect. It should have matched the first
"dim" right away (not at the second attempt).

Whenever the search text changes the first matching attempt
should be done using

Code: Select all

    wxStyledTextCtrl_SetCurrentPos( stcPTR, wxStyledTextCtrl_GetCurrentPos( stcPTR ) + 1 )


Otherwise current position should be set to end of selection. I introduced ags_global to keep
track of the kind of change that would require the current position to be set to the end of the
matched text. But where (in what routine/line) to reset that value I don't know.
Resetting of ags_global should be done after a change of the search text and
before the user presses search.
Perhaps it would be possible to keep track of the current search text and the search text
in the combo box when the user presses search. If the two match then ags_global can keep
it's value. If there is a change then ags_global should be set to 0.
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Re: wxFBE, editor for both Windows and Linux

Postby AGS » Nov 07, 2012 2:17

MOD wrote:You can select a text and then start searching, the selected text will be used for search. But the help uses such a system.
I think it's easy to fix the issue with searching just by setting the cursor after the selected section before starting the next search.

wxHaskell seems as dead as wx.NET. The best way to go is to fork wx-c from wx.NET. I've set up a repository but had no time so far to do anything. My last tests ended with problems compiling wx-c on Windows with GCC and TDM (ld sucked up all my memory and quit working) and problems compiling wxWidgets on Linux (don't remember the exact problem anymore).


wxhaskell dead? Last release was on april 12 2012. Last update to github
repo on june 10, 2012 (5 months ago). And at that point the project had
bindings for wxwidgets version 2.9.3. Current wxwidgets development
release is at 2.9.4 so wxhaskell is one version behind on the development
release. That's good, isn't it? No binaries though but wxhaskell uses the same
void* approach as wx.net used.

wxhaskell started out with C bindings created for eiffel (I think). I'm sure the
people at wxhaskell would be very happy if you'd lend them a hand. It could
be an idea to join forces with wxhaskell. The objective is the same
(C bindings for wxwidgets). Would it not be great to have C bindings for
wxwidgets created by haskell- and BASIC programmers?

Or you could fork wx-c from wx.NET and maintain those bindings yourself.
MOD
Posts: 554
Joined: Jun 11, 2009 20:15

Re: wxFBE, editor for both Windows and Linux

Postby MOD » Nov 07, 2012 18:07

Thanks AGS for your work, I fixed the issue in my local repository with little changes to your code (e.g. without any additional global variable). It works backwards somehow but also not perfect, I will commit it this sunday I guess with some other changes.
I also fixed the problem when the search keyword was changed. You also almost found the right position to add it: in Sub comboSearch_event before wxEvent_Skip( event, WX_TRUE ).

wxHaskell seems dead to me because the first google result shows me this: http://wxhaskell.sourceforge.net/download.html
But this looks way better: http://code.haskell.org/wxhaskell/wxc/src/
As I said, it would be a pain to change all things to get it to work with this lib. I don't think it's the way I would go.
MOD
Posts: 554
Joined: Jun 11, 2009 20:15

Re: wxFBE, editor for both Windows and Linux

Postby MOD » Nov 10, 2012 17:08

Committed lots of stuff today.
Jonge
Posts: 129
Joined: Jul 17, 2012 17:51
Location: Norway
Contact:

Re: wxFBE, editor for both Windows and Linux

Postby Jonge » Nov 20, 2012 22:16

Will there be a new compiled release of wxFBE soon? I downloaded the source code and tried to run "compile.bat" but got a lot of errors.
MOD
Posts: 554
Joined: Jun 11, 2009 20:15

Re: wxFBE, editor for both Windows and Linux

Postby MOD » Nov 21, 2012 17:07

Some problems with the headers are explained here in this thread, besides I don't see any issues.

I've updated the download at FreeBASIC-Portal with new builds and files for Windows and Linux.
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Code completion

Postby AGS » Nov 22, 2012 6:26

There is something of a 'conflict' between the settings having
to do with case of keywords and code completion.

In the settings 'convert keywords' is set to Lower case. But
code completion shows me keywords in CamelCase. And after
insertion of a keyword the keyword is inserted in CamelCase.
Of course typing a separator takes care of the casing
but it's still somewhat odd.

The setting is called 'convert keywords' and that is exactly
what wxfbe does. But why not have the keywords in the list
in the case the user want to start with? I think it looks
better that way (changing the entries in the keyword table
upon setting 'convert keywords' could be an option). And
it just seems odd that when I type a keyword myself code
completion changes it to CamelCase for me (while I typed
it in lowercase). I want lowercase!!! Which I get (after typing
a separator). It's just a detail.

And why not have a close all button next to the close current
file button? Most operations come in threes (you can achieve
something by pressing a combination of keys, using the menu
or pressing a button on the toolbar). Which is great (I am a
keyboard addict myself). Why not go all the way and add close
all as a button on the toolbar as well?

An idea for the future: some sort of scripting interface. Geany
comes with lua scripting and many editors have python scripting.
Of course wxfbe will be using the BASIC language for scripting
purposes (what else?).

And about compiling: wxfbe compiled on my machine without
a problem. I did change the path to fbc (in compile.bat)
but that's fairly user specific (I'd expect other fb users to
have only one version of fbc.exe installed in a place where
the OS can find fbc.exe 'automagically').

I am using windows 7, pro version, fbc version 0.24.0.
MOD
Posts: 554
Joined: Jun 11, 2009 20:15

Re: wxFBE, editor for both Windows and Linux

Postby MOD » Nov 22, 2012 17:18

AutoComplete is in an early state, so many things (almost everything^^) are not done yet. I set in on my todo and will fix it at the weekend.

I want to keep the toolbar slim, that's why it's on the main manu but not in the toolbar. If you shrink the windows size, the toolbar buttons will disappear, so having less buttons is better for usability on screens with a small resolution (like my VM for doing the linux version).

I don't think I will ever implement a scripting language. It's simply to much work.

It's impossible to know where one has installed the compiler, so I dropped any path from the compile script. For me it's not a problem, as I added my fbc path to my PATH variable on Windows. On Linux it's supposed to work by nature.
MOD
Posts: 554
Joined: Jun 11, 2009 20:15

Re: wxFBE, editor for both Windows and Linux

Postby MOD » Nov 25, 2012 13:11

Fixed the case issue with auto complete. New builds for Windows and Linux are uploaded.

(You will probably see a dialog to configure the editor after the update. This is due to a new flag to check, whether this is the first start of the editor. Just click Ok, close or configure the options and you will never see it again if you keep using your own wxFBE.xml.)

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 3 guests