Class: CustomTableItem

Inherits:
FXTableItem
  • Object
show all
Defined in:
lib/watobo/gui/conversation_table.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#backcolorObject

Returns the value of attribute backcolor.



3
4
5
# File 'lib/watobo/gui/conversation_table.rb', line 3

def backcolor
  @backcolor
end

#colorObject

Returns the value of attribute color.



2
3
4
# File 'lib/watobo/gui/conversation_table.rb', line 2

def color
  @color
end

Instance Method Details

#drawContent(table, unusable_dc, x, y, w, h) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/watobo/gui/conversation_table.rb', line 5

def drawContent table, unusable_dc, x, y, w, h
  FXDCWindow.new(table) { |dc|
    if @color and not selected?

      if @backcolor
        dc.foreground = @backcolor
        hg = table.horizontalGridShown? ? 1 : 0
        vg = table.verticalGridShown? ? 1 : 0
        dc.fillRectangle(x + vg, y + hg, w - vg, h - hg)
      end

      dc.foreground = @color

      def dc.setForeground color
        1 # stop super from setting color back
      end
    end

    dc.setFont unusable_dc.getFont
    super table, dc, x, y, w, h
  }
end