# Path: janus_event_PushButton.py
# class event_PushButton( QPushButton ) :
# 
# 
# 	#-----------------------------------------------------------------------
# 	# DEFINE THE INITIALIZATION FUNCTION.
# 	#-----------------------------------------------------------------------
# 
# 	def __init__( self, owner, fnc, lab='' ) :
# 
# 
# 		# Inherit all attributes of an instance of "QPushButton".
# 
# 		super( event_PushButton, self ).__init__( lab )
# 
# 
# 		# Store the user-provided instance of the initializing object.
# 
# 		self.owner = owner
# 
# 
# 		# Store the string indicating the function of this button.
# 
# 		self.fnc = fnc
# 
# 
# 	#-----------------------------------------------------------------------
# 	# (RE)DEFINE THE FUNCTION FOR RESPONDING TO MOUSE CLICKS.
# 	#-----------------------------------------------------------------------
# 
# 	def mousePressEvent( self, event ) :
# 
# 
# 		# Deligate the handling of the mouse-click event to
# 		# "self.owner", providing it with the details of the event and
# 		# also the string identifying the function of this button.
# 
# 		self.owner.user_event( event, self.fnc )
# 
# 
# 	#-----------------------------------------------------------------------
# 	# (RE)DEFINE THE FUNCTION FOR RESPONDING TO KEY PRESSES.
# 	#-----------------------------------------------------------------------
# 
# 	def keyPressEvent( self, event ) :
# 
# 
# 		# If the "Enter" or "Return" key was pressed, interpret this as
# 		# an event and deligate handling thereof to "self.owner".
# 
# 		if ( ( event.key( ) == Qt.Key_Enter  ) or
# 		     ( event.key( ) == Qt.Key_Return )    ) :
# 
# 			self.owner.user_event( event, self.fnc )


from PyQt4.QtGui import QDialog, QGridLayout, QLabel
from janus_event_PushButton import event_PushButton
	#-----------------------------------------------------------------------

	def __init__( self ) :

		# Inherit all attributes of an instance of "QDialog".

		super( dialog_save, self ).__init__( )

		# Make this a modal dialog (i.e., block user-interaction with
		# the main application window while this dialog exists).

		self.setModal( True )

		# Set the title of this dialog window.

		self.setWindowTitle( 'Save?' )

		# Give this widget a grid layout, "self.grd".

		self.grd = QGridLayout( )

		self.grd.setContentsMargins( 6, 6, 6, 6 )

		self.setLayout( self.grd )

		# Initialize the label and buttons that comprise this dialog
		# box.

		self.lab = QLabel( 'Save analysis results before exit?' )


# Path: janus_event_PushButton.py
# class event_PushButton( QPushButton ) :
# 
# 
# 	#-----------------------------------------------------------------------
# 	# DEFINE THE INITIALIZATION FUNCTION.
# 	#-----------------------------------------------------------------------
# 
# 	def __init__( self, owner, fnc, lab='' ) :
# 
# 
# 		# Inherit all attributes of an instance of "QPushButton".
# 
# 		super( event_PushButton, self ).__init__( lab )
# 
# 
# 		# Store the user-provided instance of the initializing object.
# 
# 		self.owner = owner
# 
# 
# 		# Store the string indicating the function of this button.
# 
# 		self.fnc = fnc
# 
# 
# 	#-----------------------------------------------------------------------
# 	# (RE)DEFINE THE FUNCTION FOR RESPONDING TO MOUSE CLICKS.
# 	#-----------------------------------------------------------------------
# 
# 	def mousePressEvent( self, event ) :
# 
# 
# 		# Deligate the handling of the mouse-click event to
# 		# "self.owner", providing it with the details of the event and
# 		# also the string identifying the function of this button.
# 
# 		self.owner.user_event( event, self.fnc )
# 
# 
# 	#-----------------------------------------------------------------------
# 	# (RE)DEFINE THE FUNCTION FOR RESPONDING TO KEY PRESSES.
# 	#-----------------------------------------------------------------------
# 
# 	def keyPressEvent( self, event ) :
# 
# 
# 		# If the "Enter" or "Return" key was pressed, interpret this as
# 		# an event and deligate handling thereof to "self.owner".
# 
# 		if ( ( event.key( ) == Qt.Key_Enter  ) or
# 		     ( event.key( ) == Qt.Key_Return )    ) :
# 
# 			self.owner.user_event( event, self.fnc )


# Path: janus_dialog_save.py
from PyQt4.QtGui import QDialog, QGridLayout, QLabel
from janus_event_PushButton import event_PushButton

	#-----------------------------------------------------------------------

	def __init__( self ) :

		# Inherit all attributes of an instance of "QDialog".

		super( dialog_save, self ).__init__( )

		# Make this a modal dialog (i.e., block user-interaction with
		# the main application window while this dialog exists).

		self.setModal( True )

		# Set the title of this dialog window.

		self.setWindowTitle( 'Save?' )

		# Give this widget a grid layout, "self.grd".

		self.grd = QGridLayout( )

		self.grd.setContentsMargins( 6, 6, 6, 6 )

		self.setLayout( self.grd )

		# Initialize the label and buttons that comprise this dialog
		# box.

		self.lab = QLabel( 'Save analysis results before exit?' )


		self.btn_save = event_PushButton( self, 'save', 'Save'    )