Added typemap for wxArrayString

Added wxMimeTypesManager and wxFileType

Other updates...


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-10-30 06:43:54 +00:00
parent 951cd18031
commit b37c7e1dcd
23 changed files with 3072 additions and 155 deletions

View File

@@ -70,6 +70,18 @@ Added a set of sophisticated Error Dialogs from Chris Fama.
Added wxRightTextCtrl from Josu Oyanguren to wxPython.lib for aligning
text in a wxTextCtrl to the right side.
Added wxURLDataObject and and example showing drag and drop of URLs to
and from web browsers. It's still not 100% bullet-proof for all types
of browsers, but it works for the majority of cases with the popular
browsers on Windows. On wxGTK it seems that only Netscape 4.x works,
if anybody has any suggestions about this please bring it up on the
wx-dev list.
Added wxStopWatch.
Added wxMimeTypesManager and wxFileType.
2.3.1

View File

@@ -34,6 +34,7 @@ _treeList = [
'ErrorDialogs',
'wxRightTextCtrl',
'URLDragAndDrop',
'wxMimeTypesManager',
##'wxPopupWindow',
]),
@@ -68,7 +69,7 @@ _treeList = [
'PythonEvents', 'Threads',
'ActiveXWrapper_Acrobat', 'ActiveXWrapper_IE',
'wxDragImage', "wxProcess", "FancyText", "OOR", "wxWave",
'wxJoystick', 'DrawXXXList', 'ErrorDialogs',
'wxJoystick', 'DrawXXXList', 'ErrorDialogs', 'wxMimeTypesManager',
]),
('wxPython Library', ['Layoutf', 'wxScrolledMessageDialog',

View File

@@ -66,14 +66,16 @@ class TestPanel(wxPanel):
0, wxALIGN_RIGHT )
self.dragText = wxTextCtrl(self, -1, "http://wxPython.org/")
inSizer.Add(self.dragText, 0, wxEXPAND)
EVT_MOTION(self.dragText, self.OnStartDrag)
inSizer.Add(wxStaticText(self, -1,
"Drag this TEXT to your browser:",
style = wxALIGN_RIGHT),
0, wxALIGN_RIGHT )
self.dragText2 = wxTextCtrl(self, -1, "http://wxPython.org/")
inSizer.Add(self.dragText2, 0, wxEXPAND)
## inSizer.Add(wxStaticText(self, -1,
## "Drag this TEXT to your browser:",
## style = wxALIGN_RIGHT),
## 0, wxALIGN_RIGHT )
## self.dragText2 = wxTextCtrl(self, -1, "http://wxPython.org/")
## inSizer.Add(self.dragText2, 0, wxEXPAND)
## EVT_MOTION(self.dragText2, self.OnStartDrag2)
outsideSizer.Add(inSizer, 1, wxEXPAND)
@@ -82,8 +84,6 @@ class TestPanel(wxPanel):
self.dropText.SetDropTarget(MyURLDropTarget(self.dropText))
EVT_MOTION(self.dragText, self.OnStartDrag)
EVT_MOTION(self.dragText2, self.OnStartDrag2)
def OnStartDrag(self, evt):

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

View File

@@ -0,0 +1,38 @@
Name Type Platform Location Availability Description
WebReuser Development Windows 95, Windows NT, HPUX 9.05 and 10.2, Solaris 2.4 and 2.5 http://www.stablesoft.com Evaluation WebReuser is a re-use tool from Hitachi Europe Limited. WebReuser is a tool that simplifies software reuse. Its ability to track, schematize and search documents makes it the ideal way to understand C++ code. These features also make WebReuser an ideal tool to classify any Web resource. WebReuser can even be used for more general documentation management tasks.
MacAnova Development Windows, Motif, Mac http://www.stat.umn.edu/~gary/macanova/macanova.home.html Free A large statistical application from the School of Statistics, University of Minnesota. It is based on a modified version of wxWindows 1.65.
Hardy Development Win 3.1, WIN32, Motif (Sun only) http://www.aiai.ed.ac.uk/~hardy/ Freeware for personal and academic use A hypertext-based diagramming and knowledge-based system development tool, with NASA's CLIPS built-in. It is a superset of wxCLIPS.
wxCLIPS Development Win 3.1, WIN32, Motif, XView http://web.ukonline.co.uk/julian.smart/wxclips Freeware A GUI development environment for CLIPS applications.
wxPython Development wxWindows 2 for the new version http://alldunn.com/wxPython/ Freeware Python/wxWindows combination by Robin Dunn and Harri Pasanen. Python is an elegant object-oriented, interpreted language that runs on many platforms.
MrEd Development Win 3.1, WIN32, Motif, XView http://www.cs.rice.edu/CS/PLT/packages/mred/ Freeware MrEd is a combined editor and Scheme development environment by Matthew Flatt.
WXLisp Development Win 3.1, WIN32, Motif, XView http://www.cadlab.de/~lipuser/wxlisp/wxlisp.html Freeware A combination of wxWindows and XLisp.
Scriptum Development Motif http://www.isoft.com.ar/eng/products/system/scriptum.html Freeware Graphical editor with visual highlighting, navigation/browsing, undo, class browser for C++ and Java, source code management, file locking, remote editing using ftp, configurable.
WipeOut Development XView/Linux http://www.softwarebuero.de/wipeout-eng.html Giftware WipeOut is an integrated development environment for C++ projects, available for Linux/XView. The authors are working on versions for SunOS/Solaris. Source is available for porting to other platforms.
OPL Development Win 3.1, WIN32, Motif, XView http://www.ozemail.com.au/~adavison/ Freeware Object Prolog is a portable implementation of Prolog by Andrew Davison, with object-oriented extensions, entirely written in C++. In the initial version, a binding to wxWindows is available. In the revamped version, this binding has not been written yet.
Dataplore Graphics and sound Windows, other? http://www.datan.de/dataplore Commercial Data visualisation tool, from Datan
VCG Tool Graphics and sound Win 3.1, WIN32, Motif, XView http://www.cs.uni-sb.de:80/RW/users/sander/html/gsvcg1.html Freeware A graph layout tool similar to GraphPlace, but with extensions. Very nice indeed!
Y.E.S. Graphics and sound Win 3.1, WIN32, XView (Linux) ftp://ftp.musik.uni-essen.de/pub/EsAC/program/ Shareware Monophonic notation program.
JAZZ Graphics and sound XView (Linux) http://rokke.aug.hiagder.no/per/jazz.html Freeware A MIDI sequencer for Linux.
ISP Graphics and sound Win 3.1, WIN32, Motif, XView ftp://www.remstar.com/pub/wxwin/contrib/isp-100/ Freeware Image and sound player educational tool.
ClockWorks Graphics and sound Win 3.1, WIN32, Motif, XView http://web.ukonline.co.uk/Members/julian.smart/freesoft.html#clockworks Freeware A configurable analogue clock, with a collection of 'fine art' faces. By Julian Smart.
M Miscellaneous Windows 95, Windows NT, Linux http://www.phy.hw.ac.uk/~karsten/M/index.html GPL M is a cross-platform e-mail application. It will be available for X11/Unix and Windows platforms, supporting a wide range of e-mail transfer protocols as well as including full MIME support. M's wealth of features and ease of use make it one of the most powerful MUAs available, providing a consistent and intuitive interface across all platforms.
Boolean Miscellaneous Windows 95, Windows NT, Solaris http://www.xs4all.nl/~kholwerd/bool.html Freeware A GDSII CAD file format viewer, and program to perform boolean operations on sets of 2D polygons. By Klaas Holwerda.
TimeMan Miscellaneous wxGTK, Unix http://www.bgif.no/neureka/TimeMan/ Freeware A time manager, written using wxGTK
Forty Thieves Miscellaneous Motif, Windows apps/forty/forty.htm Freeware A fiendish patience game, by Chris Breeze. A nice demo of what's possible with wxWindows.
Lean Integration Platform Miscellaneous Windows NT, various flavours of UNIX http://www.c-lab.de/~lipuser/lip To be decided LIP is a workflow-oriented tool integration system which uses wxLisp (and thus wxWindows) as an implementation basis. Lisp combined with the wxWindows bindings make up the compatible extension language platform of the system.
wxWeb Miscellaneous Win 3.1, WIN32, Motif ftp://www.remstar.com/pub/wxwin/contrib/wxweb Freeware Andrew Davison's Web browser, with SimSock portable socket library and wxHtml canvas. Includes an http server for UNIX and Windows.
SANTIS Miscellaneous Win 3.1, Windows 95, Linux, Solaris OpenLook and Motif, Silicon Graphics http://www.physiology.rwth-aachen.de/bs/santis/ Free for non-commercial use SANTIS is a software tool designed for the analysis of signals and time series data of any kind, in particular for scientific purposes. It was developed at the Laboratory of Biomedical Systems Analysis, Institute of Physiology at the University of Aachen, Germany.
Xbaies Miscellaneous Win 3.1, WIN32, Motif, XView xbaies.htm Freeware A shell for building Bayesian network models, by Robert Cowell.
wxTinyBB Miscellaneous Win 3.1, WIN32, Motif, XView ftp://www.remstar.com/pub/wxwin/contrib/wxtinybb Freeware/commercial A tiny blackboard shell demo showing an embedded (commercial) Prolog engine. Demo written by Arvindra Sehmi. A good example of a nice interface using wxWindows.
Gambit Miscellaneous Win 3.1, WIN32, Motif, XView http://www.hss.caltech.edu/~gambit/Gambit.html Freeware A large wxWindows application with source, and features such as a table control with printing.
Tex2RTF Miscellaneous Win 3.1, WIN32, Motif, XView http://web.ukonline.co.uk/julian.smart/tex2rtf Freeware Converts subset of LaTeX syntax to WinHelp, wordprocessor RTF, HTML, and wxHelp. As used for wxWindows documentation.
wxPoem Miscellaneous Win 3.1, WIN32, Motif, XView none.htm Freeware A poetry display program for wxWindows. Included as a sample in the wxWindows distribution.
Sonar tracking software Miscellaneous See Web site http://www.desertstar.com Demonstration Miscellaneous sonar tracking software from Desert Star Systems, who use wxWindows for all their Windows-based software.
Name Research software Platform Location Availability Description
DisCo Research software N/A http://www.cs.tut.fi/laitos/DisCo/tool.fm.html N/A A tool for specification of reactive systems.
CAFE Research software N/A cafe.htm N/A Cellular Analysis of Fire and Extinction
CODA Research software See Web site http://www.ozemail.com.au/~mbedward/coda/coda.html See Web site CODA assists in the design of networks of nature reserves or protected areas. It has been used for major reserve planning studies, as a teaching resource and for research into conservation planning methods.<2E>
EGRESS Research software N/A http://www.aiai.ed.ac.uk/~jimd/Egress2/projInfo_contents.html N/A An evacuation decision model.
ACT Research software N/A none.htm N/A A general process and tracker and automator being built at NASA.
Rectangular nesting program Research software N/A http://www.elec-eng.leeds.ac.uk/een5mpd/research.html N/A Optimized layout of rectangles on a page.
Finite element post processor Research software N/A http://www.ime.auc.dk/afd3/odessy/manuals/index.htm N/A Finite element postprocessor, produced at Aalborg University in Denmark by John Rasmussen and Erik Lund.

BIN
wxPython/demo/mimetypes.wdr Normal file

Binary file not shown.

View File

@@ -0,0 +1,156 @@
#!/usr/env python
#-----------------------------------------------------------------------------
# Python source generated by wxDesigner from file: mimetypes.wdr
# Do not modify this file, all changes will be lost!
#-----------------------------------------------------------------------------
# Include wxWindows' modules
from wxPython.wx import *
# Window functions
ID_INPUT_TEXT = 10000
ID_EXTENSION_Btn = 10001
ID_MIME_BTN = 10002
ID_LOOKUP_BTN = 10003
ID_LINE = 10004
ID_TEXT = 10005
ID_ICON_BMP = 10006
ID_ICON_FILE_TXT = 10007
ID_ICON_INDEX_TXT = 10008
ID_MIME_TYPE_TXT = 10009
ID_MIME_TYPES_TXT = 10010
ID_EXTENSIONS_TXT = 10011
ID_DESCRIPTION_TXT = 10012
ID_OPEN_CMD_TXT = 10013
ID_PRINT_CMD_TXT = 10014
ID_ALL_CMDS_TXT = 10015
ID_LISTBOX = 10016
def MakeMimeTypesTestPanel( parent, call_fit = true, set_sizer = true ):
item0 = wxBoxSizer( wxVERTICAL )
item1 = wxBoxSizer( wxHORIZONTAL )
item2 = wxTextCtrl( parent, ID_INPUT_TEXT, "", wxDefaultPosition, wxSize(100,-1), 0 )
item1.AddWindow( item2, 0, wxALIGN_CENTRE|wxALL, 5 )
item3 = wxRadioButton( parent, ID_EXTENSION_Btn, "By extension", wxDefaultPosition, wxDefaultSize, wxRB_GROUP )
item3.SetValue( true )
item1.AddWindow( item3, 0, wxALIGN_CENTRE|wxALL, 5 )
item4 = wxRadioButton( parent, ID_MIME_BTN, "By mime type", wxDefaultPosition, wxDefaultSize, 0 )
item1.AddWindow( item4, 0, wxALIGN_CENTRE|wxALL, 5 )
item5 = wxButton( parent, ID_LOOKUP_BTN, "Lookup", wxDefaultPosition, wxDefaultSize, 0 )
item5.SetDefault()
item1.AddWindow( item5, 0, wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item6 = wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL )
item0.AddWindow( item6, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item7 = wxBoxSizer( wxHORIZONTAL )
item8 = wxFlexGridSizer( 0, 2, 0, 0 )
item8.AddGrowableCol( 1 )
item8.AddGrowableRow( 8 )
item9 = wxStaticText( parent, ID_TEXT, "wxFileType:", wxDefaultPosition, wxDefaultSize, 0 )
item9.SetFont( wxFont( 14, wxSWISS, wxNORMAL, wxBOLD ) )
item8.AddWindow( item9, 0, wxALL, 5 )
item8.AddSpacer( 20, 20, 0, wxALIGN_CENTRE|wxALL, 5 )
item10 = wxStaticText( parent, ID_TEXT, "GetIconInfo:", wxDefaultPosition, wxDefaultSize, 0 )
item8.AddWindow( item10, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item11 = wxBoxSizer( wxHORIZONTAL )
item12 = wxStaticBitmap( parent, ID_ICON_BMP, MyBitmapsFunc( 0 ), wxDefaultPosition, wxDefaultSize )
item11.AddWindow( item12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item13 = wxTextCtrl( parent, ID_ICON_FILE_TXT, "", wxDefaultPosition, wxSize(120,-1), wxTE_READONLY )
item11.AddWindow( item13, 1, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5 )
item14 = wxTextCtrl( parent, ID_ICON_INDEX_TXT, "", wxDefaultPosition, wxSize(30,-1), wxTE_READONLY )
item11.AddWindow( item14, 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5 )
item8.AddSizer( item11, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 )
item15 = wxStaticText( parent, ID_TEXT, "GetMimeType:", wxDefaultPosition, wxDefaultSize, 0 )
item8.AddWindow( item15, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 )
item16 = wxTextCtrl( parent, ID_MIME_TYPE_TXT, "", wxDefaultPosition, wxSize(310,-1), wxTE_READONLY )
item8.AddWindow( item16, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 )
item17 = wxStaticText( parent, ID_TEXT, "GetMimeTypes:", wxDefaultPosition, wxDefaultSize, 0 )
item8.AddWindow( item17, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 )
item18 = wxTextCtrl( parent, ID_MIME_TYPES_TXT, "", wxDefaultPosition, wxSize(80,-1), wxTE_READONLY )
item8.AddWindow( item18, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 )
item19 = wxStaticText( parent, ID_TEXT, "GetExtensions:", wxDefaultPosition, wxDefaultSize, 0 )
item8.AddWindow( item19, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 )
item20 = wxTextCtrl( parent, ID_EXTENSIONS_TXT, "", wxDefaultPosition, wxSize(80,-1), wxTE_READONLY )
item8.AddWindow( item20, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 )
item21 = wxStaticText( parent, ID_TEXT, "GetDescription:", wxDefaultPosition, wxDefaultSize, 0 )
item8.AddWindow( item21, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 )
item22 = wxTextCtrl( parent, ID_DESCRIPTION_TXT, "", wxDefaultPosition, wxSize(80,-1), wxTE_READONLY )
item8.AddWindow( item22, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 )
item23 = wxStaticText( parent, ID_TEXT, "GetOpenCommand:", wxDefaultPosition, wxDefaultSize, 0 )
item8.AddWindow( item23, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 )
item24 = wxTextCtrl( parent, ID_OPEN_CMD_TXT, "", wxDefaultPosition, wxSize(80,-1), wxTE_READONLY )
item8.AddWindow( item24, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 )
item25 = wxStaticText( parent, ID_TEXT, "GetPrintCommand:", wxDefaultPosition, wxDefaultSize, 0 )
item8.AddWindow( item25, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 )
item26 = wxTextCtrl( parent, ID_PRINT_CMD_TXT, "", wxDefaultPosition, wxSize(80,-1), wxTE_READONLY )
item8.AddWindow( item26, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 )
item27 = wxStaticText( parent, ID_TEXT, "GetAllCommands:", wxDefaultPosition, wxDefaultSize, 0 )
item8.AddWindow( item27, 0, wxALIGN_RIGHT|wxLEFT|wxRIGHT|wxBOTTOM, 5 )
item28 = wxTextCtrl( parent, ID_ALL_CMDS_TXT, "", wxDefaultPosition, wxSize(80,100), wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL )
item8.AddWindow( item28, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 )
item7.AddSizer( item8, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item29 = wxBoxSizer( wxVERTICAL )
item30 = wxStaticText( parent, ID_TEXT, "Known mime types:", wxDefaultPosition, wxDefaultSize, 0 )
item29.AddWindow( item30, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5 )
item31 = wxListBox( parent, ID_LISTBOX, wxDefaultPosition, wxSize(150,100), [], wxLB_SINGLE|wxLB_SORT|wxLB_HSCROLL )
item29.AddWindow( item31, 1, wxALIGN_CENTRE|wxRIGHT|wxBOTTOM, 5 )
item7.AddSizer( item29, 0, wxGROW|wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP|wxBOTTOM, 5 )
item0.AddSizer( item7, 1, wxGROW|wxALIGN_CENTER_VERTICAL, 5 )
if set_sizer == true:
parent.SetAutoLayout( true )
parent.SetSizer( item0 )
if call_fit == true:
item0.Fit( parent )
item0.SetSizeHints( parent )
return item0
# Menu bar functions
# Bitmap functions
def MyBitmapsFunc( index ):
if index == 0:
return wxImage( "mimetypes_wdr/MyBitmapsFunc_0.png", wxBITMAP_TYPE_PNG ).ConvertToBitmap()
return wxNullBitmap
# End of generated file

View File

@@ -0,0 +1,167 @@
import pprint, string
from wxPython.wx import *
from mimetypes_wdr import *
#----------------------------------------------------------------------------
# WDR: classes
class MimeTypesTestPanel(wxPanel):
def __init__(self, parent, id,
pos = wxPyDefaultPosition, size = wxPyDefaultSize,
style = wxTAB_TRAVERSAL ):
wxPanel.__init__(self, parent, id, pos, size, style)
MakeMimeTypesTestPanel( self, true )
# WDR: handler declarations for MimeTypesTestPanel
EVT_LISTBOX(self, ID_LISTBOX, self.OnListbox)
EVT_BUTTON(self, ID_LOOKUP_BTN, self.OnLookup)
self.GetInputText().SetValue("html")
self.OnLookup()
mimetypes = wxTheMimeTypesManager.EnumAllFileTypes()
for mt in mimetypes:
self.GetListbox().Append(mt)
# WDR: handler implementations for MimeTypesTestPanel
def OnListbox(self, event):
mimetype = event.GetString()
self.GetInputText().SetValue(mimetype)
self.GetMimeBtn().SetValue(TRUE)
self.GetExtensionBtn().SetValue(FALSE)
self.OnLookup()
def OnLookup(self, event=None):
txt = self.GetInputText().GetValue()
if self.GetMimeBtn().GetValue():
fileType = wxTheMimeTypesManager.GetFileTypeFromMimeType(txt)
msg = "Mime type"
else:
fileType = wxTheMimeTypesManager.GetFileTypeFromExtension(txt)
msg = "File extension"
if fileType is None:
wxMessageBox(msg + " not found.", "Oops!")
else:
self.Update(fileType)
def Update(self, ft):
#icon = ft.GetIcon()
info = ft.GetIconInfo()
if info is None:
bmp = MyBitmapsFunc(0)
##print bmp.Ok(), bmp.GetWidth(), bmp.GetHeight()
self.GetIconBmp().SetBitmap(bmp)
self.GetIconFileTxt().SetValue("")
self.GetIconIndexTxt().SetValue("")
else:
icon, file, idx = info
#bmp = wxBitmapFromIcon(icon)
#self.GetIconBmp().SetBitmap(bmp)
self.GetIconBmp().SetIcon(icon)
self.GetIconFileTxt().SetValue(file)
self.GetIconIndexTxt().SetValue(str(idx))
self.GetMimeTypeTxt().SetValue(str(ft.GetMimeType()))
self.GetMimeTypesTxt().SetValue(str(ft.GetMimeTypes()))
self.GetExtensionsTxt().SetValue(str(ft.GetExtensions()))
self.GetDescriptionTxt().SetValue(str(ft.GetDescription()))
ext = ft.GetExtensions()[0]
mime = ft.GetMimeType() or ""
cmd = ft.GetOpenCommand("SPAM" + ext, mime)
self.GetOpenCmdTxt().SetValue(str(cmd))
cmd = ft.GetPrintCommand("SPAM" + ext, mime)
self.GetPrintCmdTxt().SetValue(str(cmd))
all = ft.GetAllCommands("SPAM" + ext, mime)
if all is None:
self.GetAllCmdsTxt().SetValue("")
else:
verbs, commands = all
text = pprint.pformat(map(None, verbs, commands))
self.GetAllCmdsTxt().SetValue(text)
# WDR: methods for MimeTypesTestPanel
def GetListbox(self):
return wxPyTypeCast( self.FindWindowById(ID_LISTBOX), "wxListBox" )
def GetIconIndexTxt(self):
return self.FindWindowById(ID_ICON_INDEX_TXT)
def GetIconFileTxt(self):
return self.FindWindowById(ID_ICON_FILE_TXT)
def GetMimeBtn(self):
return self.FindWindowById(ID_MIME_BTN)
def GetExtensionBtn(self):
return self.FindWindowById(ID_EXTENSION_Btn)
def GetAllCmdsTxt(self):
return self.FindWindowById(ID_ALL_CMDS_TXT)
def GetPrintCmdTxt(self):
return self.FindWindowById(ID_PRINT_CMD_TXT)
def GetOpenCmdTxt(self):
return self.FindWindowById(ID_OPEN_CMD_TXT)
def GetDescriptionTxt(self):
return self.FindWindowById(ID_DESCRIPTION_TXT)
def GetExtensionsTxt(self):
return self.FindWindowById(ID_EXTENSIONS_TXT)
def GetMimeTypesTxt(self):
return self.FindWindowById(ID_MIME_TYPES_TXT)
def GetMimeTypeTxt(self):
return self.FindWindowById(ID_MIME_TYPE_TXT)
def GetIconBmp(self):
return self.FindWindowById(ID_ICON_BMP)
def GetInputText(self):
return self.FindWindowById(ID_INPUT_TEXT)
#----------------------------------------------------------------------
def runTest(frame, nb, log):
win = MimeTypesTestPanel(nb, -1)
return win
#----------------------------------------------------------------------
overview = """\
"""
import mimetypes_wdr
def MyBitmapsFunc( index ):
return wxImage( "bitmaps/noicon.png", wxBITMAP_TYPE_PNG ).ConvertToBitmap()
mimetypes_wdr.MyBitmapsFunc = MyBitmapsFunc

View File

@@ -313,10 +313,7 @@ public:
%addmethods {
PyObject* GetFilenames() {
const wxArrayString& strings = self->GetFilenames();
PyObject* list = PyList_New(0);
for (size_t x=0; x<strings.GetCount(); x++)
PyList_Append(list, PyString_FromString(strings[x]));
return list;
return wxArrayString2PyList_helper(strings);
}
}
#ifdef __WXMSW__
@@ -596,11 +593,7 @@ bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y,
const wxArrayString& filenames) {
bool rval = FALSE;
wxPyTState* state = wxPyBeginBlockThreads();
PyObject* list = PyList_New(0);
for (size_t i=0; i<filenames.GetCount(); i++) {
PyObject* str = PyString_FromString(filenames[i].c_str());
PyList_Append(list, str);
}
PyObject* list = wxArrayString2PyList_helper(filenames);
if (m_myInst.findCallback("OnDropFiles"))
rval = m_myInst.callCallback(Py_BuildValue("(iiO)",x,y,list));
Py_DECREF(list);

View File

@@ -117,25 +117,13 @@ public:
PyObject* GetFilenames() {
wxArrayString arr;
self->GetFilenames(arr);
size_t count = arr.GetCount();
PyObject* listObj = PyList_New(0);
for(size_t x=0; x<count; x++) {
PyObject* name = PyString_FromString(arr[x]);
PyList_Append(listObj, name);
}
return listObj;
return wxArrayString2PyList_helper(arr);
}
PyObject* GetPaths() {
wxArrayString arr;
self->GetPaths(arr);
size_t count = arr.GetCount();
PyObject* listObj = PyList_New(0);
for(size_t x=0; x<count; x++) {
PyObject* name = PyString_FromString(arr[x]);
PyList_Append(listObj, name);
}
return listObj;
return wxArrayString2PyList_helper(arr);
}
}
};

View File

@@ -1371,10 +1371,10 @@ public:
int horizontalAlignment = wxLEFT,
int verticalAlignment = wxTOP );
// Split a string containing newline chararcters into an array of
// strings and return the number of lines
//
void StringToLines( const wxString& value, wxArrayString& lines );
// // Split a string containing newline chararcters into an array of
// // strings and return the number of lines
// //
// void StringToLines( const wxString& value, wxArrayString& lines );
void GetTextBoxSize( wxDC& dc,
wxArrayString& lines,

View File

@@ -1297,6 +1297,19 @@ bool wxColour_helper(PyObject* source, wxColour** obj) {
//----------------------------------------------------------------------
PyObject* wxArrayString2PyList_helper(const wxArrayString& arr) {
PyObject* list = PyList_New(0);
for (size_t i=0; i < arr.GetCount(); i++) {
PyObject* str = PyString_FromString(arr[i].c_str());
PyList_Append(list, str);
// TODO: Check refcount on str...
}
return list;
}
//----------------------------------------------------------------------
//----------------------------------------------------------------------

View File

@@ -151,6 +151,11 @@ bool _2int_seq_helper(PyObject* source, int* i1, int* i2);
bool _4int_seq_helper(PyObject* source, int* i1, int* i2, int* i3, int* i4);
PyObject* wxArrayString2PyList_helper(const wxArrayString& app);
#define RETURN_NONE() { Py_INCREF(Py_None); return Py_None; }
//----------------------------------------------------------------------
#ifndef SWIGCODE

View File

@@ -30,6 +30,8 @@
#if wxUSE_WAVE || defined(__WXMSW__)
#include <wx/wave.h>
#endif
#include <wx/mimetype.h>
%}
//----------------------------------------------------------------------
@@ -357,18 +359,12 @@ public:
%addmethods {
PyObject* GetEncodings() {
wxArrayString* arr = self->GetEncodings();
PyObject* list = PyList_New(0);
for (size_t x=0; x<arr->GetCount(); x++)
PyList_Append(list, PyString_FromString((*arr)[x]));
return list;
return wxArrayString2PyList_helper(arr);
}
PyObject* GetFacenames() {
wxArrayString* arr = self->GetFacenames();
PyObject* list = PyList_New(0);
for (size_t x=0; x<arr->GetCount(); x++)
PyList_Append(list, PyString_FromString((*arr)[x]));
return list;
return wxArrayString2PyList_helper(arr);
}
}
};
@@ -514,6 +510,21 @@ public:
void Stop();
};
class wxStopWatch
{
public:
// ctor starts the stop watch
wxStopWatch();
void Start(long t = 0);
void Pause();
void Resume();
// get elapsed time since the last Start() or Pause() in milliseconds
long Time() const;
};
//----------------------------------------------------------------------
//----------------------------------------------------------------------
@@ -913,6 +924,359 @@ public:
%}
//----------------------------------------------------------------------
enum wxMailcapStyle
{
wxMAILCAP_STANDARD = 1,
wxMAILCAP_NETSCAPE = 2,
wxMAILCAP_KDE = 4,
wxMAILCAP_GNOME = 8,
wxMAILCAP_ALL = 15
};
class wxFileTypeInfo
{
public:
// ctors
// a normal item
wxFileTypeInfo(const char *mimeType,
const char *openCmd,
const char *printCmd,
const char *desc);
// the array elements correspond to the parameters of the ctor above in
// the same order
%name(wxFileTypeInfoSequence)wxFileTypeInfo(const wxArrayString& sArray);
// invalid item - use this to terminate the array passed to
// wxMimeTypesManager::AddFallbacks
%name(wxNullFileTypeInfo)wxFileTypeInfo();
// test if this object can be used
bool IsValid() const;
// setters
// set the icon info
void SetIcon(const wxString& iconFile, int iconIndex = 0);
// set the short desc
void SetShortDesc(const wxString& shortDesc);
// accessors
// get the MIME type
const wxString& GetMimeType() const;
// get the open command
const wxString& GetOpenCommand() const;
// get the print command
const wxString& GetPrintCommand() const;
// get the short description (only used under Win32 so far)
const wxString& GetShortDesc() const;
// get the long, user visible description
const wxString& GetDescription() const;
// get the array of all extensions
//const wxArrayString& GetExtensions() const;
%addmethods {
PyObject* GetExtensions() {
wxArrayString& arr = (wxArrayString&)self->GetExtensions();
return wxArrayString2PyList_helper(arr);
}
}
int GetExtensionsCount() const;
// get the icon info
const wxString& GetIconFile() const;
int GetIconIndex() const;
};
class wxFileType
{
public:
// TODO: Make a wxPyMessageParameters with virtual GetParamValue...
// An object of this class must be passed to Get{Open|Print}Command. The
// default implementation is trivial and doesn't know anything at all about
// parameters, only filename and MIME type are used (so it's probably ok for
// Windows where %{param} is not used anyhow)
class MessageParameters
{
public:
// ctors
MessageParameters(const wxString& filename=wxPyEmptyStr,
const wxString& mimetype=wxPyEmptyStr);
// accessors (called by GetOpenCommand)
// filename
const wxString& GetFileName() const;
// mime type
const wxString& GetMimeType() const;;
// override this function in derived class
virtual wxString GetParamValue(const wxString& name) const;
// virtual dtor as in any base class
virtual ~MessageParameters();
};
// ctor from static data
wxFileType(const wxFileTypeInfo& ftInfo);
// return the MIME type for this file type
%addmethods {
PyObject* GetMimeType() {
wxString str;
if (self->GetMimeType(&str))
return PyString_FromString(str.c_str());
else
RETURN_NONE();
}
PyObject* GetMimeTypes() {
wxArrayString arr;
if (self->GetMimeTypes(arr))
return wxArrayString2PyList_helper(arr);
else
RETURN_NONE();
}
}
// Get all extensions associated with this file type
%addmethods {
PyObject* GetExtensions() {
wxArrayString arr;
if (self->GetExtensions(arr))
return wxArrayString2PyList_helper(arr);
else
RETURN_NONE();
}
}
%addmethods {
// Get the icon corresponding to this file type
%new wxIcon* GetIcon() {
wxIcon icon;
if (self->GetIcon(&icon))
return new wxIcon(icon);
else
return NULL;
}
// Get the icon corresponding to this file type, the name of the file
// where this icon resides, and its index in this file if applicable.
PyObject* GetIconInfo() {
wxIcon icon;
wxString iconFile;
int iconIndex;
if (self->GetIcon(&icon, &iconFile, &iconIndex)) {
wxPyTState* state = wxPyBeginBlockThreads();
PyObject* tuple = PyTuple_New(3);
PyTuple_SetItem(tuple, 0, wxPyConstructObject(new wxIcon(icon),
"wxIcon", TRUE));
PyTuple_SetItem(tuple, 1, PyString_FromString(iconFile.c_str()));
PyTuple_SetItem(tuple, 2, PyInt_FromLong(iconIndex));
wxPyEndBlockThreads(state);
return tuple;
}
else
RETURN_NONE();
}
}
%addmethods {
// get a brief file type description ("*.txt" => "text document")
PyObject* GetDescription() {
wxString str;
if (self->GetDescription(&str))
return PyString_FromString(str.c_str());
else
RETURN_NONE();
}
}
// get the command to open/execute the file of given type
%addmethods {
PyObject* GetOpenCommand(const wxString& filename,
const wxString& mimetype=wxPyEmptyStr) {
wxString str;
if (self->GetOpenCommand(&str, wxFileType::MessageParameters(filename, mimetype)))
return PyString_FromString(str.c_str());
else
RETURN_NONE();
}
}
// get the command to print the file of given type
%addmethods {
PyObject* GetPrintCommand(const wxString& filename,
const wxString& mimetype=wxPyEmptyStr) {
wxString str;
if (self->GetPrintCommand(&str, wxFileType::MessageParameters(filename, mimetype)))
return PyString_FromString(str.c_str());
else
RETURN_NONE();
}
}
// Get all commands defined for this file type
%addmethods {
PyObject* GetAllCommands(const wxString& filename,
const wxString& mimetype=wxPyEmptyStr) {
wxArrayString verbs;
wxArrayString commands;
if (self->GetAllCommands(&verbs, &commands,
wxFileType::MessageParameters(filename, mimetype))) {
wxPyTState* state = wxPyBeginBlockThreads();
PyObject* tuple = PyTuple_New(2);
PyTuple_SetItem(tuple, 0, wxArrayString2PyList_helper(verbs));
PyTuple_SetItem(tuple, 1, wxArrayString2PyList_helper(commands));
wxPyEndBlockThreads(state);
return tuple;
}
else
RETURN_NONE();
}
}
// set an arbitrary command, ask confirmation if it already exists and
// overwriteprompt is TRUE
bool SetCommand(const wxString& cmd, const wxString& verb,
bool overwriteprompt = TRUE);
bool SetDefaultIcon(const wxString& cmd = wxEmptyString, int index = 0);
// remove the association for this filetype from the system MIME database:
// notice that it will only work if the association is defined in the user
// file/registry part, we will never modify the system-wide settings
bool Unassociate();
// operations
// expand a string in the format of GetOpenCommand (which may contain
// '%s' and '%t' format specificators for the file name and mime type
// and %{param} constructions).
static wxString ExpandCommand(const wxString& command,
const MessageParameters& params);
// dtor (not virtual, shouldn't be derived from)
~wxFileType();
};
class wxMimeTypesManager
{
public:
// static helper functions
// -----------------------
// check if the given MIME type is the same as the other one: the
// second argument may contain wildcards ('*'), but not the first. If
// the types are equal or if the mimeType matches wildcard the function
// returns TRUE, otherwise it returns FALSE
static bool IsOfType(const wxString& mimeType, const wxString& wildcard);
// ctor
wxMimeTypesManager();
// loads data from standard files according to the mailcap styles
// specified: this is a bitwise OR of wxMailcapStyle values
//
// use the extraDir parameter if you want to look for files in another
// directory
void Initialize(int mailcapStyle = wxMAILCAP_STANDARD,
const wxString& extraDir = wxEmptyString);
// and this function clears all the data from the manager
void ClearData();
// Database lookup: all functions return a pointer to wxFileType object
// whose methods may be used to query it for the information you're
// interested in. If the return value is !NULL, caller is responsible for
// deleting it.
// get file type from file extension
%new wxFileType *GetFileTypeFromExtension(const wxString& ext);
// get file type from MIME type (in format <category>/<format>)
%new wxFileType *GetFileTypeFromMimeType(const wxString& mimeType);
// other operations: return TRUE if there were no errors or FALSE if there
// were some unreckognized entries (the good entries are always read anyhow)
//
// read in additional file (the standard ones are read automatically)
// in mailcap format (see mimetype.cpp for description)
//
// 'fallback' parameter may be set to TRUE to avoid overriding the
// settings from other, previously parsed, files by this one: normally,
// the files read most recently would override the older files, but with
// fallback == TRUE this won't happen
bool ReadMailcap(const wxString& filename, bool fallback = FALSE);
// read in additional file in mime.types format
bool ReadMimeTypes(const wxString& filename);
// enumerate all known MIME types
%addmethods {
PyObject* EnumAllFileTypes() {
wxArrayString arr;
self->EnumAllFileTypes(arr);
return wxArrayString2PyList_helper(arr);
}
}
// these functions can be used to provide default values for some of the
// MIME types inside the program itself (you may also use
// ReadMailcap(filenameWithDefaultTypes, TRUE /* use as fallback */) to
// achieve the same goal, but this requires having this info in a file).
//
void AddFallback(const wxFileTypeInfo& ft);
// create or remove associations
// create a new association using the fields of wxFileTypeInfo (at least
// the MIME type and the extension should be set)
// if the other fields are empty, the existing values should be left alone
%new wxFileType *Associate(const wxFileTypeInfo& ftInfo);
// undo Associate()
bool Unassociate(wxFileType *ft) ;
// dtor (not virtual, shouldn't be derived from)
~wxMimeTypesManager();
};
%readonly
%{
#if 0
%}
extern wxMimeTypesManager* wxTheMimeTypesManager;
%{
#endif
%}
%readwrite
//----------------------------------------------------------------------
//----------------------------------------------------------------------

View File

@@ -294,11 +294,7 @@ bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y,
const wxArrayString& filenames) {
bool rval = FALSE;
wxPyTState* state = wxPyBeginBlockThreads();
PyObject* list = PyList_New(0);
for (size_t i=0; i<filenames.GetCount(); i++) {
PyObject* str = PyString_FromString(filenames[i].c_str());
PyList_Append(list, str);
}
PyObject* list = wxArrayString2PyList_helper(filenames);
if (m_myInst.findCallback("OnDropFiles"))
rval = m_myInst.callCallback(Py_BuildValue("(iiO)",x,y,list));
Py_DECREF(list);
@@ -1711,10 +1707,7 @@ static PyObject *_wrap_new_wxFileDataObject(PyObject *self, PyObject *args, PyOb
static PyObject * wxFileDataObject_GetFilenames(wxFileDataObject *self) {
const wxArrayString& strings = self->GetFilenames();
PyObject* list = PyList_New(0);
for (size_t x=0; x<strings.GetCount(); x++)
PyList_Append(list, PyString_FromString(strings[x]));
return list;
return wxArrayString2PyList_helper(strings);
}
static PyObject *_wrap_wxFileDataObject_GetFilenames(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;

View File

@@ -1470,13 +1470,7 @@ static PyObject *_wrap_wxFileDialog_ShowModal(PyObject *self, PyObject *args, Py
static PyObject * wxFileDialog_GetFilenames(wxFileDialog *self) {
wxArrayString arr;
self->GetFilenames(arr);
size_t count = arr.GetCount();
PyObject* listObj = PyList_New(0);
for(size_t x=0; x<count; x++) {
PyObject* name = PyString_FromString(arr[x]);
PyList_Append(listObj, name);
}
return listObj;
return wxArrayString2PyList_helper(arr);
}
static PyObject *_wrap_wxFileDialog_GetFilenames(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@@ -1510,13 +1504,7 @@ static PyObject *_wrap_wxFileDialog_GetFilenames(PyObject *self, PyObject *args,
static PyObject * wxFileDialog_GetPaths(wxFileDialog *self) {
wxArrayString arr;
self->GetPaths(arr);
size_t count = arr.GetCount();
PyObject* listObj = PyList_New(0);
for(size_t x=0; x<count; x++) {
PyObject* name = PyString_FromString(arr[x]);
PyList_Append(listObj, name);
}
return listObj;
return wxArrayString2PyList_helper(arr);
}
static PyObject *_wrap_wxFileDialog_GetPaths(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;

View File

@@ -1459,13 +1459,13 @@ static PyObject *_wrap_new_wxBitmap(PyObject *self, PyObject *args, PyObject *kw
PyObject * _resultobj;
wxBitmap * _result;
wxString * _arg0;
wxBitmapType _arg1;
wxBitmapType _arg1 = (wxBitmapType ) wxBITMAP_TYPE_BMP;
PyObject * _obj0 = 0;
char *_kwnames[] = { "name","type", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:new_wxBitmap",_kwnames,&_obj0,&_arg1))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:new_wxBitmap",_kwnames,&_obj0,&_arg1))
return NULL;
{
#if PYTHON_API_VERSION >= 1009
@@ -1609,13 +1609,13 @@ static PyObject *_wrap_wxBitmap_LoadFile(PyObject *self, PyObject *args, PyObjec
bool _result;
wxBitmap * _arg0;
wxString * _arg1;
long _arg2;
wxBitmapType _arg2 = (wxBitmapType ) wxBITMAP_TYPE_BMP;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","name","flags", NULL };
char *_kwnames[] = { "self","name","type", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOl:wxBitmap_LoadFile",_kwnames,&_argo0,&_obj1,&_arg2))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxBitmap_LoadFile",_kwnames,&_argo0,&_obj1,&_arg2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -1662,7 +1662,7 @@ static PyObject *_wrap_wxBitmap_SaveFile(PyObject *self, PyObject *args, PyObjec
bool _result;
wxBitmap * _arg0;
wxString * _arg1;
int _arg2;
wxBitmapType _arg2;
wxPalette * _arg3 = (wxPalette *) NULL;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;

View File

@@ -7822,67 +7822,6 @@ static PyObject *_wrap_wxGrid_DrawTextRectangle(PyObject *self, PyObject *args,
return _resultobj;
}
#define wxGrid_StringToLines(_swigobj,_swigarg0,_swigarg1) (_swigobj->StringToLines(_swigarg0,_swigarg1))
static PyObject *_wrap_wxGrid_StringToLines(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGrid * _arg0;
wxString * _arg1;
wxArrayString * _arg2;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo2 = 0;
char *_kwnames[] = { "self","value","lines", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxGrid_StringToLines",_kwnames,&_argo0,&_obj1,&_argo2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGrid_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGrid_StringToLines. Expected _wxGrid_p.");
return NULL;
}
}
{
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
return NULL;
_arg1 = new wxString(tmpPtr, tmpSize);
#else
if (!PyString_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
return NULL;
}
_arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1));
#endif
}
if (_argo2) {
if (_argo2 == Py_None) { _arg2 = NULL; }
else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxArrayString_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxGrid_StringToLines. Expected _wxArrayString_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGrid_StringToLines(_arg0,*_arg1,*_arg2);
wxPy_END_ALLOW_THREADS;
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
{
if (_obj1)
delete _arg1;
}
return _resultobj;
}
#define wxGrid_GetTextBoxSize(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->GetTextBoxSize(_swigarg0,_swigarg1,_swigarg2,_swigarg3))
static PyObject *_wrap_wxGrid_GetTextBoxSize(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@@ -7895,7 +7834,7 @@ static PyObject *_wrap_wxGrid_GetTextBoxSize(PyObject *self, PyObject *args, PyO
long temp0;
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
PyObject * _argo2 = 0;
PyObject * _obj2 = 0;
char *_kwnames[] = { "self","dc","lines", NULL };
self = self;
@@ -7905,7 +7844,7 @@ static PyObject *_wrap_wxGrid_GetTextBoxSize(PyObject *self, PyObject *args, PyO
{
_arg4 = &temp0;
}
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxGrid_GetTextBoxSize",_kwnames,&_argo0,&_argo1,&_argo2))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxGrid_GetTextBoxSize",_kwnames,&_argo0,&_argo1,&_obj2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -7921,13 +7860,21 @@ static PyObject *_wrap_wxGrid_GetTextBoxSize(PyObject *self, PyObject *args, PyO
return NULL;
}
}
if (_argo2) {
if (_argo2 == Py_None) { _arg2 = NULL; }
else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxArrayString_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxGrid_GetTextBoxSize. Expected _wxArrayString_p.");
{
if (! PySequence_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, "Sequence of strings expected.");
return NULL;
}
}
_arg2 = new wxArrayString;
int i, len=PySequence_Length(_obj2);
for (i=0; i<len; i++) {
PyObject* item = PySequence_GetItem(_obj2, i);
PyObject* str = PyObject_Str(item);
_arg2->Add(PyString_AsString(item));
Py_DECREF(item);
Py_DECREF(str);
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGrid_GetTextBoxSize(_arg0,*_arg1,*_arg2,_arg3,_arg4);
@@ -7945,6 +7892,10 @@ static PyObject *_wrap_wxGrid_GetTextBoxSize(PyObject *self, PyObject *args, PyO
PyObject *o;
o = PyInt_FromLong((long) (*_arg4));
_resultobj = t_output_helper(_resultobj, o);
}
{
if (_obj2)
delete _arg2;
}
return _resultobj;
}
@@ -14175,7 +14126,6 @@ static PyMethodDef gridcMethods[] = {
{ "wxGrid_EndBatch", (PyCFunction) _wrap_wxGrid_EndBatch, METH_VARARGS | METH_KEYWORDS },
{ "wxGrid_BeginBatch", (PyCFunction) _wrap_wxGrid_BeginBatch, METH_VARARGS | METH_KEYWORDS },
{ "wxGrid_GetTextBoxSize", (PyCFunction) _wrap_wxGrid_GetTextBoxSize, METH_VARARGS | METH_KEYWORDS },
{ "wxGrid_StringToLines", (PyCFunction) _wrap_wxGrid_StringToLines, METH_VARARGS | METH_KEYWORDS },
{ "wxGrid_DrawTextRectangle", (PyCFunction) _wrap_wxGrid_DrawTextRectangle, METH_VARARGS | METH_KEYWORDS },
{ "wxGrid_DrawCellHighlight", (PyCFunction) _wrap_wxGrid_DrawCellHighlight, METH_VARARGS | METH_KEYWORDS },
{ "wxGrid_DeleteCols", (PyCFunction) _wrap_wxGrid_DeleteCols, METH_VARARGS | METH_KEYWORDS },

View File

@@ -958,9 +958,6 @@ class wxGridPtr(wxScrolledWindowPtr):
def DrawTextRectangle(self, *_args, **_kwargs):
val = apply(gridc.wxGrid_DrawTextRectangle,(self,) + _args, _kwargs)
return val
def StringToLines(self, *_args, **_kwargs):
val = apply(gridc.wxGrid_StringToLines,(self,) + _args, _kwargs)
return val
def GetTextBoxSize(self, *_args, **_kwargs):
val = apply(gridc.wxGrid_GetTextBoxSize,(self,) + _args, _kwargs)
return val

File diff suppressed because it is too large Load Diff

View File

@@ -313,6 +313,32 @@ class wxPyTimer(wxPyTimerPtr):
class wxStopWatchPtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def Start(self, *_args, **_kwargs):
val = apply(misc2c.wxStopWatch_Start,(self,) + _args, _kwargs)
return val
def Pause(self, *_args, **_kwargs):
val = apply(misc2c.wxStopWatch_Pause,(self,) + _args, _kwargs)
return val
def Resume(self, *_args, **_kwargs):
val = apply(misc2c.wxStopWatch_Resume,(self,) + _args, _kwargs)
return val
def Time(self, *_args, **_kwargs):
val = apply(misc2c.wxStopWatch_Time,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxStopWatch instance at %s>" % (self.this,)
class wxStopWatch(wxStopWatchPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(misc2c.new_wxStopWatch,_args,_kwargs)
self.thisown = 1
class wxLogPtr :
def __init__(self,this):
self.this = this
@@ -726,6 +752,170 @@ class wxWave(wxWavePtr):
class wxFileTypeInfoPtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def IsValid(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_IsValid,(self,) + _args, _kwargs)
return val
def SetIcon(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_SetIcon,(self,) + _args, _kwargs)
return val
def SetShortDesc(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_SetShortDesc,(self,) + _args, _kwargs)
return val
def GetMimeType(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetMimeType,(self,) + _args, _kwargs)
return val
def GetOpenCommand(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetOpenCommand,(self,) + _args, _kwargs)
return val
def GetPrintCommand(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetPrintCommand,(self,) + _args, _kwargs)
return val
def GetShortDesc(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetShortDesc,(self,) + _args, _kwargs)
return val
def GetDescription(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetDescription,(self,) + _args, _kwargs)
return val
def GetExtensions(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetExtensions,(self,) + _args, _kwargs)
return val
def GetExtensionsCount(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetExtensionsCount,(self,) + _args, _kwargs)
return val
def GetIconFile(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetIconFile,(self,) + _args, _kwargs)
return val
def GetIconIndex(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetIconIndex,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxFileTypeInfo instance at %s>" % (self.this,)
class wxFileTypeInfo(wxFileTypeInfoPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(misc2c.new_wxFileTypeInfo,_args,_kwargs)
self.thisown = 1
def wxFileTypeInfoSequence(*_args,**_kwargs):
val = wxFileTypeInfoPtr(apply(misc2c.new_wxFileTypeInfoSequence,_args,_kwargs))
val.thisown = 1
return val
def wxNullFileTypeInfo(*_args,**_kwargs):
val = wxFileTypeInfoPtr(apply(misc2c.new_wxNullFileTypeInfo,_args,_kwargs))
val.thisown = 1
return val
class wxFileTypePtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def GetMimeType(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetMimeType,(self,) + _args, _kwargs)
return val
def GetMimeTypes(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetMimeTypes,(self,) + _args, _kwargs)
return val
def GetExtensions(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetExtensions,(self,) + _args, _kwargs)
return val
def GetIcon(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetIcon,(self,) + _args, _kwargs)
if val: val = wxIconPtr(val) ; val.thisown = 1
return val
def GetIconInfo(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetIconInfo,(self,) + _args, _kwargs)
return val
def GetDescription(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetDescription,(self,) + _args, _kwargs)
return val
def GetOpenCommand(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetOpenCommand,(self,) + _args, _kwargs)
return val
def GetPrintCommand(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetPrintCommand,(self,) + _args, _kwargs)
return val
def GetAllCommands(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetAllCommands,(self,) + _args, _kwargs)
return val
def SetCommand(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_SetCommand,(self,) + _args, _kwargs)
return val
def SetDefaultIcon(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_SetDefaultIcon,(self,) + _args, _kwargs)
return val
def Unassociate(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_Unassociate,(self,) + _args, _kwargs)
return val
def __del__(self,misc2c=misc2c):
if self.thisown == 1 :
misc2c.delete_wxFileType(self)
def __repr__(self):
return "<C wxFileType instance at %s>" % (self.this,)
class wxFileType(wxFileTypePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(misc2c.new_wxFileType,_args,_kwargs)
self.thisown = 1
class wxMimeTypesManagerPtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def Initialize(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_Initialize,(self,) + _args, _kwargs)
return val
def ClearData(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_ClearData,(self,) + _args, _kwargs)
return val
def GetFileTypeFromExtension(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_GetFileTypeFromExtension,(self,) + _args, _kwargs)
if val: val = wxFileTypePtr(val) ; val.thisown = 1
return val
def GetFileTypeFromMimeType(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_GetFileTypeFromMimeType,(self,) + _args, _kwargs)
if val: val = wxFileTypePtr(val) ; val.thisown = 1
return val
def ReadMailcap(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_ReadMailcap,(self,) + _args, _kwargs)
return val
def ReadMimeTypes(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_ReadMimeTypes,(self,) + _args, _kwargs)
return val
def EnumAllFileTypes(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_EnumAllFileTypes,(self,) + _args, _kwargs)
return val
def AddFallback(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_AddFallback,(self,) + _args, _kwargs)
return val
def Associate(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_Associate,(self,) + _args, _kwargs)
if val: val = wxFileTypePtr(val) ; val.thisown = 1
return val
def Unassociate(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_Unassociate,(self,) + _args, _kwargs)
return val
def __del__(self,misc2c=misc2c):
if self.thisown == 1 :
misc2c.delete_wxMimeTypesManager(self)
def __repr__(self):
return "<C wxMimeTypesManager instance at %s>" % (self.this,)
class wxMimeTypesManager(wxMimeTypesManagerPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(misc2c.new_wxMimeTypesManager,_args,_kwargs)
self.thisown = 1
#-------------- FUNCTION WRAPPERS ------------------
@@ -935,6 +1125,10 @@ wxLog_GetTraceMask = misc2c.wxLog_GetTraceMask
wxLog_IsAllowedTraceMask = misc2c.wxLog_IsAllowedTraceMask
wxFileType_ExpandCommand = misc2c.wxFileType_ExpandCommand
wxMimeTypesManager_IsOfType = misc2c.wxMimeTypesManager_IsOfType
#-------------- VARIABLE WRAPPERS ------------------
@@ -1036,3 +1230,10 @@ wxLOG_Trace = misc2c.wxLOG_Trace
wxLOG_Progress = misc2c.wxLOG_Progress
wxLOG_User = misc2c.wxLOG_User
wxEVT_END_PROCESS = misc2c.wxEVT_END_PROCESS
wxMAILCAP_STANDARD = misc2c.wxMAILCAP_STANDARD
wxMAILCAP_NETSCAPE = misc2c.wxMAILCAP_NETSCAPE
wxMAILCAP_KDE = misc2c.wxMAILCAP_KDE
wxMAILCAP_GNOME = misc2c.wxMAILCAP_GNOME
wxMAILCAP_ALL = misc2c.wxMAILCAP_ALL
cvar = misc2c.cvar
wxTheMimeTypesManager = wxMimeTypesManagerPtr(misc2c.cvar.wxTheMimeTypesManager)

View File

@@ -58,7 +58,9 @@ extern PyObject *SWIG_newvarlink(void);
#include "helpers.h"
#include <wx/sashwin.h>
#include <wx/laywin.h>
#ifndef __WXMAC__
#include <wx/popupwin.h>
#endif
static PyObject* t_output_helper(PyObject* target, PyObject* o) {

View File

@@ -269,6 +269,29 @@
return NULL;
}
//---------------------------------------------------------------------------
// Typemap for wxArrayString from Python sequence objects
%typemap(python,in) wxArrayString& {
if (! PySequence_Check($source)) {
PyErr_SetString(PyExc_TypeError, "Sequence of strings expected.");
return NULL;
}
$target = new wxArrayString;
int i, len=PySequence_Length($source);
for (i=0; i<len; i++) {
PyObject* item = PySequence_GetItem($source, i);
PyObject* str = PyObject_Str(item);
$target->Add(PyString_AsString(item));
Py_DECREF(item);
Py_DECREF(str);
}
}
%typemap(python, freearg) wxArrayString& {
if ($target)
delete $source;
}
//---------------------------------------------------------------------------
// Map T_OUTPUTs for floats to return ints.