Package horizons :: Package gui :: Package modules :: Module ingame :: Class ChangeNameDialog
[hide private]
[frames] | no frames]

Class ChangeNameDialog

source code

windows.Window --+    
                 |    
    windows.Dialog --+
                     |
                    ChangeNameDialog

Shows a dialog where the user can change the name of a NamedComponent.

Instance Methods [hide private]
 
__init__(self, windows, session) source code
 
prepare(self, instance)
Setup the dialog gui.
source code
 
act(self, named_instance)
Renames the instance that is returned by the dialog, if confirmed.
source code
    Inherited from windows.Dialog
 
_abort(self, retval=False)
Break out of mainloop.
source code
 
_execute(self)
Execute the dialog synchronously.
source code
 
_on_keypress(self, event)
Intercept ESC and ENTER keys and execute the appropriate actions.
source code
 
close(self)
Closes the window.
source code
 
hide(self)
Hide the window.
source code
 
on_escape(self)
Define what happens when ESC is pressed.
source code
 
show(self, **kwargs)
Show the window.
source code
 
trigger_close(self, event_name)
Close the dialog and execute the received event
source code
    Inherited from windows.Window
 
_hide_modal_background(self) source code
 
_show_modal_background(self)
Loads transparent background that de facto prohibits access to other gui elements by eating all input events.
source code
 
on_return(self)
Define what happens when RETURN is pressed.
source code
 
open(self, **kwargs)
Open the window.
source code
Class Methods [hide private]
    Inherited from windows.Dialog
 
create_from_widget(cls, dlg, bind, event_map=None, modal=False, focus=None)
Shows any pychan dialog.
source code
Class Variables [hide private]
  modal = True
  focus = 'new_name'
hash(x)
    Inherited from windows.Dialog
  return_events = {}
Method Details [hide private]

__init__(self, windows, session)
(Constructor)

source code 
Overrides: windows.Window.__init__

prepare(self, instance)

source code 

Setup the dialog gui.

The widget has to be stored in `self._gui`. If you want to abort the dialog here return False.

Overrides: windows.Dialog.prepare
(inherited documentation)

act(self, named_instance)

source code 

Renames the instance that is returned by the dialog, if confirmed.

Hitting Esc or the Cancel button will not trigger a rename. if no name was entered or the new name only consists of spaces, abort the renaming as well.

Overrides: windows.Dialog.act