Sha256: ec738af97bb6dbf49d8143077ee0df37875ac567f8b9f0cc7c55268b72b3c064

Contents?: true

Size: 1.65 KB

Versions: 1

Compression:

Stored size: 1.65 KB

Contents

require 'jldrill/views/gtk/widgets/VocabularyWindow'
require 'jldrill/contexts/ModifyVocabularyContext'
require 'gtk2'

module JLDrill::Gtk

	class VocabularyView < JLDrill::ModifyVocabularyContext::VocabularyView
	
        attr_reader :vocabularyWindow
        	
		def initialize(context, name)
			super(context, name)
			@vocabularyWindow = VocabularyWindow.new(self, name)
            @vocabularyWindow.setFocus
		end
		
		def getWidget
			@vocabularyWindow
		end

        def destroy
            @vocabularyWindow.explicitDestroy
        end
		
		def emitDestroyEvent
			@vocabularyWindow.signal_emit("destroy")
		end

        def emitAddButtonClickedEvent
            @vocabularyWindow.addButton.clicked
        end
        
        def update(vocabulary)
            @vocabularyWindow.update(vocabulary)
            super(vocabulary)
        end

        def updateSearch
            @vocabularyWindow.updateSearchTable
        end
       
        def getVocabulary
            @vocabulary = @vocabularyWindow.getVocab
        end

        # Returns true if the vocabulary has been added
        def clearVocabulary
            super
            @vocabularyWindow.update(@vocabulary)
            @vocabularyWindow.updateSearchTable
            @vocabularyWindow.setFocus
        end

        def close
            @context.exit
        end

        def search(kanji, reading)
            @context.search(kanji, reading)
        end

        def preview(item)
            @context.preview(item)
        end

        def dictionaryLoaded?
            @context.dictionaryLoaded?
        end

        def loadDictionary
            @context.loadDictionary
        end
	
    end
    
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jldrill-0.5.1.7 lib/jldrill/views/gtk/VocabularyView.rb