13 |
# |
# |
14 |
# Copyright (c) 2002 Laurent Julliard. All rights reserved. |
# Copyright (c) 2002 Laurent Julliard. All rights reserved. |
15 |
# |
# |
16 |
|
|
17 |
require 'fox' |
require 'fox' |
18 |
require 'fox/colors' |
require 'fox/colors' |
19 |
|
|
96 |
# |
# |
97 |
class Renderer < FXHorizontalFrame |
class Renderer < FXHorizontalFrame |
98 |
include Fox |
include Fox |
99 |
attr_reader :plugin |
attr_reader :plugin |
100 |
|
|
101 |
def initialize(plugin,slot) |
def initialize(plugin,slot) |
102 |
@docked = false |
@docked = false |
103 |
@plugin = plugin |
@plugin = plugin |
451 |
i=0 |
i=0 |
452 |
@table_gvar.setTableSize(gv_ary.size,2) |
@table_gvar.setTableSize(gv_ary.size,2) |
453 |
gv_ary.keys.sort.each { |v| |
gv_ary.keys.sort.each { |v| |
454 |
@table_gvar.setItemText( i, 0, "#{v}") |
if (name = gv_alias(v)) |
455 |
|
@table_gvar.setItemText( i, 0, "#{v} (#{name})") |
456 |
|
else |
457 |
|
@table_gvar.setItemText( i, 0, "#{v}") |
458 |
|
end |
459 |
@table_gvar.setItemText( i, 1, "#{gv_ary[v]}") |
@table_gvar.setItemText( i, 1, "#{gv_ary[v]}") |
460 |
|
@table_gvar.getItem( i, 0).justify = 0x00004000 #left |
461 |
@table_gvar.getItem( i, 1).justify = 0x00004000 #left |
@table_gvar.getItem( i, 1).justify = 0x00004000 #left |
462 |
i += 1 |
i += 1 |
463 |
} |
} |
909 |
sender.handle(self, MKUINT(FXWindow::ID_DISABLE, SEL_COMMAND), nil) |
sender.handle(self, MKUINT(FXWindow::ID_DISABLE, SEL_COMMAND), nil) |
910 |
end |
end |
911 |
end |
end |
912 |
|
|
913 |
|
private |
914 |
|
|
915 |
|
@@gv_aliases = nil |
916 |
|
|
917 |
|
def gv_alias(gvar) |
918 |
|
if @@gv_aliases.nil? |
919 |
|
# Create an hash key of aliases for $... English names |
920 |
|
english_file = nil |
921 |
|
$:.each do |d| |
922 |
|
english_file = File.join(d,"English.rb") |
923 |
|
break if File.exist?(english_file) |
924 |
|
end |
925 |
|
|
926 |
|
if english_file |
927 |
|
@@gv_aliases = Hash.new |
928 |
|
IO.foreach(english_file) do |line| |
929 |
|
@@gv_aliases[$2] = $1 if (line =~ /^\s*alias\s+(\$[^\s]*)\s+(\$[^\s]*)/ ) |
930 |
|
end |
931 |
|
end |
932 |
|
end |
933 |
|
@@gv_aliases[gvar] |
934 |
|
end |
935 |
|
|
936 |
|
|
937 |
end # class Renderer |
end # class Renderer |
938 |
|
|