Module: VROleDropTarget

Includes:
ClipboardFormat, OleDnDConstants, VRUserMessageUseable
Defined in:
lib/vr/vrolednd.rb

Constant Summary collapse

IDROPTARGET_NOTIFY =

*ppt,dwEffect,grfKeyState,cfFormat,hMem,*data

"IIIIII"

Constants included from VRMessageHandler

VRMessageHandler::PREHANDLERSTR

Constants included from OleDnDConstants

OleDnDConstants::DROPEFFECT_COPY, OleDnDConstants::DROPEFFECT_LINK, OleDnDConstants::DROPEFFECT_MOVE, OleDnDConstants::DROPEFFECT_NONE, OleDnDConstants::IDROPTARGET_NOTIFY_DRAGENTER, OleDnDConstants::IDROPTARGET_NOTIFY_DRAGLEAVE, OleDnDConstants::IDROPTARGET_NOTIFY_DRAGOVER, OleDnDConstants::IDROPTARGET_NOTIFY_DROP

Constants included from ClipboardFormat

ClipboardFormat::CF_HDROP, ClipboardFormat::CF_OEMTEXT, ClipboardFormat::CF_TEXT, ClipboardFormat::CF_URL, ClipboardFormat::RegisterClipboardFormat

Instance Method Summary collapse

Methods included from VRUserMessageUseable

#registerUserMessage, #userMessage, #usermessageuseableinit

Methods included from VRMessageHandler

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

Instance Method Details

#oledroptargetinitObject



70
71
72
73
# File 'lib/vr/vrolednd.rb', line 70

def oledroptargetinit
  @vr_oledropmessage = registerUserMessage(ReservedMsg::WM_VR_OLEDND,"vr_olednd",0)
  addEvent @vr_oledropmessage
end

#self_oledragenter(format, keystate) ⇒ Object



106
107
108
# File 'lib/vr/vrolednd.rb', line 106

def self_oledragenter(format,keystate)
  DROPEFFECT_COPY
end

#self_oledragleaveObject



114
115
# File 'lib/vr/vrolednd.rb', line 114

def self_oledragleave
end

#self_oledragover(keystate) ⇒ Object



110
111
112
# File 'lib/vr/vrolednd.rb', line 110

def self_oledragover(keystate)
  nil
end

#self_oledrop(handle, format, keystate) ⇒ Object



117
118
# File 'lib/vr/vrolednd.rb', line 117

def self_oledrop(handle,format,keystate)
end

#self_vr_olednd(wparam, lparam) ⇒ Object



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/vr/vrolednd.rb', line 79

def self_vr_olednd(wparam,lparam)
  notify = @screen.application.cstruct2array(lparam,IDROPTARGET_NOTIFY)
  @vr_olednd_notify=notify
  case wparam
  when IDROPTARGET_NOTIFY_DRAGENTER
      if notify[3]==0 then
        @screen.application.pokeMemory(lparam+4,0,4) # effect none
        return
      end
      r = selfmsg_dispatching("oledragenter",notify[3],notify[2]).to_i
      @screen.application.pokeMemory(lparam+4,r,4) # effect r
  when IDROPTARGET_NOTIFY_DRAGOVER
      r = selfmsg_dispatching("oledragover",notify[2]) 
      if r then
        r = r.to_i
        @screen.application.pokeMemory(lparam+4,r,4) # effect r
      end
  when IDROPTARGET_NOTIFY_DRAGLEAVE
      selfmsg_dispatching("oledragleave")
  when IDROPTARGET_NOTIFY_DROP
      return if notify[3]==0
#        selfmsg_dispatching("oledropraw",dataobj,notify[2])
      selfmsg_dispatching("oledrop",notify[4],notify[3],notify[2])
  end
  @vr_olednd_notify=nil
end

#start_oledroptarget(formats) ⇒ Object



75
76
77
# File 'lib/vr/vrolednd.rb', line 75

def start_oledroptarget(formats)
  self.dndTargetStart( @vr_oledropmessage ,formats )
end

#vrinitObject



65
66
67
68
# File 'lib/vr/vrolednd.rb', line 65

def vrinit
  super
  oledroptargetinit
end