Class: VRNotifyControl

Inherits:
VRControl show all
Defined in:
lib/vr/vrcomctl.rb

Overview

Argument Utilities for Common Controls

Constant Summary

Constants inherited from VRControl

VRControl::WINCLASSINFO

Instance Attribute Summary collapse

Attributes inherited from VRControl

#handlers, #name, #parent

Attributes inherited from VRWinComponent

#parent, #screen

Instance Method Summary collapse

Methods inherited from VRControl

Controltype, #add_parentcall, #call_parenthandler, #create, #setFont

Methods inherited from VRWinComponent

#_init, #create, #exwinstyle, #hide, #maximizebox, #maximizebox=, #minimizebox, #minimizebox=, #setscreen, #sizebox, #sizebox=, #tabstop, #tabstop=, #winstyle

Instance Attribute Details

#_vr_notifyargObject (readonly)

VRNotifyControl

All common controls have these event handlers.

Event handlers

— ????_clicked

fired when the control is clicked with left button.

— ????_hitreturn

fired when the control has the input focus and the user press ((*ENTER*)) key.

— ????_dblclicked

fired when the control is double-clicked with left button.

— ????_rclicked

fired when the control is clicked with right button.

— ????_rdblclicked

fired when the control is double-clicked with rightbutton.

— ????_gotfocus

fired when the control has got the input focus

— ????_lostfocus

fired when the control has lost the input focus


149
150
151
# File 'lib/vr/vrcomctl.rb', line 149

def _vr_notifyarg
  @_vr_notifyarg
end

Instance Method Details

#_vr_ntfyhandlersObject



151
152
153
154
155
156
157
# File 'lib/vr/vrcomctl.rb', line 151

def _vr_ntfyhandlers
  unless defined?(@_vr_ntfyhandlers)
    @_vr_ntfyhandlers={} 
  else
    @_vr_ntfyhandlers
  end
end

#addFilterArg(msg, filter) ⇒ Object

filter as str : ‘T’=true, ‘F’=false



175
176
177
# File 'lib/vr/vrcomctl.rb', line 175

def addFilterArg(msg,filter)   # filter as str : 'T'=true, 'F'=false
  @_vr_notifyarg[msg]=filter
end

#addNotifyHandler(msg, handlername, handlertype, argparsestr) ⇒ Object



182
183
184
185
186
# File 'lib/vr/vrcomctl.rb', line 182

def addNotifyHandler(msg,handlername,handlertype,argparsestr)
  @_vr_ntfyhandlers={} unless defined?(@_vr_ntfyhandlers)
  @_vr_ntfyhandlers[msg]=[] unless @_vr_ntfyhandlers[msg]
  @_vr_ntfyhandlers[msg].push [handlername,handlertype,argparsestr]
end

#deleteFilterArg(msg) ⇒ Object



178
179
180
# File 'lib/vr/vrcomctl.rb', line 178

def deleteFilterArg(msg)
  @_vr_notifyarg[msg]=nil
end

#deleteNotifyHandler(msg, handlername) ⇒ Object



188
189
190
191
192
193
# File 'lib/vr/vrcomctl.rb', line 188

def deleteNotifyHandler(msg,handlername)
  return false unless @_vr_ntfyhandlers and @_vr_ntfyhandlers[msg]
  @_vr_ntfyhandlers.delete_if do |shandler|
    shandler[0] != (PREHANDLERSTR+handlername).intern
  end
end

#notifycontrolinitObject



160
161
162
163
164
165
166
167
168
169
# File 'lib/vr/vrcomctl.rb', line 160

def notifycontrolinit
  @_vr_notifyarg={}
  addNotifyHandler(0xfffffffe,"clicked",MSGTYPE::ARGNONE,nil)
  addNotifyHandler(0xfffffffd,"dblclicked",MSGTYPE::ARGNONE,nil)
  addNotifyHandler(0xfffffffc,"hitreturn",MSGTYPE::ARGNONE,nil)
  addNotifyHandler(0xfffffffb,"rclicked",MSGTYPE::ARGNONE,nil)
  addNotifyHandler(0xfffffffa,"rdblclicked",MSGTYPE::ARGNONE,nil)
  addNotifyHandler(0xfffffff9,"gotfocus",MSGTYPE::ARGNONE,nil)
  addNotifyHandler(0xfffffff8,"lostfocus",MSGTYPE::ARGNONE,nil)
end

#vrinitObject



170
171
172
173
# File 'lib/vr/vrcomctl.rb', line 170

def vrinit
  super
  notifycontrolinit
end