60 View.prototype.init = function(id) { |
60 View.prototype.init = function(id) { |
61 uiLogger.debug("View.init(" + id + ")"); |
61 uiLogger.debug("View.init(" + id + ")"); |
62 |
62 |
63 // call superclass initializer |
63 // call superclass initializer |
64 UIElement.prototype.init.call(this, id); |
64 UIElement.prototype.init.call(this, id); |
65 } |
65 }; |
66 |
66 |
67 // Returns the currently focused control; null if none. |
67 // Returns the currently focused control; null if none. |
68 View.prototype.getFocusedControl = function() { |
68 View.prototype.getFocusedControl = function() { |
69 return this.focusedControl; |
69 return this.focusedControl; |
70 } |
70 }; |
71 |
71 |
72 // Used to notify the view that the focused control has changed. |
72 // Used to notify the view that the focused control has changed. |
73 View.prototype.focusedControlChanged = function(control) { |
73 View.prototype.focusedControlChanged = function(control) { |
74 uiLogger.debug("View.focusedControlChanged(" + control + ")"); |
74 uiLogger.debug("View.focusedControlChanged(" + control + ")"); |
75 this.focusedControl = control; |
75 this.focusedControl = control; |
76 // notify event listeners |
76 // notify event listeners |
77 this.fireEvent(this.createEvent("FocusedControlChanged", this.focusedControl)); |
77 this.fireEvent(this.createEvent("FocusedControlChanged", this.focusedControl)); |
78 } |
78 }; |
79 |
79 |
80 // Attempts to focus the first focusable control. |
80 // Attempts to focus the first focusable control. |
81 // Override in subclasses as required. |
81 // Override in subclasses as required. |
82 View.prototype.focusFirstControl = function() { |
82 View.prototype.focusFirstControl = function() { |
83 uiLogger.debug("View.focusFirstControl()"); |
83 uiLogger.debug("View.focusFirstControl()"); |
84 } |
84 }; |
85 |
85 |
86 // Attempts to reset all control focus states. |
86 // Attempts to reset all control focus states. |
87 // Override in subclasses as required. |
87 // Override in subclasses as required. |
88 View.prototype.resetControlFocusStates = function() { |
88 View.prototype.resetControlFocusStates = function() { |
89 uiLogger.debug("View.resetControlFocusStates()"); |
89 uiLogger.debug("View.resetControlFocusStates()"); |
90 } |
90 }; |