move wxPython to new trunk
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
ec873c943d
commit
a4027e7487
1557 changed files with 0 additions and 1932719 deletions
|
|
@ -1,158 +0,0 @@
|
|||
SWIG 1.3.x Patches
|
||||
==================
|
||||
|
||||
This directory holds a set of patches for the CVS version of SWIG that
|
||||
are required if you wish to use SWIG for wxPython development, or for
|
||||
building your own extension modules that need to interface with
|
||||
wxPython. These have been submitted to SWIG's SourceForge patch
|
||||
tracker, so hopefully they will get incorporated into the main SWIG
|
||||
source tree soon.
|
||||
|
||||
wxPython currently uses the 1.3.29 version of SWIG, which you can get
|
||||
from https://sourceforge.net/projects/swig/, plus the patch(es) in
|
||||
this directory. Download the SWIG sources, apply the patch(es) here
|
||||
and then build as normal. I have also have made available a tarball
|
||||
containing the patched SWIG sources, plus a win32 binary, located
|
||||
here:
|
||||
|
||||
http://wxpython.wxcommunity.com/tools/
|
||||
|
||||
If you want to use the patched version of SWIG and still have the
|
||||
stock version available for other projects, then you can configure the
|
||||
patched version to use a different --prefix and then specify that
|
||||
executable when running setup.py, like this:
|
||||
|
||||
python setup.py SWIG=/path/to/my/swig [other params]
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
swig-1.3.29.patch
|
||||
|
||||
SWIG changed how the import statements are output to the proxy
|
||||
file, but this also caused the order to change (they all moved to
|
||||
the very top of the file) so this broke the module docstring, as
|
||||
well as some behavior that Chandler development is depending upon,
|
||||
so this patch changes back to how it was done in prior releases.
|
||||
|
||||
Changed the exception message used for TypeErrors to make a little
|
||||
more sense.
|
||||
|
||||
Added support for dropping the leading wx from wxNames using
|
||||
%rename("%(wxpy)s") "";
|
||||
|
||||
Don't set a module attribute for the *_swigregister functions,
|
||||
just call the one in the extension module directly.
|
||||
|
||||
Fixes to allow compiling with Python 2.5 headers.
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
swig-1.3.27.patch
|
||||
|
||||
SWIG changed slightly how the runtime type_info data is structured
|
||||
in order to optimize load time and runtime access. wxPython
|
||||
uncovered a bug in the implementation, so this patch includes the
|
||||
fix that was checked in to CVS for 1.3.28.
|
||||
|
||||
SWIG changed how the import statements are output to the proxy
|
||||
file, but this also caused the order to change (they all moved to
|
||||
the very top of the file) so this broke the module docstring, as
|
||||
well as some behavior that Chandler development is depending upon,
|
||||
so this patch changes back to how it was done in prior releases.
|
||||
|
||||
Bug fix for SWIG's definition of the %makedefault macro.
|
||||
|
||||
Fixes to allow compiling with Python 2.5 headers.
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
swig-1.3.24.patch (now obsolete)
|
||||
|
||||
A bug was introduced in SWIG 1.3.23 and remains in 1.3.24 that
|
||||
causes compilation problems with wxPython (copies are being made
|
||||
of objects that don't have a copy constructor.) This patch fixes
|
||||
the code generator to use a reference to the object instead of
|
||||
making a copy.
|
||||
|
||||
Part of my autodoc patch was disabled because a unit-test failed.
|
||||
It turns out that the failure was due to a name clash in the unit
|
||||
test itself, so I re-enabled that section of code in this patch.
|
||||
|
||||
Don't generate the autodocs string for a class if it has a
|
||||
docstring attribute.
|
||||
|
||||
Some typos fixed, etc.
|
||||
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
This patch was added to SWIG's CVS on 10/2/2004 and a modified version
|
||||
of it is in 1.3.23 and 1.3.24.
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
swig.python-2.patch
|
||||
|
||||
Adds the following features to the Python Module in SWIG. See the
|
||||
updated docs in the patch for more details.
|
||||
|
||||
%feature("autodoc")
|
||||
%feature("docstring")
|
||||
%feature("pythonprepend")
|
||||
%feature("pythonappend")
|
||||
|
||||
%module(docstring="string")
|
||||
%module(package="string")
|
||||
|
||||
https://sourceforge.net/tracker/index.php?func=detail&aid=1023309&group_id=1645&atid=301645
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
This patch was applied to SWIG's CVS on 07/12/2004 and is in the
|
||||
1.3.22 release.
|
||||
------------------------------------------------------------------------
|
||||
|
||||
swig.xmlout.patch Fixes a couple problems in the XML output
|
||||
of SWIG: an extra "/>" was removed and
|
||||
newlines in attribute values were changed
|
||||
to the #10; entity reference so they will
|
||||
be preserved by parsers.
|
||||
|
||||
Also, added options for dumping or
|
||||
writing to a file the XML of the parse
|
||||
tree *after* other language modules have
|
||||
been run (previously you could only do
|
||||
the XML output *instead of* a regular
|
||||
language module.)
|
||||
See SF Patch #864689
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
These patches have already been checked in to SWIG's CVS and are in
|
||||
the 1.3.20 release.
|
||||
------------------------------------------------------------------------
|
||||
|
||||
swig.SplitLines.patch Adds a new SplitLines function to the DOH
|
||||
library. See SF Patch #829317.
|
||||
*Checked in 10/31/2003*
|
||||
|
||||
swig.xml.patch Adds an option that drastically reduces
|
||||
the size of the XML output of SWIG, which
|
||||
increases the performance of the
|
||||
build_renamers script used in the wxPython
|
||||
build. See SF Patch #829319.
|
||||
*Checked in 10/31/2003*
|
||||
|
||||
swig.python.patch Lots of changes for SWIG's Python module,
|
||||
especially in how the proxy code is
|
||||
generated. See swig.python.patch.txt for
|
||||
more details, also SF Patch #829325.
|
||||
*Checked in 10/31/2003*
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
|
@ -1,201 +0,0 @@
|
|||
? .configure
|
||||
? .emacs.desktop
|
||||
? .test
|
||||
? mytests
|
||||
? switch_cvs.py
|
||||
? Source/Modules/mystuff
|
||||
Index: Doc/Manual/Python.html
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Doc/Manual/Python.html,v
|
||||
retrieving revision 1.20
|
||||
diff -u -4 -r1.20 Python.html
|
||||
--- Doc/Manual/Python.html 25 Oct 2004 20:42:08 -0000 1.20
|
||||
+++ Doc/Manual/Python.html 15 Apr 2005 23:11:25 -0000
|
||||
@@ -3869,10 +3869,10 @@
|
||||
|
||||
<H2><a name="Python_nn65"></a>26.10 Docstring Features</H2>
|
||||
|
||||
|
||||
-Usign docstrings in Python code is becoming more and more important
|
||||
-ans more tools are coming on the scene that take advantage of them,
|
||||
+Using docstrings in Python code is becoming more and more important
|
||||
+and more tools are coming on the scene that take advantage of them,
|
||||
everything from full-blown documentaiton generators to class browsers
|
||||
and popup call-tips in Python-aware IDEs. Given the way that SWIG
|
||||
generates the proxy code by default, your users will normally get
|
||||
something like <tt>"function_name(*args)"</tt> in the popup calltip of
|
||||
Index: Lib/python/pyrun.swg
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Lib/python/pyrun.swg,v
|
||||
retrieving revision 1.53
|
||||
diff -u -4 -r1.53 pyrun.swg
|
||||
--- Lib/python/pyrun.swg 11 Dec 2004 23:38:44 -0000 1.53
|
||||
+++ Lib/python/pyrun.swg 15 Apr 2005 23:11:25 -0000
|
||||
@@ -455,9 +455,10 @@
|
||||
} else {
|
||||
PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
|
||||
type, otype);
|
||||
}
|
||||
- Py_DECREF(str);
|
||||
+ if (str)
|
||||
+ Py_DECREF(str);
|
||||
return;
|
||||
}
|
||||
}
|
||||
PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
|
||||
Index: Source/Modules/python.cxx
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Source/Modules/python.cxx,v
|
||||
retrieving revision 1.81
|
||||
diff -u -4 -r1.81 python.cxx
|
||||
--- Source/Modules/python.cxx 13 Dec 2004 22:12:47 -0000 1.81
|
||||
+++ Source/Modules/python.cxx 15 Apr 2005 23:11:26 -0000
|
||||
@@ -74,9 +74,9 @@
|
||||
-modern - Use modern python features only, without compatibility code\n\
|
||||
-apply - Use apply() in proxy classes\n\
|
||||
-new_vwm - New value wrapper mode, use only when everything else fails \n\
|
||||
-new_repr - Use more informative version of __repr__ in proxy classes\n\
|
||||
- -old_repr - Use shorter ald old version of __repr__ in proxy classes\n\
|
||||
+ -old_repr - Use shorter and old version of __repr__ in proxy classes\n\
|
||||
-noexcept - No automatic exception handling\n\
|
||||
-noh - Don't generate the output header file\n\
|
||||
-noproxy - Don't generate proxy classes \n\n";
|
||||
|
||||
@@ -749,10 +749,15 @@
|
||||
|
||||
// Do the param type too?
|
||||
if (showTypes) {
|
||||
type = SwigType_base(type);
|
||||
- lookup = Swig_symbol_clookup(type, 0);
|
||||
- if (lookup) type = Getattr(lookup, "sym:name");
|
||||
+ SwigType* qt = SwigType_typedef_resolve_all(type);
|
||||
+ if (SwigType_isenum(qt))
|
||||
+ type = NewString("int");
|
||||
+ else {
|
||||
+ lookup = Swig_symbol_clookup(type, 0);
|
||||
+ if (lookup) type = Getattr(lookup, "sym:name");
|
||||
+ }
|
||||
Printf(doc, "%s ", type);
|
||||
}
|
||||
|
||||
if (name) {
|
||||
@@ -853,13 +858,19 @@
|
||||
}
|
||||
|
||||
switch ( ad_type ) {
|
||||
case AUTODOC_CLASS:
|
||||
- if (CPlusPlus) {
|
||||
- Printf(doc, "Proxy of C++ %s class", class_name);
|
||||
- } else {
|
||||
- Printf(doc, "Proxy of C %s struct", class_name);
|
||||
- }
|
||||
+ {
|
||||
+ // Only do the autodoc if there isn't a docstring for the class
|
||||
+ String* str = Getattr(n, "feature:docstring");
|
||||
+ if (str == NULL || Len(str) == 0) {
|
||||
+ if (CPlusPlus) {
|
||||
+ Printf(doc, "Proxy of C++ %s class", class_name);
|
||||
+ } else {
|
||||
+ Printf(doc, "Proxy of C %s struct", class_name);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
break;
|
||||
case AUTODOC_CTOR:
|
||||
if ( Strcmp(class_name, symname) == 0) {
|
||||
String* paramList = make_autodocParmList(n, showTypes);
|
||||
@@ -1027,10 +1038,12 @@
|
||||
Printf(methods,"\t { (char *)\"%s\", (PyCFunction) %s, METH_VARARGS | METH_KEYWORDS, ", name, function);
|
||||
|
||||
if (n && Getattr(n,"feature:callback")) {
|
||||
if (have_docstring(n)) {
|
||||
+ String* ds = docstring(n, AUTODOC_FUNC, "", false);
|
||||
+ Replaceall(ds, "\n", "\\n");
|
||||
Printf(methods,"(char *)\"%s\\nswig_ptr: %s\"",
|
||||
- docstring(n, AUTODOC_FUNC, "", false),
|
||||
+ ds,
|
||||
Getattr(n,"feature:callback:name"));
|
||||
} else {
|
||||
Printf(methods,"(char *)\"swig_ptr: %s\"",Getattr(n,"feature:callback:name"));
|
||||
}
|
||||
@@ -1950,11 +1963,13 @@
|
||||
Printf(f_shadow, modern ? "(object)" : "(_object)");
|
||||
}
|
||||
}
|
||||
Printf(f_shadow,":\n");
|
||||
- if ( have_docstring(n) )
|
||||
- Printv(f_shadow, tab4, docstring(n, AUTODOC_CLASS, tab4), "\n", NIL);
|
||||
-
|
||||
+ if ( have_docstring(n) ) {
|
||||
+ String* str = docstring(n, AUTODOC_CLASS, tab4);
|
||||
+ if (str != NULL && Len(str))
|
||||
+ Printv(f_shadow, tab4, str, "\n", NIL);
|
||||
+ }
|
||||
if (!modern) {
|
||||
Printv(f_shadow,tab4,"__swig_setmethods__ = {}\n",NIL);
|
||||
if (Len(base_class)) {
|
||||
Printf(f_shadow,"%sfor _s in [%s]: __swig_setmethods__.update(_s.__swig_setmethods__)\n",tab4,base_class);
|
||||
@@ -2139,11 +2154,11 @@
|
||||
Replaceall(pycode,"$action", pyaction);
|
||||
Delete(pyaction);
|
||||
Printv(f_shadow,pycode,"\n",NIL);
|
||||
} else {
|
||||
- Printv(f_shadow, tab4, "def ", symname, "(*args", (allow_kwargs ? ", **kwargs" : ""), "): ", NIL);
|
||||
+ Printv(f_shadow, tab4, "def ", symname, "(*args", (allow_kwargs ? ", **kwargs" : ""), "):", NIL);
|
||||
if (!have_addtofunc(n)) {
|
||||
- Printv(f_shadow, "return ", funcCallHelper(Swig_name_member(class_name,symname), allow_kwargs), "\n", NIL);
|
||||
+ Printv(f_shadow, " return ", funcCallHelper(Swig_name_member(class_name,symname), allow_kwargs), "\n", NIL);
|
||||
} else {
|
||||
Printv(f_shadow, "\n", NIL);
|
||||
if ( have_docstring(n) )
|
||||
Printv(f_shadow, tab8, docstring(n, AUTODOC_METHOD, tab8), "\n", NIL);
|
||||
@@ -2175,12 +2190,9 @@
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
if (shadow) {
|
||||
- //
|
||||
- // static + autodoc/prepend/append + def args not working!!!, disable by now
|
||||
- //
|
||||
- if (0 && !classic && !Getattr(n,"feature:python:callback") && have_addtofunc(n)) {
|
||||
+ if ( !classic && !Getattr(n,"feature:python:callback") && have_addtofunc(n)) {
|
||||
int kw = (check_kwargs(n) && !Getattr(n,"sym:overloaded")) ? 1 : 0;
|
||||
Printv(f_shadow, tab4, "def ", symname, "(*args", (kw ? ", **kwargs" : ""), "):\n", NIL);
|
||||
if ( have_docstring(n) )
|
||||
Printv(f_shadow, tab8, docstring(n, AUTODOC_STATICFUNC, tab8), "\n", NIL);
|
||||
Index: Source/Swig/cwrap.c
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Source/Swig/cwrap.c,v
|
||||
retrieving revision 1.51
|
||||
diff -u -4 -r1.51 cwrap.c
|
||||
--- Source/Swig/cwrap.c 4 Dec 2004 08:33:02 -0000 1.51
|
||||
+++ Source/Swig/cwrap.c 15 Apr 2005 23:11:26 -0000
|
||||
@@ -172,17 +172,26 @@
|
||||
tycode = SwigType_type(type);
|
||||
if (tycode == T_REFERENCE) {
|
||||
if (pvalue) {
|
||||
SwigType *tvalue;
|
||||
- String *defname, *defvalue, *rvalue;
|
||||
+ String *defname, *defvalue, *rvalue, *qvalue;
|
||||
rvalue = SwigType_typedef_resolve_all(pvalue);
|
||||
+ qvalue = SwigType_typedef_qualified(rvalue);
|
||||
defname = NewStringf("%s_defvalue", lname);
|
||||
tvalue = Copy(type);
|
||||
SwigType_del_reference(tvalue);
|
||||
- defvalue = NewStringf("%s = %s", SwigType_lstr(tvalue,defname), rvalue);
|
||||
+ tycode = SwigType_type(tvalue);
|
||||
+ if (tycode != T_USER) {
|
||||
+ /* plain primitive type, we copy the the def value */
|
||||
+ defvalue = NewStringf("%s = %s", SwigType_lstr(tvalue,defname),qvalue);
|
||||
+ } else {
|
||||
+ /* user type, we copy the reference value */
|
||||
+ defvalue = NewStringf("%s = %s",SwigType_str(type,defname),qvalue);
|
||||
+ }
|
||||
Wrapper_add_localv(w,defname, defvalue, NIL);
|
||||
Delete(tvalue);
|
||||
Delete(rvalue);
|
||||
+ Delete(qvalue);
|
||||
Delete(defname);
|
||||
Delete(defvalue);
|
||||
}
|
||||
} else if (!pvalue && ((tycode == T_POINTER) || (tycode == T_STRING))) {
|
||||
|
|
@ -1,310 +0,0 @@
|
|||
Index: Doc/Manual/Python.html
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Doc/Manual/Python.html,v
|
||||
retrieving revision 1.31
|
||||
diff -u -4 -r1.31 Python.html
|
||||
--- Doc/Manual/Python.html 6 Oct 2005 21:49:58 -0000 1.31
|
||||
+++ Doc/Manual/Python.html 28 Jun 2006 22:22:00 -0000
|
||||
@@ -4461,10 +4461,10 @@
|
||||
<H2><a name="Python_nn65"></a>26.10 Docstring Features</H2>
|
||||
|
||||
|
||||
<p>
|
||||
-Usign docstrings in Python code is becoming more and more important
|
||||
-ans more tools are coming on the scene that take advantage of them,
|
||||
+Using docstrings in Python code is becoming more and more important
|
||||
+and more tools are coming on the scene that take advantage of them,
|
||||
everything from full-blown documentaiton generators to class browsers
|
||||
and popup call-tips in Python-aware IDEs. Given the way that SWIG
|
||||
generates the proxy code by default, your users will normally get
|
||||
something like <tt>"function_name(*args)"</tt> in the popup calltip of
|
||||
Index: Lib/swig.swg
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Lib/swig.swg,v
|
||||
retrieving revision 1.49
|
||||
diff -u -4 -r1.49 swig.swg
|
||||
--- Lib/swig.swg 15 Oct 2005 00:15:30 -0000 1.49
|
||||
+++ Lib/swig.swg 28 Jun 2006 22:22:00 -0000
|
||||
@@ -51,9 +51,9 @@
|
||||
|
||||
#define %nodefault %feature("nodefault","1")
|
||||
#define %default %feature("nodefault","0")
|
||||
#define %clearnodefault %feature("nodefault","")
|
||||
-#define %makedefault %cleardefault
|
||||
+#define %makedefault %clearnodefault
|
||||
|
||||
/* the %exception directive */
|
||||
|
||||
#ifdef SWIGCSHARP
|
||||
Index: Lib/swiginit.swg
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Lib/swiginit.swg,v
|
||||
retrieving revision 1.5
|
||||
diff -u -4 -r1.5 swiginit.swg
|
||||
--- Lib/swiginit.swg 12 Sep 2005 23:25:03 -0000 1.5
|
||||
+++ Lib/swiginit.swg 28 Jun 2006 22:22:00 -0000
|
||||
@@ -40,14 +40,19 @@
|
||||
**/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
+#if 0
|
||||
+} /* c-mode */
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
+#if 0
|
||||
+#define SWIGRUNTIME_DEBUG
|
||||
#endif
|
||||
|
||||
SWIGRUNTIME void
|
||||
SWIG_InitializeModule(void *clientdata) {
|
||||
- swig_type_info *type, *ret;
|
||||
- swig_cast_info *cast;
|
||||
size_t i;
|
||||
swig_module_info *module_head;
|
||||
static int init_run = 0;
|
||||
|
||||
@@ -71,18 +76,35 @@
|
||||
SWIG_SetModule(clientdata, &swig_module);
|
||||
}
|
||||
|
||||
/* Now work on filling in swig_module.types */
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
|
||||
+#endif
|
||||
for (i = 0; i < swig_module.size; ++i) {
|
||||
- type = 0;
|
||||
+ swig_type_info *type = 0;
|
||||
+ swig_type_info *ret;
|
||||
+ swig_cast_info *cast;
|
||||
+
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
|
||||
+#endif
|
||||
|
||||
/* if there is another module already loaded */
|
||||
if (swig_module.next != &swig_module) {
|
||||
type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
|
||||
}
|
||||
if (type) {
|
||||
/* Overwrite clientdata field */
|
||||
- if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata;
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
|
||||
+#endif
|
||||
+ if (swig_module.type_initial[i]->clientdata) {
|
||||
+ type->clientdata = swig_module.type_initial[i]->clientdata;
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
|
||||
+#endif
|
||||
+ }
|
||||
} else {
|
||||
type = swig_module.type_initial[i];
|
||||
}
|
||||
|
||||
@@ -91,31 +113,66 @@
|
||||
while (cast->type) {
|
||||
|
||||
/* Don't need to add information already in the list */
|
||||
ret = 0;
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
|
||||
+#endif
|
||||
if (swig_module.next != &swig_module) {
|
||||
ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
|
||||
+#endif
|
||||
}
|
||||
- if (ret && type == swig_module.type_initial[i]) {
|
||||
- cast->type = ret;
|
||||
- ret = 0;
|
||||
+ if (ret) {
|
||||
+ if (type == swig_module.type_initial[i]) {
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
|
||||
+#endif
|
||||
+ cast->type = ret;
|
||||
+ ret = 0;
|
||||
+ } else {
|
||||
+ /* Check for casting already in the list */
|
||||
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
|
||||
+#endif
|
||||
+ if (!ocast) ret = 0;
|
||||
+ }
|
||||
}
|
||||
-
|
||||
+
|
||||
if (!ret) {
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
|
||||
+#endif
|
||||
if (type->cast) {
|
||||
type->cast->prev = cast;
|
||||
cast->next = type->cast;
|
||||
}
|
||||
type->cast = cast;
|
||||
}
|
||||
-
|
||||
cast++;
|
||||
}
|
||||
-
|
||||
/* Set entry in modules->types array equal to the type */
|
||||
swig_module.types[i] = type;
|
||||
}
|
||||
swig_module.types[i] = 0;
|
||||
+
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
|
||||
+ for (i = 0; i < swig_module.size; ++i) {
|
||||
+ int j = 0;
|
||||
+ swig_cast_info *cast = swig_module.cast_initial[i];
|
||||
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
|
||||
+ while (cast->type) {
|
||||
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
|
||||
+ cast++;
|
||||
+ ++j;
|
||||
+ }
|
||||
+ printf("---- Total casts: %d\n",j);
|
||||
+ }
|
||||
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* This function will propagate the clientdata field of type to
|
||||
* any new swig_type_info structures that have been added into the list
|
||||
@@ -145,6 +202,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
+#if 0
|
||||
+{ /* c-mode */
|
||||
+#endif
|
||||
}
|
||||
#endif
|
||||
Index: Source/Modules/python.cxx
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Source/Modules/python.cxx,v
|
||||
retrieving revision 1.107
|
||||
diff -u -4 -r1.107 python.cxx
|
||||
--- Source/Modules/python.cxx 7 Oct 2005 13:17:41 -0000 1.107
|
||||
+++ Source/Modules/python.cxx 28 Jun 2006 22:22:01 -0000
|
||||
@@ -36,9 +36,8 @@
|
||||
static File *f_directors_h = 0;
|
||||
static File *f_init = 0;
|
||||
static File *f_shadow_py = 0;
|
||||
static String *f_shadow = 0;
|
||||
-static String *f_shadow_imports = 0;
|
||||
static String *f_shadow_stubs = 0;
|
||||
|
||||
static String *methods;
|
||||
static String *class_name;
|
||||
@@ -322,9 +321,8 @@
|
||||
}
|
||||
Delete(filen); filen = NULL;
|
||||
|
||||
f_shadow = NewString("");
|
||||
- f_shadow_imports = NewString("");
|
||||
f_shadow_stubs = NewString("");
|
||||
|
||||
Swig_register_filebyname("shadow",f_shadow);
|
||||
Swig_register_filebyname("python",f_shadow);
|
||||
@@ -343,8 +341,10 @@
|
||||
if (mod_docstring && Len(mod_docstring)) {
|
||||
Printv(f_shadow, "\n\"\"\"\n", mod_docstring, "\n\"\"\"\n", NIL);
|
||||
Delete(mod_docstring); mod_docstring = NULL;
|
||||
}
|
||||
+
|
||||
+ Printf(f_shadow,"\nimport %s\n\n", module);
|
||||
|
||||
/* if (!modern) */
|
||||
/* always needed, a class can be forced to be no-modern, such as an exception */
|
||||
{
|
||||
@@ -445,10 +445,8 @@
|
||||
Printf(f_wrappers,"}\n");
|
||||
Printf(f_wrappers,"#endif\n");
|
||||
|
||||
if (shadow) {
|
||||
- Printf(f_shadow_imports,"\nimport %s\n", module);
|
||||
- Printv(f_shadow_py, f_shadow_imports, "\n",NIL);
|
||||
Printv(f_shadow_py, f_shadow, "\n",NIL);
|
||||
Printv(f_shadow_py, f_shadow_stubs, "\n",NIL);
|
||||
|
||||
Close(f_shadow_py);
|
||||
@@ -507,12 +505,9 @@
|
||||
}
|
||||
|
||||
// finally, output the name of the imported module
|
||||
Printf(import, "%s\n", modname);
|
||||
-
|
||||
- if (!Strstr(f_shadow_imports, import)) {
|
||||
- Printf(f_shadow_imports, "%s", import);
|
||||
- }
|
||||
+ Printf(f_shadow, "%s", import);
|
||||
Delete(import);
|
||||
}
|
||||
}
|
||||
return Language::importDirective(n);
|
||||
@@ -774,10 +769,15 @@
|
||||
|
||||
// Do the param type too?
|
||||
if (showTypes) {
|
||||
type = SwigType_base(type);
|
||||
- lookup = Swig_symbol_clookup(type, 0);
|
||||
- if (lookup) type = Getattr(lookup, "sym:name");
|
||||
+ SwigType* qt = SwigType_typedef_resolve_all(type);
|
||||
+ if (SwigType_isenum(qt))
|
||||
+ type = NewString("int");
|
||||
+ else {
|
||||
+ lookup = Swig_symbol_clookup(type, 0);
|
||||
+ if (lookup) type = Getattr(lookup, "sym:name");
|
||||
+ }
|
||||
Printf(doc, "%s ", type);
|
||||
}
|
||||
|
||||
if (name) {
|
||||
Index: Lib/python/pyinit.swg
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Lib/python/pyinit.swg,v
|
||||
retrieving revision 1.19
|
||||
diff -u -4 -r1.19 pyinit.swg
|
||||
--- Lib/python/pyinit.swg 17 Jun 2005 19:12:20 -0000 1.19
|
||||
+++ Lib/python/pyinit.swg 28 Jun 2006 22:22:01 -0000
|
||||
@@ -214,13 +214,13 @@
|
||||
swig_type_info **types,
|
||||
swig_type_info **types_initial) {
|
||||
size_t i;
|
||||
for (i = 0; methods[i].ml_name; ++i) {
|
||||
- char *c = methods[i].ml_doc;
|
||||
+ const char *c = methods[i].ml_doc;
|
||||
if (c && (c = strstr(c, "swig_ptr: "))) {
|
||||
int j;
|
||||
swig_const_info *ci = 0;
|
||||
- char *name = c + 10;
|
||||
+ const char *name = c + 10;
|
||||
for (j = 0; const_table[j].type; ++j) {
|
||||
if (strncmp(const_table[j].name, name,
|
||||
strlen(const_table[j].name)) == 0) {
|
||||
ci = &(const_table[j]);
|
||||
Index: Lib/python/pyrun.swg
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Lib/python/pyrun.swg,v
|
||||
retrieving revision 1.73
|
||||
diff -u -4 -r1.73 pyrun.swg
|
||||
--- Lib/python/pyrun.swg 23 Aug 2005 10:55:05 -0000 1.73
|
||||
+++ Lib/python/pyrun.swg 28 Jun 2006 22:22:01 -0000
|
||||
@@ -635,9 +635,9 @@
|
||||
if (pyobj && !obj) {
|
||||
obj = pyobj;
|
||||
if (PyCFunction_Check(obj)) {
|
||||
/* here we get the method pointer for callbacks */
|
||||
- char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
|
||||
+ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
|
||||
c = doc ? strstr(doc, "swig_ptr: ") : 0;
|
||||
if (c) {
|
||||
c = ty ? SWIG_UnpackVoidPtr(c + 10, &vptr, ty->name) : 0;
|
||||
if (!c) goto type_error;
|
||||
|
|
@ -1,254 +0,0 @@
|
|||
Index: Makefile.in
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Makefile.in,v
|
||||
retrieving revision 1.103
|
||||
diff -u -4 -r1.103 Makefile.in
|
||||
--- Makefile.in 10 Mar 2006 22:54:02 -0000 1.103
|
||||
+++ Makefile.in 5 Jul 2006 00:50:18 -0000
|
||||
@@ -21,9 +21,9 @@
|
||||
|
||||
source:
|
||||
@cd $(SOURCE) && $(MAKE)
|
||||
|
||||
-libfiles: Lib/swigwarn.swg
|
||||
+libfiles: $(srcdir)/Lib/swigwarn.swg
|
||||
|
||||
.PHONY: source libfiles
|
||||
|
||||
#####################################################################
|
||||
@@ -339,9 +339,9 @@
|
||||
#####################################################################
|
||||
# Update the Lib/swigwarn.swg file
|
||||
#####################################################################
|
||||
|
||||
-Lib/swigwarn.swg: Source/Include/swigwarn.h
|
||||
+$(srcdir)/Lib/swigwarn.swg: $(srcdir)/Source/Include/swigwarn.h
|
||||
echo "/* Automatically generated file containing all the swig warning codes. */" > $@
|
||||
echo "/* Do not modify this file by hand, change 'Source/Include/swigwarn.h' */" >> $@
|
||||
echo "/* and use the command 'make Lib/swigwarn.swg' instead. */" >> $@
|
||||
echo >> $@; echo >> $@
|
||||
Index: Lib/typemaps/exception.swg
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Lib/typemaps/exception.swg,v
|
||||
retrieving revision 1.8
|
||||
diff -u -4 -r1.8 exception.swg
|
||||
--- Lib/typemaps/exception.swg 7 Mar 2006 00:14:10 -0000 1.8
|
||||
+++ Lib/typemaps/exception.swg 5 Jul 2006 00:50:18 -0000
|
||||
@@ -12,9 +12,9 @@
|
||||
|
||||
/* macros for error manipulation */
|
||||
#define %nullref_fmt() "invalid null reference "
|
||||
#define %varfail_fmt(_type,_name) "in variable '"`_name`"' of type '"`_type`"'"
|
||||
-#define %argfail_fmt(_type,_name,_argn) "in method '" `_name` "', argument " `_argn`" of type '" `_type`"'"
|
||||
+#define %argfail_fmt(_type,_name,_argn) "in method '" `_name` "', expected argument " `_argn`" of type '" `_type`"'"
|
||||
#define %outfail_fmt(_type) "in output value of type '"_type"'"
|
||||
#define %argnullref_fmt(_type,_name,_argn) %nullref_fmt() %argfail_fmt(_type, _name, _argn)
|
||||
#define %varnullref_fmt(_type,_name) %nullref_fmt() %varfail_fmt(_type, _name)
|
||||
#define %outnullref_fmt(_type) %nullref_fmt() %outfail_fmt(_type)
|
||||
Index: Source/Modules/python.cxx
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Source/Modules/python.cxx,v
|
||||
retrieving revision 1.203
|
||||
diff -u -4 -r1.203 python.cxx
|
||||
--- Source/Modules/python.cxx 16 Mar 2006 01:46:50 -0000 1.203
|
||||
+++ Source/Modules/python.cxx 5 Jul 2006 00:50:19 -0000
|
||||
@@ -39,9 +39,8 @@
|
||||
static File *f_directors_h = 0;
|
||||
static File *f_init = 0;
|
||||
static File *f_shadow_py = 0;
|
||||
static String *f_shadow = 0;
|
||||
-static String *f_shadow_imports = 0;
|
||||
static String *f_shadow_stubs = 0;
|
||||
|
||||
static String *methods;
|
||||
static String *class_name;
|
||||
@@ -669,9 +668,8 @@
|
||||
}
|
||||
Delete(filen); filen = NULL;
|
||||
|
||||
f_shadow = NewString("");
|
||||
- f_shadow_imports = NewString("");
|
||||
f_shadow_stubs = NewString("");
|
||||
|
||||
Swig_register_filebyname("shadow",f_shadow);
|
||||
Swig_register_filebyname("python",f_shadow);
|
||||
@@ -817,12 +815,8 @@
|
||||
Printf(f_wrappers,"}\n");
|
||||
Printf(f_wrappers,"#endif\n");
|
||||
|
||||
if (shadow) {
|
||||
- /*
|
||||
- Printf(f_shadow_imports,"\nimport %s\n", module);
|
||||
- Printv(f_shadow_py, f_shadow_imports, "\n",NIL);
|
||||
- */
|
||||
Printv(f_shadow_py, f_shadow, "\n",NIL);
|
||||
Printv(f_shadow_py, f_shadow_stubs, "\n",NIL);
|
||||
|
||||
Close(f_shadow_py);
|
||||
@@ -882,14 +876,11 @@
|
||||
}
|
||||
|
||||
// finally, output the name of the imported module
|
||||
if (shadowimport) {
|
||||
- if (!options || (!Getattr(options, "noshadow") && !Getattr(options, "noproxy"))) {
|
||||
- Printf(import, "_%s\n", modname);
|
||||
- if (!Strstr(f_shadow_imports, import)) {
|
||||
- Printf(f_shadow, "import %s\n", modname);
|
||||
- Printv(f_shadow_imports, import, NULL);
|
||||
- }
|
||||
+ if (!options || (!Getattr(options, "noshadow") && !Getattr(options, "noproxy"))) {
|
||||
+ Printf(import, "%s\n", modname);
|
||||
+ Printf(f_shadow, "%s", import);
|
||||
}
|
||||
}
|
||||
|
||||
Delete(import);
|
||||
@@ -1154,10 +1145,15 @@
|
||||
|
||||
// Do the param type too?
|
||||
if (showTypes) {
|
||||
type = SwigType_base(type);
|
||||
- lookup = Swig_symbol_clookup(type, 0);
|
||||
- if (lookup) type = Getattr(lookup, "sym:name");
|
||||
+ SwigType* qt = SwigType_typedef_resolve_all(type);
|
||||
+ if (SwigType_isenum(qt))
|
||||
+ type = NewString("int");
|
||||
+ else {
|
||||
+ lookup = Swig_symbol_clookup(type, 0);
|
||||
+ if (lookup) type = Getattr(lookup, "sym:name");
|
||||
+ }
|
||||
Printf(doc, "%s ", type);
|
||||
}
|
||||
|
||||
if (name) {
|
||||
@@ -2793,10 +2789,10 @@
|
||||
Printf(f_shadow_file,"%s.%s = new_instancemethod(%s.%s,None,%s)\n",
|
||||
class_name, symname, module, Swig_name_member(class_name,symname), class_name);
|
||||
}
|
||||
}
|
||||
- Printf(f_shadow_file,"%s_swigregister = %s.%s_swigregister\n", class_name, module, class_name);
|
||||
- Printf(f_shadow_file,"%s_swigregister(%s)\n", class_name, class_name,0);
|
||||
+
|
||||
+ Printf(f_shadow_file,"%s.%s_swigregister(%s)\n", module, class_name, class_name);
|
||||
|
||||
shadow_indent = 0;
|
||||
Printf(f_shadow_file,"%s\n", f_shadow_stubs);
|
||||
Clear(f_shadow_stubs);
|
||||
Index: Source/Swig/misc.c
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Source/Swig/misc.c,v
|
||||
retrieving revision 1.57
|
||||
diff -u -4 -r1.57 misc.c
|
||||
--- Source/Swig/misc.c 6 Mar 2006 22:51:00 -0000 1.57
|
||||
+++ Source/Swig/misc.c 5 Jul 2006 00:50:19 -0000
|
||||
@@ -899,8 +899,26 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+
|
||||
+/* -----------------------------------------------------------------------------
|
||||
+ * Swig_string_wxpy()
|
||||
+ *
|
||||
+ * Drop a leading 'wx' for all wxNames, except for wxEVT*
|
||||
+ * ----------------------------------------------------------------------------- */
|
||||
+String *Swig_string_wxpy(String *s) {
|
||||
+ String* ns = NewStringEmpty();
|
||||
+ char* cptr = Char(s);
|
||||
+ if (cptr[0] == 'w' && cptr[1] == 'x') {
|
||||
+ if ( ! (cptr[2] == 'E' && cptr[3] == 'V' && cptr[4] == 'T')) {
|
||||
+ ns = NewString(&cptr[2]);
|
||||
+ }
|
||||
+ }
|
||||
+ return ns;
|
||||
+}
|
||||
+
|
||||
+
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Swig_init()
|
||||
*
|
||||
* Initialize the SWIG core
|
||||
@@ -928,8 +946,11 @@
|
||||
DohEncoding("undercase", Swig_string_ucase);
|
||||
DohEncoding("firstuppercase", Swig_string_first_upper);
|
||||
DohEncoding("firstlowercase", Swig_string_first_lower);
|
||||
|
||||
+ /* wxPython's rename encoder */
|
||||
+ DohEncoding("wxpy", Swig_string_wxpy);
|
||||
+
|
||||
/* Initialize the swig keys */
|
||||
Swig_keys_init();
|
||||
|
||||
/* Initialize typemaps */
|
||||
Index: Lib/python/pyinit.swg
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Lib/python/pyinit.swg,v
|
||||
retrieving revision 1.32
|
||||
diff -u -4 -r1.32 pyinit.swg
|
||||
--- Lib/python/pyinit.swg 2 Feb 2006 23:48:56 -0000 1.32
|
||||
+++ Lib/python/pyinit.swg 5 Jul 2006 00:50:19 -0000
|
||||
@@ -225,13 +225,13 @@
|
||||
swig_type_info **types,
|
||||
swig_type_info **types_initial) {
|
||||
size_t i;
|
||||
for (i = 0; methods[i].ml_name; ++i) {
|
||||
- char *c = methods[i].ml_doc;
|
||||
+ const char *c = methods[i].ml_doc;
|
||||
if (c && (c = strstr(c, "swig_ptr: "))) {
|
||||
int j;
|
||||
swig_const_info *ci = 0;
|
||||
- char *name = c + 10;
|
||||
+ const char *name = c + 10;
|
||||
for (j = 0; const_table[j].type; ++j) {
|
||||
if (strncmp(const_table[j].name, name,
|
||||
strlen(const_table[j].name)) == 0) {
|
||||
ci = &(const_table[j]);
|
||||
Index: Lib/python/pyrun.swg
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Lib/python/pyrun.swg,v
|
||||
retrieving revision 1.141
|
||||
diff -u -4 -r1.141 pyrun.swg
|
||||
--- Lib/python/pyrun.swg 7 Mar 2006 00:35:17 -0000 1.141
|
||||
+++ Lib/python/pyrun.swg 5 Jul 2006 00:50:19 -0000
|
||||
@@ -11,8 +11,12 @@
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
/* Common SWIG API */
|
||||
|
||||
+#if PY_VERSION_HEX < 0x02050000
|
||||
+typedef int Py_ssize_t;
|
||||
+#endif
|
||||
+
|
||||
/* for raw pointers */
|
||||
#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
|
||||
#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
|
||||
#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
|
||||
@@ -1074,9 +1078,9 @@
|
||||
} else {
|
||||
void *vptr = 0;
|
||||
|
||||
/* here we get the method pointer for callbacks */
|
||||
- char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
|
||||
+ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
|
||||
const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
|
||||
if (desc) {
|
||||
desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
|
||||
if (!desc) return SWIG_ERROR;
|
||||
Index: Lib/python/pystrings.swg
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Lib/python/pystrings.swg,v
|
||||
retrieving revision 1.27
|
||||
diff -u -4 -r1.27 pystrings.swg
|
||||
--- Lib/python/pystrings.swg 23 Feb 2006 21:43:33 -0000 1.27
|
||||
+++ Lib/python/pystrings.swg 5 Jul 2006 00:50:19 -0000
|
||||
@@ -5,9 +5,9 @@
|
||||
SWIGINTERN int
|
||||
SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
|
||||
{
|
||||
if (PyString_Check(obj)) {
|
||||
- char *cstr; int len;
|
||||
+ char *cstr; Py_ssize_t len;
|
||||
PyString_AsStringAndSize(obj, &cstr, &len);
|
||||
if (cptr) {
|
||||
if (alloc) {
|
||||
/*
|
||||
163
wxPython/b
163
wxPython/b
|
|
@ -1,163 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Are we using bash on win32? If so source that file and then exit.
|
||||
if [ "$OSTYPE" = "cygwin" ]; then
|
||||
source b.win32
|
||||
exit
|
||||
fi
|
||||
|
||||
# make it easy to switch versions of SWIG
|
||||
if [ "$SWIG" = "" ]; then
|
||||
SWIG=/opt/swig/bin/swig-1.3.29
|
||||
fi
|
||||
|
||||
|
||||
function getpyver {
|
||||
if [ "$1" = "15" ]; then
|
||||
PYVER=1.5
|
||||
elif [ "$1" = "20" ]; then
|
||||
PYVER=2.0
|
||||
elif [ "$1" = "21" ]; then
|
||||
PYVER=2.1
|
||||
elif [ "$1" = "22" ]; then
|
||||
PYVER=2.2
|
||||
elif [ "$1" = "23" ]; then
|
||||
PYVER=2.3
|
||||
elif [ "$1" = "24" ]; then
|
||||
PYVER=2.4
|
||||
elif [ "$1" = "25" ]; then
|
||||
PYVER=2.5
|
||||
else
|
||||
echo You must specify Python version as first parameter.
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
getpyver $1
|
||||
shift
|
||||
|
||||
python$PYVER -c "import sys;print '\n', sys.version, '\n'"
|
||||
|
||||
|
||||
SETUP="python$PYVER -u setup.py"
|
||||
FLAGS="USE_SWIG=1 SWIG=$SWIG"
|
||||
OTHERFLAGS=""
|
||||
PORTFLAGS=""
|
||||
UNIFLAG="UNICODE=1"
|
||||
|
||||
|
||||
|
||||
if [ "$1" = "gtk1" -o "$1" = "gtk" ]; then
|
||||
PORTFLAGS="WXPORT=gtk"
|
||||
UNIFLAG="UNICODE=0"
|
||||
shift
|
||||
elif [ "$1" = "gtk2" ]; then
|
||||
PORTFLAGS="WXPORT=gtk2"
|
||||
UNIFLAG="UNICODE=1"
|
||||
shift
|
||||
fi
|
||||
|
||||
for p in $*; do
|
||||
if [ "$p" = "UNICODE=0" -o "$p" = "UNICODE=1" ]; then
|
||||
UNIFLAG=""
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
FLAGS="$FLAGS $PORTFLAGS $UNIFLAG"
|
||||
|
||||
|
||||
|
||||
# "c" --> clean
|
||||
if [ "$1" = "c" ]; then
|
||||
shift
|
||||
CMD="$SETUP $FLAGS $OTHERFLAGS clean $*"
|
||||
OTHERCMD="rm -f wx/*.so"
|
||||
|
||||
# "d" --> clean extension modules only
|
||||
elif [ "$1" = "d" ]; then
|
||||
shift
|
||||
CMD="rm -f wx/*.so"
|
||||
|
||||
# "t" --> touch *.i files
|
||||
elif [ "$1" = "t" ]; then
|
||||
shift
|
||||
CMD='find . -name "*.i" | xargs touch'
|
||||
|
||||
# "i" --> install
|
||||
elif [ "$1" = "i" ]; then
|
||||
shift
|
||||
CMD="$SETUP $FLAGS $OTHERFLAGS build_ext install $*"
|
||||
|
||||
# "s" --> source dist
|
||||
elif [ "$1" = "s" ]; then
|
||||
shift
|
||||
CMD="$SETUP $OTHERFLAGS sdist $*"
|
||||
|
||||
# "r" --> rpm dist
|
||||
elif [ "$1" = "r" ]; then
|
||||
WXPYVER=`python$PYVER -c "import setup;print setup.VERSION"`
|
||||
for VER in 21 22; do
|
||||
getpyver $VER
|
||||
|
||||
echo "*****************************************************************"
|
||||
echo "******* Building wxPython for Python $PYVER"
|
||||
echo "*****************************************************************"
|
||||
|
||||
SETUP="python$PYVER -u setup.py"
|
||||
|
||||
# save the original
|
||||
cp setup.py setup.py.save
|
||||
|
||||
# fix up setup.py the way we want...
|
||||
sed "s/BUILD_GLCANVAS = /BUILD_GLCANVAS = 0 #/" < setup.py.save > setup.py.temp
|
||||
sed "s/GL_ONLY = /GL_ONLY = 1 #/" < setup.py.temp > setup.py
|
||||
|
||||
# build wxPython-gl RPM
|
||||
$SETUP $OTHERFLAGS bdist_rpm --binary-only --doc-files README.txt --python=python$PYVER
|
||||
### --requires=python$PYVER
|
||||
rm dist/wxPython-gl*.tar.gz
|
||||
|
||||
# Build wxPython RPM
|
||||
cp setup.py setup.py.temp
|
||||
sed "s/GL_ONLY = /GL_ONLY = 0 #/" < setup.py.temp > setup.py
|
||||
$SETUP $OTHERFLAGS bdist_rpm --binary-only --python=python$PYVER
|
||||
### --requires=python$PYVER
|
||||
|
||||
# put the oringal setup.py back
|
||||
cp setup.py.save setup.py
|
||||
rm setup.py.*
|
||||
|
||||
# rename the binary RPM's
|
||||
mv dist/wxPython-$WXPYVER-1.i386.rpm dist/wxPython-$WXPYVER-1-Py$VER.i386.rpm
|
||||
mv dist/wxPython-gl-$WXPYVER-1.i386.rpm dist/wxPython-gl-$WXPYVER-1-Py$VER.i386.rpm
|
||||
|
||||
done
|
||||
|
||||
# rebuild the source dists without the munched up setup.py
|
||||
$SETUP $OTHERFLAGS bdist_rpm --source-only
|
||||
exit 0
|
||||
|
||||
|
||||
# "f" --> FINAL (no debug)
|
||||
elif [ "$1" = "f" ]; then
|
||||
shift
|
||||
CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace $*"
|
||||
|
||||
# (no command arg) --> normal build for development
|
||||
else
|
||||
CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace --debug $*"
|
||||
fi
|
||||
|
||||
|
||||
echo $CMD
|
||||
eval $CMD
|
||||
RC=$?
|
||||
|
||||
if [ "$RC" = "0" -a "$OTHERCMD" != "" ]; then
|
||||
echo $OTHERCMD
|
||||
$OTHERCMD
|
||||
RC=$?
|
||||
fi
|
||||
|
||||
exit $RC
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
@echo off
|
||||
|
||||
call bash.bat -c "b.win32 %*"
|
||||
128
wxPython/b.win32
128
wxPython/b.win32
|
|
@ -1,128 +0,0 @@
|
|||
#!/bin/bash
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
if [ "$SWIGDIR" = "" ]; then
|
||||
SWIGDIR=$PROJECTS\\SWIG-1.3.29
|
||||
fi
|
||||
|
||||
|
||||
# Use non-default python?
|
||||
case $1 in
|
||||
21 | 2.1) VER=21; shift ;;
|
||||
22 | 2.2) VER=22; shift ;;
|
||||
23 | 2.3) VER=23; shift ;;
|
||||
24 | 2.4) VER=24; shift ;;
|
||||
25 | 2.5) VER=25; shift ;;
|
||||
|
||||
*) VER=24
|
||||
esac
|
||||
|
||||
PYTHON=$TOOLS/python$VER/python.exe
|
||||
|
||||
SETUP="$PYTHON -u setup.py"
|
||||
$PYTHON -c "import sys;print '\n', sys.version, '\n'"
|
||||
|
||||
|
||||
FLAGS="USE_SWIG=1 SWIG=$SWIGDIR\\swig.exe"
|
||||
UNIFLAG="UNICODE=1"
|
||||
|
||||
for p in $*; do
|
||||
if [ "$p" = "UNICODE=0" -o "$p" = "UNICODE=1" ]; then
|
||||
UNIFLAG=""
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
FLAGS="$FLAGS $UNIFLAG"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# "c" --> clean
|
||||
if [ "$1" = "c" ]; then
|
||||
shift
|
||||
CMD="$SETUP $FLAGS clean $@"
|
||||
OTHERCMD="rm wx/*.pyd"
|
||||
|
||||
# just remove the *.pyd's
|
||||
elif [ "$1" = "d" ]; then
|
||||
shift
|
||||
CMD="rm wx/*.pyd"
|
||||
|
||||
# touch all the *.i files so swig will regenerate
|
||||
elif [ "$1" = "t" ]; then
|
||||
shift
|
||||
CMD=
|
||||
find . -name "*.i" | xargs -l touch
|
||||
|
||||
# "i" --> install
|
||||
elif [ "$1" = "i" ]; then
|
||||
shift
|
||||
CMD="$SETUP build install"
|
||||
|
||||
# "r" --> make installer
|
||||
elif [ "$1" = "r" ]; then
|
||||
shift
|
||||
CMD="$PYTHON -u distrib\make_installer.py $@"
|
||||
|
||||
# "s" --> source dist
|
||||
elif [ "$1" = "s" ]; then
|
||||
shift
|
||||
CMD="$SETUP sdist"
|
||||
|
||||
# "f" --> FINAL
|
||||
elif [ "$1" == "f" ]; then
|
||||
shift
|
||||
CMD="$SETUP $FLAGS FINAL=1 build_ext --inplace $@"
|
||||
|
||||
# "h" --> HYBRID
|
||||
elif [ "$1" = "h" ]; then
|
||||
shift
|
||||
CMD="$SETUP $FLAGS HYBRID=1 build_ext --inplace $@"
|
||||
|
||||
# "a" --> make all installers
|
||||
elif [ "$1" = "a" ]; then
|
||||
shift
|
||||
CMD=
|
||||
|
||||
$0 23 d UNICODE=0
|
||||
$0 23 h UNICODE=0
|
||||
$0 23 r UNICODE=0
|
||||
$0 23 d UNICODE=1
|
||||
$0 23 h UNICODE=1
|
||||
$0 23 r UNICODE=1
|
||||
|
||||
$0 24 d UNICODE=0
|
||||
$0 24 h UNICODE=0
|
||||
$0 24 r UNICODE=0
|
||||
$0 24 d UNICODE=1
|
||||
$0 24 h UNICODE=1
|
||||
$0 24 r UNICODE=1
|
||||
|
||||
|
||||
# "b" --> both debug and hybrid builds
|
||||
elif [ "$1" = "b" ]; then
|
||||
shift
|
||||
CMD="echo Finished!"
|
||||
$0 $VER $@
|
||||
$0 $VER h $@
|
||||
|
||||
# (no command arg) --> normal debug build for development
|
||||
else
|
||||
CMD="$SETUP $FLAGS HYBRID=0 build_ext --inplace --debug $@"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [ "$CMD" != "" ]; then
|
||||
echo $CMD
|
||||
$CMD
|
||||
fi
|
||||
|
||||
if [ "$OTHERCMD" != "" ]; then
|
||||
echo $OTHERCMD
|
||||
$OTHERCMD
|
||||
fi
|
||||
|
||||
1181
wxPython/config.py
1181
wxPython/config.py
File diff suppressed because it is too large
Load diff
|
|
@ -1,3 +0,0 @@
|
|||
These sub directories contain add-on modules that are not part of the
|
||||
core wxPython, either because of licensing issues, optional code in
|
||||
wxWindows, contrib code in wxWindows, or whatever.
|
||||
|
|
@ -1,211 +0,0 @@
|
|||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Some helper and utility functions for ActiveX
|
||||
|
||||
|
||||
t4 = " " * 4
|
||||
t8 = " " * 8
|
||||
|
||||
def GetAXInfo(ax):
|
||||
"""
|
||||
Returns a printable summary of the TypeInfo from the ActiveX instance
|
||||
passed in.
|
||||
"""
|
||||
|
||||
def ProcessFuncX(f, out, name):
|
||||
out.append(name)
|
||||
out.append(t4 + "retType: %s" % f.retType.vt_type)
|
||||
if f.params:
|
||||
out.append(t4 + "params:")
|
||||
for p in f.params:
|
||||
out.append(t8 + p.name)
|
||||
out.append(t8+t4+ "in:%s out:%s optional:%s type:%s" % (p.isIn, p.isOut, p.isOptional, p.vt_type))
|
||||
out.append('')
|
||||
|
||||
def ProcessPropX(p, out):
|
||||
out.append(GernerateAXModule.trimPropName(p.name))
|
||||
out.append(t4+ "type:%s arg:%s canGet:%s canSet:%s" % (p.type.vt_type, p.arg.vt_type, p.canGet, p.canSet))
|
||||
out.append('')
|
||||
|
||||
out = []
|
||||
|
||||
out.append("PROPERTIES")
|
||||
out.append("-"*20)
|
||||
for p in ax.GetAXProperties():
|
||||
ProcessPropX(p, out)
|
||||
out.append('\n\n')
|
||||
|
||||
out.append("METHODS")
|
||||
out.append("-"*20)
|
||||
for m in ax.GetAXMethods():
|
||||
ProcessFuncX(m, out, GernerateAXModule.trimMethodName(m.name))
|
||||
out.append('\n\n')
|
||||
|
||||
out.append("EVENTS")
|
||||
out.append("-"*20)
|
||||
for e in ax.GetAXEvents():
|
||||
ProcessFuncX(e, out, GernerateAXModule.trimEventName(e.name))
|
||||
out.append('\n\n')
|
||||
|
||||
return "\n".join(out)
|
||||
|
||||
|
||||
|
||||
class GernerateAXModule:
|
||||
def __init__(self, ax, className, modulePath, moduleName=None, verbose=False):
|
||||
"""
|
||||
Make a Python module file with a class that has been specialized
|
||||
for the AcitveX object.
|
||||
|
||||
ax An instance of the ActiveXWindow class
|
||||
className The name to use for the new class
|
||||
modulePath The path where the new module should be written to
|
||||
moduleName The name of the .py file to create. If not given
|
||||
then the className will be used.
|
||||
"""
|
||||
import os
|
||||
if moduleName is None:
|
||||
moduleName = className + '.py'
|
||||
filename = os.path.join(modulePath, moduleName)
|
||||
if verbose:
|
||||
print "Creating module in:", filename
|
||||
print " ProgID: ", ax.GetCLSID().GetProgIDString()
|
||||
print " CLSID: ", ax.GetCLSID().GetCLSIDString()
|
||||
print
|
||||
self.mf = file(filename, "w")
|
||||
self.WriteFileHeader(ax)
|
||||
self.WriteEvents(ax)
|
||||
self.WriteClassHeader(ax, className)
|
||||
self.WriteMethods(ax)
|
||||
self.WriteProperties(ax)
|
||||
self.WriteDocs(ax)
|
||||
self.mf.close()
|
||||
del self.mf
|
||||
|
||||
|
||||
def WriteFileHeader(self, ax):
|
||||
self.write("# This module was generated by the wx.activex.GernerateAXModule class\n"
|
||||
"# (See also the genaxmodule script.)\n")
|
||||
self.write("import wx")
|
||||
self.write("import wx.activex\n")
|
||||
self.write("clsID = '%s'\nprogID = '%s'\n"
|
||||
% (ax.GetCLSID().GetCLSIDString(), ax.GetCLSID().GetProgIDString()))
|
||||
self.write("\n")
|
||||
|
||||
|
||||
def WriteEvents(self, ax):
|
||||
events = ax.GetAXEvents()
|
||||
if events:
|
||||
self.write("# Create eventTypes and event binders")
|
||||
for e in events:
|
||||
self.write("wxEVT_%s = wx.activex.RegisterActiveXEvent('%s')"
|
||||
% (self.trimEventName(e.name), e.name))
|
||||
self.write()
|
||||
for e in events:
|
||||
n = self.trimEventName(e.name)
|
||||
self.write("EVT_%s = wx.PyEventBinder(wxEVT_%s, 1)" % (n,n))
|
||||
self.write("\n")
|
||||
|
||||
|
||||
def WriteClassHeader(self, ax, className):
|
||||
self.write("# Derive a new class from ActiveXWindow")
|
||||
self.write("""\
|
||||
class %s(wx.activex.ActiveXWindow):
|
||||
def __init__(self, parent, ID=-1, pos=wx.DefaultPosition,
|
||||
size=wx.DefaultSize, style=0, name='%s'):
|
||||
wx.activex.ActiveXWindow.__init__(self, parent,
|
||||
wx.activex.CLSID('%s'),
|
||||
ID, pos, size, style, name)
|
||||
""" % (className, className, ax.GetCLSID().GetCLSIDString()) )
|
||||
|
||||
|
||||
def WriteMethods(self, ax):
|
||||
methods = ax.GetAXMethods()
|
||||
if methods:
|
||||
self.write(t4, "# Methods exported by the ActiveX object")
|
||||
for m in methods:
|
||||
name = self.trimMethodName(m.name)
|
||||
self.write(t4, "def %s(self%s):" % (name, self.getParameters(m, True)))
|
||||
self.write(t8, "return self.CallAXMethod('%s'%s)" % (m.name, self.getParameters(m, False)))
|
||||
self.write()
|
||||
|
||||
|
||||
def WriteProperties(self, ax):
|
||||
props = ax.GetAXProperties()
|
||||
if props:
|
||||
self.write(t4, "# Getters, Setters and properties")
|
||||
for p in props:
|
||||
getterName = setterName = "None"
|
||||
if p.canGet:
|
||||
getterName = "_get_" + p.name
|
||||
self.write(t4, "def %s(self):" % getterName)
|
||||
self.write(t8, "return self.GetAXProp('%s')" % p.name)
|
||||
if p.canSet:
|
||||
setterName = "_set_" + p.name
|
||||
self.write(t4, "def %s(self, %s):" % (setterName, p.arg.name))
|
||||
self.write(t8, "self.SetAXProp('%s', %s)" % (p.name, p.arg.name))
|
||||
|
||||
self.write(t4, "%s = property(%s, %s)" %
|
||||
(self.trimPropName(p.name), getterName, setterName))
|
||||
self.write()
|
||||
|
||||
|
||||
def WriteDocs(self, ax):
|
||||
self.write()
|
||||
doc = GetAXInfo(ax)
|
||||
for line in doc.split('\n'):
|
||||
self.write("# ", line)
|
||||
|
||||
|
||||
|
||||
def write(self, *args):
|
||||
for a in args:
|
||||
self.mf.write(a)
|
||||
self.mf.write("\n")
|
||||
|
||||
|
||||
def trimEventName(name):
|
||||
if name.startswith("On"):
|
||||
name = name[2:]
|
||||
return name
|
||||
trimEventName = staticmethod(trimEventName)
|
||||
|
||||
|
||||
def trimPropName(name):
|
||||
#name = name[0].lower() + name[1:]
|
||||
name = name.lower()
|
||||
import keyword
|
||||
if name in keyword.kwlist: name += '_'
|
||||
return name
|
||||
trimPropName = staticmethod(trimPropName)
|
||||
|
||||
|
||||
def trimMethodName(name):
|
||||
import keyword
|
||||
if name in keyword.kwlist: name += '_'
|
||||
return name
|
||||
trimMethodName = staticmethod(trimMethodName)
|
||||
|
||||
|
||||
def getParameters(self, m, withDefaults):
|
||||
import keyword
|
||||
st = ""
|
||||
# collect the input parameters, if both isIn and isOut are
|
||||
# False then assume it is an input paramater
|
||||
params = []
|
||||
for p in m.params:
|
||||
if p.isIn or (not p.isIn and not p.isOut):
|
||||
params.append(p)
|
||||
# did we get any?
|
||||
for p in params:
|
||||
name = p.name
|
||||
if name in keyword.kwlist: name += '_'
|
||||
st += ", "
|
||||
st += name
|
||||
if withDefaults and p.isOptional:
|
||||
st += '=None'
|
||||
return st
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,604 +0,0 @@
|
|||
# This file was created automatically by SWIG 1.3.29.
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
import _activex
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if (name == "this"):
|
||||
if type(value).__name__ == 'PySwigObject':
|
||||
self.__dict__[name] = value
|
||||
return
|
||||
method = class_type.__swig_setmethods__.get(name,None)
|
||||
if method: return method(self,value)
|
||||
if (not static) or hasattr(self,name):
|
||||
self.__dict__[name] = value
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
|
||||
def _swig_setattr(self,class_type,name,value):
|
||||
return _swig_setattr_nondynamic(self,class_type,name,value,0)
|
||||
|
||||
def _swig_getattr(self,class_type,name):
|
||||
if (name == "thisown"): return self.this.own()
|
||||
method = class_type.__swig_getmethods__.get(name,None)
|
||||
if method: return method(self)
|
||||
raise AttributeError,name
|
||||
|
||||
def _swig_repr(self):
|
||||
try: strthis = "proxy of " + self.this.__repr__()
|
||||
except: strthis = ""
|
||||
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
|
||||
|
||||
import types
|
||||
try:
|
||||
_object = types.ObjectType
|
||||
_newclass = 1
|
||||
except AttributeError:
|
||||
class _object : pass
|
||||
_newclass = 0
|
||||
del types
|
||||
|
||||
|
||||
def _swig_setattr_nondynamic_method(set):
|
||||
def set_attr(self,name,value):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if hasattr(self,name) or (name == "this"):
|
||||
set(self,name,value)
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
return set_attr
|
||||
|
||||
|
||||
import _core
|
||||
wx = _core
|
||||
__docfilter__ = wx.__DocFilter(globals())
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class CLSID(object):
|
||||
"""
|
||||
This class wraps the Windows CLSID structure and is used to
|
||||
specify the class of the ActiveX object that is to be created. A
|
||||
CLSID can be constructed from either a ProgID string, (such as
|
||||
'WordPad.Document.1') or a classID string, (such as
|
||||
'{CA8A9783-280D-11CF-A24D-444553540000}').
|
||||
"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
__repr__ = _swig_repr
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""
|
||||
__init__(self, String id) -> CLSID
|
||||
|
||||
This class wraps the Windows CLSID structure and is used to
|
||||
specify the class of the ActiveX object that is to be created. A
|
||||
CLSID can be constructed from either a ProgID string, (such as
|
||||
'WordPad.Document.1') or a classID string, (such as
|
||||
'{CA8A9783-280D-11CF-A24D-444553540000}').
|
||||
"""
|
||||
_activex.CLSID_swiginit(self,_activex.new_CLSID(*args, **kwargs))
|
||||
__swig_destroy__ = _activex.delete_CLSID
|
||||
__del__ = lambda self : None;
|
||||
def GetCLSIDString(*args, **kwargs):
|
||||
"""GetCLSIDString(self) -> String"""
|
||||
return _activex.CLSID_GetCLSIDString(*args, **kwargs)
|
||||
|
||||
def GetProgIDString(*args, **kwargs):
|
||||
"""GetProgIDString(self) -> String"""
|
||||
return _activex.CLSID_GetProgIDString(*args, **kwargs)
|
||||
|
||||
def __str__(self): return self.GetCLSIDString()
|
||||
_activex.CLSID_swigregister(CLSID)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class ParamX(object):
|
||||
"""Proxy of C++ ParamX class"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self): raise AttributeError, "No constructor defined"
|
||||
__repr__ = _swig_repr
|
||||
flags = property(_activex.ParamX_flags_get)
|
||||
isPtr = property(_activex.ParamX_isPtr_get)
|
||||
isSafeArray = property(_activex.ParamX_isSafeArray_get)
|
||||
isOptional = property(_activex.ParamX_isOptional_get)
|
||||
vt = property(_activex.ParamX_vt_get)
|
||||
name = property(_activex.ParamX_name_get)
|
||||
vt_type = property(_activex.ParamX_vt_type_get)
|
||||
|
||||
isIn = property(_activex.ParamX_IsIn)
|
||||
|
||||
isOut = property(_activex.ParamX_IsOut)
|
||||
|
||||
isRetVal = property(_activex.ParamX_IsRetVal)
|
||||
|
||||
_activex.ParamX_swigregister(ParamX)
|
||||
|
||||
class FuncX(object):
|
||||
"""Proxy of C++ FuncX class"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self): raise AttributeError, "No constructor defined"
|
||||
__repr__ = _swig_repr
|
||||
name = property(_activex.FuncX_name_get)
|
||||
memid = property(_activex.FuncX_memid_get)
|
||||
hasOut = property(_activex.FuncX_hasOut_get)
|
||||
retType = property(_activex.FuncX_retType_get)
|
||||
params = property(_activex.FuncX_params_get)
|
||||
_activex.FuncX_swigregister(FuncX)
|
||||
|
||||
class PropX(object):
|
||||
"""Proxy of C++ PropX class"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self): raise AttributeError, "No constructor defined"
|
||||
__repr__ = _swig_repr
|
||||
name = property(_activex.PropX_name_get)
|
||||
memid = property(_activex.PropX_memid_get)
|
||||
type = property(_activex.PropX_type_get)
|
||||
arg = property(_activex.PropX_arg_get)
|
||||
putByRef = property(_activex.PropX_putByRef_get)
|
||||
canGet = property(_activex.PropX_CanGet)
|
||||
|
||||
canSet = property(_activex.PropX_CanSet)
|
||||
|
||||
_activex.PropX_swigregister(PropX)
|
||||
|
||||
class ParamXArray(object):
|
||||
"""Proxy of C++ ParamXArray class"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self): raise AttributeError, "No constructor defined"
|
||||
__repr__ = _swig_repr
|
||||
def __nonzero__(*args, **kwargs):
|
||||
"""__nonzero__(self) -> bool"""
|
||||
return _activex.ParamXArray___nonzero__(*args, **kwargs)
|
||||
|
||||
def __len__(*args, **kwargs):
|
||||
"""__len__(self) -> int"""
|
||||
return _activex.ParamXArray___len__(*args, **kwargs)
|
||||
|
||||
def __getitem__(*args, **kwargs):
|
||||
"""__getitem__(self, int idx) -> ParamX"""
|
||||
return _activex.ParamXArray___getitem__(*args, **kwargs)
|
||||
|
||||
_activex.ParamXArray_swigregister(ParamXArray)
|
||||
|
||||
class FuncXArray(object):
|
||||
"""Proxy of C++ FuncXArray class"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self): raise AttributeError, "No constructor defined"
|
||||
__repr__ = _swig_repr
|
||||
def __nonzero__(*args, **kwargs):
|
||||
"""__nonzero__(self) -> bool"""
|
||||
return _activex.FuncXArray___nonzero__(*args, **kwargs)
|
||||
|
||||
def __len__(*args, **kwargs):
|
||||
"""__len__(self) -> int"""
|
||||
return _activex.FuncXArray___len__(*args, **kwargs)
|
||||
|
||||
def __getitem__(*args, **kwargs):
|
||||
"""__getitem__(self, int idx) -> FuncX"""
|
||||
return _activex.FuncXArray___getitem__(*args, **kwargs)
|
||||
|
||||
_activex.FuncXArray_swigregister(FuncXArray)
|
||||
|
||||
class PropXArray(object):
|
||||
"""Proxy of C++ PropXArray class"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self): raise AttributeError, "No constructor defined"
|
||||
__repr__ = _swig_repr
|
||||
def __nonzero__(*args, **kwargs):
|
||||
"""__nonzero__(self) -> bool"""
|
||||
return _activex.PropXArray___nonzero__(*args, **kwargs)
|
||||
|
||||
def __len__(*args, **kwargs):
|
||||
"""__len__(self) -> int"""
|
||||
return _activex.PropXArray___len__(*args, **kwargs)
|
||||
|
||||
def __getitem__(*args, **kwargs):
|
||||
"""__getitem__(self, int idx) -> PropX"""
|
||||
return _activex.PropXArray___getitem__(*args, **kwargs)
|
||||
|
||||
_activex.PropXArray_swigregister(PropXArray)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class ActiveXWindow(_core.Window):
|
||||
"""
|
||||
ActiveXWindow derives from wxWindow and the constructor accepts a
|
||||
CLSID for the ActiveX Control that should be created. The
|
||||
ActiveXWindow class simply adds methods that allow you to query
|
||||
some of the TypeInfo exposed by the ActiveX object, and also to
|
||||
get/set properties or call methods by name. The Python
|
||||
implementation automatically handles converting parameters and
|
||||
return values to/from the types expected by the ActiveX code as
|
||||
specified by the TypeInfo.
|
||||
|
||||
"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
__repr__ = _swig_repr
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""
|
||||
__init__(self, Window parent, CLSID clsId, int id=-1, Point pos=DefaultPosition,
|
||||
Size size=DefaultSize, long style=0,
|
||||
String name=PanelNameStr) -> ActiveXWindow
|
||||
|
||||
Creates an ActiveX control from the clsID given and makes it act
|
||||
as much like a regular wx.Window as possible.
|
||||
"""
|
||||
_activex.ActiveXWindow_swiginit(self,_activex.new_ActiveXWindow(*args, **kwargs))
|
||||
self._setOORInfo(self)
|
||||
|
||||
def GetCLSID(*args, **kwargs):
|
||||
"""
|
||||
GetCLSID(self) -> CLSID
|
||||
|
||||
Return the CLSID used to construct this ActiveX window
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetCLSID(*args, **kwargs)
|
||||
|
||||
def GetAXEventCount(*args, **kwargs):
|
||||
"""
|
||||
GetAXEventCount(self) -> int
|
||||
|
||||
Number of events defined for this control
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXEventCount(*args, **kwargs)
|
||||
|
||||
def GetAXEventDesc(*args, **kwargs):
|
||||
"""
|
||||
GetAXEventDesc(self, int idx) -> FuncX
|
||||
|
||||
Returns event description by index
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXEventDesc(*args, **kwargs)
|
||||
|
||||
def GetAXPropCount(*args, **kwargs):
|
||||
"""
|
||||
GetAXPropCount(self) -> int
|
||||
|
||||
Number of properties defined for this control
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXPropCount(*args, **kwargs)
|
||||
|
||||
def GetAXPropDesc(*args):
|
||||
"""
|
||||
GetAXPropDesc(self, int idx) -> PropX
|
||||
GetAXPropDesc(self, String name) -> PropX
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXPropDesc(*args)
|
||||
|
||||
def GetAXMethodCount(*args, **kwargs):
|
||||
"""
|
||||
GetAXMethodCount(self) -> int
|
||||
|
||||
Number of methods defined for this control
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXMethodCount(*args, **kwargs)
|
||||
|
||||
def GetAXMethodDesc(*args):
|
||||
"""
|
||||
GetAXMethodDesc(self, int idx) -> FuncX
|
||||
GetAXMethodDesc(self, String name) -> FuncX
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXMethodDesc(*args)
|
||||
|
||||
def GetAXEvents(*args, **kwargs):
|
||||
"""
|
||||
GetAXEvents(self) -> FuncXArray
|
||||
|
||||
Returns a sequence of FuncX objects describing the events
|
||||
available for this ActiveX object.
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXEvents(*args, **kwargs)
|
||||
|
||||
def GetAXMethods(*args, **kwargs):
|
||||
"""
|
||||
GetAXMethods(self) -> FuncXArray
|
||||
|
||||
Returns a sequence of FuncX objects describing the methods
|
||||
available for this ActiveX object.
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXMethods(*args, **kwargs)
|
||||
|
||||
def GetAXProperties(*args, **kwargs):
|
||||
"""
|
||||
GetAXProperties(self) -> PropXArray
|
||||
|
||||
Returns a sequence of PropX objects describing the properties
|
||||
available for this ActiveX object.
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXProperties(*args, **kwargs)
|
||||
|
||||
def SetAXProp(*args, **kwargs):
|
||||
"""
|
||||
SetAXProp(self, String name, PyObject value)
|
||||
|
||||
Set a property of the ActiveX object by name.
|
||||
"""
|
||||
return _activex.ActiveXWindow_SetAXProp(*args, **kwargs)
|
||||
|
||||
def GetAXProp(*args, **kwargs):
|
||||
"""
|
||||
GetAXProp(self, String name) -> PyObject
|
||||
|
||||
Get the value of an ActiveX property by name.
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXProp(*args, **kwargs)
|
||||
|
||||
def _CallAXMethod(*args):
|
||||
"""
|
||||
_CallAXMethod(self, String name, PyObject args) -> PyObject
|
||||
|
||||
The implementation for CallMethod. Calls an ActiveX method, by
|
||||
name passing the parameters given in args.
|
||||
"""
|
||||
return _activex.ActiveXWindow__CallAXMethod(*args)
|
||||
|
||||
def CallAXMethod(self, name, *args):
|
||||
"""
|
||||
Front-end for _CallMethod. Simply passes all positional args
|
||||
after the name as a single tuple to _CallMethod.
|
||||
"""
|
||||
return self._CallAXMethod(name, args)
|
||||
|
||||
_activex.ActiveXWindow_swigregister(ActiveXWindow)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def RegisterActiveXEvent(*args, **kwargs):
|
||||
"""
|
||||
RegisterActiveXEvent(String eventName) -> EventType
|
||||
|
||||
Creates a standard wx event ID for the given eventName.
|
||||
"""
|
||||
return _activex.RegisterActiveXEvent(*args, **kwargs)
|
||||
class ActiveXEvent(_core.CommandEvent):
|
||||
"""
|
||||
An instance of ActiveXEvent is sent to the handler for all bound
|
||||
ActiveX events. Any event parameters from the ActiveX cntrol are
|
||||
turned into attributes of the Python proxy for this event object.
|
||||
Additionally, there is a property called eventName that will
|
||||
return (surprisingly <wink>) the name of the ActiveX event.
|
||||
"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self): raise AttributeError, "No constructor defined"
|
||||
__repr__ = _swig_repr
|
||||
eventName = property(_activex.ActiveXEvent_EventName)
|
||||
|
||||
def _preCallInit(*args, **kwargs):
|
||||
"""_preCallInit(self, PyObject pyself)"""
|
||||
return _activex.ActiveXEvent__preCallInit(*args, **kwargs)
|
||||
|
||||
def _postCallCleanup(*args, **kwargs):
|
||||
"""_postCallCleanup(self, PyObject pyself)"""
|
||||
return _activex.ActiveXEvent__postCallCleanup(*args, **kwargs)
|
||||
|
||||
_activex.ActiveXEvent_swigregister(ActiveXEvent)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class IEHtmlWindowBase(ActiveXWindow):
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
__repr__ = _swig_repr
|
||||
def __init__(self, *args, **kwargs):
|
||||
_activex.IEHtmlWindowBase_swiginit(self,_activex.new_IEHtmlWindowBase(*args, **kwargs))
|
||||
self._setOORInfo(self)
|
||||
|
||||
def SetCharset(*args, **kwargs): return _activex.IEHtmlWindowBase_SetCharset(*args, **kwargs)
|
||||
def LoadString(*args, **kwargs): return _activex.IEHtmlWindowBase_LoadString(*args, **kwargs)
|
||||
def LoadStream(*args, **kwargs): return _activex.IEHtmlWindowBase_LoadStream(*args, **kwargs)
|
||||
def GetStringSelection(*args, **kwargs): return _activex.IEHtmlWindowBase_GetStringSelection(*args, **kwargs)
|
||||
def GetText(*args, **kwargs): return _activex.IEHtmlWindowBase_GetText(*args, **kwargs)
|
||||
_activex.IEHtmlWindowBase_swigregister(IEHtmlWindowBase)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Some helper and utility functions for ActiveX
|
||||
|
||||
|
||||
t4 = " " * 4
|
||||
t8 = " " * 8
|
||||
|
||||
def GetAXInfo(ax):
|
||||
"""
|
||||
Returns a printable summary of the TypeInfo from the ActiveX instance
|
||||
passed in.
|
||||
"""
|
||||
|
||||
def ProcessFuncX(f, out, name):
|
||||
out.append(name)
|
||||
out.append(t4 + "retType: %s" % f.retType.vt_type)
|
||||
if f.params:
|
||||
out.append(t4 + "params:")
|
||||
for p in f.params:
|
||||
out.append(t8 + p.name)
|
||||
out.append(t8+t4+ "in:%s out:%s optional:%s type:%s" % (p.isIn, p.isOut, p.isOptional, p.vt_type))
|
||||
out.append('')
|
||||
|
||||
def ProcessPropX(p, out):
|
||||
out.append(GernerateAXModule.trimPropName(p.name))
|
||||
out.append(t4+ "type:%s arg:%s canGet:%s canSet:%s" % (p.type.vt_type, p.arg.vt_type, p.canGet, p.canSet))
|
||||
out.append('')
|
||||
|
||||
out = []
|
||||
|
||||
out.append("PROPERTIES")
|
||||
out.append("-"*20)
|
||||
for p in ax.GetAXProperties():
|
||||
ProcessPropX(p, out)
|
||||
out.append('\n\n')
|
||||
|
||||
out.append("METHODS")
|
||||
out.append("-"*20)
|
||||
for m in ax.GetAXMethods():
|
||||
ProcessFuncX(m, out, GernerateAXModule.trimMethodName(m.name))
|
||||
out.append('\n\n')
|
||||
|
||||
out.append("EVENTS")
|
||||
out.append("-"*20)
|
||||
for e in ax.GetAXEvents():
|
||||
ProcessFuncX(e, out, GernerateAXModule.trimEventName(e.name))
|
||||
out.append('\n\n')
|
||||
|
||||
return "\n".join(out)
|
||||
|
||||
|
||||
|
||||
class GernerateAXModule:
|
||||
def __init__(self, ax, className, modulePath, moduleName=None, verbose=False):
|
||||
"""
|
||||
Make a Python module file with a class that has been specialized
|
||||
for the AcitveX object.
|
||||
|
||||
ax An instance of the ActiveXWindow class
|
||||
className The name to use for the new class
|
||||
modulePath The path where the new module should be written to
|
||||
moduleName The name of the .py file to create. If not given
|
||||
then the className will be used.
|
||||
"""
|
||||
import os
|
||||
if moduleName is None:
|
||||
moduleName = className + '.py'
|
||||
filename = os.path.join(modulePath, moduleName)
|
||||
if verbose:
|
||||
print "Creating module in:", filename
|
||||
print " ProgID: ", ax.GetCLSID().GetProgIDString()
|
||||
print " CLSID: ", ax.GetCLSID().GetCLSIDString()
|
||||
print
|
||||
self.mf = file(filename, "w")
|
||||
self.WriteFileHeader(ax)
|
||||
self.WriteEvents(ax)
|
||||
self.WriteClassHeader(ax, className)
|
||||
self.WriteMethods(ax)
|
||||
self.WriteProperties(ax)
|
||||
self.WriteDocs(ax)
|
||||
self.mf.close()
|
||||
del self.mf
|
||||
|
||||
|
||||
def WriteFileHeader(self, ax):
|
||||
self.write("# This module was generated by the wx.activex.GernerateAXModule class\n"
|
||||
"# (See also the genaxmodule script.)\n")
|
||||
self.write("import wx")
|
||||
self.write("import wx.activex\n")
|
||||
self.write("clsID = '%s'\nprogID = '%s'\n"
|
||||
% (ax.GetCLSID().GetCLSIDString(), ax.GetCLSID().GetProgIDString()))
|
||||
self.write("\n")
|
||||
|
||||
|
||||
def WriteEvents(self, ax):
|
||||
events = ax.GetAXEvents()
|
||||
if events:
|
||||
self.write("# Create eventTypes and event binders")
|
||||
for e in events:
|
||||
self.write("wxEVT_%s = wx.activex.RegisterActiveXEvent('%s')"
|
||||
% (self.trimEventName(e.name), e.name))
|
||||
self.write()
|
||||
for e in events:
|
||||
n = self.trimEventName(e.name)
|
||||
self.write("EVT_%s = wx.PyEventBinder(wxEVT_%s, 1)" % (n,n))
|
||||
self.write("\n")
|
||||
|
||||
|
||||
def WriteClassHeader(self, ax, className):
|
||||
self.write("# Derive a new class from ActiveXWindow")
|
||||
self.write("""\
|
||||
class %s(wx.activex.ActiveXWindow):
|
||||
def __init__(self, parent, ID=-1, pos=wx.DefaultPosition,
|
||||
size=wx.DefaultSize, style=0, name='%s'):
|
||||
wx.activex.ActiveXWindow.__init__(self, parent,
|
||||
wx.activex.CLSID('%s'),
|
||||
ID, pos, size, style, name)
|
||||
""" % (className, className, ax.GetCLSID().GetCLSIDString()) )
|
||||
|
||||
|
||||
def WriteMethods(self, ax):
|
||||
methods = ax.GetAXMethods()
|
||||
if methods:
|
||||
self.write(t4, "# Methods exported by the ActiveX object")
|
||||
for m in methods:
|
||||
name = self.trimMethodName(m.name)
|
||||
self.write(t4, "def %s(self%s):" % (name, self.getParameters(m, True)))
|
||||
self.write(t8, "return self.CallAXMethod('%s'%s)" % (m.name, self.getParameters(m, False)))
|
||||
self.write()
|
||||
|
||||
|
||||
def WriteProperties(self, ax):
|
||||
props = ax.GetAXProperties()
|
||||
if props:
|
||||
self.write(t4, "# Getters, Setters and properties")
|
||||
for p in props:
|
||||
getterName = setterName = "None"
|
||||
if p.canGet:
|
||||
getterName = "_get_" + p.name
|
||||
self.write(t4, "def %s(self):" % getterName)
|
||||
self.write(t8, "return self.GetAXProp('%s')" % p.name)
|
||||
if p.canSet:
|
||||
setterName = "_set_" + p.name
|
||||
self.write(t4, "def %s(self, %s):" % (setterName, p.arg.name))
|
||||
self.write(t8, "self.SetAXProp('%s', %s)" % (p.name, p.arg.name))
|
||||
|
||||
self.write(t4, "%s = property(%s, %s)" %
|
||||
(self.trimPropName(p.name), getterName, setterName))
|
||||
self.write()
|
||||
|
||||
|
||||
def WriteDocs(self, ax):
|
||||
self.write()
|
||||
doc = GetAXInfo(ax)
|
||||
for line in doc.split('\n'):
|
||||
self.write("# ", line)
|
||||
|
||||
|
||||
|
||||
def write(self, *args):
|
||||
for a in args:
|
||||
self.mf.write(a)
|
||||
self.mf.write("\n")
|
||||
|
||||
|
||||
def trimEventName(name):
|
||||
if name.startswith("On"):
|
||||
name = name[2:]
|
||||
return name
|
||||
trimEventName = staticmethod(trimEventName)
|
||||
|
||||
|
||||
def trimPropName(name):
|
||||
#name = name[0].lower() + name[1:]
|
||||
name = name.lower()
|
||||
import keyword
|
||||
if name in keyword.kwlist: name += '_'
|
||||
return name
|
||||
trimPropName = staticmethod(trimPropName)
|
||||
|
||||
|
||||
def trimMethodName(name):
|
||||
import keyword
|
||||
if name in keyword.kwlist: name += '_'
|
||||
return name
|
||||
trimMethodName = staticmethod(trimMethodName)
|
||||
|
||||
|
||||
def getParameters(self, m, withDefaults):
|
||||
import keyword
|
||||
st = ""
|
||||
# collect the input parameters, if both isIn and isOut are
|
||||
# False then assume it is an input paramater
|
||||
params = []
|
||||
for p in m.params:
|
||||
if p.isIn or (not p.isIn and not p.isOut):
|
||||
params.append(p)
|
||||
# did we get any?
|
||||
for p in params:
|
||||
name = p.name
|
||||
if name in keyword.kwlist: name += '_'
|
||||
st += ", "
|
||||
st += name
|
||||
if withDefaults and p.isOptional:
|
||||
st += '=None'
|
||||
return st
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,133 +0,0 @@
|
|||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
// This module contains the declarations of the stream adapters and such that
|
||||
// used to be in IEHtmlWin.cpp, so that they can be used independently in the
|
||||
// wxPython wrappers...
|
||||
|
||||
|
||||
#ifndef _IEHTMLSTREAM_H_
|
||||
#define _IEHTMLSTREAM_H_
|
||||
|
||||
|
||||
class IStreamAdaptorBase : public IStream
|
||||
{
|
||||
private:
|
||||
DECLARE_OLE_UNKNOWN(IStreamAdaptorBase);
|
||||
|
||||
public:
|
||||
string prepend;
|
||||
|
||||
IStreamAdaptorBase() {}
|
||||
virtual ~IStreamAdaptorBase() {}
|
||||
|
||||
virtual int Read(char *buf, int cb) = 0;
|
||||
|
||||
// ISequentialStream
|
||||
HRESULT STDMETHODCALLTYPE Read(void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbRead);
|
||||
|
||||
HRESULT STDMETHODCALLTYPE Write(const void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbWritten) {return E_NOTIMPL;}
|
||||
|
||||
// IStream
|
||||
HRESULT STDMETHODCALLTYPE Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER __RPC_FAR *plibNewPosition) {return E_NOTIMPL;}
|
||||
HRESULT STDMETHODCALLTYPE SetSize(ULARGE_INTEGER libNewSize) {return E_NOTIMPL;}
|
||||
HRESULT STDMETHODCALLTYPE CopyTo(IStream __RPC_FAR *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER __RPC_FAR *pcbRead, ULARGE_INTEGER __RPC_FAR *pcbWritten) {return E_NOTIMPL;}
|
||||
HRESULT STDMETHODCALLTYPE Commit(DWORD grfCommitFlags) {return E_NOTIMPL;}
|
||||
HRESULT STDMETHODCALLTYPE Revert(void) {return E_NOTIMPL;}
|
||||
HRESULT STDMETHODCALLTYPE LockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) {return E_NOTIMPL;}
|
||||
HRESULT STDMETHODCALLTYPE UnlockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) {return E_NOTIMPL;}
|
||||
HRESULT STDMETHODCALLTYPE Stat(STATSTG __RPC_FAR *pstatstg, DWORD grfStatFlag) {return E_NOTIMPL;}
|
||||
HRESULT STDMETHODCALLTYPE Clone(IStream __RPC_FAR *__RPC_FAR *ppstm) {return E_NOTIMPL;}
|
||||
};
|
||||
|
||||
|
||||
|
||||
class IStreamAdaptor : public IStreamAdaptorBase
|
||||
{
|
||||
private:
|
||||
istream *m_is;
|
||||
|
||||
public:
|
||||
IStreamAdaptor(istream *is);
|
||||
~IStreamAdaptor();
|
||||
int Read(char *buf, int cb);
|
||||
};
|
||||
|
||||
|
||||
|
||||
class IwxStreamAdaptor : public IStreamAdaptorBase
|
||||
{
|
||||
private:
|
||||
wxInputStream *m_is;
|
||||
|
||||
public:
|
||||
IwxStreamAdaptor(wxInputStream *is);
|
||||
~IwxStreamAdaptor();
|
||||
int Read(char *buf, int cb);
|
||||
};
|
||||
|
||||
|
||||
class wxOwnedMemInputStream : public wxMemoryInputStream
|
||||
{
|
||||
public:
|
||||
char *m_data;
|
||||
|
||||
wxOwnedMemInputStream(char *data, size_t len);
|
||||
~wxOwnedMemInputStream();
|
||||
};
|
||||
|
||||
|
||||
wxAutoOleInterface<IHTMLTxtRange> wxieGetSelRange(IOleObject *oleObject);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,478 +0,0 @@
|
|||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
#include "IEHtmlWin.h"
|
||||
#include <wx/strconv.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/event.h>
|
||||
#include <wx/listctrl.h>
|
||||
#include <wx/mstream.h>
|
||||
#include <oleidl.h>
|
||||
#include <winerror.h>
|
||||
#include <exdispid.h>
|
||||
#include <exdisp.h>
|
||||
#include <olectl.h>
|
||||
#include <Mshtml.h>
|
||||
#include <sstream>
|
||||
#include <IEHtmlStream.h>
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Stream adapters and such
|
||||
|
||||
HRESULT STDMETHODCALLTYPE IStreamAdaptorBase::Read(void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbRead)
|
||||
{
|
||||
if (prepend.size() > 0)
|
||||
{
|
||||
int n = wxMin(prepend.size(), cb);
|
||||
prepend.copy((char *) pv, n);
|
||||
prepend = prepend.substr(n);
|
||||
if (pcbRead)
|
||||
*pcbRead = n;
|
||||
|
||||
return S_OK;
|
||||
};
|
||||
|
||||
int rc = Read((char *) pv, cb);
|
||||
if (pcbRead)
|
||||
*pcbRead = rc;
|
||||
|
||||
return S_OK;
|
||||
};
|
||||
|
||||
DEFINE_OLE_TABLE(IStreamAdaptorBase)
|
||||
OLE_IINTERFACE(IUnknown)
|
||||
OLE_IINTERFACE(ISequentialStream)
|
||||
OLE_IINTERFACE(IStream)
|
||||
END_OLE_TABLE;
|
||||
|
||||
|
||||
IStreamAdaptor::IStreamAdaptor(istream *is)
|
||||
: IStreamAdaptorBase(), m_is(is)
|
||||
{
|
||||
wxASSERT(m_is != NULL);
|
||||
}
|
||||
|
||||
IStreamAdaptor::~IStreamAdaptor()
|
||||
{
|
||||
delete m_is;
|
||||
}
|
||||
|
||||
int IStreamAdaptor::Read(char *buf, int cb)
|
||||
{
|
||||
m_is->read(buf, cb);
|
||||
return m_is->gcount();
|
||||
}
|
||||
|
||||
|
||||
IwxStreamAdaptor::IwxStreamAdaptor(wxInputStream *is)
|
||||
: IStreamAdaptorBase(), m_is(is)
|
||||
{
|
||||
wxASSERT(m_is != NULL);
|
||||
}
|
||||
IwxStreamAdaptor::~IwxStreamAdaptor()
|
||||
{
|
||||
delete m_is;
|
||||
}
|
||||
|
||||
// ISequentialStream
|
||||
int IwxStreamAdaptor::Read(char *buf, int cb)
|
||||
{
|
||||
m_is->Read(buf, cb);
|
||||
return m_is->LastRead();
|
||||
};
|
||||
|
||||
wxOwnedMemInputStream::wxOwnedMemInputStream(char *data, size_t len)
|
||||
: wxMemoryInputStream(data, len), m_data(data)
|
||||
{}
|
||||
|
||||
wxOwnedMemInputStream::~wxOwnedMemInputStream()
|
||||
{
|
||||
free(m_data);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
BEGIN_EVENT_TABLE(wxIEHtmlWin, wxActiveX)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
static const CLSID CLSID_MozillaBrowser =
|
||||
{ 0x1339B54C, 0x3453, 0x11D2,
|
||||
{ 0x93, 0xB9, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00 } };
|
||||
|
||||
|
||||
//#define PROGID "Shell.Explorer"
|
||||
#define PROGID CLSID_WebBrowser
|
||||
//#define PROGID CLSID_MozillaBrowser
|
||||
//#define PROGID CLSID_HTMLDocument
|
||||
//#define PROGID "MSCAL.Calendar"
|
||||
//#define PROGID ""
|
||||
//#define PROGID "SoftwareFX.ChartFX.20"
|
||||
|
||||
wxIEHtmlWin::wxIEHtmlWin(wxWindow * parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name) :
|
||||
wxActiveX(parent, PROGID, id, pos, size, style, name)
|
||||
{
|
||||
SetupBrowser();
|
||||
}
|
||||
|
||||
|
||||
wxIEHtmlWin::~wxIEHtmlWin()
|
||||
{
|
||||
}
|
||||
|
||||
void wxIEHtmlWin::SetupBrowser()
|
||||
{
|
||||
HRESULT hret;
|
||||
|
||||
// Get IWebBrowser2 Interface
|
||||
hret = m_webBrowser.QueryInterface(IID_IWebBrowser2, m_ActiveX);
|
||||
assert(SUCCEEDED(hret));
|
||||
|
||||
// web browser setup
|
||||
m_webBrowser->put_MenuBar(VARIANT_FALSE);
|
||||
m_webBrowser->put_AddressBar(VARIANT_FALSE);
|
||||
m_webBrowser->put_StatusBar(VARIANT_FALSE);
|
||||
m_webBrowser->put_ToolBar(VARIANT_FALSE);
|
||||
|
||||
m_webBrowser->put_RegisterAsBrowser(VARIANT_TRUE);
|
||||
m_webBrowser->put_RegisterAsDropTarget(VARIANT_TRUE);
|
||||
|
||||
m_webBrowser->Navigate( L"about:blank", NULL, NULL, NULL, NULL );
|
||||
}
|
||||
|
||||
|
||||
void wxIEHtmlWin::SetEditMode(bool seton)
|
||||
{
|
||||
m_bAmbientUserMode = ! seton;
|
||||
AmbientPropertyChanged(DISPID_AMBIENT_USERMODE);
|
||||
};
|
||||
|
||||
bool wxIEHtmlWin::GetEditMode()
|
||||
{
|
||||
return ! m_bAmbientUserMode;
|
||||
};
|
||||
|
||||
|
||||
void wxIEHtmlWin::SetCharset(const wxString& charset)
|
||||
{
|
||||
// HTML Document ?
|
||||
IDispatch *pDisp = NULL;
|
||||
HRESULT hret = m_webBrowser->get_Document(&pDisp);
|
||||
wxAutoOleInterface<IDispatch> disp(pDisp);
|
||||
|
||||
if (disp.Ok())
|
||||
{
|
||||
wxAutoOleInterface<IHTMLDocument2> doc(IID_IHTMLDocument2, disp);
|
||||
if (doc.Ok())
|
||||
doc->put_charset((BSTR) (const wchar_t *) charset.wc_str(wxConvUTF8));
|
||||
//doc->put_charset((BSTR) wxConvUTF8.cMB2WC(charset).data());
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
void wxIEHtmlWin::LoadUrl(const wxString& url)
|
||||
{
|
||||
VARIANTARG navFlag, targetFrame, postData, headers;
|
||||
navFlag.vt = VT_EMPTY;
|
||||
navFlag.vt = VT_I2;
|
||||
navFlag.iVal = navNoReadFromCache;
|
||||
targetFrame.vt = VT_EMPTY;
|
||||
postData.vt = VT_EMPTY;
|
||||
headers.vt = VT_EMPTY;
|
||||
|
||||
HRESULT hret = 0;
|
||||
hret = m_webBrowser->Navigate((BSTR) (const wchar_t *) url.wc_str(wxConvUTF8),
|
||||
&navFlag, &targetFrame, &postData, &headers);
|
||||
};
|
||||
|
||||
|
||||
bool wxIEHtmlWin::LoadString(const wxString& html)
|
||||
{
|
||||
char *data = NULL;
|
||||
size_t len = html.length();
|
||||
#ifdef UNICODE
|
||||
len *= 2;
|
||||
#endif
|
||||
data = (char *) malloc(len);
|
||||
memcpy(data, html.c_str(), len);
|
||||
return LoadStream(new wxOwnedMemInputStream(data, len));
|
||||
};
|
||||
|
||||
bool wxIEHtmlWin::LoadStream(IStreamAdaptorBase *pstrm)
|
||||
{
|
||||
// need to prepend this as poxy MSHTML will not recognise a HTML comment
|
||||
// as starting a html document and treats it as plain text
|
||||
// Does nayone know how to force it to html mode ?
|
||||
pstrm->prepend = "<html>";
|
||||
|
||||
// strip leading whitespace as it can confuse MSHTML
|
||||
wxAutoOleInterface<IStream> strm(pstrm);
|
||||
|
||||
// Document Interface
|
||||
IDispatch *pDisp = NULL;
|
||||
HRESULT hret = m_webBrowser->get_Document(&pDisp);
|
||||
if (! pDisp)
|
||||
return false;
|
||||
wxAutoOleInterface<IDispatch> disp(pDisp);
|
||||
|
||||
|
||||
// get IPersistStreamInit
|
||||
wxAutoOleInterface<IPersistStreamInit>
|
||||
pPersistStreamInit(IID_IPersistStreamInit, disp);
|
||||
|
||||
if (pPersistStreamInit.Ok())
|
||||
{
|
||||
HRESULT hr = pPersistStreamInit->InitNew();
|
||||
if (SUCCEEDED(hr))
|
||||
hr = pPersistStreamInit->Load(strm);
|
||||
|
||||
return SUCCEEDED(hr);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
};
|
||||
|
||||
bool wxIEHtmlWin::LoadStream(istream *is)
|
||||
{
|
||||
// wrap reference around stream
|
||||
IStreamAdaptor *pstrm = new IStreamAdaptor(is);
|
||||
pstrm->AddRef();
|
||||
|
||||
return LoadStream(pstrm);
|
||||
};
|
||||
|
||||
bool wxIEHtmlWin::LoadStream(wxInputStream *is)
|
||||
{
|
||||
// wrap reference around stream
|
||||
IwxStreamAdaptor *pstrm = new IwxStreamAdaptor(is);
|
||||
pstrm->AddRef();
|
||||
|
||||
return LoadStream(pstrm);
|
||||
};
|
||||
|
||||
|
||||
bool wxIEHtmlWin::GoBack()
|
||||
{
|
||||
HRESULT hret = 0;
|
||||
hret = m_webBrowser->GoBack();
|
||||
return hret == S_OK;
|
||||
}
|
||||
|
||||
bool wxIEHtmlWin::GoForward()
|
||||
{
|
||||
HRESULT hret = 0;
|
||||
hret = m_webBrowser->GoForward();
|
||||
return hret == S_OK;
|
||||
}
|
||||
|
||||
bool wxIEHtmlWin::GoHome()
|
||||
{
|
||||
try
|
||||
{
|
||||
CallMethod(_T("GoHome"));
|
||||
return true;
|
||||
}
|
||||
catch(exception&)
|
||||
{
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
bool wxIEHtmlWin::GoSearch()
|
||||
{
|
||||
HRESULT hret = 0;
|
||||
hret = m_webBrowser->GoSearch();
|
||||
return hret == S_OK;
|
||||
}
|
||||
|
||||
bool wxIEHtmlWin::Refresh(wxIEHtmlRefreshLevel level)
|
||||
{
|
||||
VARIANTARG levelArg;
|
||||
HRESULT hret = 0;
|
||||
|
||||
levelArg.vt = VT_I2;
|
||||
levelArg.iVal = level;
|
||||
hret = m_webBrowser->Refresh2(&levelArg);
|
||||
return hret == S_OK;
|
||||
}
|
||||
|
||||
bool wxIEHtmlWin::Stop()
|
||||
{
|
||||
HRESULT hret = 0;
|
||||
hret = m_webBrowser->Stop();
|
||||
return hret == S_OK;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static wxAutoOleInterface<IHTMLSelectionObject> GetSelObject(IOleObject *oleObject)
|
||||
{
|
||||
// Query for IWebBrowser interface
|
||||
wxAutoOleInterface<IWebBrowser2> wb(IID_IWebBrowser2, oleObject);
|
||||
if (! wb.Ok())
|
||||
return wxAutoOleInterface<IHTMLSelectionObject>();
|
||||
|
||||
IDispatch *iDisp = NULL;
|
||||
HRESULT hr = wb->get_Document(&iDisp);
|
||||
if (hr != S_OK)
|
||||
return wxAutoOleInterface<IHTMLSelectionObject>();
|
||||
|
||||
// Query for Document Interface
|
||||
wxAutoOleInterface<IHTMLDocument2> hd(IID_IHTMLDocument2, iDisp);
|
||||
iDisp->Release();
|
||||
|
||||
if (! hd.Ok())
|
||||
return wxAutoOleInterface<IHTMLSelectionObject>();
|
||||
|
||||
IHTMLSelectionObject *_so = NULL;
|
||||
hr = hd->get_selection(&_so);
|
||||
|
||||
// take ownership of selection object
|
||||
wxAutoOleInterface<IHTMLSelectionObject> so(_so);
|
||||
|
||||
return so;
|
||||
};
|
||||
|
||||
wxAutoOleInterface<IHTMLTxtRange> wxieGetSelRange(IOleObject *oleObject)
|
||||
{
|
||||
wxAutoOleInterface<IHTMLTxtRange> tr;
|
||||
|
||||
wxAutoOleInterface<IHTMLSelectionObject> so(GetSelObject(oleObject));
|
||||
if (! so)
|
||||
return tr;
|
||||
|
||||
IDispatch *iDisp = NULL;
|
||||
HRESULT hr = so->createRange(&iDisp);
|
||||
if (hr != S_OK)
|
||||
return tr;
|
||||
|
||||
// Query for IHTMLTxtRange interface
|
||||
tr.QueryInterface(IID_IHTMLTxtRange, iDisp);
|
||||
iDisp->Release();
|
||||
return tr;
|
||||
};
|
||||
|
||||
|
||||
wxString wxIEHtmlWin::GetStringSelection(bool asHTML)
|
||||
{
|
||||
wxAutoOleInterface<IHTMLTxtRange> tr(wxieGetSelRange(m_oleObject));
|
||||
if (! tr)
|
||||
return wxEmptyString;
|
||||
|
||||
BSTR text = NULL;
|
||||
HRESULT hr = E_FAIL;
|
||||
|
||||
if (asHTML)
|
||||
hr = tr->get_htmlText(&text);
|
||||
else
|
||||
hr = tr->get_text(&text);
|
||||
if (hr != S_OK)
|
||||
return wxEmptyString;
|
||||
|
||||
wxString s = text;
|
||||
SysFreeString(text);
|
||||
|
||||
return s;
|
||||
};
|
||||
|
||||
wxString wxIEHtmlWin::GetText(bool asHTML)
|
||||
{
|
||||
if (! m_webBrowser.Ok())
|
||||
return wxEmptyString;
|
||||
|
||||
// get document dispatch interface
|
||||
IDispatch *iDisp = NULL;
|
||||
HRESULT hr = m_webBrowser->get_Document(&iDisp);
|
||||
if (hr != S_OK)
|
||||
return wxEmptyString;
|
||||
|
||||
// Query for Document Interface
|
||||
wxAutoOleInterface<IHTMLDocument2> hd(IID_IHTMLDocument2, iDisp);
|
||||
iDisp->Release();
|
||||
|
||||
if (! hd.Ok())
|
||||
return wxEmptyString;
|
||||
|
||||
// get body element
|
||||
IHTMLElement *_body = NULL;
|
||||
hd->get_body(&_body);
|
||||
if (! _body)
|
||||
return wxEmptyString;
|
||||
wxAutoOleInterface<IHTMLElement> body(_body);
|
||||
|
||||
// get inner text
|
||||
BSTR text = NULL;
|
||||
hr = E_FAIL;
|
||||
|
||||
if (asHTML)
|
||||
hr = body->get_innerHTML(&text);
|
||||
else
|
||||
hr = body->get_innerText(&text);
|
||||
if (hr != S_OK)
|
||||
return wxEmptyString;
|
||||
|
||||
wxString s = text;
|
||||
SysFreeString(text);
|
||||
|
||||
return s;
|
||||
};
|
||||
|
|
@ -1,120 +0,0 @@
|
|||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
/*! \file iehtmlwin.h
|
||||
\brief implements wxIEHtmlWin window class
|
||||
*/
|
||||
#ifndef _IEHTMLWIN_H_
|
||||
#define _IEHTMLWIN_H_
|
||||
#pragma warning( disable : 4101 4786)
|
||||
#pragma warning( disable : 4786)
|
||||
|
||||
|
||||
#include <wx/setup.h>
|
||||
#include <wx/wx.h>
|
||||
#include <exdisp.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include "wxactivex.h"
|
||||
|
||||
|
||||
enum wxIEHtmlRefreshLevel
|
||||
{
|
||||
wxIEHTML_REFRESH_NORMAL = 0,
|
||||
wxIEHTML_REFRESH_IFEXPIRED = 1,
|
||||
wxIEHTML_REFRESH_CONTINUE = 2,
|
||||
wxIEHTML_REFRESH_COMPLETELY = 3
|
||||
};
|
||||
|
||||
class IStreamAdaptorBase;
|
||||
|
||||
class wxIEHtmlWin : public wxActiveX
|
||||
{
|
||||
public:
|
||||
wxIEHtmlWin(wxWindow * parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
virtual ~wxIEHtmlWin();
|
||||
|
||||
void LoadUrl(const wxString& url);
|
||||
bool LoadString(const wxString& html);
|
||||
bool LoadStream(istream *strm);
|
||||
bool LoadStream(wxInputStream *is);
|
||||
|
||||
void SetCharset(const wxString& charset);
|
||||
void SetEditMode(bool seton);
|
||||
bool GetEditMode();
|
||||
wxString GetStringSelection(bool asHTML = false);
|
||||
wxString GetText(bool asHTML = false);
|
||||
|
||||
bool GoBack();
|
||||
bool GoForward();
|
||||
bool GoHome();
|
||||
bool GoSearch();
|
||||
bool Refresh(wxIEHtmlRefreshLevel level);
|
||||
bool Stop();
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
protected:
|
||||
void SetupBrowser();
|
||||
bool LoadStream(IStreamAdaptorBase *pstrm);
|
||||
|
||||
wxAutoOleInterface<IWebBrowser2> m_webBrowser;
|
||||
};
|
||||
|
||||
#endif /* _IEHTMLWIN_H_ */
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
The contents of this dir are from the 9-Jan-2004 version of wxie.zip
|
||||
downloaded from:
|
||||
|
||||
http://members.optusnet.com.au/~blackpaw1/wxactivex.html
|
||||
|
||||
|
||||
|
|
@ -1,205 +0,0 @@
|
|||
# Doxyfile 1.3-rc2
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# General configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = wxActiveX
|
||||
PROJECT_NUMBER =
|
||||
OUTPUT_DIRECTORY =
|
||||
OUTPUT_LANGUAGE = English
|
||||
EXTRACT_ALL = NO
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
HIDE_UNDOC_MEMBERS = YES
|
||||
HIDE_UNDOC_CLASSES = YES
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = NO
|
||||
STRIP_FROM_PATH =
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
SHORT_NAMES = NO
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
VERBATIM_HEADERS = YES
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
DETAILS_AT_TOP = YES
|
||||
INHERIT_DOCS = NO
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = NO
|
||||
DISTRIBUTE_GROUP_DOC = YES
|
||||
TAB_SIZE = 8
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ALIASES =
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
SHOW_USED_FILES = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_FORMAT = "$file($line): $text"
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = .\wxactivex.h .\iehtmlwin.h
|
||||
FILE_PATTERNS = *.cpp \
|
||||
*.c \
|
||||
*.h \
|
||||
*.cxx \
|
||||
*.idl
|
||||
RECURSIVE = NO
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS =
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = YES
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = NO
|
||||
REFERENCES_RELATION = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = YES
|
||||
COLS_IN_ALPHA_INDEX = 4
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = doxydoc
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = no
|
||||
CHM_FILE = wxactivex.chm
|
||||
HHC_LOCATION = hhc.exe
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = NO
|
||||
TREEVIEW_WIDTH = 250
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = YES
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED =
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::addtions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = YES
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = NO
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
TEMPLATE_RELATIONS = YES
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
MAX_DOT_GRAPH_WIDTH = 1024
|
||||
MAX_DOT_GRAPH_HEIGHT = 1024
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::addtions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = NO
|
||||
CGI_NAME = search.cgi
|
||||
CGI_URL =
|
||||
DOC_URL =
|
||||
DOC_ABSPATH =
|
||||
BIN_ABSPATH = /usr/local/bin/
|
||||
EXT_DOC_PATHS =
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
|
||||
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
CC = gcc
|
||||
|
||||
PROGRAM = wxIE
|
||||
|
||||
CFLAGS = -I/m/snowball/icicle/gswd/devenv/include -D__WXMOTIF__
|
||||
LFLAGS = -L/m/snowball/icicle/devenv/lib
|
||||
|
||||
# implementation
|
||||
|
||||
.SUFFIXES: .o .cpp
|
||||
|
||||
SOURCES:sh= /bin/ls *.cpp
|
||||
|
||||
OBJECTS = $(SOURCES:.cpp=.o)
|
||||
|
||||
.cpp.o :
|
||||
$(CC) -c $(CFLAGS) `wx-config --cflags` -o $@ $<
|
||||
|
||||
$(PROGRAM): $(OBJECTS)
|
||||
$(CC) -o $(PROGRAM) $(OBJECTS) $(LFLAGS) `wx-config --libs`
|
||||
|
||||
clean:
|
||||
rm -f *.o $(PROGRAM)
|
||||
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
CC = gcc
|
||||
|
||||
PROGRAM = wxIE
|
||||
|
||||
CFLAGS = -I/m/snowball/icicle/gswd/devenv/include -D__WXGTK__
|
||||
LFLAGS = -L/m/snowball/icicle/devenv/lib
|
||||
|
||||
# implementation
|
||||
|
||||
.SUFFIXES: .o .cpp
|
||||
|
||||
SOURCES:sh= /bin/ls *.cpp
|
||||
|
||||
OBJECTS = $(SOURCES:.cpp=.o)
|
||||
|
||||
.cpp.o :
|
||||
$(CC) -c $(CFLAGS) `wx-config --cflags` -o $@ $<
|
||||
|
||||
$(PROGRAM): $(OBJECTS)
|
||||
$(CC) -o $(PROGRAM) $(OBJECTS) $(LFLAGS) `wx-config --libs`
|
||||
|
||||
clean:
|
||||
rm -f *.o $(PROGRAM)
|
||||
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
CC = gcc
|
||||
|
||||
PROGRAM = wxIE
|
||||
|
||||
CFLAGS = -I/m/snowball/icicle/gswd/devenv/include -D__WXMOTIF__
|
||||
LFLAGS = -L/m/snowball/icicle/devenv/lib
|
||||
|
||||
# implementation
|
||||
|
||||
.SUFFIXES: .o .cpp
|
||||
|
||||
SOURCES:sh= /bin/ls *.cpp
|
||||
|
||||
OBJECTS = $(SOURCES:.cpp=.o)
|
||||
|
||||
.cpp.o :
|
||||
$(CC) -c $(CFLAGS) `wx-config --cflags` -o $@ $<
|
||||
|
||||
$(PROGRAM): $(OBJECTS)
|
||||
$(CC) -o $(PROGRAM) $(OBJECTS) $(LFLAGS) `wx-config --libs`
|
||||
|
||||
clean:
|
||||
rm -f *.o $(PROGRAM)
|
||||
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
Flash needs the following GUID for its event interface
|
||||
{D27CDB6D-AE6D-11CF-96B8-444553540000}
|
||||
|
|
@ -1,149 +0,0 @@
|
|||
Lindsay Mathieson
|
||||
Email : <lmathieson@optusnet.com.au>
|
||||
|
||||
This is prelimanary stuff - the controls need extra methods and events etc,
|
||||
feel free to email with suggestions &/or patches.
|
||||
|
||||
Tested with wxWindows 2.3.2.
|
||||
Built with MS Visual C++ 6.0 & DevStudio
|
||||
Minor use of templates and STL
|
||||
|
||||
-----------------------------------------------------------
|
||||
This sample illustrates using wxActiveX and wxIEHtmlWin too:
|
||||
1. Host an arbitrary ActiveX control
|
||||
1.1 - Capture and logging of all events from control
|
||||
2. Specifically host the MSHTML Control
|
||||
|
||||
|
||||
wxActiveX:
|
||||
==========
|
||||
wxActiveX is used to host and siplay any activeX control, all the wxWindows developer
|
||||
needs to know is either the ProgID or CLSID of the control in question.
|
||||
|
||||
Derived From:
|
||||
- wxWindow
|
||||
|
||||
Include Files:
|
||||
- wxactivex.h
|
||||
|
||||
Source Files:
|
||||
- wxactivex.cpp
|
||||
|
||||
Event Handling:
|
||||
---------------
|
||||
- EVT_ACTIVEX(id, eventName, handler) (handler = void OnActiveX(wxActiveXEvent& event))
|
||||
- EVT_ACTIVEX_DISPID(id, eventDispId, handler) (handler = void OnActiveX(wxActiveXEvent& event))
|
||||
class wxActiveXEvent : public wxNotifyEvent
|
||||
wxString EventName();
|
||||
int ParamCount() const;
|
||||
wxString ParamType(int idx);
|
||||
wxString ParamName(int idx);
|
||||
wxVariant operator[] (int idx) const; // parameter by index
|
||||
wxVariant& operator[] (int idx);
|
||||
wxVariant operator[] (wxString name) const; // named parameters
|
||||
wxVariant& operator[] (wxString name);
|
||||
|
||||
|
||||
Members:
|
||||
--------
|
||||
wxActiveX::wxActiveX(wxWindow * parent, REFCLSID clsid, wxWindowID id = -1);
|
||||
- Creates a activeX control identified by clsid
|
||||
e.g
|
||||
wxFrame *frame = new wxFrame(this, -1, "test");
|
||||
wxActiveX *X = new wxActiveX(frame, CLSID_WebBrowser);
|
||||
|
||||
wxActiveX::wxActiveX(wxWindow * parent, wxString progId, wxWindowID id = -1);
|
||||
- Creates a activeX control identified by progId
|
||||
e.g.
|
||||
wxFrame *frame = new wxFrame(this, -1, "test");
|
||||
wxActiveX *X = new wxActiveX(frame, "MSCAL.Calendar");
|
||||
|
||||
|
||||
wxActiveX::~wxActiveX();
|
||||
- Destroys the control
|
||||
- disconnects all connection points
|
||||
|
||||
- int GetEventCount() const;
|
||||
Number of events generated by control
|
||||
|
||||
- const FuncX& GetEvent(int idx) const;
|
||||
Names, Params and Typeinfo for events
|
||||
|
||||
HRESULT wxActiveX::ConnectAdvise(REFIID riid, IUnknown *eventSink);
|
||||
- Connects a event sink. Connections are automaticlly diconnected in the destructor
|
||||
e.g.
|
||||
FS_DWebBrowserEvents2 *events = new FS_DWebBrowserEvents2(iecontrol);
|
||||
hret = iecontrol->ConnectAdvise(DIID_DWebBrowserEvents2, events);
|
||||
if (! SUCCEEDED(hret))
|
||||
delete events;
|
||||
|
||||
|
||||
Sample Events:
|
||||
--------------
|
||||
EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X)
|
||||
|
||||
void wxIEFrame::OnMSHTMLBeforeNavigate2X(wxActiveXEvent& event)
|
||||
{
|
||||
wxString url = event["Url"];
|
||||
|
||||
int rc = wxMessageBox(url, "Allow open url ?", wxYES_NO);
|
||||
|
||||
if (rc != wxYES)
|
||||
event["Cancel"] = true;
|
||||
};
|
||||
|
||||
|
||||
wxIEHtmlWin:
|
||||
============
|
||||
wxIEHtmlWin is a specialisation of the wxActiveX control for hosting the MSHTML control.
|
||||
|
||||
Derived From:
|
||||
- wxActiveX
|
||||
- wxWindow
|
||||
|
||||
Event Handling:
|
||||
---------------
|
||||
- see wxActiveX
|
||||
Members:
|
||||
--------
|
||||
wxIEHtmlWin::wxIEHtmlWin(wxWindow * parent, wxWindowID id = -1);
|
||||
- Constructs and initialises the MSHTML control
|
||||
- LoadUrl("about:blank") is called
|
||||
|
||||
wxIEHtmlWin::~wxIEHtmlWin();
|
||||
- destroys the control
|
||||
|
||||
void wxIEHtmlWin::LoadUrl(const wxString&);
|
||||
- Attempts to browse to the url, the control uses its internal (MS)
|
||||
network streams
|
||||
|
||||
bool wxIEHtmlWin::LoadString(wxString html);
|
||||
- Load the passed HTML string
|
||||
|
||||
bool wxIEHtmlWin::LoadStream(istream *strm);
|
||||
- load the passed HTML stream. The control takes ownership of
|
||||
the pointer, deleting when finished.
|
||||
|
||||
bool wxIEHtmlWin::LoadStream(wxInputStream *is);
|
||||
- load the passed HTML stream. The control takes ownership of
|
||||
the pointer, deleting when finished.
|
||||
|
||||
void wxIEHtmlWin::SetCharset(wxString charset);
|
||||
- Sets the charset of the loaded document
|
||||
|
||||
void wxIEHtmlWin::SetEditMode(bool seton);
|
||||
- Sets edit mode.
|
||||
NOTE: This does work, but is bare bones - we need more events exposed before
|
||||
this is usable as an HTML editor.
|
||||
|
||||
bool wxIEHtmlWin::GetEditMode();
|
||||
- Returns the edit mode setting
|
||||
|
||||
wxString wxIEHtmlWin::GetStringSelection(bool asHTML = false);
|
||||
- Returns the currently selected text (plain or HTML text)
|
||||
|
||||
wxString GetText(bool asHTML = false);
|
||||
- Returns the body text (plain or HTML text)
|
||||
|
||||
Lindsay Mathieson
|
||||
Email : <lmathieson@optusnet.com.au>
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by wxIE.rc
|
||||
//
|
||||
#define DUMMY 4
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 102
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -1,284 +0,0 @@
|
|||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#if defined(__WXGTK__) || defined(__WXMOTIF__)
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
#include "wx/wxprec.h"
|
||||
#include "wx/filedlg.h"
|
||||
#include "wx/textdlg.h"
|
||||
#include "wxActiveXFrame.h"
|
||||
#include <sstream>
|
||||
using namespace std;
|
||||
#include "wx/splitter.h"
|
||||
#include "wx/textctrl.h"
|
||||
#include "wx/clipbrd.h"
|
||||
#include <wx/msgdlg.h>
|
||||
|
||||
enum
|
||||
{
|
||||
// menu items
|
||||
MENU_GETTYPEINFO = 700,
|
||||
MENU_INVOKEMETHOD,
|
||||
MENU_TEST
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(wxActiveXFrame, wxFrame)
|
||||
EVT_MENU(MENU_GETTYPEINFO, wxActiveXFrame::OnGetTypeInfo)
|
||||
EVT_MENU(MENU_INVOKEMETHOD, wxActiveXFrame::OnInvokeMethod)
|
||||
EVT_MENU(MENU_TEST, wxActiveXFrame::OnTest)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
wxActiveXFrame::wxActiveXFrame(wxWindow *parent, wxString title) :
|
||||
wxFrame(parent, -1, title)
|
||||
{
|
||||
// create a menu bar
|
||||
wxMenu *xMenu = new wxMenu("", wxMENU_TEAROFF);
|
||||
|
||||
xMenu->Append(MENU_GETTYPEINFO, "Get Type Info", "");
|
||||
xMenu->Append(MENU_INVOKEMETHOD, "Invoke Method (no params)", "");
|
||||
xMenu->Append(MENU_TEST, "Test", "For debugging purposes");
|
||||
|
||||
// now append the freshly created menu to the menu bar...
|
||||
wxMenuBar *menuBar = new wxMenuBar();
|
||||
menuBar->Append(xMenu, "&ActiveX");
|
||||
|
||||
// ... and attach this menu bar to the frame
|
||||
SetMenuBar(menuBar);
|
||||
|
||||
wxSplitterWindow *sp = new wxSplitterWindow(this);
|
||||
X = new wxActiveX(sp, title, 101);
|
||||
|
||||
textLog = new wxTextCtrl(sp, -1, "", wxPoint(0,0), wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
|
||||
|
||||
sp->SplitHorizontally(X, textLog, 0);
|
||||
|
||||
// conenct all events
|
||||
for (int i = 0; i < X->GetEventCount(); i++)
|
||||
{
|
||||
const wxActiveX::FuncX& func = X->GetEventDesc(i);
|
||||
const wxEventType& ev = RegisterActiveXEvent((DISPID) func.memid);
|
||||
Connect(101, ev, (wxObjectEventFunction) OnActiveXEvent);
|
||||
};
|
||||
}
|
||||
|
||||
wxString VarTypeAsString(VARTYPE vt)
|
||||
{
|
||||
#define VT(vtype, desc) case vtype : return desc
|
||||
|
||||
if (vt & VT_BYREF)
|
||||
vt -= VT_BYREF;
|
||||
|
||||
if (vt & VT_ARRAY)
|
||||
vt -= VT_ARRAY;
|
||||
|
||||
switch (vt)
|
||||
{
|
||||
VT(VT_SAFEARRAY, "SafeArray");
|
||||
VT(VT_EMPTY, "empty");
|
||||
VT(VT_NULL, "null");
|
||||
VT(VT_UI1, "byte");
|
||||
VT(VT_I1, "char");
|
||||
VT(VT_I2, "short");
|
||||
VT(VT_I4, "long");
|
||||
VT(VT_UI2, "unsigned short");
|
||||
VT(VT_UI4, "unsigned long");
|
||||
VT(VT_INT, "int");
|
||||
VT(VT_UINT, "unsigned int");
|
||||
VT(VT_R4, "real(4)");
|
||||
VT(VT_R8, "real(8)");
|
||||
VT(VT_CY, "Currency");
|
||||
VT(VT_DATE, "wxDate");
|
||||
VT(VT_BSTR, "wxString");
|
||||
VT(VT_DISPATCH, "IDispatch");
|
||||
VT(VT_ERROR, "SCode Error");
|
||||
VT(VT_BOOL, "bool");
|
||||
VT(VT_VARIANT, "wxVariant");
|
||||
VT(VT_UNKNOWN, "IUknown");
|
||||
VT(VT_VOID, "void");
|
||||
VT(VT_PTR, "void *");
|
||||
VT(VT_USERDEFINED, "*user defined*");
|
||||
|
||||
default:
|
||||
{
|
||||
wxString s;
|
||||
s << "Unknown(" << vt << ")";
|
||||
return s;
|
||||
};
|
||||
};
|
||||
|
||||
#undef VT
|
||||
};
|
||||
|
||||
#define ENDL "\r\n"
|
||||
|
||||
|
||||
void OutFunc(wxString& os, const wxActiveX::FuncX& func)
|
||||
{
|
||||
os << VarTypeAsString(func.retType.vt) << " " << func.name << "(";
|
||||
for (unsigned int p = 0; p < func.params.size(); p++)
|
||||
{
|
||||
const wxActiveX::ParamX& param = func.params[p];
|
||||
if (param.IsIn() && param.IsOut())
|
||||
os << "[IN OUT] ";
|
||||
else if (param.IsIn())
|
||||
os << "[IN] ";
|
||||
else if (param.IsIn())
|
||||
os << "[OUT] ";
|
||||
os << VarTypeAsString(param.vt) << " " << (param.isPtr ? "*" : "") << param.name;
|
||||
if (p < func.params.size() - 1)
|
||||
os << ", ";
|
||||
};
|
||||
os << ")" << ENDL;
|
||||
};
|
||||
|
||||
void wxActiveXFrame::OnGetTypeInfo(wxCommandEvent& event)
|
||||
{
|
||||
wxString os;
|
||||
|
||||
int i =0;
|
||||
os <<
|
||||
"Props" << ENDL <<
|
||||
"=====" << ENDL;
|
||||
for (i = 0; i < X->GetPropCount(); i++)
|
||||
{
|
||||
wxActiveX::PropX prop = X->GetPropDesc(i);
|
||||
os << VarTypeAsString(prop.type.vt) << " " << prop.name << "(";
|
||||
if (prop.CanSet())
|
||||
{
|
||||
os << VarTypeAsString(prop.arg.vt);
|
||||
};
|
||||
os << ")" << ENDL;
|
||||
|
||||
};
|
||||
os << ENDL;
|
||||
|
||||
os <<
|
||||
"Events" << ENDL <<
|
||||
"======" << ENDL;
|
||||
for (i = 0; i < X->GetEventCount(); i++)
|
||||
OutFunc(os, X->GetEventDesc(i));
|
||||
os << ENDL;
|
||||
|
||||
os <<
|
||||
"Methods" << ENDL <<
|
||||
"=======" << ENDL;
|
||||
for (i = 0; i < X->GetMethodCount(); i++)
|
||||
OutFunc(os, X->GetMethodDesc(i));
|
||||
os << ENDL;
|
||||
|
||||
|
||||
if (wxTheClipboard->Open())
|
||||
{
|
||||
wxDataObjectSimple *wo = new wxTextDataObject(os);
|
||||
wxTheClipboard->SetData(wo);
|
||||
wxTheClipboard->Flush();
|
||||
wxTheClipboard->Close();
|
||||
};
|
||||
|
||||
wxMessageBox(os, "Type Info", wxOK, this);
|
||||
};
|
||||
|
||||
void wxActiveXFrame::OnInvokeMethod(wxCommandEvent& event)
|
||||
{
|
||||
//wxTextEntryDialog dlg(this, "Method");
|
||||
//if (dlg.ShowModal() == wxID_OK)
|
||||
// X->CallMethod(dlg.GetValue());
|
||||
};
|
||||
|
||||
void wxActiveXFrame::OnTest(wxCommandEvent& event)
|
||||
{
|
||||
// flash testing
|
||||
wxVariant args[] = {0L, "http://www.macromedia.com/support/flash/ts/documents/java_script_comm/flash_to_javascript.swf"};
|
||||
X->CallMethod("LoadMovie", args);
|
||||
//X->Prop("Movie") = "http://www.macromedia.com/support/flash/ts/documents/java_script_comm/flash_to_javascript.swf";
|
||||
|
||||
// mc cal testing
|
||||
//X->Prop("year") = 1964L;
|
||||
//X->Prop("Value") = wxDateTime::Now();
|
||||
|
||||
// pdf testing
|
||||
//wxVariant file = "C:\\WINNT\\wx2\\docs\\pdf\\dialoged.pdf";
|
||||
//X->CallMethod("LoadFile", &file);
|
||||
};
|
||||
|
||||
void wxActiveXFrame::OnActiveXEvent(wxActiveXEvent& event)
|
||||
{
|
||||
#ifdef UNICODE
|
||||
wostringstream os;
|
||||
#else
|
||||
ostringstream os;
|
||||
#endif
|
||||
|
||||
os << (const wxChar *) event.EventName() << wxT("(");
|
||||
|
||||
for (int p = 0; p < event.ParamCount(); p++)
|
||||
{
|
||||
os <<
|
||||
(const wxChar *) event.ParamType(p) << wxT(" ") <<
|
||||
(const wxChar *) event.ParamName(p) << wxT(" = ") <<
|
||||
(const wxChar *) (wxString) event[p];
|
||||
if (p < event.ParamCount() - 1)
|
||||
os << wxT(", ");
|
||||
};
|
||||
os << wxT(")") << endl;
|
||||
wxString data = os.str().c_str();
|
||||
textLog->AppendText(data);
|
||||
};
|
||||
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
#ifndef wxActiveXFrame_h
|
||||
#define wxActiveXFrame_h
|
||||
|
||||
#include "wxactivex.h"
|
||||
|
||||
class wxActiveXFrame : public wxFrame
|
||||
{
|
||||
public:
|
||||
wxActiveX *X;
|
||||
wxTextCtrl *textLog;
|
||||
|
||||
wxActiveXFrame(wxWindow *parent, wxString title);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
void OnGetTypeInfo(wxCommandEvent& event);
|
||||
void OnInvokeMethod(wxCommandEvent& event);
|
||||
void OnTest(wxCommandEvent& event);
|
||||
void OnActiveXEvent(wxActiveXEvent& event);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,404 +0,0 @@
|
|||
# Microsoft Developer Studio Project File - Name="wxIE" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=wxIE - Win32 Unicode Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "wxIE.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "wxIE.mak" CFG="wxIE - Win32 Unicode Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "wxIE - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "wxIE - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "wxIE - Win32 Unicode Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "wxIE - Win32 Unicode Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "wxIE - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /c
|
||||
# ADD BASE RSC /l 0xc09 /d "NDEBUG"
|
||||
# ADD RSC /l 0xc09 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmsw.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\contrib\Lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(WXWIN)\lib\vc_dll\mswd" /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0xc09 /d "_DEBUG"
|
||||
# ADD RSC /l 0xc09 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxbase25d.lib wxbase25d_net.lib wxbase25d_xml.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /pdbtype:sept /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\lib\vc_dll" /libpath:"$(WXWIN)\contrib\Lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "wxIE___Win32_Unicode_Debug"
|
||||
# PROP BASE Intermediate_Dir "wxIE___Win32_Unicode_Debug"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "wxIE___Win32_Unicode_Debug"
|
||||
# PROP Intermediate_Dir "wxIE___Win32_Unicode_Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D UNICODE=1 /Yu"wx/wxprec.h" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0xc09 /d "_DEBUG"
|
||||
# ADD RSC /l 0xc09 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmswd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"wxIE.exe" /pdbtype:sept /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\contrib\Lib"
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmswud.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"wxIE.exe" /pdbtype:sept /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\contrib\Lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "wxIE___Win32_Unicode_Release"
|
||||
# PROP BASE Intermediate_Dir "wxIE___Win32_Unicode_Release"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "wxIE___Win32_Unicode_Release"
|
||||
# PROP Intermediate_Dir "wxIE___Win32_Unicode_Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /c
|
||||
# ADD BASE RSC /l 0xc09 /d "NDEBUG"
|
||||
# ADD RSC /l 0xc09 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib xpm.lib png.lib zlib.lib jpeg.lib tiff.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"wxIE.exe"
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmswu.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"wxIE.exe" /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\contrib\Lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "wxIE - Win32 Release"
|
||||
# Name "wxIE - Win32 Debug"
|
||||
# Name "wxIE - Win32 Unicode Debug"
|
||||
# Name "wxIE - Win32 Unicode Release"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\IEHtmlWin.cpp
|
||||
|
||||
!IF "$(CFG)" == "wxIE - Win32 Release"
|
||||
|
||||
# SUBTRACT CPP /YX
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Debug"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Debug"
|
||||
|
||||
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Release"
|
||||
|
||||
# SUBTRACT BASE CPP /YX
|
||||
# SUBTRACT CPP /YX
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxactivex.cpp
|
||||
|
||||
!IF "$(CFG)" == "wxIE - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Debug"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Debug"
|
||||
|
||||
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Release"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxActiveXFrame.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxIE.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxIEApp.cpp
|
||||
# ADD CPP /Yc"wx/wxprec.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxIEFrm.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\IEHtmlWin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxactivex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxActiveXFrame.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxIEApp.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxIEFrm.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\blank.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\bullseye.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\colours.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\cross.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\disable.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\error.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\hand.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\info.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\magnif1.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\noentry.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\pbrush.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\pencil.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\plot_dwn.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\plot_enl.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\plot_shr.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\plot_up.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\plot_zin.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\plot_zot.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\pntleft.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\pntright.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\query.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\question.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\roller.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\size.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\tick.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\tip.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\warning.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\watch1.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxIE.ico
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\default.doxygen
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\license.txt
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\makefile
|
||||
# PROP Exclude_From_Scan -1
|
||||
# PROP BASE Exclude_From_Build 1
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\makefile.gtk
|
||||
# PROP Exclude_From_Scan -1
|
||||
# PROP BASE Exclude_From_Build 1
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\makefile.mtf
|
||||
# PROP Exclude_From_Scan -1
|
||||
# PROP BASE Exclude_From_Build 1
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\notes.txt
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\readme.txt
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxIE.xpm
|
||||
# PROP Exclude_From_Scan -1
|
||||
# PROP BASE Exclude_From_Build 1
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 766 B |
|
|
@ -1,169 +0,0 @@
|
|||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
//#include "afxres.h"
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
#include <winuser.rh>
|
||||
#include <commctrl.rh>
|
||||
#include <dde.rh>
|
||||
#include <winnt.rh>
|
||||
#include <dlgs.h>
|
||||
#include <winver.h>
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
/*
|
||||
WXDISABLE_BUTTON_BITMAP BITMAP MOVEABLE PURE "wx/msw/disable.bmp"
|
||||
WXBITMAP_STD_COLOURS BITMAP MOVEABLE PURE "wx/msw/colours.bmp"
|
||||
TICK_BMP BITMAP MOVEABLE PURE "wx/msw/tick.bmp"
|
||||
PLOT_ZOT_BMP BITMAP MOVEABLE PURE "wx/msw/plot_zot.bmp"
|
||||
PLOT_ZIN_BMP BITMAP MOVEABLE PURE "wx/msw/plot_zin.bmp"
|
||||
PLOT_UP_BMP BITMAP MOVEABLE PURE "wx/msw/plot_up.bmp"
|
||||
PLOT_SHR_BMP BITMAP MOVEABLE PURE "wx/msw/plot_shr.bmp"
|
||||
PLOT_ENL_BMP BITMAP MOVEABLE PURE "wx/msw/plot_enl.bmp"
|
||||
PLOT_DWN_BMP BITMAP MOVEABLE PURE "wx/msw/plot_dwn.bmp"
|
||||
CROSS_BMP BITMAP MOVEABLE PURE "wx/msw/cross.bmp"
|
||||
*/
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Cursor
|
||||
//
|
||||
|
||||
/*
|
||||
WXCURSOR_WATCH CURSOR DISCARDABLE "wx\\msw\\watch1.cur"
|
||||
WXCURSOR_SIZING CURSOR DISCARDABLE "wx/msw/size.cur"
|
||||
WXCURSOR_ROLLER CURSOR DISCARDABLE "wx/msw/roller.cur"
|
||||
WXCURSOR_QARROW CURSOR DISCARDABLE "wx/msw/query.cur"
|
||||
WXCURSOR_PRIGHT CURSOR DISCARDABLE "wx/msw/pntright.cur"
|
||||
WXCURSOR_PLEFT CURSOR DISCARDABLE "wx/msw/pntleft.cur"
|
||||
WXCURSOR_PENCIL CURSOR DISCARDABLE "wx/msw/pencil.cur"
|
||||
WXCURSOR_PBRUSH CURSOR DISCARDABLE "wx/msw/pbrush.cur"
|
||||
WXCURSOR_NO_ENTRY CURSOR DISCARDABLE "wx/msw/noentry.cur"
|
||||
WXCURSOR_MAGNIFIER CURSOR DISCARDABLE "wx/msw/magnif1.cur"
|
||||
WXCURSOR_HAND CURSOR DISCARDABLE "wx/msw/hand.cur"
|
||||
WXCURSOR_BULLSEYE CURSOR DISCARDABLE "wx/msw/bullseye.cur"
|
||||
WXCURSOR_BLANK CURSOR DISCARDABLE "wx/msw/blank.cur"
|
||||
*/
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
WXRESIZEABLEDIALOG DIALOG DISCARDABLE 34, 22, 144, 75
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
||||
BEGIN
|
||||
END
|
||||
|
||||
WXNOCAPTIONDIALOG DIALOG DISCARDABLE 34, 22, 144, 75
|
||||
STYLE WS_POPUP
|
||||
BEGIN
|
||||
END
|
||||
|
||||
WXCAPTIONDIALOG DIALOG DISCARDABLE 34, 22, 144, 75
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dummy dialog"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
WXIE ICON DISCARDABLE "wxIE.ico"
|
||||
/*
|
||||
WXICON_WARNING ICON DISCARDABLE "wx\\msw\\warning.ico"
|
||||
WXICON_TIP ICON DISCARDABLE "wx/msw/tip.ico"
|
||||
WXICON_QUESTION ICON DISCARDABLE "wx/msw/question.ico"
|
||||
WXICON_INFO ICON DISCARDABLE "wx/msw/info.ico"
|
||||
WXICON_ERROR ICON DISCARDABLE "wx/msw/error.ico"
|
||||
*/
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
WXWINDOWMENU MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&Window"
|
||||
BEGIN
|
||||
MENUITEM "&Cascade", 4002
|
||||
MENUITEM "Tile &Horizontally", 4001
|
||||
MENUITEM "Tile &Vertically", 4005
|
||||
MENUITEM "", 65535
|
||||
MENUITEM "&Arrange Icons", 4003
|
||||
MENUITEM "&Next", 4004
|
||||
END
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
/* XPM */
|
||||
static char *wxIE_xpm[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"32 32 6 1",
|
||||
" c Black",
|
||||
". c Blue",
|
||||
"X c #00bf00",
|
||||
"o c Red",
|
||||
"O c Yellow",
|
||||
"+ c Gray100",
|
||||
/* pixels */
|
||||
" ",
|
||||
" oooooo +++++++++++++++++++++++ ",
|
||||
" oooooo +++++++++++++++++++++++ ",
|
||||
" oooooo +++++++++++++++++++++++ ",
|
||||
" oooooo +++++++++++++++++++++++ ",
|
||||
" oooooo +++++++++++++++++++++++ ",
|
||||
" oooooo +++++++++++++++++++++++ ",
|
||||
" oooooo +++++++++++++++++++++++ ",
|
||||
" ",
|
||||
" ++++++ ++++++++++++++++++ .... ",
|
||||
" ++++++ ++++++++++++++++++ .... ",
|
||||
" ++++++ ++++++++++++++++++ .... ",
|
||||
" ++++++ ++++++++++++++++++ .... ",
|
||||
" ++++++ ++++++++++++++++++ .... ",
|
||||
" ++++++ ++++++++++++++++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++ ",
|
||||
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||
" "
|
||||
};
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#if defined(__WXGTK__) || defined(__WXMOTIF__)
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
#include "wx/wxprec.h"
|
||||
#include "wxIEApp.h"
|
||||
#include "wxIEFrm.h"
|
||||
#include "resource.h"
|
||||
|
||||
|
||||
|
||||
// Create a new application object: this macro will allow wxWindows to create
|
||||
// the application object during program execution (it's better than using a
|
||||
// static object for many reasons) and also declares the accessor function
|
||||
// wxGetApp() which will return the reference of the right type (i.e. wxIEApp and
|
||||
// not wxApp)
|
||||
IMPLEMENT_APP(wxIEApp)
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// the application class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// 'Main program' equivalent: the program execution "starts" here
|
||||
bool wxIEApp::OnInit()
|
||||
{
|
||||
// create the main application window
|
||||
wxIEFrame *frame = new wxIEFrame(wxT("IE Test"));
|
||||
|
||||
// and show it (the frames, unlike simple controls, are not shown when
|
||||
// created initially)
|
||||
frame->Show(TRUE);
|
||||
|
||||
// success: wxApp::OnRun() will be called which will enter the main message
|
||||
// loop and the application will run. If we returned FALSE here, the
|
||||
// application would exit immediately.
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
// Define a new application type, each program should derive a class from wxApp
|
||||
class wxIEApp : public wxApp
|
||||
{
|
||||
public:
|
||||
// override base class virtuals
|
||||
// ----------------------------
|
||||
|
||||
// this one is called on application startup and is a good place for the app
|
||||
// initialization (doing it here and not in the ctor allows to have an error
|
||||
// return: if OnInit() returns false, the application terminates)
|
||||
virtual bool OnInit();
|
||||
};
|
||||
|
|
@ -1,381 +0,0 @@
|
|||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#if defined(__WXGTK__) || defined(__WXMOTIF__)
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
#include "wx/wxprec.h"
|
||||
#include "wx/filedlg.h"
|
||||
#include "wxIEApp.h"
|
||||
#include "wxIEFrm.h"
|
||||
#include "wxActiveXFrame.h"
|
||||
#include <istream>
|
||||
#include <fstream>
|
||||
using namespace std;
|
||||
#include <exdispid.h>
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// resources
|
||||
// ----------------------------------------------------------------------------
|
||||
// the application icon
|
||||
#if defined(__WXGTK__) || defined(__WXMOTIF__)
|
||||
#include "wxIE.xpm"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// IDs for the controls and the menu commands
|
||||
enum
|
||||
{
|
||||
// menu items
|
||||
FILE_QUIT = 1,
|
||||
FILE_OPEN,
|
||||
FILE_BROWSE,
|
||||
FILE_HTML_EDITMODE,
|
||||
FILE_TEST_HTML,
|
||||
FILE_TEST_SELECT,
|
||||
FILE_TEST_HTMLSELECT,
|
||||
FILE_TEST_GETTEXT,
|
||||
FILE_TEST_HTMLGETTEXT,
|
||||
FILE_TEST_HOME,
|
||||
FILE_TEST_ACTIVEX,
|
||||
FILE_ABOUT,
|
||||
|
||||
// controls
|
||||
ID_MSHTML = 501,
|
||||
ID_PROGRESS_GAUGE
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// event tables and other macros for wxWindows
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// the event tables connect the wxWindows events with the functions (event
|
||||
// handlers) which process them. It can be also done at run-time, but for the
|
||||
// simple menu events like this the static method is much simpler.
|
||||
BEGIN_EVENT_TABLE(wxIEFrame, wxFrame)
|
||||
EVT_SIZE(wxIEFrame::OnSize)
|
||||
EVT_MENU(FILE_QUIT, wxIEFrame::OnQuit)
|
||||
EVT_MENU(FILE_BROWSE, wxIEFrame::OnBrowse)
|
||||
EVT_MENU(FILE_OPEN, wxIEFrame::OnOpen)
|
||||
EVT_MENU(FILE_HTML_EDITMODE, wxIEFrame::OnEditMode)
|
||||
EVT_UPDATE_UI(FILE_HTML_EDITMODE, wxIEFrame::OnEditModeUI)
|
||||
EVT_MENU(FILE_TEST_HTML, wxIEFrame::OnTestHTML)
|
||||
EVT_MENU(FILE_TEST_SELECT, wxIEFrame::OnTestSelect)
|
||||
EVT_MENU(FILE_TEST_HTMLSELECT, wxIEFrame::OnTestHTMLSelect)
|
||||
EVT_MENU(FILE_TEST_GETTEXT, wxIEFrame::OnTestGetText)
|
||||
EVT_MENU(FILE_TEST_HTMLGETTEXT, wxIEFrame::OnTestHTMLGetText)
|
||||
EVT_MENU(FILE_TEST_HOME, wxIEFrame::OnTestHome)
|
||||
EVT_MENU(FILE_TEST_ACTIVEX, wxIEFrame::OnTestActiveX)
|
||||
EVT_MENU(FILE_ABOUT, wxIEFrame::OnAbout)
|
||||
|
||||
// ActiveX Events
|
||||
EVT_ACTIVEX_DISPID(ID_MSHTML, DISPID_STATUSTEXTCHANGE, OnMSHTMLStatusTextChangeX)
|
||||
EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X)
|
||||
EVT_ACTIVEX(ID_MSHTML, "TitleChange", OnMSHTMLTitleChangeX)
|
||||
EVT_ACTIVEX(ID_MSHTML, "NewWindow2", OnMSHTMLNewWindow2X)
|
||||
EVT_ACTIVEX(ID_MSHTML, "ProgressChange", OnMSHTMLProgressChangeX)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// main frame
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// frame constructor
|
||||
wxIEFrame::wxIEFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||
: wxFrame((wxFrame *)NULL, -1, title, pos, size)
|
||||
{
|
||||
// set the frame icon
|
||||
SetIcon(wxICON(wxIE));
|
||||
|
||||
// create a menu bar
|
||||
wxMenu *menuFile = new wxMenu("", wxMENU_TEAROFF);
|
||||
|
||||
// the "About" item should be in the help menu
|
||||
wxMenu *helpMenu = new wxMenu;
|
||||
helpMenu->Append(FILE_ABOUT, "&About...\tCtrl-A", "Show about dialog");
|
||||
|
||||
menuFile->Append(FILE_TEST_HTML, "Test HTML", "Demonstrates LoadString()");
|
||||
menuFile->Append(FILE_OPEN, "Open HTML File", "Demonstrates LoadStream(istream *)");
|
||||
menuFile->Append(FILE_BROWSE, "Browse Web Page", "Demonstrates LoadUrl(url)");
|
||||
menuFile->Append(FILE_HTML_EDITMODE, "Edit Mode", "Demonstrates editing html", true);
|
||||
menuFile->AppendSeparator();
|
||||
menuFile->Append(FILE_TEST_SELECT, "Get Selected Text", "Demonstrates GetStringSelection(false)");
|
||||
menuFile->Append(FILE_TEST_HTMLSELECT, "Get HTML Selected Text", "Demonstrates GetStringSelection(true)");
|
||||
menuFile->AppendSeparator();
|
||||
menuFile->Append(FILE_TEST_GETTEXT, "Get Text", "Demonstrates GetText(false)");
|
||||
menuFile->Append(FILE_TEST_HTMLGETTEXT, "Get HTML Text", "Demonstrates GetText(true)");
|
||||
menuFile->Append(FILE_TEST_HOME, "Open Home Page", "Demonstrates GoHome()");
|
||||
menuFile->AppendSeparator();
|
||||
menuFile->Append(FILE_TEST_ACTIVEX, "Display a ActiveX control", "Demonstrates the Generic ActiveX Container");
|
||||
menuFile->AppendSeparator();
|
||||
menuFile->Append(FILE_QUIT, "E&xit\tAlt-X", "Quit this program");
|
||||
|
||||
// now append the freshly created menu to the menu bar...
|
||||
wxMenuBar *menuBar = new wxMenuBar();
|
||||
menuBar->Append(menuFile, "&File");
|
||||
menuBar->Append(helpMenu, "&Help");
|
||||
|
||||
// ... and attach this menu bar to the frame
|
||||
SetMenuBar(menuBar);
|
||||
|
||||
// create a status bar just for fun (by default with 1 pane only)
|
||||
wxStatusBar * sb = CreateStatusBar(2);
|
||||
SetStatusText("Ready");
|
||||
|
||||
// progress gauge (belongs to status bar)
|
||||
m_gauge = new wxGauge(sb, ID_PROGRESS_GAUGE, 100);
|
||||
|
||||
// IE Control
|
||||
m_ie = new wxIEHtmlWin(this, ID_MSHTML);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// event handlers
|
||||
|
||||
void wxIEFrame::OnSize(wxSizeEvent& event)
|
||||
{
|
||||
wxFrame::OnSize(event);
|
||||
|
||||
wxStatusBar* sb = GetStatusBar();
|
||||
if (! sb)
|
||||
return;
|
||||
|
||||
wxRect rc;
|
||||
sb->GetFieldRect(1, rc);
|
||||
|
||||
m_gauge->SetSize(rc);
|
||||
};
|
||||
|
||||
void wxIEFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
// TRUE is to force the frame to close
|
||||
Close(TRUE);
|
||||
}
|
||||
|
||||
void wxIEFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _T("About wxIE...\n"));
|
||||
wxMessageBox(msg, "About wxIE", wxOK | wxICON_INFORMATION, this);
|
||||
}
|
||||
|
||||
void wxIEFrame::OnTestHTML(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString html =
|
||||
"<HTML><BODY><H1>Hello World</H1>Plain Text</body></html>";
|
||||
m_ie->LoadString(html);
|
||||
}
|
||||
|
||||
|
||||
void wxIEFrame::OnTestSelect(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString s = m_ie->GetStringSelection();
|
||||
|
||||
wxMessageBox(s);
|
||||
}
|
||||
|
||||
void wxIEFrame::OnTestHTMLSelect(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString s = m_ie->GetStringSelection(true);
|
||||
|
||||
wxMessageBox(s);
|
||||
}
|
||||
|
||||
void wxIEFrame::OnTestGetText(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString s = m_ie->GetText();
|
||||
|
||||
wxMessageBox(s);
|
||||
}
|
||||
|
||||
void wxIEFrame::OnTestHTMLGetText(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString s = m_ie->GetText(true);
|
||||
|
||||
wxMessageBox(s);
|
||||
}
|
||||
|
||||
void wxIEFrame::OnTestHome(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
m_ie->GoHome();
|
||||
};
|
||||
|
||||
|
||||
void wxIEFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxFileDialog dlg(this, "Chooose a HTML File", "", "", "HTML files (*.html; *.htm)|*.html;*.htm|",wxOPEN);
|
||||
|
||||
if (dlg.ShowModal() == wxID_OK)
|
||||
{
|
||||
wxString fname = dlg.GetPath();
|
||||
|
||||
ifstream *is = new ifstream(fname.mb_str());
|
||||
m_ie->LoadStream(is);
|
||||
};
|
||||
}
|
||||
|
||||
void wxIEFrame::OnEditMode(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
m_ie->SetEditMode(! m_ie->GetEditMode());
|
||||
}
|
||||
|
||||
void wxIEFrame::OnEditModeUI(wxUpdateUIEvent& event)
|
||||
{
|
||||
if (m_ie)
|
||||
event.Check(m_ie->GetEditMode());
|
||||
}
|
||||
|
||||
void wxIEFrame::OnBrowse(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString url = wxGetTextFromUser("Enter URL:", "Browse", "", this);
|
||||
|
||||
m_ie->LoadUrl(url);
|
||||
}
|
||||
|
||||
void wxIEFrame::OnMSHTMLStatusTextChangeX(wxActiveXEvent& event)
|
||||
{
|
||||
SetStatusText(event["Text"]);
|
||||
};
|
||||
|
||||
|
||||
void wxIEFrame::OnMSHTMLBeforeNavigate2X(wxActiveXEvent& event)
|
||||
{
|
||||
wxString url = event["Url"];
|
||||
if (url == "about:blank")
|
||||
return;
|
||||
|
||||
int rc = wxMessageBox(url, "Allow open url ?", wxYES_NO);
|
||||
|
||||
if (rc != wxYES)
|
||||
event["Cancel"] = true;
|
||||
};
|
||||
|
||||
void wxIEFrame::OnMSHTMLTitleChangeX(wxActiveXEvent& event)
|
||||
{
|
||||
SetTitle(event["Text"]);
|
||||
};
|
||||
|
||||
|
||||
void wxIEFrame::OnMSHTMLNewWindow2X(wxActiveXEvent& event)
|
||||
{
|
||||
int rc = wxMessageBox("New Window requested", "Allow New Window ?", wxYES_NO);
|
||||
|
||||
if (rc != wxYES)
|
||||
event["Cancel"] = true;
|
||||
};
|
||||
|
||||
|
||||
void wxIEFrame::OnMSHTMLProgressChangeX(wxActiveXEvent& event)
|
||||
{
|
||||
if ((long) event["ProgressMax"] != m_gauge->GetRange())
|
||||
m_gauge->SetRange((long) event["ProgressMax"]);
|
||||
|
||||
m_gauge->SetValue((long) event["Progress"]);
|
||||
};
|
||||
|
||||
void wxIEFrame::OnTestActiveX(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
// Some known prog ids
|
||||
//#define PROGID "Shell.Explorer"
|
||||
//#define PROGID CLSID_WebBrowser
|
||||
//#define PROGID CLSID_MozillaBrowser
|
||||
//#define PROGID CLSID_HTMLDocument
|
||||
//#define PROGID "MSCAL.Calendar"
|
||||
//#define PROGID "WordPad.Document"
|
||||
//#define PROGID "SoftwareFX.ChartFX"
|
||||
//#define PROGID "PDF.PdfCtrl"
|
||||
#define PROGID "ShockwaveFlash.ShockwaveFlash"
|
||||
|
||||
wxDialog dlg(this, -1, wxString(wxT("Test ActiveX")));
|
||||
|
||||
wxFlexGridSizer *sz = new wxFlexGridSizer(2);
|
||||
sz->Add(new wxStaticText(&dlg, -1, wxT("Enter a ActiveX ProgId")), 0, wxALL, 5 );
|
||||
|
||||
wxComboBox *cb = new wxComboBox(&dlg, 101, "");
|
||||
cb->Append(wxT("ShockwaveFlash.ShockwaveFlash"));
|
||||
cb->Append(wxT("MSCAL.Calendar"));
|
||||
cb->Append(wxT("Shell.Explorer"));
|
||||
cb->Append(wxT("WordPad.Document.1"));
|
||||
cb->Append(wxT("SoftwareFX.ChartFX.20"));
|
||||
cb->Append(wxT("PDF.PdfCtrl.5"));
|
||||
cb->SetSelection(0);
|
||||
|
||||
sz->Add(cb, 0, wxALL, 5 );
|
||||
|
||||
// next row
|
||||
sz->Add(new wxButton(&dlg, wxID_CANCEL, "Cancel"), 0, wxALIGN_RIGHT|wxALL, 5 );
|
||||
sz->Add(new wxButton(&dlg, wxID_OK, "Ok"), 0, wxALIGN_RIGHT|wxALL, 5 );
|
||||
|
||||
dlg.SetAutoLayout( TRUE );
|
||||
dlg.SetSizer(sz);
|
||||
sz->Fit(&dlg);
|
||||
sz->SetSizeHints(&dlg);
|
||||
|
||||
|
||||
if (dlg.ShowModal() == wxID_OK)
|
||||
{
|
||||
wxString progId = cb->GetValue();
|
||||
wxActiveXFrame *frame = new wxActiveXFrame(this, progId);
|
||||
frame->Show();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
#include "IEHtmlWin.h"
|
||||
#include "wx/gauge.h"
|
||||
|
||||
// Define a new frame type: this is going to be our main frame
|
||||
class wxIEFrame : public wxFrame
|
||||
{
|
||||
public:
|
||||
wxIEHtmlWin *m_ie;
|
||||
wxGauge *m_gauge;
|
||||
|
||||
// ctor(s)
|
||||
wxIEFrame(const wxString& title, const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize);
|
||||
|
||||
// event handlers (these functions should _not_ be virtual)
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnQuit(wxCommandEvent& event);
|
||||
void OnAbout(wxCommandEvent& event);
|
||||
|
||||
void OnEditMode(wxCommandEvent& event);
|
||||
void OnEditModeUI(wxUpdateUIEvent& event);
|
||||
void OnBrowse(wxCommandEvent& event);
|
||||
void OnOpen(wxCommandEvent& event);
|
||||
void OnTestHTML(wxCommandEvent& event);
|
||||
void OnTestSelect(wxCommandEvent& event);
|
||||
void OnTestHTMLSelect(wxCommandEvent& event);
|
||||
void OnTestGetText(wxCommandEvent& event);
|
||||
void OnTestHTMLGetText(wxCommandEvent& event);
|
||||
void OnTestHome(wxCommandEvent& event);
|
||||
void OnTestActiveX(wxCommandEvent& event);
|
||||
|
||||
private:
|
||||
// any class wishing to process wxWindows events must use this macro
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
void OnMSHTMLStatusTextChangeX(wxActiveXEvent& event);
|
||||
void OnMSHTMLBeforeNavigate2X(wxActiveXEvent& event);
|
||||
void OnMSHTMLTitleChangeX(wxActiveXEvent& event);
|
||||
void OnMSHTMLNewWindow2X(wxActiveXEvent& event);
|
||||
void OnMSHTMLProgressChangeX(wxActiveXEvent& event);
|
||||
};
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,680 +0,0 @@
|
|||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
/*! \file wxactivex.h
|
||||
\brief implements wxActiveX window class and OLE tools
|
||||
*/
|
||||
|
||||
#ifndef WX_ACTIVE_X
|
||||
#define WX_ACTIVE_X
|
||||
#pragma warning( disable : 4101 4786)
|
||||
#pragma warning( disable : 4786)
|
||||
|
||||
|
||||
#include <wx/setup.h>
|
||||
#include <wx/wx.h>
|
||||
#include <wx/variant.h>
|
||||
#include <wx/datetime.h>
|
||||
#include <oleidl.h>
|
||||
#include <exdisp.h>
|
||||
#include <docobj.h>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
using namespace std;
|
||||
|
||||
/// \brief wxActiveX Namespace for stuff I want to keep out of other tools way.
|
||||
namespace NS_wxActiveX
|
||||
{
|
||||
/// STL utilty class.
|
||||
/// specific to wxActiveX, for creating
|
||||
/// case insenstive maps etc
|
||||
struct less_wxStringI
|
||||
{
|
||||
bool operator()(const wxString& x, const wxString& y) const
|
||||
{
|
||||
return x.CmpNoCase(y) < 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////
|
||||
/// Template class for smart interface handling.
|
||||
/// - Automatically dereferences ole interfaces
|
||||
/// - Smart Copy Semantics
|
||||
/// - Can Create Interfaces
|
||||
/// - Can query for other interfaces
|
||||
template <class I> class wxAutoOleInterface
|
||||
{
|
||||
protected:
|
||||
I *m_interface;
|
||||
|
||||
public:
|
||||
/// takes ownership of an existing interface
|
||||
/// Assumed to already have a AddRef() applied
|
||||
explicit wxAutoOleInterface(I *pInterface = NULL) : m_interface(pInterface) {}
|
||||
|
||||
/// queries for an interface
|
||||
wxAutoOleInterface(REFIID riid, IUnknown *pUnk) : m_interface(NULL)
|
||||
{
|
||||
QueryInterface(riid, pUnk);
|
||||
};
|
||||
/// queries for an interface
|
||||
wxAutoOleInterface(REFIID riid, IDispatch *pDispatch) : m_interface(NULL)
|
||||
{
|
||||
QueryInterface(riid, pDispatch);
|
||||
};
|
||||
|
||||
/// Creates an Interface
|
||||
wxAutoOleInterface(REFCLSID clsid, REFIID riid) : m_interface(NULL)
|
||||
{
|
||||
CreateInstance(clsid, riid);
|
||||
};
|
||||
|
||||
/// copy constructor
|
||||
wxAutoOleInterface(const wxAutoOleInterface<I>& ti) : m_interface(NULL)
|
||||
{
|
||||
operator = (ti);
|
||||
}
|
||||
|
||||
/// assignment operator
|
||||
wxAutoOleInterface<I>& operator = (const wxAutoOleInterface<I>& ti)
|
||||
{
|
||||
if (ti.m_interface)
|
||||
ti.m_interface->AddRef();
|
||||
Free();
|
||||
m_interface = ti.m_interface;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// takes ownership of an existing interface
|
||||
/// Assumed to already have a AddRef() applied
|
||||
wxAutoOleInterface<I>& operator = (I *&ti)
|
||||
{
|
||||
Free();
|
||||
m_interface = ti;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// invokes Free()
|
||||
~wxAutoOleInterface()
|
||||
{
|
||||
Free();
|
||||
};
|
||||
|
||||
|
||||
/// Releases interface (i.e decrements refCount)
|
||||
inline void Free()
|
||||
{
|
||||
if (m_interface)
|
||||
m_interface->Release();
|
||||
m_interface = NULL;
|
||||
};
|
||||
|
||||
/// queries for an interface
|
||||
HRESULT QueryInterface(REFIID riid, IUnknown *pUnk)
|
||||
{
|
||||
Free();
|
||||
wxCHECK(pUnk != NULL, -1);
|
||||
return pUnk->QueryInterface(riid, (void **) &m_interface);
|
||||
};
|
||||
|
||||
/// Create a Interface instance
|
||||
HRESULT CreateInstance(REFCLSID clsid, REFIID riid)
|
||||
{
|
||||
Free();
|
||||
return CoCreateInstance(clsid, NULL, CLSCTX_ALL, riid, (void **) &m_interface);
|
||||
};
|
||||
|
||||
|
||||
/// returns the interface pointer
|
||||
inline operator I *() const {return m_interface;}
|
||||
|
||||
/// returns the dereferenced interface pointer
|
||||
inline I* operator ->() {return m_interface;}
|
||||
/// returns a pointer to the interface pointer
|
||||
inline I** GetRef() {return &m_interface;}
|
||||
/// returns true if we have a valid interface pointer
|
||||
inline bool Ok() const {return m_interface != NULL;}
|
||||
};
|
||||
|
||||
|
||||
/// \brief Converts a std HRESULT to its error code.
|
||||
/// Hardcoded, by no means a definitive list.
|
||||
wxString OLEHResultToString(HRESULT hr);
|
||||
/// \brief Returns the string description of a IID.
|
||||
/// Hardcoded, by no means a definitive list.
|
||||
wxString GetIIDName(REFIID riid);
|
||||
|
||||
//#define __WXOLEDEBUG
|
||||
|
||||
|
||||
#ifdef __WXOLEDEBUG
|
||||
#define WXOLE_TRACE(str) {OutputDebugString(str);OutputDebugString("\r\n");}
|
||||
#define WXOLE_TRACEOUT(stuff)\
|
||||
{\
|
||||
wxString os;\
|
||||
os << stuff << "\r\n";\
|
||||
WXOLE_TRACE(os.mb_str());\
|
||||
}
|
||||
|
||||
#define WXOLE_WARN(__hr,msg)\
|
||||
{\
|
||||
if (__hr != S_OK)\
|
||||
{\
|
||||
wxString s = "*** ";\
|
||||
s += msg;\
|
||||
s += " : "+ OLEHResultToString(__hr);\
|
||||
WXOLE_TRACE(s.c_str());\
|
||||
}\
|
||||
}
|
||||
#else
|
||||
#define WXOLE_TRACE(str)
|
||||
#define WXOLE_TRACEOUT(stuff)
|
||||
#define WXOLE_WARN(_proc,msg) {_proc;}
|
||||
#endif
|
||||
|
||||
class wxOleInit
|
||||
{
|
||||
public:
|
||||
static IMalloc *GetIMalloc();
|
||||
|
||||
wxOleInit();
|
||||
~wxOleInit();
|
||||
};
|
||||
|
||||
#define DECLARE_OLE_UNKNOWN(cls)\
|
||||
private:\
|
||||
class TAutoInitInt\
|
||||
{\
|
||||
public:\
|
||||
LONG l;\
|
||||
TAutoInitInt() : l(0) {}\
|
||||
};\
|
||||
TAutoInitInt refCount, lockCount;\
|
||||
wxOleInit oleInit;\
|
||||
static void _GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc);\
|
||||
public:\
|
||||
LONG GetRefCount();\
|
||||
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void ** ppvObject);\
|
||||
ULONG STDMETHODCALLTYPE AddRef();\
|
||||
ULONG STDMETHODCALLTYPE Release();\
|
||||
ULONG STDMETHODCALLTYPE AddLock();\
|
||||
ULONG STDMETHODCALLTYPE ReleaseLock()
|
||||
|
||||
#define DEFINE_OLE_TABLE(cls)\
|
||||
LONG cls::GetRefCount() {return refCount.l;}\
|
||||
HRESULT STDMETHODCALLTYPE cls::QueryInterface(REFIID iid, void ** ppvObject)\
|
||||
{\
|
||||
if (! ppvObject)\
|
||||
{\
|
||||
WXOLE_TRACE("*** NULL POINTER ***");\
|
||||
return E_FAIL;\
|
||||
};\
|
||||
const char *desc = NULL;\
|
||||
cls::_GetInterface(this, iid, ppvObject, desc);\
|
||||
if (! *ppvObject)\
|
||||
{\
|
||||
WXOLE_TRACEOUT("<" << GetIIDName(iid).c_str() << "> Not Found");\
|
||||
return E_NOINTERFACE;\
|
||||
};\
|
||||
WXOLE_TRACEOUT("QI : <" << desc <<">");\
|
||||
((IUnknown * )(*ppvObject))->AddRef();\
|
||||
return S_OK;\
|
||||
};\
|
||||
ULONG STDMETHODCALLTYPE cls::AddRef()\
|
||||
{\
|
||||
WXOLE_TRACEOUT(# cls << "::Add ref(" << refCount.l << ")");\
|
||||
InterlockedIncrement(&refCount.l);\
|
||||
return refCount.l;\
|
||||
};\
|
||||
ULONG STDMETHODCALLTYPE cls::Release()\
|
||||
{\
|
||||
if (refCount.l > 0)\
|
||||
{\
|
||||
InterlockedDecrement(&refCount.l);\
|
||||
WXOLE_TRACEOUT(# cls << "::Del ref(" << refCount.l << ")");\
|
||||
if (refCount.l == 0)\
|
||||
{\
|
||||
delete this;\
|
||||
return 0;\
|
||||
};\
|
||||
return refCount.l;\
|
||||
}\
|
||||
else\
|
||||
return 0;\
|
||||
}\
|
||||
ULONG STDMETHODCALLTYPE cls::AddLock()\
|
||||
{\
|
||||
WXOLE_TRACEOUT(# cls << "::Add Lock(" << lockCount.l << ")");\
|
||||
InterlockedIncrement(&lockCount.l);\
|
||||
return lockCount.l;\
|
||||
};\
|
||||
ULONG STDMETHODCALLTYPE cls::ReleaseLock()\
|
||||
{\
|
||||
if (lockCount.l > 0)\
|
||||
{\
|
||||
InterlockedDecrement(&lockCount.l);\
|
||||
WXOLE_TRACEOUT(# cls << "::Del Lock(" << lockCount.l << ")");\
|
||||
return lockCount.l;\
|
||||
}\
|
||||
else\
|
||||
return 0;\
|
||||
}\
|
||||
DEFINE_OLE_BASE(cls)
|
||||
|
||||
#define DEFINE_OLE_BASE(cls)\
|
||||
void cls::_GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc)\
|
||||
{\
|
||||
*_interface = NULL;\
|
||||
desc = NULL;
|
||||
|
||||
#define OLE_INTERFACE(_iid, _type)\
|
||||
if (IsEqualIID(iid, _iid))\
|
||||
{\
|
||||
WXOLE_TRACE("Found Interface <" # _type ">");\
|
||||
*_interface = (IUnknown *) (_type *) self;\
|
||||
desc = # _iid;\
|
||||
return;\
|
||||
}
|
||||
|
||||
#define OLE_IINTERFACE(_face) OLE_INTERFACE(IID_##_face, _face)
|
||||
|
||||
#define OLE_INTERFACE_CUSTOM(func)\
|
||||
if (func(self, iid, _interface, desc))\
|
||||
{\
|
||||
return;\
|
||||
}
|
||||
|
||||
#define END_OLE_TABLE\
|
||||
}
|
||||
|
||||
|
||||
/// Main class for embedding a ActiveX control.
|
||||
/// Use by itself or derive from it
|
||||
/// \note The utility program (wxie) can generate a list of events, methods & properties
|
||||
/// for a control.
|
||||
/// First display the control (File|Display),
|
||||
/// then get the type info (ActiveX|Get Type Info) - these are copied to the clipboard.
|
||||
/// Eventually this will be expanded to autogenerate
|
||||
/// wxWindows source files for a control with all methods etc encapsulated.
|
||||
/// \par Usage:
|
||||
/// construct using a ProgId or class id
|
||||
/// \code new wxActiveX(parent, CLSID_WebBrowser, id, pos, size, style, name)\endcode
|
||||
/// \code new wxActiveX(parent, "ShockwaveFlash.ShockwaveFlash", id, pos, size, style, name)\endcode
|
||||
/// \par Properties
|
||||
/// Properties can be set using \c SetProp() and set/retrieved using \c Prop()
|
||||
/// \code SetProp(name, wxVariant(x)) \endcode or
|
||||
/// \code wxString Prop("<name>") = x\endcode
|
||||
/// \code wxString result = Prop("<name>")\endcode
|
||||
/// \code flash_ctl.Prop("movie") = "file:///movies/test.swf";\endcode
|
||||
/// \code flash_ctl.Prop("Playing") = false;\endcode
|
||||
/// \code wxString current_movie = flash_ctl.Prop("movie");\endcode
|
||||
/// \par Methods
|
||||
/// Methods are invoked with \c CallMethod()
|
||||
/// \code wxVariant result = CallMethod("<name>", args, nargs = -1)\endcode
|
||||
/// \code wxVariant args[] = {0L, "file:///e:/dev/wxie/bug-zap.swf"};
|
||||
/// wxVariant result = X->CallMethod("LoadMovie", args);\endcode
|
||||
/// \par events
|
||||
/// respond to events with the
|
||||
/// \c EVT_ACTIVEX(controlId, eventName, handler) &
|
||||
/// \c EVT_ACTIVEX_DISPID(controlId, eventDispId, handler) macros
|
||||
/// \code
|
||||
/// BEGIN_EVENT_TABLE(wxIEFrame, wxFrame)
|
||||
/// EVT_ACTIVEX_DISPID(ID_MSHTML, DISPID_STATUSTEXTCHANGE, OnMSHTMLStatusTextChangeX)
|
||||
/// EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X)
|
||||
/// EVT_ACTIVEX(ID_MSHTML, "TitleChange", OnMSHTMLTitleChangeX)
|
||||
/// EVT_ACTIVEX(ID_MSHTML, "NewWindow2", OnMSHTMLNewWindow2X)
|
||||
/// EVT_ACTIVEX(ID_MSHTML, "ProgressChange", OnMSHTMLProgressChangeX)
|
||||
/// END_EVENT_TABLE()\endcode
|
||||
class wxActiveX : public wxWindow {
|
||||
public:
|
||||
/// General parameter and return type infoformation for Events, Properties and Methods.
|
||||
/// refer to ELEMDESC, IDLDESC in MSDN
|
||||
class ParamX
|
||||
{
|
||||
public:
|
||||
USHORT flags;
|
||||
bool isPtr;
|
||||
bool isSafeArray;
|
||||
bool isOptional;
|
||||
VARTYPE vt;
|
||||
wxString name;
|
||||
|
||||
ParamX() : isOptional(false), vt(VT_EMPTY) {}
|
||||
inline bool IsIn() const {return (flags & IDLFLAG_FIN) != 0;}
|
||||
inline bool IsOut() const {return (flags & IDLFLAG_FOUT) != 0;}
|
||||
inline bool IsRetVal() const {return (flags & IDLFLAG_FRETVAL) != 0;}
|
||||
};
|
||||
typedef vector<ParamX> ParamXArray;
|
||||
|
||||
|
||||
/// Type & Parameter info for Events and Methods.
|
||||
/// refer to FUNCDESC in MSDN
|
||||
class FuncX
|
||||
{
|
||||
public:
|
||||
wxString name;
|
||||
MEMBERID memid;
|
||||
bool hasOut;
|
||||
|
||||
ParamX retType;
|
||||
ParamXArray params;
|
||||
};
|
||||
typedef vector<FuncX> FuncXArray;
|
||||
|
||||
|
||||
/// Type info for properties.
|
||||
class PropX
|
||||
{
|
||||
public:
|
||||
wxString name;
|
||||
MEMBERID memid;
|
||||
ParamX type;
|
||||
ParamX arg;
|
||||
bool putByRef;
|
||||
|
||||
PropX() : putByRef (false) {}
|
||||
inline bool CanGet() const {return type.vt != VT_EMPTY;}
|
||||
inline bool CanSet() const {return arg.vt != VT_EMPTY;}
|
||||
};
|
||||
typedef vector<PropX> PropXArray;
|
||||
|
||||
|
||||
/// Create using clsid.
|
||||
wxActiveX(wxWindow * parent, REFCLSID clsid, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
/// create using progid.
|
||||
wxActiveX(wxWindow * parent, const wxString& progId, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
virtual ~wxActiveX();
|
||||
|
||||
/// Number of events defined for this control.
|
||||
inline int GetEventCount() const {return m_events.size();}
|
||||
/// returns event description by index.
|
||||
/// throws exception for invalid index
|
||||
const FuncX& GetEventDesc(int idx) const;
|
||||
|
||||
/// Number of properties defined for this control.
|
||||
inline int GetPropCount() const {return m_props.size();}
|
||||
/// returns property description by index.
|
||||
/// throws exception for invalid index
|
||||
const PropX& GetPropDesc(int idx) const;
|
||||
/// returns property description by name.
|
||||
/// throws exception for invalid name
|
||||
const PropX& GetPropDesc(const wxString& name) const;
|
||||
|
||||
/// Number of methods defined for this control.
|
||||
inline int GetMethodCount() const {return m_methods.size();}
|
||||
/// returns method description by name.
|
||||
/// throws exception for invalid index
|
||||
const FuncX& GetMethodDesc(int idx) const;
|
||||
/// returns method description by name.
|
||||
/// throws exception for invalid name
|
||||
const FuncX& GetMethodDesc(const wxString& name) const;
|
||||
|
||||
/// Set property VARIANTARG value by MEMBERID.
|
||||
void SetProp(MEMBERID name, VARIANTARG& value);
|
||||
/// Set property using wxVariant by name.
|
||||
void SetProp(const wxString &name, const wxVariant &value);
|
||||
|
||||
class wxPropertySetter
|
||||
{
|
||||
public:
|
||||
wxActiveX *m_ctl;
|
||||
wxString m_propName;
|
||||
|
||||
wxPropertySetter(wxActiveX *ctl, const wxString& propName) :
|
||||
m_ctl(ctl), m_propName(propName) {}
|
||||
|
||||
inline const wxPropertySetter& operator = (wxVariant v) const
|
||||
{
|
||||
m_ctl->SetProp(m_propName, v);
|
||||
return *this;
|
||||
};
|
||||
|
||||
inline operator wxVariant() const {return m_ctl->GetPropAsWxVariant(m_propName);};
|
||||
inline operator wxString() const {return m_ctl->GetPropAsString(m_propName);};
|
||||
inline operator char() const {return m_ctl->GetPropAsChar(m_propName);};
|
||||
inline operator long() const {return m_ctl->GetPropAsLong(m_propName);};
|
||||
inline operator bool() const {return m_ctl->GetPropAsBool(m_propName);};
|
||||
inline operator double() const {return m_ctl->GetPropAsDouble(m_propName);};
|
||||
inline operator wxDateTime() const {return m_ctl->GetPropAsDateTime(m_propName);};
|
||||
inline operator void *() const {return m_ctl->GetPropAsPointer(m_propName);};
|
||||
};
|
||||
|
||||
/// \fn inline wxPropertySetter Prop(wxString name) {return wxPropertySetter(this, name);}
|
||||
/// \param name Property name to read/set
|
||||
/// \return wxPropertySetter, which has overloads for setting/getting the property
|
||||
/// \brief Generic Get/Set Property by name.
|
||||
/// Automatically handles most types
|
||||
/// \par Usage:
|
||||
/// - Prop("\<name\>") = \<value\>
|
||||
/// - var = Prop("\<name\>")
|
||||
/// - e.g:
|
||||
/// - \code flash_ctl.Prop("movie") = "file:///movies/test.swf";\endcode
|
||||
/// - \code flash_ctl.Prop("Playing") = false;\endcode
|
||||
/// - \code wxString current_movie = flash_ctl.Prop("movie");\endcode
|
||||
/// \exception raises exception if \<name\> is invalid
|
||||
/// \note Have to add a few more type conversions yet ...
|
||||
inline wxPropertySetter Prop(wxString name) {return wxPropertySetter(this, name);}
|
||||
|
||||
VARIANT GetPropAsVariant(MEMBERID name);
|
||||
VARIANT GetPropAsVariant(const wxString& name);
|
||||
wxVariant GetPropAsWxVariant(const wxString& name);
|
||||
wxString GetPropAsString(const wxString& name);
|
||||
char GetPropAsChar(const wxString& name);
|
||||
long GetPropAsLong(const wxString& name);
|
||||
bool GetPropAsBool(const wxString& name);
|
||||
double GetPropAsDouble(const wxString& name);
|
||||
wxDateTime GetPropAsDateTime(const wxString& name);
|
||||
void *GetPropAsPointer(const wxString& name);
|
||||
|
||||
// methods
|
||||
// VARIANTARG form is passed straight to Invoke,
|
||||
// so args in *REVERSE* order
|
||||
VARIANT CallMethod(MEMBERID name, VARIANTARG args[], int argc);
|
||||
VARIANT CallMethod(const wxString& name, VARIANTARG args[] = NULL, int argc = -1);
|
||||
// args are in *NORMAL* order
|
||||
// args can be a single wxVariant or an array
|
||||
/// \fn wxVariant CallMethod(wxString name, wxVariant args[], int nargs = -1);
|
||||
/// \param name name of method to call
|
||||
/// \param args array of wxVariant's, defaults to NULL (no args)
|
||||
/// \param nargs number of arguments passed via args. Defaults to actual number of args for the method
|
||||
/// \return wxVariant
|
||||
/// \brief Call a method of the ActiveX control.
|
||||
/// Automatically handles most types
|
||||
/// \par Usage:
|
||||
/// - result = CallMethod("\<name\>", args, nargs)
|
||||
/// - e.g.
|
||||
/// - \code
|
||||
/// wxVariant args[] = {0L, "file:///e:/dev/wxie/bug-zap.swf"};
|
||||
/// wxVariant result = X->CallMethod("LoadMovie", args);\endcode
|
||||
/// \exception raises exception if \<name\> is invalid
|
||||
/// \note Since wxVariant has built in type conversion, most the std types can be passed easily
|
||||
wxVariant CallMethod(const wxString& name, wxVariant args[], int nargs = -1);
|
||||
|
||||
HRESULT ConnectAdvise(REFIID riid, IUnknown *eventSink);
|
||||
|
||||
void OnSize(wxSizeEvent&);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnMouse(wxMouseEvent& event);
|
||||
void OnSetFocus(wxFocusEvent&);
|
||||
void OnKillFocus(wxFocusEvent&);
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
protected:
|
||||
friend class FrameSite;
|
||||
friend class wxActiveXEvents;
|
||||
|
||||
unsigned long m_pdwRegister;
|
||||
|
||||
typedef map<MEMBERID, int> MemberIdMap;
|
||||
typedef map<wxString, int, NS_wxActiveX::less_wxStringI> NameMap;
|
||||
|
||||
typedef wxAutoOleInterface<IConnectionPoint> wxOleConnectionPoint;
|
||||
typedef pair<wxOleConnectionPoint, DWORD> wxOleConnection;
|
||||
typedef vector<wxOleConnection> wxOleConnectionArray;
|
||||
|
||||
wxAutoOleInterface<IDispatch> m_Dispatch;
|
||||
wxAutoOleInterface<IOleClientSite> m_clientSite;
|
||||
wxAutoOleInterface<IUnknown> m_ActiveX;
|
||||
wxAutoOleInterface<IOleObject> m_oleObject;
|
||||
wxAutoOleInterface<IOleInPlaceObject> m_oleInPlaceObject;
|
||||
wxAutoOleInterface<IOleInPlaceActiveObject>
|
||||
|
||||
m_oleInPlaceActiveObject;
|
||||
wxAutoOleInterface<IOleDocumentView> m_docView;
|
||||
wxAutoOleInterface<IViewObject> m_viewObject;
|
||||
HWND m_oleObjectHWND;
|
||||
bool m_bAmbientUserMode;
|
||||
DWORD m_docAdviseCookie;
|
||||
wxOleConnectionArray m_connections;
|
||||
|
||||
void CreateActiveX(REFCLSID clsid);
|
||||
void CreateActiveX(LPOLESTR progId);
|
||||
HRESULT AmbientPropertyChanged(DISPID dispid);
|
||||
|
||||
void GetTypeInfo();
|
||||
void GetTypeInfo(ITypeInfo *ti, bool defInterface, bool defEventSink);
|
||||
|
||||
|
||||
// events
|
||||
FuncXArray m_events;
|
||||
MemberIdMap m_eventMemberIds;
|
||||
|
||||
// properties
|
||||
PropXArray m_props;
|
||||
NameMap m_propNames;
|
||||
|
||||
// Methods
|
||||
FuncXArray m_methods;
|
||||
NameMap m_methodNames;
|
||||
|
||||
virtual bool MSWTranslateMessage(WXMSG* pMsg);
|
||||
long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
DECLARE_CLASS(wxActiveX)
|
||||
};
|
||||
|
||||
// events
|
||||
class wxActiveXEvent : public wxCommandEvent
|
||||
{
|
||||
private:
|
||||
friend class wxActiveXEvents;
|
||||
|
||||
wxVariant m_params;
|
||||
|
||||
public:
|
||||
|
||||
virtual wxEvent *Clone() const { return new wxActiveXEvent(*this); }
|
||||
|
||||
wxString EventName();
|
||||
int ParamCount() const;
|
||||
wxString ParamType(int idx);
|
||||
wxString ParamName(int idx);
|
||||
wxVariant& operator[] (int idx);
|
||||
wxVariant& operator[] (wxString name);
|
||||
|
||||
private:
|
||||
DECLARE_CLASS(wxActiveXEvent)
|
||||
};
|
||||
|
||||
const wxEventType& RegisterActiveXEvent(const wxChar *eventName);
|
||||
const wxEventType& RegisterActiveXEvent(DISPID event);
|
||||
|
||||
typedef void (wxEvtHandler::*wxActiveXEventFunction)(wxActiveXEvent&);
|
||||
|
||||
/// \def EVT_ACTIVEX(id, eventName, fn)
|
||||
/// \brief Event handle for events by name
|
||||
#define EVT_ACTIVEX(id, eventName, fn) DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(wxT(eventName)), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ),
|
||||
/// \def EVT_ACTIVEX_DISPID(id, eventDispId, fn)
|
||||
/// \brief Event handle for events by DISPID (dispath id)
|
||||
#define EVT_ACTIVEX_DISPID(id, eventDispId, fn) DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(eventDispId), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ),
|
||||
|
||||
//util
|
||||
bool wxDateTimeToVariant(wxDateTime dt, VARIANTARG& va);
|
||||
bool VariantToWxDateTime(VARIANTARG va, wxDateTime& dt);
|
||||
/// \relates wxActiveX
|
||||
/// \fn bool MSWVariantToVariant(VARIANTARG& va, wxVariant& vx);
|
||||
/// \param va VARAIANTARG to convert from
|
||||
/// \param vx Destination wxVariant
|
||||
/// \return success/failure (true/false)
|
||||
/// \brief Convert MSW VARIANTARG to wxVariant.
|
||||
/// Handles basic types, need to add:
|
||||
/// - VT_ARRAY | VT_*
|
||||
/// - better support for VT_UNKNOWN (currently treated as void *)
|
||||
/// - better support for VT_DISPATCH (currently treated as void *)
|
||||
bool MSWVariantToVariant(VARIANTARG& va, wxVariant& vx);
|
||||
/// \relates wxActiveX
|
||||
/// \fn bool VariantToMSWVariant(const wxVariant& vx, VARIANTARG& va);
|
||||
/// \param vx wxVariant to convert from
|
||||
/// \param va Destination VARIANTARG
|
||||
/// \return success/failure (true/false)
|
||||
/// \brief Convert wxVariant to MSW VARIANTARG.
|
||||
/// Handles basic types, need to add:
|
||||
/// - VT_ARRAY | VT_*
|
||||
/// - better support for VT_UNKNOWN (currently treated as void *)
|
||||
/// - better support for VT_DISPATCH (currently treated as void *)
|
||||
bool VariantToMSWVariant(const wxVariant& vx, VARIANTARG& va);
|
||||
|
||||
#endif /* _IEHTMLWIN_H_ */
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
del wxie.zip
|
||||
pkzip -max -add -dir -recurse -excl=CVS\*.* -excl=CVS\*.* -excl=debug\*.* wxie *.*
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dllwidget.cpp
|
||||
// Purpose: Dynamically loadable C++ widget for wxPython
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2001/12/03
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2001 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/dynlib.h"
|
||||
#include "wx/sizer.h"
|
||||
|
||||
#include "dllwidget.h"
|
||||
|
||||
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxDllWidget, wxPanel)
|
||||
|
||||
wxDllWidget::wxDllWidget(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& dllName, const wxString& className,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
long style)
|
||||
: wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL | wxNO_BORDER,
|
||||
className + wxT("_container")),
|
||||
m_widget(NULL), m_lib(NULL), m_controlAdded(false)
|
||||
{
|
||||
SetBackgroundColour(wxColour(255, 0, 255));
|
||||
if ( !!className )
|
||||
LoadWidget(dllName, className, style);
|
||||
}
|
||||
|
||||
wxDllWidget::~wxDllWidget()
|
||||
{
|
||||
UnloadWidget();
|
||||
}
|
||||
|
||||
void wxDllWidget::AddChild(wxWindowBase *child)
|
||||
{
|
||||
wxASSERT_MSG( !m_controlAdded, wxT("Couldn't load two widgets into one container!") );
|
||||
|
||||
wxPanel::AddChild(child);
|
||||
|
||||
m_controlAdded = true;
|
||||
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
sizer->Add((wxWindow*)child, 1, wxEXPAND);
|
||||
SetSizer(sizer);
|
||||
Layout();
|
||||
}
|
||||
|
||||
|
||||
wxString wxDllWidget::GetDllExt()
|
||||
{
|
||||
return wxDllLoader::GetDllExt();
|
||||
}
|
||||
|
||||
|
||||
typedef WXDLLEXPORT bool (*DLL_WidgetFactory_t)(const wxString& className,
|
||||
wxWindow *parent,
|
||||
long style,
|
||||
wxWindow **classInst,
|
||||
wxSendCommandFunc *cmdFunc);
|
||||
|
||||
bool wxDllWidget::LoadWidget(const wxString& dll, const wxString& className,
|
||||
long style)
|
||||
{
|
||||
UnloadWidget();
|
||||
|
||||
// Load the dynamic library
|
||||
m_lib = new wxDynamicLibrary(dll);
|
||||
if ( !m_lib->IsLoaded() )
|
||||
{
|
||||
delete m_lib;
|
||||
m_lib = NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
DLL_WidgetFactory_t factory;
|
||||
factory = (DLL_WidgetFactory_t) m_lib->GetSymbol(wxT("DLL_WidgetFactory"));
|
||||
if ( factory == NULL)
|
||||
{
|
||||
delete m_lib;
|
||||
m_lib = NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( !factory(className, this, style, &m_widget, &m_cmdFunc) )
|
||||
{
|
||||
delete m_widget;
|
||||
delete m_lib;
|
||||
m_lib = NULL;
|
||||
m_widget = NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxDllWidget::UnloadWidget()
|
||||
{
|
||||
if ( m_widget )
|
||||
{
|
||||
DestroyChildren();
|
||||
m_widget = NULL;
|
||||
delete m_lib;
|
||||
m_lib = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int wxDllWidget::SendCommand(int cmd, const wxString& param)
|
||||
{
|
||||
wxASSERT_MSG( m_widget && m_cmdFunc, wxT("Sending command to not loaded widget!"));
|
||||
|
||||
return m_cmdFunc(m_widget, cmd, param);
|
||||
}
|
||||
|
|
@ -1,139 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dllwidget.h
|
||||
// Purpose: Dynamically loadable C++ widget for wxPython
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2001/12/03
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2001 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DLLWIDGET_H__
|
||||
#define __DLLWIDGET_H__
|
||||
|
||||
#include "wx/panel.h"
|
||||
|
||||
/*
|
||||
|
||||
wxDllWidget can be used to embed a wxWindow implemented in C++ in your
|
||||
wxPython application without the need to write a SWIG interface. Widget's code
|
||||
is stored in shared library or DLL that exports DLL_WidgetFactory symbol
|
||||
and loaded at runtime. All you have to do is to pass the name of DLL and the class
|
||||
to create to wxDllWidget's ctor.
|
||||
|
||||
Runtime-loadable widget must have HandleCommand method (see the example) that is
|
||||
used to communicate with Python app. You call wxDllWidget.SendCommand(cmd,param) from
|
||||
Python and it in turn calls HandleCommand of the loaded widget.
|
||||
|
||||
You must use DECLARE_DLL_WIDGET, BEGIN_WIDGET_LIBRARY, END_WIDGET_LIBRARY and
|
||||
REGISTER_WIDGET macros in your C++ module in order to provide all the meat
|
||||
wxDllWidget needs.
|
||||
|
||||
Example of use:
|
||||
|
||||
#define CMD_MAKEWHITE 1
|
||||
|
||||
class MyWindow : public wxWindow
|
||||
{
|
||||
public:
|
||||
MyWindow(wxWindow *parent, long style)
|
||||
: wxWindow(parent, wxID_ANY) {}
|
||||
|
||||
int HandleCommand(int cmd, const wxString& param)
|
||||
{
|
||||
if (cmd == CMD_MAKEWHITE)
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
DECLARE_DLL_WIDGET(MyWindow)
|
||||
|
||||
class MyCanvasWindow : public wxScrolledWindow
|
||||
{
|
||||
...
|
||||
};
|
||||
DECLARE_DLL_WIDGET(MyCanvasWindow)
|
||||
|
||||
BEGIN_WIDGET_LIBRARY()
|
||||
REGISTER_WIDGET(MyWindow)
|
||||
REGISTER_WIDGET(MyCanvasWindow)
|
||||
END_WIDGET_LIBRARY()
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
class WXDLLEXPORT wxDynamicLibrary;
|
||||
|
||||
typedef int (*wxSendCommandFunc)(wxWindow *wnd, int cmd, const wxString& param);
|
||||
|
||||
class wxDllWidget : public wxPanel
|
||||
{
|
||||
public:
|
||||
wxDllWidget(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& dllName = wxEmptyString,
|
||||
const wxString& className = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0);
|
||||
virtual ~wxDllWidget();
|
||||
|
||||
bool Ok() { return m_widget != NULL; }
|
||||
|
||||
virtual int SendCommand(int cmd, const wxString& param = wxEmptyString);
|
||||
virtual wxWindow* GetWidgetWindow() { return m_widget; }
|
||||
|
||||
virtual void AddChild(wxWindowBase *child);
|
||||
|
||||
static wxString GetDllExt();
|
||||
|
||||
|
||||
protected:
|
||||
bool LoadWidget(const wxString& dll, const wxString& className, long style);
|
||||
void UnloadWidget();
|
||||
|
||||
protected:
|
||||
wxWindow* m_widget;
|
||||
wxSendCommandFunc m_cmdFunc;
|
||||
wxDynamicLibrary* m_lib;
|
||||
bool m_controlAdded;
|
||||
|
||||
private:
|
||||
DECLARE_ABSTRACT_CLASS(wxDllWidget)
|
||||
};
|
||||
|
||||
|
||||
#define DECLARE_DLL_WIDGET(widget) \
|
||||
static int SendCommandTo##widget(wxWindow *wnd, int cmd, const wxString& param) \
|
||||
{ \
|
||||
return wxStaticCast(wnd, widget)->HandleCommand(cmd, param); \
|
||||
}
|
||||
|
||||
|
||||
#define BEGIN_WIDGET_LIBRARY() \
|
||||
extern "C" WXEXPORT bool DLL_WidgetFactory( \
|
||||
const wxString& className, \
|
||||
wxWindow *parent, \
|
||||
long style, \
|
||||
wxWindow **classInst, \
|
||||
wxSendCommandFunc *cmdFunc) \
|
||||
{ \
|
||||
wxClassInfo::CleanUpClasses(); \
|
||||
wxClassInfo::InitializeClasses();
|
||||
|
||||
|
||||
#define REGISTER_WIDGET(widget) \
|
||||
if ( className == wxT(#widget) ) \
|
||||
{ \
|
||||
*classInst = new widget(parent, style); \
|
||||
*cmdFunc = SendCommandTo##widget; \
|
||||
return true; \
|
||||
}
|
||||
|
||||
|
||||
#define END_WIDGET_LIBRARY() \
|
||||
return false; \
|
||||
}
|
||||
|
||||
#endif // __DLLWIDGET_H__
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
# The SWIG module is named dllwidget_ to avoid name clashes, so
|
||||
# this stub just imports everything in it so the friendly module
|
||||
# name can be used elsewhere.
|
||||
|
||||
from dllwidget_ import *
|
||||
|
||||
|
|
@ -1,467 +0,0 @@
|
|||
/*
|
||||
* FILE : contrib/dllwidget/dllwidget_.cpp
|
||||
*
|
||||
* This file was automatically generated by :
|
||||
* Simplified Wrapper and Interface Generator (SWIG)
|
||||
* Version 1.1 (Build 883)
|
||||
*
|
||||
* Portions Copyright (c) 1995-1998
|
||||
* The University of Utah and The Regents of the University of California.
|
||||
* Permission is granted to distribute this file in any manner provided
|
||||
* this notice remains intact.
|
||||
*
|
||||
* Do not make changes to this file--changes will be lost!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#define SWIGCODE
|
||||
/* Implementation : PYTHON */
|
||||
|
||||
#define SWIGPYTHON
|
||||
#include "Python.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
/* Definitions for Windows/Unix exporting */
|
||||
#if defined(__WIN32__)
|
||||
# if defined(_MSC_VER)
|
||||
# define SWIGEXPORT(a) __declspec(dllexport) a
|
||||
# else
|
||||
# if defined(__BORLANDC__)
|
||||
# define SWIGEXPORT(a) a _export
|
||||
# else
|
||||
# define SWIGEXPORT(a) a
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# define SWIGEXPORT(a) a
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern void SWIG_MakePtr(char *, void *, char *);
|
||||
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
|
||||
extern char *SWIG_GetPtr(char *, void **, char *);
|
||||
extern char *SWIG_GetPtrObj(PyObject *, void **, char *);
|
||||
extern void SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
|
||||
extern PyObject *SWIG_newvarlink(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#define SWIG_init initdllwidget_c
|
||||
|
||||
#define SWIG_name "dllwidget_c"
|
||||
|
||||
#include "wxPython.h"
|
||||
#include "dllwidget.h"
|
||||
|
||||
|
||||
static PyObject* t_output_helper(PyObject* target, PyObject* o) {
|
||||
PyObject* o2;
|
||||
PyObject* o3;
|
||||
|
||||
if (!target) {
|
||||
target = o;
|
||||
} else if (target == Py_None) {
|
||||
Py_DECREF(Py_None);
|
||||
target = o;
|
||||
} else {
|
||||
if (!PyTuple_Check(target)) {
|
||||
o2 = target;
|
||||
target = PyTuple_New(1);
|
||||
PyTuple_SetItem(target, 0, o2);
|
||||
}
|
||||
o3 = PyTuple_New(1);
|
||||
PyTuple_SetItem(o3, 0, o);
|
||||
|
||||
o2 = target;
|
||||
target = PySequence_Concat(o2, o3);
|
||||
Py_DECREF(o2);
|
||||
Py_DECREF(o3);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
// Put some wx default wxChar* values into wxStrings.
|
||||
static const wxString wxPyEmptyString(wxT(""));
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
static void *SwigwxDllWidgetTowxPanel(void *ptr) {
|
||||
wxDllWidget *src;
|
||||
wxPanel *dest;
|
||||
src = (wxDllWidget *) ptr;
|
||||
dest = (wxPanel *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
static void *SwigwxDllWidgetTowxWindow(void *ptr) {
|
||||
wxDllWidget *src;
|
||||
wxWindow *dest;
|
||||
src = (wxDllWidget *) ptr;
|
||||
dest = (wxWindow *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
static void *SwigwxDllWidgetTowxEvtHandler(void *ptr) {
|
||||
wxDllWidget *src;
|
||||
wxEvtHandler *dest;
|
||||
src = (wxDllWidget *) ptr;
|
||||
dest = (wxEvtHandler *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
static void *SwigwxDllWidgetTowxObject(void *ptr) {
|
||||
wxDllWidget *src;
|
||||
wxObject *dest;
|
||||
src = (wxDllWidget *) ptr;
|
||||
dest = (wxObject *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
#define new_wxDllWidget(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6) (new wxDllWidget(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6))
|
||||
static PyObject *_wrap_new_wxDllWidget(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxDllWidget * _result;
|
||||
wxWindow * _arg0;
|
||||
wxWindowID _arg1 = (wxWindowID ) -1;
|
||||
wxString * _arg2 = (wxString *) &wxPyEmptyString;
|
||||
wxString * _arg3 = (wxString *) &wxPyEmptyString;
|
||||
wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition;
|
||||
wxSize * _arg5 = (wxSize *) &wxDefaultSize;
|
||||
long _arg6 = (long ) 0;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _obj2 = 0;
|
||||
PyObject * _obj3 = 0;
|
||||
wxPoint temp;
|
||||
PyObject * _obj4 = 0;
|
||||
wxSize temp0;
|
||||
PyObject * _obj5 = 0;
|
||||
char *_kwnames[] = { "parent","id","dllName","className","pos","size","style", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOOOl:new_wxDllWidget",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_obj5,&_arg6))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxDllWidget. Expected _wxWindow_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_obj2)
|
||||
{
|
||||
_arg2 = wxString_in_helper(_obj2);
|
||||
if (_arg2 == NULL)
|
||||
return NULL;
|
||||
}
|
||||
if (_obj3)
|
||||
{
|
||||
_arg3 = wxString_in_helper(_obj3);
|
||||
if (_arg3 == NULL)
|
||||
return NULL;
|
||||
}
|
||||
if (_obj4)
|
||||
{
|
||||
_arg4 = &temp;
|
||||
if (! wxPoint_helper(_obj4, &_arg4))
|
||||
return NULL;
|
||||
}
|
||||
if (_obj5)
|
||||
{
|
||||
_arg5 = &temp0;
|
||||
if (! wxSize_helper(_obj5, &_arg5))
|
||||
return NULL;
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxDllWidget *)new_wxDllWidget(_arg0,_arg1,*_arg2,*_arg3,*_arg4,*_arg5,_arg6);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxDllWidget_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
{
|
||||
if (_obj2)
|
||||
delete _arg2;
|
||||
}
|
||||
{
|
||||
if (_obj3)
|
||||
delete _arg3;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxDllWidget_Ok(_swigobj) (_swigobj->Ok())
|
||||
static PyObject *_wrap_wxDllWidget_Ok(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
bool _result;
|
||||
wxDllWidget * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxDllWidget_Ok",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDllWidget_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDllWidget_Ok. Expected _wxDllWidget_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (bool )wxDllWidget_Ok(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} _resultobj = Py_BuildValue("i",_result);
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxDllWidget_SendCommand(_swigobj,_swigarg0,_swigarg1) (_swigobj->SendCommand(_swigarg0,_swigarg1))
|
||||
static PyObject *_wrap_wxDllWidget_SendCommand(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
int _result;
|
||||
wxDllWidget * _arg0;
|
||||
int _arg1;
|
||||
wxString * _arg2 = (wxString *) &wxPyEmptyString;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _obj2 = 0;
|
||||
char *_kwnames[] = { "self","cmd","param", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|O:wxDllWidget_SendCommand",_kwnames,&_argo0,&_arg1,&_obj2))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDllWidget_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDllWidget_SendCommand. Expected _wxDllWidget_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_obj2)
|
||||
{
|
||||
_arg2 = wxString_in_helper(_obj2);
|
||||
if (_arg2 == NULL)
|
||||
return NULL;
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (int )wxDllWidget_SendCommand(_arg0,_arg1,*_arg2);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} _resultobj = Py_BuildValue("i",_result);
|
||||
{
|
||||
if (_obj2)
|
||||
delete _arg2;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxDllWidget_GetWidgetWindow(_swigobj) (_swigobj->GetWidgetWindow())
|
||||
static PyObject *_wrap_wxDllWidget_GetWidgetWindow(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxWindow * _result;
|
||||
wxDllWidget * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxDllWidget_GetWidgetWindow",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDllWidget_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDllWidget_GetWidgetWindow. Expected _wxDllWidget_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxWindow *)wxDllWidget_GetWidgetWindow(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
}{ _resultobj = wxPyMake_wxObject(_result); }
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static PyObject *_wrap_wxDllWidget_GetDllExt(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxString * _result;
|
||||
char *_kwnames[] = { NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxDllWidget_GetDllExt",_kwnames))
|
||||
return NULL;
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = new wxString (wxDllWidget::GetDllExt());
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
}{
|
||||
#if wxUSE_UNICODE
|
||||
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
|
||||
#else
|
||||
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
|
||||
#endif
|
||||
}
|
||||
{
|
||||
delete _result;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static PyMethodDef dllwidget_cMethods[] = {
|
||||
{ "wxDllWidget_GetDllExt", (PyCFunction) _wrap_wxDllWidget_GetDllExt, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxDllWidget_GetWidgetWindow", (PyCFunction) _wrap_wxDllWidget_GetWidgetWindow, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxDllWidget_SendCommand", (PyCFunction) _wrap_wxDllWidget_SendCommand, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxDllWidget_Ok", (PyCFunction) _wrap_wxDllWidget_Ok, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxDllWidget", (PyCFunction) _wrap_new_wxDllWidget, METH_VARARGS | METH_KEYWORDS },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* This table is used by the pointer type-checker
|
||||
*/
|
||||
static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_signed_long","_long",0},
|
||||
{ "_wxPrintQuality","_wxCoord",0},
|
||||
{ "_wxPrintQuality","_int",0},
|
||||
{ "_wxPrintQuality","_signed_int",0},
|
||||
{ "_wxPrintQuality","_unsigned_int",0},
|
||||
{ "_wxPrintQuality","_wxWindowID",0},
|
||||
{ "_wxPrintQuality","_uint",0},
|
||||
{ "_wxPrintQuality","_EBool",0},
|
||||
{ "_wxPrintQuality","_size_t",0},
|
||||
{ "_wxPrintQuality","_time_t",0},
|
||||
{ "_byte","_unsigned_char",0},
|
||||
{ "_long","_unsigned_long",0},
|
||||
{ "_long","_signed_long",0},
|
||||
{ "_size_t","_wxCoord",0},
|
||||
{ "_size_t","_wxPrintQuality",0},
|
||||
{ "_size_t","_time_t",0},
|
||||
{ "_size_t","_unsigned_int",0},
|
||||
{ "_size_t","_int",0},
|
||||
{ "_size_t","_wxWindowID",0},
|
||||
{ "_size_t","_uint",0},
|
||||
{ "_wxPanel","_wxDllWidget",SwigwxDllWidgetTowxPanel},
|
||||
{ "_uint","_wxCoord",0},
|
||||
{ "_uint","_wxPrintQuality",0},
|
||||
{ "_uint","_time_t",0},
|
||||
{ "_uint","_size_t",0},
|
||||
{ "_uint","_unsigned_int",0},
|
||||
{ "_uint","_int",0},
|
||||
{ "_uint","_wxWindowID",0},
|
||||
{ "_wxChar","_char",0},
|
||||
{ "_char","_wxChar",0},
|
||||
{ "_struct_wxNativeFontInfo","_wxNativeFontInfo",0},
|
||||
{ "_EBool","_wxCoord",0},
|
||||
{ "_EBool","_wxPrintQuality",0},
|
||||
{ "_EBool","_signed_int",0},
|
||||
{ "_EBool","_int",0},
|
||||
{ "_EBool","_wxWindowID",0},
|
||||
{ "_unsigned_long","_long",0},
|
||||
{ "_wxNativeFontInfo","_struct_wxNativeFontInfo",0},
|
||||
{ "_signed_int","_wxCoord",0},
|
||||
{ "_signed_int","_wxPrintQuality",0},
|
||||
{ "_signed_int","_EBool",0},
|
||||
{ "_signed_int","_wxWindowID",0},
|
||||
{ "_signed_int","_int",0},
|
||||
{ "_WXTYPE","_wxDateTime_t",0},
|
||||
{ "_WXTYPE","_short",0},
|
||||
{ "_WXTYPE","_signed_short",0},
|
||||
{ "_WXTYPE","_unsigned_short",0},
|
||||
{ "_unsigned_short","_wxDateTime_t",0},
|
||||
{ "_unsigned_short","_WXTYPE",0},
|
||||
{ "_unsigned_short","_short",0},
|
||||
{ "_wxObject","_wxDllWidget",SwigwxDllWidgetTowxObject},
|
||||
{ "_signed_short","_WXTYPE",0},
|
||||
{ "_signed_short","_short",0},
|
||||
{ "_unsigned_char","_byte",0},
|
||||
{ "_unsigned_int","_wxCoord",0},
|
||||
{ "_unsigned_int","_wxPrintQuality",0},
|
||||
{ "_unsigned_int","_time_t",0},
|
||||
{ "_unsigned_int","_size_t",0},
|
||||
{ "_unsigned_int","_uint",0},
|
||||
{ "_unsigned_int","_wxWindowID",0},
|
||||
{ "_unsigned_int","_int",0},
|
||||
{ "_short","_wxDateTime_t",0},
|
||||
{ "_short","_WXTYPE",0},
|
||||
{ "_short","_unsigned_short",0},
|
||||
{ "_short","_signed_short",0},
|
||||
{ "_wxWindowID","_wxCoord",0},
|
||||
{ "_wxWindowID","_wxPrintQuality",0},
|
||||
{ "_wxWindowID","_time_t",0},
|
||||
{ "_wxWindowID","_size_t",0},
|
||||
{ "_wxWindowID","_EBool",0},
|
||||
{ "_wxWindowID","_uint",0},
|
||||
{ "_wxWindowID","_int",0},
|
||||
{ "_wxWindowID","_signed_int",0},
|
||||
{ "_wxWindowID","_unsigned_int",0},
|
||||
{ "_int","_wxCoord",0},
|
||||
{ "_int","_wxPrintQuality",0},
|
||||
{ "_int","_time_t",0},
|
||||
{ "_int","_size_t",0},
|
||||
{ "_int","_EBool",0},
|
||||
{ "_int","_uint",0},
|
||||
{ "_int","_wxWindowID",0},
|
||||
{ "_int","_unsigned_int",0},
|
||||
{ "_int","_signed_int",0},
|
||||
{ "_wxDateTime_t","_unsigned_short",0},
|
||||
{ "_wxDateTime_t","_short",0},
|
||||
{ "_wxDateTime_t","_WXTYPE",0},
|
||||
{ "_time_t","_wxCoord",0},
|
||||
{ "_time_t","_wxPrintQuality",0},
|
||||
{ "_time_t","_unsigned_int",0},
|
||||
{ "_time_t","_int",0},
|
||||
{ "_time_t","_wxWindowID",0},
|
||||
{ "_time_t","_uint",0},
|
||||
{ "_time_t","_size_t",0},
|
||||
{ "_wxCoord","_int",0},
|
||||
{ "_wxCoord","_signed_int",0},
|
||||
{ "_wxCoord","_unsigned_int",0},
|
||||
{ "_wxCoord","_wxWindowID",0},
|
||||
{ "_wxCoord","_uint",0},
|
||||
{ "_wxCoord","_EBool",0},
|
||||
{ "_wxCoord","_size_t",0},
|
||||
{ "_wxCoord","_time_t",0},
|
||||
{ "_wxCoord","_wxPrintQuality",0},
|
||||
{ "_wxEvtHandler","_wxDllWidget",SwigwxDllWidgetTowxEvtHandler},
|
||||
{ "_wxWindow","_wxDllWidget",SwigwxDllWidgetTowxWindow},
|
||||
{0,0,0}};
|
||||
|
||||
static PyObject *SWIG_globals;
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
SWIGEXPORT(void) initdllwidget_c() {
|
||||
PyObject *m, *d;
|
||||
SWIG_globals = SWIG_newvarlink();
|
||||
m = Py_InitModule("dllwidget_c", dllwidget_cMethods);
|
||||
d = PyModule_GetDict(m);
|
||||
|
||||
|
||||
wxClassInfo::CleanUpClasses();
|
||||
wxClassInfo::InitializeClasses();
|
||||
|
||||
{
|
||||
int i;
|
||||
for (i = 0; _swig_mapping[i].n1; i++)
|
||||
SWIG_RegisterMapping(_swig_mapping[i].n1,_swig_mapping[i].n2,_swig_mapping[i].pcnv);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,115 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dllwidget_.i
|
||||
// Purpose: Load wx widgets from external DLLs
|
||||
//
|
||||
// Author: Robin Dunn
|
||||
//
|
||||
// Created: 04-Dec-2001
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2001 by Total Control Software
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
%module dllwidget_
|
||||
|
||||
|
||||
%{
|
||||
#include "wxPython.h"
|
||||
#include "dllwidget.h"
|
||||
%}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%include typemaps.i
|
||||
%include my_typemaps.i
|
||||
|
||||
%extern wx.i
|
||||
%extern windows.i
|
||||
%extern _defs.i
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
%{
|
||||
// Put some wx default wxChar* values into wxStrings.
|
||||
static const wxString wxPyEmptyString(wxT(""));
|
||||
%}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
|
||||
wxDllWidget can be used to embed a wxWindow implemented in C++ in your
|
||||
wxPython application without the need to write a SWIG interface. Widget's code
|
||||
is stored in shared library or DLL that exports DLL_WidgetFactory symbol
|
||||
and loaded at runtime. All you have to do is to pass the name of DLL and the class
|
||||
to create to wxDllWidget's ctor.
|
||||
|
||||
Runtime-loadable widget must have HandleCommand method (see the example) that is
|
||||
used to communicate with Python app. You call wxDllWidget.SendCommand(cmd,param) from
|
||||
Python and it in turn calls HandleCommand of the loaded widget.
|
||||
|
||||
You must use DECLARE_DLL_WIDGET, BEGIN_WIDGET_LIBRARY, END_WIDGET_LIBRARY and
|
||||
REGISTER_WIDGET macros in your C++ module in order to provide all the meat
|
||||
wxDllWidget needs.
|
||||
|
||||
Example of use:
|
||||
|
||||
#define CMD_MAKEWHITE 1
|
||||
|
||||
class MyWindow : public wxWindow
|
||||
{
|
||||
public:
|
||||
MyWindow(wxWindow *parent, long style)
|
||||
: wxWindow(parent, -1) {}
|
||||
|
||||
int HandleCommand(int cmd, const wxString& param)
|
||||
{
|
||||
if (cmd == CMD_MAKEWHITE)
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
DECLARE_DLL_WIDGET(MyWindow)
|
||||
|
||||
class MyCanvasWindow : public wxScrolledWindow
|
||||
{
|
||||
...
|
||||
};
|
||||
DECLARE_DLL_WIDGET(MyCanvasWindow)
|
||||
|
||||
BEGIN_WIDGET_LIBRARY()
|
||||
REGISTER_WIDGET(MyWindow)
|
||||
REGISTER_WIDGET(MyCanvasWindow)
|
||||
END_WIDGET_LIBRARY()
|
||||
|
||||
*/
|
||||
|
||||
class wxDllWidget : public wxPanel
|
||||
{
|
||||
public:
|
||||
wxDllWidget(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxString& dllName = wxPyEmptyString,
|
||||
const wxString& className = wxPyEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0);
|
||||
|
||||
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
|
||||
|
||||
bool Ok();
|
||||
|
||||
int SendCommand(int cmd, const wxString& param = wxPyEmptyString);
|
||||
wxWindow* GetWidgetWindow();
|
||||
|
||||
static wxString GetDllExt();
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%init %{
|
||||
|
||||
%}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
# This file was created automatically by SWIG.
|
||||
import dllwidget_c
|
||||
|
||||
from misc import *
|
||||
|
||||
from misc2 import *
|
||||
|
||||
from windows import *
|
||||
|
||||
from gdi import *
|
||||
|
||||
from fonts import *
|
||||
|
||||
from clip_dnd import *
|
||||
|
||||
from events import *
|
||||
|
||||
from streams import *
|
||||
|
||||
from utils import *
|
||||
|
||||
from mdi import *
|
||||
|
||||
from frames import *
|
||||
|
||||
from stattool import *
|
||||
|
||||
from controls import *
|
||||
|
||||
from controls2 import *
|
||||
|
||||
from windows2 import *
|
||||
|
||||
from cmndlgs import *
|
||||
|
||||
from windows3 import *
|
||||
|
||||
from image import *
|
||||
|
||||
from printfw import *
|
||||
|
||||
from sizers import *
|
||||
|
||||
from filesys import *
|
||||
class wxDllWidgetPtr(wxPanelPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
def Ok(self, *_args, **_kwargs):
|
||||
val = dllwidget_c.wxDllWidget_Ok(self, *_args, **_kwargs)
|
||||
return val
|
||||
def SendCommand(self, *_args, **_kwargs):
|
||||
val = dllwidget_c.wxDllWidget_SendCommand(self, *_args, **_kwargs)
|
||||
return val
|
||||
def GetWidgetWindow(self, *_args, **_kwargs):
|
||||
val = dllwidget_c.wxDllWidget_GetWidgetWindow(self, *_args, **_kwargs)
|
||||
return val
|
||||
def __repr__(self):
|
||||
return "<%s.%s instance; proxy of C++ wxDllWidget instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
|
||||
class wxDllWidget(wxDllWidgetPtr):
|
||||
def __init__(self,*_args,**_kwargs):
|
||||
self.this = dllwidget_c.new_wxDllWidget(*_args,**_kwargs)
|
||||
self.thisown = 1
|
||||
self._setOORInfo(self)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------- FUNCTION WRAPPERS ------------------
|
||||
|
||||
wxDllWidget_GetDllExt = dllwidget_c.wxDllWidget_GetDllExt
|
||||
|
||||
|
||||
|
||||
#-------------- VARIABLE WRAPPERS ------------------
|
||||
|
||||
|
|
@ -1,710 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: _treelist.i
|
||||
// Purpose: wxTreeListCtrl and helpers
|
||||
//
|
||||
// Author: Robin Dunn
|
||||
//
|
||||
// Created: 12-Sept-2006
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2006 by Total Control Software
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Not a %module
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%{
|
||||
#include "wx/treelistctrl.h"
|
||||
#include "wx/wxPython/pytree.h"
|
||||
|
||||
%}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
%newgroup
|
||||
|
||||
|
||||
MAKE_CONST_WXSTRING2(TreeListCtrlNameStr, wxT("treelistctrl"));
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// wxTreeListCtrl - the multicolumn tree control
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
enum {
|
||||
DEFAULT_COL_WIDTH = 100
|
||||
};
|
||||
|
||||
// modes for navigation
|
||||
enum {
|
||||
wxTL_MODE_NAV_FULLTREE,
|
||||
wxTL_MODE_NAV_EXPANDED,
|
||||
wxTL_MODE_NAV_VISIBLE,
|
||||
wxTL_MODE_NAV_LEVEL
|
||||
};
|
||||
|
||||
// modes for FindItem
|
||||
enum {
|
||||
wxTL_MODE_FIND_EXACT,
|
||||
wxTL_MODE_FIND_PARTIAL,
|
||||
wxTL_MODE_FIND_NOCASE
|
||||
};
|
||||
|
||||
// additional flag for HitTest
|
||||
enum {
|
||||
wxTREE_HITTEST_ONITEMCOLUMN
|
||||
};
|
||||
%pythoncode { wx.TREE_HITTEST_ONITEMCOLUMN = TREE_HITTEST_ONITEMCOLUMN }
|
||||
|
||||
|
||||
// additional style flags
|
||||
enum {
|
||||
wxTR_COLUMN_LINES, // put border around items
|
||||
wxTR_VIRTUAL // The application provides items text on demand.
|
||||
};
|
||||
%pythoncode {
|
||||
wx.TR_COLUMN_LINES = TR_COLUMN_LINES
|
||||
wxTR_VIRTUAL = TR_VIRTUAL
|
||||
}
|
||||
|
||||
|
||||
%pythoncode {
|
||||
%#// Compatibility aliases for old names/values
|
||||
TL_ALIGN_LEFT = wx.ALIGN_LEFT
|
||||
TL_ALIGN_RIGHT = wx.ALIGN_RIGHT
|
||||
TL_ALIGN_CENTER = wx.ALIGN_CENTER
|
||||
|
||||
TL_SEARCH_VISIBLE = TL_MODE_NAV_VISIBLE
|
||||
TL_SEARCH_LEVEL = TL_MODE_NAV_LEVEL
|
||||
TL_SEARCH_FULL = TL_MODE_FIND_EXACT
|
||||
TL_SEARCH_PARTIAL = TL_MODE_FIND_PARTIAL
|
||||
TL_SEARCH_NOCASE = TL_MODE_FIND_NOCASE
|
||||
|
||||
TR_DONT_ADJUST_MAC = 0
|
||||
wx.TR_DONT_ADJUST_MAC = TR_DONT_ADJUST_MAC
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
class wxTreeListColumnInfo: public wxObject {
|
||||
public:
|
||||
wxTreeListColumnInfo(const wxString& text = wxPyEmptyString,
|
||||
int width = DEFAULT_COL_WIDTH,
|
||||
int flag = wxALIGN_LEFT,
|
||||
int image = -1,
|
||||
bool shown = true,
|
||||
bool edit = false);
|
||||
|
||||
~wxTreeListColumnInfo();
|
||||
|
||||
int GetAlignment() const;
|
||||
wxString GetText() const;
|
||||
int GetImage() const;
|
||||
int GetSelectedImage() const;
|
||||
size_t GetWidth() const;
|
||||
bool IsEditable() const { return m_edit; }
|
||||
bool IsShown() const { return m_shown; }
|
||||
|
||||
// TODO: These all actually return wxTreeListColumnInfo&, any problem with doing it for Python too?
|
||||
void SetAlignment(int alignment);
|
||||
void SetText(const wxString& text);
|
||||
void SetImage(int image);
|
||||
void SetSelectedImage(int image);
|
||||
void SetWidth(size_t with);
|
||||
void SetEditable (bool edit);
|
||||
void SetShown(bool shown);
|
||||
|
||||
%property(Alignment, GetAlignment, SetAlignment, doc="See `GetAlignment` and `SetAlignment`");
|
||||
%property(Image, GetImage, SetImage, doc="See `GetImage` and `SetImage`");
|
||||
%property(SelectedImage, GetSelectedImage, SetSelectedImage, doc="See `GetSelectedImage` and `SetSelectedImage`");
|
||||
%property(Text, GetText, SetText, doc="See `GetText` and `SetText`");
|
||||
%property(Width, GetWidth, SetWidth, doc="See `GetWidth` and `SetWidth`");
|
||||
%property(Editable, IsEditable, SetEditable);
|
||||
%property(Shown, IsShown, SetShown);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
%{ // C++ version of Python aware control
|
||||
class wxPyTreeListCtrl : public wxTreeListCtrl {
|
||||
DECLARE_ABSTRACT_CLASS(wxPyTreeListCtrl);
|
||||
public:
|
||||
wxPyTreeListCtrl() : wxTreeListCtrl() {}
|
||||
wxPyTreeListCtrl(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator &validator,
|
||||
const wxString& name) :
|
||||
wxTreeListCtrl(parent, id, pos, size, style, validator, name) {}
|
||||
|
||||
virtual int OnCompareItems(const wxTreeItemId& item1,
|
||||
const wxTreeItemId& item2) {
|
||||
int rval = 0;
|
||||
bool found;
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
if ((found = wxPyCBH_findCallback(m_myInst, "OnCompareItems"))) {
|
||||
PyObject *o1 = wxPyConstructObject((void*)&item1, wxT("wxTreeItemId"), 0);
|
||||
PyObject *o2 = wxPyConstructObject((void*)&item2, wxT("wxTreeItemId"), 0);
|
||||
rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)",o1,o2));
|
||||
Py_DECREF(o1);
|
||||
Py_DECREF(o2);
|
||||
}
|
||||
wxPyEndBlockThreads(blocked);
|
||||
if (! found)
|
||||
rval = wxTreeListCtrl::OnCompareItems(item1, item2);
|
||||
return rval;
|
||||
}
|
||||
|
||||
virtual wxString OnGetItemText( wxTreeItemData* item, long column ) const {
|
||||
wxString rval;
|
||||
bool found;
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
if ((found = wxPyCBH_findCallback(m_myInst, "OnGetItemText"))) {
|
||||
PyObject* ro;
|
||||
PyObject* itemo = wxPyConstructObject((void*)&item, wxT("wxTreeItemId"), 0);
|
||||
ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(Oi)", itemo, column));
|
||||
Py_DECREF(itemo);
|
||||
if (ro) {
|
||||
rval = Py2wxString(ro);
|
||||
Py_DECREF(ro);
|
||||
}
|
||||
}
|
||||
wxPyEndBlockThreads(blocked);
|
||||
if (! found)
|
||||
rval = wxTreeListCtrl::OnGetItemText(item, column);
|
||||
return rval;
|
||||
}
|
||||
|
||||
PYPRIVATE;
|
||||
};
|
||||
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxPyTreeListCtrl, wxTreeListCtrl)
|
||||
|
||||
%}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
MustHaveApp(wxPyTreeListCtrl);
|
||||
|
||||
%rename(TreeListCtrl) wxPyTreeListCtrl;
|
||||
class wxPyTreeListCtrl : public wxControl
|
||||
{
|
||||
public:
|
||||
%pythonAppend wxPyTreeListCtrl "self._setOORInfo(self);" setCallbackInfo(TreeListCtrl)
|
||||
%pythonAppend wxPyTreeListCtrl() ""
|
||||
|
||||
wxPyTreeListCtrl(wxWindow *parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTR_DEFAULT_STYLE,
|
||||
const wxValidator &validator = wxDefaultValidator,
|
||||
const wxString& name = wxPyTreeListCtrlNameStr );
|
||||
%RenameCtor(PreTreeListCtrl, wxPyTreeListCtrl());
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTR_DEFAULT_STYLE,
|
||||
const wxValidator &validator = wxDefaultValidator,
|
||||
const wxString& name = wxPyTreeListCtrlNameStr );
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
|
||||
// get the total number of items in the control
|
||||
size_t GetCount() const;
|
||||
|
||||
// indent is the number of pixels the children are indented relative to
|
||||
// the parents position. SetIndent() also redraws the control
|
||||
// immediately.
|
||||
unsigned int GetIndent() const;
|
||||
void SetIndent(unsigned int indent);
|
||||
|
||||
// line spacing is the space above and below the text on each line
|
||||
unsigned int GetLineSpacing() const;
|
||||
void SetLineSpacing(unsigned int spacing);
|
||||
|
||||
// image list: these functions allow to associate an image list with
|
||||
// the control and retrieve it. Note that when assigned with
|
||||
// SetImageList, the control does _not_ delete
|
||||
// the associated image list when it's deleted in order to allow image
|
||||
// lists to be shared between different controls. If you use
|
||||
// AssignImageList, the control _does_ delete the image list.
|
||||
//
|
||||
// The normal image list is for the icons which correspond to the
|
||||
// normal tree item state (whether it is selected or not).
|
||||
// Additionally, the application might choose to show a state icon
|
||||
// which corresponds to an app-defined item state (for example,
|
||||
// checked/unchecked) which are taken from the state image list.
|
||||
wxImageList *GetImageList() const;
|
||||
wxImageList *GetStateImageList() const;
|
||||
wxImageList *GetButtonsImageList() const;
|
||||
|
||||
void SetImageList(wxImageList *imageList);
|
||||
void SetStateImageList(wxImageList *imageList);
|
||||
void SetButtonsImageList(wxImageList *imageList);
|
||||
|
||||
%disownarg( wxImageList *imageList );
|
||||
void AssignImageList(wxImageList *imageList);
|
||||
void AssignStateImageList(wxImageList *imageList);
|
||||
void AssignButtonsImageList(wxImageList *imageList);
|
||||
%cleardisown( wxImageList *imageList );
|
||||
|
||||
|
||||
// adds a column
|
||||
void AddColumn (const wxString& text,
|
||||
int width = DEFAULT_COL_WIDTH,
|
||||
int flag = wxALIGN_LEFT,
|
||||
int image = -1,
|
||||
bool shown = true,
|
||||
bool edit = false);
|
||||
%Rename(AddColumnInfo, void, AddColumn(const wxTreeListColumnInfo& col));
|
||||
|
||||
// inserts a column before the given one
|
||||
void InsertColumn (int before,
|
||||
const wxString& text,
|
||||
int width = DEFAULT_COL_WIDTH,
|
||||
int flag = wxALIGN_LEFT,
|
||||
int image = -1,
|
||||
bool shown = true,
|
||||
bool edit = false);
|
||||
%Rename(InsertColumnInfo, void, InsertColumn(size_t before, const wxTreeListColumnInfo& col));
|
||||
|
||||
// deletes the given column - does not delete the corresponding column
|
||||
// of each item
|
||||
void RemoveColumn(size_t column);
|
||||
|
||||
// returns the number of columns in the ctrl
|
||||
size_t GetColumnCount() const;
|
||||
|
||||
// tells which column is the "main" one, i.e. the "threaded" one
|
||||
void SetMainColumn(size_t column);
|
||||
size_t GetMainColumn() const;
|
||||
|
||||
void SetColumn (int column, const wxTreeListColumnInfo& colInfo);
|
||||
wxTreeListColumnInfo& GetColumn (int column);
|
||||
|
||||
void SetColumnText (int column, const wxString& text);
|
||||
wxString GetColumnText (int column) const;
|
||||
|
||||
void SetColumnWidth (int column, int width);
|
||||
int GetColumnWidth (int column) const;
|
||||
|
||||
void SetColumnAlignment (int column, int flag);
|
||||
int GetColumnAlignment (int column) const;
|
||||
|
||||
void SetColumnImage (int column, int image);
|
||||
int GetColumnImage (int column) const;
|
||||
|
||||
void SetColumnShown (int column, bool shown = true);
|
||||
bool IsColumnShown (int column) const;
|
||||
%pythoncode { ShowColumn = SetColumnShown }
|
||||
|
||||
void SetColumnEditable (int column, bool edit = true);
|
||||
bool IsColumnEditable (int column) const;
|
||||
|
||||
|
||||
|
||||
|
||||
%extend {
|
||||
// retrieves item's label of the given column (main column by default)
|
||||
wxString GetItemText(const wxTreeItemId& item, int column = -1) {
|
||||
if (column < 0) column = self->GetMainColumn();
|
||||
return self->GetItemText(item, column);
|
||||
}
|
||||
|
||||
// get one of the images associated with the item (normal by default)
|
||||
int GetItemImage(const wxTreeItemId& item, int column = -1,
|
||||
wxTreeItemIcon which = wxTreeItemIcon_Normal) {
|
||||
if (column < 0) column = self->GetMainColumn();
|
||||
return self->GetItemImage(item, column, which);
|
||||
}
|
||||
|
||||
// set item's label (main column by default)
|
||||
void SetItemText(const wxTreeItemId& item, const wxString& text, int column = -1) {
|
||||
if (column < 0) column = self->GetMainColumn();
|
||||
self->SetItemText(item, column, text);
|
||||
}
|
||||
|
||||
// set one of the images associated with the item (normal by default)
|
||||
// the which parameter is ignored for all columns but the main one
|
||||
void SetItemImage(const wxTreeItemId& item, int image, int column = -1,
|
||||
wxTreeItemIcon which = wxTreeItemIcon_Normal) {
|
||||
if (column < 0) column = self->GetMainColumn();
|
||||
self->SetItemImage(item, column, image, which);
|
||||
}
|
||||
|
||||
|
||||
// [Get|Set]ItemData substitutes. Automatically create wxPyTreeItemData
|
||||
// if needed.
|
||||
wxPyTreeItemData* GetItemData(const wxTreeItemId& item) {
|
||||
wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
|
||||
if (data == NULL) {
|
||||
data = new wxPyTreeItemData();
|
||||
data->SetId(item); // set the id
|
||||
self->SetItemData(item, data);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
%disownarg( wxPyTreeItemData* data );
|
||||
void SetItemData(const wxTreeItemId& item, wxPyTreeItemData* data) {
|
||||
data->SetId(item); // set the id
|
||||
self->SetItemData(item, data);
|
||||
}
|
||||
%cleardisown(wxPyTreeItemData* data );
|
||||
|
||||
// [Get|Set]ItemPyData are short-cuts. Also made somewhat crash-proof by
|
||||
// automatically creating data classes.
|
||||
PyObject* GetItemPyData(const wxTreeItemId& item) {
|
||||
wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
|
||||
if (data == NULL) {
|
||||
data = new wxPyTreeItemData();
|
||||
data->SetId(item); // set the id
|
||||
self->SetItemData(item, data);
|
||||
}
|
||||
return data->GetData();
|
||||
}
|
||||
|
||||
void SetItemPyData(const wxTreeItemId& item, PyObject* obj) {
|
||||
wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
|
||||
if (data == NULL) {
|
||||
data = new wxPyTreeItemData(obj);
|
||||
data->SetId(item); // set the id
|
||||
self->SetItemData(item, data);
|
||||
} else
|
||||
data->SetData(obj);
|
||||
}
|
||||
}
|
||||
%pythoncode { GetPyData = GetItemPyData }
|
||||
%pythoncode { SetPyData = SetItemPyData }
|
||||
|
||||
|
||||
bool GetItemBold(const wxTreeItemId& item) const;
|
||||
wxColour GetItemTextColour(const wxTreeItemId& item) const;
|
||||
wxColour GetItemBackgroundColour(const wxTreeItemId& item) const;
|
||||
wxFont GetItemFont(const wxTreeItemId& item) const;
|
||||
|
||||
|
||||
// force appearance of [+] button near the item. This is useful to
|
||||
// allow the user to expand the items which don't have any children now
|
||||
// - but instead add them only when needed, thus minimizing memory
|
||||
// usage and loading time.
|
||||
void SetItemHasChildren(const wxTreeItemId& item, bool has = true);
|
||||
|
||||
// the item will be shown in bold
|
||||
void SetItemBold(const wxTreeItemId& item, bool bold = true);
|
||||
|
||||
// set the item's text colour
|
||||
void SetItemTextColour(const wxTreeItemId& item, const wxColour& colour);
|
||||
|
||||
// set the item's background colour
|
||||
void SetItemBackgroundColour(const wxTreeItemId& item,
|
||||
const wxColour& colour);
|
||||
|
||||
// set the item's font (should be of the same height for all items)
|
||||
void SetItemFont(const wxTreeItemId& item, const wxFont& font);
|
||||
|
||||
|
||||
|
||||
// is the item visible (it might be outside the view or not expanded)?
|
||||
bool IsVisible(const wxTreeItemId& item) const;
|
||||
|
||||
// does the item has any children?
|
||||
bool HasChildren(const wxTreeItemId& item) const;
|
||||
%pythoncode { ItemHasChildren = HasChildren }
|
||||
|
||||
// is the item expanded (only makes sense if HasChildren())?
|
||||
bool IsExpanded(const wxTreeItemId& item) const;
|
||||
|
||||
// is this item currently selected (the same as has focus)?
|
||||
bool IsSelected(const wxTreeItemId& item) const;
|
||||
|
||||
// is item text in bold font?
|
||||
bool IsBold(const wxTreeItemId& item) const;
|
||||
|
||||
|
||||
// if 'recursively' is False, only immediate children count, otherwise
|
||||
// the returned number is the number of all items in this branch
|
||||
size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = true);
|
||||
|
||||
|
||||
// wxTreeItemId.IsOk() will return False if there is no such item
|
||||
|
||||
// get the root tree item
|
||||
wxTreeItemId GetRootItem() const;
|
||||
|
||||
// get the item currently selected (may return NULL if no selection)
|
||||
wxTreeItemId GetSelection() const;
|
||||
|
||||
// get the items currently selected, return the number of such item
|
||||
//size_t GetSelections(wxArrayTreeItemIds&) const;
|
||||
%extend {
|
||||
PyObject* GetSelections() {
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
PyObject* rval = PyList_New(0);
|
||||
wxArrayTreeItemIds array;
|
||||
size_t num, x;
|
||||
num = self->GetSelections(array);
|
||||
for (x=0; x < num; x++) {
|
||||
wxTreeItemId *tii = new wxTreeItemId(array.Item(x));
|
||||
PyObject* item = wxPyConstructObject((void*)tii, wxT("wxTreeItemId"), true);
|
||||
PyList_Append(rval, item);
|
||||
Py_DECREF(item);
|
||||
}
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return rval;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// get the parent of this item (may return NULL if root)
|
||||
wxTreeItemId GetItemParent(const wxTreeItemId& item) const;
|
||||
|
||||
// for this enumeration function you must pass in a "cookie" parameter
|
||||
// which is opaque for the application but is necessary for the library
|
||||
// to make these functions reentrant (i.e. allow more than one
|
||||
// enumeration on one and the same object simultaneously). Of course,
|
||||
// the "cookie" passed to GetFirstChild() and GetNextChild() should be
|
||||
// the same!
|
||||
|
||||
|
||||
// NOTE: These are a copy of the same methods in _treectrl.i, be sure to
|
||||
// update both at the same time. (Or find a good way to refactor!)
|
||||
%extend {
|
||||
// Get the first child of this item. Returns a wxTreeItemId and an
|
||||
// opaque "cookie" value that should be passed to GetNextChild in
|
||||
// order to continue the search.
|
||||
PyObject* GetFirstChild(const wxTreeItemId& item) {
|
||||
void* cookie = 0;
|
||||
wxTreeItemId* ritem = new wxTreeItemId(self->GetFirstChild(item, cookie));
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
PyObject* tup = PyTuple_New(2);
|
||||
PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), true));
|
||||
PyTuple_SET_ITEM(tup, 1, wxPyMakeSwigPtr(cookie, wxT("void")));
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return tup;
|
||||
}
|
||||
|
||||
|
||||
// Get the next child of this item. The cookie parameter is the 2nd
|
||||
// value returned from GetFirstChild or the previous GetNextChild.
|
||||
// Returns a wxTreeItemId and an opaque "cookie" value that should be
|
||||
// passed to GetNextChild in order to continue the search.
|
||||
PyObject* GetNextChild(const wxTreeItemId& item, void* cookie) {
|
||||
wxTreeItemId* ritem = new wxTreeItemId(self->GetNextChild(item, cookie));
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
PyObject* tup = PyTuple_New(2);
|
||||
PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), true));
|
||||
PyTuple_SET_ITEM(tup, 1, wxPyMakeSwigPtr(cookie, wxT("void")));
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return tup;
|
||||
}
|
||||
|
||||
|
||||
PyObject* GetLastChild(const wxTreeItemId& item) {
|
||||
void* cookie = 0;
|
||||
wxTreeItemId* ritem = new wxTreeItemId(self->GetLastChild(item, cookie));
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
PyObject* tup = PyTuple_New(2);
|
||||
PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), true));
|
||||
PyTuple_SET_ITEM(tup, 1, wxPyMakeSwigPtr(cookie, wxT("void")));
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return tup;
|
||||
}
|
||||
|
||||
|
||||
PyObject* GetPrevChild(const wxTreeItemId& item, void* cookie) {
|
||||
wxTreeItemId* ritem = new wxTreeItemId(self->GetPrevChild(item, cookie));
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
PyObject* tup = PyTuple_New(2);
|
||||
PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), true));
|
||||
PyTuple_SET_ITEM(tup, 1, wxPyMakeSwigPtr(cookie, wxT("void")));
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return tup;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// get the next sibling of this item
|
||||
wxTreeItemId GetNextSibling(const wxTreeItemId& item) const;
|
||||
|
||||
// get the previous sibling
|
||||
wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const;
|
||||
|
||||
|
||||
// get item in the full tree (currently only for internal use)
|
||||
wxTreeItemId GetNext(const wxTreeItemId& item) const;
|
||||
wxTreeItemId GetPrev(const wxTreeItemId& item) const;
|
||||
|
||||
// get expanded item, see IsExpanded()
|
||||
wxTreeItemId GetFirstExpandedItem() const;
|
||||
wxTreeItemId GetNextExpanded(const wxTreeItemId& item) const;
|
||||
wxTreeItemId GetPrevExpanded(const wxTreeItemId& item) const;
|
||||
|
||||
// get visible item, see IsVisible()
|
||||
wxTreeItemId GetFirstVisibleItem(bool fullRow = false) const;
|
||||
wxTreeItemId GetNextVisible(const wxTreeItemId& item, bool fullRow = false) const;
|
||||
wxTreeItemId GetPrevVisible(const wxTreeItemId& item, bool fullRow = false) const;
|
||||
|
||||
|
||||
|
||||
%disownarg( wxPyTreeItemData* data );
|
||||
|
||||
// add the root node to the tree
|
||||
wxTreeItemId AddRoot(const wxString& text,
|
||||
int image = -1, int selectedImage = -1,
|
||||
wxPyTreeItemData *data = NULL);
|
||||
|
||||
// insert a new item in as the first child of the parent
|
||||
wxTreeItemId PrependItem(const wxTreeItemId& parent,
|
||||
const wxString& text,
|
||||
int image = -1, int selectedImage = -1,
|
||||
wxPyTreeItemData *data = NULL);
|
||||
|
||||
// insert a new item after a given one
|
||||
wxTreeItemId InsertItem(const wxTreeItemId& parent,
|
||||
const wxTreeItemId& idPrevious,
|
||||
const wxString& text,
|
||||
int image = -1, int selectedImage = -1,
|
||||
wxPyTreeItemData *data = NULL);
|
||||
|
||||
// insert a new item before the one with the given index
|
||||
%Rename(InsertItemBefore,
|
||||
wxTreeItemId, InsertItem(const wxTreeItemId& parent,
|
||||
size_t index,
|
||||
const wxString& text,
|
||||
int image = -1, int selectedImage = -1,
|
||||
wxPyTreeItemData *data = NULL));
|
||||
|
||||
// insert a new item in as the last child of the parent
|
||||
wxTreeItemId AppendItem(const wxTreeItemId& parent,
|
||||
const wxString& text,
|
||||
int image = -1, int selectedImage = -1,
|
||||
wxPyTreeItemData *data = NULL);
|
||||
|
||||
%cleardisown(wxPyTreeItemData* data );
|
||||
|
||||
// delete this item and associated data if any
|
||||
void Delete(const wxTreeItemId& item);
|
||||
|
||||
// delete all children (but don't delete the item itself)
|
||||
// NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events
|
||||
void DeleteChildren(const wxTreeItemId& item);
|
||||
|
||||
// delete all items from the tree
|
||||
// NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events
|
||||
void DeleteRoot();
|
||||
%pythoncode { DeleteAllItems = DeleteRoot }
|
||||
|
||||
|
||||
|
||||
// expand this item
|
||||
void Expand(const wxTreeItemId& item);
|
||||
|
||||
// expand this item and all subitems recursively
|
||||
void ExpandAll(const wxTreeItemId& item);
|
||||
|
||||
// collapse the item without removing its children
|
||||
void Collapse(const wxTreeItemId& item);
|
||||
|
||||
// collapse the item and remove all children
|
||||
void CollapseAndReset(const wxTreeItemId& item);
|
||||
|
||||
// toggles the current state
|
||||
void Toggle(const wxTreeItemId& item);
|
||||
|
||||
// remove the selection from currently selected item (if any)
|
||||
void Unselect();
|
||||
void UnselectAll();
|
||||
|
||||
// select this item
|
||||
void SelectItem(const wxTreeItemId& item,
|
||||
const wxTreeItemId& last = (wxTreeItemId*)NULL,
|
||||
bool unselect_others=true);
|
||||
|
||||
void SelectAll();
|
||||
|
||||
// make sure this item is visible (expanding the parent item and/or
|
||||
// scrolling to this item if necessary)
|
||||
void EnsureVisible(const wxTreeItemId& item);
|
||||
|
||||
// scroll to this item (but don't expand its parent)
|
||||
void ScrollTo(const wxTreeItemId& item);
|
||||
|
||||
// Returns wxTreeItemId, flags, and column
|
||||
wxTreeItemId HitTest(const wxPoint& point, int& OUTPUT, int& OUTPUT);
|
||||
|
||||
%extend {
|
||||
// get the bounding rectangle of the item (or of its label only)
|
||||
PyObject* GetBoundingRect(const wxTreeItemId& item, bool textOnly = false) {
|
||||
wxRect rect;
|
||||
if (self->GetBoundingRect(item, rect, textOnly)) {
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
wxRect* r = new wxRect(rect);
|
||||
PyObject* val = wxPyConstructObject((void*)r, wxT("wxRect"), 1);
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return val;
|
||||
}
|
||||
else {
|
||||
RETURN_NONE();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
%extend {
|
||||
// Start editing the item label: this (temporarily) replaces the item
|
||||
// with a one line edit control. The item will be selected if it hadn't
|
||||
// been before.
|
||||
void EditLabel(const wxTreeItemId& item, int column = -1) {
|
||||
if (column < 0) column = self->GetMainColumn();
|
||||
self->EditLabel(item, column);
|
||||
}
|
||||
}
|
||||
%pythoncode { Edit = EditLabel }
|
||||
|
||||
// sort the children of this item using OnCompareItems
|
||||
void SortChildren(const wxTreeItemId& item);
|
||||
|
||||
// searching
|
||||
wxTreeItemId FindItem (const wxTreeItemId& item, const wxString& str, int flags = 0);
|
||||
|
||||
// drop over item
|
||||
void SetDragItem (const wxTreeItemId& item = (wxTreeItemId*)NULL);
|
||||
|
||||
wxWindow* GetHeaderWindow() const;
|
||||
wxScrolledWindow* GetMainWindow() const;
|
||||
|
||||
%property(ButtonsImageList, GetButtonsImageList, SetButtonsImageList, doc="See `GetButtonsImageList` and `SetButtonsImageList`");
|
||||
%property(ColumnCount, GetColumnCount, doc="See `GetColumnCount`");
|
||||
%property(Count, GetCount, doc="See `GetCount`");
|
||||
%property(HeaderWindow, GetHeaderWindow, doc="See `GetHeaderWindow`");
|
||||
%property(ImageList, GetImageList, SetImageList, doc="See `GetImageList` and `SetImageList`");
|
||||
%property(Indent, GetIndent, SetIndent, doc="See `GetIndent` and `SetIndent`");
|
||||
%property(LineSpacing, GetLineSpacing, SetLineSpacing, doc="See `GetLineSpacing` and `SetLineSpacing`");
|
||||
%property(MainColumn, GetMainColumn, SetMainColumn, doc="See `GetMainColumn` and `SetMainColumn`");
|
||||
%property(MainWindow, GetMainWindow, doc="See `GetMainWindow`");
|
||||
%property(Next, GetNext, doc="See `GetNext`");
|
||||
%property(RootItem, GetRootItem, doc="See `GetRootItem`");
|
||||
%property(Selection, GetSelection, doc="See `GetSelection`");
|
||||
%property(Selections, GetSelections, doc="See `GetSelections`");
|
||||
%property(StateImageList, GetStateImageList, SetStateImageList, doc="See `GetStateImageList` and `SetStateImageList`");
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
%init %{
|
||||
wxPyPtrTypeMap_Add("wxTreeListCtrl", "wxPyTreeListCtrl");
|
||||
%}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
@ -1,514 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: gizmos.i
|
||||
// Purpose: Wrappers for the "gizmo" classes in wx/contrib
|
||||
//
|
||||
// Author: Robin Dunn
|
||||
//
|
||||
// Created: 23-Nov-2001
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2001 by Total Control Software
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
%define DOCSTRING
|
||||
"Various *gizmo* classes: `DynamicSashWindow`, `EditableListBox`,
|
||||
`LEDNumberCtrl`, `TreeListCtrl`, etc."
|
||||
%enddef
|
||||
|
||||
%module(package="wx", docstring=DOCSTRING) gizmos
|
||||
|
||||
|
||||
%{
|
||||
#include "wx/wxPython/wxPython.h"
|
||||
#include "wx/wxPython/pyclasses.h"
|
||||
|
||||
#include <wx/gizmos/dynamicsash.h>
|
||||
//#include <wx/gizmos/editlbox.h>
|
||||
#include <wx/gizmos/splittree.h>
|
||||
#include <wx/gizmos/ledctrl.h>
|
||||
#include <wx/gizmos/statpict.h>
|
||||
|
||||
#include <wx/listctrl.h>
|
||||
#include <wx/treectrl.h>
|
||||
#include <wx/imaglist.h>
|
||||
#include <wx/editlbox.h>
|
||||
%}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%import windows.i
|
||||
%import controls.i
|
||||
%pythoncode { import wx }
|
||||
%pythoncode { __docfilter__ = wx._core.__DocFilter(globals()) }
|
||||
|
||||
|
||||
MAKE_CONST_WXSTRING2(DynamicSashNameStr, wxT("dynamicSashWindow"));
|
||||
MAKE_CONST_WXSTRING2(EditableListBoxNameStr, wxT("editableListBox"));
|
||||
MAKE_CONST_WXSTRING(StaticPictureNameStr);
|
||||
|
||||
MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
enum {
|
||||
wxDS_MANAGE_SCROLLBARS,
|
||||
wxDS_DRAG_CORNER,
|
||||
};
|
||||
|
||||
%constant wxEventType wxEVT_DYNAMIC_SASH_SPLIT;
|
||||
%constant wxEventType wxEVT_DYNAMIC_SASH_UNIFY;
|
||||
|
||||
|
||||
/*
|
||||
wxDynamicSashSplitEvents are sent to your view by wxDynamicSashWindow
|
||||
whenever your view is being split by the user. It is your
|
||||
responsibility to handle this event by creating a new view window as
|
||||
a child of the wxDynamicSashWindow. wxDynamicSashWindow will
|
||||
automatically reparent it to the proper place in its window hierarchy.
|
||||
*/
|
||||
class wxDynamicSashSplitEvent : public wxCommandEvent {
|
||||
public:
|
||||
wxDynamicSashSplitEvent(wxObject *target);
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
wxDynamicSashUnifyEvents are sent to your view by wxDynamicSashWindow
|
||||
whenever the sash which splits your view and its sibling is being
|
||||
reunified such that your view is expanding to replace its sibling.
|
||||
You needn't do anything with this event if you are allowing
|
||||
wxDynamicSashWindow to manage your view's scrollbars, but it is useful
|
||||
if you are managing the scrollbars yourself so that you can keep
|
||||
the scrollbars' event handlers connected to your view's event handler
|
||||
class.
|
||||
*/
|
||||
class wxDynamicSashUnifyEvent : public wxCommandEvent {
|
||||
public:
|
||||
wxDynamicSashUnifyEvent(wxObject *target);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
wxDynamicSashWindow
|
||||
|
||||
wxDynamicSashWindow widgets manages the way other widgets are viewed.
|
||||
When a wxDynamicSashWindow is first shown, it will contain one child
|
||||
view, a viewport for that child, and a pair of scrollbars to allow the
|
||||
user to navigate the child view area. Next to each scrollbar is a small
|
||||
tab. By clicking on either tab and dragging to the appropriate spot, a
|
||||
user can split the view area into two smaller views separated by a
|
||||
draggable sash. Later, when the user wishes to reunify the two subviews,
|
||||
the user simply drags the sash to the side of the window.
|
||||
wxDynamicSashWindow will automatically reparent the appropriate child
|
||||
view back up the window hierarchy, and the wxDynamicSashWindow will have
|
||||
only one child view once again.
|
||||
|
||||
As an application developer, you will simply create a wxDynamicSashWindow
|
||||
using either the Create() function or the more complex constructor
|
||||
provided below, and then create a view window whose parent is the
|
||||
wxDynamicSashWindow. The child should respond to
|
||||
wxDynamicSashSplitEvents -- perhaps with an OnSplit() event handler -- by
|
||||
constructing a new view window whose parent is also the
|
||||
wxDynamicSashWindow. That's it! Now your users can dynamically split
|
||||
and reunify the view you provided.
|
||||
|
||||
If you wish to handle the scrollbar events for your view, rather than
|
||||
allowing wxDynamicSashWindow to do it for you, things are a bit more
|
||||
complex. (You might want to handle scrollbar events yourself, if,
|
||||
for instance, you wish to scroll a subwindow of the view you add to
|
||||
your wxDynamicSashWindow object, rather than scrolling the whole view.)
|
||||
In this case, you will need to construct your wxDynamicSashWindow without
|
||||
the wxDS_MANAGE_SCROLLBARS style and you will need to use the
|
||||
GetHScrollBar() and GetVScrollBar() methods to retrieve the scrollbar
|
||||
controls and call SetEventHanler() on them to redirect the scrolling
|
||||
events whenever your window is reparented by wxDyanmicSashWindow.
|
||||
You will need to set the scrollbars' event handler at three times:
|
||||
|
||||
* When your view is created
|
||||
* When your view receives a wxDynamicSashSplitEvent
|
||||
* When your view receives a wxDynamicSashUnifyEvent
|
||||
|
||||
See the dynsash_switch sample application for an example which does this.
|
||||
|
||||
*/
|
||||
|
||||
MustHaveApp(wxDynamicSashWindow);
|
||||
|
||||
class wxDynamicSashWindow : public wxWindow {
|
||||
public:
|
||||
%pythonAppend wxDynamicSashWindow "self._setOORInfo(self)"
|
||||
%pythonAppend wxDynamicSashWindow() ""
|
||||
|
||||
wxDynamicSashWindow(wxWindow *parent, wxWindowID id=-1,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER,
|
||||
const wxString& name = wxPyDynamicSashNameStr);
|
||||
%RenameCtor(PreDynamicSashWindow, wxDynamicSashWindow());
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id=-1,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER,
|
||||
const wxString& name = wxPyDynamicSashNameStr);
|
||||
|
||||
wxScrollBar *GetHScrollBar(const wxWindow *child) const;
|
||||
wxScrollBar *GetVScrollBar(const wxWindow *child) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
%pythoncode {
|
||||
EVT_DYNAMIC_SASH_SPLIT = wx.PyEventBinder( wxEVT_DYNAMIC_SASH_SPLIT, 1 )
|
||||
EVT_DYNAMIC_SASH_UNIFY = wx.PyEventBinder( wxEVT_DYNAMIC_SASH_UNIFY, 1 )
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
enum {
|
||||
wxEL_ALLOW_NEW,
|
||||
wxEL_ALLOW_EDIT,
|
||||
wxEL_ALLOW_DELETE,
|
||||
wxEL_NO_REORDER,
|
||||
wxEL_DEFAULT_STYLE
|
||||
};
|
||||
|
||||
|
||||
%typemap(out) wxPyListCtrl*
|
||||
{ $result = wxPyMake_wxObject((wxObject*)$1, (bool)$owner); }
|
||||
|
||||
|
||||
// This class provides a composite control that lets the
|
||||
// user easily enter list of strings
|
||||
MustHaveApp(wxEditableListBox);
|
||||
class wxEditableListBox : public wxPanel
|
||||
{
|
||||
public:
|
||||
%pythonAppend wxEditableListBox "self._setOORInfo(self)"
|
||||
%pythonAppend wxEditableListBox() ""
|
||||
|
||||
wxEditableListBox(wxWindow *parent, wxWindowID id=-1,
|
||||
const wxString& label = wxPyEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxEL_DEFAULT_STYLE,
|
||||
const wxString& name = wxPyEditableListBoxNameStr);
|
||||
%RenameCtor(PreEditableListBox, wxEditableListBox());
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxEL_DEFAULT_STYLE,
|
||||
const wxString& name = wxEditableListBoxNameStr);
|
||||
|
||||
void SetStrings(const wxArrayString& strings);
|
||||
|
||||
//void GetStrings(wxArrayString& strings);
|
||||
%extend {
|
||||
PyObject* GetStrings() {
|
||||
wxArrayString strings;
|
||||
self->GetStrings(strings);
|
||||
return wxArrayString2PyList_helper(strings);
|
||||
}
|
||||
}
|
||||
|
||||
wxPyListCtrl* GetListCtrl();
|
||||
wxBitmapButton* GetDelButton();
|
||||
wxBitmapButton* GetNewButton();
|
||||
wxBitmapButton* GetUpButton();
|
||||
wxBitmapButton* GetDownButton();
|
||||
wxBitmapButton* GetEditButton();
|
||||
|
||||
%property(DelButton, GetDelButton, doc="See `GetDelButton`");
|
||||
%property(DownButton, GetDownButton, doc="See `GetDownButton`");
|
||||
%property(EditButton, GetEditButton, doc="See `GetEditButton`");
|
||||
%property(ListCtrl, GetListCtrl, doc="See `GetListCtrl`");
|
||||
%property(NewButton, GetNewButton, doc="See `GetNewButton`");
|
||||
%property(Strings, GetStrings, SetStrings, doc="See `GetStrings` and `SetStrings`");
|
||||
%property(UpButton, GetUpButton, doc="See `GetUpButton`");
|
||||
};
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
/*
|
||||
* wxRemotelyScrolledTreeCtrl
|
||||
*
|
||||
* This tree control disables its vertical scrollbar and catches scroll
|
||||
* events passed by a scrolled window higher in the hierarchy.
|
||||
* It also updates the scrolled window vertical scrollbar as appropriate.
|
||||
*/
|
||||
|
||||
%{
|
||||
typedef wxTreeCtrl wxPyTreeCtrl;
|
||||
%}
|
||||
|
||||
MustHaveApp(wxRemotelyScrolledTreeCtrl);
|
||||
|
||||
class wxRemotelyScrolledTreeCtrl: public wxPyTreeCtrl
|
||||
{
|
||||
public:
|
||||
%pythonAppend wxRemotelyScrolledTreeCtrl "self._setOORInfo(self)"
|
||||
%pythonAppend wxRemotelyScrolledTreeCtrl() ""
|
||||
|
||||
wxRemotelyScrolledTreeCtrl(wxWindow* parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTR_HAS_BUTTONS);
|
||||
|
||||
|
||||
void HideVScrollbar();
|
||||
|
||||
// Adjust the containing wxScrolledWindow's scrollbars appropriately
|
||||
void AdjustRemoteScrollbars();
|
||||
|
||||
// Find the scrolled window that contains this control
|
||||
wxScrolledWindow* GetScrolledWindow() const;
|
||||
|
||||
// Scroll to the given line (in scroll units where each unit is
|
||||
// the height of an item)
|
||||
void ScrollToLine(int posHoriz, int posVert);
|
||||
|
||||
// The companion window is one which will get notified when certain
|
||||
// events happen such as node expansion
|
||||
void SetCompanionWindow(wxWindow* companion);
|
||||
wxWindow* GetCompanionWindow() const;
|
||||
|
||||
%property(CompanionWindow, GetCompanionWindow, SetCompanionWindow, doc="See `GetCompanionWindow` and `SetCompanionWindow`");
|
||||
%property(ScrolledWindow, GetScrolledWindow, doc="See `GetScrolledWindow`");
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* wxTreeCompanionWindow
|
||||
*
|
||||
* A window displaying values associated with tree control items.
|
||||
*/
|
||||
|
||||
%{
|
||||
class wxPyTreeCompanionWindow: public wxTreeCompanionWindow
|
||||
{
|
||||
public:
|
||||
wxPyTreeCompanionWindow(wxWindow* parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0)
|
||||
: wxTreeCompanionWindow(parent, id, pos, size, style) {}
|
||||
|
||||
|
||||
virtual void DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& rect) {
|
||||
bool found;
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
if ((found = wxPyCBH_findCallback(m_myInst, "DrawItem"))) {
|
||||
PyObject* dcobj = wxPyMake_wxObject(&dc,false);
|
||||
PyObject* idobj = wxPyConstructObject((void*)&id, wxT("wxTreeItemId"), false);
|
||||
PyObject* recobj= wxPyConstructObject((void*)&rect, wxT("wxRect"), false);
|
||||
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", dcobj, idobj, recobj));
|
||||
Py_DECREF(dcobj);
|
||||
Py_DECREF(idobj);
|
||||
Py_DECREF(recobj);
|
||||
}
|
||||
wxPyEndBlockThreads(blocked);
|
||||
if (! found)
|
||||
wxTreeCompanionWindow::DrawItem(dc, id, rect);
|
||||
}
|
||||
|
||||
PYPRIVATE;
|
||||
};
|
||||
%}
|
||||
|
||||
|
||||
MustHaveApp(wxPyTreeCompanionWindow);
|
||||
|
||||
%rename(TreeCompanionWindow) wxPyTreeCompanionWindow;
|
||||
class wxPyTreeCompanionWindow: public wxWindow
|
||||
{
|
||||
public:
|
||||
%pythonAppend wxPyTreeCompanionWindow "self._setOORInfo(self);" setCallbackInfo(TreeCompanionWindow)
|
||||
%pythonAppend wxPyTreeCompanionWindow() ""
|
||||
|
||||
wxPyTreeCompanionWindow(wxWindow* parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0);
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
wxRemotelyScrolledTreeCtrl* GetTreeCtrl() const;
|
||||
void SetTreeCtrl(wxRemotelyScrolledTreeCtrl* treeCtrl);
|
||||
|
||||
%property(TreeCtrl, GetTreeCtrl, SetTreeCtrl, doc="See `GetTreeCtrl` and `SetTreeCtrl`");
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* wxThinSplitterWindow
|
||||
*
|
||||
* Implements a splitter with a less obvious sash
|
||||
* than the usual one.
|
||||
*/
|
||||
|
||||
MustHaveApp(wxThinSplitterWindow);
|
||||
|
||||
class wxThinSplitterWindow: public wxSplitterWindow
|
||||
{
|
||||
public:
|
||||
%pythonAppend wxThinSplitterWindow "self._setOORInfo(self)"
|
||||
%pythonAppend wxThinSplitterWindow() ""
|
||||
|
||||
wxThinSplitterWindow(wxWindow* parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_3D | wxCLIP_CHILDREN);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* wxSplitterScrolledWindow
|
||||
*
|
||||
* This scrolled window is aware of the fact that one of its
|
||||
* children is a splitter window. It passes on its scroll events
|
||||
* (after some processing) to both splitter children for them
|
||||
* scroll appropriately.
|
||||
*/
|
||||
|
||||
MustHaveApp(wxSplitterScrolledWindow);
|
||||
|
||||
class wxSplitterScrolledWindow: public wxScrolledWindow
|
||||
{
|
||||
public:
|
||||
%pythonAppend wxSplitterScrolledWindow "self._setOORInfo(self)"
|
||||
%pythonAppend wxSplitterScrolledWindow() ""
|
||||
|
||||
wxSplitterScrolledWindow(wxWindow* parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0);
|
||||
};
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
enum wxLEDValueAlign
|
||||
{
|
||||
wxLED_ALIGN_LEFT,
|
||||
wxLED_ALIGN_RIGHT,
|
||||
wxLED_ALIGN_CENTER,
|
||||
|
||||
wxLED_ALIGN_MASK,
|
||||
|
||||
wxLED_DRAW_FADED,
|
||||
};
|
||||
|
||||
|
||||
MustHaveApp(wxLEDNumberCtrl);
|
||||
|
||||
class wxLEDNumberCtrl : public wxControl
|
||||
{
|
||||
public:
|
||||
%pythonAppend wxLEDNumberCtrl "self._setOORInfo(self)"
|
||||
%pythonAppend wxLEDNumberCtrl() ""
|
||||
|
||||
wxLEDNumberCtrl(wxWindow *parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxLED_ALIGN_LEFT | wxLED_DRAW_FADED);
|
||||
%RenameCtor(PreLEDNumberCtrl, wxLEDNumberCtrl());
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxLED_ALIGN_LEFT | wxLED_DRAW_FADED);
|
||||
|
||||
wxLEDValueAlign GetAlignment() const;
|
||||
bool GetDrawFaded() const;
|
||||
const wxString &GetValue() const;
|
||||
|
||||
void SetAlignment(wxLEDValueAlign Alignment, bool Redraw = true);
|
||||
void SetDrawFaded(bool DrawFaded, bool Redraw = true);
|
||||
void SetValue(const wxString &Value, bool Redraw = true);
|
||||
|
||||
%property(Alignment, GetAlignment, SetAlignment, doc="See `GetAlignment` and `SetAlignment`");
|
||||
%property(DrawFaded, GetDrawFaded, SetDrawFaded, doc="See `GetDrawFaded` and `SetDrawFaded`");
|
||||
%property(Value, GetValue, SetValue, doc="See `GetValue` and `SetValue`");
|
||||
};
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
%include _treelist.i
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
enum
|
||||
{
|
||||
wxSCALE_HORIZONTAL,
|
||||
wxSCALE_VERTICAL,
|
||||
wxSCALE_UNIFORM,
|
||||
wxSCALE_CUSTOM
|
||||
};
|
||||
|
||||
MustHaveApp(wxStaticPicture);
|
||||
|
||||
class wxStaticPicture : public wxControl
|
||||
{
|
||||
public:
|
||||
%pythonAppend wxStaticPicture "self._setOORInfo(self)"
|
||||
%pythonAppend wxStaticPicture() ""
|
||||
|
||||
wxStaticPicture( wxWindow* parent, wxWindowID id=-1,
|
||||
const wxBitmap& label=wxNullBitmap,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPyStaticPictureNameStr );
|
||||
|
||||
%RenameCtor(PreStaticPicture, wxStaticPicture());
|
||||
|
||||
bool Create( wxWindow* parent, wxWindowID id=-1,
|
||||
const wxBitmap& label=wxNullBitmap,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPyStaticPictureNameStr );
|
||||
|
||||
void SetBitmap( const wxBitmap& bmp );
|
||||
wxBitmap GetBitmap() const;
|
||||
void SetIcon( const wxIcon& icon );
|
||||
wxIcon GetIcon() const;
|
||||
|
||||
void SetAlignment( int align );
|
||||
int GetAlignment() const;
|
||||
|
||||
void SetScale( int scale );
|
||||
int GetScale() const;
|
||||
|
||||
void SetCustomScale( float sx, float sy );
|
||||
void GetCustomScale( float* OUTPUT, float* OUTPUT ) const;
|
||||
|
||||
%property(Alignment, GetAlignment, SetAlignment, doc="See `GetAlignment` and `SetAlignment`");
|
||||
%property(Bitmap, GetBitmap, SetBitmap, doc="See `GetBitmap` and `SetBitmap`");
|
||||
%property(Icon, GetIcon, SetIcon, doc="See `GetIcon` and `SetIcon`");
|
||||
%property(Scale, GetScale, SetScale, doc="See `GetScale` and `SetScale`");
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
%init %{
|
||||
wxPyPtrTypeMap_Add("wxTreeCompanionWindow", "wxPyTreeCompanionWindow");
|
||||
%}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
|
@ -1,207 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dynamicsash.h
|
||||
// Purpose: A window which can be dynamically split to an arbitrary depth
|
||||
// and later reunified through the user interface
|
||||
// Author: Matt Kimball
|
||||
// Modified by:
|
||||
// Created: 7/15/2001
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2001 Matt Kimball
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DYNAMICSASH_H_
|
||||
#define _WX_DYNAMICSASH_H_
|
||||
|
||||
#include "wx/gizmos/gizmos.h"
|
||||
|
||||
#if !wxUSE_MDI
|
||||
# error "wxUSE_MDI must be defined for gizmos to compile."
|
||||
#endif /* !wxUSE_MDI */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
wxDynamicSashWindow
|
||||
|
||||
wxDynamicSashWindow widgets manages the way other widgets are viewed.
|
||||
When a wxDynamicSashWindow is first shown, it will contain one child
|
||||
view, a viewport for that child, and a pair of scrollbars to allow the
|
||||
user to navigate the child view area. Next to each scrollbar is a small
|
||||
tab. By clicking on either tab and dragging to the appropriate spot, a
|
||||
user can split the view area into two smaller views separated by a
|
||||
draggable sash. Later, when the user wishes to reunify the two subviews,
|
||||
the user simply drags the sash to the side of the window.
|
||||
wxDynamicSashWindow will automatically reparent the appropriate child
|
||||
view back up the window hierarchy, and the wxDynamicSashWindow will have
|
||||
only one child view once again.
|
||||
|
||||
As an application developer, you will simply create a wxDynamicSashWindow
|
||||
using either the Create() function or the more complex constructor
|
||||
provided below, and then create a view window whose parent is the
|
||||
wxDynamicSashWindow. The child should respond to
|
||||
wxDynamicSashSplitEvents -- perhaps with an OnSplit() event handler -- by
|
||||
constructing a new view window whose parent is also the
|
||||
wxDynamicSashWindow. That's it! Now your users can dynamically split
|
||||
and reunify the view you provided.
|
||||
|
||||
If you wish to handle the scrollbar events for your view, rather than
|
||||
allowing wxDynamicSashWindow to do it for you, things are a bit more
|
||||
complex. (You might want to handle scrollbar events yourself, if,
|
||||
for instance, you wish to scroll a subwindow of the view you add to
|
||||
your wxDynamicSashWindow object, rather than scrolling the whole view.)
|
||||
In this case, you will need to construct your wxDynamicSashWindow without
|
||||
the wxDS_MANAGE_SCROLLBARS style and you will need to use the
|
||||
GetHScrollBar() and GetVScrollBar() methods to retrieve the scrollbar
|
||||
controls and call SetEventHanler() on them to redirect the scrolling
|
||||
events whenever your window is reparented by wxDyanmicSashWindow.
|
||||
You will need to set the scrollbars' event handler at three times:
|
||||
|
||||
* When your view is created
|
||||
* When your view receives a wxDynamicSashSplitEvent
|
||||
* When your view receives a wxDynamicSashUnifyEvent
|
||||
|
||||
See the dynsash_switch sample application for an example which does this.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include "wx/event.h"
|
||||
#include "wx/window.h"
|
||||
|
||||
class WXDLLIMPEXP_CORE wxScrollBar;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// dynamic sash styles
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
wxDS_MANAGE_SCROLLBARS is a default style of wxDynamicSashWindow which
|
||||
will cause it to respond to scrollbar events for your application by
|
||||
automatically scrolling the child view.
|
||||
*/
|
||||
#define wxDS_MANAGE_SCROLLBARS 0x0010
|
||||
|
||||
|
||||
/*
|
||||
wxDS_DRAG_CORNER style indicates that the views can also be resized by
|
||||
dragging the corner piece between the scrollbars, and which is reflected up
|
||||
to the frame if necessary.
|
||||
*/
|
||||
#define wxDS_DRAG_CORNER 0x0020
|
||||
|
||||
/*
|
||||
Default style for wxDynamicSashWindow.
|
||||
*/
|
||||
#define wxDS_DEFAULT wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// dynamic sash events
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
extern WXDLLIMPEXP_GIZMOS const wxEventType wxEVT_DYNAMIC_SASH_SPLIT;
|
||||
extern WXDLLIMPEXP_GIZMOS const wxEventType wxEVT_DYNAMIC_SASH_UNIFY;
|
||||
|
||||
#define EVT_DYNAMIC_SASH_SPLIT(id, func) \
|
||||
wx__DECLARE_EVT1(wxEVT_DYNAMIC_SASH_SPLIT, id, \
|
||||
wxDynamicSashSplitEventHandler(func))
|
||||
|
||||
#define EVT_DYNAMIC_SASH_UNIFY(id, func) \
|
||||
wx__DECLARE_EVT1(wxEVT_DYNAMIC_SASH_UNIFY, id, \
|
||||
wxDynamicSashUnifyEventHandler(func))
|
||||
|
||||
|
||||
/*
|
||||
wxDynamicSashSplitEvents are sent to your view by wxDynamicSashWindow
|
||||
whenever your view is being split by the user. It is your
|
||||
responsibility to handle this event by creating a new view window as
|
||||
a child of the wxDynamicSashWindow. wxDynamicSashWindow will
|
||||
automatically reparent it to the proper place in its window hierarchy.
|
||||
*/
|
||||
class WXDLLIMPEXP_GIZMOS wxDynamicSashSplitEvent : public wxCommandEvent
|
||||
{
|
||||
public:
|
||||
wxDynamicSashSplitEvent();
|
||||
wxDynamicSashSplitEvent(const wxDynamicSashSplitEvent& event)
|
||||
: wxCommandEvent(event) { }
|
||||
wxDynamicSashSplitEvent(wxObject *target);
|
||||
|
||||
virtual wxEvent* Clone() const { return new wxDynamicSashSplitEvent(*this); }
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxDynamicSashSplitEvent)
|
||||
};
|
||||
|
||||
/*
|
||||
wxDynamicSashUnifyEvents are sent to your view by wxDynamicSashWindow
|
||||
whenever the sash which splits your view and its sibling is being
|
||||
reunified such that your view is expanding to replace its sibling.
|
||||
You needn't do anything with this event if you are allowing
|
||||
wxDynamicSashWindow to manage your view's scrollbars, but it is useful
|
||||
if you are managing the scrollbars yourself so that you can keep
|
||||
the scrollbars' event handlers connected to your view's event handler
|
||||
class.
|
||||
*/
|
||||
class WXDLLIMPEXP_GIZMOS wxDynamicSashUnifyEvent : public wxCommandEvent
|
||||
{
|
||||
public:
|
||||
wxDynamicSashUnifyEvent();
|
||||
wxDynamicSashUnifyEvent(const wxDynamicSashUnifyEvent& event): wxCommandEvent(event) {}
|
||||
wxDynamicSashUnifyEvent(wxObject *target);
|
||||
|
||||
virtual wxEvent* Clone() const { return new wxDynamicSashUnifyEvent(*this); }
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxDynamicSashUnifyEvent)
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxDynamicSashSplitEventFunction)(wxDynamicSashSplitEvent&);
|
||||
typedef void (wxEvtHandler::*wxDynamicSashUnifyEventFunction)(wxDynamicSashUnifyEvent&);
|
||||
|
||||
#define wxDynamicSashSplitEventHandler(func) \
|
||||
(wxObjectEventFunction)(wxEventFunction) \
|
||||
wxStaticCastEvent(wxDynamicSashSplitEventFunction, &func)
|
||||
|
||||
#define wxDynamicSashUnifyEventHandler(func) \
|
||||
(wxObjectEventFunction)(wxEventFunction) \
|
||||
wxStaticCastEvent(wxDynamicSashUnifyEventFunction, &func)
|
||||
|
||||
#define wx__DECLARE_TREEEVT(evt, id, fn) \
|
||||
wx__DECLARE_EVT1(wxEVT_COMMAND_TREE_ ## evt, id, wxTreeEventHandler(fn))
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDynamicSashWindow itself
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
WXDLLIMPEXP_GIZMOS extern const wxChar* wxDynamicSashWindowNameStr;
|
||||
|
||||
class WXDLLIMPEXP_GIZMOS wxDynamicSashWindow : public wxWindow
|
||||
{
|
||||
public:
|
||||
wxDynamicSashWindow();
|
||||
wxDynamicSashWindow(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxDS_DEFAULT,
|
||||
const wxString& name = wxDynamicSashWindowNameStr);
|
||||
virtual ~wxDynamicSashWindow();
|
||||
|
||||
virtual bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDS_DEFAULT,
|
||||
const wxString& name = wxDynamicSashWindowNameStr);
|
||||
virtual wxScrollBar *GetHScrollBar(const wxWindow *child) const;
|
||||
virtual wxScrollBar *GetVScrollBar(const wxWindow *child) const;
|
||||
|
||||
/* This is overloaded from wxWindowBase. It's not here for you to
|
||||
call directly. */
|
||||
virtual void AddChild(wxWindowBase *child);
|
||||
|
||||
private:
|
||||
class wxDynamicSashWindowImpl *m_impl;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxDynamicSashWindow)
|
||||
};
|
||||
|
||||
#endif // _WX_DYNAMICSASH_H_
|
||||
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: editlbox.h
|
||||
// Purpose: ListBox with editable items
|
||||
// Author: Vaclav Slavik
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef __WX_EDITLBOX_H__
|
||||
#define __WX_EDITLBOX_H__
|
||||
|
||||
#include "wx/panel.h"
|
||||
#include "wx/gizmos/gizmos.h"
|
||||
|
||||
class WXDLLEXPORT wxBitmapButton;
|
||||
class WXDLLEXPORT wxListCtrl;
|
||||
class WXDLLEXPORT wxListEvent;
|
||||
|
||||
#define wxEL_ALLOW_NEW 0x0100
|
||||
#define wxEL_ALLOW_EDIT 0x0200
|
||||
#define wxEL_ALLOW_DELETE 0x0400
|
||||
#define wxEL_NO_REORDER 0x0800
|
||||
|
||||
// This class provides a composite control that lets the
|
||||
// user easily enter list of strings
|
||||
|
||||
class WXDLLIMPEXP_GIZMOS wxEditableListBox : public wxPanel
|
||||
{
|
||||
DECLARE_CLASS(wxEditableListBox)
|
||||
|
||||
public:
|
||||
wxEditableListBox(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxEL_ALLOW_NEW | wxEL_ALLOW_EDIT | wxEL_ALLOW_DELETE,
|
||||
const wxString& name = wxT("editableListBox"));
|
||||
|
||||
void SetStrings(const wxArrayString& strings);
|
||||
void GetStrings(wxArrayString& strings) const;
|
||||
|
||||
wxListCtrl* GetListCtrl() { return m_listCtrl; }
|
||||
wxBitmapButton* GetDelButton() { return m_bDel; }
|
||||
wxBitmapButton* GetNewButton() { return m_bNew; }
|
||||
wxBitmapButton* GetUpButton() { return m_bUp; }
|
||||
wxBitmapButton* GetDownButton() { return m_bDown; }
|
||||
wxBitmapButton* GetEditButton() { return m_bEdit; }
|
||||
|
||||
protected:
|
||||
wxBitmapButton *m_bDel, *m_bNew, *m_bUp, *m_bDown, *m_bEdit;
|
||||
wxListCtrl *m_listCtrl;
|
||||
int m_selection;
|
||||
long m_style;
|
||||
|
||||
void OnItemSelected(wxListEvent& event);
|
||||
void OnEndLabelEdit(wxListEvent& event);
|
||||
void OnNewItem(wxCommandEvent& event);
|
||||
void OnDelItem(wxCommandEvent& event);
|
||||
void OnEditItem(wxCommandEvent& event);
|
||||
void OnUpItem(wxCommandEvent& event);
|
||||
void OnDownItem(wxCommandEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#ifndef _WX_GIZMOS_H_
|
||||
#define _WX_GIZMOS_H_
|
||||
|
||||
// #ifdef WXMAKINGDLL_GIZMOS
|
||||
// #define WXDLLIMPEXP_GIZMOS WXEXPORT
|
||||
// #elif defined(WXUSINGDLL)
|
||||
// #define WXDLLIMPEXP_GIZMOS WXIMPORT
|
||||
// #else // not making nor using DLL
|
||||
// #define WXDLLIMPEXP_GIZMOS
|
||||
// #endif
|
||||
|
||||
// #ifdef WXMAKINGDLL_GIZMOS_XRC
|
||||
// #define WXDLLIMPEXP_GIZMOS_XRC WXEXPORT
|
||||
// #elif defined(WXUSINGDLL)
|
||||
// #define WXDLLIMPEXP_GIZMOS_XRC WXIMPORT
|
||||
// #else // not making nor using DLL
|
||||
// #define WXDLLIMPEXP_GIZMOS_XRC
|
||||
// #endif
|
||||
|
||||
#define WXDLLIMPEXP_GIZMOS
|
||||
#define WXDLLIMPEXP_GIZMOS_XRC
|
||||
|
||||
#endif
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
#ifndef _WX_LEDNUMBERCTRL_H_
|
||||
#define _WX_LEDNUMBERCTRL_H_
|
||||
|
||||
#include "wx/gizmos/gizmos.h"
|
||||
|
||||
#include <wx/window.h>
|
||||
#include <wx/control.h>
|
||||
|
||||
class wxEraseEvent;
|
||||
class wxPaintEvent;
|
||||
class wxSizeEvent;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// enum and styles
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
enum wxLEDValueAlign
|
||||
{
|
||||
wxLED_ALIGN_LEFT = 0x01,
|
||||
wxLED_ALIGN_RIGHT = 0x02,
|
||||
wxLED_ALIGN_CENTER = 0x04,
|
||||
|
||||
wxLED_ALIGN_MASK = 0x07
|
||||
};
|
||||
|
||||
#define wxLED_DRAW_FADED 0x08
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxLEDNumberCtrl
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_GIZMOS wxLEDNumberCtrl : public wxControl
|
||||
{
|
||||
public:
|
||||
// Constructors.
|
||||
wxLEDNumberCtrl();
|
||||
wxLEDNumberCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxLED_ALIGN_LEFT | wxLED_DRAW_FADED);
|
||||
|
||||
// Create functions.
|
||||
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0);
|
||||
|
||||
wxLEDValueAlign GetAlignment() const { return m_Alignment; }
|
||||
bool GetDrawFaded() const { return m_DrawFaded; }
|
||||
const wxString &GetValue() const { return m_Value; }
|
||||
|
||||
void SetAlignment(wxLEDValueAlign Alignment, bool Redraw = true);
|
||||
void SetDrawFaded(bool DrawFaded, bool Redraw = true);
|
||||
void SetValue(const wxString &Value, bool Redraw = true);
|
||||
|
||||
private:
|
||||
// Members.
|
||||
wxString m_Value;
|
||||
wxLEDValueAlign m_Alignment;
|
||||
|
||||
int m_LineMargin;
|
||||
int m_DigitMargin;
|
||||
int m_LineLength;
|
||||
int m_LineWidth;
|
||||
bool m_DrawFaded;
|
||||
int m_LeftStartPos;
|
||||
|
||||
// Functions.
|
||||
void DrawDigit(wxDC &Dc, int Digit, int Column);
|
||||
void RecalcInternals(const wxSize &CurrentSize);
|
||||
|
||||
// Events.
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
void OnEraseBackground(wxEraseEvent &Event);
|
||||
void OnPaint(wxPaintEvent &Event);
|
||||
void OnSize(wxSizeEvent &Event);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,174 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: multicell.h
|
||||
// Purpose: provide two new classes for layout, wxMultiCellSizer and wxMultiCellCanvas
|
||||
// Author: Jonathan Bayer
|
||||
// Modified by:
|
||||
// Created:
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Jonathan Bayer
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This was inspired by the gbsizer class written by Alex Andruschak
|
||||
|
||||
|
||||
#ifndef __WX_MULTICELL_H__
|
||||
#define __WX_MULTICELL_H__
|
||||
|
||||
#include "wx/gizmos/gizmos.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
// The classes are derived from wxSizer
|
||||
#include "wx/sizer.h"
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
enum wxResizable
|
||||
{
|
||||
wxNOT_RESIZABLE = 0x00,
|
||||
wxHORIZONTAL_RESIZABLE = 0x01,
|
||||
wxVERTICAL_RESIZABLE = 0x10,
|
||||
wxRESIZABLE = 0x11
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// classes
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// wxMultiCellItemHandle
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_GIZMOS wxMultiCellItemHandle: public wxObject
|
||||
{
|
||||
DECLARE_CLASS(wxMultiCellItemHandle)
|
||||
protected:
|
||||
int m_column;
|
||||
int m_row;
|
||||
int m_width;
|
||||
int m_height;
|
||||
wxResizable m_style;
|
||||
wxSize m_fixedSize;
|
||||
int m_alignment;
|
||||
wxSize m_weight;
|
||||
|
||||
public:
|
||||
wxMultiCellItemHandle( int row, int column, int height = 1, int width = 1, wxSize size = wxDefaultSize, wxResizable style = wxNOT_RESIZABLE, wxSize weight = wxSize(1,1), int align = wxALIGN_NOT);
|
||||
wxMultiCellItemHandle( int row, int column, wxSize size, wxResizable style = wxNOT_RESIZABLE, wxSize weight = wxSize(1,1), int align = wxALIGN_NOT);
|
||||
wxMultiCellItemHandle( int row, int column, wxResizable style, wxSize weight = wxSize(1,1), int align = wxALIGN_NOT);
|
||||
int GetColumn() const;
|
||||
int GetRow() const;
|
||||
int GetWidth() const;
|
||||
int GetHeight() const;
|
||||
wxResizable GetStyle() const;
|
||||
wxSize GetLocalSize() const;
|
||||
int GetAlignment() const;
|
||||
wxSize GetWeight() const;
|
||||
|
||||
private:
|
||||
void Initialize( int row, int column, int height = 1, int width = 1, wxSize size = wxDefaultSize, wxResizable style = wxNOT_RESIZABLE, wxSize weight = wxSize(1,1), int align = wxALIGN_NOT);
|
||||
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// wxMultiCellSizer
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_GIZMOS wxMultiCellSizer : virtual public wxSizer
|
||||
{
|
||||
DECLARE_CLASS(wxMultiCellSizer)
|
||||
|
||||
protected:
|
||||
wxSize m_cell_count;
|
||||
|
||||
public:
|
||||
wxMultiCellSizer(wxSize & size);
|
||||
wxMultiCellSizer(int rows, int cols);
|
||||
~wxMultiCellSizer();
|
||||
|
||||
virtual void RecalcSizes();
|
||||
virtual wxSize CalcMin();
|
||||
bool SetDefaultCellSize(wxSize size);
|
||||
bool SetColumnWidth(int column, int colSize = 5, bool expandable = false);
|
||||
bool SetRowHeight(int row, int rowSize = 5, bool expandable = false);
|
||||
bool EnableGridLines(wxWindow *win);
|
||||
bool SetGridPen(const wxPen *pen);
|
||||
void OnPaint(wxDC& dc);
|
||||
|
||||
private:
|
||||
void GetMinimums();
|
||||
static int Sum(int *array, int x);
|
||||
|
||||
private:
|
||||
int *m_maxHeight;
|
||||
int *m_maxWidth;
|
||||
int *m_rowStretch;
|
||||
int *m_colStretch;
|
||||
wxSize **m_weights;
|
||||
wxSize **m_minSizes;
|
||||
int m_maxWeights;
|
||||
wxSize m_defaultCellSize;
|
||||
wxWindow *m_win; // usually used for debugging
|
||||
const wxPen *m_pen;
|
||||
|
||||
void DrawGridLines(wxDC& dc);
|
||||
void Initialize(wxSize size);
|
||||
};
|
||||
|
||||
|
||||
// wxCell is used internally, so we don't need to declare it here
|
||||
|
||||
class wxCell;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// wxMultiCellCanvas
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_GIZMOS wxMultiCellCanvas : public wxFlexGridSizer
|
||||
{
|
||||
public:
|
||||
wxMultiCellCanvas(wxWindow *parent, int numRows = 2, int numCols = 2);
|
||||
void Add(wxWindow *win, unsigned int row, unsigned int col);
|
||||
|
||||
void Resize(int numRows, int numCols);
|
||||
int MaxRows() const
|
||||
{
|
||||
return m_maxRows;
|
||||
};
|
||||
int MaxCols() const
|
||||
{
|
||||
return m_maxCols;
|
||||
};
|
||||
void CalculateConstraints();
|
||||
void SetMinCellSize(const wxSize size)
|
||||
{
|
||||
m_minCellSize = size;
|
||||
};
|
||||
|
||||
/* These are to hide Add() method of parents and to avoid Borland warning about hiding virtual functions */
|
||||
void Add( wxWindow *window, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL )
|
||||
{ wxFlexGridSizer::Add( window, proportion, flag, border, userData); }
|
||||
void Add( wxSizer *sizer, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL )
|
||||
{ wxFlexGridSizer::Add( sizer, proportion, flag, border, userData); }
|
||||
void Add( int width, int height, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL )
|
||||
{ wxFlexGridSizer::Add( width, height, proportion, flag, border, userData); }
|
||||
void Add( wxSizerItem *item )
|
||||
{ wxFlexGridSizer::Add( item); }
|
||||
|
||||
private:
|
||||
wxWindow *m_parent;
|
||||
unsigned int m_maxRows, m_maxCols;
|
||||
|
||||
wxSize m_minCellSize;
|
||||
wxCell **m_cells;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*** End of File ***/
|
||||
|
|
@ -1,231 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: splittree.h
|
||||
// Purpose: Classes to achieve a remotely-scrolled tree in a splitter
|
||||
// window that can be scrolled by a scrolled window higher in the
|
||||
// hierarchy
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 8/7/2000
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SPLITTREE_H_
|
||||
#define _WX_SPLITTREE_H_
|
||||
|
||||
#include "wx/gizmos/gizmos.h"
|
||||
|
||||
// Set this to 1 to use generic tree control (doesn't yet work properly)
|
||||
#define USE_GENERIC_TREECTRL 0
|
||||
|
||||
#include "wx/wx.h"
|
||||
#include "wx/treectrl.h"
|
||||
#include "wx/splitter.h"
|
||||
#include "wx/scrolwin.h"
|
||||
|
||||
#if USE_GENERIC_TREECTRL
|
||||
#include "wx/generic/treectlg.h"
|
||||
#ifndef wxTreeCtrl
|
||||
#define wxTreeCtrl wxGenericTreeCtrl
|
||||
#define sm_classwxTreeCtrl sm_classwxGenericTreeCtrl
|
||||
#endif
|
||||
#endif
|
||||
|
||||
class wxRemotelyScrolledTreeCtrl;
|
||||
class wxThinSplitterWindow;
|
||||
class wxSplitterScrolledWindow;
|
||||
|
||||
/*
|
||||
* wxRemotelyScrolledTreeCtrl
|
||||
*
|
||||
* This tree control disables its vertical scrollbar and catches scroll
|
||||
* events passed by a scrolled window higher in the hierarchy.
|
||||
* It also updates the scrolled window vertical scrollbar as appropriate.
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_GIZMOS wxRemotelyScrolledTreeCtrl: public wxTreeCtrl
|
||||
{
|
||||
DECLARE_CLASS(wxRemotelyScrolledTreeCtrl)
|
||||
public:
|
||||
wxRemotelyScrolledTreeCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pt = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize, long style = wxTR_HAS_BUTTONS);
|
||||
~wxRemotelyScrolledTreeCtrl();
|
||||
|
||||
//// Events
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnExpand(wxTreeEvent& event);
|
||||
void OnScroll(wxScrollWinEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
//// Overrides
|
||||
// Override this in case we're using the generic tree control.
|
||||
// Calls to this should disable the vertical scrollbar.
|
||||
|
||||
// Number of pixels per user unit (0 or -1 for no scrollbar)
|
||||
// Length of virtual canvas in user units
|
||||
// Length of page in user units
|
||||
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
|
||||
int noUnitsX, int noUnitsY,
|
||||
int xPos = 0, int yPos = 0,
|
||||
bool noRefresh = false );
|
||||
|
||||
// In case we're using the generic tree control.
|
||||
// Get the view start
|
||||
virtual void GetViewStart(int *x, int *y) const;
|
||||
|
||||
// In case we're using the generic tree control.
|
||||
virtual void PrepareDC(wxDC& dc);
|
||||
|
||||
// In case we're using the generic tree control.
|
||||
virtual int GetScrollPos(int orient) const;
|
||||
|
||||
//// Helpers
|
||||
void HideVScrollbar();
|
||||
|
||||
// Calculate the tree overall size so we can set the scrollbar
|
||||
// correctly
|
||||
void CalcTreeSize(wxRect& rect);
|
||||
void CalcTreeSize(const wxTreeItemId& id, wxRect& rect);
|
||||
|
||||
// Adjust the containing wxScrolledWindow's scrollbars appropriately
|
||||
void AdjustRemoteScrollbars();
|
||||
|
||||
// Find the scrolled window that contains this control
|
||||
wxScrolledWindow* GetScrolledWindow() const;
|
||||
|
||||
// Scroll to the given line (in scroll units where each unit is
|
||||
// the height of an item)
|
||||
void ScrollToLine(int posHoriz, int posVert);
|
||||
|
||||
//// Accessors
|
||||
|
||||
// The companion window is one which will get notified when certain
|
||||
// events happen such as node expansion
|
||||
void SetCompanionWindow(wxWindow* companion) { m_companionWindow = companion; }
|
||||
wxWindow* GetCompanionWindow() const { return m_companionWindow; }
|
||||
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
protected:
|
||||
wxWindow* m_companionWindow;
|
||||
bool m_drawRowLines;
|
||||
};
|
||||
|
||||
/*
|
||||
* wxTreeCompanionWindow
|
||||
*
|
||||
* A window displaying values associated with tree control items.
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_GIZMOS wxTreeCompanionWindow: public wxWindow
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS(wxTreeCompanionWindow)
|
||||
|
||||
wxTreeCompanionWindow(wxWindow* parent, wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
long style = 0);
|
||||
|
||||
//// Overrides
|
||||
virtual void DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& rect);
|
||||
|
||||
//// Events
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnScroll(wxScrollWinEvent& event);
|
||||
void OnExpand(wxTreeEvent& event);
|
||||
|
||||
//// Operations
|
||||
|
||||
//// Accessors
|
||||
wxRemotelyScrolledTreeCtrl* GetTreeCtrl() const { return m_treeCtrl; };
|
||||
void SetTreeCtrl(wxRemotelyScrolledTreeCtrl* treeCtrl) { m_treeCtrl = treeCtrl; }
|
||||
|
||||
//// Data members
|
||||
protected:
|
||||
wxRemotelyScrolledTreeCtrl* m_treeCtrl;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* wxThinSplitterWindow
|
||||
*
|
||||
* Implements a splitter with a less obvious sash
|
||||
* than the usual one.
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_GIZMOS wxThinSplitterWindow: public wxSplitterWindow
|
||||
{
|
||||
public:
|
||||
DECLARE_DYNAMIC_CLASS(wxThinSplitterWindow)
|
||||
|
||||
wxThinSplitterWindow(wxWindow* parent, wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
long style = wxSP_3D | wxCLIP_CHILDREN);
|
||||
~wxThinSplitterWindow();
|
||||
|
||||
//// Overrides
|
||||
|
||||
void SizeWindows();
|
||||
// Tests for x, y over sash. Overriding this allows us to increase
|
||||
// the tolerance.
|
||||
bool SashHitTest(int x, int y, int tolerance = 2);
|
||||
void DrawSash(wxDC& dc);
|
||||
|
||||
//// Events
|
||||
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
//// Operations
|
||||
|
||||
//// Accessors
|
||||
|
||||
//// Data members
|
||||
protected:
|
||||
wxPen* m_facePen;
|
||||
wxBrush* m_faceBrush;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
/*
|
||||
* wxSplitterScrolledWindow
|
||||
*
|
||||
* This scrolled window is aware of the fact that one of its
|
||||
* children is a splitter window. It passes on its scroll events
|
||||
* (after some processing) to both splitter children for them
|
||||
* scroll appropriately.
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_GIZMOS wxSplitterScrolledWindow: public wxScrolledWindow
|
||||
{
|
||||
public:
|
||||
DECLARE_DYNAMIC_CLASS(wxSplitterScrolledWindow)
|
||||
|
||||
wxSplitterScrolledWindow(wxWindow* parent, wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
long style = 0);
|
||||
|
||||
//// Overrides
|
||||
|
||||
//// Events
|
||||
|
||||
void OnScroll(wxScrollWinEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
//// Operations
|
||||
|
||||
//// Accessors
|
||||
|
||||
//// Data members
|
||||
public:
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// _SPLITTREE_H_
|
||||
|
|
@ -1,138 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: statpict.h
|
||||
// Purpose: wxStaticPicture class
|
||||
// Author: Wade Brainerd
|
||||
// Modified by:
|
||||
// Created: 2003-05-01
|
||||
// RCS-ID:
|
||||
// Copyright: (c) Wade Brainerd
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_STATPICT_H_
|
||||
#define _WX_STATPICT_H_
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
#include "wx/icon.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/image.h"
|
||||
|
||||
#include "wx/gizmos/gizmos.h"
|
||||
|
||||
enum
|
||||
{
|
||||
wxSCALE_HORIZONTAL = 0x1,
|
||||
wxSCALE_VERTICAL = 0x2,
|
||||
wxSCALE_UNIFORM = 0x4,
|
||||
wxSCALE_CUSTOM = 0x8
|
||||
};
|
||||
|
||||
WXDLLIMPEXP_GIZMOS extern const wxChar* wxStaticPictureNameStr;
|
||||
|
||||
class WXDLLIMPEXP_GIZMOS wxStaticPicture : public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticPicture)
|
||||
|
||||
public:
|
||||
wxStaticPicture() {}
|
||||
|
||||
wxStaticPicture( wxWindow* parent, wxWindowID id,
|
||||
const wxBitmap& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticPictureNameStr )
|
||||
{
|
||||
Create( parent, id, label, pos, size, style, name );
|
||||
}
|
||||
|
||||
bool Create( wxWindow* parent, wxWindowID id,
|
||||
const wxBitmap& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticPictureNameStr );
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {}
|
||||
virtual bool ProcessCommand(wxCommandEvent& WXUNUSED(event)) {return true;}
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
void SetBitmap( const wxBitmap& bmp );
|
||||
|
||||
wxBitmap GetBitmap() const
|
||||
{
|
||||
return Bitmap;
|
||||
}
|
||||
|
||||
// Icon interface for compatibility with wxStaticBitmap.
|
||||
void SetIcon( const wxIcon& icon )
|
||||
{
|
||||
wxBitmap bmp;
|
||||
bmp.CopyFromIcon( icon );
|
||||
SetBitmap( bmp );
|
||||
}
|
||||
|
||||
wxIcon GetIcon() const
|
||||
{
|
||||
wxIcon icon;
|
||||
icon.CopyFromBitmap( Bitmap );
|
||||
return icon;
|
||||
}
|
||||
|
||||
void SetAlignment( int align )
|
||||
{
|
||||
Align = align;
|
||||
}
|
||||
|
||||
int GetAlignment() const
|
||||
{
|
||||
return Align;
|
||||
}
|
||||
|
||||
void SetScale( int scale )
|
||||
{
|
||||
Scale = scale;
|
||||
}
|
||||
|
||||
int GetScale() const
|
||||
{
|
||||
return Scale;
|
||||
}
|
||||
|
||||
void SetCustomScale( float sx, float sy )
|
||||
{
|
||||
ScaleX = sx;
|
||||
ScaleY = sy;
|
||||
}
|
||||
|
||||
void GetCustomScale( float* sx, float* sy ) const
|
||||
{
|
||||
*sx = ScaleX;
|
||||
*sy = ScaleY;
|
||||
}
|
||||
|
||||
protected:
|
||||
wxBitmap Bitmap;
|
||||
|
||||
int Align;
|
||||
|
||||
int Scale;
|
||||
float ScaleX;
|
||||
float ScaleY;
|
||||
|
||||
#ifndef __WXMSW__
|
||||
// When scaling is enabled, measures are taken to improve performance on non-Windows platforms.
|
||||
// - The original bitmap is stored as a wxImage, because conversion from wxBitmap to wxImage is slow.
|
||||
// - The latest scaled bitmap is cached, this improves performance when the control is repainted
|
||||
// but the size hasn't changed (overlapping windows, movement, etc).
|
||||
wxImage OriginalImage;
|
||||
float LastScaleX;
|
||||
float LastScaleY;
|
||||
wxBitmap ScaledBitmap;
|
||||
#endif
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // #ifndef _WX_STATPICT_H_
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_statpict.h
|
||||
// Purpose: XRC resource handler for wxStaticPicture
|
||||
// Author: David A. Norris
|
||||
// Created: 2005/03/13
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: David A. Norris
|
||||
// Licence: wxWindows Licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_STATPICT_H
|
||||
#define _WX_XH_STATPICT_H
|
||||
|
||||
#include "wx/xrc/xmlres.h"
|
||||
#include "wx/gizmos/gizmos.h"
|
||||
|
||||
//
|
||||
// XML resource handler for the wxStaticPicture class in wxContrib.
|
||||
//
|
||||
|
||||
class WXDLLIMPEXP_GIZMOS_XRC wxStaticPictureXmlHandler
|
||||
: public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
|
||||
// Constructor.
|
||||
wxStaticPictureXmlHandler();
|
||||
|
||||
// Creates the control and returns a pointer to it.
|
||||
virtual wxObject *DoCreateResource();
|
||||
|
||||
// Returns true if we know how to create a control for the given node.
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
|
||||
// Register with wxWindows' dynamic class subsystem.
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticPictureXmlHandler)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,552 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: treelistctrl.h
|
||||
// Purpose: wxTreeListCtrl class
|
||||
// Author: Robert Roebling
|
||||
// Maintainer: Otto Wyss
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2004 Robert Roebling, Julian Smart, Alberto Griggio,
|
||||
// Vadim Zeitlin, Otto Wyss
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef TREELISTCTRL_H
|
||||
#define TREELISTCTRL_H
|
||||
|
||||
#include <wx/treectrl.h>
|
||||
#include <wx/control.h>
|
||||
#include <wx/pen.h>
|
||||
#include <wx/listctrl.h> // for wxListEvent
|
||||
|
||||
#ifdef GIZMOISDLL
|
||||
#define GIZMODLLEXPORT WXDLLEXPORT
|
||||
#else
|
||||
#define GIZMODLLEXPORT
|
||||
#endif
|
||||
|
||||
|
||||
class GIZMODLLEXPORT wxTreeListItem;
|
||||
class GIZMODLLEXPORT wxTreeListHeaderWindow;
|
||||
class GIZMODLLEXPORT wxTreeListMainWindow;
|
||||
|
||||
#define wxTR_COLUMN_LINES 0x1000 // put border around items
|
||||
#define wxTR_VIRTUAL 0x4000 // The application provides items text on demand.
|
||||
|
||||
// Using this typedef removes an ambiguity when calling Remove()
|
||||
#ifdef __WXMSW__
|
||||
#if !wxCHECK_VERSION(2, 5, 0)
|
||||
typedef long wxTreeItemIdValue;
|
||||
#else
|
||||
typedef void *wxTreeItemIdValue;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTreeListColumnAttrs
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
enum {
|
||||
DEFAULT_COL_WIDTH = 100
|
||||
};
|
||||
|
||||
class GIZMODLLEXPORT wxTreeListColumnInfo: public wxObject {
|
||||
|
||||
public:
|
||||
wxTreeListColumnInfo (const wxString &text = wxEmptyString,
|
||||
int width = DEFAULT_COL_WIDTH,
|
||||
int flag = wxALIGN_LEFT,
|
||||
int image = -1,
|
||||
bool shown = true,
|
||||
bool edit = false) {
|
||||
m_text = text;
|
||||
m_width = width;
|
||||
m_flag = flag;
|
||||
m_image = image;
|
||||
m_selected_image = -1;
|
||||
m_shown = shown;
|
||||
m_edit = edit;
|
||||
}
|
||||
|
||||
wxTreeListColumnInfo (const wxTreeListColumnInfo& other) {
|
||||
m_text = other.m_text;
|
||||
m_width = other.m_width;
|
||||
m_flag = other.m_flag;
|
||||
m_image = other.m_image;
|
||||
m_selected_image = other.m_selected_image;
|
||||
m_shown = other.m_shown;
|
||||
m_edit = other.m_edit;
|
||||
}
|
||||
|
||||
~wxTreeListColumnInfo() {}
|
||||
|
||||
// get/set
|
||||
wxString GetText() const { return m_text; }
|
||||
wxTreeListColumnInfo& SetText (const wxString& text) { m_text = text; return *this; }
|
||||
|
||||
int GetWidth() const { return m_width; }
|
||||
wxTreeListColumnInfo& SetWidth (int width) { m_width = width; return *this; }
|
||||
|
||||
int GetAlignment() const { return m_flag; }
|
||||
wxTreeListColumnInfo& SetAlignment (int flag) { m_flag = flag; return *this; }
|
||||
|
||||
int GetImage() const { return m_image; }
|
||||
wxTreeListColumnInfo& SetImage (int image) { m_image = image; return *this; }
|
||||
|
||||
int GetSelectedImage() const { return m_selected_image; }
|
||||
wxTreeListColumnInfo& SetSelectedImage (int image) { m_selected_image = image; return *this; }
|
||||
|
||||
bool IsEditable() const { return m_edit; }
|
||||
wxTreeListColumnInfo& SetEditable (bool edit)
|
||||
{ m_edit = edit; return *this; }
|
||||
|
||||
bool IsShown() const { return m_shown; }
|
||||
wxTreeListColumnInfo& SetShown(bool shown) { m_shown = shown; return *this; }
|
||||
|
||||
private:
|
||||
wxString m_text;
|
||||
int m_width;
|
||||
int m_flag;
|
||||
int m_image;
|
||||
int m_selected_image;
|
||||
bool m_shown;
|
||||
bool m_edit;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// wxTreeListCtrl - the multicolumn tree control
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
// modes for navigation
|
||||
const int wxTL_MODE_NAV_FULLTREE = 0x0000; // default
|
||||
const int wxTL_MODE_NAV_EXPANDED = 0x0001;
|
||||
const int wxTL_MODE_NAV_VISIBLE = 0x0002;
|
||||
const int wxTL_MODE_NAV_LEVEL = 0x0004;
|
||||
|
||||
// modes for FindItem
|
||||
const int wxTL_MODE_FIND_EXACT = 0x0000; // default
|
||||
const int wxTL_MODE_FIND_PARTIAL = 0x0010;
|
||||
const int wxTL_MODE_FIND_NOCASE = 0x0020;
|
||||
|
||||
// additional flag for HitTest
|
||||
const int wxTREE_HITTEST_ONITEMCOLUMN = 0x2000;
|
||||
extern GIZMODLLEXPORT const wxChar* wxTreeListCtrlNameStr;
|
||||
|
||||
|
||||
class GIZMODLLEXPORT wxTreeListCtrl : public wxControl
|
||||
{
|
||||
public:
|
||||
// creation
|
||||
// --------
|
||||
wxTreeListCtrl()
|
||||
: m_header_win(0), m_main_win(0), m_headerHeight(0)
|
||||
{}
|
||||
|
||||
wxTreeListCtrl(wxWindow *parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTR_DEFAULT_STYLE,
|
||||
const wxValidator &validator = wxDefaultValidator,
|
||||
const wxString& name = wxTreeListCtrlNameStr )
|
||||
: m_header_win(0), m_main_win(0), m_headerHeight(0)
|
||||
{
|
||||
Create(parent, id, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
virtual ~wxTreeListCtrl() {}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTR_DEFAULT_STYLE,
|
||||
const wxValidator &validator = wxDefaultValidator,
|
||||
const wxString& name = wxTreeListCtrlNameStr );
|
||||
|
||||
void Refresh(bool erase=TRUE, const wxRect* rect=NULL);
|
||||
void SetFocus();
|
||||
// accessors
|
||||
// ---------
|
||||
|
||||
// get the total number of items in the control
|
||||
size_t GetCount() const;
|
||||
|
||||
// indent is the number of pixels the children are indented relative to
|
||||
// the parents position. SetIndent() also redraws the control
|
||||
// immediately.
|
||||
unsigned int GetIndent() const;
|
||||
void SetIndent(unsigned int indent);
|
||||
|
||||
// line spacing is the space above and below the text on each line
|
||||
unsigned int GetLineSpacing() const;
|
||||
void SetLineSpacing(unsigned int spacing);
|
||||
|
||||
// image list: these functions allow to associate an image list with
|
||||
// the control and retrieve it. Note that when assigned with
|
||||
// SetImageList, the control does _not_ delete
|
||||
// the associated image list when it's deleted in order to allow image
|
||||
// lists to be shared between different controls. If you use
|
||||
// AssignImageList, the control _does_ delete the image list.
|
||||
//
|
||||
// The normal image list is for the icons which correspond to the
|
||||
// normal tree item state (whether it is selected or not).
|
||||
// Additionally, the application might choose to show a state icon
|
||||
// which corresponds to an app-defined item state (for example,
|
||||
// checked/unchecked) which are taken from the state image list.
|
||||
wxImageList *GetImageList() const;
|
||||
wxImageList *GetStateImageList() const;
|
||||
wxImageList *GetButtonsImageList() const;
|
||||
|
||||
void SetImageList(wxImageList *imageList);
|
||||
void SetStateImageList(wxImageList *imageList);
|
||||
void SetButtonsImageList(wxImageList *imageList);
|
||||
void AssignImageList(wxImageList *imageList);
|
||||
void AssignStateImageList(wxImageList *imageList);
|
||||
void AssignButtonsImageList(wxImageList *imageList);
|
||||
|
||||
|
||||
// Functions to work with columns
|
||||
|
||||
// adds a column
|
||||
void AddColumn (const wxString& text,
|
||||
int width = DEFAULT_COL_WIDTH,
|
||||
int flag = wxALIGN_LEFT,
|
||||
int image = -1,
|
||||
bool shown = true,
|
||||
bool edit = false) {
|
||||
AddColumn (wxTreeListColumnInfo (text, width, flag, image, shown, edit));
|
||||
}
|
||||
void AddColumn (const wxTreeListColumnInfo& colInfo);
|
||||
|
||||
// inserts a column before the given one
|
||||
void InsertColumn (int before,
|
||||
const wxString& text,
|
||||
int width = DEFAULT_COL_WIDTH,
|
||||
int flag = wxALIGN_LEFT,
|
||||
int image = -1,
|
||||
bool shown = true,
|
||||
bool edit = false) {
|
||||
InsertColumn (before,
|
||||
wxTreeListColumnInfo (text, width, flag, image, shown, edit));
|
||||
}
|
||||
void InsertColumn (int before, const wxTreeListColumnInfo& colInfo);
|
||||
|
||||
// deletes the given column - does not delete the corresponding column
|
||||
void RemoveColumn (int column);
|
||||
|
||||
// returns the number of columns in the ctrl
|
||||
int GetColumnCount() const;
|
||||
|
||||
// tells which column is the "main" one, i.e. the "threaded" one
|
||||
void SetMainColumn (int column);
|
||||
int GetMainColumn() const;
|
||||
|
||||
void SetColumn (int column, const wxTreeListColumnInfo& colInfo);
|
||||
wxTreeListColumnInfo& GetColumn (int column);
|
||||
const wxTreeListColumnInfo& GetColumn (int column) const;
|
||||
|
||||
void SetColumnText (int column, const wxString& text);
|
||||
wxString GetColumnText (int column) const;
|
||||
|
||||
void SetColumnWidth (int column, int width);
|
||||
int GetColumnWidth (int column) const;
|
||||
|
||||
void SetColumnAlignment (int column, int flag);
|
||||
int GetColumnAlignment (int column) const;
|
||||
|
||||
void SetColumnImage (int column, int image);
|
||||
int GetColumnImage (int column) const;
|
||||
|
||||
void SetColumnShown (int column, bool shown = true);
|
||||
bool IsColumnShown (int column) const;
|
||||
|
||||
void SetColumnEditable (int column, bool edit = true);
|
||||
bool IsColumnEditable (int column) const;
|
||||
|
||||
// Functions to work with items.
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
|
||||
// retrieve item's label (of the main column)
|
||||
wxString GetItemText (const wxTreeItemId& item) const
|
||||
{ return GetItemText (item, GetMainColumn()); }
|
||||
// retrieves item's label of the given column
|
||||
wxString GetItemText (const wxTreeItemId& item, int column) const;
|
||||
|
||||
// get one of the images associated with the item (normal by default)
|
||||
int GetItemImage (const wxTreeItemId& item,
|
||||
wxTreeItemIcon which = wxTreeItemIcon_Normal) const
|
||||
{ return GetItemImage (item, GetMainColumn(), which); }
|
||||
int GetItemImage (const wxTreeItemId& item, int column,
|
||||
wxTreeItemIcon which = wxTreeItemIcon_Normal) const;
|
||||
|
||||
// get the data associated with the item
|
||||
wxTreeItemData *GetItemData (const wxTreeItemId& item) const;
|
||||
|
||||
bool GetItemBold (const wxTreeItemId& item) const;
|
||||
wxColour GetItemTextColour (const wxTreeItemId& item) const;
|
||||
wxColour GetItemBackgroundColour (const wxTreeItemId& item) const;
|
||||
wxFont GetItemFont (const wxTreeItemId& item) const;
|
||||
|
||||
// modifiers
|
||||
|
||||
// set item's label
|
||||
void SetItemText (const wxTreeItemId& item, const wxString& text)
|
||||
{ SetItemText (item, GetMainColumn(), text); }
|
||||
void SetItemText (const wxTreeItemId& item, int column, const wxString& text);
|
||||
|
||||
// get one of the images associated with the item (normal by default)
|
||||
void SetItemImage (const wxTreeItemId& item, int image,
|
||||
wxTreeItemIcon which = wxTreeItemIcon_Normal)
|
||||
{ SetItemImage (item, GetMainColumn(), image, which); }
|
||||
// the which parameter is ignored for all columns but the main one
|
||||
void SetItemImage (const wxTreeItemId& item, int column, int image,
|
||||
wxTreeItemIcon which = wxTreeItemIcon_Normal);
|
||||
|
||||
// associate some data with the item
|
||||
void SetItemData (const wxTreeItemId& item, wxTreeItemData *data);
|
||||
|
||||
// force appearance of [+] button near the item. This is useful to
|
||||
// allow the user to expand the items which don't have any children now
|
||||
// - but instead add them only when needed, thus minimizing memory
|
||||
// usage and loading time.
|
||||
void SetItemHasChildren(const wxTreeItemId& item, bool has = true);
|
||||
|
||||
// the item will be shown in bold
|
||||
void SetItemBold (const wxTreeItemId& item, bool bold = true);
|
||||
|
||||
// set the item's text colour
|
||||
void SetItemTextColour (const wxTreeItemId& item, const wxColour& colour);
|
||||
|
||||
// set the item's background colour
|
||||
void SetItemBackgroundColour (const wxTreeItemId& item, const wxColour& colour);
|
||||
|
||||
// set the item's font (should be of the same height for all items)
|
||||
void SetItemFont (const wxTreeItemId& item, const wxFont& font);
|
||||
|
||||
// set the window font
|
||||
virtual bool SetFont ( const wxFont &font );
|
||||
|
||||
// set the styles.
|
||||
void SetWindowStyle (const long styles);
|
||||
long GetWindowStyle() const;
|
||||
long GetWindowStyleFlag () const { return GetWindowStyle(); }
|
||||
|
||||
// item status inquiries
|
||||
// ---------------------
|
||||
|
||||
// is the item visible (it might be outside the view or not expanded)?
|
||||
bool IsVisible (const wxTreeItemId& item, bool fullRow = false) const;
|
||||
// does the item has any children?
|
||||
bool HasChildren (const wxTreeItemId& item) const;
|
||||
// is the item expanded (only makes sense if HasChildren())?
|
||||
bool IsExpanded (const wxTreeItemId& item) const;
|
||||
// is this item currently selected (the same as has focus)?
|
||||
bool IsSelected (const wxTreeItemId& item) const;
|
||||
// is item text in bold font?
|
||||
bool IsBold (const wxTreeItemId& item) const;
|
||||
// does the layout include space for a button?
|
||||
|
||||
// number of children
|
||||
// ------------------
|
||||
|
||||
// if 'recursively' is FALSE, only immediate children count, otherwise
|
||||
// the returned number is the number of all items in this branch
|
||||
size_t GetChildrenCount (const wxTreeItemId& item, bool recursively = true);
|
||||
|
||||
// navigation
|
||||
// ----------
|
||||
|
||||
// wxTreeItemId.IsOk() will return FALSE if there is no such item
|
||||
|
||||
// get the root tree item
|
||||
wxTreeItemId GetRootItem() const;
|
||||
|
||||
// get the item currently selected (may return NULL if no selection)
|
||||
wxTreeItemId GetSelection() const;
|
||||
|
||||
// get the items currently selected, return the number of such item
|
||||
size_t GetSelections (wxArrayTreeItemIds&) const;
|
||||
|
||||
// get the parent of this item (may return NULL if root)
|
||||
wxTreeItemId GetItemParent (const wxTreeItemId& item) const;
|
||||
|
||||
// for this enumeration function you must pass in a "cookie" parameter
|
||||
// which is opaque for the application but is necessary for the library
|
||||
// to make these functions reentrant (i.e. allow more than one
|
||||
// enumeration on one and the same object simultaneously). Of course,
|
||||
// the "cookie" passed to GetFirstChild() and GetNextChild() should be
|
||||
// the same!
|
||||
|
||||
// get child of this item
|
||||
#if !wxCHECK_VERSION(2, 5, 0)
|
||||
wxTreeItemId GetFirstChild(const wxTreeItemId& item, long& cookie) const;
|
||||
wxTreeItemId GetNextChild(const wxTreeItemId& item, long& cookie) const;
|
||||
wxTreeItemId GetPrevChild(const wxTreeItemId& item, long& cookie) const;
|
||||
wxTreeItemId GetLastChild(const wxTreeItemId& item, long& cookie) const;
|
||||
#else
|
||||
wxTreeItemId GetFirstChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
|
||||
wxTreeItemId GetNextChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
|
||||
wxTreeItemId GetPrevChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
|
||||
wxTreeItemId GetLastChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
|
||||
#endif
|
||||
|
||||
// get sibling of this item
|
||||
wxTreeItemId GetNextSibling(const wxTreeItemId& item) const;
|
||||
wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const;
|
||||
|
||||
// get item in the full tree (currently only for internal use)
|
||||
wxTreeItemId GetNext(const wxTreeItemId& item) const;
|
||||
wxTreeItemId GetPrev(const wxTreeItemId& item) const;
|
||||
|
||||
// get expanded item, see IsExpanded()
|
||||
wxTreeItemId GetFirstExpandedItem() const;
|
||||
wxTreeItemId GetNextExpanded(const wxTreeItemId& item) const;
|
||||
wxTreeItemId GetPrevExpanded(const wxTreeItemId& item) const;
|
||||
|
||||
// get visible item, see IsVisible()
|
||||
wxTreeItemId GetFirstVisibleItem(bool fullRow = false) const;
|
||||
wxTreeItemId GetNextVisible(const wxTreeItemId& item, bool fullRow = false) const;
|
||||
wxTreeItemId GetPrevVisible(const wxTreeItemId& item, bool fullRow = false) const;
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
|
||||
// add the root node to the tree
|
||||
wxTreeItemId AddRoot (const wxString& text,
|
||||
int image = -1, int selectedImage = -1,
|
||||
wxTreeItemData *data = NULL);
|
||||
|
||||
// insert a new item in as the first child of the parent
|
||||
wxTreeItemId PrependItem (const wxTreeItemId& parent,
|
||||
const wxString& text,
|
||||
int image = -1, int selectedImage = -1,
|
||||
wxTreeItemData *data = NULL);
|
||||
|
||||
// insert a new item after a given one
|
||||
wxTreeItemId InsertItem (const wxTreeItemId& parent,
|
||||
const wxTreeItemId& idPrevious,
|
||||
const wxString& text,
|
||||
int image = -1, int selectedImage = -1,
|
||||
wxTreeItemData *data = NULL);
|
||||
|
||||
// insert a new item before the one with the given index
|
||||
wxTreeItemId InsertItem (const wxTreeItemId& parent,
|
||||
size_t index,
|
||||
const wxString& text,
|
||||
int image = -1, int selectedImage = -1,
|
||||
wxTreeItemData *data = NULL);
|
||||
|
||||
// insert a new item in as the last child of the parent
|
||||
wxTreeItemId AppendItem (const wxTreeItemId& parent,
|
||||
const wxString& text,
|
||||
int image = -1, int selectedImage = -1,
|
||||
wxTreeItemData *data = NULL);
|
||||
|
||||
// delete this item (except root) and associated data if any
|
||||
void Delete (const wxTreeItemId& item);
|
||||
// delete all children (but don't delete the item itself)
|
||||
// NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events
|
||||
void DeleteChildren (const wxTreeItemId& item);
|
||||
// delete the root and all its children from the tree
|
||||
// NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events
|
||||
void DeleteRoot();
|
||||
|
||||
// expand this item
|
||||
void Expand (const wxTreeItemId& item);
|
||||
// expand this item and all subitems recursively
|
||||
void ExpandAll (const wxTreeItemId& item);
|
||||
// collapse the item without removing its children
|
||||
void Collapse (const wxTreeItemId& item);
|
||||
// collapse the item and remove all children
|
||||
void CollapseAndReset(const wxTreeItemId& item); //? TODO ???
|
||||
// toggles the current state
|
||||
void Toggle (const wxTreeItemId& item);
|
||||
|
||||
// remove the selection from currently selected item (if any)
|
||||
void Unselect();
|
||||
void UnselectAll();
|
||||
// select this item
|
||||
void SelectItem (const wxTreeItemId& item,
|
||||
const wxTreeItemId& last = (wxTreeItemId*)NULL,
|
||||
bool unselect_others = true);
|
||||
// select all items in the expanded tree
|
||||
void SelectAll();
|
||||
// make sure this item is visible (expanding the parent item and/or
|
||||
// scrolling to this item if necessary)
|
||||
void EnsureVisible (const wxTreeItemId& item);
|
||||
// scroll to this item (but don't expand its parent)
|
||||
void ScrollTo (const wxTreeItemId& item);
|
||||
|
||||
// The first function is more portable (because easier to implement
|
||||
// on other platforms), but the second one returns some extra info.
|
||||
wxTreeItemId HitTest (const wxPoint& point)
|
||||
{ int flags; int column; return HitTest (point, flags, column); }
|
||||
wxTreeItemId HitTest (const wxPoint& point, int& flags)
|
||||
{ int column; return HitTest (point, flags, column); }
|
||||
wxTreeItemId HitTest (const wxPoint& point, int& flags, int& column);
|
||||
|
||||
// get the bounding rectangle of the item (or of its label only)
|
||||
bool GetBoundingRect (const wxTreeItemId& item, wxRect& rect,
|
||||
bool textOnly = false) const;
|
||||
|
||||
// Start editing the item label: this (temporarily) replaces the item
|
||||
// with a one line edit control. The item will be selected if it hadn't
|
||||
// been before.
|
||||
void EditLabel (const wxTreeItemId& item)
|
||||
{ EditLabel (item, GetMainColumn()); }
|
||||
// edit item's label of the given column
|
||||
void EditLabel (const wxTreeItemId& item, int column);
|
||||
|
||||
// virtual mode
|
||||
virtual wxString OnGetItemText( wxTreeItemData* item, long column ) const;
|
||||
|
||||
// sorting
|
||||
// this function is called to compare 2 items and should return -1, 0
|
||||
// or +1 if the first item is less than, equal to or greater than the
|
||||
// second one. The base class version performs alphabetic comparaison
|
||||
// of item labels (GetText)
|
||||
virtual int OnCompareItems (const wxTreeItemId& item1, const wxTreeItemId& item2);
|
||||
// sort the children of this item using OnCompareItems
|
||||
// NB: this function is not reentrant and not MT-safe (FIXME)!
|
||||
void SortChildren(const wxTreeItemId& item);
|
||||
|
||||
// searching
|
||||
wxTreeItemId FindItem (const wxTreeItemId& item, const wxString& str, int mode = 0);
|
||||
|
||||
// overridden base class virtuals
|
||||
virtual bool SetBackgroundColour (const wxColour& colour);
|
||||
virtual bool SetForegroundColour (const wxColour& colour);
|
||||
|
||||
// drop over item
|
||||
void SetDragItem (const wxTreeItemId& item = (wxTreeItemId*)NULL);
|
||||
|
||||
|
||||
wxTreeListHeaderWindow* GetHeaderWindow() const
|
||||
{ return m_header_win; }
|
||||
|
||||
wxTreeListMainWindow* GetMainWindow() const
|
||||
{ return m_main_win; }
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
protected:
|
||||
// header window, responsible for column visualization and manipulation
|
||||
wxTreeListHeaderWindow* m_header_win;
|
||||
|
||||
// main window, the "true" tree ctrl
|
||||
wxTreeListMainWindow* m_main_win;
|
||||
|
||||
void CalculateAndSetHeaderHeight();
|
||||
void DoHeaderLayout();
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
private:
|
||||
int m_headerHeight;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxTreeListCtrl)
|
||||
};
|
||||
|
||||
#endif // TREELISTCTRL_H
|
||||
|
||||
|
|
@ -1,463 +0,0 @@
|
|||
# =========================================================================
|
||||
# This makefile was generated by
|
||||
# Bakefile 0.2.1 (http://bakefile.sourceforge.net)
|
||||
# Do not modify, all changes will be overwritten!
|
||||
# =========================================================================
|
||||
|
||||
|
||||
@MAKE_SET@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
INSTALL = @INSTALL@
|
||||
SHARED_LD_CXX = @SHARED_LD_CXX@
|
||||
LIBEXT = @LIBEXT@
|
||||
LIBPREFIX = @LIBPREFIX@
|
||||
SO_SUFFIX = @SO_SUFFIX@
|
||||
DLLIMP_SUFFIX = @DLLIMP_SUFFIX@
|
||||
LN_S = @LN_S@
|
||||
WINDRES = @WINDRES@
|
||||
PIC_FLAG = @PIC_FLAG@
|
||||
SONAME_FLAG = @SONAME_FLAG@
|
||||
STRIP = @STRIP@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_DIR = @INSTALL_DIR@
|
||||
BK_DEPS = @BK_DEPS@
|
||||
BK_MAKE_PCH = @BK_MAKE_PCH@
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
libdir = @libdir@
|
||||
includedir = @includedir@
|
||||
DLLPREFIX = @DLLPREFIX@
|
||||
LIBS = @LIBS@
|
||||
AR = @AR@
|
||||
AROPTIONS = @AROPTIONS@
|
||||
RANLIB = @RANLIB@
|
||||
CXX = @CXX@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
VENDOR = @VENDOR@
|
||||
WX_FLAVOUR = @WX_FLAVOUR@
|
||||
WX_LIB_FLAVOUR = @WX_LIB_FLAVOUR@
|
||||
TOOLKIT = @TOOLKIT@
|
||||
TOOLKIT_LOWERCASE = @TOOLKIT_LOWERCASE@
|
||||
TOOLKIT_VERSION = @TOOLKIT_VERSION@
|
||||
TOOLCHAIN_FULLNAME = @TOOLCHAIN_FULLNAME@
|
||||
EXTRALIBS = @EXTRALIBS@
|
||||
EXTRALIBS_XML = @EXTRALIBS_XML@
|
||||
EXTRALIBS_GUI = @EXTRALIBS_GUI@
|
||||
HOST_SUFFIX = @HOST_SUFFIX@
|
||||
wx_top_builddir = @wx_top_builddir@
|
||||
|
||||
### Variables: ###
|
||||
|
||||
DESTDIR =
|
||||
WX_RELEASE = 2.9
|
||||
WX_RELEASE_NODOT = 29
|
||||
WX_VERSION_NODOT = $(WX_RELEASE_NODOT)0
|
||||
LIBDIRNAME = $(wx_top_builddir)/lib
|
||||
GIZMOSDLL_CXXFLAGS = $(__gizmosdll_PCH_INC) -D__WX$(TOOLKIT)__ \
|
||||
$(__WXUNIV_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \
|
||||
$(__THREAD_DEFINE_p) -I$(srcdir)/../../include -DWXUSINGDLL \
|
||||
-DWXMAKINGDLL_GIZMOS $(PIC_FLAG) $(CPPFLAGS) $(CXXFLAGS)
|
||||
GIZMOSDLL_OBJECTS = \
|
||||
$(__gizmosdll___win32rc) \
|
||||
gizmosdll_dynamicsash.o \
|
||||
gizmosdll_editlbox.o \
|
||||
gizmosdll_ledctrl.o \
|
||||
gizmosdll_multicell.o \
|
||||
gizmosdll_splittree.o \
|
||||
gizmosdll_statpict.o
|
||||
GIZMOSDLL_ODEP = $(___pch_wxprec_gizmosdll_wx_wxprec_h_gch___depname)
|
||||
GIZMOS_XRCDLL_CXXFLAGS = $(__gizmos_xrcdll_PCH_INC) -D__WX$(TOOLKIT)__ \
|
||||
$(__WXUNIV_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \
|
||||
$(__THREAD_DEFINE_p) -I$(srcdir)/../../include -DWXUSINGDLL \
|
||||
-DWXMAKINGDLL_GIZMOS_XRC $(PIC_FLAG) $(CPPFLAGS) $(CXXFLAGS)
|
||||
GIZMOS_XRCDLL_OBJECTS = \
|
||||
$(__gizmos_xrcdll___win32rc) \
|
||||
gizmos_xrcdll_xh_statpict.o
|
||||
GIZMOS_XRCDLL_ODEP = \
|
||||
$(___pch_wxprec_gizmos_xrcdll_wx_wxprec_h_gch___depname)
|
||||
GIZMOSLIB_CXXFLAGS = $(__gizmoslib_PCH_INC) -D__WX$(TOOLKIT)__ \
|
||||
$(__WXUNIV_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \
|
||||
$(__THREAD_DEFINE_p) -I$(srcdir)/../../include $(CPPFLAGS) $(CXXFLAGS)
|
||||
GIZMOSLIB_OBJECTS = \
|
||||
gizmoslib_dynamicsash.o \
|
||||
gizmoslib_editlbox.o \
|
||||
gizmoslib_ledctrl.o \
|
||||
gizmoslib_multicell.o \
|
||||
gizmoslib_splittree.o \
|
||||
gizmoslib_statpict.o
|
||||
GIZMOSLIB_ODEP = $(___pch_wxprec_gizmoslib_wx_wxprec_h_gch___depname)
|
||||
GIZMOS_XRCLIB_CXXFLAGS = $(__gizmos_xrclib_PCH_INC) -D__WX$(TOOLKIT)__ \
|
||||
$(__WXUNIV_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \
|
||||
$(__THREAD_DEFINE_p) -I$(srcdir)/../../include $(CPPFLAGS) $(CXXFLAGS)
|
||||
GIZMOS_XRCLIB_OBJECTS = \
|
||||
gizmos_xrclib_xh_statpict.o
|
||||
GIZMOS_XRCLIB_ODEP = \
|
||||
$(___pch_wxprec_gizmos_xrclib_wx_wxprec_h_gch___depname)
|
||||
|
||||
### Conditionally set variables: ###
|
||||
|
||||
@COND_DEPS_TRACKING_0@CXXC = $(CXX)
|
||||
@COND_DEPS_TRACKING_1@CXXC = $(BK_DEPS) $(CXX)
|
||||
@COND_PLATFORM_MACOSX_1@WXMACVERSION_CMD = \
|
||||
@COND_PLATFORM_MACOSX_1@ -compatibility_version 1.0 -current_version 1.0
|
||||
@COND_USE_GUI_0@PORTNAME = base
|
||||
@COND_USE_GUI_1@PORTNAME = $(TOOLKIT_LOWERCASE)$(TOOLKIT_VERSION)
|
||||
@COND_TOOLKIT_MAC@WXBASEPORT = _carbon
|
||||
@COND_PLATFORM_WIN32_1@WXCOMPILER = _gcc
|
||||
@COND_OFFICIAL_BUILD_0_PLATFORM_WIN32_1@VENDORTAG = _$(VENDOR)
|
||||
@COND_OFFICIAL_BUILD_1_PLATFORM_WIN32_1@VENDORTAG =
|
||||
@COND_BUILD_DEBUG_DEBUG_FLAG_DEFAULT@WXDEBUGFLAG = d
|
||||
@COND_DEBUG_FLAG_1@WXDEBUGFLAG = d
|
||||
@COND_UNICODE_1@WXUNICODEFLAG = u
|
||||
@COND_WXUNIV_1@WXUNIVNAME = univ
|
||||
@COND_PLATFORM_WIN32_0@WXDLLNAMEPREFIXGUI = wx_$(PORTNAME)$(WXUNIVNAME)
|
||||
@COND_PLATFORM_WIN32_1@WXDLLNAMEPREFIXGUI = \
|
||||
@COND_PLATFORM_WIN32_1@ wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)
|
||||
@COND_PLATFORM_WIN32_0@WXDLLVERSIONTAG = -$(WX_RELEASE)
|
||||
@COND_PLATFORM_WIN32_1@WXDLLVERSIONTAG =
|
||||
@COND_MONOLITHIC_0@EXTRALIBS_FOR_BASE = $(EXTRALIBS)
|
||||
@COND_MONOLITHIC_1@EXTRALIBS_FOR_BASE = $(EXTRALIBS) $(EXTRALIBS_GUI)
|
||||
@COND_MONOLITHIC_0@EXTRALIBS_FOR_GUI = $(EXTRALIBS_GUI)
|
||||
@COND_MONOLITHIC_1@EXTRALIBS_FOR_GUI =
|
||||
COND_SHARED_1___gizmosdll___depname = \
|
||||
$(LIBDIRNAME)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0)
|
||||
@COND_SHARED_1@__gizmosdll___depname = $(COND_SHARED_1___gizmosdll___depname)
|
||||
@COND_SHARED_1@__install_gizmosdll___depname = install_gizmosdll
|
||||
@COND_SHARED_1@__uninstall_gizmosdll___depname = uninstall_gizmosdll
|
||||
COND_PLATFORM_MACOSX_1___gizmosdll___macinstnamecmd = -install_name \
|
||||
$(libdir)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos)
|
||||
@COND_PLATFORM_MACOSX_1@__gizmosdll___macinstnamecmd = $(COND_PLATFORM_MACOSX_1___gizmosdll___macinstnamecmd)
|
||||
COND_PLATFORM_OS2_1___gizmosdll___importlib = -import \
|
||||
$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX)
|
||||
@COND_PLATFORM_OS2_1@__gizmosdll___importlib = $(COND_PLATFORM_OS2_1___gizmosdll___importlib)
|
||||
COND_WINDOWS_IMPLIB_1___gizmosdll___importlib = \
|
||||
-Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX)
|
||||
@COND_WINDOWS_IMPLIB_1@__gizmosdll___importlib = $(COND_WINDOWS_IMPLIB_1___gizmosdll___importlib)
|
||||
@COND_GCC_PCH_1@__gizmosdll_PCH_INC = -I.pch/wxprec_gizmosdll
|
||||
@COND_ICC_PCH_1@__gizmosdll_PCH_INC = -use_pch \
|
||||
@COND_ICC_PCH_1@ .pch/wxprec_gizmosdll/wx/wxprec.h.gch
|
||||
@COND_USE_PCH_1@___pch_wxprec_gizmosdll_wx_wxprec_h_gch___depname \
|
||||
@COND_USE_PCH_1@ = .pch/wxprec_gizmosdll/wx/wxprec.h.gch
|
||||
COND_USE_SOVERLINUX_1___gizmosdll___soname_flags = \
|
||||
$(SONAME_FLAG)$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos)
|
||||
@COND_USE_SOVERLINUX_1@__gizmosdll___soname_flags = $(COND_USE_SOVERLINUX_1___gizmosdll___soname_flags)
|
||||
COND_USE_SOVERSOLARIS_1___gizmosdll___soname_flags = \
|
||||
$(SONAME_FLAG)$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0)
|
||||
@COND_USE_SOVERSOLARIS_1@__gizmosdll___soname_flags = $(COND_USE_SOVERSOLARIS_1___gizmosdll___soname_flags)
|
||||
COND_USE_SOSYMLINKS_1___gizmosdll___so_symlinks_cmd = (cd $(LIBDIRNAME)/; rm -f \
|
||||
$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos); \
|
||||
$(LN_S) \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0) \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos); \
|
||||
$(LN_S) \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos) \
|
||||
$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX))
|
||||
@COND_USE_SOSYMLINKS_1@__gizmosdll___so_symlinks_cmd = $(COND_USE_SOSYMLINKS_1___gizmosdll___so_symlinks_cmd)
|
||||
COND_USE_SOSYMLINKS_1___gizmosdll___so_symlinks_inst_cmd = rm -f \
|
||||
$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos); \
|
||||
$(LN_S) \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0) \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos); \
|
||||
$(LN_S) \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos) \
|
||||
$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX)
|
||||
@COND_USE_SOSYMLINKS_1@__gizmosdll___so_symlinks_inst_cmd = $(COND_USE_SOSYMLINKS_1___gizmosdll___so_symlinks_inst_cmd)
|
||||
COND_USE_SOSYMLINKS_1___gizmosdll___so_symlinks_uninst_cmd = rm -f \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos) \
|
||||
$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX)
|
||||
@COND_USE_SOSYMLINKS_1@__gizmosdll___so_symlinks_uninst_cmd = $(COND_USE_SOSYMLINKS_1___gizmosdll___so_symlinks_uninst_cmd)
|
||||
@COND_PLATFORM_WIN32_1@__gizmosdll___win32rc = gizmosdll_version_rc.o
|
||||
COND_SHARED_1_USE_XRC_1___gizmos_xrcdll___depname = \
|
||||
$(LIBDIRNAME)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0)
|
||||
@COND_SHARED_1_USE_XRC_1@__gizmos_xrcdll___depname = $(COND_SHARED_1_USE_XRC_1___gizmos_xrcdll___depname)
|
||||
@COND_SHARED_1_USE_XRC_1@__install_gizmos_xrcdll___depname \
|
||||
@COND_SHARED_1_USE_XRC_1@ = install_gizmos_xrcdll
|
||||
@COND_SHARED_1_USE_XRC_1@__uninstall_gizmos_xrcdll___depname \
|
||||
@COND_SHARED_1_USE_XRC_1@ = uninstall_gizmos_xrcdll
|
||||
COND_PLATFORM_MACOSX_1___gizmos_xrcdll___macinstnamecmd = -install_name \
|
||||
$(libdir)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos)
|
||||
@COND_PLATFORM_MACOSX_1@__gizmos_xrcdll___macinstnamecmd = $(COND_PLATFORM_MACOSX_1___gizmos_xrcdll___macinstnamecmd)
|
||||
COND_PLATFORM_OS2_1___gizmos_xrcdll___importlib = -import \
|
||||
$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX)
|
||||
@COND_PLATFORM_OS2_1@__gizmos_xrcdll___importlib = $(COND_PLATFORM_OS2_1___gizmos_xrcdll___importlib)
|
||||
COND_WINDOWS_IMPLIB_1___gizmos_xrcdll___importlib = \
|
||||
-Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX)
|
||||
@COND_WINDOWS_IMPLIB_1@__gizmos_xrcdll___importlib = $(COND_WINDOWS_IMPLIB_1___gizmos_xrcdll___importlib)
|
||||
@COND_GCC_PCH_1@__gizmos_xrcdll_PCH_INC = -I.pch/wxprec_gizmos_xrcdll
|
||||
@COND_ICC_PCH_1@__gizmos_xrcdll_PCH_INC = -use_pch \
|
||||
@COND_ICC_PCH_1@ .pch/wxprec_gizmos_xrcdll/wx/wxprec.h.gch
|
||||
@COND_USE_PCH_1@___pch_wxprec_gizmos_xrcdll_wx_wxprec_h_gch___depname \
|
||||
@COND_USE_PCH_1@ = .pch/wxprec_gizmos_xrcdll/wx/wxprec.h.gch
|
||||
COND_USE_SOVERLINUX_1___gizmos_xrcdll___soname_flags = \
|
||||
$(SONAME_FLAG)$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos)
|
||||
@COND_USE_SOVERLINUX_1@__gizmos_xrcdll___soname_flags = $(COND_USE_SOVERLINUX_1___gizmos_xrcdll___soname_flags)
|
||||
COND_USE_SOVERSOLARIS_1___gizmos_xrcdll___soname_flags = \
|
||||
$(SONAME_FLAG)$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0)
|
||||
@COND_USE_SOVERSOLARIS_1@__gizmos_xrcdll___soname_flags = $(COND_USE_SOVERSOLARIS_1___gizmos_xrcdll___soname_flags)
|
||||
COND_USE_SOSYMLINKS_1___gizmos_xrcdll___so_symlinks_cmd = (cd $(LIBDIRNAME)/; \
|
||||
rm -f \
|
||||
$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos); \
|
||||
$(LN_S) \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0) \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos); \
|
||||
$(LN_S) \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos) \
|
||||
$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX))
|
||||
@COND_USE_SOSYMLINKS_1@__gizmos_xrcdll___so_symlinks_cmd = $(COND_USE_SOSYMLINKS_1___gizmos_xrcdll___so_symlinks_cmd)
|
||||
COND_USE_SOSYMLINKS_1___gizmos_xrcdll___so_symlinks_inst_cmd = rm -f \
|
||||
$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos); \
|
||||
$(LN_S) \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0) \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos); \
|
||||
$(LN_S) \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos) \
|
||||
$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX)
|
||||
@COND_USE_SOSYMLINKS_1@__gizmos_xrcdll___so_symlinks_inst_cmd = $(COND_USE_SOSYMLINKS_1___gizmos_xrcdll___so_symlinks_inst_cmd)
|
||||
COND_USE_SOSYMLINKS_1___gizmos_xrcdll___so_symlinks_uninst_cmd = rm -f \
|
||||
$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos) \
|
||||
$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX)
|
||||
@COND_USE_SOSYMLINKS_1@__gizmos_xrcdll___so_symlinks_uninst_cmd = $(COND_USE_SOSYMLINKS_1___gizmos_xrcdll___so_symlinks_uninst_cmd)
|
||||
@COND_PLATFORM_WIN32_1@__gizmos_xrcdll___win32rc = \
|
||||
@COND_PLATFORM_WIN32_1@ gizmos_xrcdll_version_rc.o
|
||||
COND_MONOLITHIC_0___WXLIB_XRC_p = \
|
||||
-lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_xrc-$(WX_RELEASE)$(HOST_SUFFIX)
|
||||
@COND_MONOLITHIC_0@__WXLIB_XRC_p = $(COND_MONOLITHIC_0___WXLIB_XRC_p)
|
||||
COND_MONOLITHIC_0___WXLIB_XML_p = \
|
||||
-lwx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_xml-$(WX_RELEASE)$(HOST_SUFFIX)
|
||||
@COND_MONOLITHIC_0@__WXLIB_XML_p = $(COND_MONOLITHIC_0___WXLIB_XML_p)
|
||||
COND_SHARED_0___gizmoslib___depname = \
|
||||
$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX)$(LIBEXT)
|
||||
@COND_SHARED_0@__gizmoslib___depname = $(COND_SHARED_0___gizmoslib___depname)
|
||||
@COND_SHARED_0@__install_gizmoslib___depname = install_gizmoslib
|
||||
@COND_SHARED_0@__uninstall_gizmoslib___depname = uninstall_gizmoslib
|
||||
@COND_GCC_PCH_1@__gizmoslib_PCH_INC = -I.pch/wxprec_gizmoslib
|
||||
@COND_ICC_PCH_1@__gizmoslib_PCH_INC = -use_pch \
|
||||
@COND_ICC_PCH_1@ .pch/wxprec_gizmoslib/wx/wxprec.h.gch
|
||||
@COND_USE_PCH_1@___pch_wxprec_gizmoslib_wx_wxprec_h_gch___depname \
|
||||
@COND_USE_PCH_1@ = .pch/wxprec_gizmoslib/wx/wxprec.h.gch
|
||||
COND_SHARED_0_USE_XRC_1___gizmos_xrclib___depname = \
|
||||
$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc-$(WX_RELEASE)$(HOST_SUFFIX)$(LIBEXT)
|
||||
@COND_SHARED_0_USE_XRC_1@__gizmos_xrclib___depname = $(COND_SHARED_0_USE_XRC_1___gizmos_xrclib___depname)
|
||||
@COND_SHARED_0_USE_XRC_1@__install_gizmos_xrclib___depname \
|
||||
@COND_SHARED_0_USE_XRC_1@ = install_gizmos_xrclib
|
||||
@COND_SHARED_0_USE_XRC_1@__uninstall_gizmos_xrclib___depname \
|
||||
@COND_SHARED_0_USE_XRC_1@ = uninstall_gizmos_xrclib
|
||||
@COND_GCC_PCH_1@__gizmos_xrclib_PCH_INC = -I.pch/wxprec_gizmos_xrclib
|
||||
@COND_ICC_PCH_1@__gizmos_xrclib_PCH_INC = -use_pch \
|
||||
@COND_ICC_PCH_1@ .pch/wxprec_gizmos_xrclib/wx/wxprec.h.gch
|
||||
@COND_USE_PCH_1@___pch_wxprec_gizmos_xrclib_wx_wxprec_h_gch___depname \
|
||||
@COND_USE_PCH_1@ = .pch/wxprec_gizmos_xrclib/wx/wxprec.h.gch
|
||||
@COND_WXUNIV_1@__WXUNIV_DEFINE_p_0 = --define __WXUNIVERSAL__
|
||||
@COND_USE_EXCEPTIONS_0@__EXCEPTIONS_DEFINE_p_0 = --define wxNO_EXCEPTIONS
|
||||
@COND_USE_RTTI_0@__RTTI_DEFINE_p_0 = --define wxNO_RTTI
|
||||
@COND_USE_THREADS_0@__THREAD_DEFINE_p_0 = --define wxNO_THREADS
|
||||
@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@__gizmos = .$(SO_SUFFIX).0
|
||||
@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@__gizmos = .0.$(SO_SUFFIX)
|
||||
@COND_USE_SOVERSION_0@__gizmos = .$(SO_SUFFIX)
|
||||
@COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1@__gizmos_0 \
|
||||
@COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1@ = \
|
||||
@COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1@ .$(SO_SUFFIX).0.0.0
|
||||
@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@__gizmos_0 = .0.0.0.$(SO_SUFFIX)
|
||||
@COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1@__gizmos_0 = -0.$(SO_SUFFIX)
|
||||
@COND_USE_SOVERSION_0@__gizmos_0 = .$(SO_SUFFIX)
|
||||
@COND_TOOLKIT_MSW@__RCDEFDIR_p = --include-dir \
|
||||
@COND_TOOLKIT_MSW@ $(LIBDIRNAME)/wx/include/$(TOOLCHAIN_FULLNAME)
|
||||
COND_MONOLITHIC_1___WXLIB_MONO_p = \
|
||||
-lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
|
||||
@COND_MONOLITHIC_1@__WXLIB_MONO_p = $(COND_MONOLITHIC_1___WXLIB_MONO_p)
|
||||
@COND_USE_GUI_1_WXUSE_LIBTIFF_BUILTIN@__LIB_TIFF_p \
|
||||
@COND_USE_GUI_1_WXUSE_LIBTIFF_BUILTIN@ = \
|
||||
@COND_USE_GUI_1_WXUSE_LIBTIFF_BUILTIN@ -lwxtiff$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
|
||||
@COND_USE_GUI_1_WXUSE_LIBJPEG_BUILTIN@__LIB_JPEG_p \
|
||||
@COND_USE_GUI_1_WXUSE_LIBJPEG_BUILTIN@ = \
|
||||
@COND_USE_GUI_1_WXUSE_LIBJPEG_BUILTIN@ -lwxjpeg$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
|
||||
@COND_USE_GUI_1_WXUSE_LIBPNG_BUILTIN@__LIB_PNG_p \
|
||||
@COND_USE_GUI_1_WXUSE_LIBPNG_BUILTIN@ = \
|
||||
@COND_USE_GUI_1_WXUSE_LIBPNG_BUILTIN@ -lwxpng$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
|
||||
@COND_WXUSE_ZLIB_BUILTIN@__LIB_ZLIB_p = \
|
||||
@COND_WXUSE_ZLIB_BUILTIN@ -lwxzlib$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
|
||||
@COND_WXUSE_ODBC_BUILTIN@__LIB_ODBC_p = \
|
||||
@COND_WXUSE_ODBC_BUILTIN@ -lwxodbc$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
|
||||
COND_WXUSE_REGEX_BUILTIN___LIB_REGEX_p = \
|
||||
-lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
|
||||
@COND_WXUSE_REGEX_BUILTIN@__LIB_REGEX_p = $(COND_WXUSE_REGEX_BUILTIN___LIB_REGEX_p)
|
||||
@COND_WXUSE_EXPAT_BUILTIN@__LIB_EXPAT_p = \
|
||||
@COND_WXUSE_EXPAT_BUILTIN@ -lwxexpat$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
|
||||
COND_MONOLITHIC_0___WXLIB_CORE_p = \
|
||||
-lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core-$(WX_RELEASE)$(HOST_SUFFIX)
|
||||
@COND_MONOLITHIC_0@__WXLIB_CORE_p = $(COND_MONOLITHIC_0___WXLIB_CORE_p)
|
||||
COND_MONOLITHIC_0___WXLIB_BASE_p = \
|
||||
-lwx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
|
||||
@COND_MONOLITHIC_0@__WXLIB_BASE_p = $(COND_MONOLITHIC_0___WXLIB_BASE_p)
|
||||
@COND_WXUNIV_1@__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__
|
||||
@COND_USE_EXCEPTIONS_0@__EXCEPTIONS_DEFINE_p = -DwxNO_EXCEPTIONS
|
||||
@COND_USE_RTTI_0@__RTTI_DEFINE_p = -DwxNO_RTTI
|
||||
@COND_USE_THREADS_0@__THREAD_DEFINE_p = -DwxNO_THREADS
|
||||
|
||||
### Targets: ###
|
||||
|
||||
all: $(__gizmosdll___depname) $(__gizmos_xrcdll___depname) $(__gizmoslib___depname) $(__gizmos_xrclib___depname)
|
||||
|
||||
install: all $(__install_gizmosdll___depname) $(__install_gizmos_xrcdll___depname) $(__install_gizmoslib___depname) $(__install_gizmos_xrclib___depname)
|
||||
$(INSTALL_DIR) $(DESTDIR)$(includedir)/wx-$(WX_RELEASE)$(WX_FLAVOUR)
|
||||
for f in wx/gizmos/dynamicsash.h wx/gizmos/editlbox.h wx/gizmos/ledctrl.h wx/gizmos/multicell.h wx/gizmos/splittree.h wx/gizmos/statpict.h wx/gizmos/gizmos.h wx/gizmos/xh_statpict.h; do \
|
||||
if test ! -d $(DESTDIR)$(includedir)/wx-$(WX_RELEASE)$(WX_FLAVOUR)/`dirname $$f` ; then \
|
||||
$(INSTALL_DIR) $(DESTDIR)$(includedir)/wx-$(WX_RELEASE)$(WX_FLAVOUR)/`dirname $$f`; \
|
||||
fi; \
|
||||
$(INSTALL_DATA) $(srcdir)/../../include//$$f $(DESTDIR)$(includedir)/wx-$(WX_RELEASE)$(WX_FLAVOUR)/$$f; \
|
||||
done
|
||||
|
||||
uninstall: $(__uninstall_gizmosdll___depname) $(__uninstall_gizmos_xrcdll___depname) $(__uninstall_gizmoslib___depname) $(__uninstall_gizmos_xrclib___depname)
|
||||
for f in wx/gizmos/dynamicsash.h wx/gizmos/editlbox.h wx/gizmos/ledctrl.h wx/gizmos/multicell.h wx/gizmos/splittree.h wx/gizmos/statpict.h wx/gizmos/gizmos.h wx/gizmos/xh_statpict.h; do \
|
||||
rm -f $(DESTDIR)$(includedir)/wx-$(WX_RELEASE)$(WX_FLAVOUR)/$$f; \
|
||||
done
|
||||
|
||||
install-strip: install
|
||||
$(STRIP) $(DESTDIR)$(libdir)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0)
|
||||
$(STRIP) $(DESTDIR)$(libdir)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0)
|
||||
|
||||
clean:
|
||||
rm -rf ./.deps ./.pch
|
||||
rm -f ./*.o
|
||||
rm -f $(LIBDIRNAME)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0)
|
||||
rm -f $(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX)
|
||||
rm -f $(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) $(LIBDIRNAME)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos)
|
||||
rm -f $(LIBDIRNAME)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0)
|
||||
rm -f $(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX)
|
||||
rm -f $(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) $(LIBDIRNAME)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos)
|
||||
rm -f $(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX)$(LIBEXT)
|
||||
rm -f $(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc-$(WX_RELEASE)$(HOST_SUFFIX)$(LIBEXT)
|
||||
|
||||
distclean: clean
|
||||
rm -f config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile
|
||||
|
||||
@COND_SHARED_1@$(LIBDIRNAME)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0): $(GIZMOSDLL_OBJECTS) $(__gizmosdll___win32rc)
|
||||
@COND_SHARED_1@ $(SHARED_LD_CXX) $@ $(GIZMOSDLL_OBJECTS) $(LDFLAGS) -L$(LIBDIRNAME) $(__gizmosdll___macinstnamecmd) $(__gizmosdll___importlib) $(__gizmosdll___soname_flags) $(WXMACVERSION_CMD) $(LIBS) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_ODBC_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p)
|
||||
@COND_SHARED_1@
|
||||
@COND_SHARED_1@ $(__gizmosdll___so_symlinks_cmd)
|
||||
|
||||
@COND_SHARED_1@install_gizmosdll:
|
||||
@COND_SHARED_1@ $(INSTALL_DIR) $(DESTDIR)$(libdir)
|
||||
@COND_SHARED_1@ $(INSTALL_DATA) $(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) $(DESTDIR)$(libdir)
|
||||
@COND_SHARED_1@ $(INSTALL_PROGRAM) $(LIBDIRNAME)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0) $(DESTDIR)$(libdir)
|
||||
@COND_SHARED_1@ (cd $(DESTDIR)$(libdir) ; $(__gizmosdll___so_symlinks_inst_cmd))
|
||||
|
||||
@COND_SHARED_1@uninstall_gizmosdll:
|
||||
@COND_SHARED_1@ rm -f $(DESTDIR)$(libdir)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX)
|
||||
@COND_SHARED_1@ rm -f $(DESTDIR)$(libdir)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0)
|
||||
@COND_SHARED_1@ (cd $(DESTDIR)$(libdir) ; $(__gizmosdll___so_symlinks_uninst_cmd))
|
||||
|
||||
@COND_USE_PCH_1@.pch/wxprec_gizmosdll/wx/wxprec.h.gch:
|
||||
@COND_USE_PCH_1@ $(BK_MAKE_PCH) .pch/wxprec_gizmosdll/wx/wxprec.h.gch wx/wxprec.h $(CXX) $(GIZMOSDLL_CXXFLAGS)
|
||||
|
||||
@COND_SHARED_1_USE_XRC_1@$(LIBDIRNAME)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0): $(GIZMOS_XRCDLL_OBJECTS) $(__gizmos_xrcdll___win32rc) $(__gizmosdll___depname)
|
||||
@COND_SHARED_1_USE_XRC_1@ $(SHARED_LD_CXX) $@ $(GIZMOS_XRCDLL_OBJECTS) -L$(LIBDIRNAME) $(LDFLAGS) -L$(LIBDIRNAME) $(__gizmos_xrcdll___macinstnamecmd) $(__gizmos_xrcdll___importlib) $(__gizmos_xrcdll___soname_flags) $(WXMACVERSION_CMD) $(LIBS) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_ODBC_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX) $(__WXLIB_XRC_p) $(__WXLIB_XML_p) $(EXTRALIBS_XML) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p)
|
||||
@COND_SHARED_1_USE_XRC_1@
|
||||
@COND_SHARED_1_USE_XRC_1@ $(__gizmos_xrcdll___so_symlinks_cmd)
|
||||
|
||||
@COND_SHARED_1_USE_XRC_1@install_gizmos_xrcdll:
|
||||
@COND_SHARED_1_USE_XRC_1@ $(INSTALL_DIR) $(DESTDIR)$(libdir)
|
||||
@COND_SHARED_1_USE_XRC_1@ $(INSTALL_DATA) $(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) $(DESTDIR)$(libdir)
|
||||
@COND_SHARED_1_USE_XRC_1@ $(INSTALL_PROGRAM) $(LIBDIRNAME)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0) $(DESTDIR)$(libdir)
|
||||
@COND_SHARED_1_USE_XRC_1@ (cd $(DESTDIR)$(libdir) ; $(__gizmos_xrcdll___so_symlinks_inst_cmd))
|
||||
|
||||
@COND_SHARED_1_USE_XRC_1@uninstall_gizmos_xrcdll:
|
||||
@COND_SHARED_1_USE_XRC_1@ rm -f $(DESTDIR)$(libdir)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX)
|
||||
@COND_SHARED_1_USE_XRC_1@ rm -f $(DESTDIR)$(libdir)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__gizmos_0)
|
||||
@COND_SHARED_1_USE_XRC_1@ (cd $(DESTDIR)$(libdir) ; $(__gizmos_xrcdll___so_symlinks_uninst_cmd))
|
||||
|
||||
@COND_USE_PCH_1@.pch/wxprec_gizmos_xrcdll/wx/wxprec.h.gch:
|
||||
@COND_USE_PCH_1@ $(BK_MAKE_PCH) .pch/wxprec_gizmos_xrcdll/wx/wxprec.h.gch wx/wxprec.h $(CXX) $(GIZMOS_XRCDLL_CXXFLAGS)
|
||||
|
||||
@COND_SHARED_0@$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX)$(LIBEXT): $(GIZMOSLIB_OBJECTS)
|
||||
@COND_SHARED_0@ rm -f $@
|
||||
@COND_SHARED_0@ $(AR) $(AROPTIONS) $@ $(GIZMOSLIB_OBJECTS)
|
||||
@COND_SHARED_0@ $(RANLIB) $@
|
||||
|
||||
@COND_SHARED_0@install_gizmoslib:
|
||||
@COND_SHARED_0@ $(INSTALL_DIR) $(DESTDIR)$(libdir)
|
||||
@COND_SHARED_0@ $(INSTALL_DATA) $(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX)$(LIBEXT) $(DESTDIR)$(libdir)
|
||||
|
||||
@COND_SHARED_0@uninstall_gizmoslib:
|
||||
@COND_SHARED_0@ rm -f $(DESTDIR)$(libdir)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos-$(WX_RELEASE)$(HOST_SUFFIX)$(LIBEXT)
|
||||
|
||||
@COND_USE_PCH_1@.pch/wxprec_gizmoslib/wx/wxprec.h.gch:
|
||||
@COND_USE_PCH_1@ $(BK_MAKE_PCH) .pch/wxprec_gizmoslib/wx/wxprec.h.gch wx/wxprec.h $(CXX) $(GIZMOSLIB_CXXFLAGS)
|
||||
|
||||
@COND_SHARED_0_USE_XRC_1@$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc-$(WX_RELEASE)$(HOST_SUFFIX)$(LIBEXT): $(GIZMOS_XRCLIB_OBJECTS)
|
||||
@COND_SHARED_0_USE_XRC_1@ rm -f $@
|
||||
@COND_SHARED_0_USE_XRC_1@ $(AR) $(AROPTIONS) $@ $(GIZMOS_XRCLIB_OBJECTS)
|
||||
@COND_SHARED_0_USE_XRC_1@ $(RANLIB) $@
|
||||
|
||||
@COND_SHARED_0_USE_XRC_1@install_gizmos_xrclib:
|
||||
@COND_SHARED_0_USE_XRC_1@ $(INSTALL_DIR) $(DESTDIR)$(libdir)
|
||||
@COND_SHARED_0_USE_XRC_1@ $(INSTALL_DATA) $(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc-$(WX_RELEASE)$(HOST_SUFFIX)$(LIBEXT) $(DESTDIR)$(libdir)
|
||||
|
||||
@COND_SHARED_0_USE_XRC_1@uninstall_gizmos_xrclib:
|
||||
@COND_SHARED_0_USE_XRC_1@ rm -f $(DESTDIR)$(libdir)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc-$(WX_RELEASE)$(HOST_SUFFIX)$(LIBEXT)
|
||||
|
||||
@COND_USE_PCH_1@.pch/wxprec_gizmos_xrclib/wx/wxprec.h.gch:
|
||||
@COND_USE_PCH_1@ $(BK_MAKE_PCH) .pch/wxprec_gizmos_xrclib/wx/wxprec.h.gch wx/wxprec.h $(CXX) $(GIZMOS_XRCLIB_CXXFLAGS)
|
||||
|
||||
gizmosdll_version_rc.o: $(srcdir)/../../../src/msw/version.rc $(GIZMOSDLL_ODEP)
|
||||
$(WINDRES) -i$< -o$@ --define __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_0) $(__EXCEPTIONS_DEFINE_p_0) $(__RTTI_DEFINE_p_0) $(__THREAD_DEFINE_p_0) --define WXDLLNAME=$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG) $(__RCDEFDIR_p) --include-dir $(top_srcdir)/include
|
||||
|
||||
gizmosdll_dynamicsash.o: $(srcdir)/dynamicsash.cpp $(GIZMOSDLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(GIZMOSDLL_CXXFLAGS) $(srcdir)/dynamicsash.cpp
|
||||
|
||||
gizmosdll_editlbox.o: $(srcdir)/editlbox.cpp $(GIZMOSDLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(GIZMOSDLL_CXXFLAGS) $(srcdir)/editlbox.cpp
|
||||
|
||||
gizmosdll_ledctrl.o: $(srcdir)/ledctrl.cpp $(GIZMOSDLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(GIZMOSDLL_CXXFLAGS) $(srcdir)/ledctrl.cpp
|
||||
|
||||
gizmosdll_multicell.o: $(srcdir)/multicell.cpp $(GIZMOSDLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(GIZMOSDLL_CXXFLAGS) $(srcdir)/multicell.cpp
|
||||
|
||||
gizmosdll_splittree.o: $(srcdir)/splittree.cpp $(GIZMOSDLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(GIZMOSDLL_CXXFLAGS) $(srcdir)/splittree.cpp
|
||||
|
||||
gizmosdll_statpict.o: $(srcdir)/statpict.cpp $(GIZMOSDLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(GIZMOSDLL_CXXFLAGS) $(srcdir)/statpict.cpp
|
||||
|
||||
gizmos_xrcdll_version_rc.o: $(srcdir)/../../../src/msw/version.rc $(GIZMOS_XRCDLL_ODEP)
|
||||
$(WINDRES) -i$< -o$@ --define __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_0) $(__EXCEPTIONS_DEFINE_p_0) $(__RTTI_DEFINE_p_0) $(__THREAD_DEFINE_p_0) --define WXDLLNAME=$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos_xrc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG) $(__RCDEFDIR_p) --include-dir $(top_srcdir)/include
|
||||
|
||||
gizmos_xrcdll_xh_statpict.o: $(srcdir)/xh_statpict.cpp $(GIZMOS_XRCDLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(GIZMOS_XRCDLL_CXXFLAGS) $(srcdir)/xh_statpict.cpp
|
||||
|
||||
gizmoslib_dynamicsash.o: $(srcdir)/dynamicsash.cpp $(GIZMOSLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(GIZMOSLIB_CXXFLAGS) $(srcdir)/dynamicsash.cpp
|
||||
|
||||
gizmoslib_editlbox.o: $(srcdir)/editlbox.cpp $(GIZMOSLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(GIZMOSLIB_CXXFLAGS) $(srcdir)/editlbox.cpp
|
||||
|
||||
gizmoslib_ledctrl.o: $(srcdir)/ledctrl.cpp $(GIZMOSLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(GIZMOSLIB_CXXFLAGS) $(srcdir)/ledctrl.cpp
|
||||
|
||||
gizmoslib_multicell.o: $(srcdir)/multicell.cpp $(GIZMOSLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(GIZMOSLIB_CXXFLAGS) $(srcdir)/multicell.cpp
|
||||
|
||||
gizmoslib_splittree.o: $(srcdir)/splittree.cpp $(GIZMOSLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(GIZMOSLIB_CXXFLAGS) $(srcdir)/splittree.cpp
|
||||
|
||||
gizmoslib_statpict.o: $(srcdir)/statpict.cpp $(GIZMOSLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(GIZMOSLIB_CXXFLAGS) $(srcdir)/statpict.cpp
|
||||
|
||||
gizmos_xrclib_xh_statpict.o: $(srcdir)/xh_statpict.cpp $(GIZMOS_XRCLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(GIZMOS_XRCLIB_CXXFLAGS) $(srcdir)/xh_statpict.cpp
|
||||
|
||||
|
||||
# Include dependency info, if present:
|
||||
@IF_GNU_MAKE@-include .deps/*.d
|
||||
|
||||
.PHONY: all install uninstall clean distclean install_gizmosdll uninstall_gizmosdll install_gizmos_xrcdll uninstall_gizmos_xrcdll install_gizmoslib uninstall_gizmoslib install_gizmos_xrclib uninstall_gizmos_xrclib
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,277 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: editlbox.cpp
|
||||
// Purpose: ListBox with editable items
|
||||
// Author: Vaclav Slavik
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
// for all others, include the necessary headers (this file is usually all you
|
||||
// need because it includes almost all "standard" wxWidgets headers)
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gizmos/editlbox.h"
|
||||
#include "wx/sizer.h"
|
||||
#include "wx/listctrl.h"
|
||||
|
||||
|
||||
|
||||
|
||||
// list control with auto-resizable column:
|
||||
class CleverListCtrl : public wxListCtrl
|
||||
{
|
||||
public:
|
||||
CleverListCtrl(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLC_ICON,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString &name = wxListCtrlNameStr)
|
||||
: wxListCtrl(parent, id, pos, size, style, validator, name)
|
||||
{
|
||||
CreateColumns();
|
||||
}
|
||||
|
||||
void CreateColumns()
|
||||
{
|
||||
InsertColumn(0, _T("item"));
|
||||
SizeColumns();
|
||||
}
|
||||
|
||||
void SizeColumns()
|
||||
{
|
||||
int w = GetSize().x;
|
||||
#ifdef __WXMSW__
|
||||
w -= wxSystemSettings::GetMetric(wxSYS_VSCROLL_X) + 6;
|
||||
#else
|
||||
w -= 2*wxSystemSettings::GetMetric(wxSYS_VSCROLL_X);
|
||||
#endif
|
||||
SetColumnWidth(0, w);
|
||||
}
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
void OnSize(wxSizeEvent& event)
|
||||
{
|
||||
SizeColumns();
|
||||
event.Skip();
|
||||
}
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(CleverListCtrl, wxListCtrl)
|
||||
EVT_SIZE(CleverListCtrl::OnSize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
#include "eldel.xpm"
|
||||
#include "eldown.xpm"
|
||||
#include "eledit.xpm"
|
||||
#include "elnew.xpm"
|
||||
#include "elup.xpm"
|
||||
|
||||
IMPLEMENT_CLASS(wxEditableListBox, wxPanel)
|
||||
|
||||
// NB: generate the IDs at runtime to avoid conflict with XRCID values,
|
||||
// they could cause XRCCTRL() failures in XRC-based dialogs
|
||||
const int wxID_ELB_DELETE = wxNewId();
|
||||
const int wxID_ELB_EDIT = wxNewId();
|
||||
const int wxID_ELB_NEW = wxNewId();
|
||||
const int wxID_ELB_UP = wxNewId();
|
||||
const int wxID_ELB_DOWN = wxNewId();
|
||||
const int wxID_ELB_LISTCTRL = wxNewId();
|
||||
|
||||
BEGIN_EVENT_TABLE(wxEditableListBox, wxPanel)
|
||||
EVT_LIST_ITEM_SELECTED(wxID_ELB_LISTCTRL, wxEditableListBox::OnItemSelected)
|
||||
EVT_LIST_END_LABEL_EDIT(wxID_ELB_LISTCTRL, wxEditableListBox::OnEndLabelEdit)
|
||||
EVT_BUTTON(wxID_ELB_NEW, wxEditableListBox::OnNewItem)
|
||||
EVT_BUTTON(wxID_ELB_UP, wxEditableListBox::OnUpItem)
|
||||
EVT_BUTTON(wxID_ELB_DOWN, wxEditableListBox::OnDownItem)
|
||||
EVT_BUTTON(wxID_ELB_EDIT, wxEditableListBox::OnEditItem)
|
||||
EVT_BUTTON(wxID_ELB_DELETE, wxEditableListBox::OnDelItem)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxEditableListBox::wxEditableListBox(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
: wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL, name)
|
||||
{
|
||||
m_style = style;
|
||||
m_bEdit = m_bNew = m_bDel = m_bUp = m_bDown = NULL;
|
||||
|
||||
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
wxPanel *subp = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
|
||||
wxSUNKEN_BORDER | wxTAB_TRAVERSAL);
|
||||
wxSizer *subsizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
subsizer->Add(new wxStaticText(subp, wxID_ANY, label), 1, wxALIGN_CENTRE_VERTICAL | wxLEFT, 4);
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#define BTN_BORDER 4
|
||||
// FIXME - why is this needed? There's some reason why sunken border is
|
||||
// ignored by sizers in wxMSW but not in wxGTK that I can't
|
||||
// figure out...
|
||||
#else
|
||||
#define BTN_BORDER 0
|
||||
#endif
|
||||
|
||||
if ( m_style & wxEL_ALLOW_EDIT )
|
||||
{
|
||||
m_bEdit = new wxBitmapButton(subp, wxID_ELB_EDIT, wxBitmap(eledit_xpm));
|
||||
subsizer->Add(m_bEdit, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER);
|
||||
}
|
||||
|
||||
if ( m_style & wxEL_ALLOW_NEW )
|
||||
{
|
||||
m_bNew = new wxBitmapButton(subp, wxID_ELB_NEW, wxBitmap(elnew_xpm));
|
||||
subsizer->Add(m_bNew, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER);
|
||||
}
|
||||
|
||||
if ( m_style & wxEL_ALLOW_DELETE )
|
||||
{
|
||||
m_bDel = new wxBitmapButton(subp, wxID_ELB_DELETE, wxBitmap(eldel_xpm));
|
||||
subsizer->Add(m_bDel, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER);
|
||||
}
|
||||
|
||||
if (!(m_style & wxEL_NO_REORDER))
|
||||
{
|
||||
m_bUp = new wxBitmapButton(subp, wxID_ELB_UP, wxBitmap(elup_xpm));
|
||||
subsizer->Add(m_bUp, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER);
|
||||
|
||||
m_bDown = new wxBitmapButton(subp, wxID_ELB_DOWN, wxBitmap(eldown_xpm));
|
||||
subsizer->Add(m_bDown, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER);
|
||||
}
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
if ( m_bEdit ) m_bEdit->SetToolTip(_("Edit item"));
|
||||
if ( m_bNew ) m_bNew->SetToolTip(_("New item"));
|
||||
if ( m_bDel ) m_bDel->SetToolTip(_("Delete item"));
|
||||
if ( m_bUp ) m_bUp->SetToolTip(_("Move up"));
|
||||
if ( m_bDown ) m_bDown->SetToolTip(_("Move down"));
|
||||
#endif
|
||||
|
||||
subp->SetSizer(subsizer);
|
||||
subsizer->Fit(subp);
|
||||
|
||||
sizer->Add(subp, 0, wxEXPAND);
|
||||
|
||||
long st = wxLC_REPORT | wxLC_NO_HEADER | wxLC_SINGLE_SEL | wxSUNKEN_BORDER;
|
||||
if ( style & wxEL_ALLOW_EDIT )
|
||||
st |= wxLC_EDIT_LABELS;
|
||||
m_listCtrl = new CleverListCtrl(this, wxID_ELB_LISTCTRL,
|
||||
wxDefaultPosition, wxDefaultSize, st);
|
||||
wxArrayString empty_ar;
|
||||
SetStrings(empty_ar);
|
||||
|
||||
sizer->Add(m_listCtrl, 1, wxEXPAND);
|
||||
|
||||
SetSizer(sizer);
|
||||
Layout();
|
||||
}
|
||||
|
||||
void wxEditableListBox::SetStrings(const wxArrayString& strings)
|
||||
{
|
||||
m_listCtrl->DeleteAllItems();
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < strings.GetCount(); i++)
|
||||
m_listCtrl->InsertItem(i, strings[i]);
|
||||
|
||||
m_listCtrl->InsertItem(strings.GetCount(), wxEmptyString);
|
||||
m_listCtrl->SetItemState(0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
|
||||
}
|
||||
|
||||
void wxEditableListBox::GetStrings(wxArrayString& strings) const
|
||||
{
|
||||
strings.Clear();
|
||||
|
||||
for (int i = 0; i < m_listCtrl->GetItemCount()-1; i++)
|
||||
strings.Add(m_listCtrl->GetItemText(i));
|
||||
}
|
||||
|
||||
void wxEditableListBox::OnItemSelected(wxListEvent& event)
|
||||
{
|
||||
m_selection = event.GetIndex();
|
||||
if (!(m_style & wxEL_NO_REORDER))
|
||||
{
|
||||
m_bUp->Enable(m_selection != 0 && m_selection < m_listCtrl->GetItemCount()-1);
|
||||
m_bDown->Enable(m_selection < m_listCtrl->GetItemCount()-2);
|
||||
}
|
||||
|
||||
if (m_style & wxEL_ALLOW_EDIT)
|
||||
m_bEdit->Enable(m_selection < m_listCtrl->GetItemCount()-1);
|
||||
if (m_style & wxEL_ALLOW_DELETE)
|
||||
m_bDel->Enable(m_selection < m_listCtrl->GetItemCount()-1);
|
||||
}
|
||||
|
||||
void wxEditableListBox::OnNewItem(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
m_listCtrl->SetItemState(m_listCtrl->GetItemCount()-1,
|
||||
wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
|
||||
m_listCtrl->EditLabel(m_selection);
|
||||
}
|
||||
|
||||
void wxEditableListBox::OnEndLabelEdit(wxListEvent& event)
|
||||
{
|
||||
if ( event.GetIndex() == m_listCtrl->GetItemCount()-1 &&
|
||||
!event.GetText().empty() )
|
||||
{
|
||||
// The user edited last (empty) line, i.e. added new entry. We have to
|
||||
// add new empty line here so that adding one more line is still
|
||||
// possible:
|
||||
m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), wxEmptyString);
|
||||
|
||||
// Simulate a wxEVT_COMMAND_LIST_ITEM_SELECTED event for the new item,
|
||||
// so that the buttons are enabled/disabled properly
|
||||
wxListEvent selectionEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED, m_listCtrl->GetId());
|
||||
selectionEvent.m_itemIndex = event.GetIndex();
|
||||
m_listCtrl->GetEventHandler()->ProcessEvent(selectionEvent);
|
||||
}
|
||||
}
|
||||
|
||||
void wxEditableListBox::OnDelItem(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
m_listCtrl->DeleteItem(m_selection);
|
||||
m_listCtrl->SetItemState(m_selection,
|
||||
wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
|
||||
}
|
||||
|
||||
void wxEditableListBox::OnEditItem(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
m_listCtrl->EditLabel(m_selection);
|
||||
}
|
||||
|
||||
void wxEditableListBox::OnUpItem(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString t1, t2;
|
||||
|
||||
t1 = m_listCtrl->GetItemText(m_selection - 1);
|
||||
t2 = m_listCtrl->GetItemText(m_selection);
|
||||
m_listCtrl->SetItemText(m_selection - 1, t2);
|
||||
m_listCtrl->SetItemText(m_selection, t1);
|
||||
m_listCtrl->SetItemState(m_selection - 1,
|
||||
wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
|
||||
}
|
||||
|
||||
void wxEditableListBox::OnDownItem(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString t1, t2;
|
||||
|
||||
t1 = m_listCtrl->GetItemText(m_selection + 1);
|
||||
t2 = m_listCtrl->GetItemText(m_selection);
|
||||
m_listCtrl->SetItemText(m_selection + 1, t2);
|
||||
m_listCtrl->SetItemText(m_selection, t1);
|
||||
m_listCtrl->SetItemState(m_selection + 1,
|
||||
wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
/* XPM */
|
||||
static char * eldel_xpm[] = {
|
||||
"16 16 3 1",
|
||||
" c None",
|
||||
". c #7F0000",
|
||||
"+ c #FFFFFF",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ..+ ..+ ",
|
||||
" ....+ ..+ ",
|
||||
" ....+ ..+ ",
|
||||
" ...+ .+ ",
|
||||
" .....+ ",
|
||||
" ...+ ",
|
||||
" .....+ ",
|
||||
" ...+ ..+ ",
|
||||
" ...+ ..+ ",
|
||||
" ...+ .+ ",
|
||||
" ...+ .+ ",
|
||||
" . . ",
|
||||
" "};
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
/* XPM */
|
||||
static char * eldown_xpm[] = {
|
||||
"16 16 2 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
" ",
|
||||
" ",
|
||||
" ... ",
|
||||
" ... ",
|
||||
" ... ",
|
||||
" ... ",
|
||||
" ... ",
|
||||
" ... ",
|
||||
" ........... ",
|
||||
" ......... ",
|
||||
" ....... ",
|
||||
" ..... ",
|
||||
" ... ",
|
||||
" . ",
|
||||
" ",
|
||||
" "};
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
/* XPM */
|
||||
static char * eledit_xpm[] = {
|
||||
"16 16 3 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
"+ c #00007F",
|
||||
" ",
|
||||
" ",
|
||||
" .. .. ",
|
||||
" . ",
|
||||
" . ",
|
||||
" ++++ . ++++ ",
|
||||
" ++ . ++ ++",
|
||||
" +++++ . ++++++",
|
||||
" ++ ++ . ++ ",
|
||||
" ++ ++ . ++ ++",
|
||||
" +++++ . ++++ ",
|
||||
" . ",
|
||||
" . ",
|
||||
" .. .. ",
|
||||
" ",
|
||||
" "};
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
/* XPM */
|
||||
static char * elnew_xpm[] = {
|
||||
"16 16 5 1",
|
||||
" c None",
|
||||
". c #7F7F7F",
|
||||
"+ c #FFFFFF",
|
||||
"@ c #FFFF00",
|
||||
"# c #000000",
|
||||
" ",
|
||||
" ",
|
||||
" . .+ .@ ",
|
||||
" . .@.@# # # ",
|
||||
" @.@+.... # ",
|
||||
" ... @@ ",
|
||||
" @ . @. # ",
|
||||
" .# .@ ",
|
||||
" . # ",
|
||||
" # ",
|
||||
" # ",
|
||||
" # ",
|
||||
" # ",
|
||||
" # # # # # # ",
|
||||
" ",
|
||||
" "};
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
/* XPM */
|
||||
static char * elup_xpm[] = {
|
||||
"16 16 2 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
" ",
|
||||
" . ",
|
||||
" ... ",
|
||||
" ..... ",
|
||||
" ....... ",
|
||||
" ......... ",
|
||||
" ........... ",
|
||||
" ... ",
|
||||
" ... ",
|
||||
" ... ",
|
||||
" ... ",
|
||||
" ... ",
|
||||
" ... ",
|
||||
" ",
|
||||
" ",
|
||||
" "};
|
||||
|
|
@ -1,392 +0,0 @@
|
|||
// ============================================================================
|
||||
// headers
|
||||
// ============================================================================
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif //__BORLANDC__
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gizmos/ledctrl.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// A LED digit is build up like this, with maximum 7 Lines :
|
||||
//
|
||||
// 111
|
||||
// 6 2
|
||||
// 777
|
||||
// 5 3
|
||||
// 444
|
||||
//
|
||||
// Each number contains combinations of the lines, and they are set up below.
|
||||
|
||||
const int LINE1 = 1;
|
||||
const int LINE2 = 2;
|
||||
const int LINE3 = 4;
|
||||
const int LINE4 = 8;
|
||||
const int LINE5 = 16;
|
||||
const int LINE6 = 32;
|
||||
const int LINE7 = 64;
|
||||
const int DECIMALSIGN = 128;
|
||||
|
||||
const int DIGIT0 = LINE1 | LINE2 | LINE3 | LINE4 | LINE5 | LINE6;
|
||||
const int DIGIT1 = LINE2 | LINE3;
|
||||
const int DIGIT2 = LINE1 | LINE2 | LINE4 | LINE5 | LINE7;
|
||||
const int DIGIT3 = LINE1 | LINE2 | LINE3 | LINE4 | LINE7;
|
||||
const int DIGIT4 = LINE2 | LINE3 | LINE6 | LINE7;
|
||||
const int DIGIT5 = LINE1 | LINE3 | LINE4 | LINE6 | LINE7;
|
||||
const int DIGIT6 = LINE1 | LINE3 | LINE4 | LINE5 | LINE6 | LINE7;
|
||||
const int DIGIT7 = LINE1 | LINE2 | LINE3;
|
||||
const int DIGIT8 = LINE1 | LINE2 | LINE3 | LINE4 | LINE5 | LINE6 | LINE7;
|
||||
const int DIGIT9 = LINE1 | LINE2 | LINE3 | LINE6 | LINE7;
|
||||
const int DASH = LINE7;
|
||||
|
||||
const int DIGITALL = -1;
|
||||
|
||||
// ============================================================================
|
||||
// wxLEDNumberCtrl class implementation
|
||||
// ============================================================================
|
||||
|
||||
wxLEDNumberCtrl::wxLEDNumberCtrl()
|
||||
: m_Alignment(wxLED_ALIGN_LEFT),
|
||||
m_LineMargin(-1),
|
||||
m_DigitMargin(-1),
|
||||
m_LineLength(-1),
|
||||
m_LineWidth(-1),
|
||||
m_DrawFaded(false),
|
||||
m_LeftStartPos(-1)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
wxLEDNumberCtrl::wxLEDNumberCtrl(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
long style)
|
||||
: m_Alignment(wxLED_ALIGN_LEFT),
|
||||
m_LineMargin(-1),
|
||||
m_DigitMargin(-1),
|
||||
m_LineLength(-1),
|
||||
m_LineWidth(-1),
|
||||
m_DrawFaded(false),
|
||||
m_LeftStartPos(-1)
|
||||
{
|
||||
Create(parent, id, pos, size, style);
|
||||
}
|
||||
|
||||
|
||||
bool wxLEDNumberCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
long style)
|
||||
{
|
||||
bool RetVal = wxControl::Create(parent, id, pos, size, style);
|
||||
|
||||
if ((style & wxLED_DRAW_FADED) != 0)
|
||||
SetDrawFaded(true);
|
||||
if ((style & wxLED_ALIGN_MASK) != 0)
|
||||
SetAlignment((wxLEDValueAlign)(style & wxLED_ALIGN_MASK));
|
||||
|
||||
SetBackgroundColour(*wxBLACK);
|
||||
SetForegroundColour(*wxGREEN);
|
||||
|
||||
return RetVal;
|
||||
}
|
||||
|
||||
|
||||
void wxLEDNumberCtrl::SetAlignment(wxLEDValueAlign Alignment, bool Redraw)
|
||||
{
|
||||
if (Alignment != m_Alignment)
|
||||
{
|
||||
m_Alignment = Alignment;
|
||||
RecalcInternals(GetClientSize());
|
||||
|
||||
if (Redraw)
|
||||
Refresh(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void wxLEDNumberCtrl::SetDrawFaded(bool DrawFaded, bool Redraw)
|
||||
{
|
||||
if (DrawFaded != m_DrawFaded)
|
||||
{
|
||||
m_DrawFaded = DrawFaded;
|
||||
|
||||
if (Redraw)
|
||||
Refresh(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void wxLEDNumberCtrl::SetValue(wxString const &Value, bool Redraw)
|
||||
{
|
||||
if (Value != m_Value)
|
||||
{
|
||||
#ifdef __WXDEBUG__
|
||||
if (!Value.empty())
|
||||
{
|
||||
for(size_t i=0; i<Value.Length(); i++) {
|
||||
wxChar ch = Value[i];
|
||||
wxASSERT_MSG((ch>='0' && ch<='9') || ch=='-' || ch==' ' || ch=='.',
|
||||
wxT("wxLEDNumberCtrl can only display numeric string values."));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
m_Value = Value;
|
||||
RecalcInternals(GetClientSize());
|
||||
|
||||
if (Redraw)
|
||||
Refresh(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE(wxLEDNumberCtrl, wxControl)
|
||||
EVT_ERASE_BACKGROUND(wxLEDNumberCtrl::OnEraseBackground)
|
||||
EVT_PAINT(wxLEDNumberCtrl::OnPaint)
|
||||
EVT_SIZE(wxLEDNumberCtrl::OnSize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
void wxLEDNumberCtrl::OnEraseBackground(wxEraseEvent &WXUNUSED(event))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void wxLEDNumberCtrl::OnPaint(wxPaintEvent &WXUNUSED(event))
|
||||
{
|
||||
wxPaintDC Dc(this);
|
||||
|
||||
int Width, Height;
|
||||
GetClientSize(&Width, &Height);
|
||||
|
||||
wxBitmap *pMemoryBitmap = new wxBitmap(Width, Height);
|
||||
wxMemoryDC MemDc;
|
||||
|
||||
MemDc.SelectObject(*pMemoryBitmap);
|
||||
|
||||
// Draw background.
|
||||
MemDc.SetBrush(wxBrush(GetBackgroundColour(), wxSOLID));
|
||||
MemDc.DrawRectangle(wxRect(0, 0, Width, Height));
|
||||
MemDc.SetBrush(wxNullBrush);
|
||||
|
||||
// Iterate each digit in the value, and draw.
|
||||
const int DigitCount = m_Value.Len();
|
||||
for (int offset=0, i = 0; offset < DigitCount; ++offset, ++i)
|
||||
{
|
||||
wxChar c = m_Value.GetChar(offset);
|
||||
|
||||
// Draw faded lines if wanted.
|
||||
if (m_DrawFaded && (c != _T('.')))
|
||||
DrawDigit(MemDc, DIGITALL, i);
|
||||
|
||||
// Draw the digits.
|
||||
switch (c)
|
||||
{
|
||||
case _T('0') :
|
||||
DrawDigit(MemDc, DIGIT0, i);
|
||||
break;
|
||||
case _T('1') :
|
||||
DrawDigit(MemDc, DIGIT1, i);
|
||||
break;
|
||||
case _T('2') :
|
||||
DrawDigit(MemDc, DIGIT2, i);
|
||||
break;
|
||||
case _T('3') :
|
||||
DrawDigit(MemDc, DIGIT3, i);
|
||||
break;
|
||||
case _T('4') :
|
||||
DrawDigit(MemDc, DIGIT4, i);
|
||||
break;
|
||||
case _T('5') :
|
||||
DrawDigit(MemDc, DIGIT5, i);
|
||||
break;
|
||||
case _T('6') :
|
||||
DrawDigit(MemDc, DIGIT6, i);
|
||||
break;
|
||||
case _T('7') :
|
||||
DrawDigit(MemDc, DIGIT7, i);
|
||||
break;
|
||||
case _T('8') :
|
||||
DrawDigit(MemDc, DIGIT8, i);
|
||||
break;
|
||||
case _T('9') :
|
||||
DrawDigit(MemDc, DIGIT9, i);
|
||||
break;
|
||||
case _T('-') :
|
||||
DrawDigit(MemDc, DASH, i);
|
||||
break;
|
||||
case _T('.') :
|
||||
// Display the decimal in the previous segment
|
||||
i--;
|
||||
DrawDigit(MemDc, DECIMALSIGN, i);
|
||||
break;
|
||||
case _T(' ') :
|
||||
// just skip it
|
||||
break;
|
||||
default :
|
||||
wxFAIL_MSG(wxT("Unknown digit value"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Blit the memory dc to screen.
|
||||
Dc.Blit(0, 0, Width, Height, &MemDc, 0, 0, wxCOPY);
|
||||
delete pMemoryBitmap;
|
||||
}
|
||||
|
||||
|
||||
void wxLEDNumberCtrl::DrawDigit(wxDC &Dc, int Digit, int Column)
|
||||
{
|
||||
wxColour LineColor(GetForegroundColour());
|
||||
|
||||
if (Digit == DIGITALL)
|
||||
{
|
||||
const unsigned char R = (unsigned char)(LineColor.Red() / 16);
|
||||
const unsigned char G = (unsigned char)(LineColor.Green() / 16);
|
||||
const unsigned char B = (unsigned char)(LineColor.Blue() / 16);
|
||||
|
||||
LineColor.Set(R, G, B);
|
||||
}
|
||||
|
||||
int XPos = m_LeftStartPos + Column * (m_LineLength + m_DigitMargin);
|
||||
|
||||
// Create a pen and draw the lines.
|
||||
wxPen Pen(LineColor, m_LineWidth, wxSOLID);
|
||||
Dc.SetPen(Pen);
|
||||
|
||||
if ((Digit & LINE1))
|
||||
{
|
||||
Dc.DrawLine(XPos + m_LineMargin*2, m_LineMargin,
|
||||
XPos + m_LineLength + m_LineMargin*2, m_LineMargin);
|
||||
}
|
||||
|
||||
if (Digit & LINE2)
|
||||
{
|
||||
Dc.DrawLine(XPos + m_LineLength + m_LineMargin*3, m_LineMargin*2,
|
||||
XPos + m_LineLength + m_LineMargin*3, m_LineLength + (m_LineMargin*2));
|
||||
}
|
||||
|
||||
if (Digit & LINE3)
|
||||
{
|
||||
Dc.DrawLine(XPos + m_LineLength + m_LineMargin*3, m_LineLength + (m_LineMargin*4),
|
||||
XPos + m_LineLength + m_LineMargin*3, m_LineLength*2 + (m_LineMargin*4));
|
||||
}
|
||||
|
||||
if (Digit & LINE4)
|
||||
{
|
||||
Dc.DrawLine(XPos + m_LineMargin*2, m_LineLength*2 + (m_LineMargin*5),
|
||||
XPos + m_LineLength + m_LineMargin*2, m_LineLength*2 + (m_LineMargin*5));
|
||||
}
|
||||
|
||||
if (Digit & LINE5)
|
||||
{
|
||||
Dc.DrawLine(XPos + m_LineMargin, m_LineLength + (m_LineMargin*4),
|
||||
XPos + m_LineMargin, m_LineLength*2 + (m_LineMargin*4));
|
||||
}
|
||||
|
||||
if (Digit & LINE6)
|
||||
{
|
||||
Dc.DrawLine(XPos + m_LineMargin, m_LineMargin*2,
|
||||
XPos + m_LineMargin, m_LineLength + (m_LineMargin*2));
|
||||
}
|
||||
|
||||
if (Digit & LINE7)
|
||||
{
|
||||
Dc.DrawLine(XPos + m_LineMargin*2, m_LineLength + (m_LineMargin*3),
|
||||
XPos + m_LineMargin*2 + m_LineLength, m_LineLength + (m_LineMargin*3));
|
||||
}
|
||||
|
||||
if (Digit & DECIMALSIGN)
|
||||
{
|
||||
Dc.DrawLine(XPos + m_LineLength + m_LineMargin*4, m_LineLength*2 + (m_LineMargin*5),
|
||||
XPos + m_LineLength + m_LineMargin*4, m_LineLength*2 + (m_LineMargin*5));
|
||||
}
|
||||
|
||||
Dc.SetPen(wxNullPen);
|
||||
}
|
||||
|
||||
|
||||
void wxLEDNumberCtrl::RecalcInternals(const wxSize &CurrentSize)
|
||||
{
|
||||
// Dimensions of LED segments
|
||||
//
|
||||
// Size of character is based on the HEIGH of the widget, NOT the width.
|
||||
// Segment height is calculated as follows:
|
||||
// Each segment is m_LineLength pixels long.
|
||||
// There is m_LineMargin pixels at the top and bottom of each line segment
|
||||
// There is m_LineMargin pixels at the top and bottom of each digit
|
||||
//
|
||||
// Therefore, the heigth of each character is:
|
||||
// m_LineMargin : Top digit boarder
|
||||
// m_LineMargin+m_LineLength+m_LineMargin : Top half of segment
|
||||
// m_LineMargin+m_LineLength+m_LineMargin : Bottom half of segment
|
||||
// m_LineMargin : Bottom digit boarder
|
||||
// ----------------------
|
||||
// m_LineMargin*6 + m_LineLength*2 == Total height of digit.
|
||||
// Therefore, (m_LineMargin*6 + m_LineLength*2) must equal Height
|
||||
//
|
||||
// Spacing between characters can then be calculated as follows:
|
||||
// m_LineMargin : before the digit,
|
||||
// m_LineMargin+m_LineLength+m_LineMargin : for the digit width
|
||||
// m_LineMargin : after the digit
|
||||
// = m_LineMargin*4 + m_LineLength
|
||||
const int Height = CurrentSize.GetHeight();
|
||||
|
||||
if ((Height * 0.075) < 1)
|
||||
m_LineMargin = 1;
|
||||
else
|
||||
m_LineMargin = (int)(Height * 0.075);
|
||||
|
||||
if ((Height * 0.275) < 1)
|
||||
m_LineLength = 1;
|
||||
else
|
||||
m_LineLength = (int)(Height * 0.275);
|
||||
|
||||
m_LineWidth = m_LineMargin;
|
||||
|
||||
m_DigitMargin = m_LineMargin * 4;
|
||||
|
||||
// Count the number of characters in the string; '.' characters are not
|
||||
// included because they do not take up space in the display
|
||||
int count = 0;
|
||||
for (unsigned int i = 0; i < m_Value.Len(); i++)
|
||||
if (m_Value.GetChar(i) != '.')
|
||||
count++;
|
||||
const int ValueWidth = (m_LineLength + m_DigitMargin) * count;
|
||||
const int ClientWidth = CurrentSize.GetWidth();
|
||||
|
||||
switch (m_Alignment)
|
||||
{
|
||||
case wxLED_ALIGN_LEFT :
|
||||
m_LeftStartPos = m_LineMargin;
|
||||
break;
|
||||
case wxLED_ALIGN_RIGHT :
|
||||
m_LeftStartPos = ClientWidth - ValueWidth - m_LineMargin;
|
||||
break;
|
||||
case wxLED_ALIGN_CENTER :
|
||||
m_LeftStartPos = (ClientWidth - ValueWidth) / 2;
|
||||
break;
|
||||
default :
|
||||
wxFAIL_MSG(wxT("Unknown alignent value for wxLEDNumberCtrl."));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void wxLEDNumberCtrl::OnSize(wxSizeEvent &Event)
|
||||
{
|
||||
RecalcInternals(Event.GetSize());
|
||||
|
||||
Event.Skip();
|
||||
}
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
#
|
||||
# File: makefile.vc
|
||||
WXDIR=$(WXWIN)
|
||||
|
||||
NAME=gizmos
|
||||
WAITFLAG=/WAIT
|
||||
DOCSOURCEDIR=$(WXDIR)\contrib\docs\latex\$(NAME)
|
||||
DOCDIR=$(WXDIR)\docs
|
||||
THISDIR = $(WXDIR)\contrib\src\$(NAME)
|
||||
DOCSOURCES=$(DOCSOURCEDIR)\manual.tex \
|
||||
$(DOCSOURCEDIR)\classes.tex $(DOCSOURCEDIR)\topics.tex
|
||||
|
||||
alldocs: mkdirs html htmlhelp htb hlp pdfrtf
|
||||
html: touchmanual $(DOCDIR)\html\$(NAME)\$(NAME).htm
|
||||
htmlhelp: touchmanual $(DOCDIR)\htmlhelp\$(NAME).chm
|
||||
htb: $(DOCDIR)\htb\$(NAME).htb
|
||||
hlp: touchmanual $(DOCDIR)\winhelp\$(NAME).hlp
|
||||
pdfrtf: $(DOCDIR)\pdf\$(NAME).rtf
|
||||
ps: $(DOCDIR)\ps\$(NAME).ps
|
||||
|
||||
touchmanual:
|
||||
touch $(DOCSOURCEDIR)\manual.tex
|
||||
|
||||
$(DOCDIR)\winhelp\$(NAME).hlp: $(DOCSOURCEDIR)\$(NAME).rtf $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
cd $(DOCSOURCEDIR)
|
||||
-erase $(NAME).ph
|
||||
hcw /c /e $(NAME)
|
||||
move $(NAME).hlp $(DOCDIR)\winhelp\$(NAME).hlp
|
||||
move $(NAME).cnt $(DOCDIR)\winhelp\$(NAME).cnt
|
||||
cd $(THISDIR)
|
||||
|
||||
$(DOCSOURCEDIR)\$(NAME).hpj:
|
||||
echo [OPTIONS] > $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
echo BMROOT=$(WXDIR)\contrib\docs\latex\$(NAME) >> $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
echo TITLE=OGL Manual >> $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
echo CONTENTS=Contents >> $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
echo COMPRESS=HIGH >> $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
echo "" >> $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
echo [FILES] >> $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
echo $(NAME).rtf >> $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
echo "" >> $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
echo [CONFIG] >> $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
echo CreateButton("Up", "&Up", "JumpId(`$(NAME).hlp', `Contents')") >> $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
echo BrowseButtons() >> $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
echo "" >> $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
echo [MAP] >> $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
echo "" >> $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
echo [BITMAPS] >> $(DOCSOURCEDIR)\$(NAME).hpj
|
||||
|
||||
$(DOCSOURCEDIR)\$(NAME).rtf: $(DOCSOURCES)
|
||||
cd $(DOCSOURCEDIR)
|
||||
-start $(WAITFLAG) tex2rtf $(DOCSOURCEDIR)\manual.tex $(DOCSOURCEDIR)\$(NAME).rtf -twice -winhelp
|
||||
cd $(THISDIR)
|
||||
|
||||
$(DOCDIR)\pdf\$(NAME).rtf: $(DOCSOURCES)
|
||||
cd $(DOCSOURCEDIR)
|
||||
-copy *.bmp $(DOCDIR)\pdf
|
||||
-start $(WAITFLAG) tex2rtf $(DOCSOURCEDIR)\manual.tex $(DOCDIR)\pdf\$(NAME).rtf -twice -rtf
|
||||
cd $(THISDIR)
|
||||
|
||||
$(DOCDIR)\html\$(NAME)\$(NAME).htm: $(DOCSOURCES)
|
||||
cd $(DOCSOURCEDIR)
|
||||
-mkdir $(DOCDIR)\html\$(NAME)
|
||||
copy *.gif $(DOCDIR)\html\$(NAME)
|
||||
-start $(WAITFLAG) tex2rtf $(DOCSOURCEDIR)\manual.tex $(DOCDIR)\html\$(NAME)\$(NAME) -html -twice
|
||||
-erase $(DOCDIR)\html\$(NAME)\*.con
|
||||
-erase *.con
|
||||
-erase $(DOCDIR)\html\$(NAME)\*.ref
|
||||
cd $(THISDIR)
|
||||
|
||||
$(DOCDIR)\htmlhelp\$(NAME).chm: $(DOCDIR)\html\$(NAME)\$(NAME).htm $(DOCDIR)\html\$(NAME)\$(NAME).hhp
|
||||
cd $(DOCDIR)\html\$(NAME)
|
||||
-hhc $(NAME).hhp
|
||||
-erase $(DOCDIR)\htmlhelp\$(NAME).chm
|
||||
move $(NAME).chm $(DOCDIR)\htmlhelp\$(NAME).chm
|
||||
cd $(THISDIR)
|
||||
|
||||
# An htb file is a zip file containing the .htm, .gif, .hhp, .hhc and .hhk
|
||||
# files, renamed to htb.
|
||||
# This can then be used with e.g. helpview.
|
||||
# Optionally, a cached version of the .hhp file can be generated with hhp2cached.
|
||||
$(DOCDIR)\htb\$(NAME).htb: $(DOCDIR)\html\$(NAME)\$(NAME).htm
|
||||
cd $(DOCDIR)\html\$(NAME)
|
||||
-erase $(NAME).zip $(NAME).htb
|
||||
zip $(NAME).zip *.htm *.gif *.hhp *.hhc *.hhk
|
||||
-mkdir $(DOCDIR)\htb
|
||||
-erase $(DOCDIR)\htb\$(NAME).htb
|
||||
-erase $(DOCDIR)\htb\$(NAME).htb
|
||||
move $(NAME).zip $(DOCDIR)\htb\$(NAME).htb
|
||||
cd $(THISDIR)
|
||||
|
||||
$(DOCSOURCEDIR)\$(NAME).dvi: $(DOCSOURCES)
|
||||
cd $(DOCSOURCEDIR)
|
||||
-latex $(NAME)
|
||||
-latex $(NAME)
|
||||
-makeindx $(NAME)
|
||||
-bibtex $(NAME)
|
||||
-latex $(NAME)
|
||||
-latex $(NAME)
|
||||
cd $(THISDIR)
|
||||
|
||||
$(WXDIR)\docs\ps\$(NAME).ps: $(DOCSOURCEDIR)\$(NAME).dvi
|
||||
cd $(DOCSOURCEDIR)
|
||||
-dvips32 -o $(NAME).ps $(NAME)
|
||||
move $(NAME).ps $(WXDIR)\docs\ps\$(NAME).ps
|
||||
cd $(THISDIR)
|
||||
|
||||
|
|
@ -1,653 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: multicell.cpp
|
||||
// Purpose: provide two new classes for layout, wxMultiCellSizer and wxMultiCellCanvas
|
||||
// Author: Jonathan Bayer
|
||||
// Modified by:
|
||||
// Created:
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Jonathan Bayer
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This was inspired by the gbsizer class written by Alex Andruschak
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gizmos/multicell.h"
|
||||
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxMultiCellSizer, wxSizer);
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxMultiCellItemHandle, wxObject);
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// wxMultiCellItemHandle
|
||||
//---------------------------------------------------------------------------
|
||||
/*
|
||||
*Function Name: wxMultiCellItemHandle :: wxMultiCellItemHandle
|
||||
*
|
||||
*Parameters: int row
|
||||
* int column
|
||||
* int height
|
||||
* int width
|
||||
* wxSize size
|
||||
* wxResizable Style
|
||||
* wxSize weight
|
||||
* int align
|
||||
*
|
||||
*Description: This is the constructor for the class.
|
||||
*
|
||||
*/
|
||||
|
||||
void wxMultiCellItemHandle :: Initialize( int row, int column, int height, int width, wxSize size, wxResizable Style, wxSize weight, int align)
|
||||
{
|
||||
m_column = column;
|
||||
m_row = row;
|
||||
m_width = width;
|
||||
m_height = height;
|
||||
|
||||
m_style = Style;
|
||||
m_fixedSize = size;
|
||||
m_alignment = align;
|
||||
m_weight = weight;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
wxMultiCellItemHandle :: wxMultiCellItemHandle( int row, int column, int height, int width, wxSize size, wxResizable Style, wxSize weight, int align)
|
||||
{
|
||||
Initialize(row, column,height, width, size, Style, weight, align);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
wxMultiCellItemHandle :: wxMultiCellItemHandle( int row, int column, wxSize size, wxResizable style, wxSize weight, int align)
|
||||
{
|
||||
Initialize(row, column,1, 1, size, style, weight, align);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
wxMultiCellItemHandle :: wxMultiCellItemHandle( int row, int column, wxResizable style, wxSize weight, int align)
|
||||
{
|
||||
Initialize(row, column, 1, 1, wxSize(1, 1), style, weight, align);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
int wxMultiCellItemHandle::GetColumn() const
|
||||
{
|
||||
return m_column;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
int wxMultiCellItemHandle::GetRow() const
|
||||
{
|
||||
return m_row;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
int wxMultiCellItemHandle::GetWidth() const
|
||||
{
|
||||
return m_width;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
int wxMultiCellItemHandle::GetHeight() const
|
||||
{
|
||||
return m_height;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
wxResizable wxMultiCellItemHandle :: GetStyle() const
|
||||
{
|
||||
return m_style;
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
wxSize wxMultiCellItemHandle :: GetLocalSize() const
|
||||
{
|
||||
return m_fixedSize;
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
int wxMultiCellItemHandle :: GetAlignment() const
|
||||
{
|
||||
return m_alignment;
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
wxSize wxMultiCellItemHandle :: GetWeight() const
|
||||
{
|
||||
return m_weight;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// wxMultiCellSizer
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
*Function Name: wxMultiCellSizer::Initialize
|
||||
*
|
||||
*Parameters: wxsize Initial size of sizer
|
||||
*
|
||||
*Description: This is a common function to initialize all the members of
|
||||
* this class. It is only called from the constructors
|
||||
*
|
||||
*/
|
||||
|
||||
void wxMultiCellSizer::Initialize( wxSize size )
|
||||
{
|
||||
m_cell_count = size;
|
||||
m_maxHeight = (int *)malloc((1 + m_cell_count.GetHeight()) * sizeof(int));
|
||||
m_maxWidth = (int *)malloc( (1 + m_cell_count.GetWidth()) * sizeof(int));
|
||||
m_rowStretch = (int *)malloc( (1 + m_cell_count.GetHeight()) * sizeof(int));
|
||||
m_colStretch = (int *)malloc((1 + m_cell_count.GetWidth()) * sizeof(int));
|
||||
|
||||
m_weights = (wxSize **)malloc((1 + wxMax(m_cell_count.GetHeight(), m_cell_count.GetWidth())) * sizeof(wxSize *));
|
||||
m_minSizes = (wxSize **)malloc((1 + wxMax(m_cell_count.GetHeight(), m_cell_count.GetWidth())) * sizeof(wxSize *));
|
||||
for (int x = 0; x < 1 + wxMax(m_cell_count.GetHeight(), m_cell_count.GetWidth()); x++)
|
||||
{
|
||||
m_weights[x] = new wxSize(0,0);
|
||||
m_minSizes[x] = new wxSize(0,0);
|
||||
}
|
||||
|
||||
m_maxWeights = 1 + wxMax(m_cell_count.GetHeight(), m_cell_count.GetWidth());
|
||||
m_defaultCellSize = wxSize(5, 5);
|
||||
m_win = NULL;
|
||||
m_pen = wxRED_PEN;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
wxMultiCellSizer::wxMultiCellSizer( wxSize & size )
|
||||
{
|
||||
Initialize(size);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
wxMultiCellSizer::wxMultiCellSizer( int rows, int cols)
|
||||
{
|
||||
wxSize size(cols, rows);
|
||||
Initialize(size);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
wxMultiCellSizer::~wxMultiCellSizer()
|
||||
{
|
||||
WX_CLEAR_LIST(wxSizerItemList, m_children);
|
||||
|
||||
free(m_maxHeight);
|
||||
free(m_maxWidth);
|
||||
free(m_rowStretch);
|
||||
free(m_colStretch);
|
||||
|
||||
for (int x = 0; x < 1 + wxMax(m_cell_count.GetHeight(), m_cell_count.GetWidth()); x++)
|
||||
{
|
||||
delete m_weights[x];
|
||||
delete m_minSizes[x];
|
||||
}
|
||||
free(m_weights);
|
||||
free(m_minSizes);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
bool wxMultiCellSizer::EnableGridLines(wxWindow *win)
|
||||
{
|
||||
m_win = win;
|
||||
return true;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
bool wxMultiCellSizer::SetGridPen(const wxPen *pen)
|
||||
{
|
||||
m_pen = pen;
|
||||
return true;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
bool wxMultiCellSizer::SetDefaultCellSize(wxSize size)
|
||||
{
|
||||
m_defaultCellSize = size;
|
||||
return true;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
bool wxMultiCellSizer::SetColumnWidth(int column, int colSize, bool expandable)
|
||||
{
|
||||
if (expandable)
|
||||
{
|
||||
m_minSizes[column]->SetWidth(-colSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_minSizes[column]->SetWidth(colSize);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
bool wxMultiCellSizer::SetRowHeight(int row, int rowSize, bool expandable)
|
||||
{
|
||||
if (expandable)
|
||||
{
|
||||
m_minSizes[row]->SetHeight(-rowSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_minSizes[row]->SetHeight(rowSize);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void wxMultiCellSizer::RecalcSizes()
|
||||
{
|
||||
if (m_children.GetCount() == 0)
|
||||
return;
|
||||
wxSize size = GetSize();
|
||||
wxPoint pos = GetPosition();
|
||||
|
||||
GetMinimums();
|
||||
|
||||
// We need to take the unused space and equally give it out to all the rows/columns
|
||||
// which are stretchable
|
||||
|
||||
int unUsedWidth = size.GetWidth() - Sum(m_maxWidth, m_cell_count.GetWidth());
|
||||
int unUsedHeight = size.GetHeight() - Sum(m_maxHeight, m_cell_count.GetHeight());
|
||||
int totalWidthWeight = 0;
|
||||
int totalHeightWeight = 0;
|
||||
int x;
|
||||
|
||||
for (x = 0; x < wxMax(m_cell_count.GetHeight(), m_cell_count.GetWidth()); x++)
|
||||
{
|
||||
if (m_rowStretch[x])
|
||||
{
|
||||
totalHeightWeight += m_weights[x]->GetHeight();
|
||||
}
|
||||
if (x < m_cell_count.GetWidth() && m_colStretch[x])
|
||||
{
|
||||
totalWidthWeight += m_weights[x]->GetWidth();
|
||||
}
|
||||
}
|
||||
for (x = 0; x < wxMax(m_cell_count.GetHeight(), m_cell_count.GetWidth()); x++)
|
||||
{
|
||||
if (x < m_cell_count.GetHeight() && m_rowStretch[x])
|
||||
{
|
||||
m_maxHeight[x] += unUsedHeight * m_weights[x]->GetHeight() / totalHeightWeight;
|
||||
}
|
||||
if (x < m_cell_count.GetWidth() && m_colStretch[x])
|
||||
{
|
||||
m_maxWidth[x] += unUsedWidth * m_weights[x]->GetWidth() / totalWidthWeight;
|
||||
}
|
||||
}
|
||||
// We now have everything we need to figure each cell position and size
|
||||
// The arrays m_maxHeight and m_maxWidth now contain the final widths and height of
|
||||
// each row and column.
|
||||
|
||||
double cell_width = (double)size.GetWidth() / (double)m_cell_count.GetWidth();
|
||||
double cell_height = (double)size.GetHeight() / (double)m_cell_count.GetHeight();
|
||||
wxPoint c_point;
|
||||
wxSize c_size;
|
||||
|
||||
wxSizerItemList::compatibility_iterator current = m_children.GetFirst();
|
||||
while (current)
|
||||
{
|
||||
wxSizerItem *item = current->GetData();
|
||||
|
||||
wxMultiCellItemHandle *rect;
|
||||
if (item != NULL &&
|
||||
(rect = (wxMultiCellItemHandle *)item->GetUserData()) != NULL)
|
||||
{
|
||||
c_point.x = pos.x + (int)(rect->GetColumn() * cell_width);
|
||||
c_point.y = pos.y + (int)(rect->GetRow() * cell_height);
|
||||
|
||||
c_point.x = pos.x + Sum(m_maxWidth, rect->GetColumn());
|
||||
c_point.y = pos.y + Sum(m_maxHeight, rect->GetRow());
|
||||
|
||||
|
||||
c_size = rect->GetLocalSize();
|
||||
wxSize minSize( item->CalcMin() );
|
||||
if (c_size.GetHeight() != wxDefaultCoord ||
|
||||
c_size.GetWidth() != wxDefaultCoord)
|
||||
{
|
||||
minSize.SetHeight(wxMax(minSize.GetHeight(), c_size.GetHeight()));
|
||||
minSize.SetWidth(wxMax(minSize.GetWidth(), c_size.GetWidth()));
|
||||
}
|
||||
if (rect->GetStyle() & wxHORIZONTAL_RESIZABLE ||
|
||||
rect->GetWidth() > 1
|
||||
|| m_minSizes[rect->GetColumn()]->GetWidth() < 0)
|
||||
{
|
||||
int w = 0;
|
||||
for (int x = 0; x < rect->GetWidth(); x++)
|
||||
{
|
||||
w += m_maxWidth[rect->GetColumn() + x];
|
||||
}
|
||||
c_size.SetWidth(w);
|
||||
}
|
||||
else
|
||||
{
|
||||
c_size.SetWidth(minSize.GetWidth() );
|
||||
}
|
||||
if (rect->GetStyle() & wxVERTICAL_RESIZABLE ||
|
||||
rect->GetHeight() > 1 ||
|
||||
m_minSizes[rect->GetRow()]->GetHeight() < 0)
|
||||
{
|
||||
int h = 0;
|
||||
for (int x = 0; x < rect->GetHeight(); x++)
|
||||
{
|
||||
h += m_maxHeight[rect->GetRow() + x];
|
||||
}
|
||||
c_size.SetHeight(h);
|
||||
}
|
||||
else
|
||||
{
|
||||
c_size.SetHeight(minSize.GetHeight());
|
||||
}
|
||||
int extraHeight = (m_maxHeight[rect->GetRow()] - c_size.GetHeight());
|
||||
int extraWidth = (m_maxWidth[rect->GetColumn()] - c_size.GetWidth());
|
||||
|
||||
if (rect->GetWidth() == 1 && rect->GetAlignment() & wxALIGN_CENTER_HORIZONTAL)
|
||||
{
|
||||
c_point.x += extraWidth / 2;
|
||||
}
|
||||
if (rect->GetWidth() == 1 && rect->GetAlignment() & wxALIGN_RIGHT)
|
||||
{
|
||||
c_point.x += extraWidth;
|
||||
}
|
||||
if (rect->GetHeight() == 1 && rect->GetAlignment() & wxALIGN_CENTER_VERTICAL)
|
||||
{
|
||||
c_point.y += extraHeight / 2;
|
||||
}
|
||||
if (rect->GetHeight() == 1 && rect->GetAlignment() & wxALIGN_BOTTOM)
|
||||
{
|
||||
c_point.y += extraHeight;
|
||||
}
|
||||
item->SetDimension(c_point, c_size);
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
wxSize wxMultiCellSizer::CalcMin()
|
||||
{
|
||||
if (m_children.GetCount() == 0)
|
||||
return wxSize(10,10);
|
||||
|
||||
GetMinimums();
|
||||
int m_minWidth = Sum(m_maxWidth, m_cell_count.GetWidth());
|
||||
int m_minHeight = Sum(m_maxHeight, m_cell_count.GetHeight());
|
||||
return wxSize( m_minWidth, m_minHeight );
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void wxMultiCellSizer :: GetMinimums()
|
||||
{
|
||||
// We first initial all the arrays EXCEPT for the m_minsizes array.
|
||||
|
||||
memset(m_maxHeight, 0, sizeof(int) * m_cell_count.GetHeight());
|
||||
memset(m_maxWidth, 0, sizeof(int) * m_cell_count.GetWidth());
|
||||
memset(m_rowStretch, 0, sizeof(int) * m_cell_count.GetHeight());
|
||||
memset(m_colStretch, 0, sizeof(int) * m_cell_count.GetWidth());
|
||||
for (int x = 0; x < 1 + wxMax(m_cell_count.GetHeight(), m_cell_count.GetWidth()); x++)
|
||||
{
|
||||
m_weights[x]->SetHeight(0);
|
||||
m_weights[x]->SetWidth(0);
|
||||
}
|
||||
|
||||
wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxSizerItem *item = node->GetData();
|
||||
wxMultiCellItemHandle *rect;
|
||||
if (item != NULL &&
|
||||
(rect = (wxMultiCellItemHandle *)item->GetUserData()) != NULL)
|
||||
{
|
||||
int row = rect->GetRow();
|
||||
int col = rect->GetColumn();
|
||||
|
||||
// First make sure that the control knows about the max rows and columns
|
||||
|
||||
int changed = false;
|
||||
if (row + 1 > m_cell_count.GetHeight())
|
||||
{
|
||||
changed++;
|
||||
m_maxHeight = (int *)realloc(m_maxHeight, (1 + row) * sizeof(int));
|
||||
m_rowStretch = (int *)realloc(m_rowStretch, (1 + row) * sizeof(int));
|
||||
for (int x = m_cell_count.GetHeight(); x < row + 1; x++)
|
||||
{
|
||||
m_maxHeight[x - 1] = 0;
|
||||
m_rowStretch[x - 1] = 0;
|
||||
}
|
||||
m_cell_count.SetHeight(row + 1);
|
||||
}
|
||||
if (col + 1 > m_cell_count.GetWidth())
|
||||
{
|
||||
changed++;
|
||||
m_maxWidth = (int *)realloc(m_maxWidth, (1 + col) * sizeof(int));
|
||||
m_colStretch = (int *)realloc(m_colStretch, ( 1 + col) * sizeof(int));
|
||||
for (int x = m_cell_count.GetWidth(); x < col + 1; x++)
|
||||
{
|
||||
m_maxWidth[x - 1] = 0;
|
||||
m_colStretch[x - 1] = 0;
|
||||
}
|
||||
m_cell_count.SetWidth(col + 1);
|
||||
}
|
||||
if (changed)
|
||||
{
|
||||
m_weights = (wxSize **)realloc(m_weights, (1 + wxMax(m_cell_count.GetHeight(), m_cell_count.GetWidth())) * sizeof(wxSize *));
|
||||
m_minSizes = (wxSize **)realloc(m_minSizes, (1 + wxMax(m_cell_count.GetHeight(), m_cell_count.GetWidth())) * sizeof(wxSize *));
|
||||
for (int x = m_maxWeights; x < 1 + wxMax(m_cell_count.GetHeight(), m_cell_count.GetWidth()); x++)
|
||||
{
|
||||
m_weights[x - 1] = new wxSize(0,0);
|
||||
m_minSizes[x - 1] = new wxSize(0,0);
|
||||
}
|
||||
m_maxWeights = 1 + wxMax(m_cell_count.GetHeight(), m_cell_count.GetWidth());
|
||||
}
|
||||
|
||||
// Sum the m_weights for each row/column, but only if they are resizable
|
||||
|
||||
wxSize minSize( item->CalcMin() );
|
||||
wxSize c_size = rect->GetLocalSize();
|
||||
if (c_size.GetHeight() != wxDefaultCoord ||
|
||||
c_size.GetWidth() != wxDefaultCoord)
|
||||
{
|
||||
minSize.SetHeight(wxMax(minSize.GetHeight(), c_size.GetHeight()));
|
||||
minSize.SetWidth(wxMax(minSize.GetWidth(), c_size.GetWidth()));
|
||||
}
|
||||
|
||||
// For each row, calculate the max height for those fields which are not
|
||||
// resizable in the vertical pane
|
||||
|
||||
if (!(rect->GetStyle() & wxVERTICAL_RESIZABLE || m_minSizes[row]->GetHeight() < 0))
|
||||
{
|
||||
m_maxHeight[row] = wxMax(m_maxHeight[row], minSize.GetHeight() / rect->GetHeight());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_rowStretch[row] = 1;
|
||||
if (m_minSizes[row]->GetHeight())
|
||||
{
|
||||
m_maxHeight[row] = abs(m_minSizes[row]->GetHeight());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_maxHeight[row] = wxMax(m_maxHeight[row], m_defaultCellSize.GetHeight());
|
||||
}
|
||||
m_weights[row]->SetHeight(wxMax(m_weights[row]->GetHeight(), rect->GetWeight().GetHeight()));
|
||||
}
|
||||
|
||||
// For each column, calculate the max width for those fields which are not
|
||||
// resizable in the horizontal pane
|
||||
|
||||
if (!(rect->GetStyle() & wxHORIZONTAL_RESIZABLE || m_minSizes[col]->GetWidth() < 0))
|
||||
{
|
||||
if (m_minSizes[col]->GetWidth())
|
||||
{
|
||||
m_maxWidth[col] = abs(m_minSizes[col]->GetWidth());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_maxWidth[col] = wxMax(m_maxWidth[col], minSize.GetWidth() / rect->GetWidth());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_colStretch[col] = 1;
|
||||
m_maxWidth[col] = wxMax(m_maxWidth[col], m_defaultCellSize.GetWidth());
|
||||
m_weights[col]->SetWidth(wxMax(m_weights[col]->GetWidth(), rect->GetWeight().GetWidth()));
|
||||
}
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
} // wxMultiCellSizer :: GetMinimums
|
||||
//---------------------------------------------------------------------------
|
||||
/*
|
||||
*Function Name: wxMultiCellSizer :: Sum
|
||||
*
|
||||
*Parameters: int* pointer to array of ints
|
||||
* int Number of cells to sum up
|
||||
*
|
||||
*Description: This member function sums up all the elements of the array which
|
||||
* preceed the specified cell.
|
||||
*
|
||||
*Returns: int Sum
|
||||
*
|
||||
*/
|
||||
|
||||
/* static */ int wxMultiCellSizer :: Sum(int *array, int x)
|
||||
{
|
||||
int sum = 0;
|
||||
while (x--)
|
||||
{
|
||||
sum += array[x];
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
/*
|
||||
*Function Name: wxMultiCellSizer :: DrawGridLines
|
||||
*
|
||||
*Parameters: wxDC Device context
|
||||
*
|
||||
*Description: This function draws the grid lines in the specified device context.
|
||||
*
|
||||
*/
|
||||
|
||||
void wxMultiCellSizer :: DrawGridLines(wxDC& dc)
|
||||
{
|
||||
RecalcSizes();
|
||||
int maxW = Sum(m_maxWidth, m_cell_count.GetWidth());
|
||||
int maxH = Sum(m_maxHeight, m_cell_count.GetHeight());
|
||||
int x;
|
||||
|
||||
// Draw the columns
|
||||
dc.SetPen(* m_pen);
|
||||
for (x = 1; x < m_cell_count.GetWidth(); x++)
|
||||
{
|
||||
int colPos = Sum(m_maxWidth, x) ;
|
||||
dc.DrawLine(colPos, 0, colPos, maxH);
|
||||
}
|
||||
|
||||
// Draw the rows
|
||||
for (x = 1; x < m_cell_count.GetHeight(); x++)
|
||||
{
|
||||
int rowPos = Sum(m_maxHeight, x);
|
||||
dc.DrawLine(0, rowPos, maxW, rowPos);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// Define the repainting behaviour
|
||||
/*
|
||||
*Function Name: wxMultiCellSizer::OnPaint
|
||||
*
|
||||
*Parameters: wxDC Device context
|
||||
*
|
||||
*Description: This function calls the DrawGridLines() member if a window
|
||||
* has been previously specified. This functions MUST be called
|
||||
* from an OnPaint member belonging to the window which the sizer
|
||||
* is attached to.
|
||||
*
|
||||
*/
|
||||
|
||||
void wxMultiCellSizer::OnPaint(wxDC& dc )
|
||||
{
|
||||
if (m_win)
|
||||
{
|
||||
DrawGridLines(dc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
#define CELL_LOC(row, col) ((row) * m_maxCols + col)
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// wxCell
|
||||
//---------------------------------------------------------------------------
|
||||
/*
|
||||
*Function Name: wxCell : wxLayoutConstraints
|
||||
*
|
||||
*Description: This class is used by wxMultiCellCanvas for internal storage
|
||||
*
|
||||
*/
|
||||
|
||||
class wxCell : public wxLayoutConstraints
|
||||
{
|
||||
public:
|
||||
wxCell(wxWindow *win)
|
||||
{
|
||||
m_window = win;
|
||||
};
|
||||
|
||||
wxWindow *m_window;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// wxMultiCellCanvas
|
||||
//---------------------------------------------------------------------------
|
||||
wxMultiCellCanvas :: wxMultiCellCanvas(wxWindow *par, int numRows, int numCols)
|
||||
: wxFlexGridSizer(numRows, numCols, 0, 0)
|
||||
{
|
||||
m_cells = (wxCell **)calloc(numRows * numCols, sizeof(wxCell *));
|
||||
|
||||
m_parent = par;
|
||||
m_maxRows = numRows;
|
||||
m_maxCols = numCols;
|
||||
m_minCellSize = wxSize(5, 5);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void wxMultiCellCanvas :: Add(wxWindow *win, unsigned int row, unsigned int col)
|
||||
{
|
||||
// thanks to unsigned data row and col are always >= 0
|
||||
wxASSERT_MSG( /* row >= 0 && */ row < m_maxRows,
|
||||
wxString::Format(_T("Row %d out of bounds (0..%d)"), row, m_maxRows) );
|
||||
wxASSERT_MSG( /* col >= 0 && */ col < m_maxCols,
|
||||
wxString::Format(_T("Column %d out of bounds (0..%d)"), col, m_maxCols) );
|
||||
|
||||
wxASSERT_MSG(m_cells[CELL_LOC(row, col)] == NULL, wxT("Cell already occupied"));
|
||||
|
||||
wxCell *newCell = new wxCell(win);
|
||||
m_cells[CELL_LOC(row,col)] = newCell;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void wxMultiCellCanvas :: CalculateConstraints()
|
||||
{
|
||||
unsigned int row, col;
|
||||
for (row = 0; row < m_maxRows; row++)
|
||||
{
|
||||
for (col = 0; col < m_maxCols; col++)
|
||||
{
|
||||
if (!m_cells[CELL_LOC(row, col)])
|
||||
{
|
||||
// Create an empty static text field as a placeholder
|
||||
m_cells[CELL_LOC(row, col)] = new wxCell(new wxStaticText(m_parent, wxID_ANY, wxEmptyString));
|
||||
}
|
||||
wxFlexGridSizer::Add(m_cells[CELL_LOC(row, col)]->m_window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*** End of File ***/
|
||||
|
|
@ -1,130 +0,0 @@
|
|||
These two classes make it easier to lay objects out on a screen. The
|
||||
first class is the wxMultiCellCanvas, which uses the wxFlexGridSizer
|
||||
control, so it is subject to the same limitations of that control. Among
|
||||
them is the fact that if the window is resized smaller than the control,
|
||||
then some of the objects will be obscured by the window edge.
|
||||
|
||||
The second class is the wxMultiCellSizer, which is significantly more
|
||||
powerful than the wxMultiCell Canvas. This control supports resizing of
|
||||
objects on the fly, objects spanning cells, etc.
|
||||
|
||||
Use the wxMultiCellCanvas when you have a simple layout which won't resize
|
||||
and doesn't have any unusual requirements. Use the wxMultiCellSizer when
|
||||
your needs are greater
|
||||
|
||||
|
||||
wxMultiCellCanvas
|
||||
=================
|
||||
|
||||
The wxMultiCellCanvas class allows you to add objects to a wxFlexGridSizer
|
||||
by specifying a row and a column location. When all objects have been
|
||||
added, you need to call a member function CalculateConstraints(), which
|
||||
will insert the objects into the wxFlexGridSizer. If there are empty
|
||||
cells the canvas will insert empty wxStaticText objects as placeholders.
|
||||
|
||||
Upon creation of the canvas the size of the canvas needs to be specified.
|
||||
Attempting to insert a cell outside those limits will cause an assertion
|
||||
error.
|
||||
|
||||
When adding cells, the cell locations are specified as a row,column
|
||||
location, both being zero-based. 0,0 is the upper left corner of the
|
||||
canvas.
|
||||
|
||||
|
||||
wxMultiCellSizer
|
||||
================
|
||||
|
||||
The wxMultiCellSizer class manages a collection of child windows in a way
|
||||
similar to that of data stored in a spreadsheet. A multicell canvas is a
|
||||
two-dimensional array of cells with an origin of (0,0) in the upper-left
|
||||
corner. Windows are added to a multicell sizer by first creating a
|
||||
wxMultiCellItemHandle object which specifies a starting cell and,
|
||||
optionally, a number of contiguous columns, rows, or a combination
|
||||
thereof, and then adding it to the sizer.
|
||||
|
||||
This class bases the initial cell sizes on the minimum sizes returned by
|
||||
each child window of the sizer. You can override the minimum sizes
|
||||
provided by the wxWindows Class Library by doing either of the following:
|
||||
|
||||
o Specifying the size when creating the wxMultiCellItemHandle object
|
||||
o Creating a derived class and implementing a CalcMin function
|
||||
|
||||
The wxMultiCellItemHandle must be passed the row and column of the item,
|
||||
at a minimum. Optionally, more information can be passed:
|
||||
|
||||
int row Row position, zero based
|
||||
int column Column position, zero based
|
||||
int height Number of rows this cell will occupy, default is 1
|
||||
int width Number of columns this cell will occupy, default is 1
|
||||
|
||||
Note that if the height or width is greater than one that
|
||||
dimension is assumed to be resizable because it is spanning
|
||||
multiple cells.
|
||||
|
||||
wxSize minSize Minimum size of the object.
|
||||
wxResizable Style Is this object resizable, and if so, how. Allowable styles are:
|
||||
wxNOT_RESIZABLE
|
||||
wxHORIZENTAL_RESIZABLE
|
||||
wxVERTICAL_RESIZABLE
|
||||
wxRESIZABLE
|
||||
wxSize weight If this is a resizable object, the weight applied to the specific dimension.
|
||||
This is useful if you have several resizable rows and/or columns, and you want
|
||||
one to get more of the available space than the others.
|
||||
int align This is a wxAlignment value, it is an integer so you can 'or multiple
|
||||
values together. The acceptable values are:
|
||||
wxALIGN_NOT
|
||||
wxALIGN_CENTER_HORIZONTAL
|
||||
wxALIGN_CENTRE_HORIZONTAL
|
||||
wxALIGN_LEFT
|
||||
wxALIGN_TOP
|
||||
wxALIGN_RIGHT
|
||||
wxALIGN_BOTTOM
|
||||
wxALIGN_CENTER_VERTICAL
|
||||
wxALIGN_CENTRE_VERTICAL
|
||||
wxALIGN_CENTER
|
||||
wxALIGN_CENTRE
|
||||
Note that some combinations of these make no sense, for example wxALIGN_LEFT | wxALIGN_RIGHT.
|
||||
See the definition of wxAlignment for more information
|
||||
|
||||
|
||||
Other functions are:
|
||||
|
||||
void RecalcSizes() Should not be called by the user, needed by the wxSizer class
|
||||
wxSize CalcMin() Should not be called by the user, needed by the wxSizer class
|
||||
bool SetDefaultCellSize Set the default cell size of an empty cell
|
||||
bool SetColumnWidth Set the width of a column, optionally specifying it as resizable
|
||||
bool SetRowHeight Set the height of a row, optionally specifying it as resizable
|
||||
|
||||
Sometimes it can be very confusing to determine the relationship between rows, columns, and
|
||||
which ones are resizable or not. Three functions are supplied to make this easier:
|
||||
|
||||
bool EnableGridLines(wxWindow *win); Call this to either enable or disable the grid lines.
|
||||
Pass the window the sizer is on, or NULL to disable.
|
||||
Currently the window is not used, but it may be in the
|
||||
future.
|
||||
bool SetGridPen(wxPen *pen); Set the pen color, the default pen color is red
|
||||
void OnPaint(wxDC& dc); Call this from an OnPaint function associated with the
|
||||
window the sizer is attached to. See the example program
|
||||
mtest.cpp for specific details on how to do this.
|
||||
|
||||
|
||||
Files Description
|
||||
===== ===========
|
||||
docs.txt This file
|
||||
|
||||
// wxMultiCellCanvas and wxMultiCellSizer
|
||||
makefile Makefile for the MingW32 compiler
|
||||
multicell.cpp Class source code file
|
||||
multicell.h Class header file
|
||||
|
||||
//Sample
|
||||
mtest.cpp Example program, demonstrates both classes
|
||||
mtest.rc
|
||||
mtest.gif
|
||||
makefile
|
||||
|
||||
Acknowledgments
|
||||
===============
|
||||
This was inspired by the gbsizer class written by Alex Andruschak, and the IMultiCellCanvas
|
||||
class in the IBM Class Libraries in the VisualeAge C++ compilers.
|
||||
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
2. Documentation
|
||||
|
||||
|
|
@ -1,745 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: splittree.cpp
|
||||
// Purpose: Classes to achieve a remotely-scrolled tree in a splitter
|
||||
// window that can be scrolled by a scrolled window higher in the
|
||||
// hierarchy
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 8/7/2000
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
// for all others, include the necessary headers (this file is usually all you
|
||||
// need because it includes almost all "standard" wxWidgets headers)
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#include <windows.h>
|
||||
#include "wx/msw/winundef.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gizmos/splittree.h"
|
||||
#include <math.h>
|
||||
|
||||
/*
|
||||
* wxRemotelyScrolledTreeCtrl
|
||||
*/
|
||||
|
||||
#if USE_GENERIC_TREECTRL
|
||||
IMPLEMENT_CLASS(wxRemotelyScrolledTreeCtrl, wxGenericTreeCtrl)
|
||||
#else
|
||||
IMPLEMENT_CLASS(wxRemotelyScrolledTreeCtrl, wxTreeCtrl)
|
||||
#endif
|
||||
|
||||
#if USE_GENERIC_TREECTRL
|
||||
BEGIN_EVENT_TABLE(wxRemotelyScrolledTreeCtrl, wxGenericTreeCtrl)
|
||||
#else
|
||||
BEGIN_EVENT_TABLE(wxRemotelyScrolledTreeCtrl, wxTreeCtrl)
|
||||
#endif
|
||||
EVT_SIZE(wxRemotelyScrolledTreeCtrl::OnSize)
|
||||
EVT_PAINT(wxRemotelyScrolledTreeCtrl::OnPaint)
|
||||
EVT_TREE_ITEM_EXPANDED(wxID_ANY, wxRemotelyScrolledTreeCtrl::OnExpand)
|
||||
EVT_TREE_ITEM_COLLAPSED(wxID_ANY, wxRemotelyScrolledTreeCtrl::OnExpand)
|
||||
EVT_SCROLLWIN(wxRemotelyScrolledTreeCtrl::OnScroll)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxRemotelyScrolledTreeCtrl::wxRemotelyScrolledTreeCtrl(
|
||||
wxWindow* parent, wxWindowID id, const wxPoint& pt,
|
||||
const wxSize& sz, long style)
|
||||
: wxTreeCtrl(parent, id, pt, sz, style & ~wxTR_ROW_LINES)
|
||||
{
|
||||
m_companionWindow = NULL;
|
||||
|
||||
// We draw the row lines ourself so they match what's done
|
||||
// by the companion window. That is why the flag is turned
|
||||
// off above, so wxGenericTreeCtrl doesn't draw them in a
|
||||
// different colour.
|
||||
m_drawRowLines = (style & wxTR_ROW_LINES) != 0;
|
||||
}
|
||||
|
||||
wxRemotelyScrolledTreeCtrl::~wxRemotelyScrolledTreeCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
void wxRemotelyScrolledTreeCtrl::HideVScrollbar()
|
||||
{
|
||||
#if defined(__WXMSW__)
|
||||
#if USE_GENERIC_TREECTRL
|
||||
if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
|
||||
#endif
|
||||
{
|
||||
::ShowScrollBar((HWND) GetHWND(), SB_VERT, false);
|
||||
}
|
||||
#if USE_GENERIC_TREECTRL
|
||||
else
|
||||
{
|
||||
// Implicit in overriding SetScrollbars
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
// Number of pixels per user unit (0 or -1 for no scrollbar)
|
||||
// Length of virtual canvas in user units
|
||||
// Length of page in user units
|
||||
void wxRemotelyScrolledTreeCtrl::SetScrollbars(
|
||||
#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
|
||||
int pixelsPerUnitX, int pixelsPerUnitY,
|
||||
int noUnitsX, int noUnitsY,
|
||||
int xPos, int yPos,
|
||||
bool noRefresh
|
||||
#else
|
||||
int WXUNUSED(pixelsPerUnitX), int WXUNUSED(pixelsPerUnitY),
|
||||
int WXUNUSED(noUnitsX), int WXUNUSED(noUnitsY),
|
||||
int WXUNUSED(xPos), int WXUNUSED(yPos),
|
||||
bool WXUNUSED(noRefresh)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
|
||||
if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
|
||||
{
|
||||
wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
|
||||
win->wxGenericTreeCtrl::SetScrollbars(pixelsPerUnitX, pixelsPerUnitY, noUnitsX, 0, xPos, 0, /* noRefresh */ true);
|
||||
|
||||
wxScrolledWindow* scrolledWindow = GetScrolledWindow();
|
||||
if (scrolledWindow)
|
||||
{
|
||||
scrolledWindow->SetScrollbars(0, pixelsPerUnitY, 0, noUnitsY, 0, yPos, noRefresh);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// In case we're using the generic tree control.
|
||||
int wxRemotelyScrolledTreeCtrl::GetScrollPos(
|
||||
#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
|
||||
int orient
|
||||
#else
|
||||
int WXUNUSED(orient)
|
||||
#endif
|
||||
) const
|
||||
{
|
||||
|
||||
#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
|
||||
// this condition fixes extsitence of warning but
|
||||
wxScrolledWindow* scrolledWindow =
|
||||
// but GetScrolledWindow is still executed in case internally does something
|
||||
#endif
|
||||
GetScrolledWindow();
|
||||
|
||||
#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
|
||||
if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
|
||||
{
|
||||
wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
|
||||
|
||||
if (orient == wxHORIZONTAL)
|
||||
return win->wxGenericTreeCtrl::GetScrollPos(orient);
|
||||
else
|
||||
{
|
||||
return scrolledWindow->GetScrollPos(orient);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// In case we're using the generic tree control.
|
||||
// Get the view start
|
||||
void wxRemotelyScrolledTreeCtrl::GetViewStart(int *x, int *y) const
|
||||
{
|
||||
wxScrolledWindow* scrolledWindow = GetScrolledWindow();
|
||||
|
||||
#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
|
||||
if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
|
||||
{
|
||||
|
||||
wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
|
||||
int x1, y1, x2, y2;
|
||||
win->wxGenericTreeCtrl::GetViewStart(& x1, & y1);
|
||||
* x = x1; * y = y1;
|
||||
if (!scrolledWindow)
|
||||
return;
|
||||
|
||||
scrolledWindow->GetViewStart(& x2, & y2);
|
||||
* y = y2;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
// x is wrong since the horizontal scrollbar is controlled by the
|
||||
// tree control, but we probably don't need it.
|
||||
scrolledWindow->GetViewStart(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
// In case we're using the generic tree control.
|
||||
void wxRemotelyScrolledTreeCtrl::PrepareDC(
|
||||
#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
|
||||
wxDC& dc
|
||||
#else
|
||||
wxDC& WXUNUSED(dc)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
|
||||
if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
|
||||
{
|
||||
wxScrolledWindow* scrolledWindow = GetScrolledWindow();
|
||||
|
||||
wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
|
||||
|
||||
int startX, startY;
|
||||
GetViewStart(& startX, & startY);
|
||||
|
||||
int xppu1, yppu1, xppu2, yppu2;
|
||||
win->wxGenericTreeCtrl::GetScrollPixelsPerUnit(& xppu1, & yppu1);
|
||||
scrolledWindow->GetScrollPixelsPerUnit(& xppu2, & yppu2);
|
||||
|
||||
dc.SetDeviceOrigin( -startX * xppu1, -startY * yppu2 );
|
||||
// dc.SetUserScale( win->GetScaleX(), win->GetScaleY() );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Scroll to the given line (in scroll units where each unit is
|
||||
// the height of an item)
|
||||
void wxRemotelyScrolledTreeCtrl::ScrollToLine(int WXUNUSED(posHoriz), int posVert)
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
#if USE_GENERIC_TREECTRL
|
||||
if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
|
||||
#endif // USE_GENERIC_TREECTRL
|
||||
{
|
||||
UINT sbCode = SB_THUMBPOSITION;
|
||||
HWND vertScrollBar = 0;
|
||||
MSWDefWindowProc((WXUINT) WM_VSCROLL, MAKELONG(sbCode, posVert), (WXLPARAM) vertScrollBar);
|
||||
}
|
||||
#if USE_GENERIC_TREECTRL
|
||||
else
|
||||
#endif // USE_GENERIC_TREECTRL
|
||||
#endif // __WXMSW__
|
||||
#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
|
||||
{
|
||||
wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
|
||||
win->Refresh();
|
||||
/* Doesn't work yet because scrolling is ignored by Scroll
|
||||
int xppu, yppu;
|
||||
wxScrolledWindow* scrolledWindow = GetScrolledWindow();
|
||||
if (scrolledWindow)
|
||||
{
|
||||
scrolledWindow->GetScrollPixelsPerUnit(& xppu, & yppu);
|
||||
win->Scroll(-1, posVert*yppu);
|
||||
}
|
||||
*/
|
||||
}
|
||||
#endif // USE_GENERIC_TREECTRL || !defined(__WXMSW__)
|
||||
wxUnusedVar(posVert);
|
||||
}
|
||||
|
||||
void wxRemotelyScrolledTreeCtrl::OnSize(wxSizeEvent& event)
|
||||
{
|
||||
HideVScrollbar();
|
||||
AdjustRemoteScrollbars();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void wxRemotelyScrolledTreeCtrl::OnExpand(wxTreeEvent& event)
|
||||
{
|
||||
AdjustRemoteScrollbars();
|
||||
event.Skip();
|
||||
|
||||
// If we don't have this, we get some bits of lines still remaining
|
||||
if (event.GetEventType() == wxEVT_COMMAND_TREE_ITEM_COLLAPSED)
|
||||
Refresh();
|
||||
|
||||
// Pass on the event
|
||||
if (m_companionWindow)
|
||||
m_companionWindow->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
void wxRemotelyScrolledTreeCtrl::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
|
||||
wxTreeCtrl::OnPaint(event);
|
||||
|
||||
if (! m_drawRowLines)
|
||||
return;
|
||||
|
||||
// Reset the device origin since it may have been set
|
||||
dc.SetDeviceOrigin(0, 0);
|
||||
|
||||
wxPen pen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID);
|
||||
dc.SetPen(pen);
|
||||
dc.SetBrush(* wxTRANSPARENT_BRUSH);
|
||||
|
||||
wxSize clientSize = GetClientSize();
|
||||
wxRect itemRect;
|
||||
wxTreeItemId h, lastH;
|
||||
for (h=GetFirstVisibleItem();
|
||||
h.IsOk();
|
||||
h=GetNextVisible(h))
|
||||
{
|
||||
if (GetBoundingRect(h, itemRect))
|
||||
{
|
||||
int cy = itemRect.GetTop();
|
||||
dc.DrawLine(0, cy, clientSize.x, cy);
|
||||
lastH = h;
|
||||
}
|
||||
if (! IsVisible(h))
|
||||
break;
|
||||
}
|
||||
if (lastH.IsOk() && GetBoundingRect(lastH, itemRect))
|
||||
{
|
||||
int cy = itemRect.GetBottom();
|
||||
dc.DrawLine(0, cy, clientSize.x, cy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Adjust the containing wxScrolledWindow's scrollbars appropriately
|
||||
void wxRemotelyScrolledTreeCtrl::AdjustRemoteScrollbars()
|
||||
{
|
||||
#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
|
||||
if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
|
||||
{
|
||||
// This is for the generic tree control.
|
||||
// It calls SetScrollbars which has been overridden
|
||||
// to adjust the parent scrolled window vertical
|
||||
// scrollbar.
|
||||
((wxGenericTreeCtrl*) this)->AdjustMyScrollbars();
|
||||
return;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
// This is for the wxMSW tree control
|
||||
wxScrolledWindow* scrolledWindow = GetScrolledWindow();
|
||||
if (scrolledWindow)
|
||||
{
|
||||
wxRect itemRect;
|
||||
if (GetBoundingRect(GetFirstVisibleItem(), itemRect))
|
||||
{
|
||||
// Actually, the real height seems to be 1 less than reported
|
||||
// (e.g. 16 instead of 16)
|
||||
int itemHeight = itemRect.GetHeight() - 1;
|
||||
|
||||
int w, h;
|
||||
GetClientSize(&w, &h);
|
||||
|
||||
wxRect rect(0, 0, 0, 0);
|
||||
CalcTreeSize(rect);
|
||||
|
||||
double f = ((double) (rect.GetHeight()) / (double) itemHeight) ;
|
||||
int treeViewHeight = (int) ceil(f);
|
||||
|
||||
int scrollPixelsPerLine = itemHeight;
|
||||
int scrollPos = - (itemRect.y / itemHeight);
|
||||
|
||||
scrolledWindow->SetScrollbars(0, scrollPixelsPerLine, 0, treeViewHeight, 0, scrollPos);
|
||||
|
||||
// Ensure that when a scrollbar becomes hidden or visible,
|
||||
// the contained window sizes are right.
|
||||
// Problem: this is called too early (?)
|
||||
wxSizeEvent event(scrolledWindow->GetSize(), scrolledWindow->GetId());
|
||||
scrolledWindow->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Calculate the area that contains both rectangles
|
||||
static wxRect CombineRectangles(const wxRect& rect1, const wxRect& rect2)
|
||||
{
|
||||
wxRect rect;
|
||||
|
||||
int right1 = rect1.GetRight();
|
||||
int bottom1 = rect1.GetBottom();
|
||||
int right2 = rect2.GetRight();
|
||||
int bottom2 = rect2.GetBottom();
|
||||
|
||||
wxPoint topLeft = wxPoint(wxMin(rect1.x, rect2.x), wxMin(rect1.y, rect2.y));
|
||||
wxPoint bottomRight = wxPoint(wxMax(right1, right2), wxMax(bottom1, bottom2));
|
||||
|
||||
rect.x = topLeft.x; rect.y = topLeft.y;
|
||||
rect.SetRight(bottomRight.x);
|
||||
rect.SetBottom(bottomRight.y);
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
// Calculate the tree overall size so we can set the scrollbar
|
||||
// correctly
|
||||
void wxRemotelyScrolledTreeCtrl::CalcTreeSize(wxRect& rect)
|
||||
{
|
||||
CalcTreeSize(GetRootItem(), rect);
|
||||
}
|
||||
|
||||
void wxRemotelyScrolledTreeCtrl::CalcTreeSize(const wxTreeItemId& id, wxRect& rect)
|
||||
{
|
||||
// More efficient implementation would be to find the last item (but how?)
|
||||
// Q: is the bounding rect relative to the top of the virtual tree workspace
|
||||
// or the top of the window? How would we convert?
|
||||
wxRect itemSize;
|
||||
if (GetBoundingRect(id, itemSize))
|
||||
{
|
||||
rect = CombineRectangles(rect, itemSize);
|
||||
}
|
||||
|
||||
wxTreeItemIdValue cookie;
|
||||
wxTreeItemId childId = GetFirstChild(id, cookie);
|
||||
while (childId)
|
||||
{
|
||||
CalcTreeSize(childId, rect);
|
||||
childId = GetNextChild(childId, cookie);
|
||||
}
|
||||
}
|
||||
|
||||
// Find the scrolled window that contains this control
|
||||
wxScrolledWindow* wxRemotelyScrolledTreeCtrl::GetScrolledWindow() const
|
||||
{
|
||||
wxWindow* parent = wxWindow::GetParent();
|
||||
while (parent)
|
||||
{
|
||||
if (parent->IsKindOf(CLASSINFO(wxScrolledWindow)))
|
||||
return (wxScrolledWindow*) parent;
|
||||
parent = parent->GetParent();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxRemotelyScrolledTreeCtrl::OnScroll(wxScrollWinEvent& event)
|
||||
{
|
||||
int orient = event.GetOrientation();
|
||||
if (orient == wxHORIZONTAL)
|
||||
{
|
||||
event.Skip();
|
||||
return;
|
||||
}
|
||||
wxScrolledWindow* scrollWin = GetScrolledWindow();
|
||||
if (!scrollWin)
|
||||
return;
|
||||
|
||||
int x, y;
|
||||
scrollWin->GetViewStart(& x, & y);
|
||||
|
||||
ScrollToLine(-1, y);
|
||||
}
|
||||
|
||||
/*
|
||||
* wxTreeCompanionWindow
|
||||
*
|
||||
* A window displaying values associated with tree control items.
|
||||
*/
|
||||
|
||||
IMPLEMENT_CLASS(wxTreeCompanionWindow, wxWindow)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxTreeCompanionWindow, wxWindow)
|
||||
EVT_PAINT(wxTreeCompanionWindow::OnPaint)
|
||||
EVT_SCROLLWIN(wxTreeCompanionWindow::OnScroll)
|
||||
EVT_TREE_ITEM_EXPANDED(-1, wxTreeCompanionWindow::OnExpand)
|
||||
EVT_TREE_ITEM_COLLAPSED(-1, wxTreeCompanionWindow::OnExpand)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxTreeCompanionWindow::wxTreeCompanionWindow(wxWindow* parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& sz,
|
||||
long style):
|
||||
wxWindow(parent, id, pos, sz, style)
|
||||
{
|
||||
m_treeCtrl = NULL;
|
||||
}
|
||||
|
||||
void wxTreeCompanionWindow::DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& rect)
|
||||
{
|
||||
// TEST CODE
|
||||
#if 1
|
||||
if (m_treeCtrl)
|
||||
{
|
||||
wxString text = m_treeCtrl->GetItemText(id);
|
||||
dc.SetTextForeground(* wxBLACK);
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
|
||||
int textW, textH;
|
||||
dc.GetTextExtent(text, & textW, & textH);
|
||||
|
||||
int x = 5;
|
||||
int y = rect.GetY() + wxMax(0, (rect.GetHeight() - textH) / 2);
|
||||
|
||||
dc.DrawText(text, x, y);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxTreeCompanionWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
|
||||
if (!m_treeCtrl)
|
||||
return;
|
||||
|
||||
wxPen pen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID);
|
||||
dc.SetPen(pen);
|
||||
dc.SetBrush(* wxTRANSPARENT_BRUSH);
|
||||
wxFont font(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
|
||||
dc.SetFont(font);
|
||||
|
||||
wxSize clientSize = GetClientSize();
|
||||
wxRect itemRect;
|
||||
wxTreeItemId h, lastH;
|
||||
for (h=m_treeCtrl->GetFirstVisibleItem();
|
||||
h.IsOk();
|
||||
h=m_treeCtrl->GetNextVisible(h))
|
||||
{
|
||||
if (m_treeCtrl->GetBoundingRect(h, itemRect))
|
||||
{
|
||||
int cy = itemRect.GetTop();
|
||||
wxRect drawItemRect(0, cy, clientSize.x, itemRect.GetHeight());
|
||||
|
||||
lastH = h;
|
||||
|
||||
// Draw the actual item
|
||||
DrawItem(dc, h, drawItemRect);
|
||||
dc.DrawLine(0, cy, clientSize.x, cy);
|
||||
}
|
||||
if (! m_treeCtrl->IsVisible(h))
|
||||
break;
|
||||
}
|
||||
if (lastH.IsOk() && m_treeCtrl->GetBoundingRect(lastH, itemRect))
|
||||
{
|
||||
int cy = itemRect.GetBottom();
|
||||
dc.DrawLine(0, cy, clientSize.x, cy);
|
||||
}
|
||||
}
|
||||
|
||||
void wxTreeCompanionWindow::OnScroll(wxScrollWinEvent& event)
|
||||
{
|
||||
int orient = event.GetOrientation();
|
||||
if (orient == wxHORIZONTAL)
|
||||
{
|
||||
event.Skip();
|
||||
return;
|
||||
}
|
||||
if (!m_treeCtrl)
|
||||
return;
|
||||
|
||||
// TODO: scroll the window physically instead of just refreshing.
|
||||
Refresh(true);
|
||||
}
|
||||
|
||||
void wxTreeCompanionWindow::OnExpand(wxTreeEvent& WXUNUSED(event))
|
||||
{
|
||||
// TODO: something more optimized than simply refresh the whole
|
||||
// window when the tree is expanded/collapsed. Tricky.
|
||||
Refresh();
|
||||
}
|
||||
|
||||
/*
|
||||
* wxThinSplitterWindow
|
||||
*/
|
||||
|
||||
IMPLEMENT_CLASS(wxThinSplitterWindow, wxSplitterWindow)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxThinSplitterWindow, wxSplitterWindow)
|
||||
EVT_SIZE(wxThinSplitterWindow::OnSize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxThinSplitterWindow::wxThinSplitterWindow(wxWindow* parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& sz,
|
||||
long style):
|
||||
wxSplitterWindow(parent, id, pos, sz, style)
|
||||
{
|
||||
wxColour faceColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
||||
m_facePen = new wxPen(faceColour, 1, wxSOLID);
|
||||
m_faceBrush = new wxBrush(faceColour, wxSOLID);
|
||||
}
|
||||
|
||||
wxThinSplitterWindow::~wxThinSplitterWindow()
|
||||
{
|
||||
delete m_facePen;
|
||||
delete m_faceBrush;
|
||||
}
|
||||
|
||||
|
||||
void wxThinSplitterWindow::SizeWindows()
|
||||
{
|
||||
// The client size may have changed inbetween
|
||||
// the sizing of the first window and the sizing of
|
||||
// the second. So repeat SizeWindows.
|
||||
wxSplitterWindow::SizeWindows();
|
||||
wxSplitterWindow::SizeWindows();
|
||||
}
|
||||
|
||||
// Tests for x, y over sash
|
||||
bool wxThinSplitterWindow::SashHitTest(int x, int y, int WXUNUSED(tolerance))
|
||||
{
|
||||
return wxSplitterWindow::SashHitTest(x, y, 4);
|
||||
}
|
||||
|
||||
void wxThinSplitterWindow::DrawSash(wxDC& dc)
|
||||
{
|
||||
if ( m_sashPosition == 0 || !m_windowTwo)
|
||||
return;
|
||||
if (GetWindowStyle() & wxSP_NOSASH)
|
||||
return;
|
||||
|
||||
int w, h;
|
||||
GetClientSize(&w, &h);
|
||||
|
||||
if ( m_splitMode == wxSPLIT_VERTICAL )
|
||||
{
|
||||
dc.SetPen(* m_facePen);
|
||||
dc.SetBrush(* m_faceBrush);
|
||||
int h1 = h-1;
|
||||
int y1 = 0;
|
||||
if ( (GetWindowStyleFlag() & wxSP_BORDER) != wxSP_BORDER && (GetWindowStyleFlag() & wxSP_3DBORDER) != wxSP_3DBORDER )
|
||||
h1 += 1; // Not sure why this is necessary...
|
||||
if ( (GetWindowStyleFlag() & wxSP_3DBORDER) == wxSP_3DBORDER)
|
||||
{
|
||||
y1 = 2; h1 -= 3;
|
||||
}
|
||||
dc.DrawRectangle(m_sashPosition, y1, GetSashSize(), h1);
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.SetPen(* m_facePen);
|
||||
dc.SetBrush(* m_faceBrush);
|
||||
int w1 = w-1;
|
||||
int x1 = 0;
|
||||
if ( (GetWindowStyleFlag() & wxSP_BORDER) != wxSP_BORDER && (GetWindowStyleFlag() & wxSP_3DBORDER) != wxSP_3DBORDER )
|
||||
w1 ++;
|
||||
if ( (GetWindowStyleFlag() & wxSP_3DBORDER) == wxSP_3DBORDER)
|
||||
{
|
||||
x1 = 2; w1 -= 3;
|
||||
}
|
||||
dc.DrawRectangle(x1, m_sashPosition, w1, GetSashSize());
|
||||
}
|
||||
|
||||
dc.SetPen(wxNullPen);
|
||||
dc.SetBrush(wxNullBrush);
|
||||
}
|
||||
|
||||
void wxThinSplitterWindow::OnSize(wxSizeEvent& event)
|
||||
{
|
||||
wxSplitterWindow::OnSize(event);
|
||||
}
|
||||
|
||||
/*
|
||||
* wxSplitterScrolledWindow
|
||||
*/
|
||||
|
||||
IMPLEMENT_CLASS(wxSplitterScrolledWindow, wxScrolledWindow)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxSplitterScrolledWindow, wxScrolledWindow)
|
||||
EVT_SCROLLWIN(wxSplitterScrolledWindow::OnScroll)
|
||||
EVT_SIZE(wxSplitterScrolledWindow::OnSize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxSplitterScrolledWindow::wxSplitterScrolledWindow(wxWindow* parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& sz,
|
||||
long style):
|
||||
wxScrolledWindow(parent, id, pos, sz, style)
|
||||
{
|
||||
}
|
||||
|
||||
void wxSplitterScrolledWindow::OnSize(wxSizeEvent& WXUNUSED(event))
|
||||
{
|
||||
wxSize sz = GetClientSize();
|
||||
if (GetChildren().GetFirst())
|
||||
{
|
||||
((wxWindow*) GetChildren().GetFirst()->GetData())->SetSize(0, 0, sz.x, sz.y);
|
||||
}
|
||||
}
|
||||
|
||||
void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event)
|
||||
{
|
||||
// Ensure that events being propagated back up the window hierarchy
|
||||
// don't cause an infinite loop
|
||||
static bool inOnScroll = false;
|
||||
if (inOnScroll)
|
||||
{
|
||||
event.Skip();
|
||||
return;
|
||||
}
|
||||
inOnScroll = true;
|
||||
|
||||
int orient = event.GetOrientation();
|
||||
|
||||
int nScrollInc = CalcScrollInc(event);
|
||||
if (nScrollInc == 0)
|
||||
{
|
||||
inOnScroll = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (orient == wxHORIZONTAL)
|
||||
{
|
||||
inOnScroll = false;
|
||||
event.Skip();
|
||||
return;
|
||||
#if 0
|
||||
int newPos = m_xScrollPosition + nScrollInc;
|
||||
SetScrollPos(wxHORIZONTAL, newPos, true );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
int newPos = m_yScrollPosition + nScrollInc;
|
||||
SetScrollPos(wxVERTICAL, newPos, true );
|
||||
}
|
||||
|
||||
if (orient == wxHORIZONTAL)
|
||||
{
|
||||
m_xScrollPosition += nScrollInc;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_yScrollPosition += nScrollInc;
|
||||
}
|
||||
|
||||
// Find targets in splitter window and send the event to them
|
||||
wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxWindow* child = (wxWindow*) node->GetData();
|
||||
if (child->IsKindOf(CLASSINFO(wxSplitterWindow)))
|
||||
{
|
||||
wxSplitterWindow* splitter = (wxSplitterWindow*) child;
|
||||
if (splitter->GetWindow1())
|
||||
splitter->GetWindow1()->ProcessEvent(event);
|
||||
if (splitter->GetWindow2())
|
||||
splitter->GetWindow2()->ProcessEvent(event);
|
||||
break;
|
||||
}
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
m_targetWindow->Update() ;
|
||||
|
||||
inOnScroll = false;
|
||||
}
|
||||
|
|
@ -1,148 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: statpict.cpp
|
||||
// Purpose: wxStaticPicture
|
||||
// Author: Wade Brainerd (wadeb@wadeb.com)
|
||||
// Modified by:
|
||||
// Created: 2003-05-01
|
||||
// RCS-ID:
|
||||
// Copyright: (c) Wade Brainerd
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
#include "wx/defs.h"
|
||||
|
||||
#include "wx/gizmos/statpict.h"
|
||||
#include "wx/dcclient.h"
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxStaticPicture, wxControl)
|
||||
WXDLLIMPEXP_GIZMOS const wxChar * wxStaticPictureNameStr = wxT("staticPicture");
|
||||
|
||||
/*
|
||||
* wxStaticPicture
|
||||
*/
|
||||
|
||||
BEGIN_EVENT_TABLE(wxStaticPicture, wxControl)
|
||||
EVT_PAINT(wxStaticPicture::OnPaint)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
bool wxStaticPicture::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxBitmap& bitmap,
|
||||
const wxPoint& pos,
|
||||
const wxSize& s,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
SetName(name);
|
||||
|
||||
wxSize size = s ;
|
||||
if ( bitmap.Ok() )
|
||||
{
|
||||
if ( size.x == wxDefaultCoord )
|
||||
size.x = bitmap.GetWidth() ;
|
||||
if ( size.y == wxDefaultCoord )
|
||||
size.y = bitmap.GetHeight() ;
|
||||
}
|
||||
|
||||
m_backgroundColour = parent->GetBackgroundColour() ;
|
||||
m_foregroundColour = parent->GetForegroundColour() ;
|
||||
|
||||
Bitmap = bitmap;
|
||||
Align = 0;
|
||||
Scale = 0;
|
||||
ScaleX = ScaleY = 1;
|
||||
|
||||
#ifndef __WXMSW__
|
||||
LastScaleX = LastScaleY = -1;
|
||||
if ( Bitmap.Ok() )
|
||||
OriginalImage = Bitmap.ConvertToImage();
|
||||
#endif
|
||||
|
||||
if ( id == wxID_ANY )
|
||||
m_windowId = (int)NewControlId();
|
||||
else
|
||||
m_windowId = id;
|
||||
|
||||
m_windowStyle = style;
|
||||
|
||||
bool ret = wxControl::Create( parent, id, pos, size, style, wxDefaultValidator, name );
|
||||
|
||||
SetInitialSize( size ) ;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void wxStaticPicture::SetBitmap( const wxBitmap& bmp )
|
||||
{
|
||||
Bitmap = bmp;
|
||||
#ifndef __WXMSW__
|
||||
if ( Bitmap.Ok() )
|
||||
OriginalImage = Bitmap.ConvertToImage();
|
||||
LastScaleX = LastScaleY = -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxStaticPicture::OnPaint(wxPaintEvent& WXUNUSED(event))
|
||||
{
|
||||
if ( !Bitmap.Ok() )
|
||||
return;
|
||||
|
||||
wxPaintDC dc( this );
|
||||
PrepareDC( dc );
|
||||
|
||||
wxSize sz = GetSize();
|
||||
wxSize bmpsz( Bitmap.GetWidth(), Bitmap.GetHeight() );
|
||||
float sx = 1.0f, sy = 1.0f;
|
||||
|
||||
if ( Scale & wxSCALE_UNIFORM )
|
||||
{
|
||||
float _sx = (float)sz.GetWidth() / (float)bmpsz.GetWidth();
|
||||
float _sy = (float)sz.GetHeight() / (float)bmpsz.GetHeight();
|
||||
sx = sy = _sx < _sy ? _sx : _sy;
|
||||
}
|
||||
else
|
||||
if ( Scale & wxSCALE_CUSTOM )
|
||||
{
|
||||
sx = ScaleX;
|
||||
sy = ScaleY;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( Scale & wxSCALE_HORIZONTAL )
|
||||
sx = (float)sz.x/(float)bmpsz.x;
|
||||
if ( Scale & wxSCALE_VERTICAL )
|
||||
sy = (float)sz.y/(float)bmpsz.y;
|
||||
}
|
||||
|
||||
bmpsz = wxSize( (int)(bmpsz.x*sx), (int)(bmpsz.y*sy) );
|
||||
|
||||
wxPoint pos( 0, 0 );
|
||||
|
||||
if ( Align & wxALIGN_CENTER_HORIZONTAL ) pos.x = (sz.x-bmpsz.x)/2;
|
||||
else if ( Align & wxALIGN_RIGHT ) pos.x = sz.x-bmpsz.x;
|
||||
|
||||
if ( Align & wxALIGN_CENTER_VERTICAL ) pos.y = (sz.y-bmpsz.y)/2;
|
||||
else if ( Align & wxALIGN_BOTTOM ) pos.y = sz.y-bmpsz.y;
|
||||
|
||||
if ( Scale )
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
double ux, uy;
|
||||
dc.GetUserScale( &ux, &uy );
|
||||
dc.SetUserScale( ux*sx, uy*sy );
|
||||
dc.DrawBitmap( Bitmap, (int)((float)pos.x/sx), (int)((float)pos.y/sy) );
|
||||
dc.SetUserScale( ux, uy );
|
||||
#else
|
||||
if ( LastScaleX != sx || LastScaleY != sy )
|
||||
{
|
||||
LastScaleX = sx;
|
||||
LastScaleY = sy;
|
||||
ScaledBitmap = wxBitmap( OriginalImage.Scale( bmpsz.x, bmpsz.y ) );
|
||||
}
|
||||
dc.DrawBitmap( ScaledBitmap, pos.x, pos.y );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
dc.DrawBitmap( Bitmap, pos.x, pos.y );
|
||||
}
|
||||
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
wxStaticPicture class
|
||||
by Wade Brainerd (wadeb@wadeb.com)
|
||||
|
||||
Description:
|
||||
|
||||
This class is an improved version of wxStaticBitmap.
|
||||
|
||||
Rather than using a native bitmap control, it uses DC operations to draw the
|
||||
control. This makes its appearance more consistent across platforms, and
|
||||
allows for additional features.
|
||||
|
||||
Features include:
|
||||
|
||||
wxStaticBitmap compatible API - drop-in replacement. Image alignment - top,
|
||||
left, bottom, right, center vertical and/or horizontal.
|
||||
Image scaling - scale horizontally and/or vertically, justified scaling
|
||||
(maintains image aspect ratio).
|
||||
|
||||
Platforms tested:
|
||||
|
||||
wxMSW
|
||||
wxGTK
|
||||
wxMac
|
||||
|
||||
Implementation notes:
|
||||
|
||||
Under MSW wxWindows uses the operating system to do an optimized (potentially
|
||||
hardware accelerated) blit in wxDC::DrawBitmap. This is usually fast enough to
|
||||
do image scaling without affecting the program's interactivity.
|
||||
|
||||
On wxMac and wxGTK however, wxDC::DrawBitmap implicitly calls wxImage::Scale
|
||||
which is a much slower operation. Therefore, on these platforms wxStaticPicture
|
||||
caches the scaled image to make updates that don't change the image (overlapping
|
||||
windows, etc.) faster.
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_statpict.cpp
|
||||
// Purpose: XRC resource handler for wxStaticPicture
|
||||
// Author: David A. Norris
|
||||
// Created: 2005/03/13
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: David A. Norris
|
||||
// Licence: wxWindows Licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_XRC
|
||||
|
||||
#include "wx/gizmos/statpict.h"
|
||||
#include "wx/gizmos/xh_statpict.h"
|
||||
|
||||
// Register with wxWindows' dynamic class subsystem.
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxStaticPictureXmlHandler, wxXmlResourceHandler)
|
||||
|
||||
// Constructor.
|
||||
wxStaticPictureXmlHandler::wxStaticPictureXmlHandler()
|
||||
{
|
||||
AddWindowStyles();
|
||||
}
|
||||
|
||||
// Creates the control and returns a pointer to it.
|
||||
wxObject *wxStaticPictureXmlHandler::DoCreateResource()
|
||||
{
|
||||
XRC_MAKE_INSTANCE(control, wxStaticPicture)
|
||||
|
||||
control->Create(m_parentAsWindow, GetID(),
|
||||
GetBitmap(wxT("bitmap"), wxART_OTHER, GetSize()),
|
||||
GetPosition(), GetSize(), GetStyle(), GetName());
|
||||
|
||||
SetupWindow(control);
|
||||
|
||||
return control;
|
||||
}
|
||||
|
||||
// Returns true if we know how to create a control for the given node.
|
||||
bool wxStaticPictureXmlHandler::CanHandle(wxXmlNode *node)
|
||||
{
|
||||
return IsOfClass(node, wxT("wxStaticPicture"));
|
||||
}
|
||||
|
||||
#endif // wxUSE_XRC
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,170 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: glcanvas.i
|
||||
// Purpose: SWIG definitions for the OpenGL wxWindows classes
|
||||
//
|
||||
// Author: Robin Dunn
|
||||
//
|
||||
// Created: 15-Mar-1999
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 by Total Control Software
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
%define DOCSTRING
|
||||
"`GLCanvas` provides an OpenGL Context on a `wx.Window`."
|
||||
%enddef
|
||||
|
||||
%module(package="wx", docstring=DOCSTRING) glcanvas
|
||||
|
||||
%{
|
||||
#include "wx/wxPython/wxPython.h"
|
||||
#include "wx/wxPython/pyclasses.h"
|
||||
|
||||
#include <wx/glcanvas.h>
|
||||
|
||||
%}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%import core.i
|
||||
%pythoncode { wx = _core }
|
||||
%pythoncode { __docfilter__ = wx.__DocFilter(globals()) }
|
||||
|
||||
|
||||
MAKE_CONST_WXSTRING2(GLCanvasNameStr, wxT("GLCanvas"));
|
||||
MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class wxPalette;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
MustHaveApp(wxGLContext);
|
||||
|
||||
class wxGLContext : public wxObject {
|
||||
public:
|
||||
wxGLContext(wxGLCanvas *win, const wxGLContext* other = NULL);
|
||||
~wxGLContext();
|
||||
|
||||
void SetCurrent(const wxGLCanvas& win);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
enum {
|
||||
WX_GL_RGBA, // use true color palette
|
||||
WX_GL_BUFFER_SIZE, // bits for buffer if not WX_GL_RGBA
|
||||
WX_GL_LEVEL, // 0 for main buffer, >0 for overlay, <0 for underlay
|
||||
WX_GL_DOUBLEBUFFER, // use doublebuffer
|
||||
WX_GL_STEREO, // use stereoscopic display
|
||||
WX_GL_AUX_BUFFERS, // number of auxiliary buffers
|
||||
WX_GL_MIN_RED, // use red buffer with most bits (> MIN_RED bits)
|
||||
WX_GL_MIN_GREEN, // use green buffer with most bits (> MIN_GREEN bits)
|
||||
WX_GL_MIN_BLUE, // use blue buffer with most bits (> MIN_BLUE bits)
|
||||
WX_GL_MIN_ALPHA, // use blue buffer with most bits (> MIN_ALPHA bits)
|
||||
WX_GL_DEPTH_SIZE, // bits for Z-buffer (0,16,32)
|
||||
WX_GL_STENCIL_SIZE, // bits for stencil buffer
|
||||
WX_GL_MIN_ACCUM_RED, // use red accum buffer with most bits (> MIN_ACCUM_RED bits)
|
||||
WX_GL_MIN_ACCUM_GREEN, // use green buffer with most bits (> MIN_ACCUM_GREEN bits)
|
||||
WX_GL_MIN_ACCUM_BLUE, // use blue buffer with most bits (> MIN_ACCUM_BLUE bits)
|
||||
WX_GL_MIN_ACCUM_ALPHA // use blue buffer with most bits (> MIN_ACCUM_ALPHA bits)
|
||||
};
|
||||
|
||||
|
||||
%typemap(in) const int *attribList (int *temp) {
|
||||
int i;
|
||||
if (PySequence_Check($input)) {
|
||||
int size = PyObject_Length($input);
|
||||
temp = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
|
||||
for (i = 0; i < size; i++) {
|
||||
temp[i] = PyInt_AsLong(PySequence_GetItem($input, i));
|
||||
}
|
||||
temp[size] = 0;
|
||||
$1 = temp;
|
||||
}
|
||||
}
|
||||
|
||||
%typemap(freearg) int *attribList
|
||||
{
|
||||
delete [] $1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MustHaveApp(wxGLCanvas);
|
||||
|
||||
class wxGLCanvas : public wxWindow {
|
||||
public:
|
||||
%pythonAppend wxGLCanvas "self._setOORInfo(self)"
|
||||
wxGLCanvas(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const int *attribList = NULL,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPyGLCanvasNameStr,
|
||||
const wxPalette& palette = wxNullPalette);
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxGLCanvasName,
|
||||
const int *attribList = NULL,
|
||||
const wxPalette& palette = wxNullPalette);
|
||||
|
||||
%pythonAppend wxGLCanvas "val._setOORInfo(val)"
|
||||
%RenameCtor(GLCanvasWithContext,
|
||||
wxGLCanvas( wxWindow *parent,
|
||||
const wxGLContext *shared = NULL,
|
||||
wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPyGLCanvasNameStr,
|
||||
const int *attribList = NULL,
|
||||
const wxPalette& palette = wxNullPalette ));
|
||||
|
||||
%nokwargs SetCurrent;
|
||||
void SetCurrent(const wxGLContext& context);
|
||||
void SetColour(const wxString& colour);
|
||||
void SwapBuffers();
|
||||
|
||||
// deprecated...
|
||||
wxGLContext* GetContext();
|
||||
void SetCurrent();
|
||||
|
||||
#ifdef __WXGTK__
|
||||
bool InitVisual(const int *attribList);
|
||||
|
||||
// What about these?
|
||||
// // return GLX version: 13 means 1.3 &c
|
||||
// static int GetGLXVersion();
|
||||
|
||||
// // get the X11 handle of this window
|
||||
// virtual Window GetXWindow() const = 0;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// void SetupPixelFormat(int *attribList = NULL);
|
||||
void SetupPalette(const wxPalette& palette);
|
||||
wxPalette CreateDefaultPalette();
|
||||
wxPalette* GetPalette();
|
||||
#endif
|
||||
|
||||
%property(Context, GetContext, doc="See `GetContext`");
|
||||
};
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%init %{
|
||||
|
||||
%}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
@ -1,154 +0,0 @@
|
|||
# This file was created automatically by SWIG 1.3.29.
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
`GLCanvas` provides an OpenGL Context on a `wx.Window`.
|
||||
"""
|
||||
|
||||
import _glcanvas
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if (name == "this"):
|
||||
if type(value).__name__ == 'PySwigObject':
|
||||
self.__dict__[name] = value
|
||||
return
|
||||
method = class_type.__swig_setmethods__.get(name,None)
|
||||
if method: return method(self,value)
|
||||
if (not static) or hasattr(self,name):
|
||||
self.__dict__[name] = value
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
|
||||
def _swig_setattr(self,class_type,name,value):
|
||||
return _swig_setattr_nondynamic(self,class_type,name,value,0)
|
||||
|
||||
def _swig_getattr(self,class_type,name):
|
||||
if (name == "thisown"): return self.this.own()
|
||||
method = class_type.__swig_getmethods__.get(name,None)
|
||||
if method: return method(self)
|
||||
raise AttributeError,name
|
||||
|
||||
def _swig_repr(self):
|
||||
try: strthis = "proxy of " + self.this.__repr__()
|
||||
except: strthis = ""
|
||||
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
|
||||
|
||||
import types
|
||||
try:
|
||||
_object = types.ObjectType
|
||||
_newclass = 1
|
||||
except AttributeError:
|
||||
class _object : pass
|
||||
_newclass = 0
|
||||
del types
|
||||
|
||||
|
||||
def _swig_setattr_nondynamic_method(set):
|
||||
def set_attr(self,name,value):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if hasattr(self,name) or (name == "this"):
|
||||
set(self,name,value)
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
return set_attr
|
||||
|
||||
|
||||
import _core
|
||||
wx = _core
|
||||
__docfilter__ = wx.__DocFilter(globals())
|
||||
class GLContext(_core.Object):
|
||||
"""Proxy of C++ GLContext class"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
__repr__ = _swig_repr
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""__init__(self, GLCanvas win, GLContext other=None) -> GLContext"""
|
||||
_glcanvas.GLContext_swiginit(self,_glcanvas.new_GLContext(*args, **kwargs))
|
||||
__swig_destroy__ = _glcanvas.delete_GLContext
|
||||
__del__ = lambda self : None;
|
||||
def SetCurrent(*args, **kwargs):
|
||||
"""SetCurrent(self, GLCanvas win)"""
|
||||
return _glcanvas.GLContext_SetCurrent(*args, **kwargs)
|
||||
|
||||
_glcanvas.GLContext_swigregister(GLContext)
|
||||
cvar = _glcanvas.cvar
|
||||
GLCanvasNameStr = cvar.GLCanvasNameStr
|
||||
|
||||
WX_GL_RGBA = _glcanvas.WX_GL_RGBA
|
||||
WX_GL_BUFFER_SIZE = _glcanvas.WX_GL_BUFFER_SIZE
|
||||
WX_GL_LEVEL = _glcanvas.WX_GL_LEVEL
|
||||
WX_GL_DOUBLEBUFFER = _glcanvas.WX_GL_DOUBLEBUFFER
|
||||
WX_GL_STEREO = _glcanvas.WX_GL_STEREO
|
||||
WX_GL_AUX_BUFFERS = _glcanvas.WX_GL_AUX_BUFFERS
|
||||
WX_GL_MIN_RED = _glcanvas.WX_GL_MIN_RED
|
||||
WX_GL_MIN_GREEN = _glcanvas.WX_GL_MIN_GREEN
|
||||
WX_GL_MIN_BLUE = _glcanvas.WX_GL_MIN_BLUE
|
||||
WX_GL_MIN_ALPHA = _glcanvas.WX_GL_MIN_ALPHA
|
||||
WX_GL_DEPTH_SIZE = _glcanvas.WX_GL_DEPTH_SIZE
|
||||
WX_GL_STENCIL_SIZE = _glcanvas.WX_GL_STENCIL_SIZE
|
||||
WX_GL_MIN_ACCUM_RED = _glcanvas.WX_GL_MIN_ACCUM_RED
|
||||
WX_GL_MIN_ACCUM_GREEN = _glcanvas.WX_GL_MIN_ACCUM_GREEN
|
||||
WX_GL_MIN_ACCUM_BLUE = _glcanvas.WX_GL_MIN_ACCUM_BLUE
|
||||
WX_GL_MIN_ACCUM_ALPHA = _glcanvas.WX_GL_MIN_ACCUM_ALPHA
|
||||
class GLCanvas(_core.Window):
|
||||
"""Proxy of C++ GLCanvas class"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
__repr__ = _swig_repr
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""
|
||||
__init__(self, Window parent, int id=-1, int attribList=None, Point pos=DefaultPosition,
|
||||
Size size=DefaultSize,
|
||||
long style=0, String name=GLCanvasNameStr, Palette palette=wxNullPalette) -> GLCanvas
|
||||
"""
|
||||
_glcanvas.GLCanvas_swiginit(self,_glcanvas.new_GLCanvas(*args, **kwargs))
|
||||
self._setOORInfo(self)
|
||||
|
||||
def Create(*args, **kwargs):
|
||||
"""
|
||||
Create(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition,
|
||||
Size size=DefaultSize, long style=0, String name=wxGLCanvasName,
|
||||
int attribList=None,
|
||||
Palette palette=wxNullPalette) -> bool
|
||||
"""
|
||||
return _glcanvas.GLCanvas_Create(*args, **kwargs)
|
||||
|
||||
def SetColour(*args, **kwargs):
|
||||
"""SetColour(self, String colour)"""
|
||||
return _glcanvas.GLCanvas_SetColour(*args, **kwargs)
|
||||
|
||||
def SwapBuffers(*args, **kwargs):
|
||||
"""SwapBuffers(self)"""
|
||||
return _glcanvas.GLCanvas_SwapBuffers(*args, **kwargs)
|
||||
|
||||
def GetContext(*args, **kwargs):
|
||||
"""GetContext(self) -> GLContext"""
|
||||
return _glcanvas.GLCanvas_GetContext(*args, **kwargs)
|
||||
|
||||
def SetCurrent(*args):
|
||||
"""
|
||||
SetCurrent(self, GLContext context)
|
||||
SetCurrent(self)
|
||||
"""
|
||||
return _glcanvas.GLCanvas_SetCurrent(*args)
|
||||
|
||||
def InitVisual(*args, **kwargs):
|
||||
"""InitVisual(self, int attribList) -> bool"""
|
||||
return _glcanvas.GLCanvas_InitVisual(*args, **kwargs)
|
||||
|
||||
Context = property(GetContext,doc="See `GetContext`")
|
||||
_glcanvas.GLCanvas_swigregister(GLCanvas)
|
||||
|
||||
def GLCanvasWithContext(*args, **kwargs):
|
||||
"""
|
||||
GLCanvasWithContext(Window parent, GLContext shared=None, int id=-1, Point pos=DefaultPosition,
|
||||
Size size=DefaultSize,
|
||||
long style=0, String name=GLCanvasNameStr,
|
||||
int attribList=None, Palette palette=wxNullPalette) -> GLCanvas
|
||||
"""
|
||||
val = _glcanvas.new_GLCanvasWithContext(*args, **kwargs)
|
||||
val._setOORInfo(val)
|
||||
return val
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,150 +0,0 @@
|
|||
# This file was created automatically by SWIG 1.3.29.
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
`GLCanvas` provides an OpenGL Context on a `wx.Window`.
|
||||
"""
|
||||
|
||||
import _glcanvas
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if (name == "this"):
|
||||
if type(value).__name__ == 'PySwigObject':
|
||||
self.__dict__[name] = value
|
||||
return
|
||||
method = class_type.__swig_setmethods__.get(name,None)
|
||||
if method: return method(self,value)
|
||||
if (not static) or hasattr(self,name):
|
||||
self.__dict__[name] = value
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
|
||||
def _swig_setattr(self,class_type,name,value):
|
||||
return _swig_setattr_nondynamic(self,class_type,name,value,0)
|
||||
|
||||
def _swig_getattr(self,class_type,name):
|
||||
if (name == "thisown"): return self.this.own()
|
||||
method = class_type.__swig_getmethods__.get(name,None)
|
||||
if method: return method(self)
|
||||
raise AttributeError,name
|
||||
|
||||
def _swig_repr(self):
|
||||
try: strthis = "proxy of " + self.this.__repr__()
|
||||
except: strthis = ""
|
||||
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
|
||||
|
||||
import types
|
||||
try:
|
||||
_object = types.ObjectType
|
||||
_newclass = 1
|
||||
except AttributeError:
|
||||
class _object : pass
|
||||
_newclass = 0
|
||||
del types
|
||||
|
||||
|
||||
def _swig_setattr_nondynamic_method(set):
|
||||
def set_attr(self,name,value):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if hasattr(self,name) or (name == "this"):
|
||||
set(self,name,value)
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
return set_attr
|
||||
|
||||
|
||||
import _core
|
||||
wx = _core
|
||||
__docfilter__ = wx.__DocFilter(globals())
|
||||
class GLContext(_core.Object):
|
||||
"""Proxy of C++ GLContext class"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
__repr__ = _swig_repr
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""__init__(self, GLCanvas win, GLContext other=None) -> GLContext"""
|
||||
_glcanvas.GLContext_swiginit(self,_glcanvas.new_GLContext(*args, **kwargs))
|
||||
__swig_destroy__ = _glcanvas.delete_GLContext
|
||||
__del__ = lambda self : None;
|
||||
def SetCurrent(*args, **kwargs):
|
||||
"""SetCurrent(self, GLCanvas win)"""
|
||||
return _glcanvas.GLContext_SetCurrent(*args, **kwargs)
|
||||
|
||||
_glcanvas.GLContext_swigregister(GLContext)
|
||||
cvar = _glcanvas.cvar
|
||||
GLCanvasNameStr = cvar.GLCanvasNameStr
|
||||
|
||||
WX_GL_RGBA = _glcanvas.WX_GL_RGBA
|
||||
WX_GL_BUFFER_SIZE = _glcanvas.WX_GL_BUFFER_SIZE
|
||||
WX_GL_LEVEL = _glcanvas.WX_GL_LEVEL
|
||||
WX_GL_DOUBLEBUFFER = _glcanvas.WX_GL_DOUBLEBUFFER
|
||||
WX_GL_STEREO = _glcanvas.WX_GL_STEREO
|
||||
WX_GL_AUX_BUFFERS = _glcanvas.WX_GL_AUX_BUFFERS
|
||||
WX_GL_MIN_RED = _glcanvas.WX_GL_MIN_RED
|
||||
WX_GL_MIN_GREEN = _glcanvas.WX_GL_MIN_GREEN
|
||||
WX_GL_MIN_BLUE = _glcanvas.WX_GL_MIN_BLUE
|
||||
WX_GL_MIN_ALPHA = _glcanvas.WX_GL_MIN_ALPHA
|
||||
WX_GL_DEPTH_SIZE = _glcanvas.WX_GL_DEPTH_SIZE
|
||||
WX_GL_STENCIL_SIZE = _glcanvas.WX_GL_STENCIL_SIZE
|
||||
WX_GL_MIN_ACCUM_RED = _glcanvas.WX_GL_MIN_ACCUM_RED
|
||||
WX_GL_MIN_ACCUM_GREEN = _glcanvas.WX_GL_MIN_ACCUM_GREEN
|
||||
WX_GL_MIN_ACCUM_BLUE = _glcanvas.WX_GL_MIN_ACCUM_BLUE
|
||||
WX_GL_MIN_ACCUM_ALPHA = _glcanvas.WX_GL_MIN_ACCUM_ALPHA
|
||||
class GLCanvas(_core.Window):
|
||||
"""Proxy of C++ GLCanvas class"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
__repr__ = _swig_repr
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""
|
||||
__init__(self, Window parent, int id=-1, int attribList=None, Point pos=DefaultPosition,
|
||||
Size size=DefaultSize,
|
||||
long style=0, String name=GLCanvasNameStr, Palette palette=wxNullPalette) -> GLCanvas
|
||||
"""
|
||||
_glcanvas.GLCanvas_swiginit(self,_glcanvas.new_GLCanvas(*args, **kwargs))
|
||||
self._setOORInfo(self)
|
||||
|
||||
def Create(*args, **kwargs):
|
||||
"""
|
||||
Create(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition,
|
||||
Size size=DefaultSize, long style=0, String name=wxGLCanvasName,
|
||||
int attribList=None,
|
||||
Palette palette=wxNullPalette) -> bool
|
||||
"""
|
||||
return _glcanvas.GLCanvas_Create(*args, **kwargs)
|
||||
|
||||
def SetColour(*args, **kwargs):
|
||||
"""SetColour(self, String colour)"""
|
||||
return _glcanvas.GLCanvas_SetColour(*args, **kwargs)
|
||||
|
||||
def SwapBuffers(*args, **kwargs):
|
||||
"""SwapBuffers(self)"""
|
||||
return _glcanvas.GLCanvas_SwapBuffers(*args, **kwargs)
|
||||
|
||||
def GetContext(*args, **kwargs):
|
||||
"""GetContext(self) -> GLContext"""
|
||||
return _glcanvas.GLCanvas_GetContext(*args, **kwargs)
|
||||
|
||||
def SetCurrent(*args):
|
||||
"""
|
||||
SetCurrent(self, GLContext context)
|
||||
SetCurrent(self)
|
||||
"""
|
||||
return _glcanvas.GLCanvas_SetCurrent(*args)
|
||||
|
||||
Context = property(GetContext,doc="See `GetContext`")
|
||||
_glcanvas.GLCanvas_swigregister(GLCanvas)
|
||||
|
||||
def GLCanvasWithContext(*args, **kwargs):
|
||||
"""
|
||||
GLCanvasWithContext(Window parent, GLContext shared=None, int id=-1, Point pos=DefaultPosition,
|
||||
Size size=DefaultSize,
|
||||
long style=0, String name=GLCanvasNameStr,
|
||||
int attribList=None, Palette palette=wxNullPalette) -> GLCanvas
|
||||
"""
|
||||
val = _glcanvas.new_GLCanvasWithContext(*args, **kwargs)
|
||||
val._setOORInfo(val)
|
||||
return val
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,162 +0,0 @@
|
|||
# This file was created automatically by SWIG 1.3.29.
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
`GLCanvas` provides an OpenGL Context on a `wx.Window`.
|
||||
"""
|
||||
|
||||
import _glcanvas
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if (name == "this"):
|
||||
if type(value).__name__ == 'PySwigObject':
|
||||
self.__dict__[name] = value
|
||||
return
|
||||
method = class_type.__swig_setmethods__.get(name,None)
|
||||
if method: return method(self,value)
|
||||
if (not static) or hasattr(self,name):
|
||||
self.__dict__[name] = value
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
|
||||
def _swig_setattr(self,class_type,name,value):
|
||||
return _swig_setattr_nondynamic(self,class_type,name,value,0)
|
||||
|
||||
def _swig_getattr(self,class_type,name):
|
||||
if (name == "thisown"): return self.this.own()
|
||||
method = class_type.__swig_getmethods__.get(name,None)
|
||||
if method: return method(self)
|
||||
raise AttributeError,name
|
||||
|
||||
def _swig_repr(self):
|
||||
try: strthis = "proxy of " + self.this.__repr__()
|
||||
except: strthis = ""
|
||||
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
|
||||
|
||||
import types
|
||||
try:
|
||||
_object = types.ObjectType
|
||||
_newclass = 1
|
||||
except AttributeError:
|
||||
class _object : pass
|
||||
_newclass = 0
|
||||
del types
|
||||
|
||||
|
||||
def _swig_setattr_nondynamic_method(set):
|
||||
def set_attr(self,name,value):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if hasattr(self,name) or (name == "this"):
|
||||
set(self,name,value)
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
return set_attr
|
||||
|
||||
|
||||
import _core
|
||||
wx = _core
|
||||
__docfilter__ = wx.__DocFilter(globals())
|
||||
class GLContext(_core.Object):
|
||||
"""Proxy of C++ GLContext class"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
__repr__ = _swig_repr
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""__init__(self, GLCanvas win, GLContext other=None) -> GLContext"""
|
||||
_glcanvas.GLContext_swiginit(self,_glcanvas.new_GLContext(*args, **kwargs))
|
||||
__swig_destroy__ = _glcanvas.delete_GLContext
|
||||
__del__ = lambda self : None;
|
||||
def SetCurrent(*args, **kwargs):
|
||||
"""SetCurrent(self, GLCanvas win)"""
|
||||
return _glcanvas.GLContext_SetCurrent(*args, **kwargs)
|
||||
|
||||
_glcanvas.GLContext_swigregister(GLContext)
|
||||
cvar = _glcanvas.cvar
|
||||
GLCanvasNameStr = cvar.GLCanvasNameStr
|
||||
|
||||
WX_GL_RGBA = _glcanvas.WX_GL_RGBA
|
||||
WX_GL_BUFFER_SIZE = _glcanvas.WX_GL_BUFFER_SIZE
|
||||
WX_GL_LEVEL = _glcanvas.WX_GL_LEVEL
|
||||
WX_GL_DOUBLEBUFFER = _glcanvas.WX_GL_DOUBLEBUFFER
|
||||
WX_GL_STEREO = _glcanvas.WX_GL_STEREO
|
||||
WX_GL_AUX_BUFFERS = _glcanvas.WX_GL_AUX_BUFFERS
|
||||
WX_GL_MIN_RED = _glcanvas.WX_GL_MIN_RED
|
||||
WX_GL_MIN_GREEN = _glcanvas.WX_GL_MIN_GREEN
|
||||
WX_GL_MIN_BLUE = _glcanvas.WX_GL_MIN_BLUE
|
||||
WX_GL_MIN_ALPHA = _glcanvas.WX_GL_MIN_ALPHA
|
||||
WX_GL_DEPTH_SIZE = _glcanvas.WX_GL_DEPTH_SIZE
|
||||
WX_GL_STENCIL_SIZE = _glcanvas.WX_GL_STENCIL_SIZE
|
||||
WX_GL_MIN_ACCUM_RED = _glcanvas.WX_GL_MIN_ACCUM_RED
|
||||
WX_GL_MIN_ACCUM_GREEN = _glcanvas.WX_GL_MIN_ACCUM_GREEN
|
||||
WX_GL_MIN_ACCUM_BLUE = _glcanvas.WX_GL_MIN_ACCUM_BLUE
|
||||
WX_GL_MIN_ACCUM_ALPHA = _glcanvas.WX_GL_MIN_ACCUM_ALPHA
|
||||
class GLCanvas(_core.Window):
|
||||
"""Proxy of C++ GLCanvas class"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
__repr__ = _swig_repr
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""
|
||||
__init__(self, Window parent, int id=-1, int attribList=None, Point pos=DefaultPosition,
|
||||
Size size=DefaultSize,
|
||||
long style=0, String name=GLCanvasNameStr, Palette palette=wxNullPalette) -> GLCanvas
|
||||
"""
|
||||
_glcanvas.GLCanvas_swiginit(self,_glcanvas.new_GLCanvas(*args, **kwargs))
|
||||
self._setOORInfo(self)
|
||||
|
||||
def Create(*args, **kwargs):
|
||||
"""
|
||||
Create(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition,
|
||||
Size size=DefaultSize, long style=0, String name=wxGLCanvasName,
|
||||
int attribList=None,
|
||||
Palette palette=wxNullPalette) -> bool
|
||||
"""
|
||||
return _glcanvas.GLCanvas_Create(*args, **kwargs)
|
||||
|
||||
def SetColour(*args, **kwargs):
|
||||
"""SetColour(self, String colour)"""
|
||||
return _glcanvas.GLCanvas_SetColour(*args, **kwargs)
|
||||
|
||||
def SwapBuffers(*args, **kwargs):
|
||||
"""SwapBuffers(self)"""
|
||||
return _glcanvas.GLCanvas_SwapBuffers(*args, **kwargs)
|
||||
|
||||
def GetContext(*args, **kwargs):
|
||||
"""GetContext(self) -> GLContext"""
|
||||
return _glcanvas.GLCanvas_GetContext(*args, **kwargs)
|
||||
|
||||
def SetCurrent(*args):
|
||||
"""
|
||||
SetCurrent(self, GLContext context)
|
||||
SetCurrent(self)
|
||||
"""
|
||||
return _glcanvas.GLCanvas_SetCurrent(*args)
|
||||
|
||||
def SetupPalette(*args, **kwargs):
|
||||
"""SetupPalette(self, Palette palette)"""
|
||||
return _glcanvas.GLCanvas_SetupPalette(*args, **kwargs)
|
||||
|
||||
def CreateDefaultPalette(*args, **kwargs):
|
||||
"""CreateDefaultPalette(self) -> Palette"""
|
||||
return _glcanvas.GLCanvas_CreateDefaultPalette(*args, **kwargs)
|
||||
|
||||
def GetPalette(*args, **kwargs):
|
||||
"""GetPalette(self) -> Palette"""
|
||||
return _glcanvas.GLCanvas_GetPalette(*args, **kwargs)
|
||||
|
||||
Context = property(GetContext,doc="See `GetContext`")
|
||||
_glcanvas.GLCanvas_swigregister(GLCanvas)
|
||||
|
||||
def GLCanvasWithContext(*args, **kwargs):
|
||||
"""
|
||||
GLCanvasWithContext(Window parent, GLContext shared=None, int id=-1, Point pos=DefaultPosition,
|
||||
Size size=DefaultSize,
|
||||
long style=0, String name=GLCanvasNameStr,
|
||||
int attribList=None, Palette palette=wxNullPalette) -> GLCanvas
|
||||
"""
|
||||
val = _glcanvas.new_GLCanvasWithContext(*args, **kwargs)
|
||||
val._setOORInfo(val)
|
||||
return val
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,410 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: oglbasic.i
|
||||
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
|
||||
//
|
||||
// Author: Robin Dunn
|
||||
//
|
||||
// Created: 3-Sept-1999
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 by Total Control Software
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// Not a %module
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
%newgroup;
|
||||
|
||||
|
||||
class wxShapeRegion : public wxObject {
|
||||
public:
|
||||
wxShapeRegion();
|
||||
//~wxShapeRegion();
|
||||
|
||||
void SetText(const wxString& s);
|
||||
void SetFont(wxFont *f);
|
||||
void SetMinSize(double w, double h);
|
||||
void SetSize(double w, double h);
|
||||
void SetPosition(double x, double y);
|
||||
void SetProportions(double x, double y);
|
||||
void SetFormatMode(int mode);
|
||||
void SetName(const wxString& s);
|
||||
void SetColour(const wxString& col);
|
||||
|
||||
wxString GetText();
|
||||
wxFont *GetFont();
|
||||
void GetMinSize(double *OUTPUT, double *OUTPUT);
|
||||
void GetProportion(double *OUTPUT, double *OUTPUT);
|
||||
void GetSize(double *OUTPUT, double *OUTPUT);
|
||||
void GetPosition(double *OUTPUT, double *OUTPUT);
|
||||
int GetFormatMode();
|
||||
wxString GetName();
|
||||
wxString GetColour();
|
||||
wxColour GetActualColourObject();
|
||||
wxList& GetFormattedText();
|
||||
wxString GetPenColour();
|
||||
int GetPenStyle();
|
||||
void SetPenStyle(int style);
|
||||
void SetPenColour(const wxString& col);
|
||||
wxPen *GetActualPen();
|
||||
double GetWidth();
|
||||
double GetHeight();
|
||||
|
||||
void ClearText();
|
||||
};
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
* User-defined attachment point
|
||||
*/
|
||||
|
||||
class wxAttachmentPoint: public wxObject
|
||||
{
|
||||
public:
|
||||
wxAttachmentPoint(int id=0, double x=0.0, double y=0.0);
|
||||
int m_id; // Identifier
|
||||
double m_x; // x offset from centre of object
|
||||
double m_y; // y offset from centre of object
|
||||
};
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%{
|
||||
WXSHAPE_IMP_CALLBACKS(wxPyShapeEvtHandler,wxShapeEvtHandler);
|
||||
%}
|
||||
|
||||
|
||||
class wxPyShapeEvtHandler : public wxObject {
|
||||
public:
|
||||
%pythonAppend wxPyShapeEvtHandler "self._setOORandCallbackInfo(PyShapeEvtHandler)"
|
||||
%typemap(out) wxPyShapeEvtHandler*; // turn off this typemap
|
||||
|
||||
wxPyShapeEvtHandler(wxPyShapeEvtHandler *prev = NULL,
|
||||
wxPyShape *shape = NULL);
|
||||
|
||||
%typemap(out) wxPyShapeEvtHandler* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
|
||||
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
%extend {
|
||||
void _setOORInfo(PyObject* _self) {
|
||||
self->SetClientObject(new wxPyOORClientData(_self));
|
||||
}
|
||||
}
|
||||
%pythoncode {
|
||||
def _setOORandCallbackInfo(self, _class):
|
||||
self._setOORInfo(self)
|
||||
self._setCallbackInfo(self, _class)
|
||||
}
|
||||
|
||||
|
||||
void SetShape(wxPyShape *sh);
|
||||
wxPyShape *GetShape();
|
||||
void SetPreviousHandler(wxPyShapeEvtHandler* handler);
|
||||
wxPyShapeEvtHandler* GetPreviousHandler();
|
||||
wxPyShapeEvtHandler* CreateNewCopy();
|
||||
|
||||
void base_OnDelete();
|
||||
void base_OnDraw(wxDC& dc);
|
||||
void base_OnDrawContents(wxDC& dc);
|
||||
void base_OnDrawBranches(wxDC& dc, bool erase = false);
|
||||
void base_OnMoveLinks(wxDC& dc);
|
||||
void base_OnErase(wxDC& dc);
|
||||
void base_OnEraseContents(wxDC& dc);
|
||||
void base_OnHighlight(wxDC& dc);
|
||||
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnSize(double x, double y);
|
||||
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||
void base_OnDrawControlPoints(wxDC& dc);
|
||||
void base_OnEraseControlPoints(wxDC& dc);
|
||||
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true);
|
||||
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginSize(double w, double h);
|
||||
void base_OnEndSize(double w, double h);
|
||||
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
%{
|
||||
WXSHAPE_IMP_CALLBACKS(wxPyShape, wxShape);
|
||||
%}
|
||||
|
||||
|
||||
class wxPyShape : public wxPyShapeEvtHandler {
|
||||
public:
|
||||
%pythonAppend wxPyShape "self._setOORandCallbackInfo(PyShape)"
|
||||
%typemap(out) wxPyShape*; // turn off this typemap
|
||||
|
||||
wxPyShape(wxPyShapeCanvas *can = NULL);
|
||||
|
||||
%typemap(out) wxPyShape* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
void GetBoundingBoxMax(double *OUTPUT, double *OUTPUT);
|
||||
void GetBoundingBoxMin(double *OUTPUT, double *OUTPUT);
|
||||
bool GetPerimeterPoint(double x1, double y1,
|
||||
double x2, double y2,
|
||||
double *OUTPUT, double *OUTPUT);
|
||||
wxPyShapeCanvas *GetCanvas();
|
||||
void SetCanvas(wxPyShapeCanvas *the_canvas);
|
||||
void AddToCanvas(wxPyShapeCanvas *the_canvas, wxPyShape *addAfter = NULL);
|
||||
void InsertInCanvas(wxPyShapeCanvas *the_canvas);
|
||||
void RemoveFromCanvas(wxPyShapeCanvas *the_canvas);
|
||||
double GetX();
|
||||
double GetY();
|
||||
void SetX(double x);
|
||||
void SetY(double y);
|
||||
wxPyShape *GetParent();
|
||||
void SetParent(wxPyShape *p);
|
||||
wxPyShape *GetTopAncestor();
|
||||
|
||||
|
||||
// wxList& GetChildren();
|
||||
%extend {
|
||||
PyObject* GetChildren() {
|
||||
wxList& list = self->GetChildren();
|
||||
return wxPy_ConvertShapeList(&list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Unlink();
|
||||
void SetDrawHandles(bool drawH);
|
||||
bool GetDrawHandles();
|
||||
void MakeControlPoints();
|
||||
void DeleteControlPoints(wxDC *dc = NULL);
|
||||
void ResetControlPoints();
|
||||
wxPyShapeEvtHandler *GetEventHandler();
|
||||
void SetEventHandler(wxPyShapeEvtHandler *handler);
|
||||
void MakeMandatoryControlPoints();
|
||||
void ResetMandatoryControlPoints();
|
||||
bool Recompute();
|
||||
void CalculateSize();
|
||||
void Select(bool select = true, wxDC* dc = NULL);
|
||||
void SetHighlight(bool hi = true, bool recurse = false);
|
||||
bool IsHighlighted() ;
|
||||
bool Selected();
|
||||
bool AncestorSelected();
|
||||
void SetSensitivityFilter(int sens = OP_ALL, bool recursive = false);
|
||||
int GetSensitivityFilter();
|
||||
void SetDraggable(bool drag, bool recursive = false);
|
||||
void SetFixedSize(bool x, bool y);
|
||||
void GetFixedSize(bool *OUTPUT, bool *OUTPUT) ;
|
||||
bool GetFixedWidth();
|
||||
bool GetFixedHeight();
|
||||
void SetSpaceAttachments(bool sp);
|
||||
bool GetSpaceAttachments() ;
|
||||
void SetShadowMode(int mode, bool redraw = false);
|
||||
int GetShadowMode();
|
||||
bool HitTest(double x, double y, int *OUTPUT, double *OUTPUT);
|
||||
void SetCentreResize(bool cr);
|
||||
bool GetCentreResize();
|
||||
void SetMaintainAspectRatio(bool ar);
|
||||
bool GetMaintainAspectRatio();
|
||||
|
||||
|
||||
// wxList& GetLines();
|
||||
%extend {
|
||||
PyObject* GetLines() {
|
||||
wxList& list = self->GetLines();
|
||||
return wxPy_ConvertShapeList(&list);
|
||||
}
|
||||
}
|
||||
|
||||
void SetDisableLabel(bool flag);
|
||||
bool GetDisableLabel();
|
||||
void SetAttachmentMode(int mode);
|
||||
int GetAttachmentMode();
|
||||
void SetId(long i);
|
||||
long GetId();
|
||||
|
||||
void SetPen(wxPen *pen);
|
||||
void SetBrush(wxBrush *brush);
|
||||
|
||||
|
||||
// void SetClientData(wxObject *client_data);
|
||||
// wxObject *GetClientData();
|
||||
|
||||
// The real client data methods are being used for OOR, so just fake it.
|
||||
%pythoncode {
|
||||
def SetClientData(self, data):
|
||||
self.clientData = data
|
||||
def GetClientData(self):
|
||||
if hasattr(self, 'clientData'):
|
||||
return self.clientData
|
||||
else:
|
||||
return None
|
||||
}
|
||||
|
||||
void Show(bool show);
|
||||
bool IsShown();
|
||||
void Move(wxDC& dc, double x1, double y1, bool display = true);
|
||||
void Erase(wxDC& dc);
|
||||
void EraseContents(wxDC& dc);
|
||||
void Draw(wxDC& dc);
|
||||
void Flash();
|
||||
void MoveLinks(wxDC& dc);
|
||||
void DrawContents(wxDC& dc);
|
||||
void SetSize(double x, double y, bool recursive = true);
|
||||
void SetAttachmentSize(double x, double y);
|
||||
void Attach(wxPyShapeCanvas *can);
|
||||
void Detach();
|
||||
bool Constrain();
|
||||
void AddLine(wxPyLineShape *line, wxPyShape *other,
|
||||
int attachFrom = 0, int attachTo = 0,
|
||||
int positionFrom = -1, int positionTo = -1);
|
||||
int GetLinePosition(wxPyLineShape* line);
|
||||
void AddText(const wxString& string);
|
||||
wxPen *GetPen();
|
||||
wxBrush *GetBrush();
|
||||
void SetDefaultRegionSize();
|
||||
void FormatText(wxDC& dc, const wxString& s, int regionId = 0);
|
||||
void SetFormatMode(int mode, int regionId = 0);
|
||||
int GetFormatMode(int regionId = 0);
|
||||
void SetFont(wxFont *font, int regionId = 0);
|
||||
wxFont *GetFont(int regionId = 0);
|
||||
void SetTextColour(const wxString& colour, int regionId = 0);
|
||||
wxString GetTextColour(int regionId = 0);
|
||||
int GetNumberOfTextRegions();
|
||||
void SetRegionName(const wxString& name, int regionId = 0);
|
||||
wxString GetRegionName(int regionId);
|
||||
int GetRegionId(const wxString& name);
|
||||
void NameRegions(const wxString& parentName = wxPyEmptyString);
|
||||
|
||||
// wxList& GetRegions();
|
||||
%extend {
|
||||
PyObject* GetRegions() {
|
||||
wxList& list = self->GetRegions();
|
||||
return wxPy_ConvertList(&list);
|
||||
}
|
||||
}
|
||||
|
||||
void AddRegion(wxShapeRegion *region);
|
||||
void ClearRegions();
|
||||
void AssignNewIds();
|
||||
wxPyShape *FindRegion(const wxString& regionName, int *OUTPUT);
|
||||
void FindRegionNames(wxStringList& list);
|
||||
void ClearText(int regionId = 0);
|
||||
void RemoveLine(wxPyLineShape *line);
|
||||
|
||||
#ifdef wxUSE_PROLOGIO
|
||||
void WriteAttributes(wxExpr *clause);
|
||||
void ReadAttributes(wxExpr *clause);
|
||||
void ReadConstraints(wxExpr *clause, wxExprDatabase *database);
|
||||
void WriteRegions(wxExpr *clause);
|
||||
void ReadRegions(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
bool GetAttachmentPosition(int attachment, double *OUTPUT, double *OUTPUT,
|
||||
int nth = 0, int no_arcs = 1, wxPyLineShape *line = NULL);
|
||||
int GetNumberOfAttachments();
|
||||
bool AttachmentIsValid(int attachment);
|
||||
|
||||
%extend {
|
||||
PyObject* GetAttachments() {
|
||||
wxList& list = self->GetAttachments();
|
||||
return wxPy_ConvertList(&list);
|
||||
}
|
||||
}
|
||||
|
||||
bool GetAttachmentPositionEdge(int attachment, double *OUTPUT, double *OUTPUT,
|
||||
int nth = 0, int no_arcs = 1, wxPyLineShape *line = NULL);
|
||||
wxRealPoint CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPoint& pt2,
|
||||
int nth, int noArcs, wxPyLineShape* line);
|
||||
bool AttachmentSortTest(int attachmentPoint, const wxRealPoint& pt1, const wxRealPoint& pt2);
|
||||
void EraseLinks(wxDC& dc, int attachment = -1, bool recurse = false);
|
||||
void DrawLinks(wxDC& dc, int attachment = -1, bool recurse = false);
|
||||
bool MoveLineToNewAttachment(wxDC& dc, wxPyLineShape *to_move,
|
||||
double x, double y);
|
||||
|
||||
//void ApplyAttachmentOrdering(wxList& linesToSort);
|
||||
%extend {
|
||||
void ApplyAttachmentOrdering(PyObject* linesToSort) {
|
||||
wxList* list = wxPy_wxListHelper(linesToSort, wxT("wxPyLineShape"));
|
||||
self->ApplyAttachmentOrdering(*list);
|
||||
delete list;
|
||||
}
|
||||
}
|
||||
|
||||
wxRealPoint GetBranchingAttachmentRoot(int attachment);
|
||||
bool GetBranchingAttachmentInfo(int attachment, wxRealPoint& root, wxRealPoint& neck,
|
||||
wxRealPoint& shoulder1, wxRealPoint& shoulder2);
|
||||
bool GetBranchingAttachmentPoint(int attachment, int n, wxRealPoint& attachmentPoint,
|
||||
wxRealPoint& stemPoint);
|
||||
int GetAttachmentLineCount(int attachment);
|
||||
void SetBranchNeckLength(int len);
|
||||
int GetBranchNeckLength();
|
||||
void SetBranchStemLength(int len);
|
||||
int GetBranchStemLength();
|
||||
void SetBranchSpacing(int len);
|
||||
int GetBranchSpacing();
|
||||
void SetBranchStyle(long style);
|
||||
long GetBranchStyle();
|
||||
int PhysicalToLogicalAttachment(int physicalAttachment);
|
||||
int LogicalToPhysicalAttachment(int logicalAttachment);
|
||||
bool Draggable();
|
||||
bool HasDescendant(wxPyShape *image);
|
||||
wxPyShape *CreateNewCopy(bool resetMapping = true, bool recompute = true);
|
||||
void Copy(wxPyShape& copy);
|
||||
void CopyWithHandler(wxPyShape& copy);
|
||||
void Rotate(double x, double y, double theta);
|
||||
double GetRotation();
|
||||
void SetRotation(double rotation);
|
||||
void ClearAttachments();
|
||||
void Recentre(wxDC& dc);
|
||||
void ClearPointList(wxList& list);
|
||||
wxPen GetBackgroundPen();
|
||||
wxBrush GetBackgroundBrush();
|
||||
|
||||
void base_OnDelete();
|
||||
void base_OnDraw(wxDC& dc);
|
||||
void base_OnDrawContents(wxDC& dc);
|
||||
void base_OnDrawBranches(wxDC& dc, bool erase = false);
|
||||
void base_OnMoveLinks(wxDC& dc);
|
||||
void base_OnErase(wxDC& dc);
|
||||
void base_OnEraseContents(wxDC& dc);
|
||||
void base_OnHighlight(wxDC& dc);
|
||||
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnSize(double x, double y);
|
||||
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||
void base_OnDrawControlPoints(wxDC& dc);
|
||||
void base_OnEraseControlPoints(wxDC& dc);
|
||||
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true);
|
||||
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginSize(double w, double h);
|
||||
void base_OnEndSize(double w, double h);
|
||||
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
|
@ -1,161 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: oglcanvas.i
|
||||
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
|
||||
//
|
||||
// Author: Robin Dunn
|
||||
//
|
||||
// Created: 7-Sept-1999
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 by Total Control Software
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// not a %module
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
%{
|
||||
// Put some wx default wxChar* values into wxStrings.
|
||||
DECLARE_DEF_STRING(ShapeCanvasNameStr);
|
||||
%}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class wxDiagram : public wxObject {
|
||||
public:
|
||||
wxDiagram();
|
||||
//~wxDiagram();
|
||||
|
||||
void AddShape(wxPyShape* shape, wxPyShape *addAfter = NULL);
|
||||
void Clear(wxDC& dc);
|
||||
void DeleteAllShapes();
|
||||
void DrawOutline(wxDC& dc, double x1, double y1, double x2, double y2);
|
||||
wxPyShape* FindShape(long id);
|
||||
wxPyShapeCanvas* GetCanvas();
|
||||
int GetCount();
|
||||
double GetGridSpacing();
|
||||
int GetMouseTolerance();
|
||||
|
||||
// wxList* GetShapeList();
|
||||
%extend {
|
||||
PyObject* GetShapeList() {
|
||||
wxList* list = self->GetShapeList();
|
||||
return wxPy_ConvertShapeList(list);
|
||||
}
|
||||
}
|
||||
|
||||
bool GetQuickEditMode();
|
||||
bool GetSnapToGrid();
|
||||
void InsertShape(wxPyShape *shape);
|
||||
|
||||
#ifdef wxUSE_PROLOGIO
|
||||
bool LoadFile(const wxString& filename);
|
||||
bool SaveFile(const wxString& filename);
|
||||
#endif
|
||||
|
||||
#ifdef wxUSE_PROLOGIO
|
||||
// **** Have to deal with wxExpr and wxExprDatabase first...
|
||||
//void OnDatabaseLoad(wxExprDatabase& database);
|
||||
//void OnDatabaseSave(wxExprDatabase& database);
|
||||
//bool OnHeaderLoad(wxExprDatabase& database, wxExpr& expr);
|
||||
//bool OnHeaderSave(wxExprDatabase& database, wxExpr& expr);
|
||||
//bool OnShapeLoad(wxExprDatabase& database, wxPyShape& shape, wxExpr& expr);
|
||||
//bool OnShapeSave(wxExprDatabase& database, wxPyShape& shape, wxExpr& expr);
|
||||
#endif
|
||||
|
||||
#ifdef wxUSE_PROLOGIO
|
||||
void ReadContainerGeometry(wxExprDatabase& database);
|
||||
void ReadLines(wxExprDatabase& database);
|
||||
void ReadNodes(wxExprDatabase& database);
|
||||
#endif
|
||||
|
||||
void RecentreAll(wxDC& dc);
|
||||
void Redraw(wxDC& dc);
|
||||
void RemoveAllShapes();
|
||||
void RemoveShape(wxPyShape* shape);
|
||||
void SetCanvas(wxPyShapeCanvas* canvas);
|
||||
void SetGridSpacing(double spacing);
|
||||
void SetMouseTolerance(int tolerance);
|
||||
void SetQuickEditMode(bool mode);
|
||||
void SetSnapToGrid(bool snap);
|
||||
void ShowAll(bool show);
|
||||
void Snap(double *INOUT, double *INOUT);
|
||||
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%{
|
||||
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnBeginDragLeft);
|
||||
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnBeginDragRight);
|
||||
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnEndDragLeft);
|
||||
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnEndDragRight);
|
||||
IMP_PYCALLBACK__BOOL2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnDragLeft);
|
||||
IMP_PYCALLBACK__BOOL2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnDragRight);
|
||||
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnLeftClick);
|
||||
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnRightClick);
|
||||
%}
|
||||
|
||||
|
||||
MustHaveApp(wxPyShapeCanvas);
|
||||
|
||||
class wxPyShapeCanvas : public wxScrolledWindow {
|
||||
public:
|
||||
%pythonAppend wxPyShapeCanvas "self._setOORandCallbackInfo(PyShapeCanvas)"
|
||||
%typemap(out) wxPyShapeCanvas*; // turn off this typemap
|
||||
|
||||
wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxBORDER,
|
||||
const wxString& name = wxPyShapeCanvasNameStr);
|
||||
|
||||
%typemap(out) wxPyShapeCanvas* { $result = wxPyMake_wxObject($1, $owner); }
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
%pythoncode {
|
||||
def _setOORandCallbackInfo(self, _class):
|
||||
self._setOORInfo(self)
|
||||
self._setCallbackInfo(self, _class)
|
||||
}
|
||||
|
||||
void AddShape(wxPyShape *shape, wxPyShape *addAfter = NULL);
|
||||
|
||||
// **** Need a typemap for wxClassInfo, or fully implement wxObject, etc.....
|
||||
wxPyShape* FindShape(double x1, double y, int *OUTPUT,
|
||||
wxClassInfo *info = NULL, wxPyShape* notImage = NULL);
|
||||
|
||||
wxPyShape * FindFirstSensitiveShape(double x1, double y, int *OUTPUT, int op);
|
||||
wxDiagram* GetDiagram();
|
||||
|
||||
bool GetQuickEditMode();
|
||||
void InsertShape(wxPyShape* shape);
|
||||
|
||||
|
||||
void base_OnBeginDragLeft(double x, double y, int keys = 0);
|
||||
void base_OnBeginDragRight(double x, double y, int keys = 0);
|
||||
void base_OnEndDragLeft(double x, double y, int keys = 0);
|
||||
void base_OnEndDragRight(double x, double y, int keys = 0);
|
||||
void base_OnDragLeft(bool draw, double x, double y, int keys = 0);
|
||||
void base_OnDragRight(bool draw, double x, double y, int keys = 0);
|
||||
void base_OnLeftClick(double x, double y, int keys = 0);
|
||||
void base_OnRightClick(double x, double y, int keys = 0);
|
||||
|
||||
void Redraw(wxDC& dc);
|
||||
void RemoveShape(wxPyShape *shape);
|
||||
void SetDiagram(wxDiagram *diagram);
|
||||
void Snap(double *INOUT, double *INOUT);
|
||||
|
||||
|
||||
%pythoncode {
|
||||
def GetShapeList(self):
|
||||
return self.GetDiagram().GetShapeList()
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: _ogldefs.i
|
||||
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
|
||||
//
|
||||
// Author: Robin Dunn
|
||||
//
|
||||
// Created: 27-Aug-1999
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 by Total Control Software
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Typemaps just for OGL
|
||||
|
||||
|
||||
// OOR Support
|
||||
%typemap(out) wxPyShape* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
|
||||
%typemap(out) wxPyShapeEvtHandler* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
|
||||
%typemap(out) wxPyDivisionShape* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
|
||||
|
||||
%typemap(out) wxPyShapeCanvas* { $result = wxPyMake_wxObject($1, $owner); }
|
||||
%typemap(out) wxDiagram* { $result = wxPyMake_wxObject($1, $owner); }
|
||||
%typemap(out) wxOGLConstraint* { $result = wxPyMake_wxObject($1, $owner); }
|
||||
%typemap(out) wxPseudoMetaFile* { $result = wxPyMake_wxObject($1, $owner); }
|
||||
%typemap(out) wxArrowHead* { $result = wxPyMake_wxObject($1, $owner); }
|
||||
|
||||
|
||||
|
||||
|
||||
// wxOGL doesn't use a ref-counted copy of pens and brushes, so we'll
|
||||
// use the pen and brush lists to simulate that...
|
||||
|
||||
%typemap(in) wxPen* {
|
||||
wxPen* temp;
|
||||
if ($input) {
|
||||
if ($input == Py_None) { temp = NULL; }
|
||||
else if (! wxPyConvertSwigPtr($input, (void **) &temp, wxT("wxPen"))) {
|
||||
PyErr_SetString(PyExc_TypeError, "Type error, expected wxPen.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (temp)
|
||||
$1 = wxThePenList->FindOrCreatePen(temp->GetColour(),
|
||||
temp->GetWidth(),
|
||||
temp->GetStyle());
|
||||
else
|
||||
$1 = NULL;
|
||||
}
|
||||
|
||||
%typemap(in) wxBrush* {
|
||||
wxBrush* temp;
|
||||
if ($input) {
|
||||
if ($input == Py_None) { temp = NULL; }
|
||||
else if (! wxPyConvertSwigPtr($input, (void **) &temp, wxT("wxBrush"))) {
|
||||
PyErr_SetString(PyExc_TypeError, "Type error, expected wxBrush.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (temp)
|
||||
$1 = wxTheBrushList->FindOrCreateBrush(temp->GetColour(), temp->GetStyle());
|
||||
else
|
||||
$1 = NULL;
|
||||
}
|
||||
|
||||
|
||||
%typemap(in) wxFont* {
|
||||
wxFont* temp;
|
||||
if ($input) {
|
||||
if ($input == Py_None) { temp = NULL; }
|
||||
else if (! wxPyConvertSwigPtr($input, (void **) &temp, wxT("wxFont"))) {
|
||||
PyErr_SetString(PyExc_TypeError, "Type error, expected wxFont.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (temp)
|
||||
$1 = wxTheFontList->FindOrCreateFont(temp->GetPointSize(),
|
||||
temp->GetFamily(),
|
||||
temp->GetStyle(),
|
||||
temp->GetWeight(),
|
||||
temp->GetUnderlined(),
|
||||
temp->GetFaceName(),
|
||||
temp->GetEncoding());
|
||||
else
|
||||
$1 = NULL;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,613 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: oglshapes.i
|
||||
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
|
||||
//
|
||||
// Author: Robin Dunn
|
||||
//
|
||||
// Created: 3-Sept-1999
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 by Total Control Software
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// not a %module
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
enum {
|
||||
oglMETAFLAGS_OUTLINE,
|
||||
oglMETAFLAGS_ATTACHMENTS
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%typemap(in) (int points, wxPoint* points_array ) {
|
||||
$2 = wxPoint_LIST_helper($input, &$1);
|
||||
if ($2 == NULL) SWIG_fail;
|
||||
}
|
||||
%typemap(freearg) (int points, wxPoint* points_array ) {
|
||||
if ($2) delete [] $2;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class wxPseudoMetaFile : public wxObject {
|
||||
public:
|
||||
wxPseudoMetaFile();
|
||||
~wxPseudoMetaFile();
|
||||
|
||||
void Draw(wxDC& dc, double xoffset, double yoffset);
|
||||
#ifdef wxUSE_PROLOGIO
|
||||
void WriteAttributes(wxExpr *clause, int whichAngle);
|
||||
void ReadAttributes(wxExpr *clause, int whichAngle);
|
||||
#endif
|
||||
void Clear();
|
||||
void Copy(wxPseudoMetaFile& copy);
|
||||
void Scale(double sx, double sy);
|
||||
void ScaleTo(double w, double h);
|
||||
void Translate(double x, double y);
|
||||
void Rotate(double x, double y, double theta);
|
||||
bool LoadFromMetaFile(const wxString& filename, double *width, double *height);
|
||||
void GetBounds(double *minX, double *minY, double *maxX, double *maxY);
|
||||
void CalculateSize(wxPyDrawnShape* shape);
|
||||
|
||||
// **** fix these... is it even possible? these are lists of various GDI opperations (not the objects...)
|
||||
// wxList& GetOutlineColours();
|
||||
// wxList& GetFillColours();
|
||||
// wxList& GetOps();
|
||||
|
||||
void SetRotateable(bool rot);
|
||||
bool GetRotateable();
|
||||
void SetSize(double w, double h);
|
||||
void SetFillBrush(wxBrush* brush);
|
||||
wxBrush* GetFillBrush();
|
||||
void SetOutlinePen(wxPen* pen);
|
||||
wxPen* GetOutlinePen();
|
||||
void SetOutlineOp(int op);
|
||||
int GetOutlineOp();
|
||||
|
||||
|
||||
bool IsValid();
|
||||
void DrawLine(const wxPoint& pt1, const wxPoint& pt2);
|
||||
void DrawRectangle(const wxRect& rect);
|
||||
void DrawRoundedRectangle(const wxRect& rect, double radius);
|
||||
void DrawArc(const wxPoint& centrePt, const wxPoint& startPt, const wxPoint& endPt);
|
||||
void DrawEllipticArc(const wxRect& rect, double startAngle, double endAngle);
|
||||
void DrawEllipse(const wxRect& rect);
|
||||
void DrawPoint(const wxPoint& pt);
|
||||
void DrawText(const wxString& text, const wxPoint& pt);
|
||||
void DrawLines(int points, wxPoint* points_array);
|
||||
void DrawPolygon(int points, wxPoint* points_array, int flags = 0);
|
||||
void DrawSpline(int points, wxPoint* points_array);
|
||||
void SetClippingRect(const wxRect& rect);
|
||||
void DestroyClippingRect();
|
||||
void SetPen(wxPen* pen, bool isOutline = FALSE);
|
||||
void SetBrush(wxBrush* brush, bool isFill = FALSE);
|
||||
void SetFont(wxFont* font);
|
||||
void SetTextColour(const wxColour& colour);
|
||||
void SetBackgroundColour(const wxColour& colour);
|
||||
void SetBackgroundMode(int mode);
|
||||
};
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%{
|
||||
// Using this macro can sometimes provoke an Internal Compiler Error in MSVC
|
||||
// 6, so instead I'l just expand it out by hand...
|
||||
// WXSHAPE_IMP_CALLBACKS(wxPyRectangleShape, wxRectangleShape);
|
||||
|
||||
IMP_PYCALLBACK__ (wxPyRectangleShape, wxRectangleShape, OnDelete);
|
||||
IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnDraw);
|
||||
IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnDrawContents);
|
||||
IMP_PYCALLBACK__DCBOOL (wxPyRectangleShape, wxRectangleShape, OnDrawBranches);
|
||||
IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnMoveLinks);
|
||||
IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnErase);
|
||||
IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnEraseContents);
|
||||
IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnHighlight);
|
||||
IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnLeftClick);
|
||||
IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnLeftDoubleClick);
|
||||
IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnRightClick);
|
||||
IMP_PYCALLBACK__2DBL (wxPyRectangleShape, wxRectangleShape, OnSize);
|
||||
IMP_PYCALLBACK_BOOL_DC4DBLBOOL (wxPyRectangleShape, wxRectangleShape, OnMovePre);
|
||||
IMP_PYCALLBACK__DC4DBLBOOL (wxPyRectangleShape, wxRectangleShape, OnMovePost);
|
||||
IMP_PYCALLBACK__BOOL2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnDragLeft);
|
||||
IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnBeginDragLeft);
|
||||
IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnEndDragLeft);
|
||||
IMP_PYCALLBACK__BOOL2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnDragRight);
|
||||
IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnBeginDragRight);
|
||||
IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnEndDragRight);
|
||||
IMP_PYCALLBACK__DC4DBL (wxPyRectangleShape, wxRectangleShape, OnDrawOutline);
|
||||
IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnDrawControlPoints);
|
||||
IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnEraseControlPoints);
|
||||
IMP_PYCALLBACK__DCBOOL (wxPyRectangleShape, wxRectangleShape, OnMoveLink);
|
||||
IMP_PYCALLBACK__WXCPBOOL2DBL2INT(wxPyRectangleShape, wxRectangleShape, OnSizingDragLeft);
|
||||
IMP_PYCALLBACK__WXCP2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnSizingBeginDragLeft);
|
||||
IMP_PYCALLBACK__WXCP2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnSizingEndDragLeft);
|
||||
IMP_PYCALLBACK__2DBL (wxPyRectangleShape, wxRectangleShape, OnBeginSize);
|
||||
IMP_PYCALLBACK__2DBL (wxPyRectangleShape, wxRectangleShape, OnEndSize)
|
||||
|
||||
%}
|
||||
|
||||
class wxPyRectangleShape : public wxPyShape {
|
||||
public:
|
||||
%pythonAppend wxPyRectangleShape "self._setOORandCallbackInfo(PyRectangleShape)"
|
||||
|
||||
wxPyRectangleShape(double width = 0.0, double height = 0.0);
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
void SetCornerRadius(double radius);
|
||||
double GetCornerRadius();
|
||||
|
||||
void base_OnDelete();
|
||||
void base_OnDraw(wxDC& dc);
|
||||
void base_OnDrawContents(wxDC& dc);
|
||||
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||
void base_OnMoveLinks(wxDC& dc);
|
||||
void base_OnErase(wxDC& dc);
|
||||
void base_OnEraseContents(wxDC& dc);
|
||||
void base_OnHighlight(wxDC& dc);
|
||||
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnSize(double x, double y);
|
||||
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||
void base_OnDrawControlPoints(wxDC& dc);
|
||||
void base_OnEraseControlPoints(wxDC& dc);
|
||||
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true);
|
||||
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginSize(double w, double h);
|
||||
void base_OnEndSize(double w, double h);
|
||||
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%{
|
||||
WXSHAPE_IMP_CALLBACKS(wxPyControlPoint, wxControlPoint);
|
||||
%}
|
||||
|
||||
class wxPyControlPoint : public wxPyRectangleShape {
|
||||
public:
|
||||
%pythonAppend wxPyControlPoint "self._setOORandCallbackInfo(PyControlPoint)"
|
||||
|
||||
wxPyControlPoint(wxPyShapeCanvas *the_canvas = NULL,
|
||||
wxPyShape *object = NULL,
|
||||
double size = 0.0, double the_xoffset = 0.0,
|
||||
double the_yoffset = 0.0, int the_type = 0);
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
void SetCornerRadius(double radius);
|
||||
|
||||
void base_OnDelete();
|
||||
void base_OnDraw(wxDC& dc);
|
||||
void base_OnDrawContents(wxDC& dc);
|
||||
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||
void base_OnMoveLinks(wxDC& dc);
|
||||
void base_OnErase(wxDC& dc);
|
||||
void base_OnEraseContents(wxDC& dc);
|
||||
void base_OnHighlight(wxDC& dc);
|
||||
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnSize(double x, double y);
|
||||
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||
void base_OnDrawControlPoints(wxDC& dc);
|
||||
void base_OnEraseControlPoints(wxDC& dc);
|
||||
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true);
|
||||
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginSize(double w, double h);
|
||||
void base_OnEndSize(double w, double h);
|
||||
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
%{
|
||||
WXSHAPE_IMP_CALLBACKS(wxPyBitmapShape, wxBitmapShape);
|
||||
%}
|
||||
|
||||
|
||||
class wxPyBitmapShape : public wxPyRectangleShape {
|
||||
public:
|
||||
%pythonAppend wxPyBitmapShape "self._setOORandCallbackInfo(PyBitmapShape)"
|
||||
|
||||
wxPyBitmapShape();
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
wxBitmap& GetBitmap();
|
||||
wxString GetFilename();
|
||||
void SetBitmap(const wxBitmap& bitmap);
|
||||
void SetFilename(const wxString& filename);
|
||||
|
||||
void base_OnDelete();
|
||||
void base_OnDraw(wxDC& dc);
|
||||
void base_OnDrawContents(wxDC& dc);
|
||||
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||
void base_OnMoveLinks(wxDC& dc);
|
||||
void base_OnErase(wxDC& dc);
|
||||
void base_OnEraseContents(wxDC& dc);
|
||||
void base_OnHighlight(wxDC& dc);
|
||||
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnSize(double x, double y);
|
||||
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||
void base_OnDrawControlPoints(wxDC& dc);
|
||||
void base_OnEraseControlPoints(wxDC& dc);
|
||||
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true);
|
||||
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginSize(double w, double h);
|
||||
void base_OnEndSize(double w, double h);
|
||||
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
%{
|
||||
WXSHAPE_IMP_CALLBACKS(wxPyDrawnShape, wxDrawnShape);
|
||||
%}
|
||||
|
||||
class wxPyDrawnShape : public wxPyRectangleShape {
|
||||
public:
|
||||
%pythonAppend wxPyDrawnShape "self._setOORandCallbackInfo(PyDrawnShape)"
|
||||
|
||||
wxPyDrawnShape();
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
void CalculateSize();
|
||||
void DestroyClippingRect();
|
||||
void DrawArc(const wxPoint& centrePoint, const wxPoint& startPoint,
|
||||
const wxPoint& endPoint);
|
||||
void DrawAtAngle(int angle);
|
||||
void DrawEllipticArc(const wxRect& rect, double startAngle, double endAngle);
|
||||
void DrawLine(const wxPoint& point1, const wxPoint& point2);
|
||||
void DrawLines(int points, wxPoint* points_array);
|
||||
void DrawPoint(const wxPoint& point);
|
||||
|
||||
void DrawPolygon(int points, wxPoint* points_array, int flags = 0);
|
||||
|
||||
void DrawRectangle(const wxRect& rect);
|
||||
void DrawRoundedRectangle(const wxRect& rect, double radius);
|
||||
void DrawSpline(int points, wxPoint* points_array);
|
||||
void DrawText(const wxString& text, const wxPoint& point);
|
||||
int GetAngle();
|
||||
|
||||
wxPseudoMetaFile& GetMetaFile();
|
||||
|
||||
double GetRotation();
|
||||
bool LoadFromMetaFile(const wxString& filename);
|
||||
void Rotate(double x, double y, double theta);
|
||||
void SetClippingRect(const wxRect& rect);
|
||||
void SetDrawnBackgroundColour(const wxColour& colour);
|
||||
void SetDrawnBackgroundMode(int mode);
|
||||
void SetDrawnBrush(wxBrush* pen, bool isOutline = FALSE);
|
||||
void SetDrawnFont(wxFont* font);
|
||||
void SetDrawnPen(wxPen* pen, bool isOutline = FALSE);
|
||||
void SetDrawnTextColour(const wxColour& colour);
|
||||
void Scale(double sx, double sy);
|
||||
void SetSaveToFile(bool save);
|
||||
void Translate(double x, double y);
|
||||
|
||||
|
||||
void base_OnDelete();
|
||||
void base_OnDraw(wxDC& dc);
|
||||
void base_OnDrawContents(wxDC& dc);
|
||||
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||
void base_OnMoveLinks(wxDC& dc);
|
||||
void base_OnErase(wxDC& dc);
|
||||
void base_OnEraseContents(wxDC& dc);
|
||||
void base_OnHighlight(wxDC& dc);
|
||||
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnSize(double x, double y);
|
||||
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||
void base_OnDrawControlPoints(wxDC& dc);
|
||||
void base_OnEraseControlPoints(wxDC& dc);
|
||||
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true);
|
||||
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginSize(double w, double h);
|
||||
void base_OnEndSize(double w, double h);
|
||||
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||
|
||||
};
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class wxOGLConstraint : public wxObject {
|
||||
public:
|
||||
//wxOGLConstraint(int type, wxPyShape *constraining, wxList& constrained);
|
||||
%extend {
|
||||
wxOGLConstraint(int type, wxPyShape *constraining, PyObject* constrained) {
|
||||
wxList* list = wxPy_wxListHelper(constrained, wxT("wxPyShape"));
|
||||
wxOGLConstraint* rv = new wxOGLConstraint(type, constraining, *list);
|
||||
delete list;
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
//~wxOGLConstraint(); The wxCompositShape takes ownership of the constraint
|
||||
|
||||
bool Evaluate();
|
||||
void SetSpacing(double x, double y);
|
||||
bool Equals(double a, double b);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%{
|
||||
WXSHAPE_IMP_CALLBACKS(wxPyCompositeShape, wxCompositeShape);
|
||||
%}
|
||||
|
||||
class wxPyCompositeShape : public wxPyRectangleShape {
|
||||
public:
|
||||
%pythonAppend wxPyCompositeShape "self._setOORandCallbackInfo(PyCompositeShape)"
|
||||
|
||||
wxPyCompositeShape();
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
void AddChild(wxPyShape *child, wxPyShape *addAfter = NULL);
|
||||
wxOGLConstraint * AddConstraint(wxOGLConstraint *constraint);
|
||||
|
||||
|
||||
//wxOGLConstraint * AddConstraint(int type,
|
||||
// wxPyShape *constraining,
|
||||
// wxList& constrained);
|
||||
%extend {
|
||||
wxOGLConstraint * AddConstrainedShapes(int type, wxPyShape *constraining,
|
||||
PyObject* constrained) {
|
||||
wxList* list = wxPy_wxListHelper(constrained, wxT("wxPyShape"));
|
||||
wxOGLConstraint* rv = self->AddConstraint(type, constraining, *list);
|
||||
delete list;
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
%Rename(AddSimpleConstraint, wxOGLConstraint*, AddConstraint(int type,
|
||||
wxPyShape *constraining,
|
||||
wxPyShape *constrained));
|
||||
|
||||
void CalculateSize();
|
||||
bool ContainsDivision(wxPyDivisionShape *division);
|
||||
void DeleteConstraint(wxOGLConstraint *constraint);
|
||||
void DeleteConstraintsInvolvingChild(wxPyShape *child);
|
||||
|
||||
// **** Needs an output typemap
|
||||
//wxOGLConstraint * FindConstraint(long id, wxPyCompositeShape **actualComposite);
|
||||
|
||||
wxPyShape * FindContainerImage();
|
||||
|
||||
// wxList& GetConstraints();
|
||||
// wxList& GetDivisions();
|
||||
%extend {
|
||||
PyObject* GetConstraints() {
|
||||
wxList& list = self->GetConstraints();
|
||||
return wxPy_ConvertList(&list);
|
||||
}
|
||||
|
||||
PyObject* GetDivisions() {
|
||||
wxList& list = self->GetDivisions();
|
||||
return wxPy_ConvertShapeList(&list);
|
||||
}
|
||||
}
|
||||
|
||||
void MakeContainer();
|
||||
bool Recompute();
|
||||
void RemoveChild(wxPyShape *child);
|
||||
|
||||
|
||||
void base_OnDelete();
|
||||
void base_OnDraw(wxDC& dc);
|
||||
void base_OnDrawContents(wxDC& dc);
|
||||
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||
void base_OnMoveLinks(wxDC& dc);
|
||||
void base_OnErase(wxDC& dc);
|
||||
void base_OnEraseContents(wxDC& dc);
|
||||
void base_OnHighlight(wxDC& dc);
|
||||
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnSize(double x, double y);
|
||||
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||
void base_OnDrawControlPoints(wxDC& dc);
|
||||
void base_OnEraseControlPoints(wxDC& dc);
|
||||
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true);
|
||||
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginSize(double w, double h);
|
||||
void base_OnEndSize(double w, double h);
|
||||
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||
|
||||
};
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%{
|
||||
WXSHAPE_IMP_CALLBACKS(wxPyDividedShape, wxDividedShape);
|
||||
%}
|
||||
|
||||
class wxPyDividedShape : public wxPyRectangleShape {
|
||||
public:
|
||||
%pythonAppend wxPyDividedShape "self._setOORandCallbackInfo(PyDividedShape)"
|
||||
|
||||
wxPyDividedShape(double width = 0.0, double height = 0.0);
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
void EditRegions();
|
||||
void SetRegionSizes();
|
||||
|
||||
void base_OnDelete();
|
||||
void base_OnDraw(wxDC& dc);
|
||||
void base_OnDrawContents(wxDC& dc);
|
||||
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||
void base_OnMoveLinks(wxDC& dc);
|
||||
void base_OnErase(wxDC& dc);
|
||||
void base_OnEraseContents(wxDC& dc);
|
||||
void base_OnHighlight(wxDC& dc);
|
||||
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnSize(double x, double y);
|
||||
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||
void base_OnDrawControlPoints(wxDC& dc);
|
||||
void base_OnEraseControlPoints(wxDC& dc);
|
||||
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true);
|
||||
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginSize(double w, double h);
|
||||
void base_OnEndSize(double w, double h);
|
||||
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||
|
||||
};
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
%{
|
||||
WXSHAPE_IMP_CALLBACKS(wxPyDivisionShape, wxDivisionShape);
|
||||
%}
|
||||
|
||||
class wxPyDivisionShape : public wxPyCompositeShape {
|
||||
public:
|
||||
%pythonAppend wxPyDivisionShape "self._setOORandCallbackInfo(PyDivisionShape)"
|
||||
%typemap(out) wxPyDivisionShape*; // turn off this typemap
|
||||
|
||||
wxPyDivisionShape();
|
||||
|
||||
%typemap(out) wxPyDivisionShape* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
void AdjustBottom(double bottom, bool test);
|
||||
void AdjustLeft(double left, bool test);
|
||||
void AdjustRight(double right, bool test);
|
||||
void AdjustTop(double top, bool test);
|
||||
void Divide(int direction);
|
||||
void EditEdge(int side);
|
||||
wxPyDivisionShape * GetBottomSide();
|
||||
int GetHandleSide();
|
||||
wxPyDivisionShape * GetLeftSide();
|
||||
wxString GetLeftSideColour();
|
||||
wxPen * GetLeftSidePen();
|
||||
wxPyDivisionShape * GetRightSide();
|
||||
wxPyDivisionShape * GetTopSide();
|
||||
wxPen * GetTopSidePen();
|
||||
void ResizeAdjoining(int side, double newPos, bool test);
|
||||
void PopupMenu(double x, double y);
|
||||
void SetBottomSide(wxPyDivisionShape *shape);
|
||||
void SetHandleSide(int side);
|
||||
void SetLeftSide(wxPyDivisionShape *shape);
|
||||
void SetLeftSideColour(const wxString& colour);
|
||||
void SetLeftSidePen(wxPen *pen);
|
||||
void SetRightSide(wxPyDivisionShape *shape);
|
||||
void SetTopSide(wxPyDivisionShape *shape);
|
||||
void SetTopSideColour(const wxString& colour);
|
||||
void SetTopSidePen(wxPen *pen);
|
||||
|
||||
|
||||
|
||||
void base_OnDelete();
|
||||
void base_OnDraw(wxDC& dc);
|
||||
void base_OnDrawContents(wxDC& dc);
|
||||
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||
void base_OnMoveLinks(wxDC& dc);
|
||||
void base_OnErase(wxDC& dc);
|
||||
void base_OnEraseContents(wxDC& dc);
|
||||
void base_OnHighlight(wxDC& dc);
|
||||
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnSize(double x, double y);
|
||||
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||
void base_OnDrawControlPoints(wxDC& dc);
|
||||
void base_OnEraseControlPoints(wxDC& dc);
|
||||
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true);
|
||||
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginSize(double w, double h);
|
||||
void base_OnEndSize(double w, double h);
|
||||
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
|
@ -1,411 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: oglshapes2.i
|
||||
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
|
||||
//
|
||||
// Author: Robin Dunn
|
||||
//
|
||||
// Created: 3-Sept-1999
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 by Total Control Software
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// not a %module
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%{
|
||||
WXSHAPE_IMP_CALLBACKS(wxPyEllipseShape, wxEllipseShape);
|
||||
%}
|
||||
|
||||
class wxPyEllipseShape : public wxPyShape {
|
||||
public:
|
||||
%pythonAppend wxPyEllipseShape "self._setOORandCallbackInfo(PyEllipseShape)"
|
||||
|
||||
wxPyEllipseShape(double width = 0.0, double height = 0.0);
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
void base_OnDraw(wxDC& dc);
|
||||
void base_OnDrawContents(wxDC& dc);
|
||||
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||
void base_OnMoveLinks(wxDC& dc);
|
||||
void base_OnErase(wxDC& dc);
|
||||
void base_OnEraseContents(wxDC& dc);
|
||||
void base_OnHighlight(wxDC& dc);
|
||||
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnSize(double x, double y);
|
||||
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||
void base_OnDrawControlPoints(wxDC& dc);
|
||||
void base_OnEraseControlPoints(wxDC& dc);
|
||||
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true);
|
||||
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginSize(double w, double h);
|
||||
void base_OnEndSize(double w, double h);
|
||||
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
%{
|
||||
WXSHAPE_IMP_CALLBACKS(wxPyCircleShape, wxCircleShape);
|
||||
%}
|
||||
|
||||
class wxPyCircleShape : public wxPyEllipseShape {
|
||||
public:
|
||||
%pythonAppend wxPyCircleShape "self._setOORandCallbackInfo(PyCircleShape)"
|
||||
|
||||
wxPyCircleShape(double width = 0.0);
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
void base_OnDraw(wxDC& dc);
|
||||
void base_OnDrawContents(wxDC& dc);
|
||||
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||
void base_OnMoveLinks(wxDC& dc);
|
||||
void base_OnErase(wxDC& dc);
|
||||
void base_OnEraseContents(wxDC& dc);
|
||||
void base_OnHighlight(wxDC& dc);
|
||||
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnSize(double x, double y);
|
||||
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||
void base_OnDrawControlPoints(wxDC& dc);
|
||||
void base_OnEraseControlPoints(wxDC& dc);
|
||||
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true);
|
||||
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginSize(double w, double h);
|
||||
void base_OnEndSize(double w, double h);
|
||||
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class wxArrowHead : public wxObject {
|
||||
public:
|
||||
wxArrowHead(int type = 0,
|
||||
int end = 0,
|
||||
double size = 0.0,
|
||||
double dist = 0.0,
|
||||
const wxString& name = wxPyEmptyString,
|
||||
wxPseudoMetaFile *mf = NULL,
|
||||
long arrowId = -1);
|
||||
~wxArrowHead();
|
||||
|
||||
int _GetType();
|
||||
int GetPosition();
|
||||
void SetPosition(int pos);
|
||||
double GetXOffset();
|
||||
double GetYOffset();
|
||||
double GetSpacing();
|
||||
double GetSize();
|
||||
wxString GetName();
|
||||
void SetXOffset(double x);
|
||||
void SetYOffset(double y);
|
||||
wxPseudoMetaFile *GetMetaFile();
|
||||
long GetId();
|
||||
int GetArrowEnd();
|
||||
double GetArrowSize();
|
||||
void SetSize(double size);
|
||||
void SetSpacing(double sp);
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
%{
|
||||
WXSHAPE_IMP_CALLBACKS(wxPyLineShape, wxLineShape);
|
||||
%}
|
||||
|
||||
class wxPyLineShape : public wxPyShape {
|
||||
public:
|
||||
%pythonAppend wxPyLineShape "self._setOORandCallbackInfo(PyLineShape)"
|
||||
|
||||
wxPyLineShape();
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
void AddArrow(int type, int end = ARROW_POSITION_END,
|
||||
double arrowSize = 10.0, double xOffset = 0.0,
|
||||
const wxString& name = wxPyEmptyString, wxPseudoMetaFile *mf = NULL,
|
||||
long arrowId = -1);
|
||||
|
||||
//void AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int end);
|
||||
%extend {
|
||||
void AddArrowOrdered(wxArrowHead *arrow, PyObject* referenceList, int end) {
|
||||
wxList* list = wxPy_wxListHelper(referenceList, wxT("wxArrowHead"));
|
||||
self->AddArrowOrdered(arrow, *list, end);
|
||||
delete list;
|
||||
}
|
||||
}
|
||||
bool ClearArrow(const wxString& name);
|
||||
void ClearArrowsAtPosition(int position = -1);
|
||||
void DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool proportionalOffset);
|
||||
%Rename(DeleteArrowHeadId, bool, DeleteArrowHead(long arrowId));
|
||||
bool DeleteArrowHead(int position, const wxString& name);
|
||||
bool DeleteLineControlPoint();
|
||||
void DrawArrows(wxDC& dc);
|
||||
void DrawRegion(wxDC& dc, wxShapeRegion *region, double x, double y);
|
||||
void EraseRegion(wxDC& dc, wxShapeRegion *region, double x, double y);
|
||||
%Rename(FindArrowHeadId, wxArrowHead *, FindArrowHead(long arrowId));
|
||||
wxArrowHead * FindArrowHead(int position, const wxString& name);
|
||||
void FindLineEndPoints(double *OUTPUT, double *OUTPUT,
|
||||
double *OUTPUT, double *OUTPUT);
|
||||
int FindLinePosition(double x, double y);
|
||||
double FindMinimumWidth();
|
||||
void FindNth(wxPyShape *image, int *OUTPUT, int *OUTPUT, bool incoming);
|
||||
int GetAttachmentFrom();
|
||||
int GetAttachmentTo();
|
||||
void GetEnds(double *OUTPUT, double *OUTPUT, double *OUTPUT, double *OUTPUT);
|
||||
wxPyShape * GetFrom();
|
||||
void GetLabelPosition(int position, double *OUTPUT, double *OUTPUT);
|
||||
wxRealPoint * GetNextControlPoint(wxPyShape *shape);
|
||||
wxPyShape * GetTo();
|
||||
void Initialise();
|
||||
void InsertLineControlPoint(wxDC* dc);
|
||||
bool IsEnd(wxPyShape *shape);
|
||||
bool IsSpline();
|
||||
void MakeLineControlPoints(int n);
|
||||
|
||||
// inline wxList *GetLineControlPoints() { return m_lineControlPoints; }
|
||||
%extend {
|
||||
PyObject* GetLineControlPoints() {
|
||||
wxList* list = self->GetLineControlPoints();
|
||||
return wxPy_ConvertRealPointList(list);
|
||||
}
|
||||
|
||||
// part of Patch# 893337
|
||||
void SetLineControlPoints(PyObject* list) {
|
||||
wxList* real_point_list = wxPy_wxRealPoint_ListHelper(list);
|
||||
self->MakeLineControlPoints((int)(real_point_list->GetCount()));
|
||||
wxList* old_control_points = self->GetLineControlPoints();
|
||||
wxNode* old_node = old_control_points->GetFirst();
|
||||
wxNode* real_node = real_point_list->GetFirst();
|
||||
while(old_node)
|
||||
{
|
||||
wxRealPoint* old_point = (wxRealPoint*)old_node->GetData();
|
||||
wxRealPoint* new_point = (wxRealPoint*)real_node->GetData();
|
||||
old_point->x = new_point->x;
|
||||
old_point->y = new_point->y;
|
||||
old_node = old_node->GetNext();
|
||||
real_node = real_node->GetNext();
|
||||
}
|
||||
self->ClearPointList(*real_point_list);
|
||||
delete real_point_list;
|
||||
}
|
||||
}
|
||||
|
||||
void SetAttachmentFrom(int fromAttach);
|
||||
void SetAttachments(int fromAttach, int toAttach);
|
||||
void SetAttachmentTo(int toAttach);
|
||||
void SetEnds(double x1, double y1, double x2, double y2);
|
||||
void SetFrom(wxPyShape *object);
|
||||
void SetIgnoreOffsets(bool ignore);
|
||||
void SetSpline(bool spline);
|
||||
void SetTo(wxPyShape *object);
|
||||
void Straighten(wxDC* dc = NULL);
|
||||
void Unlink();
|
||||
|
||||
|
||||
void SetAlignmentOrientation(bool isEnd, bool isHoriz);
|
||||
void SetAlignmentType(bool isEnd, int alignType);
|
||||
bool GetAlignmentOrientation(bool isEnd);
|
||||
int GetAlignmentType(bool isEnd);
|
||||
int GetAlignmentStart() const;
|
||||
int GetAlignmentEnd() const;
|
||||
|
||||
void base_OnDraw(wxDC& dc);
|
||||
void base_OnDrawContents(wxDC& dc);
|
||||
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||
void base_OnMoveLinks(wxDC& dc);
|
||||
void base_OnErase(wxDC& dc);
|
||||
void base_OnEraseContents(wxDC& dc);
|
||||
void base_OnHighlight(wxDC& dc);
|
||||
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnSize(double x, double y);
|
||||
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||
void base_OnDrawControlPoints(wxDC& dc);
|
||||
void base_OnEraseControlPoints(wxDC& dc);
|
||||
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true);
|
||||
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginSize(double w, double h);
|
||||
void base_OnEndSize(double w, double h);
|
||||
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
%{
|
||||
WXSHAPE_IMP_CALLBACKS(wxPyPolygonShape, wxPolygonShape);
|
||||
%}
|
||||
|
||||
class wxPyPolygonShape : public wxPyShape {
|
||||
public:
|
||||
%pythonAppend wxPyPolygonShape "self._setOORandCallbackInfo(PyPolygonShape)"
|
||||
|
||||
wxPyPolygonShape();
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
|
||||
// void Create(wxList* points);
|
||||
%extend {
|
||||
PyObject* Create(PyObject* points) {
|
||||
wxList* list = wxPy_wxRealPoint_ListHelper(points);
|
||||
if (list) {
|
||||
self->Create(list);
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
else return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void AddPolygonPoint(int pos = 0);
|
||||
void CalculatePolygonCentre();
|
||||
void DeletePolygonPoint(int pos = 0);
|
||||
|
||||
// wxList* GetPoints();
|
||||
%extend {
|
||||
PyObject* GetPoints() {
|
||||
wxList* list = self->GetPoints();
|
||||
return wxPy_ConvertRealPointList(list);
|
||||
}
|
||||
|
||||
PyObject* GetOriginalPoints() {
|
||||
wxList* list = self->GetOriginalPoints();
|
||||
PyObject* pyList;
|
||||
PyObject* pyObj;
|
||||
wxObject* wxObj;
|
||||
wxNode* node = list->GetFirst();
|
||||
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
pyList = PyList_New(0);
|
||||
while (node) {
|
||||
wxObj = node->GetData();
|
||||
pyObj = wxPyConstructObject(wxObj, wxT("wxRealPoint"), 0);
|
||||
PyList_Append(pyList, pyObj);
|
||||
node = node->GetNext();
|
||||
}
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return pyList;
|
||||
}
|
||||
}
|
||||
|
||||
double GetOriginalWidth() const;
|
||||
double GetOriginalHeight() const;
|
||||
|
||||
void SetOriginalWidth(double w);
|
||||
void SetOriginalHeight(double h);
|
||||
|
||||
void UpdateOriginalPoints();
|
||||
|
||||
void base_OnDraw(wxDC& dc);
|
||||
void base_OnDrawContents(wxDC& dc);
|
||||
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||
void base_OnMoveLinks(wxDC& dc);
|
||||
void base_OnErase(wxDC& dc);
|
||||
void base_OnEraseContents(wxDC& dc);
|
||||
void base_OnHighlight(wxDC& dc);
|
||||
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnSize(double x, double y);
|
||||
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||
void base_OnDrawControlPoints(wxDC& dc);
|
||||
void base_OnEraseControlPoints(wxDC& dc);
|
||||
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true);
|
||||
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginSize(double w, double h);
|
||||
void base_OnEndSize(double w, double h);
|
||||
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
%{
|
||||
WXSHAPE_IMP_CALLBACKS(wxPyTextShape, wxTextShape);
|
||||
%}
|
||||
|
||||
class wxPyTextShape : public wxPyRectangleShape {
|
||||
public:
|
||||
%pythonAppend wxPyTextShape "self._setOORandCallbackInfo(PyTextShape)"
|
||||
|
||||
wxPyTextShape(double width = 0.0, double height = 0.0);
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
void base_OnDelete();
|
||||
void base_OnDraw(wxDC& dc);
|
||||
void base_OnDrawContents(wxDC& dc);
|
||||
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||
void base_OnMoveLinks(wxDC& dc);
|
||||
void base_OnErase(wxDC& dc);
|
||||
void base_OnEraseContents(wxDC& dc);
|
||||
void base_OnHighlight(wxDC& dc);
|
||||
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
void base_OnSize(double x, double y);
|
||||
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true);
|
||||
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||
void base_OnDrawControlPoints(wxDC& dc);
|
||||
void base_OnEraseControlPoints(wxDC& dc);
|
||||
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true);
|
||||
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnBeginSize(double w, double h);
|
||||
void base_OnEndSize(double w, double h);
|
||||
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
|
@ -1,364 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: ogl.i
|
||||
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
|
||||
//
|
||||
// Author: Robin Dunn
|
||||
//
|
||||
// Created: 30-June-1999
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 by Total Control Software
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
%define DOCSTRING
|
||||
"The Object Graphics Library provides for simple drawing and manipulation
|
||||
of 2D objects. (This version is deprecated, please use wx.lib.ogl instead.)"
|
||||
%enddef
|
||||
|
||||
%module(package="wx", docstring=DOCSTRING) ogl
|
||||
|
||||
%{
|
||||
#include "wx/wxPython/wxPython.h"
|
||||
#include "wx/wxPython/pyclasses.h"
|
||||
#include "oglhelpers.h"
|
||||
|
||||
%}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%import windows.i
|
||||
%pythoncode { wx = _core }
|
||||
%pythoncode { __docfilter__ = wx.__DocFilter(globals()) }
|
||||
|
||||
%pythoncode {
|
||||
import warnings
|
||||
warnings.warn("This module is deprecated. Please use the wx.lib.ogl package instead.",
|
||||
DeprecationWarning, stacklevel=2)
|
||||
}
|
||||
|
||||
|
||||
MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
|
||||
|
||||
%include _ogldefs.i
|
||||
%include _oglbasic.i
|
||||
%include _oglshapes.i
|
||||
%include _oglshapes2.i
|
||||
%include _oglcanvas.i
|
||||
|
||||
%pythoncode {
|
||||
%# Aliases
|
||||
ShapeCanvas = PyShapeCanvas
|
||||
ShapeEvtHandler = PyShapeEvtHandler
|
||||
Shape = PyShape
|
||||
RectangleShape = PyRectangleShape
|
||||
BitmapShape = PyBitmapShape
|
||||
DrawnShape = PyDrawnShape
|
||||
CompositeShape = PyCompositeShape
|
||||
DividedShape = PyDividedShape
|
||||
DivisionShape = PyDivisionShape
|
||||
EllipseShape = PyEllipseShape
|
||||
CircleShape = PyCircleShape
|
||||
LineShape = PyLineShape
|
||||
PolygonShape = PyPolygonShape
|
||||
TextShape = PyTextShape
|
||||
ControlPoint = PyControlPoint
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
enum {
|
||||
KEY_SHIFT,
|
||||
KEY_CTRL,
|
||||
ARROW_NONE,
|
||||
ARROW_END,
|
||||
ARROW_BOTH,
|
||||
ARROW_MIDDLE,
|
||||
ARROW_START,
|
||||
ARROW_HOLLOW_CIRCLE,
|
||||
ARROW_FILLED_CIRCLE,
|
||||
ARROW_ARROW,
|
||||
ARROW_SINGLE_OBLIQUE,
|
||||
ARROW_DOUBLE_OBLIQUE,
|
||||
ARROW_METAFILE,
|
||||
ARROW_POSITION_END,
|
||||
ARROW_POSITION_START,
|
||||
CONTROL_POINT_VERTICAL,
|
||||
CONTROL_POINT_HORIZONTAL,
|
||||
CONTROL_POINT_DIAGONAL,
|
||||
CONTROL_POINT_ENDPOINT_TO,
|
||||
CONTROL_POINT_ENDPOINT_FROM,
|
||||
CONTROL_POINT_LINE,
|
||||
FORMAT_NONE,
|
||||
FORMAT_CENTRE_HORIZ,
|
||||
FORMAT_CENTRE_VERT,
|
||||
FORMAT_SIZE_TO_CONTENTS,
|
||||
LINE_ALIGNMENT_HORIZ,
|
||||
LINE_ALIGNMENT_VERT,
|
||||
LINE_ALIGNMENT_TO_NEXT_HANDLE,
|
||||
LINE_ALIGNMENT_NONE,
|
||||
SHADOW_NONE,
|
||||
SHADOW_LEFT,
|
||||
SHADOW_RIGHT,
|
||||
// SHAPE_BASIC,
|
||||
// SHAPE_RECTANGLE,
|
||||
// SHAPE_ELLIPSE,
|
||||
// SHAPE_POLYGON,
|
||||
// SHAPE_CIRCLE,
|
||||
// SHAPE_LINE,
|
||||
// SHAPE_DIVIDED_RECTANGLE,
|
||||
// SHAPE_COMPOSITE,
|
||||
// SHAPE_CONTROL_POINT,
|
||||
// SHAPE_DRAWN,
|
||||
// SHAPE_DIVISION,
|
||||
// SHAPE_LABEL_OBJECT,
|
||||
// SHAPE_BITMAP,
|
||||
// SHAPE_DIVIDED_OBJECT_CONTROL_POINT,
|
||||
// OBJECT_REGION,
|
||||
OP_CLICK_LEFT,
|
||||
OP_CLICK_RIGHT,
|
||||
OP_DRAG_LEFT,
|
||||
OP_DRAG_RIGHT,
|
||||
OP_ALL,
|
||||
ATTACHMENT_MODE_NONE,
|
||||
ATTACHMENT_MODE_EDGE,
|
||||
ATTACHMENT_MODE_BRANCHING,
|
||||
BRANCHING_ATTACHMENT_NORMAL,
|
||||
BRANCHING_ATTACHMENT_BLOB,
|
||||
|
||||
gyCONSTRAINT_CENTRED_VERTICALLY,
|
||||
gyCONSTRAINT_CENTRED_HORIZONTALLY,
|
||||
gyCONSTRAINT_CENTRED_BOTH,
|
||||
gyCONSTRAINT_LEFT_OF,
|
||||
gyCONSTRAINT_RIGHT_OF,
|
||||
gyCONSTRAINT_ABOVE,
|
||||
gyCONSTRAINT_BELOW,
|
||||
gyCONSTRAINT_ALIGNED_TOP,
|
||||
gyCONSTRAINT_ALIGNED_BOTTOM,
|
||||
gyCONSTRAINT_ALIGNED_LEFT,
|
||||
gyCONSTRAINT_ALIGNED_RIGHT,
|
||||
gyCONSTRAINT_MIDALIGNED_TOP,
|
||||
gyCONSTRAINT_MIDALIGNED_BOTTOM,
|
||||
gyCONSTRAINT_MIDALIGNED_LEFT,
|
||||
gyCONSTRAINT_MIDALIGNED_RIGHT,
|
||||
|
||||
DIVISION_SIDE_NONE,
|
||||
DIVISION_SIDE_LEFT,
|
||||
DIVISION_SIDE_TOP,
|
||||
DIVISION_SIDE_RIGHT,
|
||||
DIVISION_SIDE_BOTTOM,
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
MustHaveApp(wxOGLInitialize);
|
||||
void wxOGLInitialize();
|
||||
|
||||
MustHaveApp(wxOGLCleanUp);
|
||||
void wxOGLCleanUp();
|
||||
|
||||
|
||||
%{
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// Convert from a Python list to a list of className objects. This one will
|
||||
// work for any class for the VERY generic cases, but beyond that the helper
|
||||
// needs to know more about the type.
|
||||
wxList* wxPy_wxListHelper(PyObject* pyList, const wxChar* className) {
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
if (!PyList_Check(pyList)) {
|
||||
PyErr_SetString(PyExc_TypeError, "Expected a list object.");
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return NULL;
|
||||
}
|
||||
int count = PyList_Size(pyList);
|
||||
wxList* list = new wxList;
|
||||
if (! list) {
|
||||
PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return NULL;
|
||||
}
|
||||
for (int x=0; x<count; x++) {
|
||||
PyObject* pyo = PyList_GetItem(pyList, x);
|
||||
wxObject* wxo = NULL;
|
||||
|
||||
if ( !wxPyConvertSwigPtr(pyo, (void **)&wxo, className) ) {
|
||||
wxString errmsg;
|
||||
errmsg.Printf(wxT("Type error, expected list of %s objects"), className);
|
||||
PyErr_SetString(PyExc_TypeError, errmsg.mb_str());
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return NULL;
|
||||
}
|
||||
list->Append(wxo);
|
||||
}
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return list;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) {
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
if (!PyList_Check(pyList)) {
|
||||
PyErr_SetString(PyExc_TypeError, "Expected a list object.");
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return NULL;
|
||||
}
|
||||
int count = PyList_Size(pyList);
|
||||
wxList* list = new wxList;
|
||||
if (! list) {
|
||||
PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return NULL;
|
||||
}
|
||||
for (int x=0; x<count; x++) {
|
||||
PyObject* pyo = PyList_GetItem(pyList, x);
|
||||
|
||||
if (PyTuple_Check(pyo)) {
|
||||
PyObject* o1 = PyNumber_Float(PyTuple_GetItem(pyo, 0));
|
||||
PyObject* o2 = PyNumber_Float(PyTuple_GetItem(pyo, 1));
|
||||
|
||||
double val1 = (o1 ? PyFloat_AsDouble(o1) : 0.0);
|
||||
double val2 = (o2 ? PyFloat_AsDouble(o2) : 0.0);
|
||||
|
||||
list->Append((wxObject*) new wxRealPoint(val1, val2));
|
||||
|
||||
} else {
|
||||
wxRealPoint* wxo = NULL;
|
||||
if (wxPyConvertSwigPtr(pyo, (void **)&wxo, wxT("wxRealPoint"))) {
|
||||
PyErr_SetString(PyExc_TypeError, "Type error, expected list of wxRealPoint objects or 2-tuples");
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return NULL;
|
||||
}
|
||||
list->Append((wxObject*) new wxRealPoint(*wxo));
|
||||
}
|
||||
}
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return list;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source, bool setThisOwn) {
|
||||
PyObject* target = NULL;
|
||||
|
||||
if (source && wxIsKindOf(source, wxShapeEvtHandler)) {
|
||||
// If it's derived from wxShapeEvtHandler then there may
|
||||
// already be a pointer to a Python object that we can use
|
||||
// in the OOR data.
|
||||
wxShapeEvtHandler* seh = (wxShapeEvtHandler*)source;
|
||||
wxPyOORClientData* data = (wxPyOORClientData*)seh->GetClientObject();
|
||||
if (data) {
|
||||
target = data->m_obj;
|
||||
Py_INCREF(target);
|
||||
}
|
||||
}
|
||||
if (! target) {
|
||||
target = wxPyMake_wxObject2(source, setThisOwn, false);
|
||||
if (target != Py_None)
|
||||
((wxShapeEvtHandler*)source)->SetClientObject(new wxPyOORClientData(target));
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
PyObject* wxPy_ConvertRealPointList(wxListBase* listbase) {
|
||||
wxList* list = (wxList*)listbase;
|
||||
PyObject* pyList;
|
||||
PyObject* pyObj;
|
||||
wxObject* wxObj;
|
||||
wxNode* node = list->GetFirst();
|
||||
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
pyList = PyList_New(0);
|
||||
while (node) {
|
||||
wxObj = node->GetData();
|
||||
pyObj = wxPyConstructObject(wxObj, wxT("wxRealPoint"), 0);
|
||||
PyList_Append(pyList, pyObj);
|
||||
node = node->GetNext();
|
||||
}
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return pyList;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
PyObject* wxPy_ConvertShapeList(wxListBase* listbase) {
|
||||
wxList* list = (wxList*)listbase;
|
||||
PyObject* pyList;
|
||||
PyObject* pyObj;
|
||||
wxObject* wxObj;
|
||||
wxNode* node = list->GetFirst();
|
||||
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
pyList = PyList_New(0);
|
||||
while (node) {
|
||||
wxObj = node->GetData();
|
||||
pyObj = wxPyMake_wxShapeEvtHandler((wxShapeEvtHandler*)wxObj, false);
|
||||
PyList_Append(pyList, pyObj);
|
||||
node = node->GetNext();
|
||||
}
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return pyList;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPyShapeCanvas, wxShapeCanvas);
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPyShapeEvtHandler, wxShapeEvtHandler);
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxPyShape, wxShape);
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPyRectangleShape, wxRectangleShape);
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPyControlPoint, wxControlPoint);
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPyBitmapShape, wxBitmapShape);
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPyDrawnShape, wxDrawnShape);
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPyCompositeShape, wxCompositeShape);
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPyDividedShape, wxDividedShape);
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPyDivisionShape, wxDivisionShape);
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPyEllipseShape, wxEllipseShape);
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPyCircleShape, wxCircleShape);
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPyLineShape, wxLineShape);
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPyPolygonShape, wxPolygonShape);
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPyTextShape, wxTextShape);
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// extern "C" SWIGEXPORT(void) initoglbasicc();
|
||||
// extern "C" SWIGEXPORT(void) initoglshapesc();
|
||||
// extern "C" SWIGEXPORT(void) initoglshapes2c();
|
||||
// extern "C" SWIGEXPORT(void) initoglcanvasc();
|
||||
%}
|
||||
|
||||
|
||||
%init %{
|
||||
|
||||
// initoglbasicc();
|
||||
// initoglshapesc();
|
||||
// initoglshapes2c();
|
||||
// initoglcanvasc();
|
||||
|
||||
|
||||
wxPyPtrTypeMap_Add("wxControlPoint", "wxPyControlPoint");
|
||||
wxPyPtrTypeMap_Add("wxShapeCanvas", "wxPyShapeCanvas");
|
||||
wxPyPtrTypeMap_Add("wxShapeEvtHandler", "wxPyShapeEvtHandler");
|
||||
wxPyPtrTypeMap_Add("wxShape", "wxPyShape");
|
||||
wxPyPtrTypeMap_Add("wxRectangleShape", "wxPyRectangleShape");
|
||||
wxPyPtrTypeMap_Add("wxDrawnShape", "wxPyDrawnShape");
|
||||
wxPyPtrTypeMap_Add("wxCompositeShape", "wxPyCompositeShape");
|
||||
wxPyPtrTypeMap_Add("wxDividedShape", "wxPyDividedShape");
|
||||
wxPyPtrTypeMap_Add("wxDivisionShape", "wxPyDivisionShape");
|
||||
wxPyPtrTypeMap_Add("wxEllipseShape", "wxPyEllipseShape");
|
||||
wxPyPtrTypeMap_Add("wxCircleShape", "wxPyCircleShape");
|
||||
wxPyPtrTypeMap_Add("wxLineShape", "wxPyLineShape");
|
||||
wxPyPtrTypeMap_Add("wxPolygonShape", "wxPyPolygonShape");
|
||||
wxPyPtrTypeMap_Add("wxTextShape", "wxPyTextShape");
|
||||
|
||||
%}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
@ -1,286 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: oglhelpers.h
|
||||
// Purpose: Some Helper functions to help in data conversions in OGL
|
||||
//
|
||||
// Author: Robin Dunn
|
||||
//
|
||||
// Created: 9-Sept-1999
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 by Total Control Software
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __wxp_ogl_helpers__
|
||||
#define __wxp_ogl_helpers__
|
||||
|
||||
|
||||
#include <wx/ogl/ogl.h>
|
||||
#include <wx/ogl/basicp.h>
|
||||
#include <wx/ogl/constrnt.h>
|
||||
#include <wx/ogl/bmpshape.h>
|
||||
#include <wx/ogl/drawn.h>
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Define a macro that will be used in the class definintions below
|
||||
|
||||
#define WXSHAPE_DEC_CALLBACKS() \
|
||||
DEC_PYCALLBACK__ (OnDelete); \
|
||||
DEC_PYCALLBACK__DC (OnDraw); \
|
||||
DEC_PYCALLBACK__DC (OnDrawContents); \
|
||||
DEC_PYCALLBACK__DCBOOL (OnDrawBranches); \
|
||||
DEC_PYCALLBACK__DC (OnMoveLinks); \
|
||||
DEC_PYCALLBACK__DC (OnErase); \
|
||||
DEC_PYCALLBACK__DC (OnEraseContents); \
|
||||
DEC_PYCALLBACK__DC (OnHighlight); \
|
||||
DEC_PYCALLBACK__2DBL2INT (OnLeftClick); \
|
||||
DEC_PYCALLBACK__2DBL2INT (OnLeftDoubleClick); \
|
||||
DEC_PYCALLBACK__2DBL2INT (OnRightClick); \
|
||||
DEC_PYCALLBACK__2DBL (OnSize); \
|
||||
DEC_PYCALLBACK_BOOL_DC4DBLBOOL (OnMovePre); \
|
||||
DEC_PYCALLBACK__DC4DBLBOOL (OnMovePost); \
|
||||
DEC_PYCALLBACK__BOOL2DBL2INT (OnDragLeft); \
|
||||
DEC_PYCALLBACK__2DBL2INT (OnBeginDragLeft); \
|
||||
DEC_PYCALLBACK__2DBL2INT (OnEndDragLeft); \
|
||||
DEC_PYCALLBACK__BOOL2DBL2INT (OnDragRight); \
|
||||
DEC_PYCALLBACK__2DBL2INT (OnBeginDragRight); \
|
||||
DEC_PYCALLBACK__2DBL2INT (OnEndDragRight); \
|
||||
DEC_PYCALLBACK__DC4DBL (OnDrawOutline); \
|
||||
DEC_PYCALLBACK__DC (OnDrawControlPoints); \
|
||||
DEC_PYCALLBACK__DC (OnEraseControlPoints); \
|
||||
DEC_PYCALLBACK__DCBOOL (OnMoveLink); \
|
||||
DEC_PYCALLBACK__WXCPBOOL2DBL2INT(OnSizingDragLeft); \
|
||||
DEC_PYCALLBACK__WXCP2DBL2INT (OnSizingBeginDragLeft);\
|
||||
DEC_PYCALLBACK__WXCP2DBL2INT (OnSizingEndDragLeft); \
|
||||
DEC_PYCALLBACK__2DBL (OnBeginSize); \
|
||||
DEC_PYCALLBACK__2DBL (OnEndSize); \
|
||||
PYPRIVATE
|
||||
|
||||
|
||||
#define WXSHAPE_IMP_CALLBACKS(CLASS, PARENT) \
|
||||
IMP_PYCALLBACK__ (CLASS, PARENT, OnDelete); \
|
||||
IMP_PYCALLBACK__DC (CLASS, PARENT, OnDraw); \
|
||||
IMP_PYCALLBACK__DC (CLASS, PARENT, OnDrawContents); \
|
||||
IMP_PYCALLBACK__DCBOOL (CLASS, PARENT, OnDrawBranches); \
|
||||
IMP_PYCALLBACK__DC (CLASS, PARENT, OnMoveLinks); \
|
||||
IMP_PYCALLBACK__DC (CLASS, PARENT, OnErase); \
|
||||
IMP_PYCALLBACK__DC (CLASS, PARENT, OnEraseContents); \
|
||||
IMP_PYCALLBACK__DC (CLASS, PARENT, OnHighlight); \
|
||||
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnLeftClick); \
|
||||
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnLeftDoubleClick); \
|
||||
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnRightClick); \
|
||||
IMP_PYCALLBACK__2DBL (CLASS, PARENT, OnSize); \
|
||||
IMP_PYCALLBACK_BOOL_DC4DBLBOOL (CLASS, PARENT, OnMovePre); \
|
||||
IMP_PYCALLBACK__DC4DBLBOOL (CLASS, PARENT, OnMovePost); \
|
||||
IMP_PYCALLBACK__BOOL2DBL2INT (CLASS, PARENT, OnDragLeft); \
|
||||
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnBeginDragLeft); \
|
||||
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnEndDragLeft); \
|
||||
IMP_PYCALLBACK__BOOL2DBL2INT (CLASS, PARENT, OnDragRight); \
|
||||
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnBeginDragRight); \
|
||||
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnEndDragRight); \
|
||||
IMP_PYCALLBACK__DC4DBL (CLASS, PARENT, OnDrawOutline); \
|
||||
IMP_PYCALLBACK__DC (CLASS, PARENT, OnDrawControlPoints); \
|
||||
IMP_PYCALLBACK__DC (CLASS, PARENT, OnEraseControlPoints); \
|
||||
IMP_PYCALLBACK__DCBOOL (CLASS, PARENT, OnMoveLink); \
|
||||
IMP_PYCALLBACK__WXCPBOOL2DBL2INT(CLASS, PARENT, OnSizingDragLeft); \
|
||||
IMP_PYCALLBACK__WXCP2DBL2INT (CLASS, PARENT, OnSizingBeginDragLeft);\
|
||||
IMP_PYCALLBACK__WXCP2DBL2INT (CLASS, PARENT, OnSizingEndDragLeft); \
|
||||
IMP_PYCALLBACK__2DBL (CLASS, PARENT, OnBeginSize); \
|
||||
IMP_PYCALLBACK__2DBL (CLASS, PARENT, OnEndSize)
|
||||
|
||||
|
||||
// This one may be difficult...
|
||||
//PYCALLBACK__??????? (PARENT, OnChangeAttachment);
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// These are prototypes of some helper functions found in ogl.i
|
||||
|
||||
wxList* wxPy_wxListHelper(PyObject* pyList, const wxChar* className);
|
||||
wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList);
|
||||
PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source);
|
||||
PyObject* wxPy_ConvertShapeList(wxListBase* list);
|
||||
PyObject* wxPy_ConvertRealPointList(wxListBase* list);
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Classes that derive from the shapes and such, but which know how to turn
|
||||
// virtual callbacks into Python callbacks.
|
||||
|
||||
class wxPyShapeCanvas : public wxShapeCanvas {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyShapeCanvas);
|
||||
public:
|
||||
wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxBORDER,
|
||||
const wxString& name = wxT("shapeCanvas"))
|
||||
: wxShapeCanvas(parent, id, pos, size, style, name) {}
|
||||
|
||||
DEC_PYCALLBACK__2DBLINT(OnBeginDragLeft);
|
||||
DEC_PYCALLBACK__2DBLINT(OnBeginDragRight);
|
||||
DEC_PYCALLBACK__2DBLINT(OnEndDragLeft);
|
||||
DEC_PYCALLBACK__2DBLINT(OnEndDragRight);
|
||||
DEC_PYCALLBACK__BOOL2DBLINT(OnDragLeft);
|
||||
DEC_PYCALLBACK__BOOL2DBLINT(OnDragRight);
|
||||
DEC_PYCALLBACK__2DBLINT(OnLeftClick);
|
||||
DEC_PYCALLBACK__2DBLINT(OnRightClick);
|
||||
|
||||
PYPRIVATE;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class wxPyShapeEvtHandler : public wxShapeEvtHandler {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyShapeEvtHandler);
|
||||
public:
|
||||
wxPyShapeEvtHandler(wxShapeEvtHandler *prev = NULL, wxShape *shape = NULL)
|
||||
: wxShapeEvtHandler(prev, shape) {}
|
||||
|
||||
WXSHAPE_DEC_CALLBACKS();
|
||||
};
|
||||
|
||||
|
||||
class wxPyShape : public wxShape {
|
||||
DECLARE_ABSTRACT_CLASS(wxPyShape);
|
||||
public:
|
||||
wxPyShape(wxPyShapeCanvas *can = NULL)
|
||||
: wxShape(can) {}
|
||||
|
||||
virtual void GetBoundingBoxMin(double *width, double *height)
|
||||
{
|
||||
if (width) *width = 0.0;
|
||||
if (height) *height = 0.0;
|
||||
}
|
||||
|
||||
WXSHAPE_DEC_CALLBACKS();
|
||||
|
||||
};
|
||||
|
||||
|
||||
class wxPyRectangleShape : public wxRectangleShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyRectangleShape);
|
||||
public:
|
||||
wxPyRectangleShape(double width = 0.0, double height = 0.0)
|
||||
: wxRectangleShape(width, height) {}
|
||||
|
||||
WXSHAPE_DEC_CALLBACKS();
|
||||
};
|
||||
|
||||
class wxPyControlPoint : public wxControlPoint {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyControlPoint);
|
||||
public:
|
||||
wxPyControlPoint(wxPyShapeCanvas *the_canvas = NULL,
|
||||
wxPyShape *object = NULL,
|
||||
double size = 0.0, double the_xoffset = 0.0,
|
||||
double the_yoffset = 0.0, int the_type = 0)
|
||||
: wxControlPoint(the_canvas, object, size,
|
||||
the_xoffset, the_yoffset, the_type) {}
|
||||
|
||||
WXSHAPE_DEC_CALLBACKS();
|
||||
};
|
||||
|
||||
|
||||
|
||||
class wxPyBitmapShape : public wxBitmapShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyBitmapShape);
|
||||
public:
|
||||
wxPyBitmapShape() : wxBitmapShape() {}
|
||||
|
||||
WXSHAPE_DEC_CALLBACKS();
|
||||
};
|
||||
|
||||
|
||||
|
||||
class wxPyDrawnShape : public wxDrawnShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyDrawnShape);
|
||||
public:
|
||||
wxPyDrawnShape() : wxDrawnShape() {}
|
||||
|
||||
WXSHAPE_DEC_CALLBACKS();
|
||||
};
|
||||
|
||||
|
||||
class wxPyCompositeShape : public wxCompositeShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyCompositeShape);
|
||||
public:
|
||||
wxPyCompositeShape() : wxCompositeShape() {}
|
||||
|
||||
WXSHAPE_DEC_CALLBACKS();
|
||||
};
|
||||
|
||||
|
||||
class wxPyDividedShape : public wxDividedShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyDividedShape);
|
||||
public:
|
||||
wxPyDividedShape(double width = 0.0, double height = 0.0)
|
||||
: wxDividedShape(width, height) {}
|
||||
|
||||
WXSHAPE_DEC_CALLBACKS();
|
||||
};
|
||||
|
||||
|
||||
class wxPyDivisionShape : public wxDivisionShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyDivisionShape);
|
||||
public:
|
||||
wxPyDivisionShape() : wxDivisionShape() {}
|
||||
|
||||
WXSHAPE_DEC_CALLBACKS();
|
||||
};
|
||||
|
||||
|
||||
class wxPyEllipseShape : public wxEllipseShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyEllipseShape);
|
||||
public:
|
||||
wxPyEllipseShape(double width = 0.0, double height = 0.0)
|
||||
: wxEllipseShape(width, height) {}
|
||||
|
||||
WXSHAPE_DEC_CALLBACKS();
|
||||
};
|
||||
|
||||
|
||||
class wxPyCircleShape : public wxCircleShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyCircleShape);
|
||||
public:
|
||||
wxPyCircleShape(double width = 0.0)
|
||||
: wxCircleShape(width) {}
|
||||
|
||||
WXSHAPE_DEC_CALLBACKS();
|
||||
};
|
||||
|
||||
|
||||
class wxPyLineShape : public wxLineShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyLineShape);
|
||||
public:
|
||||
wxPyLineShape() : wxLineShape() {}
|
||||
|
||||
WXSHAPE_DEC_CALLBACKS();
|
||||
};
|
||||
|
||||
|
||||
class wxPyPolygonShape : public wxPolygonShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyPolygonShape);
|
||||
public:
|
||||
wxPyPolygonShape() : wxPolygonShape() {}
|
||||
|
||||
WXSHAPE_DEC_CALLBACKS();
|
||||
};
|
||||
|
||||
|
||||
class wxPyTextShape : public wxTextShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyTextShape);
|
||||
public:
|
||||
wxPyTextShape(double width = 0.0, double height = 0.0)
|
||||
: wxTextShape(width, height) {}
|
||||
|
||||
WXSHAPE_DEC_CALLBACKS();
|
||||
};
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -1,218 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: _stc_docstrings.i
|
||||
// Purpose: Docstrings for the wxStyledTextCtrl. The ones in this file
|
||||
// are maintained by hand for those methods that are not
|
||||
// auto-generated by gen_iface.py
|
||||
//
|
||||
// Author: Robin Dunn
|
||||
//
|
||||
// Created: 16-April-2005
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2005 by Total Control Software
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// First include the autogenerated docstrings so if any of them need
|
||||
// tweaked they can be overridden below
|
||||
%include _stc_gendocs.i
|
||||
|
||||
|
||||
// TODO: Class docstring
|
||||
DocStr(wxStyledTextCtrl,
|
||||
"", "");
|
||||
|
||||
// TODO: Main constructor
|
||||
DocStr(wxStyledTextCtrl::wxStyledTextCtrl,
|
||||
"", "");
|
||||
|
||||
// TODO: "Pre" constructor
|
||||
DocStr(wxStyledTextCtrl::wxStyledTextCtrl(),
|
||||
"", "");
|
||||
|
||||
|
||||
|
||||
DocStr(wxStyledTextCtrl::GetCurrentLine,
|
||||
"Returns the line number of the line with the caret.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::StyleSetSpec,
|
||||
"Extract style settings from a spec-string which is composed of one or
|
||||
more of the following comma separated elements::
|
||||
|
||||
bold turns on bold
|
||||
italic turns on italics
|
||||
fore:[name or #RRGGBB] sets the foreground colour
|
||||
back:[name or #RRGGBB] sets the background colour
|
||||
face:[facename] sets the font face name to use
|
||||
size:[num] sets the font size in points
|
||||
eol turns on eol filling
|
||||
underline turns on underlining
|
||||
", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::StyleSetFont,
|
||||
"Set style size, face, bold, italic, and underline attributes from the
|
||||
attributes of a `wx.Font`.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::StyleSetFontAttr,
|
||||
"Set all font style attributes at once.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::StyleSetCharacterSet,
|
||||
"Set the character set of the font in a style. Converts the Scintilla
|
||||
wx.stc.STC_CHARSET_* set values to a wxFontEncoding.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::StyleSetFontEncoding,
|
||||
"Set the font encoding to be used by a style.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::CmdKeyExecute,
|
||||
"Perform one of the operations defined by the wx.stc.STC_CMD_* constants.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::SetMargins,
|
||||
"Set the left and right margin in the edit area, measured in pixels.", "");
|
||||
|
||||
DocAStr(wxStyledTextCtrl::GetSelection,
|
||||
"GetSelection(self) -> (startPos, endPos)",
|
||||
"Retrieve the start and end positions of the current selection.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::PointFromPosition,
|
||||
"Retrieve the point in the window where a position is displayed.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::ScrollToLine,
|
||||
"Scroll enough to make the given line visible.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::ScrollToColumn,
|
||||
"Scroll enough to make the given column visible", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::SendMsg,
|
||||
"Send a message to Scintilla.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::SetVScrollBar,
|
||||
"Set the vertical scrollbar to use instead of the one that's built-in.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::SetHScrollBar,
|
||||
"Set the horizontal scrollbar to use instead of the ont that's built-in.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::SaveFile,
|
||||
"Write the contents of the editor to filename", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::LoadFile,
|
||||
"Load the contents of filename into the editor", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::DoDragOver,
|
||||
"Allow for simulating a DnD DragOver.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::DoDropText,
|
||||
"Allow for simulating a DnD DropText.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::SetUseAntiAliasing,
|
||||
"Specify whether anti-aliased fonts should be used. Will have no
|
||||
effect on some platforms, but on some (wxMac for example) can greatly
|
||||
improve performance.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::GetUseAntiAliasing,
|
||||
"Returns the current UseAntiAliasing setting.", "");
|
||||
|
||||
|
||||
|
||||
DocStr(wxStyledTextCtrl::AddTextRaw,
|
||||
"Add text to the document at current position. The text should be
|
||||
utf-8 encoded on unicode builds of wxPython, or can be any 8-bit text
|
||||
in ansi builds.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::InsertTextRaw,
|
||||
"Insert string at a position. The text should be utf-8 encoded on
|
||||
unicode builds of wxPython, or can be any 8-bit text in ansi builds.", "");
|
||||
|
||||
DocAStr(wxStyledTextCtrl::GetCurLineRaw,
|
||||
"GetCurLineRaw() -> (text, index)",
|
||||
"Retrieve the text of the line containing the caret, and also the index
|
||||
of the caret on the line. The returned value is a utf-8 encoded
|
||||
string in unicode builds of wxPython, or raw 8-bit text otherwise.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::GetLineRaw,
|
||||
"Retrieve the contents of a line. The returned value is a utf-8
|
||||
encoded string in unicode builds of wxPython, or raw 8-bit text
|
||||
otherwise.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::GetSelectedTextRaw,
|
||||
"Retrieve the selected text. The returned value is a utf-8 encoded
|
||||
string in unicode builds of wxPython, or raw 8-bit text otherwise.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::GetTextRangeRaw,
|
||||
"Retrieve a range of text. The returned value is a utf-8 encoded
|
||||
string in unicode builds of wxPython, or raw 8-bit text otherwise.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::SetTextRaw,
|
||||
"Replace the contents of the document with the argument text. The text
|
||||
should be utf-8 encoded on unicode builds of wxPython, or can be any
|
||||
8-bit text in ansi builds.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::GetTextRaw,
|
||||
"Retrieve all the text in the document. The returned value is a utf-8
|
||||
encoded string in unicode builds of wxPython, or raw 8-bit text
|
||||
otherwise.", "");
|
||||
|
||||
DocStr(wxStyledTextCtrl::AppendTextRaw,
|
||||
"Append a string to the end of the document without changing the
|
||||
selection. The text should be utf-8 encoded on unicode builds of
|
||||
wxPython, or can be any 8-bit text in ansi builds.", "");
|
||||
|
||||
|
||||
|
||||
|
||||
// Overrides for some of the generated docstrings
|
||||
|
||||
DocAStr(wxStyledTextCtrl::GetCurLine,
|
||||
"GetCurLine(self) -> (text, pos)",
|
||||
"Retrieve the text of the line containing the caret, and also theindex
|
||||
of the caret on the line.", "");
|
||||
|
||||
|
||||
|
||||
// For some reason these are not getting the right docstrings, but are
|
||||
// inheriting the docstrings from wxWindow instead. So we'll have to
|
||||
// replace the whole proxy method instead.
|
||||
%feature("shadow") wxStyledTextCtrl::LineDown
|
||||
%{
|
||||
def LineDown(*args, **kwargs):
|
||||
"""
|
||||
LineDown(self)
|
||||
|
||||
Move caret down one line.
|
||||
"""
|
||||
return _stc.StyledTextCtrl_LineDown(*args, **kwargs)
|
||||
%}
|
||||
|
||||
%feature("shadow") wxStyledTextCtrl::LineUp
|
||||
%{
|
||||
def LineUp(*args, **kwargs):
|
||||
"""
|
||||
LineUp(self)
|
||||
|
||||
Move caret up one line.
|
||||
"""
|
||||
return _stc.StyledTextCtrl_LineUp(*args, **kwargs)
|
||||
%}
|
||||
|
||||
%feature("shadow") wxStyledTextCtrl::PageDown
|
||||
%{
|
||||
def PageDown(*args, **kwargs):
|
||||
"""
|
||||
PageDown(self)
|
||||
|
||||
Move caret one page down.
|
||||
"""
|
||||
return _stc.StyledTextCtrl_PageDown(*args, **kwargs)
|
||||
%}
|
||||
|
||||
%feature("shadow") wxStyledTextCtrl::PageUp
|
||||
%{
|
||||
def PageUp(*args, **kwargs):
|
||||
"""
|
||||
PageUp(self)
|
||||
|
||||
Move caret one page up.
|
||||
"""
|
||||
return _stc.StyledTextCtrl_PageUp(*args, **kwargs)
|
||||
%}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue