root/trunk/RBSkinning/RBSkinning/wxPythonSkin/activex.py

Revision 508, 2.8 kB (checked in by gwm, 6 years ago)

*** empty log message ***

Line 
1 #!/usr/bin/env python
2 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 ##~ License
4 ##~
5 ##- The RuneBlade Foundation library is intended to ease some
6 ##- aspects of writing intricate Jabber, XML, and User Interface (wxPython, etc.)
7 ##- applications, while providing the flexibility to modularly change the
8 ##- architecture. Enjoy.
9 ##~
10 ##~ Copyright (C) 2002  TechGame Networks, LLC.
11 ##~
12 ##~ This library is free software; you can redistribute it and/or
13 ##~ modify it under the terms of the BSD style License as found in the
14 ##~ LICENSE file included with this distribution.
15 ##~
16 ##~ TechGame Networks, LLC can be reached at:
17 ##~ 3578 E. Hartsel Drive #211
18 ##~ Colorado Springs, Colorado, USA, 80920
19 ##~
20 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21
22 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 #~ Imports
24 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25
26 from wxSkinLayoutObject import wx, wxSkinLayoutObject
27 from RBSkinning.wxTools.wxActiveXWrapper import wxActiveXControlFactory, winGetAXControlCoClass, winGetAXControlModule
28
29 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30 #~ Class
31 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32
33 class activex(wxSkinLayoutObject):
34     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35     #~ Constants / Variables / Etc.
36     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37
38     default_settings = wxSkinLayoutObject.default_settings.copy()
39     default_settings.update({
40         'name': __name__,
41
42         #'progid': None,
43         #'clsid': None,
44
45         'eventClasses': 'tuple()',
46         'eventObj': 'None',
47         })
48
49     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50     #~ Public
51     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52
53     def SkinInitialize(self):
54         CoClass = self.GetAXControlCoClass()
55
56         # Prepare to make the ActiveX class that we can instantiate
57         kwAXSettings = self.wxSettingDict(['eventClasses', 'eventObj'], [])
58         ActiveXClass = wxActiveXControlFactory(CoClass, **kwAXSettings)
59
60         # Find the necessary things to instantiate the ActiveX control
61         winParent = self.wxGetParentObject(wx.wxWindowPtr)
62         kwSettings = self.wxSettingDict(['wxid', 'style', 'pos', 'size'], [])
63
64         # Make the ActiveX Control Instance!
65         self.object = ActiveXClass(winParent, **kwSettings)
66
67         # Do our standard wxPythonSkin thing
68         self.wxInitialStandardOptions()
69
70     def SkinFinalize(self):
71         self.wxFinalStandardOptions()
72
73     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74
75     def GetAXControlCoClass(self):
76         ClassIndex = self.settings.get('progid', None) or self.settings['clsid']
77         return winGetAXControlCoClass(ClassIndex)
78
79     def GetAXControlModule(self):
80         ClassIndex = self.settings.get('progid', None) or self.settings['clsid']
81         return winGetAXControlModule(ClassIndex)
Note: See TracBrowser for help on using the browser.