VisualFBEditor - IDE for FreeBasic

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

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

Avata wrote: Aug 02, 2022 12:14 Thanks, Now it is clear that two methold call a forms.
I remember that there is a optional button for automatical creat the "Common Shared As Form1Type Ptr fForm1". but now it was removed. Maybe it is important and should restore it.
But it is the same as the first one which need code "#include once "Form3.frm" before show the form3.
You told me that the code working.

Code: Select all

Common Shared As Form Ptr fForm1,fForm2,fForm3, fForm4
#include once "Form2.frm"
#include once "Form3.frm"
#include once "Form4.frm"

I wanta the code like this of a sample. Maybe it is no working so far.
There:
Form1.frm:

Code: Select all

#ifdef __FB_WIN32__
	#cmdline "Form1.rc"
#endif
'#Region "Form"
	#include once "mff/Form.bi"
	#include once "mff/Menus.bi"
	#include once "mff/Panel.bi"
	
	Using My.Sys.Forms
	
	Type Form1Type Extends Form
		Declare Static Sub _MenuItem2_Click(ByRef Sender As MenuItem)
		Declare Sub MenuItem2_Click(ByRef Sender As MenuItem)
		Declare Constructor
		
		Dim As MainMenu MainMenu1
		Dim As MenuItem MenuItem1, MenuItem2
		Dim As Panel Panel1
	End Type
	
	Constructor Form1Type
		' Form1
		With This
			.Name = "Form1"
			.Text = "Form1"
			.Designer = @This
			.Menu = @MainMenu1
			.FormStyle = FormStyles.fsMDIForm
			.WindowState = WindowStates.wsMaximized
			.SetBounds 0, 0, 350, 319
		End With
		' MainMenu1
		With MainMenu1
			.Name = "MainMenu1"
			.SetBounds 65, 111, 16, 16
			.Designer = @This
			.Parent = @This
		End With
		' MenuItem1
		With MenuItem1
			.Name = "MenuItem1"
			.Designer = @This
			.Caption = "File"
			.ParentMenu = @MainMenu1
		End With
		' MenuItem2
		With MenuItem2
			.Name = "MenuItem2"
			.Designer = @This
			.Caption = "Open"
			.OnClick = @_MenuItem2_Click
			.Parent = @MenuItem1
		End With
		' Panel1
		With Panel1
			.Name = "Panel1"
			.Text = "Panel1"
			.TabIndex = 0
			.Align = DockStyle.alLeft
			.SetBounds 0, 0, 34, 261
			.Designer = @This
			.Parent = @This
		End With
	End Constructor
	
	Private Sub Form1Type._MenuItem2_Click(ByRef Sender As MenuItem)
		*Cast(Form1Type Ptr, Sender.Designer).MenuItem2_Click(Sender)
	End Sub
	
	Dim Shared Form1 As Form1Type
	Common Shared As Form Ptr fForm1,fForm2,fForm3, fForm4
	
	#ifndef _NOT_AUTORUN_FORMS_
		#define _NOT_AUTORUN_FORMS_
		
		#include once "Form2.frm"
		#include once "Form3.frm"
		#include once "Form4.frm"
		
		fForm1 = @Form1
		fForm2 = @Form2
		fForm3 = @Form3
		fForm4 = @Form4
		
		Form1.Show
		
		App.Run
	#endif
'#End Region

Private Sub Form1Type.MenuItem2_Click(ByRef Sender As MenuItem)
	fForm2->Show Form1
End Sub
Form2.frm:

Code: Select all

#ifdef __FB_WIN32__
	#cmdline "Form1.rc"
#endif
'#Region "Form"
	#include once "mff/Form.bi"
	#include once "mff/CommandButton.bi"
	
	Using My.Sys.Forms
	
	Type Form2Type Extends Form
		Declare Static Sub _CommandButton1_Click(ByRef Sender As Control)
		Declare Sub CommandButton1_Click(ByRef Sender As Control)
		Declare Static Sub _Form_Click(ByRef Sender As Control)
		Declare Sub Form_Click(ByRef Sender As Control)
		Declare Constructor
		
		Dim As CommandButton CommandButton1
	End Type
	
	Constructor Form2Type
		' Form2
		With This
			.Name = "Form2"
			.Text = "Form2"
			.FormStyle = FormStyles.fsMDIChild
			.Designer = @This
			.OnClick = @_Form_Click
			.SetBounds 0, 0, 350, 300
		End With
		' CommandButton1
		With CommandButton1
			.Name = "CommandButton1"
			.Text = "CommandButton1"
			.TabIndex = 0
			.SetBounds 100, 66, 144, 52
			.Designer = @This
			.OnClick = @_CommandButton1_Click
			.Parent = @This
		End With
	End Constructor
	
	Private Sub Form2Type._Form_Click(ByRef Sender As Control)
		*Cast(Form2Type Ptr, Sender.Designer).Form_Click(Sender)
	End Sub
	
	Private Sub Form2Type._CommandButton1_Click(ByRef Sender As Control)
		*Cast(Form2Type Ptr, Sender.Designer).CommandButton1_Click(Sender)
	End Sub
	
	Dim Shared Form2 As Form2Type
	
	#ifndef _NOT_AUTORUN_FORMS_
		#define _NOT_AUTORUN_FORMS_
		
		Form2.Show
		
		App.Run
	#endif
'#End Region

#include once "Form3.frm"

Private Sub Form2Type.CommandButton1_Click(ByRef Sender As Control)
	Form3.Show Form1
End Sub

Private Sub Form2Type.Form_Click(ByRef Sender As Control)
	MsgBox "This is form2"
	fForm3->Show Form1
End Sub
Form3.frm:

Code: Select all

#ifdef __FB_WIN32__
	#cmdline "Form1.rc"
#endif
'#Region "Form"
	#include once "mff/Form.bi"
	
	Using My.Sys.Forms
	
	Type Form3Type Extends Form
		Declare Static Sub _Form_Click(ByRef Sender As Control)
		Declare Sub Form_Click(ByRef Sender As Control)
		Declare Constructor
		
	End Type
	
	Constructor Form3Type
		' Form3
		With This
			.Name = "Form3"
			.Text = "Form3"
			.FormStyle = FormStyles.fsMDIChild
			.Designer = @This
			.OnClick = @_Form_Click
			.SetBounds 0, 0, 350, 300
		End With
	End Constructor
	
	Private Sub Form3Type._Form_Click(ByRef Sender As Control)
		*Cast(Form3Type Ptr, Sender.Designer).Form_Click(Sender)
	End Sub
	
	Dim Shared Form3 As Form3Type
	
	#ifndef _NOT_AUTORUN_FORMS_
		#define _NOT_AUTORUN_FORMS_
		
		Form3.Show
		
		App.Run
	#endif
'#End Region

#include once "Form4.frm"

Private Sub Form3Type.Form_Click(ByRef Sender As Control)
	fForm4->Show Form1
End Sub
Form4.frm:

Code: Select all

#ifdef __FB_WIN32__
	#cmdline "Form1.rc"
#endif
'#Region "Form"
	#include once "mff/Form.bi"
	
	Using My.Sys.Forms
	
	Type Form4Type Extends Form
		Declare Constructor
		
	End Type
	
	Constructor Form4Type
		' Form4
		With This
			.Name = "Form4"
			.Text = "Form4"
			.FormStyle = FormStyles.fsMDIChild
			.Designer = @This
			.SetBounds 0, 0, 350, 300
		End With
	End Constructor
	
	Dim Shared Form4 As Form4Type
	
	#ifndef _NOT_AUTORUN_FORMS_
		#define _NOT_AUTORUN_FORMS_
		
		Form4.Show
		
		App.Run
	#endif
'#End Region
Avata
Posts: 102
Joined: Jan 17, 2021 7:27

Re: VisualFBEditor - IDE for FreeBasic

Post by Avata »

OH, Now removing MenuEditor from View menu bar? I hardly find it but found it after right click of MainMenu control.
Last edited by Avata on Aug 03, 2022 6:49, edited 1 time in total.
Xusinboy Bekchanov
Posts: 789
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

Avata wrote: Aug 02, 2022 18:08 OH, Now removing MenuEditor forms? I rember I did menu design with MenuEditor ago?
Menu Editor works. Do you have problems using the Menu Editor?
Avata
Posts: 102
Joined: Jan 17, 2021 7:27

Re: VisualFBEditor - IDE for FreeBasic

Post by Avata »

I hardly find it but found it after right click of MainMenu control. But It is better put it in the View menu bar.
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: VisualFBEditor - IDE for FreeBasic

Post by Coolman »

i ran the editor on 64 bit linux (based on ubuntu). it froze with the search for the freebasic compiler. i guess it expected to find it in /usr/bin when it was in /usr/local/bin. i deleted the VisualFBEditorX64.ini file, restarted the editor and specified the location of the compiler. it worked. most of the examples seem to be for windows but there are some that have been compiled correctly under linux. i haven't looked at the MyFbFramework framework yet but it looks promising. more examples to look at. creating an editor with a framework and a GUI generator is a great achievement. interesting project and great work.
Xusinboy Bekchanov
Posts: 789
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

Coolman wrote: Aug 03, 2022 19:02 i ran the editor on 64 bit linux (based on ubuntu). it froze with the search for the freebasic compiler. i guess it expected to find it in /usr/bin when it was in /usr/local/bin. i deleted the VisualFBEditorX64.ini file, restarted the editor and specified the location of the compiler. it worked.
I'm checking it out.
Coolman wrote: Aug 03, 2022 19:02 most of the examples seem to be for windows but there are some that have been compiled correctly under linux. i haven't looked at the MyFbFramework framework yet but it looks promising. more examples to look at.
What are some examples? In my opinion, only the GridData example does not work on Linux.
Coolman wrote: Aug 03, 2022 19:02 creating an editor with a framework and a GUI generator is a great achievement. interesting project and great work.
Thanks.
Avata
Posts: 102
Joined: Jan 17, 2021 7:27

Re: VisualFBEditor - IDE for FreeBasic

Post by Avata »

Maybe remove the file VisualFBEditor64.ini from the package and then the APP run with all default settinng at the first time. Or update the VisualFBEditor64.ini with all default settinng .
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: VisualFBEditor - IDE for FreeBasic

Post by Coolman »

in the directory Bass - a lot of errors when compiling. the dlls are for windows.it reminds me of this project:

viewtopic.php?t=19243&hilit=radio

loading Chart Example.bas causes the editor to disappear but it remains in memory, I am forced to kill the editor...

ButterflyDraw.bas
ButterflyDraw.bas(172) error 42: Variable not declared, GetTickCount
ButterflyDraw.bas(218) error 9: Expected expression, found 'GetTickCount'

WebBrowser Example.bas
linking failed: 'ld' terminated with exit code 1
ld: cannot find -lwebkitgtk-3.0

well. it is clear. it does not find the library webkitgtk

do you have other examples of using gadgets in a window. i prefer to study the source code. it's much faster than reading a documentation.
Xusinboy Bekchanov
Posts: 789
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

Coolman wrote: Aug 04, 2022 10:08 in the directory Bass - a lot of errors when compiling. the dlls are for windows.it reminds me of this project:

viewtopic.php?t=19243&hilit=radio
This example is provided by another user. This has been tested by me only on Windows.
Coolman wrote: Aug 04, 2022 10:08 loading Chart Example.bas causes the editor to disappear but it remains in memory, I am forced to kill the editor...
This is what I check.
Coolman wrote: Aug 04, 2022 10:08 ButterflyDraw.bas
ButterflyDraw.bas(172) error 42: Variable not declared, GetTickCount
ButterflyDraw.bas(218) error 9: Expected expression, found 'GetTickCount'
This is also an example of another user. Used WinAPI to measure time.
Coolman wrote: Aug 04, 2022 10:08 WebBrowser Example.bas
linking failed: 'ld' terminated with exit code 1
ld: cannot find -lwebkitgtk-3.0

well. it is clear. it does not find the library webkitgtk
Yes.
Coolman wrote: Aug 04, 2022 10:08 do you have other examples of using gadgets in a window. i prefer to study the source code. it's much faster than reading a documentation.
You can look here:
https://github.com/XusinboyBekchanov/Vi ... ussions/98

There are examples in Linux.
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: VisualFBEditor - IDE for FreeBasic

Post by Coolman »

Xusinboy Bekchanov wrote: Aug 04, 2022 11:32
Coolman wrote: Aug 04, 2022 10:08 do you have other examples of using gadgets in a window. i prefer to study the source code. it's much faster than reading a documentation.
You can look here:
https://github.com/XusinboyBekchanov/Vi ... ussions/98

There are examples in Linux.
I'll take a look. Thanks
flaviofornazier
Posts: 59
Joined: Oct 10, 2015 7:19
Location: Brazil

Re: VisualFBEditor - IDE for FreeBasic

Post by flaviofornazier »

Xusinboy Bekchanov wrote: Aug 02, 2022 7:17
flaviofornazier wrote: Aug 01, 2022 19:45 - At this point Form2 disappears from design mode as you can see in attached image.
Fixed: Showing MDI Child Form on Design Mode:
https://github.com/XusinboyBekchanov/My ... 7b24000d11
flaviofornazier wrote: Aug 01, 2022 19:45 - Save all and F5... Form1 is shown as wsNormal and if you click the Open menu item nothing happens...
Fixed: Closing and Showing MDI Child:
https://github.com/XusinboyBekchanov/My ... 14c6a3ddc7

It needs to be shown like this:

Code: Select all

Form2.Show Form1
Mr. Bekchanov,

Thank you for your time.

MDI Issues fixed, including WindowState property. Tested on Windows 7/8/10/11 (x64), except if the programmer drag a StatusBar to the MDIForm and minimize the MDIChild.

Well, on Windows 7/8/10 (x86), the MDIChild is shown inside a small window with scrollbars and sometimes when you press F5 and close the executable, Form1 still in task manager.

From now on, I will post issues on Github.

Thank you in advanced. =)
Avata
Posts: 102
Joined: Jan 17, 2021 7:27

Re: VisualFBEditor - IDE for FreeBasic

Post by Avata »

Xusinboy Bekchanov wrote: Aug 04, 2022 11:32
Coolman wrote: Aug 04, 2022 10:08 ButterflyDraw.bas
ButterflyDraw.bas(172) error 42: Variable not declared, GetTickCount
ButterflyDraw.bas(218) error 9: Expected expression, found 'GetTickCount'
This is also an example of another user. Used WinAPI to measure time.
1. Could you please fixed this and could be run in OS Linux.

2. Can not change the image of the menuItem in Property winndows.
Xusinboy Bekchanov
Posts: 789
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

Avata wrote: Aug 05, 2022 3:57
Xusinboy Bekchanov wrote: Aug 04, 2022 11:32
Coolman wrote: Aug 04, 2022 10:08 ButterflyDraw.bas
ButterflyDraw.bas(172) error 42: Variable not declared, GetTickCount
ButterflyDraw.bas(218) error 9: Expected expression, found 'GetTickCount'
This is also an example of another user. Used WinAPI to measure time.
1. Could you please fixed this and could be run in OS Linux.
I'll take a look when I get home.
Avata wrote: Aug 05, 2022 3:57 2. Can not change the image of the menuItem in Property winndows.
To do this, select an image from the Image property of the MenuItem in Properties window.
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: VisualFBEditor - IDE for FreeBasic

Post by Coolman »

hello. i just looked at the license of your framework. it's apparently the GPL. this license forces the developers to provide the source code of their programs. it's logical for your editor. any modification will benefit to its improvement but for the framework, it's an important constraint. do you consider to change this license? the MIT license is more adapted.
Xusinboy Bekchanov
Posts: 789
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

Coolman wrote: Aug 05, 2022 12:11 hello. i just looked at the license of your framework. it's apparently the GPL. this license forces the developers to provide the source code of their programs. it's logical for your editor. any modification will benefit to its improvement but for the framework, it's an important constraint. do you consider to change this license? the MIT license is more adapted.
This also applies to the framework. The framework can be used as a dll. Then there is no need to open the source code.
Post Reply