[wxmax commit] r169 - in trunk/wx.mod: wx.mod wxdc.mod wxmacpagemarginsdialog.mod wxmacpagemarginsdialog.mod/doc...

3 views
Skip to first unread message

codesite...@google.com

unread,
Dec 26, 2007, 3:35:16 PM12/26/07
to wx...@googlegroups.com
Author: woollybah
Date: Wed Dec 26 12:33:42 2007
New Revision: 169

Added:
trunk/wx.mod/wxmacpagemarginsdialog.mod/
trunk/wx.mod/wxmacpagemarginsdialog.mod/common.bmx
trunk/wx.mod/wxmacpagemarginsdialog.mod/doc/
trunk/wx.mod/wxmacpagemarginsdialog.mod/glue.cpp
trunk/wx.mod/wxmacpagemarginsdialog.mod/glue.h
trunk/wx.mod/wxmacpagemarginsdialog.mod/wxmacpagemarginsdialog.bmx
trunk/wx.mod/wxpagesetupdialog.mod/
trunk/wx.mod/wxpagesetupdialog.mod/common.bmx
trunk/wx.mod/wxpagesetupdialog.mod/doc/
trunk/wx.mod/wxpagesetupdialog.mod/glue.cpp
trunk/wx.mod/wxpagesetupdialog.mod/glue.h
trunk/wx.mod/wxpagesetupdialog.mod/wxpagesetupdialog.bmx
trunk/wx.mod/wxpreviewframe.mod/
trunk/wx.mod/wxpreviewframe.mod/common.bmx
trunk/wx.mod/wxpreviewframe.mod/doc/
trunk/wx.mod/wxpreviewframe.mod/glue.cpp
trunk/wx.mod/wxpreviewframe.mod/glue.h
trunk/wx.mod/wxpreviewframe.mod/wxpreviewframe.bmx
Modified:
trunk/wx.mod/wx.mod/wxWidgets_BuildNotes.txt
trunk/wx.mod/wx.mod/wxglue.cpp
trunk/wx.mod/wx.mod/wxglue.h
trunk/wx.mod/wxdc.mod/common.bmx
trunk/wx.mod/wxdc.mod/glue.cpp
trunk/wx.mod/wxdc.mod/glue.h
trunk/wx.mod/wxdc.mod/wxdc.bmx
trunk/wx.mod/wxpagesetupdialogdata.mod/common.bmx
trunk/wx.mod/wxpagesetupdialogdata.mod/glue.cpp
trunk/wx.mod/wxpagesetupdialogdata.mod/glue.h
trunk/wx.mod/wxpagesetupdialogdata.mod/wxpagesetupdialogdata.bmx
trunk/wx.mod/wxprintdata.mod/common.bmx
trunk/wx.mod/wxprintdata.mod/glue.cpp
trunk/wx.mod/wxprintdata.mod/glue.h
trunk/wx.mod/wxprintdata.mod/wxprintdata.bmx
trunk/wx.mod/wxprintdialog.mod/common.bmx
trunk/wx.mod/wxprintdialog.mod/glue.cpp
trunk/wx.mod/wxprintdialog.mod/glue.h
trunk/wx.mod/wxprintdialog.mod/wxprintdialog.bmx
trunk/wx.mod/wxprinter.mod/common.bmx
trunk/wx.mod/wxprinter.mod/glue.cpp
trunk/wx.mod/wxprinter.mod/glue.h
trunk/wx.mod/wxprinter.mod/wxprinter.bmx
trunk/wx.mod/wxprintout.mod/common.bmx
trunk/wx.mod/wxprintout.mod/doc/ (props changed)
trunk/wx.mod/wxprintout.mod/glue.cpp
trunk/wx.mod/wxprintout.mod/glue.h
trunk/wx.mod/wxprintout.mod/wxprintout.bmx
trunk/wx.mod/wxprintpreview.mod/common.bmx
trunk/wx.mod/wxprintpreview.mod/glue.cpp
trunk/wx.mod/wxprintpreview.mod/glue.h
trunk/wx.mod/wxprintpreview.mod/wxprintpreview.bmx

Log:
Implemented Printing functionality.

Modified: trunk/wx.mod/wx.mod/wxWidgets_BuildNotes.txt
==============================================================================
--- trunk/wx.mod/wx.mod/wxWidgets_BuildNotes.txt (original)
+++ trunk/wx.mod/wx.mod/wxWidgets_BuildNotes.txt Wed Dec 26 12:33:42 2007
@@ -4,9 +4,10 @@
Linux :

wxGTK 2.8.x
- ./configure --enable-unicode --with-opengl --enable-mediactrl
+ ./configure --enable-unicode --with-opengl --enable-mediactrl --enable-graphics_ctx

add "--disable-shared" for static libraries
+ using "--enable-mediactrl" requires gstreamer installation

make
make install (as root) (not required for static libraries)
@@ -17,7 +18,7 @@
MacOS :

wxMac 2.8.x
- ./configure --enable-unicode --with-opengl --enable-mediactrl
+ ./configure --enable-unicode --with-opengl --enable-mediactrl
--enable-graphics_ctx --disable-shared --with-expat=builtin

add "--disable-shared" for static libraries

@@ -32,6 +33,7 @@
wxMSW 2.8.x

edit build/msw/config.gcc, and change the following entries :
+ BUILD := release
UNICODE = 1
USE_OPENGL = 1


Modified: trunk/wx.mod/wx.mod/wxglue.cpp
==============================================================================
--- trunk/wx.mod/wx.mod/wxglue.cpp (original)
+++ trunk/wx.mod/wx.mod/wxglue.cpp Wed Dec 26 12:33:42 2007
@@ -244,12 +244,25 @@
void MaxDC::init(wxDC * _dc)
{
dc = _dc;
+ owner = false;
}

MaxPaintDC::MaxPaintDC(wxWindow * window)
: paintDC(window)
{
MaxDC::init(&paintDC);
+}
+
+MaxDC::MaxDC(wxDC * _dc)
+{
+ dc = _dc;
+ owner = true;
+}
+
+MaxDC::~MaxDC() {
+ if (owner) {
+ delete dc;
+ }
}

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

Modified: trunk/wx.mod/wx.mod/wxglue.h
==============================================================================
--- trunk/wx.mod/wx.mod/wxglue.h (original)
+++ trunk/wx.mod/wx.mod/wxglue.h Wed Dec 26 12:33:42 2007
@@ -352,9 +352,12 @@
public:
MaxDC();
MaxDC(wxDC & dc);
+ MaxDC(wxDC * dc);
+ ~MaxDC();
wxDC * GetDC();
void init(wxDC * _dc);
private:
+ bool owner;
wxDC * dc;
};


Modified: trunk/wx.mod/wxdc.mod/common.bmx
==============================================================================
--- trunk/wx.mod/wxdc.mod/common.bmx (original)
+++ trunk/wx.mod/wxdc.mod/common.bmx Wed Dec 26 12:33:42 2007
@@ -138,6 +138,8 @@
Function bmx_wxdc_startdoc(handle:Byte Ptr, message:String)
Function bmx_wxdc_startpage(handle:Byte Ptr)

+ Function bmx_wxdc_delete(handle:Byte Ptr)
+ Function bmx_wxdc_free(handle:Byte Ptr)

Function bmx_wxmirrordc_create:Byte Ptr(dc:Byte Ptr, mirror:Int)


Modified: trunk/wx.mod/wxdc.mod/glue.cpp
==============================================================================
--- trunk/wx.mod/wxdc.mod/glue.cpp (original)
+++ trunk/wx.mod/wxdc.mod/glue.cpp Wed Dec 26 12:33:42 2007
@@ -438,6 +438,13 @@
dc->GetDC()->StartPage();
}

+void bmx_wxdc_delete(MaxDC * dc) {
+ delete dc;
+}
+
+void bmx_wxdc_free(MaxDC * dc) {
+ delete dc;
+}


// *********************************************

Modified: trunk/wx.mod/wxdc.mod/glue.h
==============================================================================
--- trunk/wx.mod/wxdc.mod/glue.h (original)
+++ trunk/wx.mod/wxdc.mod/glue.h Wed Dec 26 12:33:42 2007
@@ -125,6 +125,9 @@
void bmx_wxdc_setpalette(MaxDC * dc, MaxPalette * palette);
void bmx_wxdc_startdoc(MaxDC * dc, BBString * message);
void bmx_wxdc_startpage(MaxDC * dc);
+
+ void bmx_wxdc_delete(MaxDC * dc);
+ void bmx_wxdc_free(MaxDC * dc);

MaxClientDC * bmx_wxclientdc_create(wxWindow * window);
void bmx_wxclientdc_delete(MaxClientDC * dc);

Modified: trunk/wx.mod/wxdc.mod/wxdc.bmx
==============================================================================
--- trunk/wx.mod/wxdc.mod/wxdc.bmx (original)
+++ trunk/wx.mod/wxdc.mod/wxdc.bmx Wed Dec 26 12:33:42 2007
@@ -160,7 +160,7 @@
to 0). See also SetTextForeground, SetTextBackground and wxMemoryDC.
</p>
End Rem
- Method DrawBitmap(bitmap:wxBitmap, x:Int, y:Int, transparent:Int)
+ Method DrawBitmap(bitmap:wxBitmap, x:Int, y:Int, transparent:Int = True)
wx_wxdc_drawbitmap(wxObjectPtr, bitmap.wxObjectPtr, x, y, transparent)
End Method

@@ -853,8 +853,19 @@
undesired effects.
End Rem
Method Free()
+ If wxObjectPtr Then
+ bmx_wxdc_free(wxObjectPtr)
+ wxObjectPtr = Null
+ End If
End Method

+ Method Delete()
+ If wxObjectPtr Then
+ bmx_wxdc_delete(wxObjectPtr)
+ wxObjectPtr = Null
+ End If
+ End Method
+
End Type

Rem

Added: trunk/wx.mod/wxmacpagemarginsdialog.mod/common.bmx
==============================================================================
--- (empty file)
+++ trunk/wx.mod/wxmacpagemarginsdialog.mod/common.bmx Wed Dec 26
12:33:42 2007
@@ -0,0 +1,49 @@
+' Copyright (c) 2007 Bruce A Henderson
+'
+' Permission is hereby granted, free of charge, to any person
obtaining a copy
+' of this software and associated documentation files
(the "Software"), to deal
+' in the Software without restriction, including without limitation
the rights
+' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+' copies of the Software, and to permit persons to whom the Software is
+' furnished to do so, subject to the following conditions:
+'
+' The above copyright notice and this permission notice shall be
included in
+' all copies or substantial portions of the Software.
+'
+' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
+' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
+' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN
+' THE SOFTWARE.
+'
+SuperStrict
+
+Import wx.wx
+Import wx.wxDialog
+Import wx.wxPageSetupDialogData
+Import wx.wxFrame
+Import BRL.Blitz
+
+
+' headers :-)
+?linux
+Import "../lib/linux/wx/include/gtk2-unicode-release-static/*.h"
+Import "../include/*.h"
+?win32
+Import "../lib/win32/mswu/*.h"
+Import "../include/*.h"
+?macosppc
+Import "../lib/macosppc/wx/include/mac-unicode-release-static/*.h"
+Import "../include/*.h"
+?macosx86
+Import "../lib/macosx86/wx/include/mac-unicode-release-static/*.h"
+Import "../include/*.h"
+?
+
+Import "glue.cpp"
+
+Extern
+
+End Extern

Added: trunk/wx.mod/wxmacpagemarginsdialog.mod/glue.cpp
==============================================================================
--- (empty file)
+++ trunk/wx.mod/wxmacpagemarginsdialog.mod/glue.cpp Wed Dec 26
12:33:42 2007
@@ -0,0 +1,31 @@
+/*
+ Copyright (c) 2007 Bruce A Henderson
+
+ Permission is hereby granted, free of charge, to any person
obtaining a copy
+ of this software and associated documentation files
(the "Software"), to deal
+ in the Software without restriction, including without limitation
the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN
+ THE SOFTWARE.
+*/
+
+#include "glue.h"
+
+// ---------------------------------------------------------------------------------------
+
+
+
+// *********************************************
+
+

Added: trunk/wx.mod/wxmacpagemarginsdialog.mod/glue.h
==============================================================================
--- (empty file)
+++ trunk/wx.mod/wxmacpagemarginsdialog.mod/glue.h Wed Dec 26 12:33:42 2007
@@ -0,0 +1,35 @@
+/*
+ Copyright (c) 2007 Bruce A Henderson
+
+ Permission is hereby granted, free of charge, to any person
obtaining a copy
+ of this software and associated documentation files
(the "Software"), to deal
+ in the Software without restriction, including without limitation
the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN
+ THE SOFTWARE.
+*/
+
+#include "wxglue.h"
+
+//class MaxNotebook;
+
+extern "C" {
+
+#include <blitz.h>
+
+
+}
+
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+

Added: trunk/wx.mod/wxmacpagemarginsdialog.mod/wxmacpagemarginsdialog.bmx
==============================================================================
--- (empty file)
+++ trunk/wx.mod/wxmacpagemarginsdialog.mod/wxmacpagemarginsdialog.bmx
Wed Dec 26 12:33:42 2007
@@ -0,0 +1,105 @@
+' Copyright (c) 2007 Bruce A Henderson
+'
+' Permission is hereby granted, free of charge, to any person
obtaining a copy
+' of this software and associated documentation files
(the "Software"), to deal
+' in the Software without restriction, including without limitation
the rights
+' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+' copies of the Software, and to permit persons to whom the Software is
+' furnished to do so, subject to the following conditions:
+'
+' The above copyright notice and this permission notice shall be
included in
+' all copies or substantial portions of the Software.
+'
+' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
+' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
+' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN
+' THE SOFTWARE.
+'
+SuperStrict
+
+Rem
+bbdoc: wxMacPageMarginsDialog
+End Rem
+Module wx.wxMacPageMarginsDialog
+
+ModuleInfo "Version: 1.00"
+ModuleInfo "License: MIT"
+ModuleInfo "Author: Bruce A Henderson"
+ModuleInfo "Copyright: (c) 2007 Bruce A Henderson"
+ModuleInfo "Modserver: BRL"
+
+?linux
+ModuleInfo "CC_OPTS: -D__WXGTK__"
+ModuleInfo "CC_OPTS: -D_FILE_OFFSET_BITS=64"
+ModuleInfo "CC_OPTS: -D_LARGE_FILES"
+ModuleInfo "CC_OPTS: -DWX_PRECOMP"
+?win32
+ModuleInfo "CC_OPTS: -DHAVE_W32API_H"
+ModuleInfo "CC_OPTS: -D__WXMSW__"
+ModuleInfo "CC_OPTS: -D_UNICODE"
+ModuleInfo "CC_OPTS: -DUNICODE"
+?macos
+ModuleInfo "CC_OPTS: -D__WXMAC__"
+ModuleInfo "CC_OPTS: -D_FILE_OFFSET_BITS=64"
+ModuleInfo "CC_OPTS: -D_LARGE_FILES"
+ModuleInfo "CC_OPTS: -DWX_PRECOMP"
+?
+
+' Mac Only :-)
+?macos
+Import "common.bmx"
+
+Rem
+bbdoc: A Mac dialog for setting the page margins separately from page
setup since (native) wxMacPageSetupDialog doesn't let you set margins.
+End Rem
+Type wxMacPageMarginsDialog Extends wxDialog
+
+ Rem
+ bbdoc:
+ End Rem
+ Function
CreateMacPageMarginsDialog:wxMacPageMarginsDialog(parent:wxFrame,
data:wxPageSetupDialogData = Null)
+ Return New wxMacPageMarginsDialog.Create(parent, data)
+ End Function
+
+ Rem
+ bbdoc:
+ End Rem
+ Method Create:wxMacPageMarginsDialog(parent:wxFrame,
data:wxPageSetupDialogData = Null)
+ Return Self
+ End Method
+
+ Rem
+ bbdoc:
+ End Rem
+ Method TransferToWindow:Int()
+ End Method
+
+ Rem
+ bbdoc:
+ End Rem
+ Method TransferDataFromWindow:Int()
+ End Method
+
+ Rem
+ bbdoc:
+ End Rem
+ Method GetPageSetupDialogData:wxPageSetupDialogData()
+ End Method
+
+End Type
+
+
+
+
+
+
+
+
+
+
+
+?
+

Added: trunk/wx.mod/wxpagesetupdialog.mod/common.bmx
==============================================================================
--- (empty file)
+++ trunk/wx.mod/wxpagesetupdialog.mod/common.bmx Wed Dec 26 12:33:42 2007
@@ -0,0 +1,52 @@
+' Copyright (c) 2007 Bruce A Henderson
+'
+' Permission is hereby granted, free of charge, to any person
obtaining a copy
+' of this software and associated documentation files
(the "Software"), to deal
+' in the Software without restriction, including without limitation
the rights
+' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+' copies of the Software, and to permit persons to whom the Software is
+' furnished to do so, subject to the following conditions:
+'
+' The above copyright notice and this permission notice shall be
included in
+' all copies or substantial portions of the Software.
+'
+' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
+' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
+' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN
+' THE SOFTWARE.
+'
+SuperStrict
+
+Import wx.wx
+Import wx.wxDialog
+Import wx.wxPageSetupDialogData
+Import BRL.Blitz
+
+
+' headers :-)
+?linux
+Import "../lib/linux/wx/include/gtk2-unicode-release-static/*.h"
+Import "../include/*.h"
+?win32
+Import "../lib/win32/mswu/*.h"
+Import "../include/*.h"
+?macosppc
+Import "../lib/macosppc/wx/include/mac-unicode-release-static/*.h"
+Import "../include/*.h"
+?macosx86
+Import "../lib/macosx86/wx/include/mac-unicode-release-static/*.h"
+Import "../include/*.h"
+?
+
+Import "glue.cpp"
+
+Extern
+
+ Function bmx_wxpagesetupdialog_create:Byte Ptr(handle:Object,
parent:Byte Ptr, data:Byte Ptr)
+ Function bmx_wxpagesetupdialog_getpagesetupdata:Byte Ptr(handle:Byte Ptr)
+ Function bmx_wxpagesetupdialog_showmodal:Int(handle:Byte Ptr)
+
+End Extern

Added: trunk/wx.mod/wxpagesetupdialog.mod/glue.cpp
==============================================================================
--- (empty file)
+++ trunk/wx.mod/wxpagesetupdialog.mod/glue.cpp Wed Dec 26 12:33:42 2007
@@ -0,0 +1,51 @@
+/*
+ Copyright (c) 2007 Bruce A Henderson
+
+ Permission is hereby granted, free of charge, to any person
obtaining a copy
+ of this software and associated documentation files
(the "Software"), to deal
+ in the Software without restriction, including without limitation
the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN
+ THE SOFTWARE.
+*/
+
+#include "glue.h"
+
+// ---------------------------------------------------------------------------------------
+
+MaxPageSetupDialog::MaxPageSetupDialog(BBObject * handle, wxWindow *
parent, wxPageSetupDialogData * data)
+ : wxPageSetupDialog(parent, data)
+{
+ wxbind(this, handle);
+}
+
+MaxPageSetupDialog::~MaxPageSetupDialog() {
+ wxunbind(this);
+}
+
+
+// *********************************************
+
+wxPageSetupDialog * bmx_wxpagesetupdialog_create(BBObject * handle,
wxWindow * parent, wxPageSetupDialogData * data) {
+ return new MaxPageSetupDialog(handle, parent, data);
+}
+
+wxPageSetupDialogData *
bmx_wxpagesetupdialog_getpagesetupdata(wxPageSetupDialog * dialog) {
+ return &dialog->GetPageSetupData();
+}
+
+int bmx_wxpagesetupdialog_showmodal(wxPageSetupDialog * dialog) {
+ return dialog->ShowModal();
+}
+

Added: trunk/wx.mod/wxpagesetupdialog.mod/glue.h
==============================================================================
--- (empty file)
+++ trunk/wx.mod/wxpagesetupdialog.mod/glue.h Wed Dec 26 12:33:42 2007
@@ -0,0 +1,46 @@
+/*
+ Copyright (c) 2007 Bruce A Henderson
+
+ Permission is hereby granted, free of charge, to any person
obtaining a copy
+ of this software and associated documentation files
(the "Software"), to deal
+ in the Software without restriction, including without limitation
the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN
+ THE SOFTWARE.
+*/
+
+#include "wxglue.h"
+#include "wx/printdlg.h"
+
+class MaxPageSetupDialog;
+
+extern "C" {
+
+#include <blitz.h>
+
+ wxPageSetupDialog * bmx_wxpagesetupdialog_create(BBObject * handle,
wxWindow * parent, wxPageSetupDialogData * data);
+ wxPageSetupDialogData *
bmx_wxpagesetupdialog_getpagesetupdata(wxPageSetupDialog * dialog);
+ int bmx_wxpagesetupdialog_showmodal(wxPageSetupDialog * dialog);
+
+}
+
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+class MaxPageSetupDialog : public wxPageSetupDialog
+{
+public:
+ MaxPageSetupDialog(BBObject * handle, wxWindow * parent,
wxPageSetupDialogData* data);
+ ~ MaxPageSetupDialog();
+};
+

Added: trunk/wx.mod/wxpagesetupdialog.mod/wxpagesetupdialog.bmx
==============================================================================
--- (empty file)
+++ trunk/wx.mod/wxpagesetupdialog.mod/wxpagesetupdialog.bmx Wed Dec 26
12:33:42 2007
@@ -0,0 +1,110 @@
+' Copyright (c) 2007 Bruce A Henderson
+'
+' Permission is hereby granted, free of charge, to any person
obtaining a copy
+' of this software and associated documentation files
(the "Software"), to deal
+' in the Software without restriction, including without limitation
the rights
+' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+' copies of the Software, and to permit persons to whom the Software is
+' furnished to do so, subject to the following conditions:
+'
+' The above copyright notice and this permission notice shall be
included in
+' all copies or substantial portions of the Software.
+'
+' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
+' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
+' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN
+' THE SOFTWARE.
+'
+SuperStrict
+
+Module wx.wxPageSetupDialog
+
+ModuleInfo "Version: 1.00"
+ModuleInfo "License: MIT"
+ModuleInfo "Author: Bruce A Henderson"
+ModuleInfo "Copyright: (c) 2007 Bruce A Henderson"
+ModuleInfo "Modserver: BRL"
+
+?linux
+ModuleInfo "CC_OPTS: -D__WXGTK__"
+ModuleInfo "CC_OPTS: -D_FILE_OFFSET_BITS=64"
+ModuleInfo "CC_OPTS: -D_LARGE_FILES"
+ModuleInfo "CC_OPTS: -DWX_PRECOMP"
+?win32
+ModuleInfo "CC_OPTS: -DHAVE_W32API_H"
+ModuleInfo "CC_OPTS: -D__WXMSW__"
+ModuleInfo "CC_OPTS: -D_UNICODE"
+ModuleInfo "CC_OPTS: -DUNICODE"
+?macos
+ModuleInfo "CC_OPTS: -D__WXMAC__"
+ModuleInfo "CC_OPTS: -D_FILE_OFFSET_BITS=64"
+ModuleInfo "CC_OPTS: -D_LARGE_FILES"
+ModuleInfo "CC_OPTS: -DWX_PRECOMP"
+?
+
+Import "common.bmx"
+
+Rem
+bbdoc: This type represents the page setup common dialog.
+about: In MSW, the page setup dialog is standard from Windows 95 on,
replacing the print setup dialog
+(which is retained in Windows and wxWidgets for backward
compatibility). On Windows 95 and NT 4.0
+and above, the page setup dialog is native to the windowing system,
otherwise it is emulated.
+<p>
+The page setup dialog contains controls for paper size (A4, A5 etc.),
orientation (landscape or
+portrait), and controls for setting left, top, right and bottom margin
sizes in millimetres.
+</p>
+<p>
+On Macintosh, the native page setup dialog is used, which lets you
select paper size and orientation
+but it does not let you change the page margins.
+</p>
+<p>
+On other platforms, a generic dialog is used.
+</p>
+<p>
+When the dialog has been closed, you need to query the
wxPageSetupDialogData object associated with
+the dialog.
+</p>
+<p>
+Note that the OK and Cancel buttons do not destroy the dialog; this
must be done by the application.
+</p>
+End Rem
+Type wxPageSetupDialog Extends wxDialog
+
+ Rem
+ bbdoc:
+ End Rem
+ Function CreatePageSetupDialog:wxPageSetupDialog(parent:wxWindow,
data:wxPageSetupDialogData = Null)
+ Return New wxPageSetupDialog.Create(parent, data)
+ End Function
+
+ Rem
+ bbdoc:
+ End Rem
+ Method Create:wxPageSetupDialog(parent:wxWindow,
data:wxPageSetupDialogData = Null)
+ If data Then
+ wxObjectPtr = bmx_wxpagesetupdialog_create(Self,
parent.wxObjectPtr, data.wxObjectPtr)
+ Else
+ wxObjectPtr = bmx_wxpagesetupdialog_create(Self,
parent.wxObjectPtr, Null)
+ End If
+ Return Self
+ End Method
+
+ Rem
+ bbdoc: Returns the page setup data associated with the dialog.
+ End Rem
+ Method GetPageSetupData:wxPageSetupDialogData()
+ Return wxPageSetupDialogData._find(bmx_wxpagesetupdialog_getpagesetupdata(wxObjectPtr))
+ End Method
+
+ Rem
+ bbdoc: Shows the dialog, returning wxID_OK if the user pressed OK,
and wxID_CANCEL otherwise.
+ End Rem
+ Method ShowModal:Int()
+ Return bmx_wxpagesetupdialog_showmodal(wxObjectPtr)
+ End Method
+
+End Type
+

Modified: trunk/wx.mod/wxpagesetupdialogdata.mod/common.bmx
==============================================================================
--- trunk/wx.mod/wxpagesetupdialogdata.mod/common.bmx (original)
+++ trunk/wx.mod/wxpagesetupdialogdata.mod/common.bmx Wed Dec 26
12:33:42 2007
@@ -44,4 +44,36 @@

Extern

+ Function bmx_wxpagesetupdialogdata_create:Byte Ptr(handle:Object,
printData:Byte Ptr)
+
+ Function bmx_wxpagesetupdialogdata_enablehelp(handle:Byte Ptr, flag:Int)
+ Function bmx_wxpagesetupdialogdata_enablemargins(handle:Byte Ptr, flag:Int)
+ Function bmx_wxpagesetupdialogdata_enableorientation(handle:Byte Ptr, flag:Int)
+ Function bmx_wxpagesetupdialogdata_enablepaper(handle:Byte Ptr, flag:Int)
+ Function bmx_wxpagesetupdialogdata_enableprinter(handle:Byte Ptr, flag:Int)
+ Function
bmx_wxpagesetupdialogdata_getdefaultminmargins:Int(handle:Byte Ptr)
+ Function bmx_wxpagesetupdialogdata_getenablemargins:Int(handle:Byte Ptr)
+ Function
bmx_wxpagesetupdialogdata_getenableorientation:Int(handle:Byte Ptr)
+ Function bmx_wxpagesetupdialogdata_getenablepaper:Int(handle:Byte Ptr)
+ Function bmx_wxpagesetupdialogdata_getenableprinter:Int(handle:Byte Ptr)
+ Function bmx_wxpagesetupdialogdata_getenablehelp:Int(handle:Byte Ptr)
+ Function bmx_wxpagesetupdialogdata_getdefaultinfo:Int(handle:Byte Ptr)
+ Function bmx_wxpagesetupdialogdata_getmargintopleft(handle:Byte Ptr,
leftMargin:Int Ptr, topMargin:Int Ptr)
+ Function bmx_wxpagesetupdialogdata_getmarginbottomright(handle:Byte
Ptr, rightMargin:Int Ptr, bottomMargin:Int Ptr)
+ Function bmx_wxpagesetupdialogdata_getminmargintopleft(handle:Byte
Ptr, leftMin:Int Ptr, topMin:Int Ptr)
+ Function
bmx_wxpagesetupdialogdata_getminmarginbottomright(handle:Byte Ptr,
rightMin:Int Ptr, bottomMin:Int Ptr)
+ Function bmx_wxpagesetupdialogdata_getpaperid:Int(handle:Byte Ptr)
+ Function bmx_wxpagesetupdialogdata_getpapersize(handle:Byte Ptr,
w:Int Ptr, h:Int Ptr)
+ Function bmx_wxpagesetupdialogdata_getprintdata:Byte Ptr(handle:Byte Ptr)
+ Function bmx_wxpagesetupdialogdata_isok:Int(handle:Byte Ptr)
+ Function bmx_wxpagesetupdialogdata_setdefaultinfo(handle:Byte Ptr, flag:Int)
+ Function bmx_wxpagesetupdialogdata_setdefaultminmargins(handle:Byte
Ptr, flag:Int)
+ Function bmx_wxpagesetupdialogdata_setmargintopleft(handle:Byte Ptr,
leftMargin:Int, topMargin:Int)
+ Function bmx_wxpagesetupdialogdata_setmarginbottomright(handle:Byte
Ptr, rightMargin:Int, bottomMargin:Int)
+ Function bmx_wxpagesetupdialogdata_setminmargintopleft(handle:Byte
Ptr, leftMin:Int, topMin:Int)
+ Function
bmx_wxpagesetupdialogdata_setminmarginbottomright(handle:Byte Ptr,
rightMin:Int, bottomMin:Int)
+ Function bmx_wxpagesetupdialogdata_setpaperid(handle:Byte Ptr, id:Int)
+ Function bmx_wxpagesetupdialogdata_setpapersize(handle:Byte Ptr,
w:Int, h:Int)
+ Function bmx_wxpagesetupdialogdata_setprintdata(handle:Byte Ptr,
printData:Byte Ptr)
+
End Extern

Modified: trunk/wx.mod/wxpagesetupdialogdata.mod/glue.cpp
==============================================================================
--- trunk/wx.mod/wxpagesetupdialogdata.mod/glue.cpp (original)
+++ trunk/wx.mod/wxpagesetupdialogdata.mod/glue.cpp Wed Dec 26 12:33:42 2007
@@ -24,8 +24,156 @@

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

+MaxPageSetupDialogData::MaxPageSetupDialogData(BBObject * handle)
+{
+ wxbind(this, handle);
+}

+MaxPageSetupDialogData::MaxPageSetupDialogData(BBObject * handle,
wxPrintData & data)
+ : wxPageSetupDialogData(data)
+{
+ wxbind(this, handle);
+}
+
+MaxPageSetupDialogData::~ MaxPageSetupDialogData()
+{
+ wxunbind(this);
+}

// *********************************************

+
+wxPageSetupDialogData * bmx_wxpagesetupdialogdata_create(BBObject *
handle, MaxPrintData * data) {
+ if(data) {
+ return new MaxPageSetupDialogData(handle, data->Data());
+ } else {
+ return new MaxPageSetupDialogData(handle);
+ }
+}
+
+void bmx_wxpagesetupdialogdata_enablehelp(wxPageSetupDialogData *
setup, bool flag) {
+ setup->EnableHelp(flag);
+}
+
+void bmx_wxpagesetupdialogdata_enablemargins(wxPageSetupDialogData *
setup, bool flag) {
+ setup->EnableMargins(flag);
+}
+
+void bmx_wxpagesetupdialogdata_enableorientation(wxPageSetupDialogData
* setup, bool flag) {
+ setup->EnableOrientation(flag);
+}
+
+void bmx_wxpagesetupdialogdata_enablepaper(wxPageSetupDialogData *
setup, bool flag) {
+ setup->EnablePaper(flag);
+}
+
+void bmx_wxpagesetupdialogdata_enableprinter(wxPageSetupDialogData *
setup, bool flag) {
+ setup->EnablePrinter(flag);
+}
+
+bool
bmx_wxpagesetupdialogdata_getdefaultminmargins(wxPageSetupDialogData *
setup) {
+ return setup->GetDefaultMinMargins();
+}
+
+bool bmx_wxpagesetupdialogdata_getenablemargins(wxPageSetupDialogData
* setup) {
+ return setup->GetEnableMargins();
+}
+
+bool
bmx_wxpagesetupdialogdata_getenableorientation(wxPageSetupDialogData *
setup) {
+ return setup->GetEnableOrientation();
+}
+
+bool bmx_wxpagesetupdialogdata_getenablepaper(wxPageSetupDialogData *
setup) {
+ return setup->GetEnablePaper();
+}
+
+bool bmx_wxpagesetupdialogdata_getenableprinter(wxPageSetupDialogData
* setup) {
+ return setup->GetEnablePrinter();
+}
+
+bool bmx_wxpagesetupdialogdata_getenablehelp(wxPageSetupDialogData *
setup) {
+ return setup->GetEnableHelp();
+}
+
+bool bmx_wxpagesetupdialogdata_getdefaultinfo(wxPageSetupDialogData *
setup) {
+ return setup->GetDefaultInfo();
+}
+
+void bmx_wxpagesetupdialogdata_getmargintopleft(wxPageSetupDialogData
* setup, int * leftMargin, int * topMargin) {
+ wxPoint p = setup->GetMarginTopLeft();
+ *leftMargin = p.x;
+ *topMargin = p.y;
+}
+
+void
bmx_wxpagesetupdialogdata_getmarginbottomright(wxPageSetupDialogData *
setup, int * rightMargin, int * bottomMargin) {
+ wxPoint p = setup->GetMarginBottomRight();
+ *rightMargin = p.x;
+ *bottomMargin = p.y;
+}
+
+void
bmx_wxpagesetupdialogdata_getminmargintopleft(wxPageSetupDialogData *
setup, int * leftMin, int * topMin) {
+ wxPoint p = setup->GetMinMarginTopLeft();
+ *leftMin = p.x;
+ *topMin = p.y;
+}
+
+void
bmx_wxpagesetupdialogdata_getminmarginbottomright(wxPageSetupDialogData
* setup, int * rightMin, int * bottomMin) {
+ wxPoint p = setup->GetMinMarginBottomRight();
+ *rightMin = p.x;
+ *bottomMin = p.y;
+}
+
+wxPaperSize bmx_wxpagesetupdialogdata_getpaperid(wxPageSetupDialogData
* setup) {
+ return setup->GetPaperId();
+}
+
+void bmx_wxpagesetupdialogdata_getpapersize(wxPageSetupDialogData *
setup, int * w, int * h) {
+ wxSize s = setup->GetPaperSize();
+ *w = s.x;
+ *h = s.y;
+}
+
+MaxPrintData *
bmx_wxpagesetupdialogdata_getprintdata(wxPageSetupDialogData * setup) {
+ return new MaxPrintData(setup->GetPrintData());
+}
+
+bool bmx_wxpagesetupdialogdata_isok(wxPageSetupDialogData * setup) {
+ return setup->IsOk();
+}
+
+void bmx_wxpagesetupdialogdata_setdefaultinfo(wxPageSetupDialogData *
setup, bool flag) {
+ setup->SetDefaultInfo(flag);
+}
+
+void
bmx_wxpagesetupdialogdata_setdefaultminmargins(wxPageSetupDialogData *
setup, bool flag) {
+ setup->SetDefaultMinMargins(flag);
+}
+
+void bmx_wxpagesetupdialogdata_setmargintopleft(wxPageSetupDialogData
* setup, int leftMargin, int topMargin) {
+ setup->SetMarginTopLeft(wxPoint(leftMargin, topMargin));
+}
+
+void
bmx_wxpagesetupdialogdata_setmarginbottomright(wxPageSetupDialogData *
setup, int rightMargin, int bottomMargin) {
+ setup->SetMarginBottomRight(wxPoint(rightMargin, bottomMargin));
+}
+
+void
bmx_wxpagesetupdialogdata_setminmargintopleft(wxPageSetupDialogData *
setup, int leftMin, int topMin) {
+ setup->SetMinMarginTopLeft(wxPoint(leftMin, topMin));
+}
+
+void
bmx_wxpagesetupdialogdata_setminmarginbottomright(wxPageSetupDialogData
* setup, int rightMin, int bottomMin) {
+ setup->SetMinMarginBottomRight(wxPoint(rightMin, bottomMin));
+}
+
+void bmx_wxpagesetupdialogdata_setpaperid(wxPageSetupDialogData *
setup, wxPaperSize id) {
+ setup->SetPaperId(id);
+}
+
+void bmx_wxpagesetupdialogdata_setpapersize(wxPageSetupDialogData *
setup, int w, int h) {
+ setup->SetPaperSize(wxSize(w, h));
+}
+
+void bmx_wxpagesetupdialogdata_setprintdata(wxPageSetupDialogData *
setup, MaxPrintData * data) {
+ setup->SetPrintData(data->Data());
+}


Modified: trunk/wx.mod/wxpagesetupdialogdata.mod/glue.h
==============================================================================
--- trunk/wx.mod/wxpagesetupdialogdata.mod/glue.h (original)
+++ trunk/wx.mod/wxpagesetupdialogdata.mod/glue.h Wed Dec 26 12:33:42 2007
@@ -20,16 +20,60 @@
THE SOFTWARE.
*/

+#ifndef _WX_MAX_PAGESETUPDIALOGDATA_H_
+#define _WX_MAX_PAGESETUPDIALOGDATA_H_
+
#include "wxglue.h"
+#include "../wxprintdata.mod/glue.h"

-//class MaxNotebook;
+class MaxPageSetupDialogData;

extern "C" {

#include <blitz.h>

+ wxPageSetupDialogData * bmx_wxpagesetupdialogdata_create(BBObject *
handle, MaxPrintData * data);
+
+ void bmx_wxpagesetupdialogdata_enablehelp(wxPageSetupDialogData *
setup, bool flag);
+ void bmx_wxpagesetupdialogdata_enablemargins(wxPageSetupDialogData *
setup, bool flag);
+ void
bmx_wxpagesetupdialogdata_enableorientation(wxPageSetupDialogData *
setup, bool flag);
+ void bmx_wxpagesetupdialogdata_enablepaper(wxPageSetupDialogData *
setup, bool flag);
+ void bmx_wxpagesetupdialogdata_enableprinter(wxPageSetupDialogData *
setup, bool flag);
+ bool
bmx_wxpagesetupdialogdata_getdefaultminmargins(wxPageSetupDialogData * setup);
+ bool bmx_wxpagesetupdialogdata_getenablemargins(wxPageSetupDialogData
* setup);
+ bool
bmx_wxpagesetupdialogdata_getenableorientation(wxPageSetupDialogData * setup);
+ bool bmx_wxpagesetupdialogdata_getenablepaper(wxPageSetupDialogData * setup);
+ bool bmx_wxpagesetupdialogdata_getenableprinter(wxPageSetupDialogData
* setup);
+ bool bmx_wxpagesetupdialogdata_getenablehelp(wxPageSetupDialogData * setup);
+ bool bmx_wxpagesetupdialogdata_getdefaultinfo(wxPageSetupDialogData * setup);
+ void bmx_wxpagesetupdialogdata_getmargintopleft(wxPageSetupDialogData
* setup, int * leftMargin, int * topMargin);
+ void
bmx_wxpagesetupdialogdata_getmarginbottomright(wxPageSetupDialogData *
setup, int * rightMargin, int * bottomMargin);
+ void
bmx_wxpagesetupdialogdata_getminmargintopleft(wxPageSetupDialogData *
setup, int * leftMin, int * topMin);
+ void
bmx_wxpagesetupdialogdata_getminmarginbottomright(wxPageSetupDialogData
* setup, int * rightMin, int * bottomMin);
+ wxPaperSize
bmx_wxpagesetupdialogdata_getpaperid(wxPageSetupDialogData * setup);
+ void bmx_wxpagesetupdialogdata_getpapersize(wxPageSetupDialogData *
setup, int * w, int * h);
+ MaxPrintData *
bmx_wxpagesetupdialogdata_getprintdata(wxPageSetupDialogData * setup);
+ bool bmx_wxpagesetupdialogdata_isok(wxPageSetupDialogData * setup);
+ void bmx_wxpagesetupdialogdata_setdefaultinfo(wxPageSetupDialogData *
setup, bool flag);
+ void
bmx_wxpagesetupdialogdata_setdefaultminmargins(wxPageSetupDialogData *
setup, bool flag);
+ void bmx_wxpagesetupdialogdata_setmargintopleft(wxPageSetupDialogData
* setup, int leftMargin, int topMargin);
+ void
bmx_wxpagesetupdialogdata_setmarginbottomright(wxPageSetupDialogData *
setup, int rightMargin, int bottomMargin);
+ void
bmx_wxpagesetupdialogdata_setminmargintopleft(wxPageSetupDialogData *
setup, int leftMin, int topMin);
+ void
bmx_wxpagesetupdialogdata_setminmarginbottomright(wxPageSetupDialogData
* setup, int rightMin, int bottomMin);
+ void bmx_wxpagesetupdialogdata_setpaperid(wxPageSetupDialogData *
setup, wxPaperSize id);
+ void bmx_wxpagesetupdialogdata_setpapersize(wxPageSetupDialogData *
setup, int w, int h);
+ void bmx_wxpagesetupdialogdata_setprintdata(wxPageSetupDialogData *
setup, MaxPrintData * data);

}

// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

+class MaxPageSetupDialogData : public wxPageSetupDialogData
+{
+public:
+ MaxPageSetupDialogData(BBObject * handle);
+ MaxPageSetupDialogData(BBObject * handle, wxPrintData & data);
+ ~ MaxPageSetupDialogData();
+};
+
+#endif // _WX_MAX_PAGESETUPDIALOGDATA_H_

Modified: trunk/wx.mod/wxpagesetupdialogdata.mod/wxpagesetupdialogdata.bmx
==============================================================================
--- trunk/wx.mod/wxpagesetupdialogdata.mod/wxpagesetupdialogdata.bmx (original)
+++ trunk/wx.mod/wxpagesetupdialogdata.mod/wxpagesetupdialogdata.bmx
Wed Dec 26 12:33:42 2007
@@ -57,91 +57,258 @@
End Rem
Type wxPageSetupDialogData Extends wxObject

+ Rem
+ bbdoc:
+ End Rem
+ Function
CreatePageSetupDialogData:wxPageSetupDialogData(printData:wxPrintData = Null)
+ Return New wxPageSetupDialogData.Create(printData)
+ End Function
+
+ Rem
+ bbdoc:
+ End Rem
+ Method Create:wxPageSetupDialogData(printData:wxPrintData = Null)
+ If printData Then
+ wxObjectPtr = bmx_wxpagesetupdialogdata_create(Self, printData.wxObjectptr)
+ Else
+ wxObjectPtr = bmx_wxpagesetupdialogdata_create(Self, Null)
+ End If
+ Return Self
+ End Method
+
+ ' soft linking
+ Function _create:wxPageSetupDialogData(wxObjectPtr:Byte Ptr)
+ If wxObjectPtr Then
+ Local this:wxPageSetupDialogData = New wxPageSetupDialogData
+ this.wxObjectPtr = wxObjectPtr
+ Return this
+ End If
+ End Function
+
+ Function _find:wxPageSetupDialogData(wxObjectPtr:Byte Ptr)
+ If wxObjectPtr Then
+ Local data:wxPageSetupDialogData = wxPageSetupDialogData(wxfind(wxObjectPtr))
+ If Not data Then
+ Return wxPageSetupDialogData._create(wxObjectPtr)
+ End If
+ Return data
+ End If
+ End Function
+
+ Rem
+ bbdoc: Enables or disables the 'Help' button (Windows only).
+ End Rem
Method EnableHelp(flag:Int)
+ bmx_wxpagesetupdialogdata_enablehelp(wxObjectPtr, flag)
End Method

+ Rem
+ bbdoc: Enables or disables the margin controls (Windows only).
+ End Rem
Method EnableMargins(flag:Int)
+ bmx_wxpagesetupdialogdata_enablemargins(wxObjectPtr, flag)
End Method

+ Rem
+ bbdoc: Enables or disables the orientation control (Windows only).
+ End Rem
Method EnableOrientation(flag:Int)
+ bmx_wxpagesetupdialogdata_enableorientation(wxObjectPtr, flag)
End Method

+ Rem
+ bbdoc: Enables or disables the paper size control (Windows only).
+ End Rem
Method EnablePaper(flag:Int)
+ bmx_wxpagesetupdialogdata_enablepaper(wxObjectPtr, flag)
End Method

+ Rem
+ bbdoc: Enables or disables the @Printer button, which invokes a
printer setup dialog.
+ End Rem
Method EnablePrinter(flag:Int)
+ bmx_wxpagesetupdialogdata_enableprinter(wxObjectPtr, flag)
End Method

+ Rem
+ bbdoc: Returns true if the page setup dialog will take its minimum
margin values from the currently selected printer properties (Windows only).
+ End Rem
Method GetDefaultMinMargins:Int()
+ Return bmx_wxpagesetupdialogdata_getdefaultminmargins(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Returns true if the margin controls are enabled (Windows only).
+ End Rem
Method GetEnableMargins:Int()
+ Return bmx_wxpagesetupdialogdata_getenablemargins(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Returns true if the orientation control is enabled (Windows only).
+ End Rem
Method GetEnableOrientation:Int()
+ Return bmx_wxpagesetupdialogdata_getenableorientation(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Returns true if the paper size control is enabled (Windows only).
+ End Rem
Method GetEnablePaper:Int()
+ Return bmx_wxpagesetupdialogdata_getenablepaper(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Returns true if the printer setup button is enabled.
+ End Rem
Method GetEnablePrinter:Int()
+ Return bmx_wxpagesetupdialogdata_getenableprinter(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Returns true if the printer setup button is enabled.
+ End Rem
Method GetEnableHelp:Int()
+ Return bmx_wxpagesetupdialogdata_getenablehelp(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Returns true if the dialog will simply return default printer
information (such as orientation) instead of showing a dialog (Windows only).
+ End Rem
Method GetDefaultInfo:Int()
+ Return bmx_wxpagesetupdialogdata_getdefaultinfo(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Returns the left and top margins in millimetres.
+ End Rem
Method GetMarginTopLeft(leftMargin:Int Var, topMargin:Int Var)
+ bmx_wxpagesetupdialogdata_getmargintopleft(wxObjectPtr, Varptr
leftMargin, Varptr topMargin)
End Method

+ Rem
+ bbdoc: Returns the right and bottom margins in millimetres.
+ End Rem
Method GetMarginBottomRight(rightMargin:Int Var, bottomMargin:Int Var)
+ bmx_wxpagesetupdialogdata_getmarginbottomright(wxObjectPtr, Varptr
rightMargin, Varptr bottomMargin)
End Method

+ Rem
+ bbdoc: Returns the left and top minimum margins the user can enter
(Windows only).
+ about: Units are in millimetres
+ End Rem
Method GetMinMarginTopLeft(leftMin:Int Var, topMin:Int Var)
+ bmx_wxpagesetupdialogdata_getminmargintopleft(wxObjectPtr, Varptr
leftMin, Varptr topMin)
End Method

+ Rem
+ bbdoc: Returns the right and bottom minimum margins the user can
enter (Windows only).
+ about: Units are in millimetres
+ End Rem
Method GetMinMarginBottomRight(rightMin:Int Var, bottomMin:Int Var)
+ bmx_wxpagesetupdialogdata_getminmarginbottomright(wxObjectPtr,
Varptr rightMin, Varptr bottomMin)
End Method

+ Rem
+ bbdoc: Returns the paper id (stored in the internal wxPrintData object).
+ End Rem
Method GetPaperId:Int()
+ Return bmx_wxpagesetupdialogdata_getpaperid(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Returns the paper size in millimetres.
+ End Rem
Method GetPaperSize(w:Int Var, h:Int Var)
+ bmx_wxpagesetupdialogdata_getpapersize(wxObjectPtr, Varptr w, Varptr h)
End Method

+ Rem
+ bbdoc: Returns a reference to the print data associated with this object.
+ End Rem
Method GetPrintData:wxPrintData()
+ Return wxPrintData._create(bmx_wxpagesetupdialogdata_getprintdata(wxObjectPtr))
End Method

+ Rem
+ bbdoc: Returns true if the print data associated with the dialog data
is valid.
+ about: This can return false on Windows if the current printer is not
set, for example. On all
+ other platforms, it returns true.
+ End Rem
Method IsOk:Int()
+ Return bmx_wxpagesetupdialogdata_isok(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Pass true if the dialog will simply return default printer
information (such as orientation) instead of showing a dialog (Windows only).
+ End Rem
Method SetDefaultInfo(flag:Int)
+ bmx_wxpagesetupdialogdata_setdefaultinfo(wxObjectPtr, flag)
End Method

+ Rem
+ bbdoc: Pass true if the page setup dialog will take its minimum
margin values from the currently selected printer properties (Windows only).
+ about: Units are in millimetres
+ End Rem
Method SetDefaultMinMargins(flag:Int)
+ bmx_wxpagesetupdialogdata_setdefaultminmargins(wxObjectPtr, flag)
End Method

+ Rem
+ bbdoc: Sets the left and top margins in millimetres.
+ End Rem
Method SetMarginTopLeft(leftMargin:Int, topMargin:Int)
+ bmx_wxpagesetupdialogdata_setmargintopleft(wxObjectPtr, leftMargin, topMargin)
End Method

+ Rem
+ bbdoc: Sets the right and bottom margins in millimetres.
+ End Rem
Method SetMarginBottomRight(rightMargin:Int, bottomMargin:Int)
+ bmx_wxpagesetupdialogdata_setmarginbottomright(wxObjectPtr,
rightMargin, bottomMargin)
End Method

+ Rem
+ bbdoc: Sets the left and top minimum margins the user can enter
(Windows only).
+ about: Units are in millimetres.
+ End Rem
Method SetMinMarginTopLeft(leftMin:Int, topMin:Int)
+ bmx_wxpagesetupdialogdata_setminmargintopleft(wxObjectPtr, leftMin, topMin)
End Method

+ Rem
+ bbdoc: Sets the right and bottom minimum margins the user can enter
(Windows only).
+ about: Units are in millimetres.
+ End Rem
Method SetMinMarginBottomRight(rightMin:Int, bottomMin:Int)
+ bmx_wxpagesetupdialogdata_setminmarginbottomright(wxObjectPtr,
rightMin, bottomMin)
End Method

+ Rem
+ bbdoc: Sets the paper size id.
+ about: For further information, see wxPrintData::SetPaperId.
+ <p>
+ Calling this method overrides the explicit paper dimensions passed in SetPaperSize.
+ </p>
+ End Rem
Method SetPaperId(id:Int)
+ bmx_wxpagesetupdialogdata_setpaperid(wxObjectPtr, id)
End Method

- Method SetPaperSize(w:Int, y:Int)
+ Rem
+ bbdoc: Sets the paper size in millimetres.
+ about: If a corresponding paper id is found, it will be set in the
internal wxPrintData object,
+ otherwise the paper size overrides the paper id.
+ End Rem
+ Method SetPaperSize(w:Int, h:Int)
+ bmx_wxpagesetupdialogdata_setpapersize(wxObjectPtr, w, h)
End Method

+ Rem
+ bbdoc: Sets the print data associated with this object.
+ End Rem
Method SetPrintData(printData:wxPrintData)
+ bmx_wxpagesetupdialogdata_setprintdata(wxObjectPtr, printData.wxObjectPtr)
End Method

End Type

Added: trunk/wx.mod/wxpreviewframe.mod/common.bmx
==============================================================================
--- (empty file)
+++ trunk/wx.mod/wxpreviewframe.mod/common.bmx Wed Dec 26 12:33:42 2007
@@ -0,0 +1,55 @@
+' Copyright (c) 2007 Bruce A Henderson
+'
+' Permission is hereby granted, free of charge, to any person
obtaining a copy
+' of this software and associated documentation files
(the "Software"), to deal
+' in the Software without restriction, including without limitation
the rights
+' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+' copies of the Software, and to permit persons to whom the Software is
+' furnished to do so, subject to the following conditions:
+'
+' The above copyright notice and this permission notice shall be
included in
+' all copies or substantial portions of the Software.
+'
+' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
+' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
+' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN
+' THE SOFTWARE.
+'
+SuperStrict
+
+Import wx.wx
+Import wx.wxFrame
+Import wx.wxPrintPreview
+Import BRL.Blitz
+
+
+' headers :-)
+?linux
+Import "../lib/linux/wx/include/gtk2-unicode-release-static/*.h"
+Import "../include/*.h"
+?win32
+Import "../lib/win32/mswu/*.h"
+Import "../include/*.h"
+?macosppc
+Import "../lib/macosppc/wx/include/mac-unicode-release-static/*.h"
+Import "../include/*.h"
+?macosx86
+Import "../lib/macosx86/wx/include/mac-unicode-release-static/*.h"
+Import "../include/*.h"
+?
+
+Import "glue.cpp"
+
+Extern
+
+ Function bmx_wxpreviewframe_create:Byte Ptr(handle:Object,
preview:Byte Ptr, parent:Byte Ptr, title:String, ..
+ x:Int, y:Int, w:Int, h:Int, style:Int)
+
+ Function bmx_wxpreviewframe_createcontrolbar(handle:Byte Ptr)
+ Function bmx_wxpreviewframe_createcanvas(handle:Byte Ptr)
+ Function bmx_wxpreviewframe_initialize(handle:Byte Ptr)
+
+End Extern

Added: trunk/wx.mod/wxpreviewframe.mod/glue.cpp
==============================================================================
--- (empty file)
+++ trunk/wx.mod/wxpreviewframe.mod/glue.cpp Wed Dec 26 12:33:42 2007
@@ -0,0 +1,75 @@
+/*
+ Copyright (c) 2007 Bruce A Henderson
+
+ Permission is hereby granted, free of charge, to any person
obtaining a copy
+ of this software and associated documentation files
(the "Software"), to deal
+ in the Software without restriction, including without limitation
the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN
+ THE SOFTWARE.
+*/
+
+#include "glue.h"
+
+// ---------------------------------------------------------------------------------------
+
+MaxPreviewFrame::MaxPreviewFrame(BBObject * handle, wxPrintPreview *
preview, wxWindow* parent, const wxString& title, int x,
+ int y, int w, int h, long style)
+ : maxHandle(handle), wxPreviewFrame(preview, parent, title,
wxPoint(x, y), wxSize(w,h), style)
+{
+ wxbind(this, handle);
+}
+
+MaxPreviewFrame::~ MaxPreviewFrame() {
+ wxunbind(this);
+}
+
+void MaxPreviewFrame::CreateControlBar() {
+ _wx_wxpreviewframe_wxPreviewFrame__CreateControlBar(maxHandle);
+}
+
+void MaxPreviewFrame::CreateCanvas() {
+ _wx_wxpreviewframe_wxPreviewFrame__CreateCanvas(maxHandle);
+}
+
+void MaxPreviewFrame::CreateControlBarX() {
+ wxPreviewFrame::CreateControlBar();
+}
+
+void MaxPreviewFrame::CreateCanvasX() {
+ wxPreviewFrame::CreateCanvas();
+}
+
+
+// *********************************************
+
+
+wxPreviewFrame * bmx_wxpreviewframe_create(BBObject * handle,
wxPrintPreview * preview, wxWindow * parent, BBString * title,
+ int x, int y, int w, int h, long style) {
+ return new MaxPreviewFrame(handle, preview, parent,
wxStringFromBBString(title), x, y, w, h, style);
+}
+
+void bmx_wxpreviewframe_createcontrolbar(MaxPreviewFrame * frame) {
+ frame->CreateControlBarX();
+}
+
+void bmx_wxpreviewframe_createcanvas(MaxPreviewFrame * frame) {
+ frame->CreateCanvasX();
+}
+
+void bmx_wxpreviewframe_initialize(wxPreviewFrame * frame) {
+ frame->Initialize();
+}
+
+

Added: trunk/wx.mod/wxpreviewframe.mod/glue.h
==============================================================================
--- (empty file)
+++ trunk/wx.mod/wxpreviewframe.mod/glue.h Wed Dec 26 12:33:42 2007
@@ -0,0 +1,60 @@
+/*
+ Copyright (c) 2007 Bruce A Henderson
+
+ Permission is hereby granted, free of charge, to any person
obtaining a copy
+ of this software and associated documentation files
(the "Software"), to deal
+ in the Software without restriction, including without limitation
the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN
+ THE SOFTWARE.
+*/
+
+#include "wxglue.h"
+#include "wx/print.h"
+
+class MaxPreviewFrame;
+
+extern "C" {
+
+#include <blitz.h>
+
+ void _wx_wxpreviewframe_wxPreviewFrame__CreateControlBar(BBObject * handle);
+ void _wx_wxpreviewframe_wxPreviewFrame__CreateCanvas(BBObject * handle);
+
+
+ wxPreviewFrame * bmx_wxpreviewframe_create(BBObject * handle,
wxPrintPreview * preview, wxWindow * parent, BBString * title,
+ int x, int y, int w, int h, long style);
+
+ void bmx_wxpreviewframe_createcontrolbar(MaxPreviewFrame * frame);
+ void bmx_wxpreviewframe_createcanvas(MaxPreviewFrame * frame);
+ void bmx_wxpreviewframe_initialize(wxPreviewFrame * frame);
+
+}
+
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+class MaxPreviewFrame : public wxPreviewFrame
+{
+public:
+ MaxPreviewFrame(BBObject * handle, wxPrintPreview * preview,
wxWindow* parent, const wxString& title, int x,
+ int y, int w, int h, long style);
+ ~ MaxPreviewFrame();
+ void CreateControlBar();
+ void CreateCanvas();
+ void CreateControlBarX();
+ void CreateCanvasX();
+
+private:
+ BBObject * maxHandle;
+};

Added: trunk/wx.mod/wxpreviewframe.mod/wxpreviewframe.bmx
==============================================================================
--- (empty file)
+++ trunk/wx.mod/wxpreviewframe.mod/wxpreviewframe.bmx Wed Dec 26
12:33:42 2007
@@ -0,0 +1,115 @@
+' Copyright (c) 2007 Bruce A Henderson
+'
+' Permission is hereby granted, free of charge, to any person
obtaining a copy
+' of this software and associated documentation files
(the "Software"), to deal
+' in the Software without restriction, including without limitation
the rights
+' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+' copies of the Software, and to permit persons to whom the Software is
+' furnished to do so, subject to the following conditions:
+'
+' The above copyright notice and this permission notice shall be
included in
+' all copies or substantial portions of the Software.
+'
+' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
+' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
+' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN
+' THE SOFTWARE.
+'
+SuperStrict
+
+Rem
+bbdoc: wxPreviewFrame
+End Rem
+Module wx.wxPreviewFrame
+
+ModuleInfo "Version: 1.00"
+ModuleInfo "License: MIT"
+ModuleInfo "Author: Bruce A Henderson"
+ModuleInfo "Copyright: (c) 2007 Bruce A Henderson"
+ModuleInfo "Modserver: BRL"
+
+?linux
+ModuleInfo "CC_OPTS: -D__WXGTK__"
+ModuleInfo "CC_OPTS: -D_FILE_OFFSET_BITS=64"
+ModuleInfo "CC_OPTS: -D_LARGE_FILES"
+ModuleInfo "CC_OPTS: -DWX_PRECOMP"
+?win32
+ModuleInfo "CC_OPTS: -DHAVE_W32API_H"
+ModuleInfo "CC_OPTS: -D__WXMSW__"
+ModuleInfo "CC_OPTS: -D_UNICODE"
+ModuleInfo "CC_OPTS: -DUNICODE"
+?macos
+ModuleInfo "CC_OPTS: -D__WXMAC__"
+ModuleInfo "CC_OPTS: -D_FILE_OFFSET_BITS=64"
+ModuleInfo "CC_OPTS: -D_LARGE_FILES"
+ModuleInfo "CC_OPTS: -DWX_PRECOMP"
+?
+
+Import "common.bmx"
+
+
+Rem
+bbdoc: This type provides the default method of managing the print
preview interface.
+about: Member methods may be overridden to replace functionality, or
the type may be used
+without derivation.
+End Rem
+Type wxPreviewFrame Extends wxFrame
+
+ Rem
+ bbdoc: Constructor.
+ about: Pass a print preview object plus other normal frame arguments.
The print preview
+ object will be destroyed by the frame when it closes.
+ End Rem
+ Function CreatePreviewFrame:wxPreviewFrame(preview:wxPrintPreview,
parent:wxWindow, title:String, ..
+ x:Int = -1, y:Int = -1, w:Int = -1, h:Int = -1, style:Int = wxDEFAULT_FRAME_STYLE)
+ Return New wxPreviewFrame.CreatePF(preview, parent, title, x, y, w,
h, style)
+ End Function
+
+ Rem
+ bbdoc: Constructor.
+ about: Pass a print preview object plus other normal frame arguments.
The print preview
+ object will be destroyed by the frame when it closes.
+ End Rem
+ Method CreatePF:wxPreviewFrame(preview:wxPrintPreview,
parent:wxWindow, title:String, ..
+ x:Int = -1, y:Int = -1, w:Int = -1, h:Int = -1, style:Int = wxDEFAULT_FRAME_STYLE)
+ wxObjectPtr = bmx_wxpreviewframe_create(Self, preview.wxObjectPtr,
parent.wxObjectPtr, title, x, y, w, h, style)
+ Return Self
+ End Method
+
+ Rem
+ bbdoc: Creates a wxPreviewControlBar.
+ about: Override this method to allow a user-defined preview control
bar object to be created.
+ End Rem
+ Method CreateControlBar()
+ bmx_wxpreviewframe_createcontrolbar(wxObjectPtr)
+ End Method
+
+ Function _CreateControlBar(frame:wxPreviewFrame)
+ frame.CreateControlBar()
+ End Function
+
+ Rem
+ bbdoc: Creates a wxPreviewCanvas.
+ about: Override this method to allow a user-defined preview canvas
object to be created.
+ End Rem
+ Method CreateCanvas()
+ bmx_wxpreviewframe_createcanvas(wxObjectPtr)
+ End Method
+
+ Function _CreateCanvas(frame:wxPreviewFrame)
+ frame.CreateCanvas()
+ End Function
+
+ Rem
+ bbdoc: Creates the preview canvas and control bar, and calls
wxWindow::MakeModal(True) to disable other top-level windows in the application.
+ about: This method should be called by the application prior to
showing the frame.
+ End Rem
+ Method Initialize()
+ bmx_wxpreviewframe_initialize(wxObjectPtr)
+ End Method
+
+End Type
+

Modified: trunk/wx.mod/wxprintdata.mod/common.bmx
==============================================================================
--- trunk/wx.mod/wxprintdata.mod/common.bmx (original)
+++ trunk/wx.mod/wxprintdata.mod/common.bmx Wed Dec 26 12:33:42 2007
@@ -43,4 +43,222 @@

Extern

+ Function bmx_wxprintdata_create:Byte Ptr()
+ Function bmx_wxprintdata_delete(handle:Byte Ptr)
+
+ Function bmx_wxprintdata_getcollate:Int(handle:Byte Ptr)
+ Function bmx_wxprintdata_getbin:Int(handle:Byte Ptr)
+ Function bmx_wxprintdata_getcolour:Int(handle:Byte Ptr)
+ Function bmx_wxprintdata_getduplex:Int(handle:Byte Ptr)
+ Function bmx_wxprintdata_getnocopies:Int(handle:Byte Ptr)
+ Function bmx_wxprintdata_getorientation:Int(handle:Byte Ptr)
+ Function bmx_wxprintdata_getpaperid:Int(handle:Byte Ptr)
+ Function bmx_wxprintdata_getprintername:String(handle:Byte Ptr)
+ Function bmx_wxprintdata_getquality:Int(handle:Byte Ptr)
+ Function bmx_wxprintdata_getisok:Int(handle:Byte Ptr)
+ Function bmx_wxprintdata_setbin(handle:Byte Ptr, flag:Int)
+ Function bmx_wxprintdata_setcollate(handle:Byte Ptr, flag:Int)
+ Function bmx_wxprintdata_setcolour(handle:Byte Ptr, flag:Int)
+ Function bmx_wxprintdata_setduplex(handle:Byte Ptr, mode:Int)
+ Function bmx_wxprintdata_setnocopies(handle:Byte Ptr, n:Int)
+ Function bmx_wxprintdata_setorientation(handle:Byte Ptr, orientation:Int)
+ Function bmx_wxprintdata_setpaperid(handle:Byte Ptr, paperId:Int)
+ Function bmx_wxprintdata_setprintername(handle:Byte Ptr, name:String)
+ Function bmx_wxprintdata_setquality(handle:Byte Ptr, quality:Int)
+
End Extern
+
+Rem
+bbdoc: Use specific dimensions
+end rem
+Const wxPAPER_NONE:Int = 0
+Rem
+bbdoc: Letter, 8 1/2 by 11 inches
+end rem
+Const wxPAPER_LETTER:Int = 1
+Rem
+bbdoc: Legal, 8 1/2 by 14 inches
+end rem
+Const wxPAPER_LEGAL:Int = 2
+Rem
+bbdoc: A4 Sheet, 210 by 297 millimeters
+end rem
+Const wxPAPER_A4:Int = 3
+Rem
+bbdoc: C Sheet, 17 by 22 inches
+end rem
+Const wxPAPER_CSHEET:Int = 4
+Rem
+bbdoc: D Sheet, 22 by 34 inches
+end rem
+Const wxPAPER_DSHEET:Int = 5
+Rem
+bbdoc: E Sheet, 34 by 44 inches
+end rem
+Const wxPAPER_ESHEET:Int = 6
+Rem
+bbdoc: Letter Small, 8 1/2 by 11 inches
+end rem
+Const wxPAPER_LETTERSMALL:Int = 7
+Rem
+bbdoc: Tabloid, 11 by 17 inches
+end rem
+Const wxPAPER_TABLOID:Int = 8
+Rem
+bbdoc: Ledger, 17 by 11 inches
+end rem
+Const wxPAPER_LEDGER:Int = 9
+Rem
+bbdoc: Statement, 5 1/2 by 8 1/2 inches
+end rem
+Const wxPAPER_STATEMENT:Int = 10
+Rem
+bbdoc: Executive, 7 1/4 by 10 1/2 inches
+end rem
+Const wxPAPER_EXECUTIVE:Int = 11
+Rem
+bbdoc: A3 sheet, 297 by 420 millimeters
+end rem
+Const wxPAPER_A3:Int = 12
+Rem
+bbdoc: A4 small sheet, 210 by 297 millimeters
+end rem
+Const wxPAPER_A4SMALL:Int = 13
+Rem
+bbdoc: A5 sheet, 148 by 210 millimeters
+end rem
+Const wxPAPER_A5:Int = 14
+Rem
+bbdoc: B4 sheet, 250 by 354 millimeters
+end rem
+Const wxPAPER_B4:Int = 15
+Rem
+bbdoc: B5 sheet, 182-by-257-millimeter paper
+end rem
+Const wxPAPER_B5:Int = 16
+Rem
+bbdoc: Folio, 8-1/2-by-13-inch paper
+end rem
+Const wxPAPER_FOLIO:Int = 17
+Rem
+bbdoc: Quarto, 215-by-275-millimeter paper
+end rem
+Const wxPAPER_QUARTO:Int = 18
+Rem
+bbdoc: 10-by-14-inch sheet
+end rem
+Const wxPAPER_10X14:Int = 19
+Rem
+bbdoc: 11-by-17-inch sheet
+end rem
+Const wxPAPER_11X17:Int = 20
+Rem
+bbdoc: Note, 8 1/2 by 11 inches
+end rem
+Const wxPAPER_NOTE:Int = 21
+Rem
+bbdoc: #9 Envelope, 3 7/8 by 8 7/8 inches
+end rem
+Const wxPAPER_ENV_9:Int = 22
+Rem
+bbdoc: #10 Envelope, 4 1/8 by 9 1/2 inches
+end rem
+Const wxPAPER_ENV_10:Int = 23
+Rem
+bbdoc: #11 Envelope, 4 1/2 by 10 3/8 inches
+end rem
+Const wxPAPER_ENV_11:Int = 24
+Rem
+bbdoc: #12 Envelope, 4 3/4 by 11 inches
+end rem
+Const wxPAPER_ENV_12:Int = 25
+Rem
+bbdoc: #14 Envelope, 5 by 11 1/2 inches
+end rem
+Const wxPAPER_ENV_14:Int = 26
+Rem
+bbdoc: DL Envelope, 110 by 220 millimeters
+end rem
+Const wxPAPER_ENV_DL:Int = 27
+Rem
+bbdoc: C5 Envelope, 162 by 229 millimeters
+end rem
+Const wxPAPER_ENV_C5:Int = 28
+Rem
+bbdoc: C3 Envelope, 324 by 458 millimeters
+end rem
+Const wxPAPER_ENV_C3:Int = 29
+Rem
+bbdoc: C4 Envelope, 229 by 324 millimeters
+end rem
+Const wxPAPER_ENV_C4:Int = 30
+Rem
+bbdoc: C6 Envelope, 114 by 162 millimeters
+end rem
+Const wxPAPER_ENV_C6:Int = 31
+Rem
+bbdoc: C65 Envelope, 114 by 229 millimeters
+end rem
+Const wxPAPER_ENV_C65:Int = 32
+Rem
+bbdoc: B4 Envelope, 250 by 353 millimeters
+end rem
+Const wxPAPER_ENV_B4:Int = 33
+Rem
+bbdoc: B5 Envelope, 176 by 250 millimeters
+end rem
+Const wxPAPER_ENV_B5:Int = 34
+Rem
+bbdoc: B6 Envelope, 176 by 125 millimeters
+end rem
+Const wxPAPER_ENV_B6:Int = 35
+Rem
+bbdoc: Italy Envelope, 110 by 230 millimeters
+end rem
+Const wxPAPER_ENV_ITALY:Int = 36
+Rem
+bbdoc: Monarch Envelope, 3 7/8 by 7 1/2 inches
+end rem
+Const wxPAPER_ENV_MONARCH:Int = 37
+Rem
+bbdoc: 6 3/4 Envelope, 3 5/8 by 6 1/2 inches
+end rem
+Const wxPAPER_ENV_PERSONAL:Int = 38
+Rem
+bbdoc: US Std Fanfold, 14 7/8 by 11 inches
+end rem
+Const wxPAPER_FANFOLD_US:Int = 39
+Rem
+bbdoc: German Std Fanfold, 8 1/2 by 12 inches
+end rem
+Const wxPAPER_FANFOLD_STD_GERMAN:Int = 40
+Rem
+bbdoc: German Legal Fanfold, 8 1/2 by 13 inches
+end rem
+Const wxPAPER_FANFOLD_LGL_GERMAN:Int = 41
+
+Const wxPRINTBIN_DEFAULT:Int = 0
+Const wxPRINTBIN_ONLYONE:Int = 1
+Const wxPRINTBIN_LOWER:Int = 2
+Const wxPRINTBIN_MIDDLE:Int = 3
+Const wxPRINTBIN_MANUAL:Int = 4
+Const wxPRINTBIN_ENVELOPE:Int = 5
+Const wxPRINTBIN_ENVMANUAL:Int = 6
+Const wxPRINTBIN_AUTO:Int = 7
+Const wxPRINTBIN_TRACTOR:Int = 8
+Const wxPRINTBIN_SMALLFMT:Int = 9
+Const wxPRINTBIN_LARGEFMT:Int = 10
+Const wxPRINTBIN_LARGECAPACITY:Int = 11
+Const wxPRINTBIN_CASSETTE:Int = 12
+Const wxPRINTBIN_FORMSOURCE:Int = 13
+Const wxPRINTBIN_USER:Int = 14
+
+Const wxDUPLEX_SIMPLEX:Int = 0
+Const wxDUPLEX_HORIZONTAL:Int = 1
+Const wxDUPLEX_VERTICAL:Int = 2
+
+Const wxPRINT_QUALITY_HIGH:Int = -1
+Const wxPRINT_QUALITY_MEDIUM:Int = -2
+Const wxPRINT_QUALITY_LOW:Int = -3
+Const wxPRINT_QUALITY_DRAFT:Int = -4
+

Modified: trunk/wx.mod/wxprintdata.mod/glue.cpp
==============================================================================
--- trunk/wx.mod/wxprintdata.mod/glue.cpp (original)
+++ trunk/wx.mod/wxprintdata.mod/glue.cpp Wed Dec 26 12:33:42 2007
@@ -24,8 +24,107 @@

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

+MaxPrintData::MaxPrintData(const wxPrintData & d)
+{
+ data = d;
+}
+
+MaxPrintData::MaxPrintData()
+{
+ data = wxPrintData();
+}
+
+
+wxPrintData & MaxPrintData::Data() {
+ return data;
+}


// *********************************************
+
+
+MaxPrintData * bmx_wxprintdata_create() {
+ return new MaxPrintData();
+}
+
+void bmx_wxprintdata_delete(MaxPrintData * data) {
+ delete data;
+}
+
+bool bmx_wxprintdata_getcollate(MaxPrintData * data) {
+ return data->Data().GetCollate();
+}
+
+wxPrintBin bmx_wxprintdata_getbin(MaxPrintData * data) {
+ return data->Data().GetBin();
+}
+
+bool bmx_wxprintdata_getcolour(MaxPrintData * data) {
+ return data->Data().GetColour();
+}
+
+wxDuplexMode bmx_wxprintdata_getduplex(MaxPrintData * data) {
+ return data->Data().GetDuplex();
+}
+
+int bmx_wxprintdata_getnocopies(MaxPrintData * data) {
+ return data->Data().GetNoCopies();
+}
+
+int bmx_wxprintdata_getorientation(MaxPrintData * data) {
+ return data->Data().GetOrientation();
+}
+
+wxPaperSize bmx_wxprintdata_getpaperid(MaxPrintData * data) {
+ return data->Data().GetPaperId();
+}
+
+BBString * bmx_wxprintdata_getprintername(MaxPrintData * data) {
+ return bbStringFromWxString(data->Data().GetPrinterName());
+}
+
+wxPrintQuality bmx_wxprintdata_getquality(MaxPrintData * data) {
+ return data->Data().GetQuality();
+}
+
+bool bmx_wxprintdata_getisok(MaxPrintData * data) {
+ return data->Data().IsOk();
+}
+
+void bmx_wxprintdata_setbin(MaxPrintData * data, wxPrintBin flag) {
+ data->Data().SetBin(flag);
+}
+
+void bmx_wxprintdata_setcollate(MaxPrintData * data, bool flag) {
+ data->Data().SetCollate(flag);
+}
+
+void bmx_wxprintdata_setcolour(MaxPrintData * data, bool flag) {
+ data->Data().SetColour(flag);
+}
+
+void bmx_wxprintdata_setduplex(MaxPrintData * data, wxDuplexMode mode) {
+ data->Data().SetDuplex(mode);
+}
+
+void bmx_wxprintdata_setnocopies(MaxPrintData * data, int n) {
+ data->Data().SetNoCopies(n);
+}
+
+void bmx_wxprintdata_setorientation(MaxPrintData * data, int
orientation) {
+ data->Data().SetOrientation(orientation);
+}
+
+void bmx_wxprintdata_setpaperid(MaxPrintData * data, wxPaperSize
paperId) {
+ data->Data().SetPaperId(paperId);
+}
+
+void bmx_wxprintdata_setprintername(MaxPrintData * data, BBString *
name) {
+ data->Data().SetPrinterName(wxStringFromBBString(name));
+}
+
+void bmx_wxprintdata_setquality(MaxPrintData * data, wxPrintQuality
quality) {
+ data->Data().SetQuality(quality);
+}

Modified: trunk/wx.mod/wxprintdata.mod/glue.h
==============================================================================
--- trunk/wx.mod/wxprintdata.mod/glue.h (original)
+++ trunk/wx.mod/wxprintdata.mod/glue.h Wed Dec 26 12:33:42 2007
@@ -20,16 +20,54 @@
THE SOFTWARE.
*/

+#ifndef _WX_MAX_PRINTDATA_H_
+#define _WX_MAX_PRINTDATA_H_
+
#include "wxglue.h"

-//class MaxNotebook;
+class MaxPrintData;

extern "C" {

#include <blitz.h>

+ MaxPrintData * bmx_wxprintdata_create();
+ void bmx_wxprintdata_delete(MaxPrintData * data);
+
+ bool bmx_wxprintdata_getcollate(MaxPrintData * data);
+ wxPrintBin bmx_wxprintdata_getbin(MaxPrintData * data);
+ bool bmx_wxprintdata_getcolour(MaxPrintData * data);
+ wxDuplexMode bmx_wxprintdata_getduplex(MaxPrintData * data);
+ int bmx_wxprintdata_getnocopies(MaxPrintData * data);
+ int bmx_wxprintdata_getorientation(MaxPrintData * data);
+ wxPaperSize bmx_wxprintdata_getpaperid(MaxPrintData * data);
+ BBString * bmx_wxprintdata_getprintername(MaxPrintData * data);
+ wxPrintQuality bmx_wxprintdata_getquality(MaxPrintData * data);
+ bool bmx_wxprintdata_getisok(MaxPrintData * data);
+ void bmx_wxprintdata_setbin(MaxPrintData * data, wxPrintBin flag);
+ void bmx_wxprintdata_setcollate(MaxPrintData * data, bool flag);
+ void bmx_wxprintdata_setcolour(MaxPrintData * data, bool flag);
+ void bmx_wxprintdata_setduplex(MaxPrintData * data, wxDuplexMode mode);
+ void bmx_wxprintdata_setnocopies(MaxPrintData * data, int n);
+ void bmx_wxprintdata_setorientation(MaxPrintData * data, int orientation);
+ void bmx_wxprintdata_setpaperid(MaxPrintData * data, wxPaperSize paperId);
+ void bmx_wxprintdata_setprintername(MaxPrintData * data, BBString * name);
+ void bmx_wxprintdata_setquality(MaxPrintData * data, wxPrintQuality quality);

}

// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

+class MaxPrintData
+{
+public:
+ MaxPrintData(const wxPrintData & d);
+ MaxPrintData();
+ wxPrintData & Data();
+
+private:
+ wxPrintData data;
+
+};
+
+#endif // _WX_MAX_PRINTDATA_H_

Modified: trunk/wx.mod/wxprintdata.mod/wxprintdata.bmx
==============================================================================
--- trunk/wx.mod/wxprintdata.mod/wxprintdata.bmx (original)
+++ trunk/wx.mod/wxprintdata.mod/wxprintdata.bmx Wed Dec 26 12:33:42 2007
@@ -58,62 +58,221 @@
End Rem
Type wxPrintData Extends wxObject

+ Function _create:wxPrintData(wxObjectPtr:Byte Ptr)
+ If wxObjectPtr Then
+ Local this:wxPrintData = New wxPrintData
+ this.wxObjectPtr = wxObjectPtr
+ Return this
+ End If
+ End Function
+
+ Rem
+ bbdoc: Creates a new wxPrintData object.
+ End Rem
+ Function CreatePrintData:wxPrintData()
+ Return New wxPrintData.Create()
+ End Function
+
+ Rem
+ bbdoc: Default Constructor.
+ End Rem
+ Method Create:wxPrintData()
+ wxObjectPtr = bmx_wxprintdata_create()
+ Return Self
+ End Method
+
+ Rem
+ bbdoc: Returns true if collation is on.
+ End Rem
Method GetCollate:Int()
+ Return bmx_wxprintdata_getcollate(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Returns the current bin (papersource).
+ about: By default, the system is left to select the bin
(wxPRINTBIN_DEFAULT is returned).
+ <p>
+ See SetBin() for the full list of bin values.
+ </p>
+ End Rem
Method GetBin:Int()
+ Return bmx_wxprintdata_getbin(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Returns true if colour printing is on.
+ End Rem
Method GetColour:Int()
+ Return bmx_wxprintdata_getcolour(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Returns the duplex mode.
+ about: One of @wxDUPLEX_SIMPLEX, @wxDUPLEX_HORIZONTAL, @wxDUPLEX_VERTICAL.
+ End Rem
Method GetDuplex:Int()
+ Return bmx_wxprintdata_getduplex(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Returns the number of copies requested by the user.
+ End Rem
Method GetNoCopies:Int()
+ Return bmx_wxprintdata_getnocopies(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Gets the orientation.
+ about: This can be @wxLANDSCAPE or @wxPORTRAIT.
+ End Rem
Method GetOrientation:Int()
+ Return bmx_wxprintdata_getorientation(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Returns the paper size id.
+ about: For more information, see wxPrintData::SetPaperId.
+ End Rem
Method GetPaperId:Int()
+ Return bmx_wxprintdata_getpaperid(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Returns the printer name.
+ about: If the printer name is the empty string, it indicates that the
default printer
+ should be used.
+ End Rem
Method GetPrinterName:String()
+ Return bmx_wxprintdata_getprintername(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Returns the current print quality.
+ about: This can be a positive integer, denoting the number of dots
per inch, or one of the
+ following identifiers:
+ <ul>
+ <li>wxPRINT_QUALITY_HIGH </li>
+ <li>wxPRINT_QUALITY_MEDIUM </li>
+ <li>wxPRINT_QUALITY_LOW </li>
+ <li>wxPRINT_QUALITY_DRAFT </li>
+ </ul>
+ On input you should pass one of these identifiers, but on return you
may get back a positive
+ integer indicating the current resolution setting.
+ End Rem
Method GetQuality:Int()
+ Return bmx_wxprintdata_getquality(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Returns true if the print data is valid for using in print dialogs.
+ about: This can return False on Windows if the current printer is not
set, for example. On
+ all other platforms, it returns True.
+ End Rem
Method IsOk:Int()
+ Return bmx_wxprintdata_getisok(wxObjectPtr)
End Method

+ Rem
+ bbdoc: Sets the current bin.
+ about: Possible values are:
+ <ul>
+ <li>wxPRINTBIN_DEFAULT</li>
+ <li>wxPRINTBIN_ONLYONE</li>
+ <li>wxPRINTBIN_LOWER</li>
+ <li>wxPRINTBIN_MIDDLE</li>
+ <li>wxPRINTBIN_MANUAL</li>
+ <li>wxPRINTBIN_ENVELOPE</li>
+ <li>wxPRINTBIN_ENVMANUAL</li>
+ <li>wxPRINTBIN_AUTO</li>
+ <li>wxPRINTBIN_TRACTOR</li>
+ <li>wxPRINTBIN_SMALLFMT</li>
+ <li>wxPRINTBIN_LARGEFMT</li>
+ <li>wxPRINTBIN_LARGECAPACITY</li>
+ <li>wxPRINTBIN_CASSETTE</li>
+ <li>wxPRINTBIN_FORMSOURCE</li>
+ <li>wxPRINTBIN_USER</li>
+ </ul>
+ End Rem
Method SetBin(flag:Int)
+ bmx_wxprintdata_setbin(wxObjectPtr, flag)
End Method

+ Rem
+ bbdoc: Sets collation to on or off.
+ End Rem
Method SetCollate(flag:Int)
+ bmx_wxprintdata_setcollate(wxObjectPtr, flag)
End Method

+ Rem
+ bbdoc: Sets colour printing on or off.
+ End Rem
Method SetColour(flag:Int)
+ bmx_wxprintdata_setcolour(wxObjectPtr, flag)
End Method

+ Rem
+ bbdoc: Sets the duplex mode.
+ about: One of @wxDUPLEX_SIMPLEX, @wxDUPLEX_HORIZONTAL, @wxDUPLEX_VERTICAL.
+ End Rem
Method SetDuplex(mode:Int)
+ bmx_wxprintdata_setduplex(wxObjectPtr, mode)
End Method

+ Rem
+ bbdoc: Sets the default number of copies to be printed out.
+ End Rem
Method SetNoCopies(n:Int)
+ bmx_wxprintdata_setnocopies(wxObjectPtr, n)
End Method

+ Rem
+ bbdoc: Sets the orientation.
+ about: This can be @wxLANDSCAPE or @wxPORTRAIT.
+ End Rem
Method SetOrientation(orientation:Int)
+ bmx_wxprintdata_setorientation(wxObjectPtr, orientation)
End Method

+ Rem
+ bbdoc: Sets the paper id.
+ about: This indicates the type of paper to be used.
+ End Rem
Method SetPaperId(paperId:Int)
+ bmx_wxprintdata_setpaperid(wxObjectPtr, paperId)
End Method

+ Rem
+ bbdoc: Sets the printer name.
+ about: This can be the empty string to indicate that the default
printer should be used.
+ End Rem
Method SetPrinterName(name:String)
+ bmx_wxprintdata_setprintername(wxObjectPtr, name)
End Method

+ Rem
+ bbdoc: Sets the desired print quality.
+ about: This can be a positive integer, denoting the number of dots
per inch, or one of the
+ following identifiers:
+ <ul>
+ <li>wxPRINT_QUALITY_HIGH</li>
+ <li>wxPRINT_QUALITY_MEDIUM</li>
+ <li>wxPRINT_QUALITY_LOW</li>
+ <li>wxPRINT_QUALITY_DRAFT</li>
+ </ul>
+ On input you should pass one of these identifiers, but on return you
may get back a positive
+ integer indicating the current resolution setting.
+ End Rem
Method SetQuality(quality:Int)
+ bmx_wxprintdata_setquality(wxObjectPtr, quality)
End Method

+ Method Delete()
+ If wxObjectPtr Then
+ bmx_wxprintdata_delete(wxObjectPtr)
+ wxObjectPtr = Null
+ End If
+ End Method
+
End Type


Modified: trunk/wx.mod/wxprintdialog.mod/common.bmx
==============================================================================
--- trunk/wx.mod/wxprintdialog.mod/common.bmx (original)
+++ trunk/wx.mod/wxprintdialog.mod/common.bmx Wed Dec 26 12:33:42 2007
@@ -46,4 +46,36 @@

Extern

+ Function bmx_wxprintdialog_getprintdialogdata:Byte Ptr(handle:Byte Ptr)
+ Function bmx_wxprintdialog_getprintdc:Byte Ptr(handle:Byte Ptr)
+ Function bmx_wxprintdialog_showmodal:Int(handle:Byte Ptr)
+
+ Function bmx_wxprintdialogdata_create:Byte Ptr(printData:Byte Ptr)
+ Function bmx_wxprintdialogdata_delete(handle:Byte Ptr)
+
+ Function bmx_wxprintdialogdata_enablehelp(handle:Byte Ptr, flag:Int)
+ Function bmx_wxprintdialogdata_enablepagenumbers(handle:Byte Ptr, flag:Int)
+ Function bmx_wxprintdialogdata_enableprinttofile(handle:Byte Ptr, flag:Int)
+ Function bmx_wxprintdialogdata_enableselection(handle:Byte Ptr, flag:Int)
+ Function bmx_wxprintdialogdata_getallpages:Int(handle:Byte Ptr)
+ Function bmx_wxprintdialogdata_getcollate:Int(handle:Byte Ptr)
+ Function bmx_wxprintdialogdata_getfrompage:Int(handle:Byte Ptr)
+ Function bmx_wxprintdialogdata_getmaxpage:Int(handle:Byte Ptr)
+ Function bmx_wxprintdialogdata_getminpage:Int(handle:Byte Ptr)
+ Function bmx_wxprintdialogdata_getnocopies:Int(handle:Byte Ptr)
+ Function bmx_wxprintdialogdata_getprintdata:Byte Ptr(handle:Byte Ptr)
+ Function bmx_wxprintdialogdata_getprinttofile:Int(handle:Byte Ptr)
+ Function bmx_wxprintdialogdata_getselection:Int(handle:Byte Ptr)
+ Function bmx_wxprintdialogdata_gettopage:Int(handle:Byte Ptr)
+ Function bmx_wxprintdialogdata_isok:Int(handle:Byte Ptr)
+ Function bmx_wxprintdialogdata_setcollate(handle:Byte Ptr, flag:Int)
+ Function bmx_wxprintdialogdata_setfrompage(handle:Byte Ptr, page:Int)
+ Function bmx_wxprintdialogdata_setmaxpage(handle:Byte Ptr, page:Int)
+ Function bmx_wxprintdialogdata_setminpage(handle:Byte Ptr, page:Int)
+ Function bmx_wxprintdialogdata_setnocopies(handle:Byte Ptr, count:Int)
+ Function bmx_wxprintdialogdata_setprintdata(handle:Byte Ptr,
printdata:Byte Ptr)
+ Function bmx_wxprintdialogdata_setprinttofile(handle:Byte Ptr, flag:Int)
+ Function bmx_wxprintdialogdata_setselection(handle:Byte Ptr, flag:Int)
+ Function bmx_wxprintdialogdata_settopage(handle:Byte Ptr, page:Int)
+
End Extern

Modified: trunk/wx.mod/wxprintdialog.mod/glue.cpp
==============================================================================
--- trunk/wx.mod/wxprintdialog.mod/glue.cpp (original)
+++ trunk/wx.mod/wxprintdialog.mod/glue.cpp Wed Dec 26 12:33:42 2007
@@ -24,8 +24,143 @@

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

+MaxPrintDialogData::MaxPrintDialogData(const wxPrintDialogData & d)
+{
+ data = d;
+}

+MaxPrintDialogData::MaxPrintDialogData()
+{
+ data = wxPrintDialogData();
+}
+
+wxPrintDialogData & MaxPrintDialogData::Data() {
+ return data;
+}
+
+// *********************************************
+
+MaxPrintDialogData *
bmx_wxprintdialog_getprintdialogdata(wxPrintDialog * dialog) {
+ return new MaxPrintDialogData(dialog->GetPrintDialogData());
+}
+
+MaxDC * bmx_wxprintdialog_getprintdc(wxPrintDialog * dialog) {
+ return new MaxDC(dialog->GetPrintDC());
+}
+
+int bmx_wxprintdialog_showmodal(wxPrintDialog * dialog) {
+ return dialog->ShowModal();
+}

// *********************************************
+
+MaxPrintDialogData * bmx_wxprintdialogdata_create(MaxPrintData * data) {
+ if (data) {
+ wxPrintDialogData d(data->Data());
+ return new MaxPrintDialogData(d);
+ } else {
+ return new MaxPrintDialogData();
+ }
+}
+
+void bmx_wxprintdialogdata_delete(MaxPrintDialogData * data) {
+ delete data;
+}
+
+void bmx_wxprintdialogdata_enablehelp(MaxPrintDialogData * data, bool
flag) {
+ data->Data().EnableHelp(flag);
+}
+
+void bmx_wxprintdialogdata_enablepagenumbers(MaxPrintDialogData *
data, bool flag) {
+ data->Data().EnablePageNumbers(flag);
+}
+
+void bmx_wxprintdialogdata_enableprinttofile(MaxPrintDialogData *
data, bool flag) {
+ data->Data().EnablePrintToFile(flag);
+}
+
+void bmx_wxprintdialogdata_enableselection(MaxPrintDialogData * data,
bool flag) {
+ data->Data().EnableSelection(flag);
+}
+
+bool bmx_wxprintdialogdata_getallpages(MaxPrintDialogData * data) {
+ return data->Data().GetAllPages();
+}
+
+bool bmx_wxprintdialogdata_getcollate(MaxPrintDialogData * data) {
+ return data->Data().GetCollate();
+}
+
+int bmx_wxprintdialogdata_getfrompage(MaxPrintDialogData * data) {
+ return data->Data().GetFromPage();
+}
+
+int bmx_wxprintdialogdata_getmaxpage(MaxPrintDialogData * data) {
+ return data->Data().GetMaxPage();
+}
+
+int bmx_wxprintdialogdata_getminpage(MaxPrintDialogData * data) {
+ return data->Data().GetMinPage();
+}
+
+int bmx_wxprintdialogdata_getnocopies(MaxPrintDialogData * data) {
+ return data->Data().GetNoCopies();
+}
+
+MaxPrintData * bmx_wxprintdialogdata_getprintdata(MaxPrintDialogData *
data) {
+ return new MaxPrintData(data->Data().GetPrintData());
+}
+
+bool bmx_wxprintdialogdata_getprinttofile(MaxPrintDialogData * data) {
+ return data->Data().GetPrintToFile();
+}
+
+bool bmx_wxprintdialogdata_getselection(MaxPrintDialogData * data) {
+ return data->Data().GetSelection();
+}
+
+int bmx_wxprintdialogdata_gettopage(MaxPrintDialogData * data) {
+ return data->Data().GetToPage();
+}
+
+bool bmx_wxprintdialogdata_isok(MaxPrintDialogData * data) {
+ return data->Data().IsOk();
+}
+
+void bmx_wxprintdialogdata_setcollate(MaxPrintDialogData * data, bool
flag) {
+ data->Data().SetCollate(flag);
+}
+
+void bmx_wxprintdialogdata_setfrompage(MaxPrintDialogData * data, int
page) {
+ data->Data().SetFromPage(page);
+}
+
+void bmx_wxprintdialogdata_setmaxpage(MaxPrintDialogData * data, int
page) {
+ data->Data().SetMaxPage(page);
+}
+
+void bmx_wxprintdialogdata_setminpage(MaxPrintDialogData * data, int
page) {
+ data->Data().SetMinPage(page);
+}
+
+void bmx_wxprintdialogdata_setnocopies(MaxPrintDialogData * data, int
count) {
+ data->Data().SetNoCopies(count);
+}
+
+void bmx_wxprintdialogdata_setprintdata(MaxPrintDialogData * data,
MaxPrintData * printdata) {
+ data->Data().SetPrintData(printdata->Data());
+}
+
+void bmx_wxprintdialogdata_setprinttofile(MaxPrintDialogData * data,
bool flag) {
+ data->Data().SetPrintToFile(flag);
+}
+
+void bmx_wxprintdialogdata_setselection(MaxPrintDialogData * data,
bool flag) {
+ data->Data().SetSelection(flag);
+}
+
+void bmx_wxprintdialogdata_settopage(MaxPrintDialogData * data, int
page) {
+ data->Data().SetToPage(page);
+}

Modified: trunk/wx.mod/wxprintdialog.mod/glue.h
==============================================================================
--- trunk/wx.mod/wxprintdialog.mod/glue.h (original)
+++ trunk/wx.mod/wxprintdialog.mod/glue.h Wed Dec 26 12:33:42 2007
@@ -21,15 +21,68 @@
*/

#include "wxglue.h"
+#include "wx/printdlg.h"
+#include "../wxprintdata.mod/glue.h"

-//class MaxNotebook;
+class MaxPrintDialogData;
+class MaxPrintDialog;

extern "C" {

#include <blitz.h>

+ MaxPrintDialogData *
bmx_wxprintdialog_getprintdialogdata(wxPrintDialog * dialog);
+ MaxDC * bmx_wxprintdialog_getprintdc(wxPrintDialog * dialog);
+ int bmx_wxprintdialog_showmodal(wxPrintDialog * dialog);
+
+ MaxPrintDialogData * bmx_wxprintdialogdata_create(MaxPrintData * data);
+ void bmx_wxprintdialogdata_delete(MaxPrintDialogData * data);
+
+ void bmx_wxprintdialogdata_enablehelp(MaxPrintDialogData * data, bool flag);
+ void bmx_wxprintdialogdata_enablepagenumbers(MaxPrintDialogData *
data, bool flag);
+ void bmx_wxprintdialogdata_enableprinttofile(MaxPrintDialogData *
data, bool flag);
+ void bmx_wxprintdialogdata_enableselection(MaxPrintDialogData * data,
bool flag);
+ bool bmx_wxprintdialogdata_getallpages(MaxPrintDialogData * data);
+ bool bmx_wxprintdialogdata_getcollate(MaxPrintDialogData * data);
+ int bmx_wxprintdialogdata_getfrompage(MaxPrintDialogData * data);
+ int bmx_wxprintdialogdata_getmaxpage(MaxPrintDialogData * data);
+ int bmx_wxprintdialogdata_getminpage(MaxPrintDialogData * data);
+ int bmx_wxprintdialogdata_getnocopies(MaxPrintDialogData * data);
+ MaxPrintData * bmx_wxprintdialogdata_getprintdata(MaxPrintDialogData
* data);
+ bool bmx_wxprintdialogdata_getprinttofile(MaxPrintDialogData * data);
+ bool bmx_wxprintdialogdata_getselection(MaxPrintDialogData * data);
+ int bmx_wxprintdialogdata_gettopage(MaxPrintDialogData * data);
+ bool bmx_wxprintdialogdata_isok(MaxPrintDialogData * data);
+ void bmx_wxprintdialogdata_setcollate(MaxPrintDialogData * data, bool flag);
+ void bmx_wxprintdialogdata_setfrompage(MaxPrintDialogData * data, int page);
+ void bmx_wxprintdialogdata_setmaxpage(MaxPrintDialogData * data, int page);
+ void bmx_wxprintdialogdata_setminpage(MaxPrintDialogData * data, int page);
+ void bmx_wxprintdialogdata_setnocopies(MaxPrintDialogData * data, int count);
+ void bmx_wxprintdialogdata_setprintdata(MaxPrintDialogData * data,
MaxPrintData * printdata);
+ void bmx_wxprintdialogdata_setprinttofile(MaxPrintDialogData * data,
bool flag);
+ void bmx_wxprintdialogdata_setselection(MaxPrintDialogData * data,
bool flag);
+ void bmx_wxprintdialogdata_settopage(MaxPrintDialogData * data, int page);

}

// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

+class MaxPrintDialog : public wxPrintDialog
+{
+public:
+ MaxPrintDialog(BBObject * handle, wxWindow * parent,
wxPrintDialogData* data);
+ ~ MaxPrintDialog();
+};
+
+
+class MaxPrintDialogData
+{
+public:
+ MaxPrintDialogData(const wxPrintDialogData & d);
+ MaxPrintDialogData();
+ wxPrintDialogData & Data();
+
+private:
+ wxPrintDialogData data;
+
+};

Modified: trunk/wx.mod/wxprintdialog.mod/wxprintdialog.bmx
==============================================================================
--- trunk/wx.mod/wxprintdialog.mod/wxprintdialog.bmx (original)
+++ trunk/wx.mod/wxprintdialog.mod/wxprintdialog.bmx Wed Dec 26
12:33:42 2007
@@ -58,17 +58,31 @@
Type wxPrintDialog Extends wxDialog

Rem
+ bbdoc:
+ End Rem
+ Function CreatePrintDialog:wxPrintDialog()
+ End Function
+
+ Rem
+ bbdoc:
+ End Rem
+ Method Create:wxPrintDialog()
+ End Method
+
+ Rem
bbdoc: Returns the print dialog data associated with the print dialog.
End Rem
Method GetPrintDialogData:wxPrintDialogData()
+ Return wxPrintDialogData._create(bmx_wxprintdialog_getprintdialogdata(wxObjectPtr))
End Method

Rem
bbdoc: Returns the device context created by the print dialog, if any.
about: When this method has been called, the ownership of the device
context is transferred to the application,
- so it must then be deleted explicitly.
+ so it must then be deleted explicitly using wxDC.Free().
End Rem
Method GetPrintDC:wxDC()
+ Return wxDC._create(bmx_wxprintdialog_getprintdc(wxObjectPtr))
End Method

Rem
@@ -76,6 +90,7 @@
about: After this method is called, a device context may be
retrievable using wxPrintDialog::GetPrintDC.
End Rem
Method ShowModal:Int()
+ Return bmx_wxprintdialog_showmodal(wxObjectPtr)
End Method

End Type
@@ -87,87 +102,128 @@
Type wxPrintDialogData Extends wxObject

Rem
+ bbdoc: Constructs a wxPrintDialogData object with an optional print
data object.
+ End Rem
+ Function
CreatePrintDialogData:wxPrintDialogData(printData:wxPrintData = Null)
+ Return New wxPrintDialogData.Create(printData)
+ End Function
+
+ Rem
+ bbdoc: Constructs a wxPrintDialogData object with an optional print
data object.
+ End Rem
+ Method Create:wxPrintDialogData(printData:wxPrintData = Null)
+ If printData Then
+ wxObjectPtr = bmx_wxprintdialogdata_create(printData.wxObjectPtr)
+ Else
+ wxObjectPtr = bmx_wxprintdialogdata_create(Null)
+ End If
+ Return Self
+ End Method
+
+ Function _create:wxPrintDialogData(wxObjectPtr:Byte Ptr)
+ If wxObjectPtr Then
+ Local this:wxPrintDialogData = New wxPrintDialogData
+ this.wxObjectPtr = wxObjectPtr
+ Return this
+ End If
+ End Function
+
+ Rem
bbdoc: Enables or disables the 'Help' button.
End Rem
Method EnableHelp(flag:Int)
+ bmx_wxprintdialogdata_enablehelp(wxObjectPtr, flag)
End Method

Rem
bbdoc: Enables or disables the 'Page numbers' controls.
End Rem
Method EnablePageNumbers(flag:Int)
+ bmx_wxprintdialogdata_enablepagenumbers(wxObjectPtr, flag)
End Method

Rem
bbdoc: Enables or disables the 'Print to file' checkbox.
End Rem
Method EnablePrintToFile(flag:Int)
+ bmx_wxprintdialogdata_enableprinttofile(wxObjectPtr, flag)
End Method

Rem
bbdoc: Enables or disables the 'Selection' radio button.
End Rem
Method EnableSelection(flag:Int)
+ bmx_wxprintdialogdata_enableselection(wxObjectPtr, flag)
End Method

Rem
bbdoc: Returns true if the user requested that all pages be printed.
End Rem
Method GetAllPages:Int()
+ Return bmx_wxprintdialogdata_getallpages(wxObjectPtr)
End Method

Rem
bbdoc: Returns true if the user requested that the document(s) be collated.
End Rem
Method GetCollate:Int()
+ Return bmx_wxprintdialogdata_getcollate(wxObjectPtr)
End Method

Rem
bbdoc: Returns the from page number, as entered by the user.
End Rem
Method GetFromPage:Int()
+ Return bmx_wxprintdialogdata_getfrompage(wxObjectPtr)
End Method

Rem
bbdoc: Returns the maximum page number.
End Rem
Method GetMaxPage:Int()
+ Return bmx_wxprintdialogdata_getmaxpage(wxObjectPtr)
End Method

Rem
bbdoc: Returns the minimum page number.
End Rem
Method GetMinPage:Int()
+ Return bmx_wxprintdialogdata_getminpage(wxObjectPtr)
End Method

Rem
bbdoc: Returns the number of copies requested by the user.
End Rem
Method GetNoCopies:Int()
+ Return bmx_wxprintdialogdata_getnocopies(wxObjectPtr)
End Method

Rem
bbdoc: Returns a reference to the internal wxPrintData object.
End Rem
Method GetPrintData:wxPrintData()
+ Return wxPrintData._create(bmx_wxprintdialogdata_getprintdata(wxObjectPtr))
End Method

Rem
bbdoc: Returns true if the user has selected printing to a file.
End Rem
Method GetPrintToFile:Int()
+ Return bmx_wxprintdialogdata_getprinttofile(wxObjectPtr)
End Method

Rem
bbdoc: Returns true if the user requested that the selection be
printed (where 'selection' is a concept specific to the application).
End Rem
Method GetSelection:Int()
+ Return bmx_wxprintdialogdata_getselection(wxObjectPtr)
End Method

Rem
bbdoc: Returns the to page number, as entered by the user.
End Rem
Method GetToPage:Int()
+ Return bmx_wxprintdialogdata_gettopage(wxObjectPtr)
End Method

Rem
@@ -176,48 +232,56 @@
platforms, it returns true.
End Rem
Method IsOk:Int()
+ Return bmx_wxprintdialogdata_isok(wxObjectPtr)
End Method

Rem
bbdoc: Sets the 'Collate' checkbox to true or false.
End Rem
Method SetCollate(flag:Int)
+ bmx_wxprintdialogdata_setcollate(wxObjectPtr, flag)
End Method

Rem
bbdoc: Sets the from page number.
End Rem
Method SetFromPage(page:Int)
+ bmx_wxprintdialogdata_setfrompage(wxObjectPtr, page)
End Method

Rem
bbdoc: Sets the maximum page number.
End Rem
Method SetMaxPage(page:Int)
+ bmx_wxprintdialogdata_setmaxpage(wxObjectPtr, page)
End Method

Rem
bbdoc: Sets the minimum page number.
End Rem
Method SetMinPage(page:Int)
+ bmx_wxprintdialogdata_setminpage(wxObjectPtr, page)
End Method

Rem
bbdoc: Sets the default number of copies the user has requested to be
printed out.
End Rem
Method SetNoCopies(count:Int)
+ bmx_wxprintdialogdata_setnocopies(wxObjectPtr, count)
End Method

Rem
bbdoc: Sets the internal wxPrintData.
End Rem
Method SetPrintData(printData:wxPrintData)
+ bmx_wxprintdialogdata_setprintdata(wxObjectPtr, printdata.wxObjectPtr)
End Method

Rem
bbdoc: Sets the 'Print to file' checkbox to true or false.
End Rem
Method SetPrintToFile(flag:Int)
+ bmx_wxprintdialogdata_setprinttofile(wxObjectPtr, flag)
End Method

Rem
@@ -225,12 +289,21 @@
about: The effect of printing the selection depends on how the
application implements this command, if at all.
End Rem
Method SetSelection(flag:Int)
+ bmx_wxprintdialogdata_setselection(wxObjectPtr, flag)
End Method

Rem
bbdoc: Sets the to page number.
End Rem
Method SetToPage(page:Int)
+ bmx_wxprintdialogdata_settopage(wxObjectPtr, page)
+ End Method
+
+ Method Delete()
+ If wxObjectPtr Then
+ bmx_wxprintdialogdata_delete(wxObjectPtr)
+ wxObjectPtr = Null
+ End If
End Method

End Type

Modified: trunk/wx.mod/wxprinter.mod/common.bmx
==============================================================================
--- trunk/wx.mod/wxprinter.mod/common.bmx (original)
+++ trunk/wx.mod/wxprinter.mod/common.bmx Wed Dec 26 12:33:42 2007
@@ -47,4 +47,20 @@

Extern

+ Function bmx_wxprinter_create:Byte Ptr(data:Byte Ptr)
+ Function bmx_wxprinter_delete(handle:Byte Ptr)
+
+ Function bmx_wxprinter_createabortwindow(handle:Byte Ptr, parent:Byte
Ptr, printout:Byte Ptr)
+ Function bmx_wxprinter_getabort:Int(handle:Byte Ptr)
+ Function bmx_wxprinter_getlasterror:Int()
+ Function bmx_wxprinter_print:Int(handle:Byte Ptr, parent:Byte Ptr,
printout:Byte Ptr, prompt:Int)
+ Function bmx_wxprinter_getprintdialogdata:Byte Ptr(handle:Byte Ptr)
+
+ Function bmx_wxprinter_printdialog:Byte Ptr(handle:Byte Ptr,
parent:Byte Ptr)
+ Function bmx_wxprinter_setup(handle:Byte Ptr, parent:Byte Ptr)
+
End Extern
+
+Const wxPRINTER_NO_ERROR:Int = 0
+Const wxPRINTER_CANCELLED:Int = 1
+Const wxPRINTER_ERROR:Int = 2

Modified: trunk/wx.mod/wxprinter.mod/glue.cpp
==============================================================================
--- trunk/wx.mod/wxprinter.mod/glue.cpp (original)
+++ trunk/wx.mod/wxprinter.mod/glue.cpp Wed Dec 26 12:33:42 2007
@@ -25,7 +25,45 @@
// ---------------------------------------------------------------------------------------


-
// *********************************************

+wxPrinter * bmx_wxprinter_create(MaxPrintDialogData * data) {
+ if (data) {
+ return new wxPrinter(&data->Data());
+ } else {
+ return new wxPrinter();
+ }
+}
+
+void bmx_wxprinter_delete(wxPrinter * printer) {
+ delete printer;
+}
+
+void bmx_wxprinter_createabortwindow(wxPrinter * printer, wxWindow *
parent, wxPrintout * printout) {
+ printer->CreateAbortWindow(parent, printout);
+}
+
+bool bmx_wxprinter_getabort(wxPrinter * printer) {
+ return printer->GetAbort();
+}
+
+wxPrinterError bmx_wxprinter_getlasterror() {
+ return wxPrinter::GetLastError();
+}
+
+bool bmx_wxprinter_print(wxPrinter * printer, wxWindow * parent,
wxPrintout * printout, bool prompt) {
+ return printer->Print(parent, printout, prompt);
+}
+
+MaxPrintDialogData * bmx_wxprinter_getprintdialogdata(wxPrinter *
printer) {
+ return new MaxPrintDialogData(printer->GetPrintDialogData());
+}
+
+MaxDC * bmx_wxprinter_printdialog(wxPrinter * printer, wxWindow *
parent) {
+ return new MaxDC(printer->PrintDialog(parent));
+}
+
+void bmx_wxprinter_setup(wxPrinter * printer, wxWindow * parent) {
+ printer->Setup(parent);
+}


Modified: trunk/wx.mod/wxprinter.mod/glue.h
==============================================================================
--- trunk/wx.mod/wxprinter.mod/glue.h (original)
+++ trunk/wx.mod/wxprinter.mod/glue.h Wed Dec 26 12:33:42 2007
@@ -20,16 +20,36 @@
THE SOFTWARE.
*/

+#ifndef _WX_MAX_PRINTDIALOGDATA_H_
+#define _WX_MAX_PRINTDIALOGDATA_H_
+
#include "wxglue.h"
+#include "../wxprintdialog.mod/glue.h"
+
+#include "wx/print.h"

-//class MaxNotebook;
+//class MaxPrinter;

extern "C" {

#include <blitz.h>

+ wxPrinter * bmx_wxprinter_create(MaxPrintDialogData * data);
+ void bmx_wxprinter_delete(wxPrinter * printer);
+
+ void bmx_wxprinter_createabortwindow(wxPrinter * printer, wxWindow *
parent, wxPrintout * printout);
+ bool bmx_wxprinter_getabort(wxPrinter * printer);
+ wxPrinterError bmx_wxprinter_getlasterror();
+ bool bmx_wxprinter_print(wxPrinter * printer, wxWindow * parent,
wxPrintout * printout, bool prompt);
+ MaxPrintDialogData * bmx_wxprinter_getprintdialogdata(wxPrinter * printer);
+
+ MaxDC * bmx_wxprinter_printdialog(wxPrinter * printer, wxWindow * parent);
+ void bmx_wxprinter_setup(wxPrinter * printer, wxWindow * parent);

}

// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

+
+
+#endif // _WX_MAX_PRINTDIALOGDATA_H_

Modified: trunk/wx.mod/wxprinter.mod/wxprinter.bmx
==============================================================================
--- trunk/wx.mod/wxprinter.mod/wxprinter.bmx (original)
+++ trunk/wx.mod/wxprinter.mod/wxprinter.bmx Wed Dec 26 12:33:42 2007
@@ -58,15 +58,40 @@
Type wxPrinter Extends wxObject

Rem
+ bbdoc: Constructor.
+ about: Pass an optional block of print dialog data, which will be
copied to
+ the printer object's local data.
+ End Rem
+ Function CreatePrinter:wxPrinter(data:wxPrintDialogData = Null)
+ Return New wxPrinter.Create(data)
+ End Function
+
+ Rem
+ bbdoc: Constructor.
+ about: Pass an optional block of print dialog data, which will be
copied to
+ the printer object's local data.
+ End Rem
+ Method Create:wxPrinter(data:wxPrintDialogData = Null)
+ If data Then
+ wxObjectPtr = bmx_wxprinter_create(data.wxObjectPtr)
+ Else
+ wxObjectPtr = bmx_wxprinter_create(Null)
+ End If
+ Return Self
+ End Method
+
+ Rem
bbdoc: Creates the default printing abort window, with a cancel button.
End Rem
Method CreateAbortWindow(parent:wxWindow, printout:wxPrintout)
+ bmx_wxprinter_createabortwindow(wxObjectPtr, parent.wxObjectPtr, printout.wxObjectPtr)
End Method

Rem
bbdoc: Returns true if the user has aborted the print job.
End Rem
Method GetAbort:Int()
+ Return bmx_wxprinter_getabort(wxObjectPtr)
End Method

Rem
@@ -75,12 +100,14 @@
to wxPRINTER_NO_ERROR if no error happened.
End Rem
Function GetLastError:Int()
+ Return bmx_wxprinter_getlasterror()
End Function

Rem
bbdoc: Returns the print data associated with the printer object.
End Rem
Method GetPrintDialogData:wxPrintDialogData()
+ Return wxPrintDialogData._create(bmx_wxprinter_getprintdialogdata(wxObjectPtr))
End Method

Rem
@@ -94,6 +121,7 @@
</p>
End Rem
Method Print:Int(parent:wxWindow, printout:wxPrintout, prompt:Int = True)
+ Return bmx_wxprinter_print(wxObjectPtr, parent.wxObjectPtr,
printout.wxObjectPtr, prompt)
End Method

Rem
@@ -102,16 +130,18 @@
be returned (otherwise NULL is returned -- call
wxPrinter::GetLastError to get detailed information about
the kind of the error).
<p>
- The application must free this device context to avoid a memory leak.
+ The application <b>must</b> Free() this device context to avoid a
memory leak.
</p>
End Rem
Method PrintDialog:wxDC(parent:wxWindow)
+ Return wxDC._create(bmx_wxprinter_printdialog(wxObjectPtr, parent.wxObjectPtr))
End Method

Rem
bbdoc: Default error-reporting method.
End Rem
Method ReportError(parent:wxWindow, printout:wxPrintout, message:String)
+ ' TODO
End Method

Rem
@@ -119,6 +149,14 @@
about: Note that the setup dialog is obsolete from Windows 95, though
retained for backward compatibility.
End Rem
Method Setup(parent:wxWindow)
+ bmx_wxprinter_setup(wxObjectPtr, parent.wxObjectPtr)
End Method

+ Method Delete()
+ If wxObjectPtr Then
+ bmx_wxprinter_delete(wxObjectPtr)
+ wxObjectPtr = Null
+ End If
+ End Method
+
End Type

Modified: trunk/wx.mod/wxprintout.mod/common.bmx
==============================================================================
--- trunk/wx.mod/wxprintout.mod/common.bmx (original)
+++ trunk/wx.mod/wxprintout.mod/common.bmx Wed Dec 26 12:33:42 2007
@@ -44,5 +44,32 @@
Import "glue.cpp"

Extern
+ Function bmx_wxprintout_create:Byte Ptr(handle:Object, title:String)
+ Function bmx_printout_delete(handle:Byte Ptr)
+
+ Function bmx_wxprintout_getdc:Byte Ptr(handle:Byte Ptr)
+ Function bmx_wxprintout_getpagesizemm(handle:Byte Ptr, w:Int Ptr,
h:Int Ptr)
+ Function bmx_wxprintout_getpagesizepixels(handle:Byte Ptr, w:Int Ptr,
h:Int Ptr)
+ Function bmx_wxprintout_getpaperrectpixels(handle:Byte Ptr, x:Int
Ptr, y:Int Ptr, w:Int Ptr, h:Int Ptr)
+ Function bmx_wxprintout_getpaperrectpixelsrect:Byte Ptr(handle:Byte Ptr)
+ Function bmx_wxprintout_getppiprinter(handle:Byte Ptr, w:Int Ptr,
h:Int Ptr)
+ Function bmx_wxprintout_getppiscreen(handle:Byte Ptr, w:Int Ptr,
h:Int Ptr)
+ Function bmx_wxprintout_gettitle:String(handle:Byte Ptr)
+ Function bmx_wxprintout_ispreview:Int(handle:Byte Ptr)
+ Function bmx_wxprintout_fitthissizetopaper(handle:Byte Ptr, w:Int, h:Int)
+ Function bmx_wxprintout_fitthissizetopage(handle:Byte Ptr, w:Int, h:Int)
+ Function bmx_wxprintout_fitthissizetopagemargins(handle:Byte Ptr,
w:Int, h:Int, pageSetupData:Byte Ptr)
+ Function bmx_wxprintout_mapscreensizetopaper(handle:Byte Ptr)
+ Function bmx_wxprintout_mapscreensizetopage(handle:Byte Ptr)
+ Function bmx_wxprintout_mapscreensizetopagemargins(handle:Byte Ptr,
pageSetupData:Byte Ptr)
+ Function bmx_wxprintout_mapscreensizetodevice(handle:Byte Ptr)
+ Function bmx_wxprintout_getlogicalpaperrect(handle:Byte Ptr, x:Int
Ptr, y:Int Ptr, w:Int Ptr, h:Int Ptr)
+ Function bmx_wxprintout_getlogicalpaperrectrect:Byte Ptr(handle:Byte Ptr)
+ Function bmx_wxprintout_getlogicalpagerect(handle:Byte Ptr, x:Int
Ptr, y:Int Ptr, w:Int Ptr, h:Int Ptr)
+ Function bmx_wxprintout_getlogicalpagerectrect:Byte Ptr(handle:Byte Ptr)
+ Function bmx_wxprintout_getlogicalpagemarginsrect(handle:Byte Ptr,
x:Int Ptr, y:Int Ptr, w:Int Ptr, h:Int Ptr, pageSetupData:Byte Ptr)
+ Function bmx_wxprintout_getlogicalpagemarginsrectrect:Byte
Ptr(handle:Byte Ptr, pageSetupData:Byte Ptr)
+ Function bmx_wxprintout_setlogicalorigin(handle:Byte Ptr, x:Int, y:Int)
+ Function bmx_wxprintout_offsetlogicalorigin(handle:Byte Ptr,
xOff:Int, yOff:Int)

End Extern

Modified: trunk/wx.mod/wxprintout.mod/glue.cpp
==============================================================================
--- trunk/wx.mod/wxprintout.mod/glue.cpp (original)
+++ trunk/wx.mod/wxprintout.mod/glue.cpp Wed Dec 26 12:33:42 2007
@@ -24,8 +24,186 @@

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

+MaxPrintout::MaxPrintout(BBObject * handle, const wxString& title)
+ : maxHandle(handle), wxPrintout(title)
+{
+}
+
+bool MaxPrintout::OnBeginDocument(int startPage, int endPage) {
+
+ bool check = _wx_wxprintout_wxPrintout__OnBeginDocument(maxHandle,
startPage, endPage);
+ if (!wxPrintout::OnBeginDocument(startPage, endPage)) {
+ return false;
+ }
+ return check;
+}
+
+void MaxPrintout::OnEndDocument() {
+
+ _wx_wxprintout_wxPrintout__OnEndDocument(maxHandle);
+ wxPrintout::OnEndDocument();
+
+}
+
+void MaxPrintout::OnBeginPrinting() {
+
+ _wx_wxprintout_wxPrintout__OnBeginPrinting(maxHandle);
+
+}
+
+void MaxPrintout::OnEndPrinting() {
+
+ _wx_wxprintout_wxPrintout__OnEndPrinting(maxHandle);
+
+}
+
+void MaxPrintout::OnPreparePrinting() {
+
+ _wx_wxprintout_wxPrintout__OnPreparePrinting(maxHandle);
+
+}
+
+bool MaxPrintout::OnPrintPage(int pageNum) {
+
+ return _wx_wxprintout_wxPrintout__OnPrintPage(maxHandle, pageNum);
+
+}
+
+void MaxPrintout::GetPageInfo(int *minPage, int *maxPage, int
*pageFrom, int *pageTo) {
+
+ _wx_wxprintout_wxPrintout__GetPageInfo(maxHandle, minPage, maxPage,
pageFrom, pageTo);
+
+}
+
+bool MaxPrintout::HasPage(int pageNum) {
+
+ return _wx_wxprintout_wxPrintout__HasPage(maxHandle, pageNum);
+
+}
+


// *********************************************
+
+MaxPrintout * bmx_wxprintout_create(BBObject * handle, BBString *
title) {
+ return new MaxPrintout(handle, wxStringFromBBString(title));
+}
+
+void bmx_printout_delete(wxPrintout * printout){
+ delete printout;
+}
+
+
+MaxDC * bmx_wxprintout_getdc(wxPrintout * printout) {
+ return new MaxDC(*printout->GetDC());
+}
+
+void bmx_wxprintout_getpagesizemm(wxPrintout * printout, int * w, int
* h) {
+ printout->GetPageSizeMM(w, h);
+}
+
+void bmx_wxprintout_getpagesizepixels(wxPrintout * printout, int * w,
int * h) {
+ printout->GetPageSizePixels(w, h);
+}
+
+void bmx_wxprintout_getpaperrectpixels(wxPrintout * printout, int * x,
int * y, int * w, int * h) {
+ wxRect r(printout->GetPaperRectPixels());
+ *x = r.x;
+ *y = r.y;
+ *w = r.width;
+ *h = r.height;
+}
+
+MaxRect * bmx_wxprintout_getpaperrectpixelsrect(wxPrintout * printout) {
+ return new MaxRect(printout->GetPaperRectPixels());
+}
+
+void bmx_wxprintout_getppiprinter(wxPrintout * printout, int * w, int
* h) {
+ printout->GetPPIPrinter(w, h);
+}
+
+void bmx_wxprintout_getppiscreen(wxPrintout * printout, int * w, int *
h) {
+ printout->GetPPIScreen(w, h);
+}
+
+BBString * bmx_wxprintout_gettitle(wxPrintout * printout) {
+ return bbStringFromWxString(printout->GetTitle());
+}
+
+bool bmx_wxprintout_ispreview(wxPrintout * printout) {
+ return printout->IsPreview();
+}
+
+void bmx_wxprintout_fitthissizetopaper(wxPrintout * printout, int w,
int h) {
+ printout->FitThisSizeToPaper(wxSize(w, h));
+}
+
+void bmx_wxprintout_fitthissizetopage(wxPrintout * printout, int w,
int h) {
+ printout->FitThisSizeToPage(wxSize(w, h));
+}
+
+void bmx_wxprintout_fitthissizetopagemargins(wxPrintout * printout,
int w, int h, wxPageSetupDialogData * pageSetupData) {
+ printout->FitThisSizeToPageMargins(wxSize(w, h), *pageSetupData);
+}
+
+void bmx_wxprintout_mapscreensizetopaper(wxPrintout * printout) {
+ printout->MapScreenSizeToPaper();
+}
+
+void bmx_wxprintout_mapscreensizetopage(wxPrintout * printout) {
+ printout->MapScreenSizeToPage();
+}
+
+void bmx_wxprintout_mapscreensizetopagemargins(wxPrintout * printout,
wxPageSetupDialogData * pageSetupData) {
+ printout->MapScreenSizeToPageMargins(*pageSetupData);
+}
+
+void bmx_wxprintout_mapscreensizetodevice(wxPrintout * printout) {
+ printout->MapScreenSizeToDevice();
+}
+
+void bmx_wxprintout_getlogicalpaperrect(wxPrintout * printout, int *
x, int * y, int * w, int * h) {
+ wxRect r(printout->GetLogicalPaperRect());
+ *x = r.x;
+ *y = r.y;
+ *w = r.width;
+ *h = r.height;
+}
+
+MaxRect * bmx_wxprintout_getlogicalpaperrectrect(wxPrintout *
printout) {
+ return new MaxRect(printout->GetLogicalPaperRect());
+}
+
+void bmx_wxprintout_getlogicalpagerect(wxPrintout * printout, int * x,
int * y, int * w, int * h) {
+ wxRect r(printout->GetLogicalPageRect());
+ *x = r.x;
+ *y = r.y;
+ *w = r.width;
+ *h = r.height;
+}
+
+MaxRect * bmx_wxprintout_getlogicalpagerectrect(wxPrintout * printout) {
+ return new MaxRect(printout->GetLogicalPageRect());
+}
+
+void bmx_wxprintout_getlogicalpagemarginsrect(wxPrintout * printout,
int * x, int * y, int * w, int * h, wxPageSetupDialogData *
pageSetupData) {
+ wxRect r(printout->GetLogicalPageMarginsRect(*pageSetupData));
+ *x = r.x;
+ *y = r.y;
+ *w = r.width;
+ *h = r.height;
+}
+
+MaxRect * bmx_wxprintout_getlogicalpagemarginsrectrect(wxPrintout *
printout, wxPageSetupDialogData * pageSetupData) {
+ return new MaxRect(printout->GetLogicalPageMarginsRect(*pageSetupData));
+}
+
+void bmx_wxprintout_setlogicalorigin(wxPrintout * printout, int x, int
y) {
+ printout->SetLogicalOrigin(x, y);
+}
+
+void bmx_wxprintout_offsetlogicalorigin(wxPrintout * printout, int
xOff, int yOff) {
+ printout->OffsetLogicalOrigin(xOff, yOff);
+}

Modified: trunk/wx.mod/wxprintout.mod/glue.h
==============================================================================
--- trunk/wx.mod/wxprintout.mod/glue.h (original)
+++ trunk/wx.mod/wxprintout.mod/glue.h Wed Dec 26 12:33:42 2007
@@ -21,15 +21,72 @@
*/

#include "wxglue.h"
+#include "wx/print.h"
+#include "../wxpagesetupdialogdata.mod/glue.h"

-//class MaxNotebook;
+class MaxPrintout;

extern "C" {

#include <blitz.h>

+ MaxPrintout * bmx_wxprintout_create(BBObject * handle, BBString * title);
+ void bmx_printout_delete(wxPrintout * printout);
+
+ void _wx_wxprintout_wxPrintout__GetPageInfo(BBObject * handle, int
*minPage, int *maxPage, int *pageFrom, int *pageTo);
+ bool _wx_wxprintout_wxPrintout__HasPage(BBObject * handle, int pageNum);
+
+ bool _wx_wxprintout_wxPrintout__OnBeginDocument(BBObject * handle,
int startPage, int endPage);
+ void _wx_wxprintout_wxPrintout__OnEndDocument(BBObject * handle);
+ void _wx_wxprintout_wxPrintout__OnBeginPrinting(BBObject * handle);
+ void _wx_wxprintout_wxPrintout__OnEndPrinting(BBObject * handle);
+ void _wx_wxprintout_wxPrintout__OnPreparePrinting(BBObject * handle);
+ bool _wx_wxprintout_wxPrintout__OnPrintPage(BBObject * handle, int pageNum);
+
+ MaxDC * bmx_wxprintout_getdc(wxPrintout * printout);
+ void bmx_wxprintout_getpagesizemm(wxPrintout * printout, int * w, int
* h);
+ void bmx_wxprintout_getpagesizepixels(wxPrintout * printout, int * w,
int * h);
+ void bmx_wxprintout_getpaperrectpixels(wxPrintout * printout, int *
x, int * y, int * w, int * h);
+ MaxRect * bmx_wxprintout_getpaperrectpixelsrect(wxPrintout * printout);
+ void bmx_wxprintout_getppiprinter(wxPrintout * printout, int * w, int
* h);
+ void bmx_wxprintout_getppiscreen(wxPrintout * printout, int * w, int
* h);
+ BBString * bmx_wxprintout_gettitle(wxPrintout * printout);
+ bool bmx_wxprintout_ispreview(wxPrintout * printout);
+ void bmx_wxprintout_fitthissizetopaper(wxPrintout * printout, int w,
int h);
+ void bmx_wxprintout_fitthissizetopage(wxPrintout * printout, int w,
int h);
+ void bmx_wxprintout_fitthissizetopagemargins(wxPrintout * printout,
int w, int h, wxPageSetupDialogData * pageSetupData);
+ void bmx_wxprintout_mapscreensizetopaper(wxPrintout * printout);
+ void bmx_wxprintout_mapscreensizetopage(wxPrintout * printout);
+ void bmx_wxprintout_mapscreensizetopagemargins(wxPrintout * printout,
wxPageSetupDialogData * pageSetupData);
+ void bmx_wxprintout_mapscreensizetodevice(wxPrintout * printout);
+ void bmx_wxprintout_getlogicalpaperrect(wxPrintout * printout, int *
x, int * y, int * w, int * h);
+ MaxRect * bmx_wxprintout_getlogicalpaperrectrect(wxPrintout * printout);
+ void bmx_wxprintout_getlogicalpagerect(wxPrintout * printout, int *
x, int * y, int * w, int * h);
+ MaxRect * bmx_wxprintout_getlogicalpagerectrect(wxPrintout * printout);
+ void bmx_wxprintout_getlogicalpagemarginsrect(wxPrintout * printout,
int * x, int * y, int * w, int * h, wxPageSetupDialogData * pageSetupData);
+ MaxRect * bmx_wxprintout_getlogicalpagemarginsrectrect(wxPrintout *
printout, wxPageSetupDialogData * pageSetupData);
+ void bmx_wxprintout_setlogicalorigin(wxPrintout * printout, int x,
int y);
+ void bmx_wxprintout_offsetlogicalorigin(wxPrintout * printout, int
xOff, int yOff);

}

// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

+class MaxPrintout : public wxPrintout
+{
+public:
+ MaxPrintout(BBObject * handle, const wxString& title);
+
+ void GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo);
+ bool HasPage(int pageNum);
+
+ bool OnBeginDocument(int startPage, int endPage);
+ void OnEndDocument();
+ void OnBeginPrinting();
+ void OnEndPrinting();
+ void OnPreparePrinting();
+ bool OnPrintPage(int pageNum);
+
+private:
+ BBObject * maxHandle;
+};

Modified: trunk/wx.mod/wxprintout.mod/wxprintout.bmx
==============================================================================
--- trunk/wx.mod/wxprintout.mod/wxprintout.bmx (original)
+++ trunk/wx.mod/wxprintout.mod/wxprintout.bmx Wed Dec 26 12:33:42 2007
@@ -72,11 +72,50 @@
Type wxPrintout Extends wxObject

Rem
+ bbdoc: Constructor.
+ about: Pass an optional title argument - the current filename would
be a good idea. This
+ will appear in the printing list (at least in MSW)
+ End Rem
+ Function CreatePrintout:wxPrintout(title:String = "Printout")
+ Return New wxPrintout.Create(title)
+ End Function
+
+ Rem
+ bbdoc: Constructor.
+ about: Pass an optional title argument - the current filename would
be a good idea. This
+ will appear in the printing list (at least in MSW)
+ End Rem
+ Method Create:wxPrintout(title:String = "Printout")
+ wxObjectPtr = bmx_wxprintout_create(Self, title)
+ Return Self
+ End Method
+
+ ' soft linking
+ Function _create:wxPrintout(wxObjectPtr:Byte Ptr)
+ If wxObjectPtr Then
+ Local this:wxPrintout = New wxPrintout
+ this.wxObjectPtr = wxObjectPtr
+ Return this
+ End If
+ End Function
+
+ Function _find:wxPrintout(wxObjectPtr:Byte Ptr)
+ If wxObjectPtr Then
+ Local printout:wxPrintout = wxPrintout(wxfind(wxObjectPtr))
+ If Not printout Then
+ Return wxPrintout._create(wxObjectPtr)
+ End If
+ Return printout
+ End If
+ End Function
+
+ Rem
bbdoc: Returns the device context associated with the printout (given
to the printout at start of printing or previewing).
about: This will be a wxPrinterDC if printing under Windows or Mac, a
wxPostScriptDC if printing on
other platforms, and a wxMemoryDC if previewing.
End Rem
Method GetDC:wxDC()
+ Return wxDC._create(bmx_wxprintout_getdc(wxObjectPtr))
End Method

Rem
@@ -102,6 +141,7 @@
bbdoc: Returns the size of the printer page in millimetres.
End Rem
Method GetPageSizeMM(w:Int Var, h:Int Var)
+ bmx_wxprintout_getpagesizemm(wxObjectPtr, Varptr w, Varptr h)
End Method

Rem
@@ -112,6 +152,7 @@
preview zoom. The application must take this discrepancy into account
if previewing is to be supported.
End Rem
Method GetPageSizePixels(w:Int Var, h:Int Var)
+ bmx_wxprintout_getpagesizepixels(wxObjectPtr, Varptr w, Varptr h)
End Method

Rem
@@ -127,6 +168,23 @@
its entire area were printable, so this function will return the same
rectangle as the page rectangle.
End Rem
Method GetPaperRectPixels(x:Int Var, y:Int Var, w:Int Var, h:Int Var)
+ bmx_wxprintout_getpaperrectpixels(wxObjectPtr, Varptr x, Varptr y,
Varptr w, Varptr h)
+ End Method
+
+ Rem
+ bbdoc: Returns the rectangle that corresponds to the entire paper in
pixels, called the paper rectangle.
+ about: This distinction between paper rectangle and page rectangle
reflects the fact that most
+ printers cannot print all the way to the edge of the paper. The page
rectangle is a rectangle whose
+ top left corner is at (0,0) and whose width and height are given by wxDC::GetPageSizePixels.
+ On MSW and Mac, the page rectangle gives the printable area of the
paper, while the paper rectangle
+ represents the entire paper, including non-printable borders. Thus,
the rectangle returned by
+ GetPaperRectPixels will have a top left corner whose coordinates are
small negative numbers and the
+ bottom right corner will have values somewhat larger than the width
and height given by
+ wxDC::GetPageSizePixels. On other platforms and for PostScript
printing, the paper is treated as if
+ its entire area were printable, so this function will return the same
rectangle as the page rectangle.
+ End Rem
+ Method GetPaperRectPixelsRect:wxRect()
+ Return wxRect._create(bmx_wxprintout_getpaperrectpixelsrect(wxObjectPtr))
End Method

Rem
@@ -137,6 +195,7 @@
most of the scaling calculations for you.
End Rem
Method GetPPIPrinter(w:Int Var, h:Int Var)
+ bmx_wxprintout_getppiprinter(wxObjectPtr, Varptr w, Varptr h)
End Method

Rem
@@ -146,12 +205,14 @@
take the preview DC size into account.
End Rem
Method GetPPIScreen(w:Int Var, h:Int Var)
+ bmx_wxprintout_getppiscreen(wxObjectPtr, Varptr w, Varptr h)
End Method

Rem
bbdoc: Returns the title of the printout
End Rem
Method GetTitle:String()
+ Return bmx_wxprintout_gettitle(wxObjectPtr)
End Method

Rem
@@ -160,6 +221,10 @@
document has only one page.
End Rem
Method HasPage:Int(pageNum:Int)
+ If pageNum = 1 Then
+ Return True
+ End If
+ Return False
End Method

Function _HasPage:Int(obj:wxPrintout, pageNum:Int)
@@ -170,6 +235,7 @@
bbdoc: Returns true if the printout is currently being used for previewing.
End Rem
Method IsPreview:Int()
+ Return bmx_wxprintout_ispreview(wxObjectPtr)
End Method

Rem
@@ -178,6 +244,7 @@
that the edges of the image could be cut off. Use this if you're
managing your own page margins.
End Rem
Method FitThisSizeToPaper(w:Int, h:Int)
+ bmx_wxprintout_fitthissizetopaper(wxObjectPtr, w, h)
End Method

Rem
@@ -188,6 +255,7 @@
off at the edges.
End Rem
Method FitThisSizeToPage(w:Int, h:Int)
+ bmx_wxprintout_fitthissizetopage(wxObjectPtr, w, h)
End Method

Rem
@@ -198,6 +266,7 @@
type wxMacPageMarginsDialog.
End Rem
Method FitThisSizeToPageMargins(w:Int, h:Int, pageSetupData:wxPageSetupDialogData)
+ bmx_wxprintout_fitthissizetopagemargins(wxObjectPtr, w, h, pageSetupData.wxObjectPtr)
End Method

Rem
@@ -207,18 +276,21 @@
if you want WYSIWYG behavior, e.g., in a text editor.
End Rem
Method MapScreenSizeToPaper()
+ bmx_wxprintout_mapscreensizetopaper(wxObjectPtr)
End Method

Rem
bbdoc: This sets the user scale of the wxDC assocated with this
wxPrintout to the same scale as MapScreenSizeToPaper but sets the
logical origin to the top left corner of the page rectangle.
End Rem
Method MapScreenSizeToPage()
+ bmx_wxprintout_mapscreensizetopage(wxObjectPtr)
End Method

Rem
bbdoc: This sets the user scale of the wxDC assocated with this
wxPrintout to the same scale as MapScreenSizeToPageMargins but sets the
logical origin to the top left corner of the page margins specified by
the given wxPageSetupDialogData object.
End Rem
Method MapScreenSizeToPageMargins(pageSetupData:wxPageSetupDialogData)
+ bmx_wxprintout_mapscreensizetopagemargins(wxObjectPtr, pageSetupData.wxObjectPtr)
End Method

Rem
@@ -231,12 +303,21 @@
page rectangle, or page margins rectangle to perform your own scaling.
End Rem
Method MapScreenSizeToDevice()
+ bmx_wxprintout_mapscreensizetodevice(wxObjectPtr)
End Method

Rem
bbdoc: Return the rectangle corresponding to the paper in the
associated wxDC's logical coordinates for the current user scale and
device origin.
End Rem
Method GetLogicalPaperRect(x:Int Var, y:Int Var, w:Int Var, h:Int Var)
+ bmx_wxprintout_getlogicalpaperrect(wxObjectPtr, Varptr x, Varptr y,
Varptr w, Varptr h)
+ End Method
+
+ Rem
+ bbdoc: Return the rectangle corresponding to the paper in the
associated wxDC's logical coordinates for the current user scale and
device origin.
+ End Rem
+ Method GetLogicalPaperRectRect:wxRect()
+ Return wxRect._create(bmx_wxprintout_getlogicalpaperrectrect(wxObjectPtr))
End Method

Rem
@@ -245,6 +326,16 @@
printing, this will be the full paper rectangle.
End Rem
Method GetLogicalPageRect(x:Int Var, y:Int Var, w:Int Var, h:Int Var)
+ bmx_wxprintout_getlogicalpagerect(wxObjectPtr, Varptr x, Varptr y,
Varptr w, Varptr h)
+ End Method
+
+ Rem
+ bbdoc: Return the rectangle corresponding to the page in the
associated wxDC's logical coordinates for the current user scale and
device origin.
+ about: On MSW and Mac, this will be the printable area of the paper.
On other platforms and PostScript
+ printing, this will be the full paper rectangle.
+ End Rem
+ Method GetLogicalPageRectRect:wxRect()
+ Return wxRect._create(bmx_wxprintout_getlogicalpagerectrect(wxObjectPtr))
End Method

Rem
@@ -252,18 +343,29 @@
about: The page margins are specified with respect to the edges of
the paper on all platforms.
End Rem
Method GetLogicalPageMarginsRect(x:Int Var, y:Int Var, w:Int Var,
h:Int Var, pageSetupData:wxPageSetupDialogData)
+ bmx_wxprintout_getlogicalpagemarginsrect(wxObjectPtr, Varptr x,
Varptr y, Varptr w, Varptr h, pageSetupData.wxObjectPtr)
+ End Method
+
+ Rem
+ bbdoc: Return the rectangle corresponding to the page margins
specified by the given wxPageSetupDialogData object in the associated
wxDC's logical coordinates for the current user scale and device origin.
+ about: The page margins are specified with respect to the edges of
the paper on all platforms.
+ End Rem
+ Method GetLogicalPageMarginsRectRect:wxRect(pageSetupData:wxPageSetupDialogData)
+ Return
wxRect._create(bmx_wxprintout_getlogicalpagemarginsrectrect(wxObjectPtr, pageSetupData.wxObjectPtr))
End Method

Rem
bbdoc: Set the device origin of the associated wxDC so that the
current logical point becomes the new logical origin.
End Rem
Method SetLogicalOrigin(x:Int, y:Int)
+ bmx_wxprintout_setlogicalorigin(wxObjectPtr, x, y)
End Method

Rem
bbdoc: Shift the device origin by an amount specified in logical coordinates.
End Rem
Method OffsetLogicalOrigin(xOff:Int, yOff:Int)
+ bmx_wxprintout_offsetlogicalorigin(wxObjectPtr, xOff, yOff)
End Method

Rem
@@ -336,5 +438,12 @@
Return obj.OnPrintPage(pageNum)
End Function

+ Method Delete()
+ If wxObjectPtr Then
+ bmx_printout_delete(wxObjectPtr)
+ wxObjectPtr = Null
+ End If
+ End Method
+
End Type


Modified: trunk/wx.mod/wxprintpreview.mod/common.bmx
==============================================================================
--- trunk/wx.mod/wxprintpreview.mod/common.bmx (original)
+++ trunk/wx.mod/wxprintpreview.mod/common.bmx Wed Dec 26 12:33:42 2007
@@ -21,6 +21,9 @@
SuperStrict

Import wx.wx
+Import wx.wxPrintout
+Import wx.wxScrolledWindow
+Import wx.wxFrame
Import BRL.Blitz


@@ -42,5 +45,26 @@
Import "glue.cpp"

Extern
+
+ Function bmx_wxprintpreview_create:Byte Ptr(handle:Object,
printout:Byte Ptr, printoutForPrinting:Byte Ptr, data:Byte Ptr)
+ Function bmx_wxprintpreview_free(handle:Byte Ptr)
+ Function bmx_wxprintpreview_getcanvas:Byte Ptr(handle:Byte Ptr)
+ Function bmx_wxprintpreview_getcurrentpage:Int(handle:Byte Ptr)
+ Function bmx_wxprintpreview_getframe:Byte Ptr(handle:Byte Ptr)
+ Function bmx_wxprintpreview_getmaxpage:Int(handle:Byte Ptr)
+ Function bmx_wxprintpreview_getminpage:Int(handle:Byte Ptr)
+ Function bmx_wxprintpreview_getprintout:Byte Ptr(handle:Byte Ptr)
+ Function bmx_wxprintpreview_getprintoutforprinting:Byte
Ptr(handle:Byte Ptr)
+ Function bmx_wxprintpreview_isok:Int(handle:Byte Ptr)
+ Function bmx_wxprintpreview_paintpage:Int(handle:Byte Ptr,
canvas:Byte Ptr, dc:Byte Ptr)
+ Function bmx_wxprintpreview_paintpageX:Int(handle:Byte Ptr,
canvas:Byte Ptr, dc:Byte Ptr)
+ Function bmx_wxprintpreview_print:Int(handle:Byte Ptr, prompt:Int)
+ Function bmx_wxprintpreview_renderpage:Int(handle:Byte Ptr, pageNum:Int)
+ Function bmx_wxprintpreview_setCanvas(handle:Byte Ptr, canvas:Byte Ptr)
+ Function bmx_wxprintpreview_setcurrentpage(handle:Byte Ptr, pageNum:Int)
+ Function bmx_wxprintpreview_setframe(handle:Byte Ptr, frame:Byte Ptr)
+ Function bmx_wxprintpreview_setprintout(handle:Byte Ptr,
printout:Byte Ptr)
+ Function bmx_wxprintpreview_setzoom(handle:Byte Ptr, percent:Int)
+

End Extern

Modified: trunk/wx.mod/wxprintpreview.mod/glue.cpp
==============================================================================
--- trunk/wx.mod/wxprintpreview.mod/glue.cpp (original)
+++ trunk/wx.mod/wxprintpreview.mod/glue.cpp Wed Dec 26 12:33:42 2007
@@ -24,8 +24,107 @@

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

+MaxPrintPreview::MaxPrintPreview(BBObject * handle, wxPrintout*
printout, wxPrintout* printoutForPrinting, wxPrintData* data)
+ : maxHandle(handle), wxPrintPreview(printout, printoutForPrinting, data)
+{
+ wxbind(this, handle);
+}

+MaxPrintPreview::~MaxPrintPreview() {
+ wxunbind(this);
+}
+
+bool MaxPrintPreview::PaintPage(wxPreviewCanvas *canvas, wxDC dc) {
+ _wx_wxprintpreview_wxPrintPreview__PaintPage(maxHandle, canvas, new MaxDC(dc));
+}
+
+bool MaxPrintPreview::PaintPageX(wxPreviewCanvas *canvas, MaxDC * dc) {
+ wxPrintPreview::PaintPage(canvas, *dc->GetDC());
+}

// *********************************************

+wxPrintPreview * bmx_wxprintpreview_create(BBObject * handle,
wxPrintout * printout, wxPrintout * printoutForPrinting, MaxPrintData *
data) {
+ if (data) {
+ if (printoutForPrinting) {
+ return new MaxPrintPreview(handle, printout, printoutForPrinting, &data->Data());
+ } else {
+ return new MaxPrintPreview(handle, printout, NULL, &data->Data());
+ }
+ } else {
+ if (printoutForPrinting) {
+ return new MaxPrintPreview(handle, printout, printoutForPrinting, NULL);
+ } else {
+ return new MaxPrintPreview(handle, printout, NULL, NULL);
+ }
+ }
+}
+
+void bmx_wxprintpreview_free(wxPrintPreview * preview) {
+ delete preview;
+}
+
+wxPreviewCanvas * bmx_wxprintpreview_getcanvas(wxPrintPreview *
preview) {
+ return preview->GetCanvas();
+}
+
+int bmx_wxprintpreview_getcurrentpage(wxPrintPreview * preview) {
+ return preview->GetCurrentPage();
+}
+
+wxFrame * bmx_wxprintpreview_getframe(wxPrintPreview * preview) {
+ return preview->GetFrame();
+}
+
+int bmx_wxprintpreview_getmaxpage(wxPrintPreview * preview) {
+ return preview->GetMaxPage();
+}
+
+int bmx_wxprintpreview_getminpage(wxPrintPreview * preview) {
+ return preview->GetMinPage();
+}
+
+wxPrintout * bmx_wxprintpreview_getprintout(wxPrintPreview * preview) {
+ return preview->GetPrintout();
+}
+
+wxPrintout * bmx_wxprintpreview_getprintoutforprinting(wxPrintPreview
* preview) {
+ return preview->GetPrintoutForPrinting();
+}
+
+bool bmx_wxprintpreview_isok(wxPrintPreview * preview) {
+ return preview->IsOk();
+}
+
+bool bmx_wxprintpreview_paintpage(wxPrintPreview * preview,
wxPreviewCanvas * canvas, MaxDC * dc) {
+ return preview->PaintPage(canvas, *dc->GetDC());
+}
+
+bool bmx_wxprintpreview_paintpageX(MaxPrintPreview * preview,
wxPreviewCanvas * canvas, MaxDC * dc) {
+ return preview->PaintPageX(canvas, dc);
+}
+
+bool bmx_wxprintpreview_print(wxPrintPreview * preview, bool prompt) {
+ return preview->Print(prompt);
+}
+
+void bmx_wxprintpreview_setCanvas(wxPrintPreview * preview,
wxPreviewCanvas * canvas) {
+ preview->SetCanvas(canvas);
+}
+
+void bmx_wxprintpreview_setcurrentpage(wxPrintPreview * preview, int
pageNum) {
+ preview->SetCurrentPage(pageNum);
+}
+
+void bmx_wxprintpreview_setframe(wxPrintPreview * preview, wxFrame *
frame) {
+ preview->SetFrame(frame);
+}
+
+void bmx_wxprintpreview_setprintout(wxPrintPreview * preview,
wxPrintout * printout) {
+ preview->SetPrintout(printout);
+}
+
+void bmx_wxprintpreview_setzoom(wxPrintPreview * preview, int percent) {
+ preview->SetZoom(percent);
+}


Modified: trunk/wx.mod/wxprintpreview.mod/glue.h
==============================================================================
--- trunk/wx.mod/wxprintpreview.mod/glue.h (original)
+++ trunk/wx.mod/wxprintpreview.mod/glue.h Wed Dec 26 12:33:42 2007
@@ -21,15 +21,50 @@
*/

#include "wxglue.h"
+#include "wx/print.h"
+#include "../wxprintdata.mod/glue.h"

-//class MaxNotebook;
+class MaxPrintPreview;

extern "C" {

#include <blitz.h>

+ bool _wx_wxprintpreview_wxPrintPreview__PaintPage(BBObject *
maxHandle, wxPreviewCanvas * canvas, MaxDC * dc);
+
+ wxPrintPreview * bmx_wxprintpreview_create(BBObject * handle,
wxPrintout * printout, wxPrintout * printoutForPrinting, MaxPrintData * data);
+ void bmx_wxprintpreview_free(wxPrintPreview * preview);
+ wxPreviewCanvas * bmx_wxprintpreview_getcanvas(wxPrintPreview * preview);
+ int bmx_wxprintpreview_getcurrentpage(wxPrintPreview * preview);
+ wxFrame * bmx_wxprintpreview_getframe(wxPrintPreview * preview);
+ int bmx_wxprintpreview_getmaxpage(wxPrintPreview * preview);
+ int bmx_wxprintpreview_getminpage(wxPrintPreview * preview);
+ wxPrintout * bmx_wxprintpreview_getprintout(wxPrintPreview * preview);
+ wxPrintout * bmx_wxprintpreview_getprintoutforprinting(wxPrintPreview
* preview);
+ bool bmx_wxprintpreview_isok(wxPrintPreview * preview);
+ bool bmx_wxprintpreview_paintpage(wxPrintPreview * preview,
wxPreviewCanvas * canvas, MaxDC * dc);
+ bool bmx_wxprintpreview_paintpageX(MaxPrintPreview * preview,
wxPreviewCanvas * canvas, MaxDC * dc);
+ bool bmx_wxprintpreview_print(wxPrintPreview * preview, bool prompt);
+ void bmx_wxprintpreview_setCanvas(wxPrintPreview * preview,
wxPreviewCanvas * canvas);
+ void bmx_wxprintpreview_setcurrentpage(wxPrintPreview * preview, int pageNum);
+ void bmx_wxprintpreview_setframe(wxPrintPreview * preview, wxFrame * frame);
+ void bmx_wxprintpreview_setprintout(wxPrintPreview * preview,
wxPrintout * printout);
+ void bmx_wxprintpreview_setzoom(wxPrintPreview * preview, int percent);

}

// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+class MaxPrintPreview : public wxPrintPreview
+{
+public:
+ MaxPrintPreview(BBObject * handle, wxPrintout* printout, wxPrintout*
printoutForPrinting, wxPrintData* data);
+ ~MaxPrintPreview();
+
+ bool PaintPage(wxPreviewCanvas *canvas, wxDC dc);
+ bool PaintPageX(wxPreviewCanvas *canvas, MaxDC * dc);
+
+private:
+ BBObject * maxHandle;
+};


Modified: trunk/wx.mod/wxprintpreview.mod/wxprintpreview.bmx
==============================================================================
--- trunk/wx.mod/wxprintpreview.mod/wxprintpreview.bmx (original)
+++ trunk/wx.mod/wxprintpreview.mod/wxprintpreview.bmx Wed Dec 26
12:33:42 2007
@@ -47,4 +47,227 @@

Import "common.bmx"

+Rem
+bbdoc: Objects of this type manage the print preview process.
+about: The object is passed a wxPrintout object, and the
wxPrintPreview object itself is passed
+to a wxPreviewFrame object. Previewing is started by initializing and
showing the preview frame.
+Unlike wxPrinter::Print, flow of control returns to the application
immediately after the frame
+is shown.
+End Rem
+Type wxPrintPreview Extends wxObject
+
+ Rem
+ bbdoc: Constructor.
+ about: Pass a printout object, an optional printout object to be used
for actual printing,
+ and optional printer data, which will be copied to the print preview
object's print data.
+ <p>
+ If printoutForPrinting is non-NULL, a Print... button will be placed
on the preview frame
+ so that the user can print directly from the preview interface.
+ </p>
+ <p>
+ Do not explicitly delete the printout objects once this destructor
has been called, since
+ they will be deleted in the wxPrintPreview constructor. The same does
not apply to the data
+ argument.
+ </p>
+ <p>
+ Test IsOk() to check whether the wxPrintPreview object was created
correctly. Ok could
+ return false if there was a problem initializing the printer device
context (current printer
+ not set, for example).
+ </p>
+ End Rem
+ Function CreatePrintPreview:wxPrintPreview(printout:wxPrintout,
printoutForPrinting:wxPrintout = Null, data:wxPrintData = Null)
+ Return New wxPrintPreview.Create(printout, printoutForPrinting, data)
+ End Function
+
+ Rem
+ bbdoc: Constructor.
+ about: Pass a printout object, an optional printout object to be used
for actual printing,
+ and optional printer data, which will be copied to the print preview
object's print data.
+ <p>
+ If printoutForPrinting is non-NULL, a Print... button will be placed
on the preview frame
+ so that the user can print directly from the preview interface.
+ </p>
+ <p>
+ Do not explicitly delete the printout objects once this destructor
has been called, since
+ they will be deleted in the wxPrintPreview constructor. The same does
not apply to the data
+ argument.
+ </p>
+ <p>
+ Test IsOk() to check whether the wxPrintPreview object was created
correctly. Ok could
+ return false if there was a problem initializing the printer device
context (current printer
+ not set, for example).
+ </p>
+ End Rem
+ Method Create:wxPrintPreview(printout:wxPrintout,
printoutForPrinting:wxPrintout = Null, data:wxPrintData = Null)
+ If data Then
+ If printoutForPrinting Then
+ wxObjectPtr = bmx_wxprintpreview_create(Self,
printout.wxObjectPtr, printoutForPrinting.wxObjectPtr, data.wxObjectPtr)
+ Else
+ wxObjectPtr = bmx_wxprintpreview_create(Self,
printout.wxObjectPtr, Null, data.wxObjectPtr)
+ End If
+ Else
+ If printoutForPrinting Then
+ wxObjectPtr = bmx_wxprintpreview_create(Self,
printout.wxObjectPtr, printoutForPrinting.wxObjectPtr, Null)
+ Else
+ wxObjectPtr = bmx_wxprintpreview_create(Self,
printout.wxObjectPtr, Null, Null)
+ End If
+ End If
+ Return Self
+ End Method
+
+ Rem
+ bbdoc: Gets the preview window used for displaying the print preview image.
+ End Rem
+ Method GetCanvas:wxPreviewCanvas()
+ Return wxPreviewCanvas._create(bmx_wxprintpreview_getcanvas(wxObjectPtr))
+ End Method
+
+ Rem
+ bbdoc: Gets the page currently being previewed.
+ End Rem
+ Method GetCurrentPage:Int()
+ Return bmx_wxprintpreview_getcurrentpage(wxObjectPtr)
+ End Method
+
+ Rem
+ bbdoc: Gets the frame used for displaying the print preview canvas
and control bar.
+ End Rem
+ Method GetFrame:wxFrame()
+ Return wxFrame._find(bmx_wxprintpreview_getframe(wxObjectPtr))
+ End Method
+
+ Rem
+ bbdoc: Returns the maximum page number.
+ End Rem
+ Method GetMaxPage:Int()
+ Return bmx_wxprintpreview_getmaxpage(wxObjectPtr)
+ End Method
+
+ Rem
+ bbdoc: Returns the minimum page number.
+ End Rem
+ Method GetMinPage:Int()
+ Return bmx_wxprintpreview_getminpage(wxObjectPtr)
+ End Method
+
+ Rem
+ bbdoc: Gets the preview printout object associated with the
wxPrintPreview object.
+ End Rem
+ Method GetPrintout:wxPrintout()
+ Return wxPrintout._find(bmx_wxprintpreview_getprintout(wxObjectPtr))
+ End Method
+
+ Rem
+ bbdoc: Gets the printout object to be used for printing from within
the preview interface, or NULL if none exists.
+ End Rem
+ Method GetPrintoutForPrinting:wxPrintout()
+ Return wxPrintout._find(bmx_wxprintpreview_getprintoutforprinting(wxObjectPtr))
+ End Method
+
+ Rem
+ bbdoc: Returns True if the wxPrintPreview is valid, false otherwise.
+ about: It could return False if there was a problem initializing the
printer device context
+ (current printer not set, for example).
+ End Rem
+ Method IsOk:Int()
+ Return bmx_wxprintpreview_isok(wxObjectPtr)
+ End Method
+
+ Rem
+ bbdoc: This refreshes the preview window with the preview image.
+ about: It must be called from the preview window's OnPaint member.
+ <p>
+ The implementation simply blits the preview bitmap onto the canvas,
creating a new preview
+ bitmap if none exists.
+ </p>
+ End Rem
+ Method PaintPage:Int(canvas:wxPreviewCanvas, dc:wxDC)
+ Return bmx_wxprintpreview_paintpage(wxObjectPtr, canvas.wxObjectPtr, dc.wxObjectPtr)
+ End Method
+
+ Function _PaintPage:Int(preview:wxPrintPreview, canvas:Byte Ptr,
dc:Byte Ptr)
+ preview.PaintPage(wxPreviewCanvas._create(canvas), wxDC._create(dc))
+ End Function
+
+ Rem
+ bbdoc: Invokes the print process using the second wxPrintout object
supplied in the wxPrintPreview constructor.
+ returns: False in case of error -- call wxPrinter::GetLastError to
get detailed information about the kind of the error.
+ about: Will normally be called by the Print... panel item on the
preview frame's control
+ bar.
+ End Rem
+ Method Print:Int(prompt:Int)
+ Return bmx_wxprintpreview_print(wxObjectPtr, prompt)
+ End Method
+
+ Rem
+ bbdoc: Renders a page into a wxMemoryDC. Used internally by wxPrintPreview.
+ End Rem
+ Method RenderPage:Int(pageNum:Int)
+ ' nothing to see here, move along, move along ! ! !
+ End Method
+
+ Rem
+ bbdoc: Sets the window to be used for displaying the print preview image.
+ End Rem
+ Method SetCanvas(canvas:wxPreviewCanvas)
+ bmx_wxprintpreview_setCanvas(wxObjectPtr, canvas.wxObjectPtr)
+ End Method
+
+ Rem
+ bbdoc: Sets the current page to be previewed.
+ End Rem
+ Method SetCurrentPage(pageNum:Int)
+ bmx_wxprintpreview_setcurrentpage(wxObjectPtr, pageNum)
+ End Method
+
+ Rem
+ bbdoc: Sets the frame to be used for displaying the print preview
canvas and control bar.
+ End Rem
+ Method SetFrame(frame:wxFrame)
+ bmx_wxprintpreview_setframe(wxObjectPtr, frame.wxObjectPtr)
+ End Method
+
+ Rem
+ bbdoc: Associates a printout object with the wxPrintPreview object.
+ End Rem
+ Method SetPrintout(printout:wxPrintout)
+ bmx_wxprintpreview_setprintout(wxObjectPtr, printout.wxObjectPtr)
+ End Method
+
+ Rem
+ bbdoc: Sets the percentage preview zoom, and refreshes the preview
canvas accordingly.
+ End Rem
+ Method SetZoom(percent:Int)
+ bmx_wxprintpreview_setzoom(wxObjectPtr, percent)
+ End Method
+
+ Rem
+ bbdoc: Frees/Deletes the preview.
+ about: Usually, this will be handled when you close the frame, but
depending on other factors
+ you may wish to do it yourself.
+ End Rem
+ Method Free()
+ If wxObjectPtr Then
+ bmx_wxprintpreview_free(wxObjectPtr)
+ wxObjectPtr = Null
+ End If
+ End Method
+
+
+End Type
+
+Rem
+bbdoc: A preview canvas is the default canvas used by the print
preview system to display the preview.
+End Rem
+Type wxPreviewCanvas Extends wxScrolledWindow
+
+ Function _create:wxPreviewCanvas(wxObjectPtr:Byte Ptr)
+ If wxObjectPtr Then
+ Local this:wxPreviewCanvas = New wxPreviewCanvas
+ this.wxObjectPtr = wxObjectPtr
+ Return this
+ End If
+ End Function
+
+End Type

Reply all
Reply to author
Forward
0 new messages