Class: VROwnerDrawButton

Inherits:
VRButton show all
Defined in:
lib/vr/vrowndraw.rb

Constant Summary collapse

BS_OWNERDRAW =

VROwnerDrawButton

Owner draw button. This is just a button but the system doesn’t draw button faces. It’s necessary to draw button face manually.

Required methods

In these method, it doesn’t need to call ((dopaint)).

— drawpushed(left,top,right,bottom,state)

Draws the pushed button face.

— drawreleased(left,top,right,bottom,state)

Draws the released button face.

— drawfocused(left,top,right,bottom,state)

Draws the focused button face. 
This method is fired after drawpushed or drawreleased.
0x0000000B
WINCLASSINFO =
["BUTTON", BS_OWNERDRAW]

Instance Attribute Summary

Attributes inherited from VRControl

#handlers, #name, #parent

Attributes inherited from VRWinComponent

#parent, #screen

Instance Method Summary collapse

Methods inherited from VRButton

#vrinit

Methods inherited from VRStdControl

#_vr_cmdhandlers, #addCommandHandler, #deleteCommandHandler

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=, #vrinit, #winstyle

Instance Method Details

#drawfocused(left, top, right, bottom, state) ⇒ Object



106
# File 'lib/vr/vrowndraw.rb', line 106

def drawfocused(left,top,right,bottom,state) end

#drawpushed(left, top, right, bottom, state) ⇒ Object



104
# File 'lib/vr/vrowndraw.rb', line 104

def drawpushed(left,top,right,bottom,state) end

#drawreleased(left, top, right, bottom, state) ⇒ Object



105
# File 'lib/vr/vrowndraw.rb', line 105

def drawreleased(left,top,right,bottom,state) end

#ownerdraw(iid, action, state, hwnd, hdc, left, top, right, bottom, data) ⇒ Object



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/vr/vrowndraw.rb', line 85

def ownerdraw(iid,action,state,hwnd,hdc,left,top,right,bottom,data)
  self.opaque=false
  if (pushed = ((state & 1)>0) ) then
    drawpushed(left,top,right,bottom,state)
    @parent.controlmsg_dispatching(self,
        "drawpushed",left,top,right,bottom,state)
  else
    drawreleased(left,top,right,bottom,state)
    @parent.controlmsg_dispatching(self,
        "drawreleased",left,top,right,bottom,state)
  end
  
  if (state & 0x10)>0 then
    drawfocused(left,top,right,bottom,state)
    @parent.controlmsg_dispatching(self,
        "drawfocused",left,top,right,bottom,state)
  end
end