VisualFBEditor - IDE for FreeBasic

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

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

Xusinboy Bekchanov wrote: May 30, 2022 18:34 Try from releases (1.3.2). I need to look at the latest unreleased version.
Fixed: Crashing IDE when start on Linux:
https://github.com/XusinboyBekchanov/Vi ... 68f0e5b38c

I looked and corrected.
birosys
Posts: 17
Joined: Aug 28, 2007 20:39

Re: VisualFBEditor - IDE for FreeBasic

Post by birosys »

The Parameters Window will open in the Build -> Parameters menu. There, in the compiler line, it should have been written like this:
-b {S} -exx -v
When compiling, it was necessary to compile like this:
-b "Form1.frm" -exx -v
Have you changed this setting?

No, I haven't changed them.
The default is -exx.

I downloaded the latest version from github, and I confirm that everything is ok now.
By changing the parameters in the Build menu, I was able to compile a test program.

I also rewrote the auto-install script for raspberry with dependent compiler packages.

Code: Select all

sudo apt install gcc libncurses5-dev libffi-dev libgl1-mesa-dev libx11-dev libxext-dev libxrender-dev libxrandr-dev libxpm-dev libtinfo5 libgpm-dev
sudo apt install libgtk-3-dev
sudo apt install git
sudo apt-get install wget
rm -r VisualFBEditor
git clone https://github.com/XusinboyBekchanov/VisualFBEditor
cd VisualFBEditor
git clone https://github.com/XusinboyBekchanov/MyFbFramework
mkdir Compilers
cd Compilers
wget -O FreeBASIC-1.09.0-raspbian9-arm.tar.xz https://versaweb.dl.sourceforge.net/project/fbc/FreeBASIC-1.09.0/Binaries-Linux/raspbian9/FreeBASIC-1.09.0-raspbian9-arm.tar.xz
tar xf FreeBASIC-1.09.0-raspbian9-arm.tar.xz
cd ..
cd src
../Compilers/FreeBASIC-1.09.0-raspbian9-arm/bin/fbc "VisualFBEditor.bas" -x "../VisualFBEditor_gtk3" -i "../MyFbFramework" -d __USE_GTK3__ -v
cd ..
cd MyFbFramework/mff
../../Compilers/FreeBASIC-1.09.0-raspbian9-arm/bin/fbc -b "mff.bi" -dll -x "../libmff32_gtk3.so" -d __USE_GTK3__ -v
cd ..
cd ..

Thanks again.
Xusinboy Bekchanov
Posts: 792
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

birosys wrote: May 31, 2022 8:45 No, I haven't changed them.
The default is -exx.
I don’t know, everything is correct in the release and github.
birosys wrote: May 31, 2022 8:45 I downloaded the latest version from github, and I confirm that everything is ok now.
By changing the parameters in the Build menu, I was able to compile a test program.

I also rewrote the auto-install script for raspberry with dependent compiler packages.

Code: Select all

sudo apt install gcc libncurses5-dev libffi-dev libgl1-mesa-dev libx11-dev libxext-dev libxrender-dev libxrandr-dev libxpm-dev libtinfo5 libgpm-dev
sudo apt install libgtk-3-dev
sudo apt install git
sudo apt-get install wget
rm -r VisualFBEditor
git clone https://github.com/XusinboyBekchanov/VisualFBEditor
cd VisualFBEditor
git clone https://github.com/XusinboyBekchanov/MyFbFramework
mkdir Compilers
cd Compilers
wget -O FreeBASIC-1.09.0-raspbian9-arm.tar.xz https://versaweb.dl.sourceforge.net/project/fbc/FreeBASIC-1.09.0/Binaries-Linux/raspbian9/FreeBASIC-1.09.0-raspbian9-arm.tar.xz
tar xf FreeBASIC-1.09.0-raspbian9-arm.tar.xz
cd ..
cd src
../Compilers/FreeBASIC-1.09.0-raspbian9-arm/bin/fbc "VisualFBEditor.bas" -x "../VisualFBEditor_gtk3" -i "../MyFbFramework" -d __USE_GTK3__ -v
cd ..
cd MyFbFramework/mff
../../Compilers/FreeBASIC-1.09.0-raspbian9-arm/bin/fbc -b "mff.bi" -dll -x "../libmff32_gtk3.so" -d __USE_GTK3__ -v
cd ..
cd ..

Thanks again.
Very well, I will add this to the github with your permission.
birosys
Posts: 17
Joined: Aug 28, 2007 20:39

Re: VisualFBEditor - IDE for FreeBasic

Post by birosys »

Of course .
No problem.
Xusinboy Bekchanov
Posts: 792
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

birosys wrote: May 31, 2022 8:45 No, I haven't changed them.
The default is -exx.
Default value also changed to "-b {S} -exx":
https://github.com/XusinboyBekchanov/Vi ... dc6178b2c7
birosys wrote: May 31, 2022 9:30 Of course .
No problem.
Thanks.
Avata
Posts: 106
Joined: Jan 17, 2021 7:27

Re: VisualFBEditor - IDE for FreeBasic

Post by Avata »

Are there any plans to upgrade to GTK4? But there are not any plans of GTK team to distribute GTK 4 to Android mobile devices.
Xusinboy Bekchanov
Posts: 792
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

Avata wrote: Jun 01, 2022 8:53 Are there any plans to upgrade to GTK4? But there are not any plans of GTK team to distribute GTK 4 to Android mobile devices.
We have to give it a try, but the compiler doesn't officially include it yet.
Avata
Posts: 106
Joined: Jan 17, 2021 7:27

Re: VisualFBEditor - IDE for FreeBasic

Post by Avata »

I am wonder which frame is better are used on Android OS. Now I am interest in make a Android APP with MFF.
Xusinboy Bekchanov
Posts: 792
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

Avata wrote: Jun 02, 2022 0:41 I am wonder which frame is better are used on Android OS. Now I am interest in make a Android APP with MFF.
Together we must improve the Android version of the library.
Avata
Posts: 106
Joined: Jan 17, 2021 7:27

Re: VisualFBEditor - IDE for FreeBasic

Post by Avata »

It is better compiling the source code with the same compiler between win32 APP and Andriod APP.
Xusinboy Bekchanov
Posts: 792
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

Avata wrote: Jun 05, 2022 2:12 It is better compiling the source code with the same compiler between win32 APP and Andriod APP.
When android-branch is merged then it will be on one compiler.
Avata
Posts: 106
Joined: Jan 17, 2021 7:27

Re: VisualFBEditor - IDE for FreeBasic

Post by Avata »

VisualFBEditor's word case conversion feature is so good that it's like smart spell checking. This is treated differently according to scope. The text in the string is also not replaced.
Avata
Posts: 106
Joined: Jan 17, 2021 7:27

Re: VisualFBEditor - IDE for FreeBasic

Post by Avata »

why the function setBody of control WebBrowser not working? But it is ok load from a file.
SaveToFile(wszPath, s)
' // Navigate to the path
webBrowser1.navigate wszPath

Code: Select all

#ifdef __FB_WIN32__
	#cmdline "Form1.rc"
#endif
'#Region "Form"
	#include once "mff/Form.bi"
	#include once "mff/WebBrowser.bi"
	#include once "mff/CommandButton.bi"
	#include once "mff/DateTimePicker.bi"
	
	Using My.Sys.Forms
	
	Type Form1Type Extends Form
		Declare Static Sub _Form_Show(ByRef Sender As Form)
		Declare Sub Form_Show(ByRef Sender As Form)
		Declare Static Sub _CommandButton1_Click(ByRef Sender As Control)
		Declare Sub CommandButton1_Click(ByRef Sender As Control)
		Declare Static Sub _cmdSetBody_Click(ByRef Sender As Control)
		Declare Sub cmdSetBody_Click(ByRef Sender As Control)
		Declare Constructor
		
		Dim As WebBrowser WebBrowser1
		Dim As CommandButton cmdGetBody, cmdSetBody
	End Type
	
	Constructor Form1Type
		' Form1
		With This
			.Name = "Form1"
			.Text = "Form1"
			.Designer = @This
			.OnShow = @_Form_Show
			.SetBounds 0, 0, 369, 323
		End With
		' WebBrowser1
		With WebBrowser1
			.Name = "WebBrowser1"
			.Text = "WebBrowser1"
			.TabIndex = 0
			.Anchor.Top = AnchorStyle.asAnchor
			.Anchor.Right = AnchorStyle.asAnchor
			.Anchor.Left = AnchorStyle.asAnchor
			.Anchor.Bottom = AnchorStyle.asAnchor
			.SetBounds 4, 6, 328, 232
			.Designer = @This
			.Parent = @This
		End With
		' cmdGetBody
		With cmdGetBody
			.Name = "cmdGetBody"
			.Text = "Get Body"
			.TabIndex = 0
			.Caption = "Get Body"
			.Anchor.Right = AnchorStyle.asAnchor
			.Anchor.Bottom = AnchorStyle.asAnchor
			.SetBounds 215, 253, 104, 27
			.Designer = @This
			.OnClick = @_CommandButton1_Click
			.Parent = @This
		End With
		' cmdSetBody
		With cmdSetBody
			.Name = "cmdSetBody"
			.Text = "Set Body"
			.TabIndex = 2
			.Caption = "Set Body"
			.Anchor.Left = AnchorStyle.asAnchor
			.Anchor.Bottom = AnchorStyle.asAnchor
			.SetBounds 59, 253, 98, 27
			.Designer = @This
			.OnClick = @_cmdSetBody_Click
			.Parent = @This
		End With
	End Constructor
	
	Private Sub Form1Type._cmdSetBody_Click(ByRef Sender As Control)
		*Cast(Form1Type Ptr, Sender.Designer).cmdSetBody_Click(Sender)
	End Sub
	
	Private Sub Form1Type._CommandButton1_Click(ByRef Sender As Control)
		*Cast(Form1Type Ptr, Sender.Designer).CommandButton1_Click(Sender)
	End Sub
	
	Private Sub Form1Type._Form_Show(ByRef Sender As Form)
		*Cast(Form1Type Ptr, Sender.Designer).Form_Show(Sender)
	End Sub
	
	Dim Shared form1 As Form1Type
	
	#ifndef _NOT_AUTORUN_FORMS_
		#define _NOT_AUTORUN_FORMS_
		
		Form1.Show
		
		App.Run
	#endif
'#End Region
' ========================================================================================
' HTML script to build a Google pie chart
' ========================================================================================
Private Function BuildPieChart3D () As String
	
	Dim s As String
	
	s  = "<!DOCTYPE html>"
	s += "<html>"
	s += "<head>"
	s += "   <meta http-equiv='X-UA-Compatible' content='IE=edge' />"
	s += "   <meta http-equiv='MSThemeCompatible' content='Yes'>"
	s += "    <script type='text/javascript' src='https://www.gstatic.com/charts/loader.js'></script>"
	s += "    <script type='text/javascript'>"
	s += "      google.charts.load('current', {packages:['corechart']});"
	s += "      google.charts.setOnLoadCallback(drawChart);"
	s += "      function drawChart() {"
	s += "        var data = google.visualization.arrayToDataTable(["
	s += "          ['Task', 'Hours per Day'],"
	s += "          ['Work',     11],"
	s += "          ['Eat',      2],"
	s += "          ['Commute',  2],"
	s += "          ['Watch TV', 2],"
	s += "          ['Sleep',    7]"
	s += "        ]);"
	s += "        var options = {"
	s += "          title: 'My Daily Activities',"
	s += "          is3D: true,"
	s += "        };"
	s += "        var chart = new google.visualization.PieChart(document.getElementById('piechart_3d'));"
	s += "        chart.draw(data, options);"
	s += "      }"
	s += "    </script>"
	s += "  </head>"
	s += "  <body>"
	s += "    <div id='piechart_3d' style='width: 600px; height: 400px;'></div>"
	s += "  </body>"
	s += "</html>"
	Function = s
	
End Function


Private Sub Form1Type.Form_Show(ByRef Sender As Form)
	webBrowser1.navigate wszPath   '"about:blank"
End Sub

Private Sub Form1Type.CommandButton1_Click(ByRef Sender As Control)
	Debug.Print WebBrowser1.GetBody() 
End Sub

Private Sub Form1Type.cmdSetBody_Click(ByRef Sender As Control)
	' Build the script
	Dim s As String = BuildPieChart3D
	WebBrowser1.setbody(s, 0)
End Sub
Avata
Posts: 106
Joined: Jan 17, 2021 7:27

Re: VisualFBEditor - IDE for FreeBasic

Post by Avata »

I think that it's time to import the webView2 or webkit2 now.
Xusinboy Bekchanov
Posts: 792
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

Avata wrote: Jun 12, 2022 2:21 VisualFBEditor's word case conversion feature is so good that it's like smart spell checking. This is treated differently according to scope. The text in the string is also not replaced.
Yes, it's finished now. But there are small nuances. We will fix them as we go.
Avata wrote: Jun 14, 2022 6:33 why the function setBody of control WebBrowser not working? But it is ok load from a file.
SaveToFile(wszPath, s)
' // Navigate to the path
webBrowser1.navigate wszPath

Code: Select all

#ifdef __FB_WIN32__
	#cmdline "Form1.rc"
#endif
'#Region "Form"
	#include once "mff/Form.bi"
	#include once "mff/WebBrowser.bi"
	#include once "mff/CommandButton.bi"
	#include once "mff/DateTimePicker.bi"
	
	Using My.Sys.Forms
	
	Type Form1Type Extends Form
		Declare Static Sub _Form_Show(ByRef Sender As Form)
		Declare Sub Form_Show(ByRef Sender As Form)
		Declare Static Sub _CommandButton1_Click(ByRef Sender As Control)
		Declare Sub CommandButton1_Click(ByRef Sender As Control)
		Declare Static Sub _cmdSetBody_Click(ByRef Sender As Control)
		Declare Sub cmdSetBody_Click(ByRef Sender As Control)
		Declare Constructor
		
		Dim As WebBrowser WebBrowser1
		Dim As CommandButton cmdGetBody, cmdSetBody
	End Type
	
	Constructor Form1Type
		' Form1
		With This
			.Name = "Form1"
			.Text = "Form1"
			.Designer = @This
			.OnShow = @_Form_Show
			.SetBounds 0, 0, 369, 323
		End With
		' WebBrowser1
		With WebBrowser1
			.Name = "WebBrowser1"
			.Text = "WebBrowser1"
			.TabIndex = 0
			.Anchor.Top = AnchorStyle.asAnchor
			.Anchor.Right = AnchorStyle.asAnchor
			.Anchor.Left = AnchorStyle.asAnchor
			.Anchor.Bottom = AnchorStyle.asAnchor
			.SetBounds 4, 6, 328, 232
			.Designer = @This
			.Parent = @This
		End With
		' cmdGetBody
		With cmdGetBody
			.Name = "cmdGetBody"
			.Text = "Get Body"
			.TabIndex = 0
			.Caption = "Get Body"
			.Anchor.Right = AnchorStyle.asAnchor
			.Anchor.Bottom = AnchorStyle.asAnchor
			.SetBounds 215, 253, 104, 27
			.Designer = @This
			.OnClick = @_CommandButton1_Click
			.Parent = @This
		End With
		' cmdSetBody
		With cmdSetBody
			.Name = "cmdSetBody"
			.Text = "Set Body"
			.TabIndex = 2
			.Caption = "Set Body"
			.Anchor.Left = AnchorStyle.asAnchor
			.Anchor.Bottom = AnchorStyle.asAnchor
			.SetBounds 59, 253, 98, 27
			.Designer = @This
			.OnClick = @_cmdSetBody_Click
			.Parent = @This
		End With
	End Constructor
	
	Private Sub Form1Type._cmdSetBody_Click(ByRef Sender As Control)
		*Cast(Form1Type Ptr, Sender.Designer).cmdSetBody_Click(Sender)
	End Sub
	
	Private Sub Form1Type._CommandButton1_Click(ByRef Sender As Control)
		*Cast(Form1Type Ptr, Sender.Designer).CommandButton1_Click(Sender)
	End Sub
	
	Private Sub Form1Type._Form_Show(ByRef Sender As Form)
		*Cast(Form1Type Ptr, Sender.Designer).Form_Show(Sender)
	End Sub
	
	Dim Shared form1 As Form1Type
	
	#ifndef _NOT_AUTORUN_FORMS_
		#define _NOT_AUTORUN_FORMS_
		
		Form1.Show
		
		App.Run
	#endif
'#End Region
' ========================================================================================
' HTML script to build a Google pie chart
' ========================================================================================
Private Function BuildPieChart3D () As String
	
	Dim s As String
	
	s  = "<!DOCTYPE html>"
	s += "<html>"
	s += "<head>"
	s += "   <meta http-equiv='X-UA-Compatible' content='IE=edge' />"
	s += "   <meta http-equiv='MSThemeCompatible' content='Yes'>"
	s += "    <script type='text/javascript' src='https://www.gstatic.com/charts/loader.js'></script>"
	s += "    <script type='text/javascript'>"
	s += "      google.charts.load('current', {packages:['corechart']});"
	s += "      google.charts.setOnLoadCallback(drawChart);"
	s += "      function drawChart() {"
	s += "        var data = google.visualization.arrayToDataTable(["
	s += "          ['Task', 'Hours per Day'],"
	s += "          ['Work',     11],"
	s += "          ['Eat',      2],"
	s += "          ['Commute',  2],"
	s += "          ['Watch TV', 2],"
	s += "          ['Sleep',    7]"
	s += "        ]);"
	s += "        var options = {"
	s += "          title: 'My Daily Activities',"
	s += "          is3D: true,"
	s += "        };"
	s += "        var chart = new google.visualization.PieChart(document.getElementById('piechart_3d'));"
	s += "        chart.draw(data, options);"
	s += "      }"
	s += "    </script>"
	s += "  </head>"
	s += "  <body>"
	s += "    <div id='piechart_3d' style='width: 600px; height: 400px;'></div>"
	s += "  </body>"
	s += "</html>"
	Function = s
	
End Function


Private Sub Form1Type.Form_Show(ByRef Sender As Form)
	webBrowser1.navigate wszPath   '"about:blank"
End Sub

Private Sub Form1Type.CommandButton1_Click(ByRef Sender As Control)
	Debug.Print WebBrowser1.GetBody() 
End Sub

Private Sub Form1Type.cmdSetBody_Click(ByRef Sender As Control)
	' Build the script
	Dim s As String = BuildPieChart3D
	WebBrowser1.setbody(s, 0)
End Sub
After your fix on github, it still doesn't work for me.
Avata wrote: Jun 14, 2022 13:46 I think that it's time to import the webView2 or webkit2 now.
This must be done together. But webkit is already used in the gtk version.
Post Reply