Class: JLDrill::Gtk::PopupFactory
- Inherits:
-
Object
- Object
- JLDrill::Gtk::PopupFactory
show all
- Defined in:
- lib/jldrill/views/gtk/widgets/PopupFactory.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of PopupFactory.
16
17
18
19
20
21
22
|
# File 'lib/jldrill/views/gtk/widgets/PopupFactory.rb', line 16
def initialize(view)
@view = view
@context = @view.context
= nil
@blocked = false
@lastEvent = nil
end
|
Instance Method Details
#belowRect(rect) ⇒ Object
52
53
54
55
56
|
# File 'lib/jldrill/views/gtk/widgets/PopupFactory.rb', line 52
def belowRect(rect)
x = rect[0]
y = rect[1] + (rect[3])
[x, y]
end
|
#block ⇒ Object
24
25
26
|
# File 'lib/jldrill/views/gtk/widgets/PopupFactory.rb', line 24
def block
@blocked = true
end
|
32
33
34
35
36
37
|
# File 'lib/jldrill/views/gtk/widgets/PopupFactory.rb', line 32
def
if !.nil?
.close
= nil
end
end
|
45
46
47
48
49
50
|
# File 'lib/jldrill/views/gtk/widgets/PopupFactory.rb', line 45
def (searchString, x, y)
= .new(searchString,
(searchString),
@view.mainWindow, x, y)
end
|
Finds the string that should be displayed in the Popup Please override this in the concrete class
41
42
43
|
# File 'lib/jldrill/views/gtk/widgets/PopupFactory.rb', line 41
def (searchString)
return ""
end
|
#showBusy(bool) ⇒ Object
66
67
68
69
70
|
# File 'lib/jldrill/views/gtk/widgets/PopupFactory.rb', line 66
def showBusy(bool)
if !.nil?
.showBusy(bool)
end
end
|
#toAbsPos(widget, x, y) ⇒ Object
Translates the x,y coordinates of the widget in this window to absolute screen coordinates
60
61
62
63
64
|
# File 'lib/jldrill/views/gtk/widgets/PopupFactory.rb', line 60
def toAbsPos(widget, x, y)
origin = @view.mainWindow.window.position
pos = [x + origin[0], y + origin[1]]
widget.translate_coordinates(@view.mainWindow, pos[0], pos[1])
end
|
#unblock ⇒ Object
28
29
30
|
# File 'lib/jldrill/views/gtk/widgets/PopupFactory.rb', line 28
def unblock
@blocked = false
end
|