/[eiffelstudio]/branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_pretty_print_cmd.e
ViewVC logotype

Annotation of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_pretty_print_cmd.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 26913 - (hide annotations)
Sun Aug 12 23:50:20 2001 UTC (18 years, 5 months ago) by manus
Original Path: trunk/Src/bench/Eiffel/interface/new_graphical/commands/eb_pretty_print_cmd.e
File size: 3681 byte(s)
Merged branch `dev46_manu' to the trunc.

1 manus 26913 indexing
2     description: "Command that allows the user to have a nicer display for his object value %
3     %especially strings."
4     author: "Xavier Rousselot"
5     date: "$Date$"
6     revision: "$Revision$"
7    
8     class
9     EB_PRETTY_PRINT_CMD
10    
11     inherit
12     EB_TOOLBARABLE_AND_MENUABLE_COMMAND
13     redefine
14     mini_pixmap,
15     new_mini_toolbar_item
16     end
17    
18     EB_CONSTANTS
19    
20     create
21     make
22    
23     feature {NONE} -- Initialization
24    
25     make (a_tool: EB_OBJECT_TOOL) is
26     -- Initialize `Current' and associate it with `a_tool'.
27     do
28     tool := a_tool
29     create opened_dialogs.make (5)
30     end
31    
32     feature -- Access
33    
34     mini_pixmap: ARRAY [EV_PIXMAP] is
35     -- 8*8 pixmaps representing `Current'.
36     do
37     Result := Pixmaps.Icon_pretty_print_vsmall
38     end
39    
40     tooltip: STRING is
41     -- Tooltip for Current.
42     do
43     Result := Interface_names.e_Pretty_print
44     end
45    
46     description: STRING is
47     -- Tooltip for Current.
48     do
49     Result := Interface_names.e_Pretty_print
50     end
51    
52     name: STRING is
53     -- Tooltip for Current.
54     do
55     Result := "Pretty_print"
56     end
57    
58     pixmap: ARRAY [EV_PIXMAP] is
59     -- No big pixmap is necessary.
60     do
61    
62     end
63    
64     menu_name: STRING is
65     -- Menu name for `Current'.
66     do
67     Result := Interface_names.m_Pretty_print
68     end
69    
70     new_mini_toolbar_item: EB_COMMAND_TOOL_BAR_BUTTON is
71     -- Create a new mini toolbar button for this command.
72     do
73     Result := Precursor
74     Result.drop_actions.extend (~on_stone_dropped)
75     end
76    
77     feature -- Measurement
78    
79     feature -- Status report
80    
81     associated_window: EV_WINDOW is
82     -- Window to which the child dialogs will be modeless to.
83     do
84     Result := tool.debugger_manager.debugging_window.window
85     end
86    
87     feature -- Status setting
88    
89     feature -- Cursor movement
90    
91     feature -- Element change
92    
93     feature -- Removal
94    
95     feature -- Resizing
96    
97     feature -- Transformation
98    
99     feature -- Conversion
100    
101     feature -- Duplication
102    
103     feature -- Miscellaneous
104    
105     feature -- Basic operations
106    
107     execute is
108     -- Launch `Current' as a command.
109     -- Pop up a new empty dialog.
110     do
111     pop_up_new_dialog
112     end
113    
114     refresh is
115     -- Update the state of all dialogs.
116     do
117     from
118     opened_dialogs.start
119     until
120     opened_dialogs.after
121     loop
122     opened_dialogs.item.refresh
123     opened_dialogs.forth
124     end
125     end
126    
127     end_debug is
128     -- A debug session ended. We free the resources.
129     do
130     from
131     opened_dialogs.start
132     until
133     opened_dialogs.after
134     loop
135     --| No need to call `forth', `destroy' removes the items automatically.
136     opened_dialogs.item.destroy
137     end
138     end
139    
140     feature -- Obsolete
141    
142     feature -- Inapplicable
143    
144     feature {EB_PRETTY_PRINT_DIALOG} -- Dialog
145    
146     remove_dialog (d: EB_PRETTY_PRINT_DIALOG) is
147     -- Remove `d' from the list of displayed dialogs.
148     require
149     is_now_destroyed: d.is_destroyed
150     do
151     opened_dialogs.start
152     opened_dialogs.prune_all (d)
153     ensure
154     is_no_longer_known: not opened_dialogs.has (d)
155     end
156    
157     feature {EB_PRETTY_PRINT_DIALOG} -- Implementation
158    
159     tool: EB_OBJECT_TOOL
160     -- Object tool `Current' is linked with.
161    
162     feature {NONE} -- Implementation
163    
164     on_stone_dropped (st: OBJECT_STONE) is
165     -- An object was dropped on the button, display it.
166     do
167     pop_up_new_dialog
168     last_opened_dialog.set_stone (st)
169     end
170    
171     opened_dialogs: ARRAYED_LIST [EB_PRETTY_PRINT_DIALOG]
172     -- All pretty print dialogs that are appear on the screen (linked to `Current').
173    
174     pop_up_new_dialog is
175     -- Create and display a new pretty print dialog.
176     local
177     nd: EB_PRETTY_PRINT_DIALOG
178     do
179     create nd.make (Current)
180     opened_dialogs.extend (nd)
181     last_opened_dialog := nd
182     nd.raise
183     ensure
184     added_a_dialog: opened_dialogs.count = (old opened_dialogs.count) + 1
185     end
186    
187     last_opened_dialog: EB_PRETTY_PRINT_DIALOG
188     -- The last dialog that `Current' opened.
189    
190     end -- class EB_PRETTY_PRINT_CMD

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23