wxWidgets 2.8.12 FreeBASIC C wrapper

Headers, Bindings, Libraries for use with FreeBASIC, Please include example of use to help ensure they are tested and usable.
D.J.Peters
Posts: 8588
Joined: May 28, 2005 3:28
Contact:

Re: wxWidgets 2.8.12 FreeBASIC C wrapper

Post by D.J.Peters »

I added *.rc with manifest to my wx-c 2.8.12 wrapper for Win32 and x86 Linux (wxTimer,wxGLCanvas,wxSound,...) and it's fbc 0.99.0 compatible now.

See first post for the download.

Joshy
VANYA
Posts: 1839
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: wxWidgets 2.8.12 FreeBASIC C wrapper

Post by VANYA »

Hi Joshy!

demo01_wx-c.bas crash.
D.J.Peters
Posts: 8588
Joined: May 28, 2005 3:28
Contact:

Re: wxWidgets 2.8.12 FreeBASIC C wrapper

Post by D.J.Peters »

Hello VANYA
sorry I uploaded the wrong archive *.7z (with wrong panel constructor)
please test the wx-c_2.8.12.zip file.

Joshy
VANYA
Posts: 1839
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: wxWidgets 2.8.12 FreeBASIC C wrapper

Post by VANYA »

Yes, now example work fine. Thanks
St_W
Posts: 1628
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: wxWidgets 2.8.12 FreeBASIC C wrapper

Post by St_W »

This package seems to contain a modified version of the original wx-c library contained in the wx.NET project. Is the source code of this modified wx-c library available or will it be?

Using a closed source wrapper for an open source library looks kinda strange and wrong in my eyes.
D.J.Peters
Posts: 8588
Joined: May 28, 2005 3:28
Contact:

Re: wxWidgets 2.8.12 FreeBASIC C wrapper

Post by D.J.Peters »

I added an optional new event handler the old isn't replaced and useabl too.
eventhandler.cxx

Code: Select all

//-----------------------------------------------------------------------------
// wx-c - evthandler.cxx
//
// new version Written by d.j.peters (aka. joshy)
// Licensed under the wxWidgets license, see LICENSE.txt for details.
//-----------------------------------------------------------------------------
#include <wx/wx.h>
#include "local_events.h"

typedef void (CALLBACK* EventListener)(wxEvent* event, int iListener);

typedef void (CALLBACK* Virtual_EventHandler)(wxEvent* event);

//-----------------------------------------------------------------------------
struct wxProxyData : public wxObject
{
	int iListener;
};

class wxEvtProxy : public wxEvtHandler
{
public:
	void ForwardEvent(wxEvent& event)
	{
		wxProxyData* data = (wxProxyData*)event.m_callbackUserData;

		EventListener el = (EventListener)GetClientData();
		el(&event, data->iListener);
	}
};

WXNET_EXPORT(void) wxEvtHandler_proxy(wxEvtHandler* self, EventListener listener){
	self->SetClientData((void*)listener);
}

WXNET_EXPORT(void) wxEvtHandler_Connect(wxEvtHandler* self, int evtType, int id, int lastId, int iListener) {
	wxProxyData* data = new wxProxyData;
	data->iListener = iListener;
	self->Connect(id, lastId, evtType, (wxObjectEventFunction)&wxEvtProxy::ForwardEvent, data);
}

//-----------------------------------------------------------------------------
// new wxEvtHandler
struct EventHandlerUserData
{
  Virtual_EventHandler veh;
  void*                cd; // ClientData
};

class wxVirtualEventHandler : public wxEvtHandler
{
  public:
    void ObjectEventFunction(wxEvent& event) {
      EventHandlerUserData* ehus = (EventHandlerUserData*)GetClientData();
      Virtual_EventHandler veh = (Virtual_EventHandler)ehus->veh;
      veh(&event);
  }
};

void SetVirtualEventHandler(wxEvtHandler* self, Virtual_EventHandler veh) {
  EventHandlerUserData* ehud = (EventHandlerUserData*)self->GetClientData();
  if (ehud==NULL) ehud = new EventHandlerUserData;
  ehud->veh=veh;
  self->SetClientData((void*)ehud);
}

void SetClientData(wxEvtHandler* self, void* cd) {
  EventHandlerUserData* ehud = (EventHandlerUserData*)self->GetClientData();
  if (ehud==NULL) ehud = new EventHandlerUserData;
  ehud->cd=cd;
  self->SetClientData((void*)ehud);
}

void* GetClientData(wxEvtHandler* self) {
  EventHandlerUserData* ehud = (EventHandlerUserData*)self->GetClientData();
  if (ehud==NULL) return NULL;
  return ehud->cd;
}

// wx-c wxEvtHandler
WXNET_EXPORT(void) wxEvtHandler_AddPendingEvent(wxEvtHandler* self, wxEvent* event){
  self->AddPendingEvent(*event);
}

WXNET_EXPORT(void) wxEvtHandler_ConnectByType(wxEvtHandler* self, wxEventType eventType, Virtual_EventHandler veh, wxObject* userData, wxEvtHandler* eventSink){
  if (self==NULL) return;
  SetVirtualEventHandler(self,veh);
  self->Connect(eventType, (wxObjectEventFunction)&wxVirtualEventHandler::ObjectEventFunction, userData, eventSink);
}
WXNET_EXPORT(void) wxEvtHandler_ConnectById(wxEvtHandler* self, int id,wxEventType eventType, Virtual_EventHandler veh, wxObject* userData, wxEvtHandler* eventSink){
  if (self==NULL) return;
  SetVirtualEventHandler(self,veh);
  self->Connect(id, eventType, (wxObjectEventFunction)&wxVirtualEventHandler::ObjectEventFunction, userData, eventSink);
}
WXNET_EXPORT(void) wxEvtHandler_ConnectByIds(wxEvtHandler* self, int id, int lastId, wxEventType eventType, Virtual_EventHandler veh, wxObject* userData, wxEvtHandler* eventSink){
  if (self==NULL) return;
  SetVirtualEventHandler(self,veh);
  self->Connect(id, lastId, eventType, (wxObjectEventFunction)&wxVirtualEventHandler::ObjectEventFunction, userData, eventSink);
}

WXNET_EXPORT(void*) wxEvtHandler_GetClientData(wxEvtHandler* self){
  if (self==NULL) return NULL;
  return GetClientData(self);
}

WXNET_EXPORT(wxClientData*) wxEvtHandler_GetClientObject(wxEvtHandler* self) {
  if (self==NULL) return NULL;
  return self->GetClientObject();
}

WXNET_EXPORT(bool) wxEvtHandler_GetEvtHandlerEnabled(wxEvtHandler* self) {
  if (self==NULL) return false;
  return self->GetEvtHandlerEnabled();
}

WXNET_EXPORT(wxEvtHandler*) wxEvtHandler_GetNextHandler(wxEvtHandler* self) {
  if (self==NULL) return NULL;
  return self->GetNextHandler();
}

WXNET_EXPORT(wxEvtHandler*) wxEvtHandler_GetPeviousHandler(wxEvtHandler* self) {
  if (self==NULL) return NULL;
  return self->GetPreviousHandler();
}

WXNET_EXPORT(bool) wxEvtHandler_ProcessEvent(wxEvtHandler* self, wxEvent* event){
    return self->ProcessEvent(*event);
}

WXNET_EXPORT(void) wxEvtHandler_SetClientData(wxEvtHandler* self,void* cd){
  if (self==NULL) return;
  SetClientData(self,cd);
}

WXNET_EXPORT(void) wxEvtHandler_SetClientObject(wxEvtHandler* self,wxClientData* data){
  if (self==NULL) return;
  self->SetClientObject(data);
}

WXNET_EXPORT(void) wxEvtHandler_SetEvtHandlerEnabled(wxEvtHandler* self, bool enabled){
  if (self==NULL) return;
  self->SetEvtHandlerEnabled(enabled);
}

WXNET_EXPORT(void) wxEvtHandler_SetNextHandler(wxEvtHandler* self, wxEvtHandler* handler){
  if (self==NULL) return;
  self->SetNextHandler(handler);
}

WXNET_EXPORT(void) wxEvtHandler_SetPreviousHandler(wxEvtHandler* self, wxEvtHandler* handler){
  if (self==NULL) return;
  self->SetPreviousHandler(handler);
}
and added wxTimer, wxGLCanvas and wxSound
timer.cxx

Code: Select all

//-----------------------------------------------------------------------------
// wx-c - timer.cxx
//
// Written by d.j.peters (aka. DJLinux, joshy)
// Licensed under the wxWidgets license, see LICENSE.txt for details.
//-----------------------------------------------------------------------------

#include <wx/wx.h>
#include "local_events.h"

//-----------------------------------------------------------------------------

// CALLBACK MAY BE ALREADY DEFINED
#ifndef CALLBACK
# if defined(_WINDOWS)
#  define CALLBACK __stdcall
# else
#  define CALLBACK
# endif
#endif


//-----------------------------------------------------------------------------

WXNET_EXPORT(wxTimer*) wxTimer_ctor(wxEvtHandler *owner, int id){
  return new wxTimer(owner,id);
}
WXNET_EXPORT(void) wxTimer_dtor(wxTimer* self){
  if (self!=NULL)
    delete self;
}
WXNET_EXPORT(bool) wxTimer_Start(wxTimer* self, int milliseconds, bool oneShot){
  if (self!=NULL)
    return self->Start(milliseconds,oneShot);
  else
    return false;
}
WXNET_EXPORT(void) wxTimer_Stop(wxTimer* self){
  if (self!=NULL)
    self->Stop();
}
WXNET_EXPORT(int) wxTimer_GetInterval(wxTimer* self){
  if (self!=NULL)
    return self->GetInterval();
  else
    return 0;
}
WXNET_EXPORT(bool) wxTimer_IsOneShot(wxTimer* self) {
  if (self!=NULL)
    return self->IsOneShot();
  else
    return false;
}
WXNET_EXPORT(bool) wxTimer_IsRunning(wxTimer* self) {
  if (self!=NULL)
    return self->IsRunning();
  else
    return false;
}
glcanvas.cxx

Code: Select all

//-----------------------------------------------------------------------------
// wx-c - glcanvas.cxx
//
//
// Written by D.J.Peters (aka. DJLinux,Joshy)
// (C) 2011 by shiny3d.
// Licensed under the wxWidgets license, see LICENSE.txt for details.
//
//-----------------------------------------------------------------------------


#include <wx/wx.h>
#include <wx/glcanvas.h>
#include "local_events.h"

#if !wxUSE_GLCANVAS
    #error "OpenGL required: set wxUSE_GLCANVAS to 1 and rebuild the library"
#endif
//-----------------------------------------------------------------------------

// CALLBACK MAY BE ALREADY DEFINED
#ifndef CALLBACK
# if defined(_WINDOWS)
#  define CALLBACK __stdcall
# else
#  define CALLBACK
# endif
#endif


//-----------------------------------------------------------------------------

WXNET_EXPORT(wxGLCanvas*) wxGLCanvas_ctor(wxWindow* parent,
                          wxWindowID id,
                          int x, int y, int w, int h,
                          long style,
                          int* attribList,
                          const wxString* nameArg){
  wxString name;
	if (nameArg == NULL)
		name = wxPanelNameStr;
  else
    name=*nameArg;

  return new wxGLCanvas(parent, id, wxPoint(x,y), wxSize(w,h), style, name, attribList, wxNullPalette);
}
WXNET_EXPORT(void) wxGLCanvas_dtor(wxGLCanvas* self) {
  if (self!=NULL)
    delete self;
}

WXNET_EXPORT(wxGLContext*) wxGLCanvas_GetContext(wxGLCanvas* self) {
  if (self!=NULL)
    return self->GetContext();
  else
    return NULL;
}

WXNET_EXPORT(void) wxGLCanvas_SetCurent(wxGLCanvas* self) {
  if (self!=NULL)
    self->SetCurrent();
}

WXNET_EXPORT(void) wxGLCanvas_SwapBuffers(wxGLCanvas* self) {
  if (self!=NULL)
    self->SwapBuffers();
}
sound.cxx

Code: Select all

#ifndef __sound_cxx__
#define __sound_cxx__
//-----------------------------------------------------------------------------
// wx-c - sound.cxx
//
//
// Written by d.j.peters (aka. DJLinux, joshy)
// Licensed under the wxWidgets license, see LICENSE.txt for details.
//-----------------------------------------------------------------------------


#include <wx/wx.h>
#include <wx/sound.h>

#include "local_events.h"

#if !wxUSE_SOUND
    #error "required: set wxUSE_SOUND 1 and rebuild the library"
#endif
//-----------------------------------------------------------------------------

// CALLBACK MAY BE ALREADY DEFINED
#ifndef CALLBACK
# if defined(_WINDOWS)
#  define CALLBACK __stdcall
# else
#  define CALLBACK
# endif
#endif


WXNET_EXPORT(wxSound*) wxSound_ctor(void) {
  return new wxSound();
}

WXNET_EXPORT(void) wxSound_dtor(const wxSound* self) {
  if (self) delete self;
}

WXNET_EXPORT(bool) wxSound_Create(wxSound* self,wxString& fileName, bool isResource) {
  if (self==NULL) return false;
  return self->Create(fileName, isResource);
}

WXNET_EXPORT(bool) wxSound_IsOk(wxSound* self) {
  if (self==NULL) return false;
  return self->IsOk();
}
// not implemented on Windows
WXNET_EXPORT(bool) wxSound_IsPlaying(wxSound* self) {
  if (self==NULL) return false;
#ifdef __WXMSW__
  return false;
#else
  return self->IsPlaying();
#endif
}

WXNET_EXPORT(bool) wxSound_Play(wxSound* self, unsigned flag) {
  if (self==NULL) return false;
  return self->Play(flag);
}

WXNET_EXPORT(void) wxSound_Stop(wxSound* self) {
  if (self!=NULL) self->Stop();
}

#endif // __sound_cxx__
Last edited by D.J.Peters on Aug 16, 2013 13:35, edited 1 time in total.
St_W
Posts: 1628
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: wxWidgets 2.8.12 FreeBASIC C wrapper

Post by St_W »

Thank you for providing the sources for your library.

I've tried to compile it using the included CodeBlocks project file and GCC 4.7.2 in an MinGW Environment, but ran into a memory issue:

Code: Select all

-------------- Build: WinDynamicRelease in wx-c (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -shared  -Wl,--out-implib=.\lib\win32\libwx-c-0-9-0-2.a -Wl,--dll -LC:\Users\swurzinx\Downloads\wx\wxWidgets-2.8.12\lib\gcc_lib obj\WinDynamicRelease\accel.o obj\WinDynamicRelease\activateevent.o obj\WinDynamicRelease\app.o obj\WinDynamicRelease\archive.o obj\WinDynamicRelease\artprovider.o obj\WinDynamicRelease\bitmap.o obj\WinDynamicRelease\bitmapbutton.o obj\WinDynamicRelease\boxsizer.o obj\WinDynamicRelease\brush.o obj\WinDynamicRelease\button.o obj\WinDynamicRelease\calendarctrl.o obj\WinDynamicRelease\caret.o obj\WinDynamicRelease\checkbox.o obj\WinDynamicRelease\childfocusevent.o obj\WinDynamicRelease\choice.o obj\WinDynamicRelease\choicedialog.o obj\WinDynamicRelease\clientdata.o obj\WinDynamicRelease\clipboard.o obj\WinDynamicRelease\closeevent.o obj\WinDynamicRelease\colour.o obj\WinDynamicRelease\colourdialog.o obj\WinDynamicRelease\combobox.o obj\WinDynamicRelease\comboctrl.o obj\WinDynamicRelease\commandevent.o obj\WinDynamicRelease\config.o obj\WinDynamicRelease\contextmenuevent.o obj\WinDynamicRelease\control.o obj\WinDynamicRelease\controlwithitems.o obj\WinDynamicRelease\cursor.o obj\WinDynamicRelease\dataformat.o obj\WinDynamicRelease\dataobject.o obj\WinDynamicRelease\dc.o obj\WinDynamicRelease\dialog.o obj\WinDynamicRelease\dirdialog.o obj\WinDynamicRelease\display.o obj\WinDynamicRelease\displaychangedevent.o obj\WinDynamicRelease\dnd.o obj\WinDynamicRelease\document.o obj\WinDynamicRelease\eraseevent.o obj\WinDynamicRelease\event.o obj\WinDynamicRelease\evthandler.o obj\WinDynamicRelease\filedialog.o obj\WinDynamicRelease\filesys.o obj\WinDynamicRelease\findreplacedialog.o obj\WinDynamicRelease\flexgridsizer.o obj\WinDynamicRelease\focusevent.o obj\WinDynamicRelease\font.o obj\WinDynamicRelease\fontdialog.o obj\WinDynamicRelease\fontmisc.o obj\WinDynamicRelease\frame.o obj\WinDynamicRelease\gauge.o obj\WinDynamicRelease\gdicmn.o obj\WinDynamicRelease\gdiobject.o obj\WinDynamicRelease\glcanvas.o obj\WinDynamicRelease\global.o obj\WinDynamicRelease\grid.o obj\WinDynamicRelease\gridbagsizer.o obj\WinDynamicRelease\gridctrl.o obj\WinDynamicRelease\gridsizer.o obj\WinDynamicRelease\helpdata.o obj\WinDynamicRelease\helpevent.o obj\WinDynamicRelease\html.o obj\WinDynamicRelease\htmlhelpctrl.o obj\WinDynamicRelease\htmllbox.o obj\WinDynamicRelease\icon.o obj\WinDynamicRelease\iconizeevent.o obj\WinDynamicRelease\idleevent.o obj\WinDynamicRelease\image.o obj\WinDynamicRelease\imagelist.o obj\WinDynamicRelease\imghandler.o obj\WinDynamicRelease\initdialogevent.o obj\WinDynamicRelease\keyevent.o obj\WinDynamicRelease\laywin.o obj\WinDynamicRelease\listbook.o obj\WinDynamicRelease\listbox.o obj\WinDynamicRelease\listctrl.o obj\WinDynamicRelease\locale.o obj\WinDynamicRelease\log.o obj\WinDynamicRelease\maximizeevent.o obj\WinDynamicRelease\mdi.o obj\WinDynamicRelease\memorydc.o obj\WinDynamicRelease\menu.o obj\WinDynamicRelease\menubar.o obj\WinDynamicRelease\menuitem.o obj\WinDynamicRelease\messagedialog.o obj\WinDynamicRelease\miniframe.o obj\WinDynamicRelease\mousecapturechangedevent.o obj\WinDynamicRelease\mouseevent.o obj\WinDynamicRelease\moveevent.o obj\WinDynamicRelease\navigationkeyevent.o obj\WinDynamicRelease\ncpaintevent.o obj\WinDynamicRelease\notebook.o obj\WinDynamicRelease\notebooksizer.o obj\WinDynamicRelease\object.o obj\WinDynamicRelease\paintevent.o obj\WinDynamicRelease\palette.o obj\WinDynamicRelease\palettechangedevent.o obj\WinDynamicRelease\panel.o obj\WinDynamicRelease\pen.o obj\WinDynamicRelease\picker.o obj\WinDynamicRelease\printdata.o obj\WinDynamicRelease\printdialog.o obj\WinDynamicRelease\printer.o obj\WinDynamicRelease\printpreview.o obj\WinDynamicRelease\progdlg.o obj\WinDynamicRelease\querynewpaletteevent.o obj\WinDynamicRelease\radiobox.o obj\WinDynamicRelease\radiobutton.o obj\WinDynamicRelease\reflectconfig.o obj\WinDynamicRelease\region.o obj\WinDynamicRelease\sashwindow.o obj\WinDynamicRelease\scrollbar.o obj\WinDynamicRelease\scrolledwindow.o obj\WinDynamicRelease\setcursorevent.o obj\WinDynamicRelease\showevent.o obj\WinDynamicRelease\sizeevent.o obj\WinDynamicRelease\sizer.o obj\WinDynamicRelease\sizeritem.o obj\WinDynamicRelease\slider.o obj\WinDynamicRelease\sound.o obj\WinDynamicRelease\spinbutton.o obj\WinDynamicRelease\spinctrl.o obj\WinDynamicRelease\splashscreen.o obj\WinDynamicRelease\splitterwindow.o obj\WinDynamicRelease\staticbitmap.o obj\WinDynamicRelease\staticbox.o obj\WinDynamicRelease\staticboxsizer.o obj\WinDynamicRelease\staticline.o obj\WinDynamicRelease\statictext.o obj\WinDynamicRelease\statusbar.o obj\WinDynamicRelease\styledtextctrl.o obj\WinDynamicRelease\syscolourchangedevent.o obj\WinDynamicRelease\systemsettings.o obj\WinDynamicRelease\tabctrl.o obj\WinDynamicRelease\taskbaricon.o obj\WinDynamicRelease\textattr.o obj\WinDynamicRelease\textctrl.o obj\WinDynamicRelease\textdialog.o obj\WinDynamicRelease\timer.o obj\WinDynamicRelease\tipdialog.o obj\WinDynamicRelease\tipwindow.o obj\WinDynamicRelease\togglebutton.o obj\WinDynamicRelease\toolbar.o obj\WinDynamicRelease\tooltip.o obj\WinDynamicRelease\treectrl.o obj\WinDynamicRelease\updateuievent.o obj\WinDynamicRelease\validator.o obj\WinDynamicRelease\vlbox.o obj\WinDynamicRelease\vscroll.o obj\WinDynamicRelease\window.o obj\WinDynamicRelease\windowcreateevent.o obj\WinDynamicRelease\windowdestroyevent.o obj\WinDynamicRelease\wizard.o obj\WinDynamicRelease\wizardpagesimple.o obj\WinDynamicRelease\wxdatetime.o obj\WinDynamicRelease\wxstring.o obj\WinDynamicRelease\xmlresource.o  -o .\lib\win32\wx-c-0-9-0-2.dll -s  -luser32 -lwxmsw28u -lwxmsw28u_gl -lwxmsw28u_stc -lwxjpeg -lwxtiff -lwxzlib -lwxpng -lwxexpat -lwinspool -lwinmm -lkernel32 -lgdi32 -lshell32 -lcomdlg32 -ladvapi32 -lole32 -luuid -loleaut32 -lcomctl32 -lrpcrt4 -lwsock32 -lws2_32 -lopengl32
obj\WinDynamicRelease\listbook.o: could not read symbols: Memory exhausted
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (12 minute(s), 28 second(s))
0 error(s), 0 warning(s) (12 minute(s), 28 second(s))
Which compiler (and Version) did you use?

I've also tried using MSVC (9.0) and besides Microsoft's Compiler compiled way faster than GCC it also produces smaller object files and did not ran into memory problems. Anyway, I'd like to be able to compile it using GCC.
D.J.Peters
Posts: 8588
Joined: May 28, 2005 3:28
Contact:

Re: wxWidgets 2.8.12 FreeBASIC C wrapper

Post by D.J.Peters »

I used MinGW 4.4.1, 4.6.1, 4.6.2 and 4.7.2 with success in the past.

Your wxWidgets libs are compiled with the same version you build the wx-c wrapper ?

Joshy
Last edited by D.J.Peters on Aug 16, 2013 13:38, edited 1 time in total.
St_W
Posts: 1628
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: wxWidgets 2.8.12 FreeBASIC C wrapper

Post by St_W »

I've built everything using MinGW 4.7.2 (the only version I've installed on this system). I've changed the following build options:

in build\msw\config.gcc:
UNICODE ?= 1
BUILD ?= release
MONOLITHIC ?= 1
USE_OPENGL ?= 1

in include\msw\setup.h:
#define wxUSE_GLCANVAS 1

... and built it using the makefile.
St_W
Posts: 1628
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: wxWidgets 2.8.12 FreeBASIC C wrapper

Post by St_W »

Btw: If one removes the "WXMAKINGDLL" #define it compiles and links fine using GCC 4.7.2 (and probably previous versions).

But I doubt more and more that the wx-c source you released does match the source used for building the wx-c library included in your binary package.

Although the library seems to be built using GCC, the compile options in the CodeBlocks project file do not seem to be correct for that build. For example: your library does not depend on libgcc or libstdc++, but binaries created with MinGW generally do (except linking the static versions of that libs, but that is not done when using the CodeBlocks compile options).

Furthermore, some functions, which are present in your binary, do not exist in your source. For example: wxPen_dtor and wxListBox_Create

Could You please check whether you have uploaded the correct and current version? Thank You.
D.J.Peters
Posts: 8588
Joined: May 28, 2005 3:28
Contact:

Re: wxWidgets 2.8.12 FreeBASIC C wrapper

Post by D.J.Peters »

The source code with my code::blocks project I posted is the only one working wx-c source code on my HD.

I use in CodeBlocks the global linker settings for all my C++ projects
-static-libgcc
-static-libstdc++

By the way you can use the original wx-net wrapper source code an add glcanvas.cxx timer.cxx sound.cxx eventhandler.cxx if you like.
I have done it on my ARM devices for wxFBE with success.

Joshy
St_W
Posts: 1628
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: wxWidgets 2.8.12 FreeBASIC C wrapper

Post by St_W »

Oh, ok, that explains the dependency issue.

But I'm still wondering about the code differences. For example:

wxListBox_Create from your wx-c source takes a wxPoint* and a wxSize*, as do the official wx-c sources (both 0.9.0.3 CVS and 0.9.0.2 release). But your FB-headers and your compiled binary take x, y, w and h parameters instead.

wxPen_dtor is missing in the official wx-c sources and in your wx-c source. But your FB-headers and your compiled binary contain this method.

These are just two examples I've detected while testing. There may be more incompatibilities.

Btw wxFBE uses the wxPoint* and wxSize* variant of wxListBox_Create - thus it is incompatible with your FB headers and your binary from the current "wx-c_2.8.12.zip".
D.J.Peters
Posts: 8588
Joined: May 28, 2005 3:28
Contact:

Re: wxWidgets 2.8.12 FreeBASIC C wrapper

Post by D.J.Peters »

Looks like i losing the source code of my old wx-c wrapper.

The archive you donloaded from me is the original wx-net wrapper plus my improved version of wxEeventHandler and the new classes wxGLCanvas, wxTimer and wxSound.

Sorry for the trouble.

Joshy
mongnewer
Posts: 3
Joined: Apr 14, 2022 17:41

Re: wxWidgets 2.8.12 FreeBASIC C wrapper

Post by mongnewer »

Coding wx-c and its bi is a lot of time consuming great work. I like it and learnt a lot, and tried to code with it for XRC sample from wxWidgets online manual, and get it works on LINUX mint-21.3 virginia.

Code: Select all

Function wxXRCproc WXCALL () as wxBool
	self = wxXmlResource_ctor(XRC_USE_LOCALE)
	wxXmlResource_InitAllHandlers(self)
	wxXmlResource_Load(self, wxString_ctorUTF8("wxTest.xrc"))
	dlg = wxXmlResource_LoadDialog(self, frame, wxString_ctorUTF8("SimpleDialog"))
	wxDialog_ShowModal(dlg)
	Return WX_FALSE
End Function
Sample freebasic source code.
https://sourceforge.net/projects/freebasic-wx-c-xrc/

It was tested on virtual machine running Mint-21.3.
It works but it is too slow ,against C compiled code, on XRC dialog object initial load and show.
Post Reply