VisualFBEditor - IDE for FreeBasic

User projects written in or related to FreeBASIC.
Post Reply
Avata
Posts: 80
Joined: Jan 17, 2021 7:27

Re: VisualFBEditor - IDE for FreeBasic

Post by Avata »

The Chart 1 is a curve but the ChartStyle is the same ChartStyles.CS_Area. The ChartStyle of Chart 5 is the same. What’s the difference between Chart 1 and Chart 5

Image
Xusinboy Bekchanov
Posts: 661
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

Avata wrote: Sep 19, 2022 19:26 The Chart 1 is a curve but the ChartStyle is the same ChartStyles.CS_Area. The ChartStyle of Chart 5 is the same. What’s the difference between Chart 1 and Chart 5
In Chart 5, the FillOpacity property is filled.
Avata
Posts: 80
Joined: Jan 17, 2021 7:27

Re: VisualFBEditor - IDE for FreeBasic

Post by Avata »

Good. But the ChartOrientations not working in Chart1 and Chart5. This is important also.
Avata
Posts: 80
Joined: Jan 17, 2021 7:27

Re: VisualFBEditor - IDE for FreeBasic

Post by Avata »

Xusinboy Bekchanov wrote: Sep 16, 2022 13:02
Avata wrote: Sep 16, 2022 9:27 Just compile the source code as normal project. It is difficult do a visual design.
You can submit a pull request as a Project template.
I am ot sure which one is better for FLTK? FLTK-C or FLTK with no wrap?
Xusinboy Bekchanov
Posts: 661
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

Avata wrote: Sep 23, 2022 6:32
Xusinboy Bekchanov wrote: Sep 16, 2022 13:02
Avata wrote: Sep 16, 2022 9:27 Just compile the source code as normal project. It is difficult do a visual design.
You can submit a pull request as a Project template.
I am ot sure which one is better for FLTK? FLTK-C or FLTK with no wrap?
Maybe the second
Xusinboy Bekchanov
Posts: 661
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

I have released new version:

Version 1.3.3 (September 25, 2022)
- Fixed: Namespace intellisense
- Improved: Make and Make clean functions
- Fixed: Intellisense for variables inside Namespace
- Improved: Include paths also added to Auto Complete
- Fixed: Showing Options Controls on Linux
- Fixed: Define function on Linux
- Fixed: Var Intellisense
- Fixed: Define function
- Fixed: Ctrl+Click on Include File in Linux
- Added: Split functions on Linux
- Fixed: Warnings when showing tooltips on Linux
- Fixed: Crashing IDE on Linux
- Added: Line Labels syntax highlighting
- Fixed: Showing bottom pin button on Linux
- Fixed: Designing Menu Item Images
- Added: Double Buffer to Menu Editor
- Added: MDI Notepad Example
- Fixed: Showing ToolBar in Designer and Menu Editor on High DPI
- Fixed: Adding ToolTips control as component
- Improved: Disabled menu items and tool buttons will be colored correctly in design mode.
- Improved: It is only possible to enter a number in the Goto form.
- Fixed: Focus changing on edit items in Menu Editor
- Added: Insert, Move Up and Move Down functions to ToolBar Editor and StatusBar Editor
- Fixed: Opening StatusBar Editor
- Fixed: Updating Edit Control after Numbering or Remove numbering
- Fixed: Showing Drop down tooltips on Linux
- Improved: Showing Options window on Linux
- Fixed: Error on Design ToolBar
- Fixed: IntelliSense
- Changed: Form templates
- Improved: When opening a project, all used controls are loaded into the Toolbox.
- Added: MDIForm example
- Added: rs_Types parameter to FindByte(Utf) and FindOneByte(Utf) functions of MariaDBBox and SQLite3Component
- Fixed: TransactionBegin method of MariaDBBox
- Added: TransactionRollback function to SQLite3Component and MariaDBBox
- Fixed: TransactionEnd function of MariaDBBox
- Fixed: Auto CompleteWord and ParameterInfo inside string and comments
- Fixed: Errors in SQLite3Component and MariaDBBox
- Improved: "Form" and "Code and Form" functions
- Added: Add Procedure function
- Added: Duplicate Menu item to Designer Context Menu
- Added: host, unix_socket, clientflag parameters to Open method of MariaDBBox component
- Fixed: Auto Complete Word inside String
- Added: UserName and Port parameters to Open function of MariaDBBox
- Fixed: Reading blob columns with MariaDBBox
- Fixed: Changing Font size and Font name in the Edit Control
- Added: MariaDBBox component
- Fixed: Numbering, Format Code, Comment, Uncomment, Indent and Outdent functions
- Improved: Speed updating Of Edit Control
- Improved: The names of all selected controls are displayed in the Properties and Events window.
- Added: Showing Selected Control Name in Properties and Events Windows
- Fixed: Updating Edit Control on Divided Mode
- Fixed: The Error Handling function will fire the correct exit operator.
- Fixed: Updating values in the Properties Window after insert a new Menu Item on Menu Editor.
- Improved: Edit Control updates faster
- Improved: Speed of Auto complete
- Added: OnSQLString function event and OnErrorOut sub event to SQLite3Component.
- Added: Ability to process function events in the IDE.
- Fixed: Return of error ERROR_BROKEN_PIPE (109) when closing started without a console program.
- Fixed: Set Parent to Components in Designer
- Fixed: Opening Files with Ctrl + Click for another components
- Improved: Checking and unchecking libraries in Components Window adds components to ToolBox and deletes from it.
- Fixed: Undo and Redo functions of Code Editor
- Improved: Components Window
- Added: Saving Components library settings
- Added: Showing Control libraries in Components window
- Added: Components Form
- Improved: Add Form, Module, etc. template to the Project auto opens the new tab on the IDE
- Added: Designing controls from multiple libraries
- Added: Multiple add resources and files to ImageList in ImageList Editor
- Improved: ImageList Editor
- Improved: Image Manager
- Fixed: Menu Editor on High DPI
- Added: Move Up and Move Down functions to Menu Editor
- Fixed: Butterfly Draw Example on Linux
- Improved: Send to Back and Bring to Front functions of Designer
- Added: "Delete menu item" Context menu to Menu Editor
- Fixed: Changing MenuItem properties with Property Window
- Fixed: Remove MainMenu with MenuItems
- Fixed: Numbering with collapsible lines
- Fixed: On set wrong Component values on Design shows Message to User
- Added: Insert menu item to Menu Editor
- Added: Shift Mouse Wheel for Code Editor to horizontal scrolling
- Added: Shift Mouse Wheel for Designer to horizontal scrolling
- Fixed: IntelliSense with nested constructions
- Improved: Syntax Highlighting Identifiers with One Dot and Two Dot
- Improved: Comment Single And Comment Block
- Fixed: Syntax Highlighting Members of Types
- Changed: Type of Key parameter of KeyPress event from Byte To Integer
- Added: Collapsing If, For, Select Case and etc.
- Fixed: Vertical Scroll on Code Editor Folding.
- Added: Collapse and Uncollapse Current, All Procedures menu items
- Fixed: Auto Complete words by press Enter Key.
- Improved: Showing Edit Control DropDown with ToolTips
- Fixed: Focus when copying and selecting controls when designing.
- Fixed: Loading codes longer than 1024 symbols
- Added: IDE creates a new line if the string of controls exceeds 1024 characters when adding new control
- Fixed: Starting programs with a space in the name using cmd.exe
- Fixed: Showing brackets by position on High DPI
- Fixed: Scrolling to the end line of the Edit Control
- Fixed: Find Control at Cursor in Designer on High DPI
- Added: Syntax Highlighting Identifiers option
- Changed: Macro identifier color
- Added: VisualFBEditor and MyFbFramework Discussions menu item to Help menu
- Added: Input the integer value of color to change color setting directly
- Fixed: Syntax Highlighting Static Subs and Functions
- Changed: Syntax Color of Shared and Common Variables on Dark theme
- Added: Syntax Highlighting Member Identifiers
- Added: Syntax Highlighting Identifiers with membership
- Fixed: Syntax Highlighting Identifiers with two dots on start
- Fixed: Syntax Highlighting For Next local variable
- Added: Syntax Highlighting Operators
- Improved: Change Identifiers Case
- Improved: Syntax Highlighting Identifiers
- Added: Local Args Syntax Highlighting
- Added: Change Identifiers Case option
- Improved: Sorted Add Controls to Class List on Design
- Fixed: Integrated GDB Debugger
- Fixed: Add space after keyword "To"
- Added: DownloadAndCompileForRaspbian.sh
- Fixed: Crashing IDE when start on Linux
- Fixed: UTF8 support on function LoadFromFile
- Fixed: Add space to Oct Value &O
- Improved: Showing WinAPI and GTK API tooltips
- Improved: Showing keyword tooltips
- Added: GTK API Functions to KeyWordsHelp.txt
- Fixed: Run compiled program
- Added: Windows SDK API functions to Keywords Help
- Added: Automatic change of Parameter Info when changing the selection while the tooltip is open.
- Fixed: Functions list
- Added: Syntax Highlighting Namespaces, Components, Types, Enums, Functions, Args
- Fixed: Properties Window on High DPI
- Fixed: Size of Menu images on High DPI
- Fixed: Crashing when showing Parameter Info
- Fixed: Showing Parameter info
- Improved: Show Tooltip for functions.
- Fixed: IDE closing when waiting for a running program.
- Improved: Showing Keywords parameter info
- Added: Cut Current Line to Edit Menu
- Added: Erase Immediate Window button
- Fixed: Namespace intellisense
- Added: Compiling programs with _DebugWindow_ define
- Fixed: File number leak
- Fixed: Double clicking on an event in the Event window shows the Code editor
- Fixed: Displaying the FBMemCheckAssist Add-In Menu Item in the Service Menu
- Added: Install git and wget to DownloadAndCompile.sh
- Added: DownloadAndCompile.sh for Linux
- Improved: DownloadAndCompileWithQuestion.bat adds Compilers and Debuggers folder
- Added: Download GDB question to DownloadAndCompileWithQuestion.bat
- Added: Default Compiler and GDB path settings to VisualFBEditor folder
- Fixed: Compiling 64-bit with DownloadAndCompileWithQuestions.bat
- Fixed: EditControl LoadFromFile
- Fixed: TabPage on Design Mode
- Improved: Closing split tabs removes empty space too.
- Fixed: Ctrl + MouseMove on Edit Control on Vertically Split Mode
- Fixed: Reload History Code function, now Open File Dialog opens the Temp folder
- Added: Localization the help of Keywords
- Fixed: Activating Tab
- Added: Split Up, Split Down, Split Left and Split Right functionality to Tab Page menu
- Added: DownloadAndCompileWithQuestions.bat
- Fixed: GridData example: sorting by numbers
- Fixed: Limit debug to the directory of the main file option
- Added: DownloadAndCompile.bat
- Added: Manage the history backup file.
- Added: Show Tooltips at the Top option
- Fixed: Showing Edit control tooltips
- Fixed: Edit control lose focus on mouse move to tooltip hyperlink
PeterHu
Posts: 46
Joined: Jul 24, 2022 4:57

Re: VisualFBEditor - IDE for FreeBasic

Post by PeterHu »

Greetings,

I downloaded the latest release from github today and have a try on this ,it is great!

I have a couple of questions to ask(for help) and issues to report:
1. Does the IDE/MyFrameWork provide its own documentation,and tutorials step by step for the beginners?I searched and got some helps regarding win32 sdk/freebasic help file in the help subfolder but failed to find guidline on ide or myframework.

2. When I created a windows sdk program,it is fine,but when I created a new Form and added it to the current project,I can not find ways to call and show it from the main windows which was created by the sdk routine.Is it possible?d

3. When I created a GUI project ,it is fine as well,but when I created a new form and added it to the current project ,failed again to call and show it from the main form cause I cann't #include this form's header file since there is not such a header.How can I do this?

4. When I drag and put a couple of controls to the form and try to modify their properties,esp. the TextBox one ,the IDE disappeared and I have to restarted again.This issue ocurred several time when I try to do so.

5. When I tried to write some event procedures ,for example a commandButton clicked event,I noticed the Edit area flicks very frequently ,seems it updated itself when there is any key down event ocurring.

I chose 64bit the IDE for my Win10.

Thanks for the help in advance.
Avata
Posts: 80
Joined: Jan 17, 2021 7:27

Re: VisualFBEditor - IDE for FreeBasic

Post by Avata »

You can run and review the source code in "Examples". For example the project "MDINotepad" showinng a lot of skill. Those code can run both in OS Windows and Linux.
Xusinboy Bekchanov
Posts: 661
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

PeterHu wrote: Sep 26, 2022 14:47 Greetings,

I downloaded the latest release from github today and have a try on this ,it is great!
Thank you.
PeterHu wrote: Sep 26, 2022 14:47 I have a couple of questions to ask(for help) and issues to report:
1. Does the IDE/MyFrameWork provide its own documentation,and tutorials step by step for the beginners?I searched and got some helps regarding win32 sdk/freebasic help file in the help subfolder but failed to find guidline on ide or myframework.
There is no manual for the IDE. For MyFbFramework you can read here:
https://github.com/XusinboyBekchanov/Vi ... ussions/98
PeterHu wrote: Sep 26, 2022 14:47 2. When I created a windows sdk program,it is fine,but when I created a new Form and added it to the current project,I can not find ways to call and show it from the main windows which was created by the sdk routine.Is it possible?d
Yes. To do this, you need to include the frm file:
Form1.frm:

Code: Select all

'#Region "Form"
	#if defined(__FB_MAIN__) AndAlso Not defined(__MAIN_FILE__)
		#define __MAIN_FILE__ __FILE__
		#ifdef __FB_WIN32__
			#cmdline "Form1.rc"
		#endif
	#endif
	#include once "mff/Form.bi"
	
	Using My.Sys.Forms
	
	Type Form1Type Extends Form
		
	End Type
	
	Dim Shared Form1 As Form1Type
	
	'#if __MAIN_FILE__ = __FILE__
	'	Form1.Show
	'	
	'	App.Run
	'#endif
'#End Region
Form1.bas:

Code: Select all

'#Compile "Form1.rc"
#define __MAIN_FILE__ __FILE__
#include once "Form1.frm"
#include once "windows.bi"
#include once "win\commctrl.bi"

Dim msg As MSG
Dim As WNDCLASSEX wc
Dim As WString * 100 NameClass = "MyClass"
Dim As HINSTANCE HInst = GetModuleHandle(0)

Function WndProc(hwnd As HWND, msg As UInteger, wparam As WPARAM, lparam As LPARAM) As Integer
	Select Case msg
	Case WM_CREATE
		
	Case WM_COMMAND
		
	Case WM_LBUTTONUP
		Form1.Show
	Case WM_DESTROY
		PostQuitMessage(0)
	End Select
	Return DefWindowProc(hwnd, msg, wparam, lparam)
End Function

With wc
	.cbSize = SizeOf(WNDCLASSEX)
	.style = CS_HREDRAW Or CS_VREDRAW
	.lpfnWndProc = @WndProc
	.hInstance = HInst
	.hIcon = LoadIcon(0, IDI_QUESTION)
	.hCursor = LoadCursor(0, IDC_ARROW)
	.hbrBackground = Cast(HBRUSH, COLOR_WINDOW)
	.lpszClassName = StrPtr(NameClass)
	.hIconSm = .hIcon
End With

If RegisterClassEx(@wc) = 0 Then
	Print "Register error, press any key"
	Sleep
	End
EndIf

InitCommonControls

CreateWindowEx(0, NameClass, "Main Window", WS_VISIBLE Or WS_OVERLAPPEDWINDOW, 10, 10, 300, 300, 0, 0, HInst, 0)

Form1.MainForm = False

While GetMessage(@msg, 0, 0, 0)
	TranslateMessage(@msg)
	DispatchMessage(@msg)
Wend
PeterHu wrote: Sep 26, 2022 14:47 3. When I created a GUI project ,it is fine as well,but when I created a new form and added it to the current project ,failed again to call and show it from the main form cause I cann't #include this form's header file since there is not such a header.How can I do this?
This is how you can call the second form:

Code: Select all

'#Region "Form"
	#if defined(__FB_MAIN__) AndAlso Not defined(__MAIN_FILE__)
		#define __MAIN_FILE__ __FILE__
		#ifdef __FB_WIN32__
			#cmdline "Form1.rc"
		#endif
	#endif
	#include once "mff/Form.bi"
	
	Using My.Sys.Forms
	
	Type Form1Type Extends Form
		Declare Static Sub _Form_Click(ByRef Sender As Control)
		Declare Sub Form_Click(ByRef Sender As Control)
		Declare Constructor
		
	End Type
	
	Constructor Form1Type
		' Form1
		With This
			.Name = "Form1"
			.Text = "Form1"
			.Designer = @This
			.OnClick = @_Form_Click
			.SetBounds 0, 0, 350, 300
		End With
	End Constructor
	
	Private Sub Form1Type._Form_Click(ByRef Sender As Control)
		*Cast(Form1Type Ptr, Sender.Designer).Form_Click(Sender)
	End Sub
	
	Dim Shared Form1 As Form1Type
	
	#if __MAIN_FILE__ = __FILE__
		Form1.Show
		
		App.Run
	#endif
'#End Region

#include "Form2.frm"

Private Sub Form1Type.Form_Click(ByRef Sender As Control)
	Form2.Show
End Sub
PeterHu wrote: Sep 26, 2022 14:47 4. When I drag and put a couple of controls to the form and try to modify their properties,esp. the TextBox one ,the IDE disappeared and I have to restarted again.This issue ocurred several time when I try to do so.
What property?
PeterHu wrote: Sep 26, 2022 14:47 5. When I tried to write some event procedures ,for example a commandButton clicked event,I noticed the Edit area flicks very frequently ,seems it updated itself when there is any key down event ocurring.
Can you show it on video?
PeterHu
Posts: 46
Joined: Jul 24, 2022 4:57

Re: VisualFBEditor - IDE for FreeBasic

Post by PeterHu »

Thank you for the reply.
PeterHu wrote: ↑Sep 26, 2022 22:47
2. When I created a windows sdk program,it is fine,but when I created a new Form and added it to the current project,I can not find ways to call and show it from the main windows which was created by the sdk routine.Is it possible?d
Yes. To do this, you need to include the frm file:
Form1.frm:
Regarding to add a second form and show it from the main windows which was created by SDK,I followed your guideline and got a failed compilation message as this:

Code: Select all

09:06:06: Compilation: "E:\Learning\FreeBasic\WinFBE\toolchains\FreeBASIC-1.09.0-winlibs-gcc-9.3.0\fbc64.exe"  -b "Form1.bas" -exx -v  "Form1.rc" -i "E:\Learning\FreeBasic\VisualFBEditor\Controls\MariaDBBox" -i "E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework" -i "E:\Learning\FreeBasic\VisualFBEditor\Controls\SQLite3" -d _DebugWindow_=5964602

FreeBASIC Compiler - Version 1.09.0 (2021-12-31), built for win64 (64bit)

Copyright (C) 2004-2021 The FreeBASIC development team.

standalone

target:       win64, x86-64, 64bit

backend:      gcc

compiling:    Form1.bas -o Form1.c (main module)

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\SysUtils.bas(48) warning 3(2): Passing different pointer types, at parameter 5 of FORMATMESSAGE()

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Bitmap.bas(321) warning 3(2): Passing different pointer types, at parameter 3 of FINDRESOURCEW()

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Bitmap.bas(322) warning 3(2): Passing different pointer types, at parameter 3 of FINDRESOURCEW()

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Canvas.bas(592) warning 3(2): Passing different pointer types, at parameter 4 of TEXTOUT()

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Canvas.bas(852) warning 3(2): Passing different pointer types, at parameter 2 of GETTEXTEXTENTPOINT32()

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Canvas.bas(879) warning 3(2): Passing different pointer types, at parameter 2 of GETTEXTEXTENTPOINT32()

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Menus.bas(137) warning 4(2): Suspicious pointer assignment

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Menus.bas(471) error 58: Type mismatch, at parameter 1 (value) of SETITEMINFO()

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Menus.bas(483) error 58: Type mismatch, at parameter 1 (value) of SETITEMINFO()

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Menus.bas(502) error 58: Type mismatch, at parameter 1 (value) of SETITEMINFO()

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Menus.bas(675) warning 4(2): Suspicious pointer assignment

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\DarkMode\DarkMode.bas(156) warning 3(2): Passing different pointer types, at parameter 1 of LSTRCMPI()

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Application.bas(122) warning 3(2): Passing different pointer types, at parameter 2 of GETMODULEFILENAME()

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Application.bas(562) warning 3(2): Passing different pointer types, at parameter 1 of GETFILEVERSIONINFOSIZE()

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Application.bas(566) warning 3(2): Passing different pointer types, at parameter 1 of GETFILEVERSIONINFO()

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Application.bas(744) warning 3(2): Passing different pointer types, at parameter 2 of MESSAGEBOX()

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Application.bas(744) warning 3(2): Passing different pointer types, at parameter 3 of MESSAGEBOX()

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Control.bas(387) warning 3(2): Passing different pointer types, at parameter 2 of GETWINDOWTEXT()

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Control.bas(432) warning 4(2): Suspicious pointer assignment

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Control.bas(2132) warning 4(2): Suspicious pointer assignment

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Control.bas(2146) warning 4(2): Suspicious pointer assignment

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Control.bas(2157) warning 4(2): Suspicious pointer assignment

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Control.bas(2529) warning 4(2): Suspicious pointer assignment

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Form.bas(949) warning 4(2): Suspicious pointer assignment

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\Form.bas(957) warning 4(2): Suspicious pointer assignment

E:\Learning\FreeBasic\VisualFBEditor\Controls\MyFbFramework\mff\TextBox.bas(582) warning 3(2): Passing different pointer types, at parameter 2 of SETWINDOWTEXT()

Form1.bas(27) warning 4(2): Suspicious pointer assignment


09:06:09: found Errors (3 Pos)Warnings (24 Pos)
09:06:09: Do not build file. Elapsed Time: 3.60 Seconds

For the other one,Visual Designer made GUI,first (main) Form,second Form...,I followed your guideline and compiled successfully,but when run app,only the second form pops up ,the main one doesn't.

mainform.frm:

Code: Select all

'#Region "Form"
	#if defined(__FB_MAIN__) AndAlso Not defined(__MAIN_FILE__)
		#define __MAIN_FILE__ __FILE__
		#ifdef __FB_WIN32__
			#cmdline "Form1.rc"
		#endif
	#endif
	'#define __MAIN_FILE__ __FILE__
	#include once "secondForm.frm"
	#include once "mff/Form.bi"
	#include once "mff/CommandButton.bi"
	
	Using My.Sys.Forms
	
	Type mainFormType Extends Form
		Declare Static Sub _btnShowSecond_Click(ByRef Sender As Control)
		Declare Sub btnShowSecond_Click(ByRef Sender As Control)
		Declare Constructor
		
		Dim As CommandButton btnShowSecond
	End Type
	
	Constructor mainFormType
		' mainForm
		With This
			.Name = "mainForm"
			.Text = "Main Form"
			.Designer = @This
			.Caption = "Main Form"
			.SetBounds 0, 0, 350, 300
		End With
		' btnShowSecond
		With btnShowSecond
			.Name = "btnShowSecond"
			.Text = "ShowSecond"
			.TabIndex = 0
			.Caption = "ShowSecond"
			.SetBounds 170, 180, 90, 30
			.Designer = @This
			.OnClick = @_btnShowSecond_Click
			.Parent = @This
		End With
	End Constructor
	
	Private Sub mainFormType._btnShowSecond_Click(ByRef Sender As Control)
		*Cast(mainFormType Ptr, Sender.Designer).btnShowSecond_Click(Sender)
	End Sub
	
	Dim Shared mainForm As mainFormType
	
	#if __MAIN_FILE__ = __FILE__
		mainForm.Show
		
		App.Run
	#endif
'#End Region

Private Sub mainFormType.btnShowSecond_Click(ByRef Sender As Control)
	SecondForm.Show()
End 
secondForm.frm:

Code: Select all

'#Region "Form"
	#if defined(__FB_MAIN__) AndAlso Not defined(__MAIN_FILE__)
		#define __MAIN_FILE__ __FILE__
		#ifdef __FB_WIN32__
			#cmdline "Form1.rc"
		#endif
	#endif
	#include once "mff/Form.bi"
	#include once "mff/CommandButton.bi"
	
	Using My.Sys.Forms
	
	Type secondFormType Extends Form
		Declare Static Sub _btnBack_Click(ByRef Sender As Control)
		Declare Sub btnBack_Click(ByRef Sender As Control)
		Declare Constructor
		
		Dim As CommandButton btnBack
	End Type
	
	Constructor secondFormType
		' secondForm
		With This
			.Name = "secondForm"
			.Text = "Second Form"
			.Designer = @This
			.Caption = "Second Form"
			.SetBounds 0, 0, 350, 300
		End With
		' btnBack
		With btnBack
			.Name = "btnBack"
			.Text = "Go Back"
			.TabIndex = 0
			.Caption = "Go Back"
			.SetBounds 180, 190, 100, 40
			.Designer = @This
			.OnClick = @_btnBack_Click
			.Parent = @This
		End With
	End Constructor
	
	Private Sub secondFormType._btnBack_Click(ByRef Sender As Control)
		*Cast(secondFormType Ptr, Sender.Designer).btnBack_Click(Sender)
	End Sub
	
	Dim Shared secondForm As secondFormType
	
	#if __MAIN_FILE__ = __FILE__
		secondForm.Show
		
		App.Run
	#endif
'#End Region

Private Sub secondFormType.btnBack_Click(ByRef Sender As Control)
	this.CloseForm()
End Sub
Was I doing something wrong or missing something?
PeterHu wrote: ↑Sep 26, 2022 22:47
4. When I drag and put a couple of controls to the form and try to modify their properties,esp. the TextBox one ,the IDE disappeared and I have to restarted again.This issue ocurred several time when I try to do so.
What property?
For a simple execise,I only modified property Name and Text in the properties window,no touched any source code in the editer area which was generated by the IDE designer.
PeterHu wrote: ↑Sep 26, 2022 22:47
5. When I tried to write some event procedures ,for example a commandButton clicked event,I noticed the Edit area flicks very frequently ,seems it updated itself when there is any key down event ocurring.
Can you show it on video?
Now I know why was that,they are the autocompletion pop-ups,just ignore this.
PeterHu
Posts: 46
Joined: Jul 24, 2022 4:57

Re: VisualFBEditor - IDE for FreeBasic

Post by PeterHu »

Avata wrote: Sep 26, 2022 17:00 You can run and review the source code in "Examples". For example the project "MDINotepad" showinng a lot of skill. Those code can run both in OS Windows and Linux.
Thank you,I will try soon.

May I ask when you mention about in OS Windows and Linux,does that mean the gui(the framework) is portable,not just Windows specific?But I noticed the frame I made is quite windows native look & feel.
PeterHu
Posts: 46
Joined: Jul 24, 2022 4:57

Re: VisualFBEditor - IDE for FreeBasic

Post by PeterHu »

One more thing---
When I tried to study the examples\MDIForm,I noticed this code:

Code: Select all

Private Sub MDIMainType.mnuHelp_Click(ByRef Sender As MenuItem)
	Select Case Sender.Name
	Case "mnuHelpAbout"
		MsgBox(!"Visual FB Editor MDI Demo\r\nBy Cm Wang", "MDI Demo")
	Case Else
		MsgBox Sender.Name & !"\r\nThis function is under construction", "Edit"
	End Select
End Sub
"\r\n"---C style escape sequence in FreeBasic!when I run the app,the \r\n is effective there!!Based on my poor knowledge about FreeBasic,it uses chr() instead of escape sequence as C does.Am I totally wrong?Personnaly I love escape sequence because it is efficient when writing code.
oyster
Posts: 259
Joined: Oct 11, 2005 10:46

Re: VisualFBEditor - IDE for FreeBasic

Post by oyster »

PeterHu wrote: Sep 27, 2022 1:57 One more thing---
When I tried to study the examples\MDIForm,I noticed this code:

Code: Select all

!"Visual FB Editor MDI Demo\r\nBy Cm Wang"

there is a ! at the beginning, please read https://www.freebasic.net/wiki/TblEscapeSequences
Xusinboy Bekchanov
Posts: 661
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

PeterHu wrote: Sep 27, 2022 1:34 Regarding to add a second form and show it from the main windows which was created by SDK,I followed your guideline and got a failed compilation message as this:
In my example, I added #include once "Form1.frm" before #include once "windows.bi". Because, #define UNICODE is defined in the framework. And it is not in the Form1.bas file. If you write #include once "windows.bi" first, then all WinAPI functions use "A" variants, not "W" variants, i.e. ascii variants, not unicode variants. Or you can add #define UNICODE before #include once "windows.bi" yourself, then there will be no errors.
PeterHu wrote: Sep 27, 2022 1:34 For the other one,Visual Designer made GUI,first (main) Form,second Form...,I followed your guideline and compiled successfully,but when run app,only the second form pops up ,the main one doesn't.

mainform.frm:

Code: Select all

'#Region "Form"
	#if defined(__FB_MAIN__) AndAlso Not defined(__MAIN_FILE__)
		#define __MAIN_FILE__ __FILE__
		#ifdef __FB_WIN32__
			#cmdline "Form1.rc"
		#endif
	#endif
	'#define __MAIN_FILE__ __FILE__
	#include once "secondForm.frm"
	#include once "mff/Form.bi"
	#include once "mff/CommandButton.bi"
Until yesterday we included the second form after "'End Region". Then the first form was called correctly.
I changed the form template yesterday:
https://github.com/XusinboyBekchanov/Vi ... b39da882a2

Now you can include the second form as in your example. To do this, change the top #if #endif to this (in two forms):

Code: Select all

	#if defined(__FB_MAIN__) AndAlso Not defined(__MAIN_FILE__)
		#define __MAIN_FILE__
		Const _MAIN_FILE_ = __FILE__
		#ifdef __FB_WIN32__
			#cmdline "Form1.rc"
		#endif
	#endif
Bottom #if #endif to this (in the second form, respectively, will be Form2 or secondform):

Code: Select all

	#if _MAIN_FILE_ = __FILE__
		Form1.MainForm = True
		Form1.Show
		App.Run
	#endif
Or download the unreleased version from github.
PeterHu wrote: Sep 27, 2022 1:34 For a simple execise,I only modified property Name and Text in the properties window,no touched any source code in the editer area which was generated by the IDE designer.
I can't find it now. I also tried changing the properties several times. But it didn't happen to me.
PeterHu wrote: Sep 27, 2022 1:34 Now I know why was that,they are the autocompletion pop-ups,just ignore this.
You can turn off Auto Complete in the settings.
Xusinboy Bekchanov
Posts: 661
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Post by Xusinboy Bekchanov »

PeterHu wrote: Sep 27, 2022 1:36 May I ask when you mention about in OS Windows and Linux,does that mean the gui(the framework) is portable,not just Windows specific?But I noticed the frame I made is quite windows native look & feel.
The framework uses GTK on Linux instead of WinAPI. If you don't use WinAPI then you can compile your program in Linux too. The structure of MyFbFramework is the same in both systems.
Post Reply