IUP_FB_EDITOR (simple development environment)

User projects written in or related to FreeBASIC.
Post Reply
Cretin Ho
Posts: 182
Joined: Feb 04, 2021 13:01

Re: IUP_FB_EDITOR (simple development environment)

Post by Cretin Ho »

Note: last IUP version with GTK2: https://sourceforge.net/projects/iup/fi ... Libraries/

You should consider rebuild your release with GTK3, though.
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: IUP_FB_EDITOR (simple development environment)

Post by VANYA »

Cretin Ho wrote:Note: last IUP version with GTK2: https://sourceforge.net/projects/iup/fi ... Libraries/

You should consider rebuild your release with GTK3, though.
Sorry, I did not notice this post.
I thought about it, but so far there are no IUP (GTK3) headers for the compiler. And this is not strictly necessary as long as Linux has GTK2 support. Of course, there are no difficulties, but I do not want to follow the IUP updates. Maybe tomorrow the author of IUP will opt for GTK4, removing all versions of GTK2, GTK3. I shouldn't follow him. I indicated the version with which the editor works, and then the user can decide whether to use the editor or not.
Cretin Ho
Posts: 182
Joined: Feb 04, 2021 13:01

Re: IUP_FB_EDITOR (simple development environment)

Post by Cretin Ho »

The only thing I want you to improve now is stop making the file type when selecting new compiler as fbc.exe. Your hard coded it to fbc.exe is a bit premature. The fbc binary could be fbc32.exe, fbc64.exe or on Linux it has no extensions at all, just fbc. I know you want users easier to set thing up, but I think they could select the correct compiler anyway, so you don't need to hard coded it like that.
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: IUP_FB_EDITOR (simple development environment)

Post by VANYA »

Cretin Ho wrote:The only thing I want you to improve now is stop making the file type when selecting new compiler as fbc.exe. Your hard coded it to fbc.exe is a bit premature. The fbc binary could be fbc32.exe, fbc64.exe or on Linux it has no extensions at all, just fbc. I know you want users easier to set thing up, but I think they could select the correct compiler anyway, so you don't need to hard coded it like that.
I took your advice and have already made the changes on my local machine. I cannot say yet when I will post the new version, but it will already contain this change.
Cretin Ho
Posts: 182
Joined: Feb 04, 2021 13:01

Re: IUP_FB_EDITOR (simple development environment)

Post by Cretin Ho »

VANYA wrote:I took your advice and have already made the changes on my local machine. I cannot say yet when I will post the new version, but it will already contain this change.
Thank you.
Cretin Ho
Posts: 182
Joined: Feb 04, 2021 13:01

Re: IUP_FB_EDITOR (simple development environment)

Post by Cretin Ho »

How to compile your IDE from source? I made a few modifications and wanted to compile it to see the result. Thanks.
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: IUP_FB_EDITOR (simple development environment)

Post by VANYA »

Cretin Ho wrote:How to compile your IDE from source? I made a few modifications and wanted to compile it to see the result. Thanks.
The files are provided for compilation: build.bat (for windows) , makefile (for Linux).

In general, for compiling only the editor: fbc fbnp.bas. Plugins are compiled in a similar way.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: IUP_FB_EDITOR (simple development environment)

Post by D.J.Peters »

What are the syntax or var names for current file and path to config the tool menu ?

Joshy
someting like this:

Code: Select all

[TOOL]
c1=d:\FreeBASIC\mytool-32.exe $FILE
c2=d:\FreeBASIC\mytool-64.exe $PATH $FILE $EXT -x $PATH test.exe
c3=
n1=FreeBASIC 32-bit
n2=FreeBASIC 64-bit
n3=
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: IUP_FB_EDITOR (simple development environment)

Post by VANYA »

D.J.Peters wrote:What are the syntax or var names for current file and path to config the tool menu ?
There is only one variable in the editor:

$A - denotes the current path of the editor executable , the same as exepath().
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: IUP_FB_EDITOR (simple development environment)

Post by D.J.Peters »

VANYA wrote:There is only one variable in the editor
So the tools menu is useless at this date ?

I mean a programing tool needs at least the current file name right ?

Joshy
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: IUP_FB_EDITOR (simple development environment)

Post by VANYA »

D.J.Peters wrote:So the tools menu is useless at this date ?

I mean a programing tool needs at least the current file name right ?

Joshy
I have 4 tools in this menu: code templates, on-screen measurement, compiler version, data in hex. This menu is useful for me.
If it is useful to anyone, I will write some variables.

$PATH , $FILE , $EXT will be enough or what else do you need?
Cretin Ho
Posts: 182
Joined: Feb 04, 2021 13:01

Re: IUP_FB_EDITOR (simple development environment)

Post by Cretin Ho »

VANYA wrote:
Cretin Ho wrote:How to compile your IDE from source? I made a few modifications and wanted to compile it to see the result. Thanks.
The files are provided for compilation: build.bat (for windows) , makefile (for Linux).

In general, for compiling only the editor: fbc fbnp.bas. Plugins are compiled in a similar way.
Sorry, I didn't see the makefile. While waiting for your next release to remove the hard coded "fbc.exe" file type, I edited the source code to remove it myself. We can workaround it by manually typing the name of the executable (just "fbc" on Linux) but it's just annoying when you have to this again and again when specifying other fbc versions. Everything is fine now.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: IUP_FB_EDITOR (simple development environment)

Post by D.J.Peters »

VANYA wrote:$PATH , $FILE , $EXT will be enough ...
Yes thank you and good job so far.

Joshy

EDIT: would be nice if $FILE doesn't include the path nor the file extension

imagine a current file "project/test01.bas"
a external tool can create a *.bi file
mytool -i $PATH/$FILE/$EXT -o $PATH/$FILE.bi

will create "project/test01.bi"
...
Cretin Ho
Posts: 182
Joined: Feb 04, 2021 13:01

Re: IUP_FB_EDITOR (simple development environment)

Post by Cretin Ho »

Hi, VANYA. Your code failed to compile on FreeBSD/x86_64:

Code: Select all

$ gmake
rm -f ./fbnp
rm -f ../IUP_FB_EDITOR
fbc fbnp.bas
/usr/home/fellow/Downloads/source/tabs.bi(142) error 42: Variable not declared, tabs in 'IupSetAttribute(tabs, "TABVISIBLE0", "NO")'
/usr/home/fellow/Downloads/source/tabs.bi(144) error 1: Argument count mismatch, found 'tabs' in 'IupSetAttribute(tabs, "SHOWCLOSE", "Yes")'
/usr/home/fellow/Downloads/source/tabs.bi(146) error 1: Argument count mismatch, found 'tabs' in 'IupSetAttribute(tabs, "TABSFONTSIZE", "12")'
/usr/home/fellow/Downloads/source/tabs.bi(148) error 1: Argument count mismatch, found 'tabs' in 'IupSetAttribute(tabs, "TABSPADDING", "x2" )'
/usr/home/fellow/Downloads/source/tabs.bi(150) error 1: Argument count mismatch, found 'tabs' in 'IupSetCallback(tabs, "TABCHANGEPOS_CB", Cast(Any Ptr,@tab_change_pos_callback))'
/usr/home/fellow/Downloads/source/tabs.bi(152) error 1: Argument count mismatch, found 'tabs' in 'IupSetCallback(tabs, "TABCLOSE_CB", Cast(Any Ptr,@tab_close_callback))'
/usr/home/fellow/Downloads/source/tabs.bi(154) error 1: Argument count mismatch, found 'tabs' in 'IupSetCallback(tabs, "FLAT_BUTTON_CB", Cast(Any Ptr, @tab_flat_button_callback))'
/usr/home/fellow/Downloads/source/tabs.bi(156) error 9: Expected expression, found 'tabs' in 'Return tabs'
/usr/home/fellow/Downloads/source/tabs.bi(158) warning 13(1): Function result was not explicitly set
gmake: *** [makefile:9: fbnp] Error 1
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: IUP_FB_EDITOR (simple development environment)

Post by VANYA »

Cretin Ho wrote:Hi, VANYA. Your code failed to compile on FreeBSD/x86_64:
I do not officially support FreeBSD. But you can try to rewrite the code in the tabs.bi file:

this code:

Code: Select all

#ifdef __FB_LINUX__
		
	#ifdef __FB_64BIT__
			
		dim as IHandle ptr tabs = IupFlatTabs(vBox,null)
			
		IupSetAttribute(tabs, "FORECOLOR", "0 0 0")
			
		IupSetAttribute(tabs, "BGCOLOR", "230 230 230")
			
	#else
			
		dim as IHandle ptr tabs = IupTabs(vBox,null)
			
	#endif
		
#endif
	
#ifdef __FB_WIN32__
		
	dim as IHandle ptr tabs = IupFlatTabs(vBox,null)
		
	IupSetAttribute(tabs, "FORECOLOR", "0 0 0")
		
	IupSetAttribute(tabs, "BGCOLOR", "230 230 230")
		
#endif
replace with this one:

Code: Select all

#ifdef __FB_WIN32__
		
	dim as IHandle ptr tabs = IupFlatTabs(vBox,null)
		
	IupSetAttribute(tabs, "FORECOLOR", "0 0 0")
		
	IupSetAttribute(tabs, "BGCOLOR", "230 230 230")
		
#else
	
	#ifdef __FB_64BIT__
			
		dim as IHandle ptr tabs = IupFlatTabs(vBox,null)
			
		IupSetAttribute(tabs, "FORECOLOR", "0 0 0")
			
		IupSetAttribute(tabs, "BGCOLOR", "230 230 230")
			
	#else
			
		dim as IHandle ptr tabs = IupTabs(vBox,null)
			
	#endif
		
#endif
Post Reply