I am staying with FreeBasic....

Started by Paul Squires, March 31, 2017, 04:59:57 PM

Previous topic - Next topic

Paul Squires

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  :)
Paul Squires
PlanetSquires Software

James Fuller

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

James

Paul Squires

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

C# is the most popular .NET language.

Paul Squires
PlanetSquires Software

Paul Squires

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.


#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.


Paul Squires
PlanetSquires Software

Paul Squires

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


#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


Paul Squires
PlanetSquires Software

Paul Squires

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):


#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



Paul Squires
PlanetSquires Software