1
# Copyright (c) 2007, Enthought, Inc.
4
""" Demo showing how to use the Windows specific Internet Explorer editor.
8
from traitsui.wx.extra.windows.ie_html_editor \
12
import Str, List, Button, HasTraits
15
import View, VGroup, HGroup, Item, TextEditor, ListEditor
18
class WebPage ( HasTraits ):
21
url = Str( 'http://code.enthought.com' )
29
# The browser navigation buttons:
30
back = Button( '<--' )
31
forward = Button( '-->' )
32
home = Button( 'Home' )
33
stop = Button( 'Stop' )
34
refresh = Button( 'Refresh' )
35
search = Button( 'Search' )
37
# The view to display:
39
HGroup( 'back', 'forward', 'home', 'stop', 'refresh', 'search', '_',
40
Item( 'status', style = 'readonly' ),
45
editor = IEHTMLEditor(
46
home = 'home', back = 'back',
47
forward = 'forward', stop = 'stop',
48
refresh = 'refresh', search = 'search',
49
title = 'title', status = 'status' )
54
class InternetExplorerDemo ( HasTraits ):
57
url = Str( 'http://' )
59
# The list of web pages being browsed:
60
pages = List( WebPage )
62
# The view to display:
67
editor = TextEditor( auto_set = False, enter_set = True )
73
editor = ListEditor( use_notebook = True,
76
export = 'DockWindowShell',
77
page_name = '.title' )
82
def _url_changed ( self, url ):
83
self.pages.append( WebPage( url = url.strip() ) )
86
demo = InternetExplorerDemo(
87
pages = [ WebPage(url='http://code.enthought.com/projects/traits/'),
88
WebPage(url='http://dmorrill.com') ] )
90
# Run the demo (if invoked from the command line):
91
if __name__ == '__main__':
92
demo.configure_traits()