Add wx.TextEntryDialog and wx.PasswordEntryDialog

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@72351 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2012-08-16 00:45:37 +00:00
parent 5b964d9f8b
commit a546e29c18
5 changed files with 93 additions and 22 deletions

View File

@@ -128,21 +128,19 @@ other dev stuff
* Add ETG scripts for these items in _core:
* PseudoDC (not actually an ETG script, probably a .sip)
* access
* dialup ??
* docmdi ??
* docview ??
* msgout
* palette ?
* persist ?
* quantize
* rawbmp
* richmsgdlg (requires wrappers for wxGenericMessageDialog)
* textdlg
* valgen
* valnum
* valtext
* valgen (No. It could probably be reimplemented in Python easier than wrapping)
* valnum (No. Ditto)
* valtext (No. Ditto. It works by using a pointer to long-lived wxString object.)
* vlbox
* dialup ??
* docmdi ??
* docview ??
* palette ??
* persist ??
* Add a _msw module that will contain classes and such that are only
available in the Windows port:
@@ -150,6 +148,7 @@ other dev stuff
* axbase (ActiveX.)
* wxCHMHelpController
* metafile
* access
* Any others?
* Add _grid module

View File

@@ -317,7 +317,6 @@ NotificationMessage :class:`adv.Notific
NullFileTypeInfo ``MISSING``
NumberEntryDialog ``MISSING``
Panel_GetClassDefaultAttributes :meth:`Panel.GetClassDefaultAttributes <Window.GetClassDefaultAttributes>`
PasswordEntryDialog ``MISSING``
PCXHandler ``MISSING``
PixelDataBase ``MISSING``
PlatformInformation_GetOperatingSystemDirectory :meth:`PlatformInfo.GetOperatingSystemDirectory`
@@ -448,6 +447,7 @@ RadioButton_GetClassDefaultAttributes :meth:`RadioButton.
RectPP :class:`Rect`
RectPS :class:`Rect`
RectS :class:`Rect`
Rect.OffsetXY :meth:`Rect.Offset`
RegionFromBitmap :class:`Region`
RegionFromBitmapColour :class:`Region`
RegionFromPoints :class:`Region`
@@ -527,7 +527,6 @@ TextCtrl_GetClassDefaultAttributes :meth:`TextCtrl.Get
TextCtrlBase ``MISSING``
TextCtrlIface ``MISSING``
TextEntryBase ``MISSING``
TextEntryDialog ``MISSING``
TextUrlEvent ``MISSING``
TGAHandler ``MISSING``
Thread_IsMain :meth:`IsMainThread`
@@ -622,7 +621,7 @@ GetDeviceOriginTuple :meth:`~DC.GetDevic
GetImpl ``MISSING``
GetLogicalOriginTuple :meth:`~DC.GetLogicalOrigin`
GetMultiLineTextExtent :meth:`~DC.GetFullMultiLineTextExtent`
GetOptimization ``MISSING``
GetOptimization ``REMOVED``
GetPixelPoint :meth:`~DC.GetPixel`
GetResolution ``MISSING``
GetSizeMMTuple :meth:`~DC.GetSizeMM`
@@ -632,7 +631,7 @@ SetClippingRegionAsRegion :meth:`~DC.SetClipp
SetClippingRegionPointSize :meth:`~DC.SetClippingRegion`
SetDeviceOriginPoint :meth:`~DC.SetDeviceOrigin`
SetLogicalOriginPoint :meth:`~DC.SetLogicalOrigin`
SetOptimization ``MISSING``
SetOptimization ``REMOVED``
StretchBlitPointSize :meth:`~DC.StretchBlit`
=========================================================== ===========================================================
@@ -708,14 +707,6 @@ ShowItems ``MISSING``
=========================================================== ===========================================================
Miscellaneous Modifications
---------------------------
=========================================================== ===========================================================
`Classic` Name `Phoenix` Name
=========================================================== ===========================================================
Rect.OffsetXY :meth:`Rect.Offset`
=========================================================== ===========================================================

View File

@@ -188,6 +188,7 @@ INCLUDES = [ # base and core stuff
'fontdlg',
'rearrangectrl',
'minifram',
'textdlg',
# misc
'power',

56
etg/textdlg.py Normal file
View File

@@ -0,0 +1,56 @@
#---------------------------------------------------------------------------
# Name: etg/textdlg.py
# Author: Robin Dunn
#
# Created: 10-Aug-2012
# Copyright: (c) 2012 by Total Control Software
# License: wxWindows License
#---------------------------------------------------------------------------
import etgtools
import etgtools.tweaker_tools as tools
PACKAGE = "wx"
MODULE = "_core"
NAME = "textdlg" # Base name of the file to generate to for this script
DOCSTRING = ""
# The classes and/or the basename of the Doxygen XML files to be processed by
# this script.
ITEMS = [ "wxTextEntryDialog",
"wxPasswordEntryDialog",
]
#---------------------------------------------------------------------------
def run():
# Parse the XML file(s) building a collection of Extractor objects
module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING)
etgtools.parseDoxyXML(module, ITEMS)
#-----------------------------------------------------------------
# Tweak the parsed meta objects in the module object as needed for
# customizing the generated code and docstrings.
module.addHeaderCode("#include <wx/textdlg.h>")
module.find('wxGetTextFromUserPromptStr').type = 'const char*'
module.find('wxGetPasswordFromUserPromptStr').type = 'const char*'
c = module.find('wxTextEntryDialog')
assert isinstance(c, etgtools.ClassDef)
tools.fixTopLevelWindowClass(c)
c = module.find('wxPasswordEntryDialog')
tools.fixTopLevelWindowClass(c)
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)
#---------------------------------------------------------------------------
if __name__ == '__main__':
run()

24
unittests/test_textdlg.py Normal file
View File

@@ -0,0 +1,24 @@
import imp_unittest, unittest
import wtc
import wx
#---------------------------------------------------------------------------
class textdlg_Tests(wtc.WidgetTestCase):
def test_textdlg1(self):
dlg = wx.TextEntryDialog(None, "Message", "Caption", "Value")
dlg.SetValue("Hello")
self.assertEqual(dlg.Value, "Hello")
dlg.Destroy()
def test_textdlg2(self):
dlg = wx.PasswordEntryDialog(None, "Message", "Caption", "Value")
dlg.SetValue("Hello")
self.assertEqual(dlg.Value, "Hello")
dlg.Destroy()
#---------------------------------------------------------------------------
if __name__ == '__main__':
unittest.main()