Package speakeasy :: Module buttonSetPopupSelector_ui :: Class ButtonSetPopupSelector
[hide private]
[frames] | no frames]

Class ButtonSetPopupSelector

source code

python_qt_binding.QtGui.QDialog --+
                                  |
                                 ButtonSetPopupSelector

An interactive dialog that displays successive sets of buttons. When each set is displayed, user may ask for the next available set, the previous. already seen set, or the user may accept the currently displayed set. A cancel is available as well.

The call and return protocol is as follows:

Instance Methods [hide private]
 
__init__(self, buttonProgramArrayIterator) source code
int
exec_(self)
If the prior initialization revealed that the caller does not deliver any sets of button labels at all, then return -1, without displaying any dialog.
source code
[ButtonProgram]
getCurrentlyShowingSet(self)
Returns an array of ButtonProgram instances that are currently showing on the dialog, or were showing when the user clicked OK.
source code
[string]
getCurrentlyShowingSetLabels(self)
Returns an array of labels of buttons that are currently showing on the dialog, or were showing when the user clicked OK.
source code
 
offerNewButtonSet(self)
Responsible for displaying the next, or previous set of buttons.
source code
 
setButtonSetTitleInWindow(self, buttonSetIndex)
Given a button set number, displays a help text in the 'pick button set' dialog.
source code
 
flipNextPrevDirection(self)
Called when no more button label sets are available either in the next, or previous direction.
source code
 
clearDialogPane(self)
Cleans out the dialog's layout.
source code
 
buildButtonSet(self, buttonLabelArray)
Constructs one set of buttons, based on passed in button labels.
source code
 
addChoiceButtons(self, layout)
Appends the existing Next/Previous/Cancel/OK buttons into the passed-in layout.
source code
 
setNextPrevButtonsEnabledness(self)
Examines the instance variables <code>shownLabelArrays</code> and </code>currentlyShowingSetIndex</code> to determine whether the Next or Previous buttons should be enabled.
source code
 
enableActionButton(self, buttonObj) source code
 
disableActionButton(self, buttonObj) source code
 
clickedNextButton(self)
Handler for Next button clicks.
source code
 
clickedPrevButton(self)
Handler for Next button clicks.
source code
 
clickedCancelButton(self) source code
 
clickedOKButton(self) source code
 
terminateWithWarning(self)
Called when no button sets are available from the caller at all.
source code
Method Details [hide private]

exec_(self)

source code 

If the prior initialization revealed that the caller does not deliver any sets of button labels at all, then return -1, without displaying any dialog.

Returns: int
-1 if no button sets available. 1 if user accepted one of the button label sets as the one they want, or 0, if the user cancelled.

getCurrentlyShowingSet(self)

source code 

Returns an array of ButtonProgram instances that are currently showing on the dialog, or were showing when the user clicked OK.

Returns: [ButtonProgram]
Array of ButtonProgram instances.

getCurrentlyShowingSetLabels(self)

source code 

Returns an array of labels of buttons that are currently showing on the dialog, or were showing when the user clicked OK.

Returns: [string]
Array of labels.

offerNewButtonSet(self)

source code 

Responsible for displaying the next, or previous set of buttons. During successive calls to this method, the method obtains new button label sets from the caller's iterator until the iterator is exhausted. The sets are collected in <code>self.shownLabelArrays</code>. The method is also responsible for showing previously shown sets again. The direction is controlled by the handlers of the Previous and Next buttons. They set instance variable <code>currentNextPrevDirection</code>.

setButtonSetTitleInWindow(self, buttonSetIndex)

source code 

Given a button set number, displays a help text in the 'pick button set' dialog.

Parameters:
  • buttonSetIndex (int) - number of button set (1-based by convention, but 0 is legal). set to -1 if wish to indicate absence of a relevant set. Will show as 'Showing button set --'.

clearDialogPane(self)

source code 

Cleans out the dialog's layout. Does not destroy the control buttons (Next, Previous, Cancel, and OK), but does trigger deletion of all the button objects in the button grid. Attempts to None out references to UI widgets to enable garbage collection.

buildButtonSet(self, buttonLabelArray)

source code 

Constructs one set of buttons, based on passed in button labels.

Parameters:
  • buttonLabelArray ([string]) - Array of button labels.

addChoiceButtons(self, layout)

source code 

Appends the existing Next/Previous/Cancel/OK buttons into the passed-in layout.

Parameters:
  • layout

setNextPrevButtonsEnabledness(self)

source code 

Examines the instance variables <code>shownLabelArrays</code> and </code>currentlyShowingSetIndex</code> to determine whether the Next or Previous buttons should be enabled. Acts on the result.

clickedNextButton(self)

source code 

Handler for Next button clicks. Triggers show of next button set in order.

clickedPrevButton(self)

source code 

Handler for Next button clicks. Triggers show of previous button set in order.

terminateWithWarning(self)

source code 

Called when no button sets are available from the caller at all. Records this event in instance variable <code>noAvailableSets</code>, and returns.