Yet Another GUI module
BlitzMax Forums/Brucey's Modules/Yet Another GUI module
| ||
As some of the more observant may have noticed, I'm currently messing around with creating another GUI module for BlitzMax. (ie. a proper GUI, not graphics/canvas based). Some facts : It is based on wxWidgets wxWidgets is a GUI toolkit supporting all kinds of weird and wonderful controls/features. It is cross-platform Something I always look for with a BlitzMax module. And with wxWidgets+BlitzMax it's cool to take an app you've built on Linux and see it running in the same way on Windows :-) I have some issues with OS X currently, mostly to do with the way BlitzMax creates its own App menu - which interferes with wxWidget (probably trying to do the same thing!). I have a workaround, but I'm hoping that Mark might be able to think of a better way than my hack ;-) It is not MaxGUI compatible Rather than attempt to tie myself to the constraints of MaxGUI (its event model, limited gadgets, etc), I decided to do a straight port of wxWidgets to BlitzMax. Where there is a wxFrame class in wxWidgets, there's a wxFrame Type in BlitzMax, with as near to the same API access as I can make it. The event model also works in the same way as wxWidgets. You Connect() a function to a specific event, and the function is called when the event occurs. wxWidget library is huge! Some of you might have problems with the "size" of it, but it's not really so bad. Unless you intended to use *every* feature of its API in one application, then you might have something to worry about. There are TWO ways you can go when building an app that uses wxWidgets. The first is to have at hand the DLLs for the whole toolkit, and link to them at runtime. The second is to have a set of static libraries and link in only the functionality that you need for your application, without the need for external DLLs. I have had it running with both options, but I currently use the static linking method. The auidemo app is currently around 3meg on Linux/Windows. Which isn't so big really. Certainly not the biggest binary I've ever seen. Lots of modules! Rather than building a single module which encompasses the whole API, I decided to split each functional part into its own module. This has lots of advantages. The primary one being that you only Import the parts you need, which therefore dramatically decreases the final binary size. It also makes maintenance that much easier, because everything lives in its own place. To fix something on one control is a case of making a change to one module. Then a Build Modules recompiles/links that and any of its dependent modules - which is quick! At this time there are around 60 modules, using the wx namespace. I've done quite a lot so far, but there is still a rather large mountain of API to do. (no, really!). I haven't yet touched on the wxGrid (which is a huge beast by itself - although it is very fully featured as a table/grid control !!) I'm curious as to the interest of such a module. If I was an entrepreneurial type I might consider selling the it for a small fee, but that would require an increased effort with regards support that I may not be able to give the time to. So another option would be to create a repository on say, Google Code, and completely open it up to the community, and perhaps get some help in completing/maintaining it. (and while I mention it, would anyone be interested in helping get it done?) There is also a wxScintilla widget around, which adds a scintilla text editor to the fray. If you haven't seen Scintilla, it's a *very* cool cross-platform editor control with folding, line-numbers, and all the usual things you really want in a code editor. Something like that, with the Aui framework could make for a really groovy BlitzMax IDE ;-) Anyhoo... as usual, your comments and suggestions are always appreciated :-) |
| ||
I'm very interested in this, I've been following your worklog keenly. I'm afraid I'm so short of time lately that I couldn't possibly find the time to help, as much as I'd like to. I like the event model a lot more than MaxGUI, and if I had the time, I would, but I just don't get five minutes to spare these days. If you decided to charge a fee for it, I'd be more than happy to contribute that way. |
| ||
I'm interested in it as well, I'd help out too if I had more time (and skill). |
| ||
What about a formeditor? There's a form-designer (Borland C++ Builder Plugin) around, but I don't know if it could be utilized for your module(s). In my opinion a GUI needs a solid and powerful editor to be really useful. |
| ||
No doubt once it's released, someone will write one... |
| ||
If I was an entrepreneurial type I might consider selling the it for a small fee, Seriously Brucey it's about time you earned something for all these modules you produce. Skid is selling the MaxGUI module for $30 at the moment, (with little or no support recently, cough, cough :-P), and with far fewer features. I'd be more than happy to pay for wxWidgets or for a generic Brucey module license. I wouldn't expect extended support if I was to buy it (although I'd really appreciate it!!!) - providing it has good docs (which all your modules have anyway!!!). As for the use of wxWidgets, it's a bit awkward with it not being a driver for the official MaxGUI module in that I can't simply import the module into my ongoing 10,000 line project and switch over to the new platform straight away. However, I fully understand why you've done it. P.S. Perhaps BRL should employ you to do the official IDE with wxWidgets - the screenshots from your worklog look mightily impressive!?!?! |
| ||
I agree! Brucey deserves money for all his work! Great job. Where do I pay? I can't wait to scrap MaxGUI |
| ||
I'd be very happy to buy a decent Gui Module - you should really think about selling it - there's no other option available for native Guis after years of waiting and the disappointing MaxGUI (in terms of supported controls) wasn't a solution either. I like using langauges like Max or Python for tools and smaller apps just for their simplicity to setup new projects and the higherlevel libraries. In the past I mostly used wxPython and sometimes had to add external helper tools for number crunching tasks as Python is just to slow if you really have a lot of data to handle. wxMax could be the perfect match but I'd really prefer paying for the product than having a half done free version ... and after waiting for any real update/progress with MaxGUI I'd prefere paying over waiting for some others to add small bits every now and then all day. Regarding the task - have you had a look at SWIG? I don't know it could be of any use but might be worth a look as it's used for creating wrappers in general. |
| ||
I'm very interested in this too. I was doing a GUI editor for BLIde, but I dropped development becouse of the existing MaxGui bugs and missing features. |
| ||
Yes, this will sell, and I'll buy this if the price is reasonable. BRL should be afraid of this, this will kill MaxGUI, or Mark shoul make MaxGUI better ;) |
| ||
You should definitely ask for contributions from your userbase. I know you have a donate button on your site but i think it is about time we all showed you how much we appreciate your ongoing efforts by USING it... Personally i have bought SSwifts Sprite Engine, Greys Framework, Physlite, and LogicGui. Asides from your Database module i haven't produced much of value yet but i am learning every day. Cheers Glenn |
| ||
BTW - The Grid Control is what i want most. |
| ||
If I can use wxWidgets in BlitzMax, I will pay for it. Simple as that. I'd also be willing to help work on it, but that mostly depends on what coding standards and such in place. |
| ||
I agree! Brucey deserves money for all his work! Great job. Where do I pay? There's a PayPal donation button on his module page: http://www.brucey.net/programming/blitz/ |
| ||
I would pay as well no problem. |
| ||
I Agree ! if you want to make a solid gui module without bug i'll buy it ! You are an alien brucey :) |
| ||
You are an alien brucey :) Is calling people aliens a compliment in France? O-o |
| ||
yes it is ! |
| ||
Yep :) No offense brucey !! |
| ||
None taken, Filax ;-) What about a formeditor I agree, one will be important... and there are some examples of wx-based form editors out there, but obviously as part of a "UI module" it's not a specific requirement. As Pert. says, I'm sure someone will be able to do something once there's a module to make one for :-) it's a bit awkward with it not being a driver for the official MaxGUI module MaxGUI, as you know, is very constrained in its feature-set. It is far easier to do a straight port than try to figure out how to take the bits of wxWidgets and squeeze it into a MaxGUI module. Perhaps you could add a MaxGUI interface on top of it later?? have you had a look at SWIG I have, and had someone already written a BlitzMax langauage extension for it, it would probably have been the easy way to go. Alas, the time it would take to write a (working!) SWIG interface, might be as long as the work involved in doing the port! Still, perhaps someone wants to write one anyway? It could be really useful for future projects. The Grid Control is what i want most. Me too ;-) However, it is a *monster* of a control. Looking through the docs... it looks like it is the most complex one in the framework. Also, as you can see HERE, some of the documentation is sparse at best... :-p However, the grid demo that comes with wxWidgets shows a lot of the functionality, and is a good benchmark to compare a BlitzMax version against. (With the module, one can port the samples from C++ with very little effort, and therefore allow direct comparisons with the two apps - good for debugging ;-) |
| ||
I see there is also a wxSkin addon being developed which would allow skinning. Is this in your focus, too? I have to admit i don't know how well this one works but skinning in general is a great feature for any gui. |
| ||
I took a look at converting wxWidgets instead of using MaxGUI and I was put off by it's size. It's a beast! Saying that; MaxGUI will die when you release this, paid or not. I'd buy it, and I'll help in conversion where I can. |
| ||
I'd probably get it even if it was chargeable. Unfortunately I am not in a position to help. |
| ||
This module will be so much work, I think Brucey should definitely charge some money for it. When it really works flawlessly and does not need any weird workarouns or hacks from the user, I think USD 35 - 50 would be very acceptable from the customer perspective. |
| ||
Definitly! |
| ||
If I was an entrepreneurial type I might consider selling the it for a small fee, but that would require an increased effort with regards support that I may not be able to give the time to. How about offering it for sale, without support (at least formally), for a small fee? Stress this on all pages in CAPS, but allow some method of bug reporting? I've seen this no-support model on other commercial apps (we used a payment processing company where their support was basically, "Here's a PDF", inside the PDF it says, "use SOAP", that's it). |
| ||
Brucey - I have just transferred US$100 to your account. It is probably more than most people would contribute but your efforts are hugely appreciated and you deserve every cent. I hope other people use your DONATE button too. BRL - I bought maxgui to get some functionality i was used to in VB6 and to design forms for applications, not games. It hasn't quite lived up to my expectations but don't be put off. I would gladly buy another cool product from you. Is there a worklog or update somewhere telling us what you have planned for the next few months? I think there will be plenty of users like me who will pay more money for increased functionality. Cheers Glenn |
| ||
Thank you Glenn. Your generosity is also hugely appreciated! :-) Here's a little taster of one of the samples, ported to BlitzMax. aui.zip (win32 1.1 meg) It's not quite finished (some of the menus aren't implemented yet), but it gives you an idea of some of the functionality... try dragging things around (tabs/panes), and the settings pane in Options works nicely. Usually, what I do, has been to pick a sample, and add the API required to make it work. (much more interesting than wrapping the API, one widget at a time)... It's coming along... |
| ||
Nice teaser, Brucey. :) What does the BlitzMax code for that look like? And do you have it already running on the other two platforms? |
| ||
What does the BlitzMax code for that look like It's a straight port of the C++ sample... I'd post it here, but it's a bit big... (unless you want it zipped?) And do you have it already running on the other two platforms? Of course :-) Am developing on Linux, and test on Mac now and then. The idea is that you can write it on any, and it should "just work" on the other. (Mac issues excepted - problems with BlitzMax's appstub and wanting to be a Cocoa app - I have a hack for that). |
| ||
A zip would be cool. I only know what wxPython code looks like and would like to compare to the BlitzMax version. I find wxPyhon very easy to read and understand, but I'm afraid that native wxWidgets will be much more complex. |
| ||
Okay... here's a zip with both the original C++ and BlitzMax source for comparison : aui_src.zip (20kb) Remember, the Blitz version isn't quite finished, but you should get the idea. Notes: * C++ uses macros to define event tables. Blitz uses Connect(). * callbacks expect a wxEvent, it's up to the coder to cast it properly (to a wxCommandEvent, etc). * It's not MaxGUI, which makes it looks a bit different. :-) |
| ||
That looks great, Brucey.. Maybe this is something BRL can use for the next IDE, if Mark hasn't limited it to his own GUI thing he was/is working on.. |
| ||
Yeah, I was going to mention the new GUI Mark is working on myself. Don't know if it will be replacing MaxGUI or not, but if it's better... Russell |
| ||
Russell (Posted 38 minutes ago) Yeah, I was going to mention the new GUI Mark is working on myself. Don't know if it will be replacing MaxGUI or not, but if it's better... I think they will be two completely different products - I got the impression that Mark's GUI was graphics based i.e. it draws everything manually onto a canvas, however MaxGUI and Brucey's wxWidgets module uses actual native GUI system API and GDI drawing. |
| ||
Thanks for the code snippet, Brucey; it looks huge but still familiar. Excellent job! :) |
| ||
Can't wait to see the first blitmax test in run :) |
| ||
excellent work! something to insert into 'the BlitzMax's Wonders Guide' (if ever exists!) |
| ||
Impressive. Very impressive. |
| ||
Imagine the cross-platform IDE this thing could make... :) Ziggy, I'm looking in your direction.... |
| ||
Hi Brucey i have try to follow the tutorial here : http://code.google.com/p/wxmax/wiki/SetupAndInstallation the new BMK is compiled and work perfectly ! I follow step by step, but blitzmax seem not compile this module? Any idea ? Can you distribute, the mod compiled ? Else good job brucey :) |
| ||
Hi Brucey, Just to let you know that if you would like any examples made to test out certain functionality, I'll be more than happy to help out when I can. You know I like bug reporting!!! The other thing that I wanted to mention was concerning your Mac troubles with wxWidgets. You said it was partly to do with a conflict between Carbon (what wxWidgets uses) and Cocoa (what BlitzMax uses). I know that it is a few version behind, but would using the wxCocoa port of wxWidgets help? I don't know much about Cocoa/Carbon but isn't Cocoa supposed to be better anyway? |
| ||
the new BMK is compiled and work perfectly ! I follow step by step, but blitzmax seem not compile this module? Any idea ? Hey Filax. What are the issues exactly? What platform? I develop mostly on Linux, and do clean builds often (that is, all wx mods are stripped of binary data and recompiled). I then build on Mac, and at work I have it building fine on my Win2k box. If the instructions are not clear enough as to what you need, and what needs to go where, please tell me and I'll improve the guide. Can you distribute, the mod compiled? Well, it's not finished yet, nor anywhere near it, which is why the instructions only point to the Subversion repository. Consider it bleeding edge development ;-) I do always try to have the repository code compiling without errors before I commit anything - so fingers crossed, it is always usable as I add more features. Once much of the functionality is there, then I can start spending time packaging it up properly, but doing it now (and as often as I am committing), it would slow down my development cycle far too much. Of course, if someone wants to provide pre-compiled sets, they are welcome to. (that is, excluding headers and libs). Thanks Seb. If you follow the wxMax Group, I've got the commits posting there too, which might give you an idea of recently added functionality. The problem with porting up the samples, is that they tend to touch on all kinds of different functionality, rather than just the one thing (like the menu sample requires wxTextCtrl and logging to be working). So I bounce around adding bits here and there while working on a sample, and otherwise diving into a specific widget. As for wxCocoa, I believe its functionality is too far behind/untested for me to be worrying about for the moment. I would much rather concentrate on getting the library working now, than spend time finding bugs in wxCocoa. Still, if they can get it up to scratch, it would be nice to have. Whether Cocoa is better or not, it depends what side of the camp you are in. For speed of coding (if one came from a C/C++ background) I imagine that Carbon is the best choice. If you were coding something from scratch, then sure, Cocoa might be the way forward. Anyways, I'll stick with what works for now :-) |
| ||
I would help, but I lack the skills in C/C++. Also, I never used wxWidgets =\. I've used some of your modules in the past to help me understand some problems I came across. |
| ||
Thanks Seb. If you follow the wxMax Group, I've got the commits posting there too, which might give you an idea of recently added functionality. The problem with porting up the samples, is that they tend to touch on all kinds of different functionality, rather than just the one thing (like the menu sample requires wxTextCtrl and logging to be working). So I bounce around adding bits here and there while working on a sample, and otherwise diving into a specific widget. OK, I've joined the wxMax Google Group. I would help, but I lack the skills in C/C++. Also, I never used wxWidgets =\. I've used some of your modules in the past to help me understand some problems I came across. Same here - I don't know C++ (or wxWidgets yet!?!?!), but if you want custom programs coded in BlitzMax that will test specific features (to aid development), I'd be more than happy to help out. Plus, I get to learn how to use wxWidgets in the process. If you need me, use the e-mail address in my profile. |
| ||
Well, I've just compiled it under Windows (With MinGW.4.11), and tried out the AUI example given above... Not a good one to try first I expect; but here is my result... Updated some lines in the code so that I could compile it: Added: Import wx.wxApp and updated the frame creation line to: frame = MyFrame(New MyFrame.Create(Null,-1,"wxAUI Sample Application", , , 800, 600,wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER)) Then I got the following in the output window... I guess I should try something a little simpler first eh?... Lol |
| ||
Interesting.. How old is your code? the aui.bmx in subversion has : Framework wx.wxApp and frame = MyFrame(New MyFrame.Create(,,"wxAUI Sample Application", , , 800, 600,wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER)) (You may need to re-sync from the repository) My static libs with the BlitzMax default MinGW. Might that be a problem too? |
| ||
Ah! WX was downloaded last night, but I tested it with the AUI code from the link earlier in this thread. I'll give it another go after work. |
| ||
Yeah... only rely on the current samples that come with the dist. (wx.mod/samples) The samples build and run on my Win2k (MinGW 3.10 I think). Until BlitzMax officially move to a newer MinGW, I'll have to stick with that version. |
| ||
Hi Brucey :) I'll try to clarify my problem :) 1) Bmk replacement : Ok 2) Headers extracted to : C:\BlitzMax\mod\wx.mod\include\wx -aui -cocoa -generic -etc ... 3) Library's extracted to : C:\BlitzMax\mod\wx.mod\lib\win32 -mswu -libwxbase28u.a -libwxbase28u_net.a -etc... When i try to run a sample like this : I get an error (requester) : Compile Error Can't find interface for module wx.wxframe I have try to replace this : Framework wx.wxApp Import wx.wxFrame By Import wx.wxApp I get this requester : Compile Error Can't find interface for module wx.wxapp Any ideas ? :) |
| ||
Just a guess, Have you build the module with bmk makemods -a wx.mod If not its normal that you will get these 'interface missing' errors. Brucey, Awesome work as always. Works like a charm here on WinXP. I will test it today a bit more but till yet it is amazing. |
| ||
Hi Yes, i have try many methods to compile my VX module (direct from IDE etc) But blitzmax seem bypass the VX mod ? a direct compilation with bat file : Cd \BlitzMax\bin bmk makemods -a -r wx.mod bmk makemods -a -d wx.mod 'pause 5 Made nothing ! no error message etc. just dos prompt ? i there a way to get the module allready compiled ? |
| ||
Are you sure that you have also loaded the SVN Repositary with the module= You only mentioned the header and lib files but nothing about the actual module. http://wxmax.googlecode.com/svn/trunk/ or http://wxmax.googlecode.com/svn/ for more details. And keep in mind that the compiling will take some time ;9 |
| ||
I think the command-line would need to bebmx makemods wx ...without the ".mod" Filax, you should have something like : C:\BlitzMax\mod\wx.mod\ C:\BlitzMax\mod\wx.mod\include C:\BlitzMax\mod\wx.mod\lib C:\BlitzMax\mod\wx.mod\samples C:\BlitzMax\mod\wx.mod\wx.mod C:\BlitzMax\mod\wx.mod\wxadv.mod C:\BlitzMax\mod\wx.mod\wxapp.mod .... etc... I don't know why it wouldn't build from the IDE. there a way to get the module already compiled ? Not yet... I don't have time at the moment to set that up. Maybe you should wait a while until more development is done? Works like a charm here on WinXP. Good to hear, Klepto :-) Still a lot of work to do... |
| ||
I've uploaded a MinGW 4.1.1 build of the Win32 static libs - Completely untested, so you're mileage may vary. Update - I accidentally compiled one of the samples against the 4.1.1 libs while using 3.1.0, and I got the same kind of errors as Scaremonger reports, so the two are definitely not compatible with each other. Scaremonger, if you would like to try the new libs and let me know if you have any success. Thanks :-) |
| ||
Many thanks klepto2 it work now :) Brucey : It's ok now :) but others peoples in france get problems to compile the module, my question is : Can i distribute the compiled mod folder ? So, good job brucey, can't wait to play with this gui :) question : how i can make a donation ? your paypal button seem not work ? (i go directly on the paypal home page ?) Another question : In this code : Why the button fit the entire window ? |
| ||
Can i distribute the compiled mod folder ? Of course :-) ... but remember it's still not yet finished.. a lot of work still to do. Once I reach a point where I think much of the core work is done I will try to work out a proper release procedure... (i go directly on the paypal home page ?) Yes, that's strange... I've regenerated the buttons, and it now appears to go to the correct page. Enjoy :o) |
| ||
Impressive GUI !!! aui.bmx is absolutely a great demo. Excellent job Brucey. Here is the compiled module, just copy it under blitzmax mod folder : http://www.blitz3dfr.com/tempo/wx.mod.rar Note : "and it now appears to go to the correct page." It's ok :) donation is on the way :) And the last question brucey : It is possible to mix this GUI and B3DSDK viewport to make tools ? |
| ||
t's ok :) donation is on the way :) Thank you! It is possible to mix this GUI and B3DSDK viewport to make tools ? I don't know anything about the SDK. There is access to the HWND handle on the wxWindow, which might be what you need... ? |
| ||
I'll try to find :) But here is an example with maxgui and B3Dsdk. Maybe wxWidgets have the same commands to do it ? :) |
| ||
I got wxmax compiled finally but when i try to run an example i get this error../usr/bin/ld: cannot find -lgdk-x11-2.0 searched for that package in synaptic and didn't find it. |
| ||
You'll need something like gtk+2-devel and glib2-devel packages installed. (the chances are you'll have the standard gtk packages installed, but not the developer ones). |
| ||
Brucey, the GUI coding is a littlebit strange :) No main loop etc :) Can you post a simple example, with a main loop ? :) Here is my first tests, i hope to take the good direction ? : Combobox Button CheckListBox Windows Listbox Checkbox |
| ||
Can you post a simple example, with a main loop There is no main loop.... it is entirely event-driven. However, in much the same way you might run a "main loop" in MaxGUI with a TimerTick event, you could do the same kind of thing with wxWidgets' wxTimer... See also the timer sample which demonstrates extending wxTimer and implementing the Notify method. The statbar sample also uses a timer to update the time in the statusbar. |
| ||
Re, the SDK You may be able to replace this: Local Hwnd=QueryGadget(Canvas,QUERY_HWND) bbSetBlitz3DHWND(Hwnd) with something like : MyFrame:wxFrame MyWindow:wxWindow.... New wxWindow.Create(MyFrame,....) Local Hwnd:Int = Int(MyWindow.GetHandle()) bbSetBlitz3DHWND(Hwnd) Not sure about the event callback tho. Looking at the MaxGUI source, a win32 Canvas is simply a Panel that raises a Paint event, so it shouldn't be too difficult (in theory) to get it working with the SDK. |
| ||
Many thanks for reply Brucey ;) I'll test this :) Great GUI ! |
| ||
I've retried with MINGW 3.1.0-1 and it's fine. This is a fantastic addition to Blitzmax. I'm very impressed. Goodbye Maxgui.. :) |
| ||
After finding and installing what you suggested, there was another one I had to get (libtiff), after that I tried to compile the basic_notebook.bmx sample, here's what it gave meLinking:.basic_notebook.debug /home/timuhow/BlitzMax118_Linux/BlitzMax/mod/wx.mod/wx.mod/../lib/linux/libwx_gtk2u_core-2.8.a(corelib_textctrl.o):(.rodata._ZTV10wxTextCtrl[vtable for wxTextCtrl]+0x368): undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::seekoff(long long, std::_Ios_Seekdir, std::_Ios_Openmode)' /home/timuhow/BlitzMax118_Linux/BlitzMax/mod/wx.mod/wx.mod/../lib/linux/libwx_gtk2u_core-2.8.a(corelib_textcmn.o):(.rodata._ZTV14wxTextCtrlBase[vtable for wxTextCtrlBase]+0x368): undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::seekoff(long long, std::_Ios_Seekdir, std::_Ios_Openmode)' /home/timuhow/BlitzMax118_Linux/BlitzMax/mod/wx.mod/wx.mod/../lib/linux/libwx_gtk2u_core-2.8.a(corelib_treectlg.o):(.rodata._ZTV14wxTreeTextCtrl[vtable for wxTreeTextCtrl]+0x368): undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::seekoff(long long, std::_Ios_Seekdir, std::_Ios_Openmode)' collect2: ld returned 1 exit status Build Error: Failed to link /home/timuhow/BlitzMax118_Linux/BlitzMax/mod/wx.mod/samples/.basic_notebook.debug Process complete I tried some of the other samples and got some errors of the same type. |
| ||
Brucey, after some time playing around with this I have to say this is an amazing module. The OOP is much better than the MaxGui one. @Filax or @All: I don't know if filax has solved the problem with big (full frame filling) button. The solution is very simple: The wxFrame has a special feature, as long there is only 1 control parented to the frame this control is sized to the clientarea. There are 2 ways to solve this behaviour (which isn't bad). First add more than 1 control ;) , 2nd always use panels to as containers. Thats also the advantage of this behaviour, the panel is attached to the frame as its only child so the panel is resized everytime the frame is resized. |
| ||
You're right Klepto !, to solve the filling button problem just add a panel. |
| ||
The OOP is much better .Thanks Kepto. I'm mapping the C++ classes one for one, which makes wrapping very much easier. The wxWidget's folks I feel have a pretty good design. As for the control layout, there are things called Sizers you can use too, which allow you to design scalable positioning (not unlike what MaxGUI tries to emulate). And of course there is the traditional exact positioning option, but this can have problems when you move across platforms - those platforms having different HI guidelines to follow. The chklist sample gives you a (small) idea of how the sizers work. Note that you don't give x,y or specific sizing of the controls. This way you don't need to worry about having to add 4 pixels to a button height when running your app on Mac, for example. :o) |
| ||
I would like to help with this project. I am developing primarily on Mac OS these days and very frustrated with the options available there. I'll download the source and build it on my Mac tonight. There is a project I am eager to start using this for so I'll immediately start writing code against it if all goes well. |
| ||
Do you have a priority list for which controls to implement in which order? I really need HTMLView. Also is there a tutorial on how you wrap controls? |
| ||
Do you have a priority list for which controls to implement in which order? You could always add an "enhancement" issue, saying you'd like it sooner rather than later. I was looking into wxSheet most recently, which is going to take a while to finish. wxHtmlWindow (which is what I assume you want?), should be quite quick to do. |
| ||
I believe you may need to add a new type of issue to the project. I do not get an option when creating a new issue what type to set it to, and the "show only" option on the Type column lists only "Defect". For now I just put "Enhancement:" at the beginning of the summary. Also, SmartSVN + BlitzMax may be the coolest thing ever. Right Click -> Update, switch to MaxIDE, CMD+D, done. =D I have an odd issue, don't want to add it to the bug tracker yet as I may be misunderstanding something, but I have a htmlWindow on a frame, set to coordinates 0, 0, width, 100. When I resize the frame, the htmlWindow automatically resizes to fill the entire frame. Any thoughts? Do I need to change a layout setting to prevent this from happening? |
| ||
I do not get an option when creating a new issue what type to set it to, When you click in the text field that says "Type-Defect", when creating a new issue, it should popup with a list of other options. but I have a htmlWindow on a frame, set to coordinates 0, 0, width, 100. When I resize the frame, the htmlWindow automatically resizes to fill the entire frame. Any thoughts? Do I need to change a layout setting to prevent this from happening? I guess this needs to be added to one of the Frequently Asked Questions ;-) The answer, should you choose to accept it, is that if you add a single control to a frame, it automatically fits inside that frame. So, if you want to add a control at a fixed size/location, add a wxPanel first whose parent is the frame, and then add your control which has the panel as its parent. |
| ||
When you click in the text field that says "Type-Defect", when creating a new issue, it should popup with a list of other options. That field doesn't appear in my form, I only get Summary and Description. Maybe I have to join the project to see more? So, please add me if you feel so inclined: isaac dot raway at gmail dit com. I guess this needs to be added to one of the Frequently Asked Questions ;-) I would say so. Added a comment to the FAQ page. |
| ||
Just wanted to let you know I appreciate how quick you are with this stuff Brucey, this module is shaping up to be (for me anyway) the best there is for BMax since I don't use it for game programming but trying to do cross platform application development. |
| ||
Brucey, et al. If you find this module interesting (As I do, well done Brucey) I can recomend "Cross-Platform GUI Programming with wxWidgets" ISBN 0-13-147381-6. http://safari.informit.com/0131473816 |
| ||
It is indeed a very good read! Most of the example snippets throughout the book translate very well : C++ wxButton* button = new wxButton(panel, wxID_OK, wxT(“OK”), wxPoint(10, 10), wxDefaultSize) BlitzMax Local button:wxButton = new wxButton.Create(panel, wxID_OK, "OK", 10, 10, -1, -1) ..so there isn't a huge leap from the actual API to the BlitzMax implementation. |
| ||
Very impressive. Could I mix this with Max2D stuff in some way? -AF |
| ||
Could I mix this with Max2D stuff in some way? At some point I'm sure. I haven't got around to sorting out a "canvas" yet since there's lots of other things to do still. It also has the ability to draw directly onto controls (GDI?) which is kinda nice, and something I missed with MaxGUI. |
| ||
OK. I have a system in which I use a MaxGUI HTML widget amongst Max2D stuff for easy display of hypertext material. I'd use wxWidgets if it was possible. :) Does wxWidgets provide a way to find out when user clicks a link in HTML view? Does it let you update the HTML content from code? Does it support JavaScript? :) -AF |
| ||
It also has the ability to draw directly onto controls (GDI?) which is kinda nice, oooh, do you have an example of this? it could make a really nice skinning system if its worked on enough (though, only if you can draw bitmaps to any GUI object..) |
| ||
Does wxWidgets provide a way to find out when user clicks a link in HTML view? Does it let you update the HTML content from code? Does it support JavaScript? :) wxHTMLWindow does not support CSS or Javascript. Catching clicks is pretty easy: It is possible to update content but I believe Brucey is still working on that part of the interface. I owe him more testing on this very widget since I plan to use it in a project. HTML tags can be intercepted and other wx controls added to the HTML display window. There is an example of this in the latest SVN snapshot: http://wxmax.googlecode.com/svn/trunk/wx.mod/samples/html/widget/widget.bmx |
| ||
I want to second (triple?) the recommendation for "Cross-Platform GUI Programming with wxWidgets" ISBN 0-13-147381-6. I was considering switching to C++ and using wxWidgets before Brucey announced this module and purchased this book for that purpose. Happy coincidence that Brucey started working on this "impossible" module (the suggestion was made before that this very thing could never be done). |
| ||
Never say never :-) btw, wxHtmlWindow and it's related types - there are a lot of them, and I only implemented enough so far to get that sample working, which amazingly, it seems to. |
| ||
Just svnup'd my wx.mod folder to revision 135 and now the samples\aui.bmx fails to link with: Building aui Compiling:aui.bmx flat assembler version 1.66 4 passes, 147832 bytes. Linking:aui.debug.exe C:/Program Files/BlitzMax/mod/wx.mod/wxspinctrl.mod/wxspinctrl.debug.win32.x86.a(wxspinctrl.bmx.debug.win32.x86.o)(code+0x2d6): undefined reference to `bmx_wxspinctrl_setvalue' C:/Program Files/BlitzMax/mod/wx.mod/wxspinctrl.mod/wxspinctrl.debug.win32.x86.a(wxspinctrl.bmx.debug.win32.x86.o)(code+0x336): undefined reference to `bmx_wxspinctrl_settextvalue' C:/Program Files/BlitzMax/mod/wx.mod/wxspinctrl.mod/wxspinctrl.debug.win32.x86.a(wxspinctrl.bmx.debug.win32.x86.o)(code+0x38d): undefined reference to `bmx_wxspinctrl_getvalue' C:/Program Files/BlitzMax/mod/wx.mod/wxspinctrl.mod/wxspinctrl.debug.win32.x86.a(wxspinctrl.bmx.debug.win32.x86.o)(code+0x3f3): undefined reference to `bmx_wxspinctrl_setrange' C:/Program Files/BlitzMax/mod/wx.mod/wxspinctrl.mod/wxspinctrl.debug.win32.x86.a(wxspinctrl.bmx.debug.win32.x86.o)(code+0x45c): undefined reference to `bmx_wxspinctrl_setselection' C:/Program Files/BlitzMax/mod/wx.mod/wxspinctrl.mod/wxspinctrl.debug.win32.x86.a(wxspinctrl.bmx.debug.win32.x86.o)(code+0x4b3): undefined reference to `bmx_wxspinctrl_getmin' C:/Program Files/BlitzMax/mod/wx.mod/wxspinctrl.mod/wxspinctrl.debug.win32.x86.a(wxspinctrl.bmx.debug.win32.x86.o)(code+0x507): undefined reference to `bmx_wxspinctrl_getmax' Build Error: Failed to link C:/Program Files/BlitzMax/mod/wx.mod/samples/aui.debug.exe Process complete |
| ||
Oops, sorry... didn't think anything was using wxSpintCtrl yet, otherwise I'd have finished it off *before* checking it in. Will be fixed in the next commit (which will happen soon). |
| ||
Fixed.... apologies. |
| ||
@JakeL What about a formeditor? There's a form-designer (Borland C++ Builder Plugin) around, but I don't know if it could be utilized for your module(s). In my opinion a GUI needs a solid and powerful editor to be really useful. There is a form editor available called wxFormBuilder it can output C++ source and XRC Files. So I guess all that is required is a XRC->BMax convertor. This could be standalone and output BMax source or I guess there could be some code that allows importing these files into your own program. They are xml descriptions of the the forms. |
| ||
XRC is an XML based resource file that is used directly with wxWidgets. You shouldn't need a converter. |
| ||
What he said. Also, good work Brucey, really fills up nearly all the holes most people would care about in BMax. Powerful GUI, we have reflection, cross-platform, etc. -- now alls we somewhat sort of need is threading (these days it's a good thing to have, at least -- certainly not needed for most of what anyone will do, but that's another topic). Keep up the good work. Hopefully I'll be able to play around with this more once I get all my computer issues fixed. |
| ||
Just downloaded and installed the Mac version. All seemed to go well and the modules all built. However when I try an compile any of the samples with the new IDE, I get: Linking:.basic_notepad /usr/bin/ld: Undefined symbols: ___dso_handle collect2: ld returned 1 exit status Build Error: Failed to link /Applications/BlitzMax/mod/wx.mod/samples/basic_notebook.app/Contents/MacOS/basic_notebook |
| ||
You have the "tweaked" bmk? And I take it you also installed the custom appstub module? I've tested the modified IDE on PPC Mac, and David, the one who made the changes to it, is on Intel Mac. I wonder if it's a problem with a version of XCode and the compiled libs? You can also compile it normally, but the menus tend not to work properly - but otherwise it works - handy for testing purposes to see if it doesn't compile either way... |
| ||
@ Brucey Checked out revision 136 with: svn checkout http://wxmax.googlecode.com/svn/trunk/ wxmax Copied wxmax/wx.mod to BlitzMax/mod/wx.mod Downloaded: MaxIDE_wxMax_OSX_hack.zip to MaxIDE_wxMax_OSX_hack wxwidgets_2.8.6_headers.zip to wx wxwidgets_2.8.6_static_macosx86.zip to macosx86 Copied: wx to BlitzMax/mod/wx.mod/include/wx macosx86 to BlitzMax/mod/wx.mod/lib/macosx86 Downloaded & installed update 1.26 for MacOS (Intel). Re-build Docs (automatic on first run). Syncmods to bring everything up to date. Ctrl-D to build modules. Download bmk2 and compile Copy bmk2/bmk to BlitzMax/bin/bmk Answer yes to replace. Compile MaxIDE_wxMax_OSX_hack\maxide.bmx to maxide.app Copy MaxIDE_wxMax_OSX_hack\maxide.app to BlitzMax/maxide.app Answer yes to replace Open BlitMax/mod/wx.mod/samples/basic_notedpad.bmx and compile with the wx rocketship icon: Linking:.basic_notepad /usr/bin/ld: Undefined symbols: ___dso_handle collect2: ld returned 1 exit status Build Error: Failed to link /Applications/BlitzMax/mod/wx.mod/samples/basic_notebook Compile with standard rocketship icon gives an identical error. All other programs that I have still compile and run as normal. Including the samples that come with BlitzMax. |
| ||
I'm thinking that the XCode used to compile the x86 libraries and the XCode that you have, are different, which would explain the error. Do you happen to know which version of XCode you have installed? (I'll check to see which version was used to compile the libs). Also, you need this : http://brucey.net/programming/blitz/index.php#bahappstub And can you also confirm that you compiled the wx modules *after* installing the tweaked bmk? |
| ||
I used XCode 2.4.1 to compile the x86 libs. The change to the IDE itself is minimal. I added ' Allow Brucey's bmk to choose the wxWidgets OSX appstub If _b_wx_max Then cmd$ :+ " -b bah.appstub" To BuildSource, and then made that accessible via the menu/toolbar. So there's nothing too nasty going on in there. Note it assumes the path for Brucey's appstub is mod/bah.mod/appstub.mod David |
| ||
Missed the appstub part out, I did download and place it in BlitzMax/mod/bah/appstub.mod. I am currently using xcode 2.2.1 now downloading 2.4.1 will install and check to see if this makes a difference. modules were re-built after bmk2 was installed. |
| ||
am currently using xcode 2.2.1 now downloading 2.4.1 That's probably it... It's much like using MinGW 3.1.0 and MinGW 5.1.3 on Windows, where compiling with one is likely to cause problems when linking that compiled code with the other. Always good to keep your dev-tools up-to-date :-) |
| ||
Thanks, installing 2.4.1 and re-building all the modules seems to have fixed the problem. |
| ||
Great work on wxMax! Checking the svn at least once a day. Oh, and for the wxScintilla thingy I've had a look at it, it's a beast with 500+ methods.. Image |
| ||
Going back to basics here, how can you centre a window on the desktop? ::wxGetClientDisplayRect and ::wxDisplaySize are available functions to do the calculations with but are they implemented? |
| ||
Using the splash.bmx example i add:Local col:wxColour col.Create(255,0,0) to the line before: Local text:wxStaticText = New wxStaticText.Create(win, wxID_EXIT, .. "click somewhere~non image", 13, 11) and the text in the top left of the about screen becomes invisable? found the answer: local col:wxColour = new wxColour 'oops' |
| ||
how can you centre a window on the desktop? Okay... I've just committed the following GDI functions : wxClientDisplayRect, wxGetClientDisplayRect, wxColourDisplay, wxDisplayDepth, wxDisplaySize and wxDisplaySizeMM Here's a short example app: SuperStrict Framework wx.wxApp Import BRL.StandardIO Type MyApp Extends wxApp Method OnInit:Int() Print "is colour : " + wxColourDisplay() Print "depth : " + wxDisplayDepth() Local w:Int, h:Int wxDisplaySize(w, h) Print "size : " + w + ", " + h Local rect:wxRect = wxGetClientDisplayRect() Print "client : " + rect.GetX() + ", " + rect.GetY() + ", " + rect.GetWidth() + ", " + rect.GetHeight() Local x:Int, y:Int wxClientDisplayRect(x, y, w, h) Print "client : " + x + ", " + y + ", " + w + ", " + h Return False End Method End Type New MyApp.run() and example output :-) Executing:untitled1.debug.exe is colour : 1 depth : 32 size : 1152, 864 client : 0, 0, 1152, 836 client : 0, 0, 1152, 836 Process complete |
| ||
Brucey, thanks for that. Frame.centre() does the trick nicley! Looking for ways to set window and taskbar icons now :-)Local icon:wxIcon = New wxIcon("/resources/librarian.ico",wxBITMAP_TYPE_ICO) frame.SetIcon(icon) |
| ||
wish list: wxExecute + example. wxIcon wxLocale + example internationalised app. wxConfig |
| ||
import this : wx.wxMessageDialog for the message dialog. |
| ||
I am trying to force the window close button to call the same OnQuit handler asConnect(wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, OnQuit) The book suggests the following Connect(,EVT_CLOSE,OnQuit) but I get "Identifier 'EVT_CLOSE' not found"? |
| ||
Hey Brucey, thanks for this. Percentage-wise, how close to completion is this? This could REALLY be helpful for people wanting to build proper cross-platform apps with Max. Thanks again, Russell |
| ||
@Nigel just guessing, but i'd say that it should be wxEVT_CLOSE. |
| ||
@Nigel Brown Try this one: Connect(wxID_ANY, wxEVT_CLOSE_WINDOW, OnQuit) or just: Connect(, wxEVT_CLOSE_WINDOW, OnQuit) @ArtemisX The official Event wxEVT_CLOSE doesn't exist in wx.mod, or I'm just blind. ;) |
| ||
@d-bug thanks for that, guess I should have looked up the message name in the code instead of relying on the book. this now leads me on to the next problem try adding: Connect(, wxEVT_CLOSE_WINDOW, OnQuit) to to line 52 of minimal.bmx and see the crashes you get? |
| ||
Hallo folks :-) It should be wxEVT_CLOSE, but it's not currently plugged in yet. The event itself is there (wxCloseEvent) it's just not connected yet. Nigel, I don't think connecting a close window event handler to a function that closes the window is an entirely good idea. If it doesn't fall over with a nullpointer error, the least that will happen might be an infinite loop and then stack overflow... tsk ;-) Rather I implement the close event you need, I suppose? The reason development has slowed down recently is that I've been doing a bit of paid module work, which as you'd imagine is a bit higher priority for me. But expect it to kick back into its usual update pace shortly :-) There is a todo list on The Wiki on the wxMax site, which you are free to add to.. or.. even better, add an Issue in the issue tracker. That way I can't forget about it :-) |
| ||
Sorry... EVT_CLOSE and wxEVT_CLOSE_WINDOW are synonyms. I'll add wxEVT_CLOSE along with wxEVT_CLOSE_WINDOW and have them perform the same function in wxMax. |
| ||
wxStatixBoxSizer or wxStaticBoxSizer ? When using:Local limb1:wxStatixBoxSizer = wxStatixBoxSizer( New wxStatixBoxSizer.Create(m_panel0,-1,"label",wxHORIZONTAL)) I get the error "to many function parameters" |
| ||
The following code produceds the error "Compile Error: Unable to convert from 'wx.wxwindow.wxBoxSizer' to 'wxWindow'Local branch0:wxBoxSizer = wxBoxSizer(New wxBoxSizer.Create(wxVERTICAL)) Local limb0:wxBoxSizer = wxBoxSizer(New wxBoxSizer.Create(wxHORIZONTAL)) branch0.add( limb0, 0, wxEXPAND, 5 ) |
| ||
Hi there, i just tried to get this running but ran into problems. I compiled Bruceys BMK and exchanged that with the original. I got the wx sources via svn and compiled the lot. Now when i try to run the Hello World example i get the following errors: Any idea whats wrong? I'm using BMax 1.26 and the current MingGW 5.1.3 |
| ||
Hey for some reason I cam't compile any samples. I keep getting this error when linking: BlitzMax/bin/ld.exe: cannot find -lwinspool Any Ideas? |
| ||
Copy the needed libraries from the MinGW/lib directory in BlitzMax/lib. ( lwinspool=libwinspool.a , ...) |
| ||
Hi again, i was hoping to get some assistance here. The errors i posted 3 posts above still are the farthest i can get with this module. Has anybody seen errors like these or knows what i could try out differently? Thanks in advance |
| ||
Hallo :-) This : multiple definition of `typeinfo.... usually means that the compiler you are using is not of the same version as the compiler used to compile the static library. The current version in the Downloads section was compiled for BlitzMax 1.26 (MinGW 5.1.3). If you are still using 1.24, you can find the MinGW 3.1 compatible libs by choosing "Deprecated Downloads" in the combobox provided. If you *are* on the latest BlitzMax, then you may need to copy over ar.exe and ld.exe from your MinGW/bin folder to your BlitzMax/bin folder. These are the archive/linker apps that are required for part of the compilation process. The ones included with 1.26 were the OLD ones. Hopefully that will sort out the multiple-defs problem. |
| ||
Thanks for the answer Brucey, i just deinstalled MingW(5.1.3), installed it again(5.1.3), copied the ar.exe and ld.exe to blitzmax/bin, compiled your BMK with that, got me a fresh checkout of wx.mod via svn, compiled the lot and tried to run hello_world. Still the same errors. Could it have to do with the header files i have to download separately from the googlecode pages? They are the only things I always have to copy in there by hand... Thanks for any assistance in this matter |
| ||
do you have copied the libs? as you mentioned only the headers? |
| ||
Hi again, ok i got it. Turned out I had an entry in my path variables pointing to an obsolete MinGW installation. Once i fixed that everything worked. Thanks alot for your help and Brucey ... great mod :) |
| ||
Any news, Brucey? |
| ||
Hey man just wanted to let you know I am going to try to get back to my projects that use wxWidgets and I will do more bug hunting for you. Work has been crazy. |
| ||
Brucey, Will you be converting the wxThread module? (See Page 447, Cross-Platform GUI Programming with wxWidgets) I know that Blitzmax is not multi threaded and it's unlikely to work but it would be interesting to see what can be achieved (if anything). |
| ||
Hallo :-) Will try and get back on the job over the coming weeks... it's been a bit busy around here of late. Been chomping at ye olde bit to get back into it though :-) From what I recall, wxSheet and wxScintilla are up to the point of initial workage - ie. they compile and appear to do something, but haven't been finished yet. And of course there are a lot of mods added but un-implemented as yet. I think Scintilla is quite exciting, what with its built-in lexer stuff, and support for folding and auto-completion... things which would be nice in a cross-platform IDE, I imagine :-) Scaremonger, I'm not sure wxThread would be worth putting much effort into, given the problems associated with Max's GC. Sure, you could have some c/c++ stuff running concurrently in another thread, but you'd be looking for trouble hoping Max-code would hold up to the same task. Which is a shame really... I see too that wxWidgets 2.8.7 came out recently, which I guess will mean building some new libs for.. ...and there's a new Scintilla too... It's never-ending, hey? |
| ||
Hmm... I can't get this to work anymore on Mac OS X (10.4). The SetupAndInstallation page says BMax 1.28 works out of the box with the module, but that doesn't seem to the case for me. Actually, after updating to 1.28 not even the custom BMK works for me anymore. The applications build okay, but then when it tries to run it nothing happens. I just see this: Building wxhello Compiling:wxhello.bmx Linking:wxhello Executing:wxhello No application window appears. wxhello.bmx |
| ||
Are you remembering to build using the custom appstub? (I presume you would do this using the tweaked IDE? cmd-shift-R ). Also checked you have GUI build selected. I had the same problem - which was because of me forgetting to use the custom app-stub. Hopefully, once wxCocoa matures - whenever that may be - we can move away from Carbon altogether. |
| ||
Never mind, it must have been something else screwed up. I rebuilt my BlitzMax from scratch and all is well, so far. |
| ||
Weird, though... I have exactly the code above and I am using the "factory" provided BMK and IDE... and it works... that can't be right... The window even appears *over* the IDE... |
| ||
Ah yes, but the Menus are screwed, cuz Max tries to make its own - and wxWidgets tries to do the same too. I'm wondering if there isn't something in the plist that will make the App jump-to-front. Interestingly, if I run a wx sample outside of its .app folder it opens up behind the console, but if I run the .app, it opens up in front of the console.. I'm sure there is a way to fix it :-) |
| ||
First of all, just want to thank you Brucey for all the work you've done with regards to BlitzMax modules, they are awesome! I noticed that wxWidgets also contain wxPrinter and wxPrinterDC, and except of Kanati's DLL printer module for Windows, this module might make it possible to print on Mac as well (without MaxGUI). The printing module is not really a part of the GUI module so I don't expect it to be a part of this project, but I was just wondering if you had taken a peek at it and seen if its possible at all to port it without too much work :) |
| ||
I was just wondering if you had taken a peek at it and seen if its possible at all to port it Yep, it's on my list of things to do :-) ... specifically because I'd like some decent printer support for BlitzMax. The nice thing about wxPrinterDC is that it should be able to render anything that you might normally use a wxDC to render - so for example, you have your preview on-screen, and then change the DC to output to the printer instead... (at least that's the theory) |
| ||
Ah awesome! :) Yes, thats also what made me very interested in it, it would be the perfect printing library for BlitzMax :) |
| ||
I'm wondering if there isn't something in the plist that will make the App jump-to-front. Interestingly, if I run a wx sample outside of its .app folder it opens up behind the console, but if I run the .app, it opens up in front of the console.. I'm sure there is a way to fix it :-) That's the thing... with the 1.28 BlitzMax vanilla install and all your stuff set up in the mod folder, the app opened correctly, over the IDE instead of behind it... I don't get it. This never worked before. Did they make some changes to the compiler or startup code? I'm not even sure if my apps are using your appstub, though I do use it in the Framework command... I guess I should learn to not complain so much, I just hope it doesn't suddenly stop working on me... |
| ||
But the problem with using the built-in appstub is, that although it appears to work normally, the menus are all messed up. Don't say I didn't warn you ;-) |
| ||
Oh, okay I get it now... thick headed today. So, I still either need to call BMK from the terminal to compile correctly with bah.appstub, or use the custom IDE. I wish they'd just add a way to customize BMK switches to the official IDE. |
| ||
I need some advice. I installed the repository, added the libs and includes, open up Blide with Hello_world.bmx and Blide hangs up. BMax IDE show these errors: Any clue what's going on? I think the whole package compiles well (took ages). Do I need to modify bmk with 1.28? Jake PS: Win XP here. |
| ||
No you shouldn't but you still might need to replace the AR and LD tools as the repository still does not send out the current ones?! Especially don't forget to first rebuild the BMK and replace it as bmk_util was patched twice through SVN since 1.28 release. For me it works that way |
| ||
Hm, I guess I'm in need of more "noobish" explanations. Sorry, but I can't get it to run... |
| ||
The errors you are getting are generally due to differences between the version of the compiler/linker used to compile a library and the one which you are using to build an application using that library. The current download ( wxwidgets_2.8.6_static_win32 (5.1.3).zip ) was compiled with MinGW 5.1.3, which is the one required for use with BlitzMax 1.26+ There was an issue with BlitzMax 1.26 though, in that two files (ar.exe and ld.exe) that were shipped with it were not from MinGW 5.1.3 but from the old version (3.1.x), and thus caused the same issues when building an app against the libraries. 1.28 has fixed this problem, as far as I'm aware, and also includes my BMK updates - which were also required to be able to build with the libraries. So, what does this mean for you? Perhaps that your MinGW 5.1.3 isn't quite right? If you have an older version of MinGW lying around, check that it isn't using that instead by mistake? Otherwise, it should "just work"... However, I'll give it a run on mine here just to double-check.. :-) |
| ||
Thanks for that explanation. I noticed that ld.exe and ar.exe from BMax 1.28 and MinGW 5.1.3 differ (BMax having the newer ones). Anyway, I tried both versions, rebuild all modules, but the error stays the same. Perhaps someone can send me a zipped wx.mod with everything build (mail-limit is at 100MB, so this should work via email). Thanks in advance Jake |
| ||
I just tried it on XP using a vanilla BlitzMax 1.28 with MinGW 5.1.3, and it's working as I'd expect. I've also started uploading builds of wxWidgets 2.8.7, which you can grab from the usual place. For the MacOS curious, I've also found a fix for the "app starting *behind* the IDE" problem, which requires a new BaH.AppStub. In the end I added some Carbon code to bring the app to the front, in the same kind of way that the Cocoa code does. I've put it up on the MaxMods site - where I'm working on migrating most of my modules to. :o) |
| ||
Weird, but it works now. My MinGW 5.1.3 was an update of an older version. A reinstall of MinGW over the existing one did not work (errors from above). After a complete uninstall of MinGW I reinstalled it and applied a Blitzmax setup+1.28 update over my existing BMax installation and after a complete rebuild using the Blizmax IDE everything works. Could be that the MinGW installer did not replace all old files. Thanks again for your help PS: After looking through some examples, I can't say much more than WOW! Absolutely great stuff! I will love it! You should receive the "Man who brought UI to Blitmax" honor medal and some kind of statue before your house! |
| ||
Could be that the MinGW installer did not replace all old files. What I always do is rename the MinGW folder, create a new one with the original name (like c:\MinGW) and install fresh into there. Never trust an over-install :-p |
| ||
I've also started uploading builds of wxWidgets 2.8.7, which you can grab from the usual place. Hi Brucey -- do you actually have a complete module for the wxwidgets yet, or is it 'just' the collection of includes and libraries at this point? I downloaded the 2.8.7 thing from your page, but have no idea what to do with its contents at this point. :-? |
| ||
do you actually have a complete module for the wxwidgets yet Not yet... There are still a lot of gaps in the API, which I would rather add first before I say "Here is our first *release*". So for now, the code lives in the Subversion repository. It's reasonably useable as it is at the moment, depending on what you want from it. There's certainly enough there to knock together a basic application with multi-column lists etc. As for a "complete module", wxMax is made up of about 118 individual modules, each of which is generally for one specific widget - like a wx.wxButton, and a wx.wxListCtrl, etc. Because of the way BlitzMax links its dependencies, this architecture means that you only import the widgets that you want for your app - otherwise, with one *very large* module, you would implicitly have all of the library in your app too. I think it's much cleaner this way too, and also makes maintenance a joy (almost!) ;-) The includes and libraries are separate to make it easier to deploy everything. Choose your libs, get the headers, drop them into the right folder, and build modules - if you have everything set up correctly, it will "just work" - albeit a wee while later ;-) |
| ||
Ok, I'm getting into it. But now I'm stucked (and found nothing about it on google). Basically I want to create a nested splitter solution: I created a MyFrame, added a vertical splitter with a wxScrolledWindow to the left and a wxWindow to the right. Within this right wxWindow I added another splitter (horizontaly) and attached two wxWindows to them. It works, but the horizontal splitter is about 20x20 and so are my wxWindows. I used SetSize() but nothing happened. Any idea? Jake PS: I looked through the wxMax forum at google, but it's more a developer log than a forum, right? So what to do? I think it's a bad idea to bomb this thread with noob questions. Create another thread? Another board or forum? Hmm... |
| ||
I guess this is the kind of thing you are after?---------------- | | | | | | | |--------- | | | | | | ---------------- You can probably skip the wxWindow on the right for a horizontal splitter directly. Otherwise, I would expect it to work... Also, have a look at SetSashGravity(). it's more a developer log than a forum, right Not really. I've got subversion posting commit details to it so ppl know what's going on in the repository, but otherwise, there haven't been many questions there. New threads work for me :-) |
| ||
Okay.. I just hacked the Splitter sample to try out the above, and it works okay. The main splitter took a canvas on the left, and a splitter on the right. The right-splitter split horizontally, with a canvas top and bottom. Resulting in a nested splitter :-) If you change this chunk of code in MyFrame's OnInit(), you'll see what I mean : |
| ||
Thanks a lot, Brucey, will try this immediately. Edit: Works like a charm! |
| ||
Though I have a lot to learn about wxWidgets, I'd like to know if the current state of wxMax allowes the creation of custom controls? In particular lower level event handling like mouse enter/leave/move for wxWindow. I don't want to ask for it and I wish I could somehow help the project. So, are there any tasks left a non-C++ guy can do? |
| ||
You should be able to extend a wxWindow, do your own OnPaint() stuff, and have it handle any mouse events you care to notify it about. There's a small example HERE which shows how I extended a wxButton and connected a Mouse Down event to it. I expect the same can apply to a plain wxWindow control Also have a look at the font sample for examples of doing your own Painting. are there any tasks left a non-C++ guy can do? I think, just using the code will help a lot - the more testing it gets, the quicker any bugs will appear and be sorted out. The samples are generally good at showing up any holes in the wrappings, but there's usually some other APIs to add before there's enough framework there to finish them. The samples can be fiddly to implement too sometimes, as the code doesn't *always* translate exactly (although it does more often than not!). Other than that, there's general documentation and wiki stuff for the website which is all rather tedious :-) |
| ||
I'm currently doing a normal max2d/graphics game and tried to add a GUI (for an in-game editor) using wxMax. I tried to start the game in a brl.graphics window and switch to wxMax as soon as the editor is started, but that didn't work quite well, I guess it's because wxMax uses it's own pixmap/graphics module. Now I'm trying to convert the whole game to wxMax (more specific wxMax2d), but it still doesn't work properly. E.g. it's look like i have to call all the game functions from the frame's onPaint() method now, which requires quite a lot of changes. Furthermore i used a modified version of max2d and glmax2d, so i'll have to convert the new functions i did to wxMax2d as well. Isn't there an easier way to do this? |
| ||
I just did tests with wxMax2D as well. It's sloooow. I don't know the backgrounds, but from a noobs perspective it should work as fast as Max2D within MaxGUI, shouldn't it? Right now it seems impossible to use a max2d canvas for realtime purpose. I did a test and a render that took 0.5ms in Blitzmax needs 12ms within a wxMax2D canvas. Brucey, is there any hope on the horizon? |
| ||
wxMax2D isn't designed for "realtime" 60fps hardcore-tastic thrashing... It's more of a Max2D compatible drawing layer that will make it easy to use Max2D for rendering to controls and printers, and the likes. It's a "software" renderer, so don't expect miracles :-p However, it's entirely possible to connect DX to a wxWindow, and thus render D3D7Max2D with wxMax quite easily - I've even proven a B3DSDK context running via wxMax. OpenGL requires some work though, since the OS X implementation relies on Cocoa a lot (thanks Mark :-p ). I'm hoping that the wxGLCanvas mod will allow GLMax2D integration, but it's a wee bit out of my depth... I've made a start, but all this GLContext stuff makes me dizzy... So, it's all do-able, it just needs some work, and specifically with the OpenGL stuff, some help :-) |
| ||
Using:Connect(, wxEVT_CLOSE_WINDOW, OnQuit) I am now getting an error: "Compile Error Unable to convert from 'Int()' to 'Int(wxEvent)' I guess what I really want to do is something like Connect( Self.GetId(), wxEVT_CLOSE_WINDOW, OnQuit) This gives the same error? |
| ||
Sure that your onQuit meets the needed header definitions? because the problem is that something with a definition of function bla:int() is assigned instead of function bla:int(ev:wxEvent) which looks like an event handler |
| ||
Dremora: Thanks. |
| ||
Brucey: Glad to see your back at it again :-) internat.bmx replacelocaleInfo = _("Language: %s~nSystem locale name:~n%s~nCanonical locale name: %s~n") localeInfo = localeInfo.Replace("%s", locale) localeInfo = localeInfo.Replace("%s", sysname) localeInfo = localeInfo.Replace("%s", canname) with localeInfo = "Language: " + locale + "~n" .. + "System locale name: ~n" + sysname + "~n" .. +"Canonical locale name: " + canname + "~n" and change the lines: sizer.Add(New wxStaticText.Create(Self, wxID_ANY, _("First")),0,wxEXPAND|wxALL,5) sizer.Add(New wxStaticText.Create(Self, wxID_ANY, _("Second")),0,wxEXPAND|wxALL,5) |
| ||
That'll be why First/Second looked silly ;-) I'm thinking perhaps I should just implement wxSizerFlags() and be done with. Maybe. As for the first bit, surely the strings need to match the "localized" strings in the .po files for possible translation? - which is why I did it that way... btw, did it work for you on Windows? The c++ sample works, but on my XP nothing translated... as per my worklog entry, I think it's a char-width issue on Win32. (I could be wrong..) |
| ||
The problem with the first part of the code is that all %s get replaced the first time so subsequent calls to Replace are unable to add the new values. wxSizerFlags() look like the way to go from what I have read today. Yes, there is a problem on Windows I don't get any translation at all. did not look at it much if you have a clue as to where the problem may be I will take a look. |
| ||
Just tested Internat sample on Leopard 10.5 Intel and 10.5 PPC and it seems not to be working here on any platform. |
| ||
That's strange... I wrote it on an Intel Mac, and it worked fine (albeit some of the languages like Russian didn't want to work because apparently you need to have that locale as part of your OS - or something). The German, French and Japanese translations were working tho. |
| ||
Spooky. I tried it on XP (fresh checkout) and the French and German translations seem to work in the internat sample... I guess I must have tried it on Win2k previously then... (still think it's something to do with char sizes...) |
| ||
I'm considering adding support for wxGraphicsContext, however on Win32 this uses GDI+ (GDIPlus). Is this an issue for anyone? Apparently some versions of Windows would require the installation of a gdiplus.dll ("GDI+ is available as a redistributable for Windows NT 4.0 SP6, Windows 2000, Windows 98, and Windows Me.") What do we get with wxGraphicsContext? Well, significantly for me are font extents while drawing. |
| ||
I think as long as it's noted in documentation, it shouldn't be an issue. |
| ||
Brucey, Question for you. I have been playing with the MaxGUI HTMLView because it uses Safari on Mac and IE on Windows automatically. The API to it is a bit of a pain but I've had some success customizing the C code to do what I need. <edit>Forgot to say that this control is favorable v. the wxWidgets control since it can handle JS, CSS, etc.</edit> What I'm wondering is if there is a way you can see to add a MaxGUI control to an otherwise wx driven application. I'd like to build everything in wx using it's event model, and only break to MaxGUI when I need that one control. I'd be more than happy to do most of the coding for this, if you can point me in the right direction. I'll be looking at it myself in the next few days but I wanted to see if you have any insight, since you've also done a MaxGUI driver. |
| ||
revision 170 causes: Building Modules Compiling:glue.cpp In file included from C:/Program Files/BlitzMax/mod/wx.mod/wxprintpreview.mod/glue.cpp:23: C:/Program Files/BlitzMax/mod/wx.mod/wxprintpreview.mod/glue.h:64: error: cannot declare parameter `dc' to be of type `wxDC' C:/Program Files/BlitzMax/mod/wx.mod/wxprintpreview.mod/glue.h:64: error: because the following virtual functions are abstract: C:/Program Files/BlitzMax/mod/wx.mod/include/wx/dc.h:736: error: virtual void wxDCBase::DoGetSize(int*, int*) const C:/Program Files/BlitzMax/mod/wx.mod/wxprintpreview.mod/glue.cpp:37: error: cannot declare parameter `dc' to be of type `wxDC' C:/Program Files/BlitzMax/mod/wx.mod/wxprintpreview.mod/glue.cpp:37: error: since type `wxDC' has abstract virtual functions Build Error: failed to compile C:/Program Files/BlitzMax/mod/wx.mod/wxprintpreview.mod/glue.cpp Process complete |
| ||
Apologies for the build problem... Fixed in 171 ... that's what I get for : 1) Blindly following the API docs. 2) Not testing on all platforms before a commit. (although I thought I should check it in before heading for bed - just in case. You know how it is.. you work on something for several days and you'd prefer to have an off-site backup somewhere). Anyhoo, it seems that the printing sample (as much as I've done of it) mostly works at the moment. I did get an exception after printing the example page on Windows, but I haven't tracked that down yet. On Mac, the Preview screen throws an "Out of Memory" error, but, it does that with the C++ sample too - so at least the BlitzMax version is comparable ;-) Why the Japanese text doesn't print out in the sample (or in the preview) on Win32 is, I think, to do with the character encoding on Win32 BlitzMax - specifically having that text in-lined in the code. Works fine on Mac, as the Mac IDE handles Unicode (mostly) properly. Otherwise, I think the printing stuff is going quite well. |
| ||
a way you can see to add a MaxGUI control to an otherwise wx driven application. On Win32 it should be relatively easy. On OS X, not likely, since wxMax on Mac is Carbon, and MaxGUI is Cocoa - which are not entirely interchangeable. So you can't, for example, add a Cocoa window to a Carbon app, but you can add a Carbon window to a Cocoa app. However, I think I've seen somewhere, some work with regards implementing WebKit with wxWidgets (on all three platforms), and it apparently works. Although Webkit is like a 200meg download *just* for the source project, so I'm not planning on taking a look at that in a hurry :-p From what I've read, the reason there isn't a native HTML widget API with wxWidgets is because each browser API is very incompatible with the other, and noone appears to want to write lots of wrapping code to have a single API for all. Which is fair enough. |
| ||
The mainloop.bmx example does not exit properly. The loop continues to run after the window has closed because the loop is a While True..Wend Is there an equivalent to appTerminate() that can be used to force it to exit, or should we pick up the wxEVT_CLOSE event and set our own flag ? Cheers, |
| ||
The mainloop.bmx example does not exit properly. Yeah... I've kind of not got my head around that completely yet - hence all the debug. The idea is to run your own main-loop, rather than let wxWidgets run its own - which is normally the case. While at the same time, try to control it from BlitzMax. The difficulty is finding clear examples on the net that show it in action. |
| ||
An example on This Page shows a mainloop something like this: But I cannot find the identifier m_shouldExit !! I have not included code for the try-catch statement yet... |
| ||
I get an error on my Ubuntu (Gutsy Gibbon) when i try to execute an with wxMax created wxWidgets application. (An with C++ compiled wxWidgets application (v2.8.*) works fine) Don't know what to do... Building hello_world Compiling:hello_world.bmx flat assembler version 1.64 3 passes, 2206 bytes. Linking:hello_world Executing:hello_world /usr/bin/ld: warning: libstdc++.so.6, needed by /usr/lib/libwx_gtk2u_aui-2.8.so, may conflict with libstdc++.so.5 Fatal Error: Mismatch between the program and library build versions detected. The library used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6), and your program used 2.8 (no debug,Unicode,compiler with C++ ABI 102,wx containers,compatible with 2.6). Aborted (core dumped) Process complete Any ideas? - FOODy |
| ||
The build is picking up your "system" libraries rather than the static libs that you find in wx.mod/lib. The headers that are located in wx.mod/include are specific to the static libs. The message also implies that the system library was compiled with gcc4 and you are trying to compile with gcc3 ?? (The ABI version difference as well as the number on the end of libstdc++.so imply this). The static libs are also compiled with gcc4. Do you have gcc3 and gcc4 installed? I know that by default on Linux, BlitzMax wants to build using gcc3.3, but most systems these days ship with gcc4. It's pretty easy to make it build with gcc4 instead, and this may be what you need to do in order to go further. However, Perhaps adding this into wx.mod/wx.mod/common.bmx will fix the search order, and get around the attempted link to the system libs: After ?Linux add this line Import "-L../lib/linux/" and Build Modules. If that succeeds, and you are using gcc3, you may get a different set of error messages. Nice that it tries to fail gracefully though :-) |
| ||
Yes, both versions of the gcc are installed and it works fine when i use the gcc4 :/ @Import[...] : Same error message. :( [trash]Can i simply create a symbolic link "gcc-3.3" who point to "gcc" without having (to much) trouble in the future?[/trash] [edit]I recompiled the bmk that use now "gcc" instead of "gcc-3.3". As long wxMax works ;)[/edit] - FOODy |
| ||
You shouldn't have problems using gcc4 to build the modules. As long as when you change to using gcc4 from gcc3 you Rebuild All Modules, you'll be okay. The reason there are problems with the two versions is that the GCC guys changed the internal vtables in gcc4 so that you can't link code from one to the other - for static-compiled apps, that is a Build-time issue. For Apps that used shared objects you need to have the compatible .so's on your system. (note that original warning about libstdc++) |
| ||
Because some of us have crappy Internet connections (raises hand), it takes bloody ages for a giant sized topic to open each time... I'm going to start a new one... |
| ||
internat problem now fixed here, just downloaded 2.8.7 headers and libs and checked under XP / 10.5 Intel. |