Class: Fzeet::Container

Inherits:
Object
  • Object
show all
Defined in:
lib/fzeet/windows/user/Window/Container.rb

Instance Method Summary collapse

Constructor Details

#initialize(parent, opts = {}) ⇒ Container



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fzeet/windows/user/Window/Container.rb', line 26

def initialize(parent, opts = {})
  opts[:parent] = parent
  (opts[:style] ||= []) << :visible << :child << :clipsiblings << :clipchildren

  super(opts)

  style >> :caption >> :thickframe

  on(:erasebkgnd) { |args|
    Handle.wrap(FFI::Pointer.new(args[:wParam]), DCMethods).
      fillRect(
        rect,
        case @parent
        when Dialog; FFI::Pointer.new(Windows::CTLCOLOR_DLG + 1)
        when BasicWindow; FFI::Pointer.new(Windows.DetonateLastError(-1, :GetClassLong, @parent.handle, Windows::GCL_HBRBACKGROUND))
        end
      )

    args[:result] = 1
  }
end