VisualFBEditor - IDE for FreeBasic

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

Re: VisualFBEditor - IDE for FreeBasic

Postby Xusinboy Bekchanov » Feb 22, 2021 2:24

classd2008 wrote:How to force to use the GTK3 library in Windows? With this code VisualFBE compiles, it doesn't seem to be using the GTK3 library.

Code: Select all

'#ifdef __FB_WIN32__
   '#Compile -exx "Form1.rc"
'#else
   '#Compile -exx
'#endif
'#Region "Form"
   #define __USE_GTK3__
   #libpath "C:\msys64\mingw64\lib"
   '#libpath "C:\msys64\mingw32\lib"
   #include once "mff/Form.bi"
   #include once "mff/CommandButton.bi"
   
   Using My.Sys.Forms
   
   Type Form1 Extends Form
      Declare Constructor
      
      Dim As CommandButton CommandButton1
   End Type
   
   Constructor Form1
      ' Form1
      With This
         .Name = "Form1"
         .Text = "Form1"
         .SetBounds 0, 0, 350, 300
      End With
      ' CommandButton1
      With CommandButton1
         .Name = "CommandButton1"
         .Text = "CommandButton1"
         .SetBounds 60, 70, 210, 90
         .Parent = @This
      End With
   End Constructor
   
   Dim Shared fForm1 As Form1
   
   #ifndef _NOT_AUTORUN_FORMS_
      fForm1.Show
      
      App.Run
   #endif
'#End Region

Add this:

Code: Select all

#define __USE_GTK__

classd2008 wrote:Error compiler.

Code: Select all

C:\FreeBasic\Projects\VisualFBEditor-master\src>C:\FreeBasic\FreeBASIC-1.07.1\fbc32 "VisualFBEditor.bas" -x "../VisualFBEditor32.exe" "VisualFBEditor.rc" -i "../MyFbFramework"
C:\FreeBasic\Projects\VisualFBEditor-master\src\frmFind.frm(597) error 18: Element not defined, SelectedTabIndex
C:\FreeBasic\Projects\VisualFBEditor-master\src\frmOptions.frm(1130) error 18: Element not defined, TabIndex
C:\FreeBasic\Projects\VisualFBEditor-master\src\frmOptions.frm(1141) error 3: Expected End-of-Line, found '='
C:\FreeBasic\Projects\VisualFBEditor-master\src\Main.bas(1421) error 9: Expected expression
C:\FreeBasic\Projects\VisualFBEditor-master\src\Main.bas(3117) error 18: Element not defined, DisplayIcons
C:\FreeBasic\Projects\VisualFBEditor-master\src\Main.bas(3857) error 3: Expected End-of-Line, found '='
C:\FreeBasic\Projects\VisualFBEditor-master\src\Main.bas(3881) error 3: Expected End-of-Line, found '='
C:\FreeBasic\Projects\VisualFBEditor-master\src\Main.bas(3903) error 3: Expected End-of-Line, found '='
C:\FreeBasic\Projects\VisualFBEditor-master\src\Main.bas(3991) error 3: Expected End-of-Line, found '='
C:\FreeBasic\Projects\VisualFBEditor-master\src\Main.bas(4072) error 9: Expected expression, found '='
C:\FreeBasic\Projects\VisualFBEditor-master\src\Main.bas(4072) error 133: Too many errors, exiting

You compile with an old version of the MyFbFramework library. Copy the new library to the .../VisualFBEditor/MyFbFramework folder
classd2008
Posts: 10
Joined: Oct 31, 2017 13:33

Re: VisualFBEditor - IDE para FreeBasic

Postby classd2008 » Feb 22, 2021 9:36

But with this #define can I work with GTK3?
#define __USE_GTK__
Xusinboy Bekchanov
Posts: 388
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Postby Xusinboy Bekchanov » Feb 22, 2021 10:19

classd2008 wrote:But with this #define can I work with GTK3?
#define __USE_GTK__

It takes two, too:

Code: Select all

#define __USE_GTK__
#define __USE_GTK3__

Check it out. If it is possible to work with GTK3 on Windows, let me know too, I will also add the needed fixes. I have everything compiled with GTK on Windows, but, when I run the program, a segmentation error appears.
classd2008
Posts: 10
Joined: Oct 31, 2017 13:33

Re: VisualFBEditor - IDE para FreeBasic

Postby classd2008 » Feb 22, 2021 10:43

Ok it worked and compiled just right.
Two problems encountered. When I select Start Position = 1-Center Screeen the form does not center. And if I try to move the position form, the program crashes. I don't know how to solve this.
I also want to find out how to use CSS to be able to assemble more beautiful forms.
I installed the GTK 3 library using mingw32. Remembering that you must put all the GTK 3 DLLs at the root of the program.

Obs: I could put a property to add CSS to the components.

I'm using Windows 10.


Code: Select all

'#ifdef __FB_WIN32__
   '#Compile -exx "Form1.rc"
'#else
   '#Compile -exx
'#endif
'#Region "Form"   
   #define __USE_GTK__
   #define __USE_GTK3__
   #libpath "C:\msys64\mingw64\lib"
   #include once "mff/Form.bi"
   #include once "mff/CommandButton.bi"
   
   Using My.Sys.Forms
   
   Type Form1 Extends Form
      Declare Static Sub CommandButton1_Click_(ByRef Sender As Control)
      Declare Sub CommandButton1_Click(ByRef Sender As Control)
      Declare Constructor
      
      Dim As CommandButton CommandButton1
   End Type
   
   Constructor Form1
      ' Form1
      With This
         .Name = "Form1"
         .Text = "Testing GTK 3"
         .Caption = "Testing GTK 3"
         .StartPosition = FormStartPosition.CenterScreen
         .SetBounds 0, 0, 350, 300
      End With
      ' CommandButton1
      With CommandButton1
         .Name = "CommandButton1"
         .Text = "CommandButton1"
         .SetBounds 60, 70, 210, 90
         .Designer = @This
         .OnClick = @CommandButton1_Click_
         .Parent = @This
      End With
   End Constructor
   
   Dim Shared fForm1 As Form1
   
   #ifndef _NOT_AUTORUN_FORMS_
      fForm1.Show
      
      App.Run
   #endif
'#End Region

Private Sub Form1.CommandButton1_Click_(ByRef Sender As Control)
   *Cast(Form1 Ptr, Sender.Designer).CommandButton1_Click(Sender)
End Sub
Private Sub Form1.CommandButton1_Click(ByRef Sender As Control)
   msgbox("Testing GTK 3")
End Sub
Xusinboy Bekchanov
Posts: 388
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE para FreeBasic

Postby Xusinboy Bekchanov » Feb 22, 2021 11:44

classd2008 wrote:Ok it worked and compiled just right.
Two problems encountered. When I select Start Position = 1-Center Screeen the form does not center.

The documentation says that some window managers are placed after the window is displayed:
gtk_window_move ()
void
gtk_window_move (GtkWindow *window,
gint x,
gint y);
Asks the window manager to move window to the given position. Window managers are free to ignore this; most window managers ignore requests for initial window positions (instead using a user-defined placement algorithm) and honor requests after the window has already been shown.

That's how it works:

Code: Select all

'#ifdef __FB_WIN32__
   '#Compile -exx "Form1.rc"
'#else
   '#Compile -exx
'#endif
'#Region "Form"   
   #define __USE_GTK__
   #define __USE_GTK3__
   #libpath "F:\Install\Install2\msys32\mingw64\lib"
   #include once "mff/Form.bi"
   #include once "mff/CommandButton.bi"
   
   Using My.Sys.Forms
   
   Type Form1 Extends Form
      Declare Static Sub CommandButton1_Click_(ByRef Sender As Control)
      Declare Sub CommandButton1_Click(ByRef Sender As Control)
      Declare Static Sub Form_Show_(ByRef Sender As Form)
      Declare Sub Form_Show(ByRef Sender As Form)
      Declare Constructor
     
      Dim As CommandButton CommandButton1
   End Type
   
   Constructor Form1
      ' Form1
      With This
         .Name = "Form1"
         .Text = "Testing GTK 3"
         .Caption = "Testing GTK 3"
         .StartPosition = FormStartPosition.CenterScreen
         .Designer = @This
         .OnShow = @Form_Show_
         .SetBounds 0, 0, 350, 300
      End With
      ' CommandButton1
      With CommandButton1
         .Name = "CommandButton1"
         .Text = "CommandButton1"
         .SetBounds 60, 70, 210, 90
         .Designer = @This
         .OnClick = @CommandButton1_Click_
         .Parent = @This
      End With
   End Constructor
   
   Dim Shared fForm1 As Form1
   
   #ifndef _NOT_AUTORUN_FORMS_
      fForm1.Show
     
      App.Run
   #endif
'#End Region

Private Sub Form1.CommandButton1_Click_(ByRef Sender As Control)
   *Cast(Form1 Ptr, Sender.Designer).CommandButton1_Click(Sender)
End Sub
Private Sub Form1.CommandButton1_Click(ByRef Sender As Control)
   msgbox("Testing GTK 3")
End Sub

Private Sub Form1.Form_Show_(ByRef Sender As Form)
   *Cast(Form1 Ptr, Sender.Designer).Form_Show(Sender)
End Sub
Private Sub Form1.Form_Show(ByRef Sender As Form)
   Me.StartPosition = FormStartPosition.CenterScreen
End Sub


classd2008 wrote:I also want to find out how to use CSS to be able to assemble more beautiful forms.
I installed the GTK 3 library using mingw32. Remembering that you must put all the GTK 3 DLLs at the root of the program.

It worked for me, too.

classd2008 wrote:Obs: I could put a property to add CSS to the components.

Any help would be appreciated.
classd2008
Posts: 10
Joined: Oct 31, 2017 13:33

Re: VisualFBEditor - IDE for FreeBasic

Postby classd2008 » Feb 22, 2021 12:00

The TIMER component does not work on GTK3.
Xusinboy Bekchanov
Posts: 388
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Postby Xusinboy Bekchanov » Feb 22, 2021 12:30

classd2008 wrote:The TIMER component does not work on GTK3.

TimerComponent also added to __USE_GTK__ version of program (in Linux too):
https://github.com/XusinboyBekchanov/My ... 2fce3f8466
Xusinboy Bekchanov
Posts: 388
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Postby Xusinboy Bekchanov » Feb 23, 2021 17:21

classd2008 wrote:And if I try to move the position form, the program crashes. I don't know how to solve this.

I fixed it:
https://github.com/XusinboyBekchanov/My ... 60253dec07
Xusinboy Bekchanov
Posts: 388
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Postby Xusinboy Bekchanov » Feb 24, 2021 7:15

Based on the problem of compiling and running with different encodings, I added support for different encodings when saving and opening a file:
https://github.com/XusinboyBekchanov/Vi ... 65209742ad
jj2007
Posts: 2041
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: VisualFBEditor - IDE for FreeBasic

Postby jj2007 » Feb 24, 2021 10:20

You are fast, lol ;-)
classd2008
Posts: 10
Joined: Oct 31, 2017 13:33

Re: VisualFBEditor - IDE for FreeBasic

Postby classd2008 » Feb 25, 2021 18:26

Xusinboy Bekchanov wrote:
classd2008 wrote:And if I try to move the position form, the program crashes. I don't know how to solve this.

I fixed it:
https://github.com/XusinboyBekchanov/My ... 60253dec07

Perfect...
classd2008
Posts: 10
Joined: Oct 31, 2017 13:33

Re: VisualFBEditor - IDE for FreeBasic

Postby classd2008 » Feb 25, 2021 18:48

Timer interval continues not to work. In the form when adding a TIMER component and moving it in the grid, the timer component disappears.
Xusinboy Bekchanov
Posts: 388
Joined: Jul 26, 2018 18:28

Re: VisualFBEditor - IDE for FreeBasic

Postby Xusinboy Bekchanov » Feb 26, 2021 0:40

classd2008 wrote:Timer interval continues not to work.

It works for me. Try setting the interval to 1000.

classd2008 wrote:In the form when adding a TIMER component and moving it in the grid, the timer component disappears.

Thank you for reporting this problem. This has been fixed:
https://github.com/XusinboyBekchanov/Vi ... de94903778
Cretin Ho
Posts: 158
Joined: Feb 04, 2021 13:01

Re: VisualFBEditor - IDE for FreeBasic

Postby Cretin Ho » Feb 28, 2021 13:17

When I start your IDE, everything I see is just this:

Image

Ignore the error, it could start but I think it's something wrong there, there is no project template to choose from when creating a new project and somehow it just hangs. I have to use XFCE4 Task Manager to kill it manually. The program just stuck with no activity at all.
Cretin Ho
Posts: 158
Joined: Feb 04, 2021 13:01

Re: VisualFBEditor - IDE for FreeBasic

Postby Cretin Ho » Feb 28, 2021 13:22

I could confirm the .so files are there, they are not missing:

$ ls MyFbFramework
changes_en.txt examples libmff32.dll.a libmff64.dll.a libmff64_gtk2.so libmff64_gtk3.so LICENSE mff mff32.dll mff64.dll MyFbFramework.vfp README.md resources

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 14 guests