VisualFBEditor - IDE for FreeBasic

User projects written in or related to FreeBASIC.
Post Reply
Xusinboy Bekchanov
Posts: 806
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

xiaoyao wrote: Jun 08, 2024 10:13 19. Select the UI mode as GTK4, and the result is wrong.

compiler\bin\win32\ld.exe: cannot find -lglib-2.0: No such file or directory
compiler\bin\win32\ld.exe: cannot find -lgthread-2.0: No such file or directory
To compile it, these lib files are required, copy these lib files to the lib folder of the fbc compiler.
xiaoyao wrote: Jun 08, 2024 10:13 20. Project templates should be added: GTK ui interface project, WINDOWS form program project
Added: GTK Application project template:
https://github.com/XusinboyBekchanov/Vi ... 6886d6e425
Updated: GTK Application template:
https://github.com/XusinboyBekchanov/Vi ... 55175fe1b8
Xusinboy Bekchanov
Posts: 806
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

xiaoyao wrote: Jun 13, 2024 9:10 As for the previous question, the compiled EXE is running. If you recompile it, it would be better to prompt whether to terminate the last process.
Forcibly terminating a process can lead to memory leaks in the system, so it is better for the user to close it in the usual way.
xiaoyao wrote: Jun 13, 2024 9:10 Question 21: Project:\Examples\Add-In, how to use the plug-in
A new plug-in project was created, and the compilation error was: \compiler\bin\win32\ld.exe: cannot open output file ../AddIns/MyAddin (x32).dll: No such file or directory
The compiler cannot find such a directory. If you save the project in the Projects folder, the directory path should be like this: ../../AddIns.
I fixed this:

Fixed: Addin template project:
https://github.com/XusinboyBekchanov/Vi ... 48e673c7fa
xiaoyao wrote: Jun 13, 2024 9:10 22. The vbcrlf function cannot be used and this header file vbcompat.bi needs to be quoted.
Yes, it would be better if the IDE offers to include the necessary includes.
xiaoyao wrote: Jun 13, 2024 9:10 23. It is best that when the IDE is run for the first time, it will automatically add the opening method of *.VFP as fbeditor.
This can also be done.
xiaoyao wrote: Jun 13, 2024 9:10 24. You can add the concept of control array, textbox1(index)
This is supported in the program:

Code: Select all

'#Region "Form"
	#if defined(__FB_MAIN__) AndAlso Not defined(__MAIN_FILE__)
		#define __MAIN_FILE__
		#ifdef __FB_WIN32__
			#cmdline "Form1.rc"
		#endif
		Const _MAIN_FILE_ = __FILE__
	#endif
	#include once "mff/Form.bi"
	#include once "mff/TextBox.bi"
	
	Using My.Sys.Forms
	
	Type Form1Type Extends Form
		Declare Sub TextBox1_Click(ByRef Sender As Control)
		Declare Constructor
		
		Dim As TextBox TextBox1(1)
	End Type
	
	Constructor Form1Type
		#if _MAIN_FILE_ = __FILE__
			With App
				.CurLanguagePath = ExePath & "/Languages/"
				.CurLanguage = My.Sys.Language
			End With
		#endif
		' Form1
		With This
			.Name = "Form1"
			.Text = "Form1"
			.Designer = @This
			.SetBounds 0, 0, 350, 300
		End With
		' TextBox1(0)
		With TextBox1(0)
			.Name = "TextBox1(0)"
			.Text = "TextBox1(0)"
			.TabIndex = 0
			.SetBounds 70, 80, 140, 40
			.Designer = @This
			.OnClick = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As Control), @TextBox1_Click)
			.Parent = @This
		End With
		' TextBox1(1)
		With TextBox1(1)
			.Name = "TextBox1(1)"
			.Text = "TextBox1(1)"
			.TabIndex = 1
			.ControlIndex = 0
			.SetBounds 70, 130, 140, 40
			.Designer = @This
			.OnClick = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As Control), @TextBox1_Click)
			.Parent = @This
		End With
	End Constructor
	
	Dim Shared Form1 As Form1Type
	
	#if _MAIN_FILE_ = __FILE__
		App.DarkMode = True
		Form1.MainForm = True
		Form1.Show
		App.Run
	#endif
'#End Region

Private Sub Form1Type.TextBox1_Click(ByRef Sender As Control)
	Dim As Integer Index = Val(Mid(Sender.Name, InStrRev(Sender.Name, "(") + 1))
	MsgBox Str(Index)
End Sub
xiaoyao wrote: Jun 13, 2024 9:10 25. It is best to add a WINDOWS api list, so there is no need to reference it. What APIs are used in the project? An API list module file will be automatically generated during compilation: Project_api.bas
This is not necessary, include "windows.bi" is the best option.
xiaoyao wrote: Jun 13, 2024 9:10 26. Like VB6, if it supports adding OCX controls, COM DLL references, and TLB file references, it would basically be perfect.
Yes, we thought about this too, such projects only work on Windows.
xiaoyao wrote: Jun 13, 2024 9:10 27. It is best to add a module management database with 3 basic fields: module file/function (supports Chinese)/module main function list, which can be automatically searched at any time when needed.
For example, if I enter the VBCRlf function, I will be prompted whether I need to quote: vbcompat.bi.
The automatic detection function will be added later. If vbcompat.bi does not use any functions, the file will be automatically excluded during compilation.
vbcompat.bi vb6Function vbcrlf,***
Does suggestion 22 talk about this too?
Xusinboy Bekchanov
Posts: 806
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

xiaoyao wrote: Jun 13, 2024 9:11 With the control array, you can write a calculator program with very little code like this
Array of elements is supported. Answered this question on the 24th.
xiaoyao
Posts: 138
Joined: May 05, 2020 2:01

Re: VisualFBEditor - IDE for FreeBasic

Post by xiaoyao »

Xusinboy Bekchanov wrote: Jun 13, 2024 19:17
xiaoyao wrote: Jun 13, 2024 9:11 With the control array, you can write a calculator program with very little code like this
Array of elements is supported. Answered this question on the 24th.
how to do like this? only put controls on form1? or new version have CONTROL(INDEX)
Is it in the properties box? In fact, None=-1 can be used by default, which means that index and control array are not used.
xiaoyao
Posts: 138
Joined: May 05, 2020 2:01

Re: VisualFBEditor - IDE for FreeBasic

Post by xiaoyao »

Questions Batch 3:Thanks to the chief designer for his great contribution and improvement and optimization of bugs or new functions. When I have time, I would like to participate together to make the open source VB7 and fbeditor better.

28. It is best to add a git sdk and let everyone write the fbeditor open source project together. I modified a form or added a function. I can submit it and the administrator will review and merge it. Everyone can use all the modules, forms, and functions in it. Search and share, if everyone can get some modules and functions that can be used for work from the IDE source code, the development progress will be greatly improved. If 100 people develop together, the speed can be increased several times.
For example, some functions and functions can be made into SQLITE database or JSON format, so that everyone can download them using GIT and then merge, search, modify and add them locally. The functions contributed by each person can retain the author information and give you a code ID, such as:
Function SortStringArr()
Codeid=5534
Author: Xiaoyao
Features:
First submission time, last modification time
Parameter 1, Chinese name (other languages), purpose
Parameter 2, Chinese name, purpose

29. When saving the newly created project, the module specified a path, but the "Project Name" pop-up asked me to save it to another directory. It is best to use the same path without asking, just enter the project name.
30, New Project, it is best to be independent and close the last opened project. Or there is a check box to add a new project, which can save the project project group or just be used for multiple project testing.
The last 26, like VB6, would be basically perfect if it supports adding OCX controls, COM DLL references, and TLB file references.
This WINDOWS can be supported by the plug-in mode, and the plug-in functions of the IDE should be developed as the first priority. Some functions can be directly made into plug-ins first, and some can be extracted by the administrator and merged into the main module of the IDE. There are many people developing plug-ins. The basic goal is to have a few thousand plug-ins (most of them have source code). If there are tens of thousands of plug-ins, the maturity of use will be high. The biggest disadvantage of VB6 is that each person may not actually use more than 5 plug-ins.
31. There is only one event in the control array, and others cannot be added. It would be better if the control array could display names.
BUG: Unable to modify the controlindex attribute value, Name=TextBox1(1), ControlIndex may=5
It is best to double-click the event option "onclick", it will automatically bind the event, and double-click again to remove the event. Add and remove events for all control arrays at the same time

With TextBox1(1)
.Name = "TextBox1(1)"
.Text = "TextBox1"
.TabIndex = 1
.ControlIndex = 0
.OnClick = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As Control), @TextBox1_Click)
End With

With TextBox1(2)
.Name = "TextBox1(2)"
.Text = "TextBox1"
.ControlIndex = 1
End With
32. The most used project templates should automatically be ranked at the top.
33. Too many control properties are a problem that has always existed in VB6 and .net development tools. By default, they are ranked according to the number of uses, so the development speed can be faster. The other two modes are to arrange by name and by group.
34. Can the control type be displayed at the top of the property window? Just like vb6

35. GITHUB SDK WEBapi requires login authorization and encryption verification to perform some functions, such as listing all files and folders in a certain directory and getting the date of the last update.
Local file synchronization (only upload changed files, or delete locally removed files)
Using this function, it can be used to detect new versions and all plug-in lists, so that only the contents of a few specified folders can be downloaded to the local hard drive.
36. The window attributes are added (main form), and the MainExeHwnd handle can be generated in the code and saved into the shared memory object (CreateFileMapping). When you need to force close or stop debugging, send a shutdown command to this handle to achieve the normal exit function. Or a menu or button as the entry point to exit the program. Send a click event to the button.
The same goes for .NET debugging. The DEBUG program is already running and you just want to recompile and run it, so you need to let the IDE actively end it.
The vb6 IDE runs analytically. If you click the stop button in the IDE, it will exit abnormally, causing subclassing events and other problems to cause the IDE to crash. Freebasic runs analytically, and the IDE actively sends instructions to exit the program, saving the workload of manual switching.
37. I wonder if Freebasic has a function similar to VBSCRIPT, which can run Freebasic code directly to facilitate cross-platform use.
You can also simulate CreateObjectLinux(""), and then use scripts to control the IDE, use code to add controls, and set control properties. Or run the compiled program, run the Freebasic script to operate the host EXE itself or call the API
38. The key class library, Websocket, implements server and client functions. You can use WINE to run the EXE under Linux, and then communicate with the program written in python under Linux. You can also use Fbeditor to develop Linux programs and Windows programs (running on WINE) using websockets at the same time. Because WINDOWS's development technology is more mature, some functions run in the WINE virtual application container just like the ASP.NET server.
xiaoyao
Posts: 138
Joined: May 05, 2020 2:01

Re: VisualFBEditor - IDE for FreeBasic

Post by xiaoyao »

BUG Reports and New Feature Suggestions Group 4:
39. To manage the open source project of visualFbeditor, you can use one or more sqlite databases and Json files.
For example, there are differences in interface menus, control properties, and syntax between VB6 and VisualFbeditor IDE.
Which functions want to achieve the same functions as VB6, join the development plan, which functions are new inventions and ideas that surpass VB6, and which functions surpass all mainstream IDEs. For example, there are too many control attributes, and they are ranked according to the number of times they are used. This is the first time in the world that this has been done, and it is also the most efficient.
After the BUG list is added, it displays the number, whether it is ready to be fixed, and its status.
You can refer to Twinbasic, another new development tool that almost 100% implements VB6 functions.
You can learn a lot of new IDE skills from it

Download https://github.com/twinbasic/twinbasic/releases

https://github.com/twinbasic/twinbasic/issues

twinBASIC 12-MONTH ROADMAP · Issue #335 · twinbasic/twinbasic
https://github.com/twinbasic/twinbasic/issues/335

List of ALL missing / unimplemented intrinsic control properties and methods · Issue #1188 · twinbasic/twinbasic
https://github.com/twinbasic/twinbasic/issues/1188
Xusinboy Bekchanov wrote: Jun 13, 2024 19:14xiaoyao wrote: ↑Jun 13, 2024 17:10
As for the previous question, the compiled EXE is running. If you recompile it, it would be better to prompt whether to terminate the last process.
Forcibly terminating a process can lead to memory leaks in the system, so it is better for the user to close it in the usual way.
Function suggestion 40: You can add the ability to compile and execute a certain program, and execute a certain program after compilation (pass in the path of the current compilation project, the running EXE path), so that I can use the plug-in to automatically realize the compilation before pressing F5 , automatically end the last run process (simulating closing the main window or the programmer's exit button)
Maximize the use of plug-ins to fix bugs or enhance functions of the IDE. At that time, there is no need to recompile all the codes of visualFBEDITOR. It is like developing a company without the management of the boss. Employees can recruit new personnel and fire employees by themselves. , add new business scope
xiaoyao
Posts: 138
Joined: May 05, 2020 2:01

Re: VisualFBEditor - IDE for FreeBasic

Post by xiaoyao »

Regarding suggestion 33: VB6 text box attribute operation is troublesome
1. Scroll the attributes to the bottom
2. Double-click to set the text box to multiple lines.
3. ScrollBars click drop-down
4. Select to display only the vertical scroll bar
Requires 4 steps
Setting the default content of the text box also requires 4 steps
Would it be more convenient if you put frequently used operations directly in the right-click menu: Quick Settings?
Just create a small interface, enter the default value, and set the vertical scroll bar. Wouldn’t it be beautiful to complete it in 2 steps?
The OCX control itself generally does not provide a property page. All properties are displayed. It is inconvenient to set which row to search for. Most of the properties are not used.

Therefore, it is definitely useful to add a shortcut setting for each control. This function can also be made into ADD-IN plug-in mode.
Add a button in the first row of properties, quick settings, and the right-click menu of the control can also be added.
xiaoyao
Posts: 138
Joined: May 05, 2020 2:01

Re: VisualFBEditor - IDE for FreeBasic

Post by xiaoyao »

Summary of Linux inter-process communication methods. Is there any class library so? - freebasic.net
https://www.freebasic.net/forum/viewtopic.php?t=32728

pipeline
named pipe
Signal
message queue
Shared memory
signal
socket
==============
No. 41, suggestion
Can you write 7 examples to implement these methods of LINUX communication?
How to program in Linux, run programs, end running programs, create desktop shortcuts, and modify which software a file type is bound to
1. Execute the command line and obtain the returned results.
2. You can interact in the middle to get all the returned text, such as 30%, 35%
Like FDISK, diskpart windows command line, how to deal with many commands that need to be manually entered in the middle?
Xusinboy Bekchanov
Posts: 806
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

xiaoyao wrote: Jun 13, 2024 22:28
Xusinboy Bekchanov wrote: Jun 13, 2024 19:17
xiaoyao wrote: Jun 13, 2024 9:11 With the control array, you can write a calculator program with very little code like this
Array of elements is supported. Answered this question on the 24th.
how to do like this? only put controls on form1? or new version have CONTROL(INDEX)
Is it in the properties box? In fact, None=-1 can be used by default, which means that index and control array are not used.
This is done manually in the type and constructor. We can make an array of controls by asking the user when he gives the same name for controls of the same type.
xiaoyao wrote: Jun 13, 2024 23:33 Questions Batch 3:Thanks to the chief designer for his great contribution and improvement and optimization of bugs or new functions. When I have time, I would like to participate together to make the open source VB7 and fbeditor better.
We are glad to have your participation in this project.
xiaoyao wrote: Jun 13, 2024 23:33 28. It is best to add a git sdk and let everyone write the fbeditor open source project together. I modified a form or added a function. I can submit it and the administrator will review and merge it. Everyone can use all the modules, forms, and functions in it. Search and share, if everyone can get some modules and functions that can be used for work from the IDE source code, the development progress will be greatly improved. If 100 people develop together, the speed can be increased several times.
For example, some functions and functions can be made into SQLITE database or JSON format, so that everyone can download them using GIT and then merge, search, modify and add them locally. The functions contributed by each person can retain the author information and give you a code ID, such as:
Function SortStringArr()
Codeid=5534
Author: Xiaoyao
Features:
First submission time, last modification time
Parameter 1, Chinese name (other languages), purpose
Parameter 2, Chinese name, purpose
Now github is used the same.
xiaoyao wrote: Jun 13, 2024 23:33 29. When saving the newly created project, the module specified a path, but the "Project Name" pop-up asked me to save it to another directory. It is best to use the same path without asking, just enter the project name.
This is done as in VB6.
xiaoyao wrote: Jun 13, 2024 23:33 30, New Project, it is best to be independent and close the last opened project. Or there is a check box to add a new project, which can save the project project group or just be used for multiple project testing.
We can add a checkmark to the New Project window.
xiaoyao wrote: Jun 13, 2024 23:33 The last 26, like VB6, would be basically perfect if it supports adding OCX controls, COM DLL references, and TLB file references.
As I said before, we planned for this.
xiaoyao wrote: Jun 13, 2024 23:33 This WINDOWS can be supported by the plug-in mode, and the plug-in functions of the IDE should be developed as the first priority. Some functions can be directly made into plug-ins first, and some can be extracted by the administrator and merged into the main module of the IDE. There are many people developing plug-ins. The basic goal is to have a few thousand plug-ins (most of them have source code). If there are tens of thousands of plug-ins, the maturity of use will be high. The biggest disadvantage of VB6 is that each person may not actually use more than 5 plug-ins.
Plugins are supported in the IDE.
xiaoyao wrote: Jun 13, 2024 23:33 31. There is only one event in the control array, and others cannot be added. It would be better if the control array could display names.
BUG: Unable to modify the controlindex attribute value, Name=TextBox1(1), ControlIndex may=5
It is best to double-click the event option "onclick", it will automatically bind the event, and double-click again to remove the event. Add and remove events for all control arrays at the same time

With TextBox1(1)
.Name = "TextBox1(1)"
.Text = "TextBox1"
.TabIndex = 1
.ControlIndex = 0
.OnClick = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As Control), @TextBox1_Click)
End With

With TextBox1(2)
.Name = "TextBox1(2)"
.Text = "TextBox1"
.ControlIndex = 1
End With
It is possible to add other events in the events window. Event deletion has not yet been implemented.
xiaoyao wrote: Jun 13, 2024 23:33 32. The most used project templates should automatically be ranked at the top.
It's possible to do this.
xiaoyao wrote: Jun 13, 2024 23:33 33. Too many control properties are a problem that has always existed in VB6 and .net development tools. By default, they are ranked according to the number of uses, so the development speed can be faster. The other two modes are to arrange by name and by group.
This is possible, there is also a search option in ToolBox.
xiaoyao wrote: Jun 13, 2024 23:33 34. Can the control type be displayed at the top of the property window? Just like vb6
Now only the name of the control will appear, we can add the type too.
xiaoyao wrote: Jun 13, 2024 23:33 35. GITHUB SDK WEBapi requires login authorization and encryption verification to perform some functions, such as listing all files and folders in a certain directory and getting the date of the last update.
Local file synchronization (only upload changed files, or delete locally removed files)
Using this function, it can be used to detect new versions and all plug-in lists, so that only the contents of a few specified folders can be downloaded to the local hard drive.
I'm currently using GitHub Desktop.
xiaoyao wrote: Jun 13, 2024 23:33 36. The window attributes are added (main form), and the MainExeHwnd handle can be generated in the code and saved into the shared memory object (CreateFileMapping). When you need to force close or stop debugging, send a shutdown command to this handle to achieve the normal exit function. Or a menu or button as the entry point to exit the program. Send a click event to the button.
The same goes for .NET debugging. The DEBUG program is already running and you just want to recompile and run it, so you need to let the IDE actively end it.
The vb6 IDE runs analytically. If you click the stop button in the IDE, it will exit abnormally, causing subclassing events and other problems to cause the IDE to crash. Freebasic runs analytically, and the IDE actively sends instructions to exit the program, saving the workload of manual switching.
If a running program runs continuously, it is impossible to close it in the usual way.
xiaoyao wrote: Jun 13, 2024 23:33 37. I wonder if Freebasic has a function similar to VBSCRIPT, which can run Freebasic code directly to facilitate cross-platform use.
You can also simulate CreateObjectLinux(""), and then use scripts to control the IDE, use code to add controls, and set control properties. Or run the compiled program, run the Freebasic script to operate the host EXE itself or call the API
To do this you need to make a plugin, the plugin requests the necessary things and the IDE does it.
xiaoyao wrote: Jun 13, 2024 23:33 38. The key class library, Websocket, implements server and client functions. You can use WINE to run the EXE under Linux, and then communicate with the program written in python under Linux. You can also use Fbeditor to develop Linux programs and Windows programs (running on WINE) using websockets at the same time. Because WINDOWS's development technology is more mature, some functions run in the WINE virtual application container just like the ASP.NET server.
I'll take a look at this.
xiaoyao wrote: Jun 14, 2024 0:12 BUG Reports and New Feature Suggestions Group 4:
39. To manage the open source project of visualFbeditor, you can use one or more sqlite databases and Json files.
For example, there are differences in interface menus, control properties, and syntax between VB6 and VisualFbeditor IDE.
Which functions want to achieve the same functions as VB6, join the development plan, which functions are new inventions and ideas that surpass VB6, and which functions surpass all mainstream IDEs. For example, there are too many control attributes, and they are ranked according to the number of times they are used. This is the first time in the world that this has been done, and it is also the most efficient.
After the BUG list is added, it displays the number, whether it is ready to be fixed, and its status.
You can refer to Twinbasic, another new development tool that almost 100% implements VB6 functions.
You can learn a lot of new IDE skills from it

Download https://github.com/twinbasic/twinbasic/releases

https://github.com/twinbasic/twinbasic/issues

twinBASIC 12-MONTH ROADMAP · Issue #335 · twinbasic/twinbasic
https://github.com/twinbasic/twinbasic/issues/335

List of ALL missing / unimplemented intrinsic control properties and methods · Issue #1188 · twinbasic/twinbasic
https://github.com/twinbasic/twinbasic/issues/1188
I can only work in my free time as a hobby, so I can't make a plan.
xiaoyao wrote: Jun 14, 2024 0:12 Function suggestion 40: You can add the ability to compile and execute a certain program, and execute a certain program after compilation (pass in the path of the current compilation project, the running EXE path), so that I can use the plug-in to automatically realize the compilation before pressing F5 , automatically end the last run process (simulating closing the main window or the programmer's exit button)
Maximize the use of plug-ins to fix bugs or enhance functions of the IDE. At that time, there is no need to recompile all the codes of visualFBEDITOR. It is like developing a company without the management of the boss. Employees can recruit new personnel and fire employees by themselves. , add new business scope
Added: OnBeforeCompile event to Add-Ins:
https://github.com/XusinboyBekchanov/Vi ... 3aed9fdbfb

This plugin example gets the name and path of the exe file to compile and run:

Code: Select all

#ifdef __FB_WIN32__
	#ifdef __FB_64BIT__
		'#Compile -dll -x "../../AddIns/My Add-In (x64).dll" "My Add-In.rc"
	#else
		'#Compile -dll -x "../../AddIns/My Add-In (x32).dll" "My Add-In.rc"
	#endif
#else
	#ifdef __FB_64BIT__
		'#Compile -dll -x "../../AddIns/MyAddInx64.so"
	#else
		'#Compile -dll -x "../../AddIns/MyAddInx32.so"
	#endif
#endif

Enum MessageType '...'
	mtInfo
	mtWarning
	mtQuestion
	mtError
	mtOther
End Enum

Enum ButtonsTypes '...'
	btNone
	btOK
	btYesNo
	btYesNoCancel
	btOkCancel
End Enum

Enum MessageResult '...'
	mrAbort
	mrCancel
	mrIgnore
	mrNo
	mrOK
	mrRetry
	mrYes
End Enum

Type MFFLib
	MsgBox As Function(ByRef MsgStr As WString, ByRef Caption As WString = "", MsgType As Integer = 0, ButtonsType As Integer = 1) As Integer
	ReadProperty As Function(Obj As Any Ptr, ByRef PropertyName As String) As Any Ptr
	ApplicationMainForm As Function(App As Any Ptr) As Any Ptr
	ControlByName As Function(Ctrl As Any Ptr, CtrlName As String) As Any Ptr
	ToolBarAddButtonWithImageKey As Function(tb As Any Ptr, FStyle As Integer = 16, ByRef FImageKey As WString = "", Index As Integer = -1, FClick As Any Ptr = 0, ByRef FKey As WString = "", ByRef FCaption As WString = "", ByRef FHint As WString = "", FShowHint As Boolean = False, FState As Integer = 4) As Any Ptr
	ToolBarRemoveButton As Sub(tb As Any Ptr, Index As Integer)
	ToolBarIndexOfButton As Function(tb As Any Ptr, btn As Any Ptr) As Integer
	MenuItemAdd As Function(ParentMenuItem As Any Ptr, ByRef sCaption As WString, ByRef sImageKey As WString, sKey As String = "", eClick As Any Ptr = 0, Index As Integer = -1) As Any Ptr
	MenuItemIndexOfKey As Function(ParentMenuItem As Any Ptr, ByRef Key As WString) As Integer
	MenuItemRemove As Sub(ParentMenuItem As Any Ptr, PMenuItem As Any Ptr)
	MenuFindByName As Function(PMenu As Any Ptr, ByRef FName As WString) As Any Ptr
	ObjectDelete As Function(Obj As Any Ptr) As Boolean
End Type

Dim Shared mff As MFFLib
Dim Shared VFBEditorLib As Any Ptr
Dim Shared VFBEditorApp As Any Ptr

Sub LoadMFFProcs()
	mff.MsgBox = DyLibSymbol(VFBEditorLib, "MsgBox")
	mff.ReadProperty = DyLibSymbol(VFBEditorLib, "ReadProperty")
	mff.ApplicationMainForm = DyLibSymbol(VFBEditorLib, "ApplicationMainForm")
	mff.ControlByName = DyLibSymbol(VFBEditorLib, "ControlByName")
	mff.ToolBarAddButtonWithImageKey = DyLibSymbol(VFBEditorLib, "ToolBarAddButtonWithImageKey")
	mff.ToolBarRemoveButton = DyLibSymbol(VFBEditorLib, "ToolBarRemoveButton")
	mff.ToolBarIndexOfButton = DyLibSymbol(VFBEditorLib, "ToolBarIndexOfButton")
	mff.MenuItemAdd = DyLibSymbol(VFBEditorLib, "MenuItemAdd")
	mff.MenuItemIndexOfKey = DyLibSymbol(VFBEditorLib, "MenuItemIndexOfKey")
	mff.MenuItemRemove = DyLibSymbol(VFBEditorLib, "MenuItemRemove")
	mff.MenuFindByName = DyLibSymbol(VFBEditorLib, "MenuFindByName")
	mff.ObjectDelete = DyLibSymbol(VFBEditorLib, "ObjectDelete")
End Sub

Dim Shared As Any Ptr MainForm, MainReBar
Dim Shared As Any Ptr tbStandard, tbMyAddin, tbMyAddinSeparator
Dim Shared As Any Ptr mnuService, mnuMyAddin, mnuMyAddinSeparator

Dim Shared s As WString Ptr
Function GetFolderPath(ByRef FileName As WString) ByRef As WString
	Dim Pos1 As Long = InStrRev(FileName, "\")
	Dim Pos2 As Long = InStrRev(FileName, "/")
	If Pos1 = 0 OrElse Pos2 > Pos1 Then Pos1 = Pos2
	If Pos1 > 0 Then
		s = Cast(WString Ptr, Reallocate(s, Pos1 * SizeOf(WString)))
		*s = Left(FileName, Pos1)
		Return *s
	End If
	Return ""
End Function

Sub OnMyAddinButtonClick(ByRef Sender As Object)
	If mff.MsgBox <> 0 Then
		mff.MsgBox(*Cast(WString Ptr, mff.ReadProperty(VFBEditorApp, "exefile")))
	End If
End Sub

Sub OnBeforeCompile Alias "OnBeforeCompile" (VisualFBEditorApp As Any Ptr, ByRef CompilingProgramPath As WString) Export
	If mff.MsgBox <> 0 Then
		mff.MsgBox(CompilingProgramPath)
	End If
End Sub

Sub OnConnection Alias "OnConnection"(VisualFBEditorApp As Any Ptr, ByRef AppPath As WString) Export
	VFBEditorApp = VisualFBEditorApp
	
	#ifdef __FB_WIN32__
		#ifdef __FB_64BIT__
			VFBEditorLib = DyLibLoad(GetFolderPath(AppPath) & "/Controls/MyFbFramework/mff64.dll")
		#else
			VFBEditorLib = DyLibLoad(GetFolderPath(AppPath) & "/Controls/MyFbFramework/mff32.dll")
		#endif
	#else
		VFBEditorLib = DyLibLoad(GetFolderPath(AppPath) & "/Controls/MyFbFramework/libmff" & Right(AppPath, 7) & ".so")
	#endif
	If s <> 0 Then Deallocate s
	
	If VFBEditorLib = 0 Then Exit Sub
	
	LoadMFFProcs
	
	If mff.ApplicationMainForm <> 0 Then
		MainForm = mff.ApplicationMainForm(VisualFBEditorApp)
		If MainForm <> 0 Then
			If mff.ControlByName <> 0 Then
				MainReBar = mff.ControlByName(MainForm, "MainReBar")
				If MainReBar <> 0 Then
					tbStandard = mff.ControlByName(MainReBar, "Standard")
					If tbStandard <> 0 AndAlso mff.ToolBarAddButtonWithImageKey <> 0 Then
						tbMyAddinSeparator = mff.ToolBarAddButtonWithImageKey(tbStandard, 1, "MyAddinSeparator")
						tbMyAddin = mff.ToolBarAddButtonWithImageKey(tbStandard, , "About", , @OnMyAddinButtonClick, "MyAddin", , "My Add-In", True)
					End If
				End If
			End If
			If mff.ReadProperty <> 0 AndAlso mff.MenuFindByName <> 0 Then
				Dim As Any Ptr mnuMenu = mff.ReadProperty(MainForm, "Menu")
				mnuService = mff.MenuFindByName(mnuMenu, "Service")
				If mnuService <> 0 AndAlso mff.MenuItemAdd <> 0 Then
					Var IndexOfKey = mff.MenuItemIndexOfKey(mnuService, "AddIns")
					mnuMyAddinSeparator = mff.MenuItemAdd(mnuService, "-", "", "", , IndexOfKey + 1)
					mnuMyAddin = mff.MenuItemAdd(mnuService, "My Add-In", "About", , @OnMyAddinButtonClick, IndexOfKey + 2)
				End If
			End If
		End If
	End If
	
End Sub

Sub OnDisconnection Alias "OnDisconnection"(VisualFBEditorApp As Any Ptr) Export
	If tbStandard <> 0 AndAlso mff.ToolBarRemoveButton <> 0 AndAlso mff.ToolBarIndexOfButton <> 0 Then
		If tbMyAddinSeparator <> 0 Then
			mff.ToolBarRemoveButton(tbStandard, mff.ToolBarIndexOfButton(tbStandard, tbMyAddinSeparator))
			If mff.ObjectDelete <> 0 Then mff.ObjectDelete(tbMyAddinSeparator)
		End If
		If tbMyAddin <> 0 Then
			mff.ToolBarRemoveButton(tbStandard, mff.ToolBarIndexOfButton(tbStandard, tbMyAddin))
			If mff.ObjectDelete <> 0 Then mff.ObjectDelete(tbMyAddin)
		End If
	End If
	If mnuService <> 0 AndAlso mff.MenuItemRemove <> 0 Then
		If mnuMyAddinSeparator <> 0 Then
			mff.MenuItemRemove(mnuService, mnuMyAddinSeparator)
			If mff.ObjectDelete <> 0 Then mff.ObjectDelete(mnuMyAddinSeparator)
		End If
		If mnuMyAddin <> 0 Then
			mff.MenuItemRemove(mnuService, mnuMyAddin)
			If mff.ObjectDelete <> 0 Then mff.ObjectDelete(mnuMyAddin)
		End If
	End If
	If VFBEditorLib <> 0 Then
		DyLibFree(VFBEditorLib)
	End If
End Sub
In these procedures:

Code: Select all

Sub OnMyAddinButtonClick(ByRef Sender As Object)
	If mff.MsgBox <> 0 Then
		mff.MsgBox(*Cast(WString Ptr, mff.ReadProperty(VFBEditorApp, "exefile")))
	End If
End Sub

Sub OnBeforeCompile Alias "OnBeforeCompile" (VisualFBEditorApp As Any Ptr, ByRef CompilingProgramPath As WString) Export
	If mff.MsgBox <> 0 Then
		mff.MsgBox(CompilingProgramPath)
	End If
End Sub
xiaoyao
Posts: 138
Joined: May 05, 2020 2:01

Re: VisualFBEditor - IDE for FreeBasic

Post by xiaoyao »

Xusinboy Bekchanov wrote: Jun 15, 2024 1:08 If a running program runs continuously, it is impossible to close it in the usual way.
This is very feasible. We should actually add a debug mode, although at the moment it's a full compile run every time.

Repeated opening and closing many times in the course of testing, really need a quick automatic closing program function.
I did my research on the VB6 IDE.If an MsgBox dialog box pops up.I tried to send the interrupted command control + break, but it failed.
Vb6 does not respond to this event.


I see it can be sent later. bm_click,wm_close
In fact, these forms are composed of a certain classname.
I just need to find these things, close these windows, and the IDE will finish debugging.
As long as our ordinary program closes all the windows, it will exit normally.

Of course, I forgot that the most important thing is to be able to send a pos quit command.
Then, combined with Linux programming, how to end a process, if the internal communication in the process is waiting for a command. Or message, and then shut down the main program.
xiaoyao
Posts: 138
Joined: May 05, 2020 2:01

Re: VisualFBEditor - IDE for FreeBasic

Post by xiaoyao »

The next key point is to make the plug-in function the first in the world.
In this way, 70% of the functions can be completed by community members.All you need to do is to check whether there is any problem with their functional code, and then merge them into a main program.

Just like in office, we can add new formulas to so many formulas, and we can also add plug-in functions such as automatic backup.

Vb6, the core essence of VBA.It can record actions,Record Macro, beyond the various menus or drag-and-drop controls, click the button, and it will automatically convert these steps into code.

This is like a screen mouse record, which can automatically input different contents and read them from the database. But its shape is ah, and it can be turned into a formula.

I see another IDE, winfbe.His new project is on the fifth menu, and many people may not be able to adapt to it.To switch different national languages, it takes seven or eight steps to operate manually.
Everyone can design their own IDE menus if there is a special plug-in for automatic menu adjustment. And then make the best solutions available to everyone.

Maybe the core of our work in the future should be on Linux. Because that's the hardest and the most promising.Most VB6 programmers have no problem using 32-bit programs.

So our development focus is cross-platform. Linux, and if that makes it a good Linux freebasic script parser, so much the better.
xiaoyao
Posts: 138
Joined: May 05, 2020 2:01

Re: VisualFBEditor - IDE for FreeBasic

Post by xiaoyao »

Summarize it again.
1. We need to set up a plug-in market for plug-in functions on the Internet.In this way, many of the new features we need can be downloaded directly online without the need to compile the entire IDE.
2,Make the plug-in function better. You can automatically download the plug-in source code to generate exe, and choose to load or unload it.
3. Develop a scripting language similar to Vbs.A freebasic script that can execute simple freebasic code. Include references to the API, as well as com objects.
4. Do more Linux modules. The future development center is to do Renix's desktop gadgets or server background.
The freebasic script can be executed with the same functions as aspnet or ASP.
5. Ide also supports the editing of JavaScript code. Just like node. JS, we expose the function of the host to it, and JS can call it directly.
6. Develop a macro recording function of office.
We can set a callback for each menu or button.
After manual operation, it is automatically turned into code. This can make it part of the plug-in or itself.
7,Add AI and artificial intelligence functions. Microsoft disbanded windows directly in 2018, and everything was in the cloud.
Add chatgpt interface
8
Set up an online freebasic compiler server. Open a web page, as long as you connect to the server, it can be automatically compiled into a windows Linux program.
9. Make a wine container image, which supports visual fbeditor, VB6, and can run directly in the Linux server.
In this way, we have an online meta-compilation platform, which takes up almost no CPU.
Xusinboy Bekchanov
Posts: 806
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

xiaoyao wrote: Jun 16, 2024 23:12 Summarize it again.
1. We need to set up a plug-in market for plug-in functions on the Internet.In this way, many of the new features we need can be downloaded directly online without the need to compile the entire IDE.
2,Make the plug-in function better. You can automatically download the plug-in source code to generate exe, and choose to load or unload it.
3. Develop a scripting language similar to Vbs.A freebasic script that can execute simple freebasic code. Include references to the API, as well as com objects.
4. Do more Linux modules. The future development center is to do Renix's desktop gadgets or server background.
The freebasic script can be executed with the same functions as aspnet or ASP.
5. Ide also supports the editing of JavaScript code. Just like node. JS, we expose the function of the host to it, and JS can call it directly.
6. Develop a macro recording function of office.
We can set a callback for each menu or button.
After manual operation, it is automatically turned into code. This can make it part of the plug-in or itself.
7,Add AI and artificial intelligence functions. Microsoft disbanded windows directly in 2018, and everything was in the cloud.
Add chatgpt interface
8
Set up an online freebasic compiler server. Open a web page, as long as you connect to the server, it can be automatically compiled into a windows Linux program.
9. Make a wine container image, which supports visual fbeditor, VB6, and can run directly in the Linux server.
In this way, we have an online meta-compilation platform, which takes up almost no CPU.
It's open source, you can help with these points too.
lenoil98
Posts: 20
Joined: Feb 16, 2021 0:13
Location: USA

Re: VisualFBEditor - IDE for FreeBasic

Post by lenoil98 »

I'm attempting to build on FreeBSD/power9. The app builds successfully and starts up as normal. I get the "Tip of the Day". However, it does not open a new workspace/project.

When I attempt to open a new file/project, I get a SegFault (See below).

Thread 27 received signal SIGSEGV, Segmentation fault.
Invalid permissions for mapped object.
[Switching to LWP 118391 of process 8778]
0x0000000811838534 in ?? () from /lib/libthr.so.3
(gdb) backtrace
#0  0x0000000811838534 in  () at /lib/libthr.so.3
#1  0x00000008118384b0 in  () at /lib/libthr.so.3
#2  0x0000000811833478 in  () at /lib/libthr.so.3
#3  0x0000000811a4beac in  () at /lib/libc.so.7
#4  0x0000000811a99e9c in  () at /lib/libc.so.7
#5  0x0000000811a40ad4 in realloc () at /lib/libc.so.7
#6  0x00000000101e2c0c in _ZN4LIST3ADDEPv (THIS$1=0xfffff9e7f1cb8, FITEM$1=0x81bbcfc88) at /usr/home/clhamilto/Devel/VisualFBEditor-1.3.4/Controls/MyFbFramework/mff/List.bas:38
#7  0x00000000100e043c in ANALYZETAB (PARAM$1=0x81bbc4ac0) at /usr/home/clhamilto/Devel/VisualFBEditor-1.3.4/src/TabWindow.bas:5634
#8  0x000000001031fac4 in threadproc ()
#9  0x000000081182ab04 in  () at /lib/libthr.so.3
#10 0x0000000000000000 in  ()
(gdb)


I've tried fbc 1.09 and fbc 1.10 and get the same results.
Any ideas?
Xusinboy Bekchanov
Posts: 806
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

lenoil98 wrote: Jun 25, 2024 21:57 I'm attempting to build on FreeBSD/power9. The app builds successfully and starts up as normal. I get the "Tip of the Day". However, it does not open a new workspace/project.
It's good that it worked in FreeBSD. Different configurations have different settings. For example, in the GTK3 configuration, in the Options -> General -> When Visual FB Editor starts setting, the “Do nothing” option is selected. And in GTK2 this option is selected Create project/file -> Form.frm. In the Windows configuration, the Prompt for Project/File option is selected (Last settings I used). You can select Prompt for Project / File, then the New Project window will be shown.
lenoil98 wrote: Jun 25, 2024 21:57 When I attempt to open a new file/project, I get a SegFault (See below).

Thread 27 received signal SIGSEGV, Segmentation fault.
Invalid permissions for mapped object.
[Switching to LWP 118391 of process 8778]
0x0000000811838534 in ?? () from /lib/libthr.so.3
(gdb) backtrace
#0  0x0000000811838534 in  () at /lib/libthr.so.3
#1  0x00000008118384b0 in  () at /lib/libthr.so.3
#2  0x0000000811833478 in  () at /lib/libthr.so.3
#3  0x0000000811a4beac in  () at /lib/libc.so.7
#4  0x0000000811a99e9c in  () at /lib/libc.so.7
#5  0x0000000811a40ad4 in realloc () at /lib/libc.so.7
#6  0x00000000101e2c0c in _ZN4LIST3ADDEPv (THIS$1=0xfffff9e7f1cb8, FITEM$1=0x81bbcfc88) at /usr/home/clhamilto/Devel/VisualFBEditor-1.3.4/Controls/MyFbFramework/mff/List.bas:38
#7  0x00000000100e043c in ANALYZETAB (PARAM$1=0x81bbc4ac0) at /usr/home/clhamilto/Devel/VisualFBEditor-1.3.4/src/TabWindow.bas:5634
#8  0x000000001031fac4 in threadproc ()
#9  0x000000081182ab04 in  () at /lib/libthr.so.3
#10 0x0000000000000000 in  ()
(gdb)


I've tried fbc 1.09 and fbc 1.10 and get the same results.
Any ideas?
For some reason reallocate does not work in a newly created thread. You can disable the option Options -> Code Editor -> Enable Auto Suggestions. Then don't go to this place.
Post Reply