Module: VRComCtlContainer

Includes:
VRMessageHandler
Included in:
VRContainersSet
Defined in:
lib/vr/vrcomctl.rb

Overview

The following control windows send WM_NOTIFY message to their parent

This definition is for handling them.

Constant Summary

Constants included from VRMessageHandler

VRMessageHandler::PREHANDLERSTR

Instance Method Summary collapse

Methods included from VRMessageHandler

#acceptEvents, #addHandler, #addNoRelayMessages, #controlmsg_dispatching, #deleteHandler, #msghandlerinit, #selfmsg_dispatching

Instance Method Details

#comctlcontainerinitObject



69
70
71
72
73
74
75
76
# File 'lib/vr/vrcomctl.rb', line 69

def comctlcontainerinit
  addHandler(WMsg::WM_NOTIFY,"wmnotify", MSGTYPE::ARGPASS, nil)
  addHandler(WMsg::WM_NOTIFYFORMAT,"wmnotifyformat",MSGTYPE::ARGINTINT,nil)
  addEvent WMsg::WM_NOTIFY
  addEvent WMsg::WM_NOTIFYFORMAT

  addNoRelayMessages [WMsg::WM_NOTIFY,WMsg::WM_NOTIFYFORMAT]
end

#self_wmnotify(msg) ⇒ Object



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/vr/vrcomctl.rb', line 87

def self_wmnotify(msg)

  orig_arg= @screen.application.cstruct2array(msg.lParam,WStruct::NMHDR)

  id=msg.wParam
  ct=@controls[id]       # Activated Control
  if !ct then return end # Ignore message passed through childwin 

  return unless ct.is_a?(VRNotifyControl) and # Added by yukimi_sake
                ct._vr_ntfyhandlers and ct._vr_ntfyhandlers[orig_arg[2]]
  ct._vr_ntfyhandlers[orig_arg[2]].each do |shandler|
    args=msgarg2handlerarg(shandler[1],msg,shandler[2])
    if args.size>0 and ct.respond_to?("_vr_notifyarg") then
      necessary_arg=ct._vr_notifyarg[orig_arg[2]]
      if necessary_arg then
        n=necessary_arg.size-1
        0.upto(n) do |idx|
          args[idx+3]=nil if necessary_arg[idx,1]=='F'
        end
      end
      args=args[3..-1].compact
    end

    ct.__send__(shandler[0],*args) if ct.respond_to?(shandler[0])
    msg.retval = controlmsg_dispatching(ct,shandler[0],*args)

  end
end

#self_wmnotifyformat(parent, command) ⇒ Object



83
84
85
# File 'lib/vr/vrcomctl.rb', line 83

def self_wmnotifyformat(parent,command)
  SKIP_DEFAULTHANDLER[1]
end

#vrinitObject



78
79
80
81
# File 'lib/vr/vrcomctl.rb', line 78

def vrinit
  super
  comctlcontainerinit
end