Created
December 29, 2014 10:46
-
-
Save narumitukasa/d185c0f38e78c5681ea0 to your computer and use it in GitHub Desktop.
WSFloatingWindowテスト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: utf-8 | |
module WS | |
module FloatingWindow | |
def priority | |
(super + 2) | |
end | |
end | |
class WSControl | |
def priority | |
activated? ? 1 : 0 | |
end | |
end | |
class WSDesktop | |
# システムフォーカスをセットする。 | |
def set_focus(obj) | |
return obj if @system_focus == obj | |
return nil if obj != nil and @children.index(obj) == nil | |
@system_focus.on_leave if @system_focus | |
@system_focus = obj | |
obj.on_enter if obj | |
@children.sort{|a,b| a.priority <=> b.priority} if obj | |
obj | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment