Class: CustomTableItem

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

Overview

. conversation_table.rb

Copyright 2013 by siberas, www.siberas.de

This file is part of WATOBO (Web Application Tool Box)

http://watobo.sourceforge.com

WATOBO is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License.

WATOBO is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with WATOBO; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA .

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#backcolorObject

Returns the value of attribute backcolor


24
25
26
# File 'lib/watobo/gui/conversation_table.rb', line 24

def backcolor
  @backcolor
end

#colorObject

Returns the value of attribute color


23
24
25
# File 'lib/watobo/gui/conversation_table.rb', line 23

def color
  @color
end

Instance Method Details

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


25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/watobo/gui/conversation_table.rb', line 25

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