Integrated Application Platform › Forums › General › wxWidgets (again) › Re: Re: wxWidgets (again)
Hi Andrew,
point taken. (Allocation) So let’s start again from this wxWidget class. I’ll skip the C wrapper.
//wxWidgets C++
class wxStringMap
{
public: wxStringMap();
virtual ~wxStringMap();
bool HasValueFor(const wxString& key) const;
const wxString& ValueFor(const wxString& key) const;
};
Our Suneido class could look like :
wxStringMap = class
{
isDisposable: true;
classptr: 0;
New()
{
,classptr = dll long* wxsuneido:wxStringMap_CTor()
}
//NON Thread save, we need a _mutex_lock_ here
Dispose()
{
if (.isDisposable)
{
IsDisposable = false;
// Call class destructor
dll void wxsuneido:wxStringMap_DTor( .classptr )
}
.isDisposible = true;
}
HasValueFor( key )
{
//autogenerated ?? Assert( key.isString() ) ]
return dll bool wxsuneido:wxStringMap_HasValueFor( classptr, key.towxString())
}
/// etc.
}
Now you see that I have used Dispose (DOTNET style) instead of Destroy.
Slightly Off topic
Maybe we can add a small convenience (syntax sugar) feature to Suneido :
alias Dispose Dwstroy;
//or
alias long* wxObjPtr;
For me this is bread and butter.
// D code;
class ArrayList( T ) { }
alias ArrayList!( int ) IntegerList;
IntegerList il = new IntegerList();
I know that you like that!!
OKay . For all wxWidgets constants, enums, and global variables we can create Suneido code. Right now.
Same is also valid for the C Function wrapper DLL .F.I.
extern “C” __declspec(dllexport) bool wxStringMap_HasValueFor(wxStringMap* self, const char* key)
What needs some attention is the Suneido class generation..
Open Questions are event-handling,…. Suneido’s layout manager vs. wxWidgets Layout manager. .keeping the current Suneido “Business objects” as far as possible in sync with wxwidgets. …..
Quit some stuff. I would prefer to discuss details via email (if you like ) makes it a bit easier for me.
email starts with amckinlay ?
Bjoern
ps. till next Sunday I have to work on a commercial project, so icase that my feedback takes awhile don’t worry.