BASIC(modified B++ complier) + wxWidgets

For other topics related to the FreeBASIC project or its community.
caseih
Posts: 1476
Joined: Feb 26, 2007 5:32

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

Postby caseih » Mar 12, 2020 3:53

@kankouhin7937 has nothing to do with the files you downloaded from SourceForge. The zip file there purports to be the source code (and it must be because @kankouhin7937 apparently has modified and extended it). So you can safely delete any executables in that zip file while perusing the code in there.

For what it's worth, VirusTotal.com ran the zip file and its contents against nearly 40 commercial antivirus engines and found nothing. So I'm not sure what your computer was complaining about. False positive maybe? In addition all the antivirus engines also didn't find anything bad in the bpp.exe he has posted on his github site.

His little project may or may not be useful to others, and even though it has nothing to do with FB, there's no call for accusing him of trying to victimize anyone. There's simply no evidence for that.
oyster
Posts: 204
Joined: Oct 11, 2005 10:46

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

Postby oyster » Mar 12, 2020 4:58

It is a good idea to use up-to-date wxWidgets.

I have tested this project on windows. Since kankouhin7937's BASIC translates the BASIC source file to CPP, I can then link wxWidgets in a dynamic or static way.

However, there is no much document on the BASIC part implemented, it is hard to say whether we can use kankouhin7937's BASIC for the common tasks which can be finished by freebasic.

If kankouhin7937's BASIC only puts emphasis on the GUI part, it will be useful for somebody else but not for me.

Maybe a C interface like FLTK-C vs FLTK can make this idea born in freebasic. However, it is a too huge project.
kankouhin7937
Posts: 24
Joined: Aug 16, 2018 2:00

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

Postby kankouhin7937 » Mar 12, 2020 5:25

caseih wrote:@kankouhin7937 has nothing to do with the files you downloaded from SourceForge. The zip file there purports to be the source code (and it must be because @kankouhin7937 apparently has modified and extended it). So you can safely delete any executables in that zip file while perusing the code in there.

For what it's worth, VirusTotal.com ran the zip file and its contents against nearly 40 commercial antivirus engines and found nothing. So I'm not sure what your computer was complaining about. False positive maybe? In addition all the antivirus engines also didn't find anything bad in the bpp.exe he has posted on his github site.

His little project may or may not be useful to others, and even though it has nothing to do with FB, there's no call for accusing him of trying to victimize anyone. There's simply no evidence for that.


Thank you for report the scanned result.Thanks a lot.

sorry for my poor english ,i hope you can understand.

After microsoft dropped VB, I almost searched all BASIC language alive or deaded on internet.
I hope i can find a BASIC language can running on Win,Linux,Mac, even iOS or Andriod.
Only the FreeBASIC seems can do all of above . (i known a unoffical version can running on Mac). but FreeBASIC just fixs bugs now.
FreeBASIC can also create GUI and call windows COM/ActiveX by the extern libs, but I hope a BASIC can do all like builtin functions(Win: + GUI + COM bind, Linux/Mac: + GUI).
at first i want to modify freebasic to implement those functions, i readed the sources, but it is too difficult for me.
I found bpp complier, and using my a few c++ knownledge, start to learn MinGW(g++), Windows COM, ... , it took me many times to do it.
I just a IT beginner, i can not do everythings to make the dream comes true.

Last, i am sorry announced Kaya-BASIC on FreeBASIC Community.
I also like FreeBASIC, i am also using FreeBASIC to develep somethings.
FreeBASIC is a great compiler, and Kaya-BASIC is just like a tool. a little tool.
kankouhin7937
Posts: 24
Joined: Aug 16, 2018 2:00

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

Postby kankouhin7937 » Mar 12, 2020 7:28

oyster wrote:It is a good idea to use up-to-date wxWidgets.

I have tested this project on windows. Since kankouhin7937's BASIC translates the BASIC source file to CPP, I can then link wxWidgets in a dynamic or static way.

However, there is no much document on the BASIC part implemented, it is hard to say whether we can use kankouhin7937's BASIC for the common tasks which can be finished by freebasic.

If kankouhin7937's BASIC only puts emphasis on the GUI part, it will be useful for somebody else but not for me.

Maybe a C interface like FLTK-C vs FLTK can make this idea born in freebasic. However, it is a too huge project.


wxWidgets has many classes and functions except GUI.
about using wxWidgets , Kaya-BASIC only convert the source to CPP now, NOT check if the method exists of the wxClasses(check this need all wxClasses models, it is too hard). if the method not exists. can not compile by g++(need some c++ knowledge).
so you can add wxClass/wxFunction_Header.h to lib/core/wxWidgets.h and link the libs if need to test other wxClasses/wxFunctions.
JohnK_RQ
Posts: 13
Joined: Nov 25, 2019 1:50

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

Postby JohnK_RQ » Mar 12, 2020 21:05

I think a lot of fb users don't agree on what gui API to use. So big projects like this tend to fail unless you get several people to contribute, unless it includes DJ Peters...

I suggested that fb add native code that makes it look compatible with vb6, but that started a huge fight. I thought that since fb emits c code, it was possible AND The underlying API can change but the interface stays the same.
Anyway that went down in flames.
kankouhin7937
Posts: 24
Joined: Aug 16, 2018 2:00

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

Postby kankouhin7937 » Mar 13, 2020 0:06

http sample

Code: Select all

Option Explicit

Using MsgBoxDoEvents

Dim f As wxFrame Ptr

Sub LoadDataFromWeb
   Dim http As wxHTTP
   Dim httpStream As wxInputStream Ptr
   
   http.SetHeader( "Content-type", "text/html; charset=utf-8" )
   http.SetTimeout(10)
   
   While Not http.Connect( "www.google.com" )
      wxSleep(5)
   Wend
   
   httpStream = http.GetInputStream( "/intl/en/about.html" )
   
   If (http.GetError() = wxPROTO_NOERR) Then
      Dim res As wxString
      Dim out_stream As wxStringOutputStream( AddressOf res )
      httpStream.Read(out_stream)

      MsgBox res
   Else
      MsgBox "Unable to connect!"
   End If
   
   wxDELETE(httpStream)
   http.Close()
End Sub

Sub Main
   f = New wxFrame( Nothing, wxID_ANY, "treectrl demo" )
   
   Call LoadDataFromWeb
   
   f.SetIcon( wxICON(wxICON_AAA) )
   f.Show(TRUE)
End Sub

https://github.com/kankouhin/Kaya-BASIC/blob/master/samples/wxUtils/http/gui.bas
Last edited by kankouhin7937 on Mar 13, 2020 2:41, edited 2 times in total.
kankouhin7937
Posts: 24
Joined: Aug 16, 2018 2:00

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

Postby kankouhin7937 » Mar 13, 2020 0:51

xml sample

Code: Select all

Option Explicit

Using MsgBoxDoEvents

Dim f As wxFrame Ptr
Dim treeCtrl As wxTreeCtrl Ptr

Sub AddChildren( p As wxTreeItemId, pn As wxXmlNode Ptr )
   
   Dim node As wxXmlNode Ptr = pn.GetChildren()
   While node <> Nothing
      Dim parent As wxTreeItemId = treeCtrl.AppendItem( p, node.GetName(), 2 )
      Call AddChildren( parent, node )
      node = node.GetNext()
   Wend
End Sub

Sub LoadDataFromXml
   Dim doc As wxXmlDocument
   doc.Load( "data.xml" )
   
   Dim node As wxXmlNode Ptr = doc.GetRoot()
   Dim p As wxTreeItemId = treeCtrl.AppendItem( NULL, node.GetName(), 0 )

   Call AddChildren( p, node )
End Sub

Sub Main
   f = New wxFrame( Nothing, wxID_ANY, "treectrl demo" )

   Dim images As New wxImageList(16, 16)
   images.Add( wxICON(wxICON_SMALL_CLOSED_FOLDER) )
   images.Add( wxICON(wxICON_SMALL_OPEN_FOLDER) )
   images.Add( wxICON(wxICON_SMALL_FILE) )

   treeCtrl = New wxTreeCtrl( f )
   treeCtrl.SetImageList( images )

   Call LoadDataFromXml

   f.SetIcon( wxICON(wxICON_AAA) )
   f.Show(TRUE)
End Sub

https://github.com/kankouhin/Kaya-BASIC/blob/master/samples/wxUtils/xml/gui.bas
kankouhin7937
Posts: 24
Joined: Aug 16, 2018 2:00

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

Postby kankouhin7937 » Mar 16, 2020 5:37

OOP sample and callbyname

Code: Select all

Sub OnButtonClick(ByRef ev As wxCommandEvent)
   
   Dim id As Integer = ev.GetId()

   Select Case id
      Case 100 'ClassForName
          Dim s As Shape
          
          s = CreateObject("Shapes.Rect")
          s.Height    = 300.0
          s.Width    = 400.0
          Call s.Draw
          Msgbox s.Area
          
          s = CreateObject("Shapes.Triangle")
          s.Height    = 300.0
          s.Width    = 400.0
          Call s.Draw
          Msgbox s.Area       
       
      Case 200 'CallByName Get
         
          Dim s As Shape
          
          s = CreateObject("Shapes.Rect")
          s.Height    = 300.0
          s.Width    = 400.0
          
          Dim v As Single
          Dim n As String = "Height"
          CallByName( s, n, Get, v )
          Msgbox v
          
      Case 300 'CallByName Set

          Dim s As Shape
          
          s = CreateObject("Shapes.Rect")
          s.Width    = 400.0
          
          Dim v As Single = 100
          Dim n As String = "Height"
          CallByName( s, n, Set, v )
          s.Draw
          
      Case 400 ' CallByName Call Sub
         
          Dim s As Shape
          
          s = CreateObject("Shapes.Rect")
          s.Height    = 200.0
          s.Width    = 800.0
          
          Dim n As String = "Draw"
          CallByName( s, n, Call )
          
      Case 500 'CallByName Call Function
      
          Dim s As Shape
          
          s = CreateObject("Shapes.Triangle")
          s.Height    = 200.0
          s.Width    = 600.0
          
          Dim v As Double
          Dim n As String = "Area"
          CallByName( s, n, Call, v)
          
          MsgBox v
                
   End Select
   
End Sub

https://github.com/kankouhin/Kaya-BASIC/blob/master/samples/coretests/OOP/Shapes.bas
paul doe
Posts: 1175
Joined: Jul 25, 2017 17:22
Location: Argentina

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

Postby paul doe » Mar 16, 2020 10:54

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

I don't think so. It's just a project that's totally in the wrong forum.
srvaldez
Posts: 2327
Joined: Sep 25, 2005 21:54

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

Postby srvaldez » Mar 16, 2020 10:57

I agree, the whole thread should be deleted.
aurelVZAB
Posts: 318
Joined: Jul 02, 2008 14:55
Location: Croatia
Contact:

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

Postby aurelVZAB » Mar 17, 2020 8:18

For OP should be best to open your own forum for this fork of B++
JohnK_RQ
Posts: 13
Joined: Nov 25, 2019 1:50

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

Postby JohnK_RQ » Mar 17, 2020 15:51

I take it back, I encourage the development of this project. I have no opinion about posting in community topic
paul doe
Posts: 1175
Joined: Jul 25, 2017 17:22
Location: Argentina

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

Postby paul doe » Mar 17, 2020 19:57

JohnK_RQ wrote:I take it back, I encourage the development of this project. I have no opinion about posting in community topic

The Community Discussion topic is 'for other topics related to FreeBasic or its community'. Of course there's nothing wrong with the project per se, but how it is related to FreeBasic or its community? Is it written in it? Does it have libraries that can interface with it? A project was ported to/from it? You see the point.
aurelVZAB
Posts: 318
Joined: Jul 02, 2008 14:55
Location: Croatia
Contact:

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

Postby aurelVZAB » Mar 17, 2020 20:00

This "project" is a relict from the past ,it is supposed to be VBclone translator to C++
and really don't have anyrhing with any basic -like language we know and also with FB.
oyster
Posts: 204
Joined: Oct 11, 2005 10:46

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

Postby oyster » Mar 17, 2020 23:28

is it possible to open an "off-topic" subforum? I don't think there will be traffic jam for this forum

As for this modified B+ BASIC project, I think it is about BASIC language, so it has some relation to freebasic. There has already been topics here which are actually have nothing to do freebasic, why nobody claims to delete them before? Let me guess the reason

- you have never met the author before

or

- you are afraid that this modified B+ BASIC can get more focus then freebasic does. Come on, this modified B+ BASIC is far from mature and I doubt whether it can cover a full BASIC syntax for realy applications in years. Just relax or make freebasic can support up-to-date wxWidgets to defeat this modified B+ BASIC.

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests