Forum Replies Created
-
AuthorPosts
-
No, the CString memory is automatically released after the function call.
One thing that is missing from the simulator builds is fiber support.
This wont be easy to do either as there is no appropriate x86_64 asm file in the fcontext lib I pinched.
But I gather not many people are using fibers so this is OK for now?
Should I ditch the HighDPI flag? Should it just always be ‘on’? It would save a lot of headaches as DesktopSize could returned scaled/physical/retina size, and DPI/retina handling could all be done internally etc.
Ok, simple simulator support added to develop branch.
It’s implemented as a sort of psuedo target so you’ll need to set MX2_IOS_SIMULATOR=1 in bin/env_macos.txt and rebuild modules – a bit clunky but it works.
AssetsDir()+path etc will work for most targets, it’s only android that causes problems as assets are stored in a zip file on android. On all other targets, assets are just files in the filesystem, so GetFileType etc will work.
What will work safely is opening the asset as a stream, eg:
Monkey12345678910111213Function AssetExists:Bool( path:String )If Not path.StartsWith( "asset::" ) path="asset::"+pathLocal stream:=Stream.Open( path )If Not stream Return Falsestream.Close()Return TrueEnd(untested).
Its shouldn’t matter what you set window size to, as it will always be maximised. Just check Width and Height after creating window/
The ios simulator is not currently supported – you need to build directly to a device.
I can add simulator support but it will require rebuilding all modules etc as it will effectively require a whole new target.
What host platform is this? I’ve tweaked the windows rebuild batch files to halt on any error but not the .sh files yet (not sure how).
Also, If you build modules in IDE it should error out if one module fails to build.
…mojo3d is alive and well!
Brackets show us we deal with array, but += don’t.
That’s about all it shows. The syntax ‘[]=’ to append to an array is typical php WTF-ness!
But I did have a quick look at the parser and, I sort of hate to say it, but it’s actually a pretty simple tweak to allow no args for array indexing. With a 2 line change to parser.monkey2 I can compile this…
Monkey123456789101112131415161718192021Class COperator[]=( key:String,value:String )Print "key="+key+", value="+valueEndOperator[]=( value:String )Print "value="+valueEndEndFunction Main()Local c:=New Cc["one"]="two"c[]="Hello there!"End…which isn’t quite what you wanted, but enough to be able to do what you want I believe?
I still really dislike []= to append to an array though, boring old Method Add() is IMO a much better option!
You need to turn off ‘Use legacy console’ in ‘Command prompt properties’ (right click on shell drag bar).
With this off, you don’t even need SetConsoleMode. In fact, your SetConsoleMode isn’t doing anything due to incorrect stdout const (should be -11) and use of Varptr hOut (should just be hOut).
Or you could use something like the mighty conemu…
I recommend using #include <bbmonkey.h> if you want to access the native types in c++.
There are GC issues you need to be a bit careful of too. I’ll try to write something up about this soon.
that means append the string to array.
It sure doesn’t look like it!
This would require major changers to the parser though, as ‘[]’ is not a valid ‘value expression’ (it may only appear in type expressions, ie: when declaring the type of something).
How about ‘+=’ instead? This looks much more logical to me.
it would be nice to emulate how ListView works, by being able to listen to clicks from the container rather than each element
Well, AcceptsMouseEvents sort of lets you play with this idea, although I think FilterMouseEvent() would be the nicer way to do it – you’d be able to filter only some mouse events (not all) plus you wouldn’t have to change state of child view.
I think what you’re really thinking here is why is there a specialized ListView.Item class, why don’t ListViews just contain ‘Views’.
The reasons for this are actually mostly practical – an Item is lighter weight than a View, useful if you want lists of 10000 items (although less useful than it once was); an Item can also be highly customized, eg: TreeView.Item can be expanded/collapsed – but it is a valid question and in theory it is possible to write a more ‘pure’ gui like this. It’s harder though (try it!) and most/all guis I’ve used like Qt, cocoa, windows etc use ‘specialized’ ListView.Item types in a similar way so it’s not just me…
But I’ll keep thinking on this one ‘coz it’s interesting, and while I think emulating a ListView is pointless (just use a ListView!) it does mean you can’t use, say, a GridView to contain items ListView style…
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172#Import "<libd2d1.a>"#Import "<libole32.a>"#Import "<libgdi32.a>"#Import "<libuser32.a>"#Import "<libkernel32.a>"#Import "<libuxtheme.a>"#Import "<libdwrite.a>"#Import "<libusp10.a>"#Import "common/areaevents.c"#Import "common/control.c"#Import "common/debug.c"#Import "common/matrix.c"#Import "common/shouldquit.c"#Import "common/userbugs.c"#Import "windows/alloc.cpp"#Import "windows/area.cpp"#Import "windows/areadraw.cpp"#Import "windows/areaevents.cpp"#Import "windows/areascroll.cpp"#Import "windows/areautil.cpp"#Import "windows/box.cpp"#Import "windows/button.cpp"#Import "windows/checkbox.cpp"#Import "windows/colorbutton.cpp"#Import "windows/colordialog.cpp"#Import "windows/combobox.cpp"#Import "windows/container.cpp"#Import "windows/control.cpp"#Import "windows/d2dscratch.cpp"#Import "windows/datetimepicker.cpp"#Import "windows/debug.cpp"#Import "windows/draw.cpp"#Import "windows/drawmatrix.cpp"#Import "windows/drawpath.cpp"#Import "windows/drawtext.cpp"#Import "windows/dwrite.cpp"#Import "windows/editablecombo.cpp"#Import "windows/entry.cpp"#Import "windows/events.cpp"#Import "windows/fontbutton.cpp"#Import "windows/fontdialog.cpp"#Import "windows/form.cpp"#Import "windows/graphemes.cpp"#Import "windows/grid.cpp"#Import "windows/group.cpp"#Import "windows/init.cpp"#Import "windows/label.cpp"#Import "windows/main.cpp"#Import "windows/menu.cpp"#Import "windows/multilineentry.cpp"#Import "windows/parent.cpp"#Import "windows/progressbar.cpp"#Import "windows/radiobuttons.cpp"#Import "windows/separator.cpp"#Import "windows/sizing.cpp"#Import "windows/slider.cpp"#Import "windows/spinbox.cpp"#Import "windows/stddialogs.cpp"#Import "windows/tab.cpp"#Import "windows/tabpage.cpp"#Import "windows/text.cpp"#Import "windows/utf16.cpp"#Import "windows/utilwin.cpp"#Import "windows/window.cpp"#Import "windows/winpublic.cpp"#Import "windows/winutil.cpp"Function Main()End -
AuthorPosts