Class: JLDrill::DisplayProblemContext::ProblemView
- Inherits:
-
Context::View
- Object
- Context::View
- JLDrill::DisplayProblemContext::ProblemView
- Defined in:
- lib/jldrill/contexts/DisplayProblemContext.rb
Direct Known Subclasses
Defined Under Namespace
Classes: ItemHintView
Instance Attribute Summary collapse
-
#itemHints ⇒ Object
readonly
Returns the value of attribute itemHints.
Attributes inherited from Context::View
Instance Method Summary collapse
-
#initialize(context) ⇒ ProblemView
constructor
A new instance of ProblemView.
-
#newProblem(problem) ⇒ Object
A new problem has been added.
-
#removingViewFrom(parent) ⇒ Object
Modify the removingViewFrom hook to remove the ItemHintView.
-
#showAnswer ⇒ Object
Show the answer to the problem.
-
#showBusy(bool) ⇒ Object
Show the busy cursor in the UI if bool is true.
-
#updateProblem(problem) ⇒ Object
The current problem has changed and needs updating.
-
#viewAddedTo(parent) ⇒ Object
Modify the viewAddedTo hook to add the ItemHintView.
Methods inherited from Context::View
#addView, #getWidget, #removeView
Constructor Details
#initialize(context) ⇒ ProblemView
Returns a new instance of ProblemView.
42 43 44 45 |
# File 'lib/jldrill/contexts/DisplayProblemContext.rb', line 42 def initialize(context) super(context) @itemHints = context.viewBridge.ItemHintView.new(context) end |
Instance Attribute Details
#itemHints ⇒ Object (readonly)
Returns the value of attribute itemHints.
40 41 42 |
# File 'lib/jldrill/contexts/DisplayProblemContext.rb', line 40 def itemHints @itemHints end |
Instance Method Details
#newProblem(problem) ⇒ Object
A new problem has been added
58 59 60 61 |
# File 'lib/jldrill/contexts/DisplayProblemContext.rb', line 58 def newProblem(problem) itemHints.newProblem(problem) # Define the rest in the concrete class end |
#removingViewFrom(parent) ⇒ Object
Modify the removingViewFrom hook to remove the ItemHintView
53 54 55 |
# File 'lib/jldrill/contexts/DisplayProblemContext.rb', line 53 def removingViewFrom(parent) self.removeView(@itemHints) end |
#showAnswer ⇒ Object
Show the answer to the problem
70 71 72 |
# File 'lib/jldrill/contexts/DisplayProblemContext.rb', line 70 def showAnswer # Should be overridden in the concrete class end |
#showBusy(bool) ⇒ Object
Show the busy cursor in the UI if bool is true. This happens during a long event where the user can’t interact with the window
77 78 79 |
# File 'lib/jldrill/contexts/DisplayProblemContext.rb', line 77 def showBusy(bool) # Please define in the concrete class end |
#updateProblem(problem) ⇒ Object
The current problem has changed and needs updating
64 65 66 67 |
# File 'lib/jldrill/contexts/DisplayProblemContext.rb', line 64 def updateProblem(problem) itemHints.updateProblem(problem) # Define the rest in the concrete class end |
#viewAddedTo(parent) ⇒ Object
Modify the viewAddedTo hook to add the ItemHintView
48 49 50 |
# File 'lib/jldrill/contexts/DisplayProblemContext.rb', line 48 def viewAddedTo(parent) self.addView(@itemHints) end |