Changeset 28970

Show
Ignore:
Timestamp:
01/24/09 17:39:14 (4 years ago)
Author:
isaisstillalive
Message:
  • 一時的選択をEditField::Selection#sendMessage直前後に変更。
  • EditField::Selection#sendMessageをpublicに。
  • これにより、一時的選択範囲に対してsendMessageすることができるようになった。
Location:
lang/ruby/ruwin/lib/ruwin/edit_field
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/ruwin/lib/ruwin/edit_field/rich.rb

    r28967 r28970  
    44      class Selection < EditField::Selection 
    55        def string 
    6           temporary_refrect do 
    7             result = "\0"*length 
    8             sendMessage EM_GETSELTEXT, 0, result 
    9             result 
    10           end 
     6          result = "\0"*length 
     7          sendMessage EM_GETSELTEXT, 0, result 
     8          result 
    119        end 
    1210      end 
  • lang/ruby/ruwin/lib/ruwin/edit_field/selection.rb

    r28967 r28970  
    5252       
    5353      def string= string 
     54        sendMessage EM_REPLACESEL, 1, string 
     55      end 
     56       
     57      def sendMessage *args 
    5458        temporary_refrect do 
    55           sendMessage EM_REPLACESEL, 1, string 
     59          @control.sendMessage *args 
    5660        end 
    5761      end 
    5862       
    5963      private 
    60       def sendMessage *args 
    61         @control.sendMessage *args 
    62       end 
    63        
    6464      def temporary_refrect &block 
    6565        return block.call if @reflection 
     
    7676       
    7777      def getsel 
    78         ranges = sendMessage EM_GETSEL, 0, 0 
     78        ranges = @control.sendMessage EM_GETSEL, 0, 0 
    7979        return LOWORD(ranges), HIWORD(ranges) 
    8080      end 
    8181       
    8282      def setsel first, last 
    83         sendMessage EM_SETSEL, first, last 
     83        @control.sendMessage EM_SETSEL, first, last 
    8484      end 
    8585    end