module Fzeet::WindowMethods
Constants
- EnumChildProc
Public Instance Methods
[](id)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 196 def [](id) Handle.instance(Windows.DetonateLastError(FFI::Pointer::NULL, :GetDlgItem, @handle, Command[id])) end
capture=(capture)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 162 def capture=(capture) (capture) ? Windows.SetCapture(@handle) : Windows.DetonateLastError(0, :ReleaseCapture) end
capture?()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 161 def capture?; Windows.GetCapture().to_i == @handle.to_i end
dialog=(dialog)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 43 def dialog=(dialog) if dialog Application.dialogs << self unless dialog? else Application.dialogs.delete(self) end end
dialog?()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 41 def dialog?; Application.dialogs.include?(self) end
dlgmsg?(msg)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 51 def dlgmsg?(msg) Windows.IsDialogMessage(@handle, msg) != 0 end
drawMenuBar()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 194 def drawMenuBar; Windows.DetonateLastError(0, :DrawMenuBar, @handle); self end
eachChild(&block)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 202 def eachChild(&block) Windows.EnumChildWindows(@handle, EnumChildProc, block.object_id); self end
enabled=(enabled)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 111 def enabled=(enabled) Windows.EnableWindow(@handle, (enabled) ? 1 : 0) end
enabled?()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 110 def enabled?; Windows.IsWindowEnabled(@handle) != 0 end
focus=(focus)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 121 def focus=(focus) Windows.DetonateLastError(FFI::Pointer::NULL, :SetFocus, (focus) ? @handle : nil) end
focus?()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 120 def focus?; Windows.GetFocus().to_i == @handle.to_i end
invalidate(r = rect, erase = 1)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 184 def invalidate(r = rect, erase = 1) Windows.DetonateLastError(0, :InvalidateRect, @handle, r, erase); self end
location()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 144 def location; position.lt end
location=(a)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 145 def location=(a) Windows.DetonateLastError(0, :SetWindowPos, @handle, nil, a[0], a[1], 0, 0, Fzeet.flags([:nosize, :nozorder], :swp_)) end
long()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 73 def long; Long.new(self) end
message(message, opts = {})
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 7 def message(message, opts = {}) opts[:window] ||= self opts[:caption] ||= text Fzeet.message(message, opts) end
paint() { |dc, ps| ... }
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 164 def paint hdc = Windows.DetonateLastError(FFI::Pointer::NULL, :BeginPaint, @handle, ps = Windows::PAINTSTRUCT.new) begin dc = Handle.wrap(hdc, DCMethods) dc.instance_variable_set(:@window, self) class << dc attr_reader :window end yield dc, ps ensure Windows.EndPaint(@handle, ps) end self end
position()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 141 def position; Windows.DetonateLastError(0, :GetWindowRect, @handle, r = Rect.new); r end
position=(a)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 142 def position=(a) Windows.DetonateLastError(0, :SetWindowPos, @handle, nil, a[0], a[1], a[2], a[3], Fzeet.constant(:nozorder, :swp_)) end
postmsg(msg, wParam = 0, lParam = 0)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 30 def postmsg(msg, wParam = 0, lParam = 0) Windows.DetonateLastError(0, :PostMessage, @handle, Fzeet.constant(msg, *self.class::Prefix[:message]), wParam.to_i, ((lparam = lParam.to_i) > 0x7fff_ffff) ? lparam - 0x1_0000_0000 : lparam ) self end
question(message, opts = {})
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 14 def question(message, opts = {}) opts[:window] ||= self opts[:caption] ||= text Fzeet.question(message, opts) end
rect()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 139 def rect; Windows.DetonateLastError(0, :GetClientRect, @handle, r = Rect.new); r end
reframe()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 150 def reframe Windows.DetonateLastError(0, :SetWindowPos, @handle, nil, 0, 0, 0, 0, Fzeet.flags([:nomove, :nosize, :nozorder, :framechanged], :swp_) ) self end
sendmsg(msg, wParam = 0, lParam = 0)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 21 def sendmsg(msg, wParam = 0, lParam = 0) Windows.SendMessage( @handle, Fzeet.constant(msg, *self.class::Prefix[:message]), wParam.to_i, ((lparam = lParam.to_i) > 0x7fff_ffff) ? lparam - 0x1_0000_0000 : lparam ) end
show(cmdShow = :shownormal)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 116 def show(cmdShow = :shownormal) Windows.ShowWindow(@handle, Fzeet.constant(cmdShow, :sw_)); self end
size()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 147 def size; r = position; Size[r[:right] - r[:left], r[:bottom] - r[:top]] end
size=(a)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 148 def size=(a) Windows.DetonateLastError(0, :SetWindowPos, @handle, nil, 0, 0, a[0], a[1], Fzeet.flags([:nomove, :nozorder], :swp_)) end
style()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 94 def style; Style.new(self) end
style?(style)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 93 def style?(style) (long[:style] & (style = Fzeet.constant(style, *self.class::Prefix[:style]))) == style end
text()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 125 def text return '' if (len = textlen + 1) == 1 ''.tap { |text| FFI::MemoryPointer.new(:char, len) { |buf| Windows.DetonateLastError(0, :GetWindowText, @handle, buf, len) text << buf.read_string } } end
text=(text)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 137 def text=(text) Windows.DetonateLastError(0, :SetWindowText, @handle, text.to_s) end
textlen()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 123 def textlen; Windows.GetWindowTextLength(@handle) end
topmost=(topmost)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 101 def topmost=(topmost) Windows.DetonateLastError(0, :SetWindowPos, @handle, (topmost) ? Windows::HWND_TOPMOST : Windows::HWND_NOTOPMOST, 0, 0, 0, 0, Windows::SWP_NOMOVE | Windows::SWP_NOSIZE ) end
topmost?()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 99 def topmost?; xstyle?(:topmost) end
update()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 118 def update; Windows.DetonateLastError(0, :UpdateWindow, @handle); self end
visible=(visible)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 114 def visible=(visible) show((visible) ? Windows::SW_SHOWNORMAL : Windows::SW_HIDE) end
visible?()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 113 def visible?; Windows.IsWindowVisible(@handle) != 0 end
xstyle()
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 97 def xstyle; ExStyle.new(self) end
xstyle?(xstyle)
click to toggle source
# File lib/fzeet/windows/user/Window/WindowMethods.rb, line 96 def xstyle?(xstyle) (long[:exstyle] & (xstyle = Fzeet.constant(xstyle, *self.class::Prefix[:xstyle]))) == xstyle end