BASIC(modified B++ complier) + wxWidgets

General discussion for topics related to the FreeBASIC project or its community.
kankouhin7937
Posts: 31
Joined: Aug 16, 2018 2:00

BASIC(modified B++ complier) + wxWidgets

Post by kankouhin7937 »

Code: Select all

Option Explicit

Dim f As wxFrame Ptr
Dim listctrl As wxListCtrl Ptr

Dim colSort As Integer
Dim arSort(1) As Integer

Callback Function myCompareFunction(item1 As Long, item2 As Long, sortData As Long) As Integer

	Dim row1,row2 As Long
	
	row1 = listctrl.FindItem( -1, item1 )
	row2 = listctrl.FindItem( -1, item2 )

	Dim str1 As wxString = listctrl.GetItemText( row1, colSort )
	Dim str2 As wxString = listctrl.GetItemText( row2, colSort )
	
 	Dim ret As Integer = 0
 	If str1 > str2 Then
 		ret = 1
 	ElseIf str1 < str2 Then
 		ret = -1
 	End If
 	
 	If arSort(colSort) > 0 Then
 		ret *= -1
 	End If
 	
    Function = ret
End Function

Sub OnItemSelected(ByRef ev As wxListEvent)
	f.SetTitle( ev.GetText() )
End Sub

Sub OnColumnClick(ByRef ev As wxListEvent)
	colSort = ev.GetColumn()
	arSort(colSort) *= -1
	listctrl.SortItems( AddressOf myCompareFunction, 0 )
End Sub

Sub Main

	f = New wxFrame( NULL, wxID_ANY, "listctrl" )
	listctrl = New wxListCtrl( f, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT )

	listctrl.InsertColumn(0, "Column1")
	listctrl.InsertColumn(1, "Column2")

	Dim ret As Long
	
	ret = listctrl.InsertItem(0,"Item 1")
	listctrl.SetItemData( ret, ret )
	ret = listctrl.InsertItem(1,"Item 3")
	listctrl.SetItemData( ret, ret )
	ret = listctrl.InsertItem(2,"Item 2")
	listctrl.SetItemData( ret, ret )
	
	listctrl.SetItem(0,1,"Item 9")
	listctrl.SetItem(1,1,"Item 7")
	listctrl.SetItem(2,1,"Item 8")
	
	listctrl.Bind ( wxEVT_LIST_ITEM_SELECTED , AddressOf OnItemSelected )
	listctrl.Bind ( wxEVT_LIST_COL_CLICK , AddressOf OnColumnClick )
	
	arSort(0) = 1
	arSort(1) = 1
	
	f.SetIcon( wxICON(wxICON_AAA) )
	f.Show(TRUE)
End Sub
JohnK_RQ
Posts: 27
Joined: Nov 25, 2019 1:50

Re: BASIC(modified B++ complier) + wxWidgets

Post by JohnK_RQ »

Very interesting, like fb with a gui. This is something I have been waiting for.

Are you the only dev?
Is there further dev?
Is the code translated to c++ but allows debugging?
kankouhin7937
Posts: 31
Joined: Aug 16, 2018 2:00

Re: BASIC(modified B++ complier) + wxWidgets

Post by kankouhin7937 »

JohnK_RQ wrote:Very interesting, like fb with a gui. This is something I have been waiting for.

Are you the only dev?
Is there further dev?
Is the code translated to c++ but allows debugging?
sorry for my poor english.
I am dev it by myself.
because the powerfull wxWidgets can also run on Linux and mac, I will try to make the linux version(also mac version? using vmware).
even I am a beginner of C++ and no tecnology of linux or mac.

sorry, now not support debugging.
aurelVZAB
Posts: 666
Joined: Jul 02, 2008 14:55
Contact:

Re: BASIC(modified B++ complier) + wxWidgets

Post by aurelVZAB »

All is good , but what is a number of incarnation of this?
last time i tried this one is packed with malware...
oyster
Posts: 274
Joined: Oct 11, 2005 10:46

Re: BASIC(modified B++ complier) + wxWidgets

Post by oyster »

can we use all the widgets/controls in the latest wxWidgets with it?

btw, it reminds me of https://www.wxbasic.net/ which is a BASIC interpreter
kankouhin7937
Posts: 31
Joined: Aug 16, 2018 2:00

Re: BASIC(modified B++ complier) + wxWidgets

Post by kankouhin7937 »

oyster wrote:can we use all the widgets/controls in the latest wxWidgets with it?

btw, it reminds me of https://www.wxbasic.net/ which is a BASIC interpreter
I test some controls only.
but
1. add all header files to lib/core/wxWidgets.h.
2. change the bin/config[XXX] file to link all libs.

maybe can use all the widgets/controls.
kankouhin7937
Posts: 31
Joined: Aug 16, 2018 2:00

Re: BASIC(modified B++ complier) + wxWidgets

Post by kankouhin7937 »

kankouhin7937 wrote:
oyster wrote:can we use all the widgets/controls in the latest wxWidgets with it?

btw, it reminds me of https://www.wxbasic.net/ which is a BASIC interpreter
I test some controls only.
but
1. add all header files to lib/core/wxWidgets.h.
2. change the bin/config[XXX] file to link all libs.

maybe can use all the widgets/controls.
wxBasic is a great project. but i like native only.
kankouhin7937
Posts: 31
Joined: Aug 16, 2018 2:00

Re: BASIC(modified B++ complier) + wxWidgets

Post by kankouhin7937 »

com sample

Code: Select all

Option Explicit

Sub Main

	Dim Xlb As ComObject, Xls As ComObject, Rng As ComObject,xlapp As ComObject

	xlapp.CreateObject("Excel.Application")
	xlapp.Visible = TRUE

	Xlb = xlapp.Workbooks.Add
	Xls = Xlb.WorkSheets(1)
	
	Dim sName As String
	sName = "Name"

	Dim s As String = CallByName(xls, "Name")
	Print s
	s = CallByName(xls, sName)
	Print s
	
	Rng = CallByName(xls, "Range")("A1:A5")
	Rng.Font.Size = 14

	Rng = Xls.Range("A2:A5")
	Rng.Interior.ColorIndex = 36
	Rng.EntireColumn.Autofit

	xlapp.DisplayAlerts = FALSE
	Sleep 5

	xlapp.quit

End Sub
https://github.com/kankouhin/Kaya-BASIC ... byname.bas
paul doe
Moderator
Posts: 1730
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: BASIC(modified B++ complier) + wxWidgets

Post by paul doe »

Quite sorry to poop the party, fellas, but what does this have to do with FreeBasic?
aurelVZAB
Posts: 666
Joined: Jul 02, 2008 14:55
Contact:

Re: BASIC(modified B++ complier) + wxWidgets

Post by aurelVZAB »

Yes that is true,B++ not have anything with FB
oyster
Posts: 274
Joined: Oct 11, 2005 10:46

Re: BASIC(modified B++ complier) + wxWidgets

Post by oyster »

how about a 'off-topic' or 'other BASIC' subforum here?
dodicat
Posts: 7976
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: BASIC(modified B++ complier) + wxWidgets

Post by dodicat »

I've never had much luck with wxwidgets.
I tried to recompile fbide, which is C++ with the widgets, after repairing the lowercase flags issue.
I used the correct wxwidget version and C++ (mingw) version, but the compilation never quite got to the end (fbide.exe)
So I gave up till another day.
aurelVZAB
Posts: 666
Joined: Jul 02, 2008 14:55
Contact:

Re: BASIC(modified B++ complier) + wxWidgets

Post by aurelVZAB »

And AGAIN BAD thing, so people be very carefull and scan files from Sourceforge
i picked again few malware from B++ source code packages..damn!!!
JohnK_RQ
Posts: 27
Joined: Nov 25, 2019 1:50

Re: BASIC(modified B++ complier) + wxWidgets

Post by JohnK_RQ »

Then this project total junk, waiting for victims?
I don't even want to try downloading!
Locked