Page 1 of 1

Can anyone compile an updated wxWidgets C.lib / DLL ??

Posted: Fri Jun 20, 2014 2:07 am
by Zach
Reference: http://www.purebasic.fr/english/viewtop ... t=wxWidget

I don't know if its possible, or if there are sources available to do this but thought I would ask

I'm no good at the compiler stuff (beyond hitting compile in PB) and would be totally lost trying to figure it out..

But I would like to try updating the wxWidget wrapper for personal use (if it goes well, maybe for public) that was posted on the forum a while back, however it is based on a much older 2.x version and the accompanying library + binaries are, obviously, out of date.

I can't find an actual .lib anywhere, nor any active C API project with a download, but my google-fu is also not the best either..
I'm guessing I could try and fail miserably at trying to wrap the C++ API, but at least with the previous wrapper I would have something as a reference..

Re: Can anyone compile an updated wxWidgets C.lib / DLL ??

Posted: Fri Jun 20, 2014 6:01 am
by idle
It looks like the source is included so you can just use the includes or make a new userlib with tailbite

Re: Can anyone compile an updated wxWidgets C.lib / DLL ??

Posted: Fri Jun 20, 2014 6:45 am
by Zach
That's the whole problem.

Those files are based on an older version of wxWidgets, which would include the wx-c.lib / dll that are in that package.

I'm trying to find a wx-c.lib & dll based on the current version of wxWidgets which is 3.0.1, so that I can use those source files as a base for trying to update things and include any new widgets, etc.

Re: Can anyone compile an updated wxWidgets C.lib / DLL ??

Posted: Fri Jun 20, 2014 7:23 am
by ts-soft
I think, there is no newer C.lib!

Re: Can anyone compile an updated wxWidgets C.lib / DLL ??

Posted: Fri Jun 20, 2014 9:08 am
by Zach
could I still do it with a DLL alone?

What puzzles me is how the wx-c.dll was made / where it came from.

wx.NET seems to have a C binding, although I'm not sure what version its based on, off the top of my head.. Can't really seem to find -that- info..

Looking in the source packages structure

/wx.NET-0.9.2/src/wx-c

it has a bunch of source files that mirror the filenames of all the stuff in wx-PB's files (accel.cxx, activateevent.cxx, etc..)
It also comes with a wx-c-0-9-0-2.dll, and a bunch of .SO files (not sure what those are really) i.e "libwx-c-0-9-0-2.so".

Anyway as an example, there is these couple of lines in the accel.CXX source file for wx.NET

Code: Select all

WXNET_EXPORT(wxAcceleratorEntry*)
 wxAcceleratorEntry_ctor(int flags, int keyCode, int cmd, wxMenuItem* item)
{
	return new wxAcceleratorEntry(flags, keyCode, cmd, item);
}
And then there is this in the accel.pbi file.

Code: Select all

ImportC"wx-c.lib"
	
	wxAcceleratorEntry( flags ,  keyCode ,  cmd ,  item )  As "_wxAcceleratorEntry_ctor"
	wxAcceleratorEntry_RegisterDisposable ( self ,  onDispose ) As "_wxAcceleratorEntry_RegisterDisposable"
	wxAcceleratorEntry_dtor ( self ) As "_wxAcceleratorEntry_dtor"
	wxAcceleratorEntry_Set ( self ,  flags ,  keyCode ,  cmd ,  item ) As "_wxAcceleratorEntry_Set"
	wxAcceleratorEntry_SetMenuItem ( self ,  item ) As "_wxAcceleratorEntry_SetMenuItem"
	wxAcceleratorEntry_GetFlags ( self )  As "_wxAcceleratorEntry_GetFlags"
	wxAcceleratorEntry_GetKeyCode ( self )  As "_wxAcceleratorEntry_GetKeyCode"
	wxAcceleratorEntry_GetCommand ( self )  As "_wxAcceleratorEntry_GetCommand"
	wxAcceleratorEntry_GetMenuItem ( self )  As "_wxAcceleratorEntry_GetMenuItem"
	wxAcceleratorEntry_GetAccelFromString ( label.s )  As "_wxAcceleratorEntry_GetAccelFromString"
	wxAcceleratorTable( ) As "_wxAcceleratorTable_ctor"
	wxAcceleratorTable_Ok ( self )  As "_wxAcceleratorTable_Ok"
	
EndImport
Pretty much all those keywords should be present in accel.cxx based on a quick glance over the code.

I'm guessing I would have to learn to translate all the code in the .cxx source files into PureBasic and then maybe I could use the wc-c-0-9-02.dll file or something.. Only hitch is wx-PB opens the wx-c.lib file with OpenLibrary; but I'm not sure if that is simply a matter of static vs dynamic linking and whether or not I really need it. Kind of like the way ProGUI worked? It had a user library, but you could also use it directly from the DLL with an included file which had similar definitions to stuff like inc.accel.pbi (the ProGUI_PB.pb file is full of definitions for Constants, Prototypes and Functions).


But then this would all be moot if its a much older version 2.x DLL anyway.


Is it even possible to wrap functions into PB if I could glean the necesarry info from C++ sources for wxWidgets 3.0.1 ? I thought I read something about Prototypes/pseudo-types/Interfaces being able to facilitate this in some way, but I am not sure 100%.. (Can you guys tell I am in way over my head? hehe...)
Oh well, at least it occupied me for a while :oops:

Goddamnit PrincieD why did you have to dissapear... ProGUI was shaping up to be so awesome :cry:

Re: Can anyone compile an updated wxWidgets C.lib / DLL ??

Posted: Fri Jun 20, 2014 11:25 pm
by idle
If you want a stand alone gui widget lib maybe IUP would be a better option
there are a couple of ports available for it but it's only native for linux and windows
osx requires X11 or gtk

Re: Can anyone compile an updated wxWidgets C.lib / DLL ??

Posted: Fri Jun 20, 2014 11:51 pm
by Zach
I can't compile for Mac/OSX anyway.

I did not know about IUP. Has anyone used it in PB before? (always nice to have a starting point)..

Re: Can anyone compile an updated wxWidgets C.lib / DLL ??

Posted: Sat Jun 21, 2014 6:43 am
by idle

Re: Can anyone compile an updated wxWidgets C.lib / DLL ??

Posted: Sat Jun 21, 2014 11:57 pm
by Zach
Thanks idle 8)