VisualFBEditor - IDE for FreeBasic

User projects written in or related to FreeBASIC.
Post Reply
UEZ
Posts: 1028
Joined: May 05, 2017 19:59
Location: Germany

Re: VisualFBEditor - IDE for FreeBasic

Post by UEZ »

Thx.
UEZ
Posts: 1028
Joined: May 05, 2017 19:59
Location: Germany

Re: VisualFBEditor - IDE for FreeBasic

Post by UEZ »

I found one issue. When the editor is not running and *.bas is assigned to VisualFBEditor and I double click on a *.bas file then only the file will be loaded not the other opened files which are saved in the session file. No issue when the editor is running.
Xusinboy Bekchanov
Posts: 845
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

UEZ wrote: Jan 19, 2025 19:00 I found one issue. When the editor is not running and *.bas is assigned to VisualFBEditor and I double click on a *.bas file then only the file will be loaded not the other opened files which are saved in the session file. No issue when the editor is running.
Fixed: Opening the last opened file when specifying a file on the command line:
https://github.com/XusinboyBekchanov/Vi ... 1b7b587690
UEZ
Posts: 1028
Joined: May 05, 2017 19:59
Location: Germany

Re: VisualFBEditor - IDE for FreeBasic

Post by UEZ »

Looks good now but when editor window is minimized (invisible) only and double click on a *.bas file will load the file and bring the editor to the front (restore window) - not when it is already visible then only icon on the taskbar is flashing.
Xusinboy Bekchanov
Posts: 845
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

UEZ wrote: Jan 19, 2025 23:22 Looks good now but when editor window is minimized (invisible) only and double click on a *.bas file will load the file and bring the editor to the front (restore window) - not when it is already visible then only icon on the taskbar is flashing.
If the IDE window is visible then the file will open and the IDE window will become active. I have Windows 10 so the window title will turn blue.
stan1958
Posts: 7
Joined: Oct 24, 2020 21:17

Re: VisualFBEditor - IDE for FreeBasic

Post by stan1958 »

Hi,

How to add new Tabpages dynamically to a TabControl and be able to update controls in them.

not through the Toolbox/containers

Thanks
Xusinboy Bekchanov
Posts: 845
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

stan1958 wrote: Feb 05, 2025 21:33 Hi,

How to add new Tabpages dynamically to a TabControl and be able to update controls in them.

not through the Toolbox/containers

Thanks
Hi,

This is how you can do it:

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/TabControl.bi"
	#include once "mff/CommandButton.bi"
	
	Using My.Sys.Forms
	
	Type Form1Type Extends Form
		Declare Sub CommandButton1_Click(ByRef Sender As Control)
		Declare Constructor
		
		Dim As TabControl TabControl1
		Dim As CommandButton CommandButton1
	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
		' TabControl1
		With TabControl1
			.Name = "TabControl1"
			.Text = "TabControl1"
			.TabIndex = 0
			.SetBounds 20, 50, 240, 150
			.Designer = @This
			.Parent = @This
		End With
		' CommandButton1
		With CommandButton1
			.Name = "CommandButton1"
			.Text = "Add Tab Page"
			.TabIndex = 1
			.Caption = "Add Tab Page"
			.SetBounds 10, 210, 120, 30
			.Designer = @This
			.OnClick = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As Control), @CommandButton1_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 NewCommandButton_Click(ByRef Designer As My.Sys.Object, ByRef Sender As Control)
	MsgBox Sender.Text
End Sub

Private Sub Form1Type.CommandButton1_Click(ByRef Sender As Control)
	Var NewTabPage = TabControl1.AddTab("New Tab 1")
	Var NewCommandButton = New CommandButton
	NewCommandButton->Text = "New CommandButton"
	NewCommandButton->SetBounds 10, 10, 150, 30
	NewCommandButton->OnClick = @NewCommandButton_Click
	NewTabPage->Add NewCommandButton
	Var NewTabPage2 = TabControl1.AddTab("New Tab 2")
End Sub
stan1958
Posts: 7
Joined: Oct 24, 2020 21:17

Re: VisualFBEditor - IDE for FreeBasic

Post by stan1958 »

Many Thanks :D
Post Reply