Changeset 743 for moxy/trunk/src


Ignore:
Timestamp:
Dec 26, 2011 1:21:12 AM (13 years ago)
Author:
jemian
Message:

now working on axis configure dialog

Location:
moxy/trunk/src/moxy
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified moxy/trunk/src/moxy/vc_axis.py

    r742 r743  
    2525from m_pv import PvConnection
    2626from m_axis import SingleAxis
     27from vc_axis_configure import AxisConfigure_Dialog
    2728
    2829
     
    5859
    5960    def OnExit(self):
    60         print "OnExit", self.axis
     61        #print "OnExit", self.axis
    6162        self.axis.disconnect()
    6263
     
    6768    '''
    6869    def __init__(self, parent, axis): #@ReservedAssignment
    69         wx.Frame.__init__(self, parent, wx.ID_ANY, 'DemoView', size=(200,300))
     70        self.axis = axis
     71        wx.Frame.__init__(self, parent, wx.ID_ANY, 'DemoView', size=(240,300))
    7072        self.SetToolTipString(u'Single Axis DemoFrame')
    7173        self.panel = SingleAxisPanel(parent=self, axis=axis)
     
    7981        dlg.Destroy()
    8082        if result == wx.ID_OK:
    81             # TODO: here is where to disconnect() the PVs, need "axis" above
    82                         # see: http://wiki.wxpython.org/wxPython%20by%20Example
    83                         # see: http://docs.wxwidgets.org/stable/wx_wxdialog.html
     83            self.axis.disconnect()
    8484            self.Destroy()
    8585
     
    9898        self.connected = False
    9999        self.show_buttons = show_buttons
     100        self.parent = parent
    100101
    101102        wx.Panel.__init__(self, id=wx.ID_ANY, parent=parent)
     
    229230    def doConfigureButton(self, event):
    230231        '''run dialog to configure the EPICS PVs of this axis'''
    231         print "Configure pressed - feature not enabled yet"    # TODO: unfinished
     232        modal = AxisConfigure_Dialog(self.parent, self.axis)
     233        modal.ShowModal()
     234        modal.Destroy()
    232235
    233236    def doConnnectButton(self, event):
  • TabularUnified moxy/trunk/src/moxy/vc_pv.py

    r741 r743  
    6363       
    6464        self._init_widgets()
     65        self.Bind(wx.EVT_CLOSE, self.OnClose)
    6566
    6667    def _init_widgets(self):
     
    234235            wx.CallAfter(self.w_value.SetBackgroundColour, color)
    235236
     237    def OnClose(self, event):
     238        dlg = wx.MessageDialog(self,
     239            "Do you really want to close this application?",
     240            "Confirm Exit", wx.OK|wx.CANCEL|wx.ICON_QUESTION)
     241        result = dlg.ShowModal()
     242        dlg.Destroy()
     243        if result == wx.ID_OK:
     244            if self.pv is not None:
     245                self.pv.disconnect()
     246            self.Destroy()
     247
    236248
    237249
Note: See TracChangeset for help on using the changeset viewer.