X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a3fbed81b2165fddbbf2ee7eddd6089b62db3692..96e5ef7631307ebd9b0e4c51ceaeb68e36569f56:/wxPython/src/msw/wx.py diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index 39b9db97e5..781cc2ca5b 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -15,6 +15,8 @@ from events import * from streams import * +from utils import * + from mdi import * from frames import * @@ -38,8 +40,6 @@ from printfw import * from sizers import * from filesys import * - -from utils import * class wxPyAppPtr(wxEvtHandlerPtr): def __init__(self,this): self.this = this @@ -179,6 +179,7 @@ wxUSER_COLOURS = wxc.wxUSER_COLOURS wxNO_3D = wxc.wxNO_3D wxTAB_TRAVERSAL = wxc.wxTAB_TRAVERSAL wxWANTS_CHARS = wxc.wxWANTS_CHARS +wxPOPUP_WINDOW = wxc.wxPOPUP_WINDOW wxHORIZONTAL = wxc.wxHORIZONTAL wxVERTICAL = wxc.wxVERTICAL wxBOTH = wxc.wxBOTH @@ -244,15 +245,20 @@ wxLB_OWNERDRAW = wxc.wxLB_OWNERDRAW wxLB_HSCROLL = wxc.wxLB_HSCROLL wxPROCESS_ENTER = wxc.wxPROCESS_ENTER wxPASSWORD = wxc.wxPASSWORD -wxTE_PROCESS_ENTER = wxc.wxTE_PROCESS_ENTER -wxTE_PROCESS_TAB = wxc.wxTE_PROCESS_TAB -wxTE_PASSWORD = wxc.wxTE_PASSWORD wxTE_READONLY = wxc.wxTE_READONLY -wxTE_RICH = wxc.wxTE_RICH wxTE_MULTILINE = wxc.wxTE_MULTILINE -wxTE_AUTO_SCROLL = wxc.wxTE_AUTO_SCROLL +wxTE_PROCESS_TAB = wxc.wxTE_PROCESS_TAB +wxTE_RICH = wxc.wxTE_RICH +wxTE_RICH2 = wxc.wxTE_RICH2 wxTE_NO_VSCROLL = wxc.wxTE_NO_VSCROLL +wxTE_AUTO_SCROLL = wxc.wxTE_AUTO_SCROLL +wxTE_PROCESS_ENTER = wxc.wxTE_PROCESS_ENTER +wxTE_PASSWORD = wxc.wxTE_PASSWORD wxTE_AUTO_URL = wxc.wxTE_AUTO_URL +wxTE_NOHIDESEL = wxc.wxTE_NOHIDESEL +wxTE_DONTWRAP = wxc.wxTE_DONTWRAP +wxTE_LINEWRAP = wxc.wxTE_LINEWRAP +wxTE_WORDWRAP = wxc.wxTE_WORDWRAP wxCB_SIMPLE = wxc.wxCB_SIMPLE wxCB_DROPDOWN = wxc.wxCB_DROPDOWN wxCB_SORT = wxc.wxCB_SORT @@ -355,6 +361,7 @@ wxID_HELP_CONTENTS = wxc.wxID_HELP_CONTENTS wxID_HELP_COMMANDS = wxc.wxID_HELP_COMMANDS wxID_HELP_PROCEDURES = wxc.wxID_HELP_PROCEDURES wxID_HELP_CONTEXT = wxc.wxID_HELP_CONTEXT +wxID_CLOSE_ALL = wxc.wxID_CLOSE_ALL wxID_CUT = wxc.wxID_CUT wxID_COPY = wxc.wxID_COPY wxID_PASTE = wxc.wxID_PASTE @@ -424,8 +431,6 @@ wxNB_BOTTOM = wxc.wxNB_BOTTOM wxNB_MULTILINE = wxc.wxNB_MULTILINE wxLI_HORIZONTAL = wxc.wxLI_HORIZONTAL wxLI_VERTICAL = wxc.wxLI_VERTICAL -wxHW_SCROLLBAR_NEVER = wxc.wxHW_SCROLLBAR_NEVER -wxHW_SCROLLBAR_AUTO = wxc.wxHW_SCROLLBAR_AUTO wxJOYSTICK1 = wxc.wxJOYSTICK1 wxJOYSTICK2 = wxc.wxJOYSTICK2 wxJOY_BUTTON1 = wxc.wxJOY_BUTTON1 @@ -434,6 +439,26 @@ wxJOY_BUTTON3 = wxc.wxJOY_BUTTON3 wxJOY_BUTTON4 = wxc.wxJOY_BUTTON4 wxJOY_BUTTON_ANY = wxc.wxJOY_BUTTON_ANY wxWS_EX_VALIDATE_RECURSIVELY = wxc.wxWS_EX_VALIDATE_RECURSIVELY +wxWS_EX_BLOCK_EVENTS = wxc.wxWS_EX_BLOCK_EVENTS +wxWS_EX_TRANSIENT = wxc.wxWS_EX_TRANSIENT +wxMM_TEXT = wxc.wxMM_TEXT +wxMM_LOMETRIC = wxc.wxMM_LOMETRIC +wxMM_HIMETRIC = wxc.wxMM_HIMETRIC +wxMM_LOENGLISH = wxc.wxMM_LOENGLISH +wxMM_HIENGLISH = wxc.wxMM_HIENGLISH +wxMM_TWIPS = wxc.wxMM_TWIPS +wxMM_ISOTROPIC = wxc.wxMM_ISOTROPIC +wxMM_ANISOTROPIC = wxc.wxMM_ANISOTROPIC +wxMM_POINTS = wxc.wxMM_POINTS +wxMM_METRIC = wxc.wxMM_METRIC +wxBORDER_DEFAULT = wxc.wxBORDER_DEFAULT +wxBORDER_NONE = wxc.wxBORDER_NONE +wxBORDER_STATIC = wxc.wxBORDER_STATIC +wxBORDER_SIMPLE = wxc.wxBORDER_SIMPLE +wxBORDER_RAISED = wxc.wxBORDER_RAISED +wxBORDER_SUNKEN = wxc.wxBORDER_SUNKEN +wxBORDER_DOUBLE = wxc.wxBORDER_DOUBLE +wxBORDER_MASK = wxc.wxBORDER_MASK wxDEFAULT = wxc.wxDEFAULT wxDECORATIVE = wxc.wxDECORATIVE wxROMAN = wxc.wxROMAN @@ -497,6 +522,7 @@ WXK_CANCEL = wxc.WXK_CANCEL WXK_MBUTTON = wxc.WXK_MBUTTON WXK_CLEAR = wxc.WXK_CLEAR WXK_SHIFT = wxc.WXK_SHIFT +WXK_ALT = wxc.WXK_ALT WXK_CONTROL = wxc.WXK_CONTROL WXK_MENU = wxc.WXK_MENU WXK_PAUSE = wxc.WXK_PAUSE @@ -559,6 +585,33 @@ WXK_NUMLOCK = wxc.WXK_NUMLOCK WXK_SCROLL = wxc.WXK_SCROLL WXK_PAGEUP = wxc.WXK_PAGEUP WXK_PAGEDOWN = wxc.WXK_PAGEDOWN +WXK_NUMPAD_SPACE = wxc.WXK_NUMPAD_SPACE +WXK_NUMPAD_TAB = wxc.WXK_NUMPAD_TAB +WXK_NUMPAD_ENTER = wxc.WXK_NUMPAD_ENTER +WXK_NUMPAD_F1 = wxc.WXK_NUMPAD_F1 +WXK_NUMPAD_F2 = wxc.WXK_NUMPAD_F2 +WXK_NUMPAD_F3 = wxc.WXK_NUMPAD_F3 +WXK_NUMPAD_F4 = wxc.WXK_NUMPAD_F4 +WXK_NUMPAD_HOME = wxc.WXK_NUMPAD_HOME +WXK_NUMPAD_LEFT = wxc.WXK_NUMPAD_LEFT +WXK_NUMPAD_UP = wxc.WXK_NUMPAD_UP +WXK_NUMPAD_RIGHT = wxc.WXK_NUMPAD_RIGHT +WXK_NUMPAD_DOWN = wxc.WXK_NUMPAD_DOWN +WXK_NUMPAD_PRIOR = wxc.WXK_NUMPAD_PRIOR +WXK_NUMPAD_PAGEUP = wxc.WXK_NUMPAD_PAGEUP +WXK_NUMPAD_NEXT = wxc.WXK_NUMPAD_NEXT +WXK_NUMPAD_PAGEDOWN = wxc.WXK_NUMPAD_PAGEDOWN +WXK_NUMPAD_END = wxc.WXK_NUMPAD_END +WXK_NUMPAD_BEGIN = wxc.WXK_NUMPAD_BEGIN +WXK_NUMPAD_INSERT = wxc.WXK_NUMPAD_INSERT +WXK_NUMPAD_DELETE = wxc.WXK_NUMPAD_DELETE +WXK_NUMPAD_EQUAL = wxc.WXK_NUMPAD_EQUAL +WXK_NUMPAD_MULTIPLY = wxc.WXK_NUMPAD_MULTIPLY +WXK_NUMPAD_ADD = wxc.WXK_NUMPAD_ADD +WXK_NUMPAD_SEPARATOR = wxc.WXK_NUMPAD_SEPARATOR +WXK_NUMPAD_SUBTRACT = wxc.WXK_NUMPAD_SUBTRACT +WXK_NUMPAD_DECIMAL = wxc.WXK_NUMPAD_DECIMAL +WXK_NUMPAD_DIVIDE = wxc.WXK_NUMPAD_DIVIDE wxBITMAP_TYPE_INVALID = wxc.wxBITMAP_TYPE_INVALID wxBITMAP_TYPE_BMP = wxc.wxBITMAP_TYPE_BMP wxBITMAP_TYPE_BMP_RESOURCE = wxc.wxBITMAP_TYPE_BMP_RESOURCE @@ -587,6 +640,8 @@ wxBITMAP_TYPE_PICT = wxc.wxBITMAP_TYPE_PICT wxBITMAP_TYPE_PICT_RESOURCE = wxc.wxBITMAP_TYPE_PICT_RESOURCE wxBITMAP_TYPE_ICON = wxc.wxBITMAP_TYPE_ICON wxBITMAP_TYPE_ICON_RESOURCE = wxc.wxBITMAP_TYPE_ICON_RESOURCE +wxBITMAP_TYPE_ANI = wxc.wxBITMAP_TYPE_ANI +wxBITMAP_TYPE_IFF = wxc.wxBITMAP_TYPE_IFF wxBITMAP_TYPE_MACCURSOR = wxc.wxBITMAP_TYPE_MACCURSOR wxBITMAP_TYPE_MACCURSOR_RESOURCE = wxc.wxBITMAP_TYPE_MACCURSOR_RESOURCE wxBITMAP_TYPE_ANY = wxc.wxBITMAP_TYPE_ANY @@ -689,6 +744,22 @@ wxPAPER_A3_EXTRA_TRANSVERSE = wxc.wxPAPER_A3_EXTRA_TRANSVERSE wxDUPLEX_SIMPLEX = wxc.wxDUPLEX_SIMPLEX wxDUPLEX_HORIZONTAL = wxc.wxDUPLEX_HORIZONTAL wxDUPLEX_VERTICAL = wxc.wxDUPLEX_VERTICAL +wxHT_NOWHERE = wxc.wxHT_NOWHERE +wxHT_SCROLLBAR_FIRST = wxc.wxHT_SCROLLBAR_FIRST +wxHT_SCROLLBAR_ARROW_LINE_1 = wxc.wxHT_SCROLLBAR_ARROW_LINE_1 +wxHT_SCROLLBAR_ARROW_LINE_2 = wxc.wxHT_SCROLLBAR_ARROW_LINE_2 +wxHT_SCROLLBAR_ARROW_PAGE_1 = wxc.wxHT_SCROLLBAR_ARROW_PAGE_1 +wxHT_SCROLLBAR_ARROW_PAGE_2 = wxc.wxHT_SCROLLBAR_ARROW_PAGE_2 +wxHT_SCROLLBAR_THUMB = wxc.wxHT_SCROLLBAR_THUMB +wxHT_SCROLLBAR_BAR_1 = wxc.wxHT_SCROLLBAR_BAR_1 +wxHT_SCROLLBAR_BAR_2 = wxc.wxHT_SCROLLBAR_BAR_2 +wxHT_SCROLLBAR_LAST = wxc.wxHT_SCROLLBAR_LAST +wxHT_WINDOW_OUTSIDE = wxc.wxHT_WINDOW_OUTSIDE +wxHT_WINDOW_INSIDE = wxc.wxHT_WINDOW_INSIDE +wxHT_WINDOW_VERT_SCROLLBAR = wxc.wxHT_WINDOW_VERT_SCROLLBAR +wxHT_WINDOW_HORZ_SCROLLBAR = wxc.wxHT_WINDOW_HORZ_SCROLLBAR +wxHT_WINDOW_CORNER = wxc.wxHT_WINDOW_CORNER +wxHT_MAX = wxc.wxHT_MAX FALSE = wxc.FALSE false = wxc.false TRUE = wxc.TRUE @@ -719,6 +790,7 @@ wxEVT_COMMAND_TOOL_RCLICKED = wxc.wxEVT_COMMAND_TOOL_RCLICKED wxEVT_COMMAND_TOOL_ENTER = wxc.wxEVT_COMMAND_TOOL_ENTER wxEVT_SET_FOCUS = wxc.wxEVT_SET_FOCUS wxEVT_KILL_FOCUS = wxc.wxEVT_KILL_FOCUS +wxEVT_CHILD_FOCUS = wxc.wxEVT_CHILD_FOCUS wxEVT_MOUSEWHEEL = wxc.wxEVT_MOUSEWHEEL wxEVT_LEFT_DOWN = wxc.wxEVT_LEFT_DOWN wxEVT_LEFT_UP = wxc.wxEVT_LEFT_UP @@ -826,7 +898,6 @@ wxDefaultSize = wxSizePtr(wxc.cvar.wxDefaultSize) # Author: Robin Dunn # # Created: 6/30/97 -# RCS-ID: $Id$ # Copyright: (c) 1998 by Total Control Software # Licence: wxWindows license #---------------------------------------------------------------------------- @@ -895,6 +966,9 @@ def EVT_SET_FOCUS(win, func): def EVT_KILL_FOCUS(win, func): win.Connect(-1, -1, wxEVT_KILL_FOCUS, func) +def EVT_CHILD_FOCUS(win, func): + win.Connect(-1, -1, wxEVT_CHILD_FOCUS, func) + def EVT_ACTIVATE(win, func): win.Connect(-1, -1, wxEVT_ACTIVATE, func) @@ -1388,33 +1462,33 @@ class wxTimer(wxPyTimer): wxPyTimer.__init__(self, None) self.SetOwner(evtHandler, id) -#---------------------------------------------------------------------- - -NULL = None # For backwards compatibility only. You should really be - # using None now. - - #---------------------------------------------------------------------- # aliases wxColor = wxColour wxNamedColor = wxNamedColour +wxPen = wxPyPen +wxScrollbar = wxScrollBar # backwards compatibility wxNoRefBitmap = wxBitmap wxPyDefaultPosition = wxDefaultPosition wxPyDefaultSize = wxDefaultSize - +NULL = None +wxSystemSettings_GetSystemColour = wxSystemSettings_GetColour +wxSystemSettings_GetSystemFont = wxSystemSettings_GetFont +wxSystemSettings_GetSystemMetric = wxSystemSettings_GetMetric #---------------------------------------------------------------------- # wxGTK sets the locale when initialized. Doing this at the Python # level should set it up to match what GTK is doing at the C level. -try: - import locale - locale.setlocale(locale.LC_ALL, "") -except: - pass +if wxPlatform == "__WXGTK__": + try: + import locale + locale.setlocale(locale.LC_ALL, "") + except: + pass @@ -1457,7 +1531,8 @@ def wxPyTypeCast(obj, typeStr): theClass = globals()[typeStr+"Ptr"] typeStr = __wxPyPtrTypeMap.get(typeStr, typeStr) if hasattr(obj, "this"): - if obj.__class__ is theClass: # if already the right type then just return it + # if already the right type then just return it + if isinstance(obj, theClass) or obj.__class__ is theClass: return obj newPtr = ptrcast(obj.this, typeStr+"_p") else: