wxMonkey

Monkey Forums/Monkey Programming/wxMonkey

AdamRedwoods(Posted 2012) [#1]
It's quite possible:



It uses a wxWindows target using g++ and is limited to Win/OSX/Linux (untested, should work). Static compilation (debug is a whopping 25mb large, but only 3.3MB release). Does not use mojo.

The only big question I have, is that does anyone know of a way to implicitly convert a monkey String to a wxString class? This would save a lot of glue code writing.
My only thought is to inject the conversion code into the String class during transcode.

Thoughts?


slenkar(Posted 2012) [#2]
looking good, ah dunno 'bout them new fangled string thangs though


c.k.(Posted 2012) [#3]
That's awesome Adam. I think wxWidgets has mobile platform aspirations... :-)


AdamRedwoods(Posted 2012) [#4]
Ok, Menu bars are working, haven't tackled events yet.
But the way I'm managing wxString is as follows:

[monkeycode]
Class MyFrame Extends wxFrame

Global MINIMAL_ABOUT:=wxID_ABOUT

Field fileMenu:wxMenu
Field menuBar:wxMenuBar


Method CreateMenu()
fileMenu= New wxMenu
fileMenu.Append(MINIMAL_ABOUT, wxString("&About...F1"), wxString("Show about dialog"))

menuBar= New wxMenuBar()
menuBar.Append(fileMenu, wxString("&File"))

SetMenuBar(menuBar)

Print 400
End

End
[/monkeycode]

So all strings passed to wxStuff needs to be wxString(monkey String).
Does anyone see any potential problems with this offhand?

The reason for this is that I can blast through the wxWidget API. It's all monkey-side, with very little glue. Much easier given the high number of functions I'd have to cover.

If it works for eveyone, then I'll blast away, and see if I can't come up with a github soon.


MikeHart(Posted 2012) [#5]
I would have no problem with wxString. Great job!


Shinkiro1(Posted 2012) [#6]
This is absolutely great.
I know it's to soon to ask this, but do you see any way of implementing mojo into this.


Skn3(Posted 2012) [#7]
seeing as you are writing your own target, could you not make a modified trans similar to how the bmax target does? Just simply convert your strings into wxStrings there?

btw awesome stuff, it would be brilliant coding apps in monkey!


AdamRedwoods(Posted 2012) [#8]

Just simply convert your strings into wxStrings there

I could do that for straight quotes, but not for defined Strings, as that is monkey controlled. I wouldn't want to change EVERY String to wxString, so it'd be quite a chore to write a parser to identity string use.


Skn3(Posted 2012) [#9]
Ah of course I didn't think of that. wxString seems fine in that case.


Why0Why(Posted 2012) [#10]
This in combination with some robust database access could make some nice apps. Is anyone aware of anything that might work for Monkey on the db front?


Skn3(Posted 2012) [#11]
Probably SQLite as I'd imagine this would be most supported on many targets already.


AdamRedwoods(Posted 2012) [#12]
wxODBC
http://docs.wxwidgets.org/stable/wx_odbcoverview.html#odbcoverview


Why0Why(Posted 2012) [#13]
That looks nice! I looked around yesterday and didn't see it. How big of a process is it to wrap? I have never done it but I would be very interested.


AdamRedwoods(Posted 2012) [#14]
AHAHAHAHAAH!

I have events working in wxMonkey now.
It was difficult, but the solution works! I had to incorporate function pointers by way of intercepting the TransFunc() and others to get the trans to accept my function passing. Plus I had to do a few other things, but now I have custom classes that will take care of this.

This video is similar to what I had to do:
http://www.youtube.com/watch?v=dlaUtMVbmI0


[monkeycode]
Connect(DYNAMIC_ABOUT, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandFunc(wxMonkeyFunc(DynamicAbout() )) )


Method DynamicAbout:Void(e:wxCommandEvent=Null)
Local dialog:wxMessageDialog = wxMessageDialog.Create(MyApp.frame, wxString("This demonstrates dynamic event handling"),
wxString("About Dynamic"), wxYES_NO|wxCANCEL)

dialog.ShowModal()
End
[/monkeycode]


Sub_Zero(Posted 2012) [#15]
Nice work :)


slenkar(Posted 2012) [#16]
Ah rothrock programming technique


AdamRedwoods(Posted 2012) [#17]
moved to here, download available:
http://monkeycoder.co.nz/Community/posts.php?topic=3610


Neuro(Posted 2012) [#18]
This video is similar to what I had to do:
http://www.youtube.com/watch?v=dlaUtMVbmI0

I always wondered what her name was, lol :).


zoqfotpik(Posted 2012) [#19]
There is a recent Bollywood film about your TRANS hackery.

http://www.youtube.com/watch?v=7yBnl_krN_U