Changeset 9572
- Timestamp:
- 09/22/09 11:00:16 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/branches/deepanns/tools/wavedash/src/WavedashView.py
r9570 r9572 74 74 75 75 76 self.Set MinSize(OSSIE_WAVEAPP_DIMENSION)76 self.SetSize(OSSIE_WAVEAPP_DIMENSION) 77 77 #self.SetMaxSize((800,800)) 78 78 … … 170 170 171 171 for component in componentList: 172 cPanel = self.createComponentPanel(wPanel,component )172 cPanel = self.createComponentPanel(wPanel,component, preview) 173 173 wSizer.Add(cPanel, 0, wx.ALIGN_LEFT | wx.GROW, 10) 174 174 … … 183 183 return wPanel 184 184 185 def createComponentPanel(self, wPanel, component ):185 def createComponentPanel(self, wPanel, component, preview = False): 186 186 cPanel = wx.Panel(wPanel, -1, name=component.getName()) 187 187 sbox = wx.StaticBox(cPanel, -1, component.getName()) … … 207 207 pWindow.Hide() 208 208 209 if preview is True: 210 #Don't allow any manipulation on properties in Preview form. 211 pWindow.Enable(False) 212 209 213 #Create a popup menu for this property 210 214 self.attachPopupMenuToProp(wPanel, pWindow, property) … … 215 219 #Find the type of event corresponding to the window in use 216 220 if windowType is wx.TextCtrl or windowType is wx.SpinCtrl: 217 eventType = wx.EVT_KILL_FOCUS 221 pWindow.Bind(wx.EVT_TEXT_ENTER, self.OnPropValueChanged, pWindow) 222 pWindow.Bind(wx.EVT_KILL_FOCUS, self.OnPropValueChanged, pWindow) 218 223 elif windowType is wx.Slider: 219 eventType = wx.EVT_COMMAND_SCROLL224 pWindow.Bind(wx.EVT_COMMAND_SCROLL, self.OnPropValueChanged, pWindow) 220 225 elif windowType is wx.CheckBox: 221 eventType = wx.EVT_CHECKBOX 222 223 pWindow.Bind(eventType, self.OnPropValueChanged, pWindow) 226 pWindow.Bind(wx.EVT_CHECKBOX, self.OnPropValueChanged, pWindow) 227 224 228 #checkbox has a label associated with itself. so no need to add separate label 225 229 if pWindow.__class__ is wx.CheckBox: … … 450 454 451 455 if widgetType == "text": 452 window = wx.TextCtrl(parent, -1, str(pValue) )456 window = wx.TextCtrl(parent, -1, str(pValue), style = wx.TE_PROCESS_ENTER) 453 457 elif widgetType == "spin": 454 458 minV, maxV = property.getRange() 455 window = wx.SpinCtrl(parent, -1, str(pValue), min = minV, max = maxV )459 window = wx.SpinCtrl(parent, -1, str(pValue), min = minV, max = maxV, style = wx.TE_PROCESS_ENTER) 456 460 elif widgetType == "slider": 457 461 minV, maxV = property.getRange() … … 460 464 elif widget.parameters["style"] == "VERTICAL": 461 465 styleV = wx.SL_VERTICAL | wx.SL_LABELS 462 window = wx.Slider(parent, -1, int(pValue), minValue = minV, maxValue = maxV, style = styleV, size=(120,3 0))466 window = wx.Slider(parent, -1, int(pValue), minValue = minV, maxValue = maxV, style = styleV, size=(120,35)) 463 467 elif widgetType == "checkbox": 464 468 window = wx.CheckBox(parent, -1, property.getName()) … … 485 489 #or select a different waveform. 486 490 if wform is None: 487 #if event triggered as a result of object destroy, no need to update the value. Just return 491 #if event triggered as a result of object destroy or from Waveform Preview Dialog 492 #then no need to update the value. Just return 488 493 return 489 494 … … 666 671 title = 'Preview - ' + wformName 667 672 668 previewDlg = wx.Dialog(self, -1, title, OSSIE_WAVEAPP_DIMENSION) 669 wPanel = self.createWaveformPanel(previewDlg, waveform, preview = True) 670 wPanel.Enable(False) 673 previewFrame = wx.Frame(self, -1, title, OSSIE_WAVEAPP_DIMENSION) 674 wPanel = self.createWaveformPanel(previewFrame, waveform, preview = True) 671 675 wPanel.Show() 672 previewDlg.SetSize(wPanel.GetSize()) 673 #viewFrame.Show() 674 try: 675 previewDlg.ShowModal() 676 finally: 677 previewDlg.Destroy() 676 previewFrame.Show() 678 677 break 679 678