PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: I am staying with FreeBasic....  (Read 520 times)

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
I am staying with FreeBasic....
« on: March 31, 2017, 04:29:57 PM »

In another thread http://www.planetsquires.com/protect/forum/index.php?topic=4025.0 I said that I am learning C, WPF and XAML. Many people have emailed me asking if that means I am ditching FreeBasic, WinFBE, FireFly, etc... Well, definitely not. I am sticking with FreeBasic because I have a lot more plans to continue developing there. I am going to use C#, etc for a different personal project. It is nice to have more than more development tool in your toolbelt  :)
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

James Fuller

  • FireFly3 Registered User
  • Senior FireFly Member
  • *
  • Posts: 274
  • FF3 User
Re: I am staying with FreeBasic....
« Reply #1 on: March 31, 2017, 04:55:01 PM »

Paul,
  I meant to ask in your other thread but why C# and not VB NET?

James
Logged

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
Re: I am staying with FreeBasic....
« Reply #2 on: March 31, 2017, 04:57:06 PM »

VB.net is not where all the cool kids are at  :)

C# is the most popular .NET language.

Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
Re: I am staying with FreeBasic....
« Reply #3 on: March 31, 2017, 10:05:04 PM »

Having said that, I am using VB.NET as a kind of guide or blueprint for my object based wrapper above Jose's CWindow class and routines. It's really early in its development but the following code actually works. Creates a form and shows it on the screen.

Code: [Select]
#include once "WinLib\WinLib.inc"

#Define NewForm(f) dim as clsForm ptr f = new clsForm


NewForm(frmMain)
frmMain->WindowState = FormWindowState.Normal
frmMain->StartPosition = FormStartPosition.CenterScreen
frmMain->Text = "My Super Cool New Form"

Application.Run(frmMain)

print "Done..."
sleep

I need this framework before I build the visual designer on top of WinFBE.


Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
Re: I am staying with FreeBasic....
« Reply #4 on: April 01, 2017, 12:04:01 PM »

Making the framework do a little bit more every day.....

Code: [Select]
#include once "WinLib\WinLib.inc"

declare function Form1_OnClick() as LRESULT

NewObject(Form, frmMain)
frmMain->StartPosition = FormStartPosition.CenterScreen
frmMain->Text = "Form1"
frmMain->Position = 50, 50
frmMain->Size = 600, 400
frmMain->OnClick = @Form1_OnClick

NewObject(Button, cmdOK)
cmdOK->Text = "OK"
cmdOK->Position = 50, 50
cmdOK->Size = 50, 30

frmMain->Controls.Add(cmdOK)

Application.Run(frmMain)

print "Done..."
sleep


function Form1_OnClick() as LRESULT
   print "OnClick"
   function = 0
END FUNCTION

« Last Edit: April 01, 2017, 12:05:42 PM by TechSupport »
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
Re: I am staying with FreeBasic....
« Reply #5 on: April 01, 2017, 12:46:55 PM »

And here is an even more VB.NET looking example using pure dot notation instead of -> notation. This is accomplished by using the DIM BYREF functionality (see the #Define):

Code: [Select]
#include once "WinLib\WinLib.inc"

declare function Form1_OnClick() as LRESULT

#Define NewObject(ObjType, ObjName) Dim ByRef ObjName as cls##ObjType = *(new cls##ObjType)


NewObject(Form, frmMain)
frmMain.StartPosition = FormStartPosition.CenterScreen
frmMain.Text = "Form1"
frmMain.Position = 50, 50
frmMain.Size = 600, 400
frmMain.OnClick = @Form1_OnClick

NewObject(Button, cmdOK)
cmdOK.Text = "OK"
cmdOK.Position = 50, 50
cmdOK.Size = 50, 30
 
frmMain.Controls.Add(cmdOK)

Application.Run(frmMain)

print "Done..."
sleep


Function Form1_OnClick() as LRESULT
   print "OnClick"
   function = 0
END FUNCTION


Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor