Class: Glimmer::DSL::Wx::SizerExpression

Inherits:
Expression
  • Object
show all
Includes:
ParentExpression
Defined in:
lib/glimmer/dsl/wx/sizer_expression.rb

Instance Method Summary collapse

Instance Method Details

#add_content(parent, keyword, *args, &block) ⇒ Object



44
45
46
47
48
49
# File 'lib/glimmer/dsl/wx/sizer_expression.rb', line 44

def add_content(parent, keyword, *args, &block)
  options = args.last.is_a?(Hash) ? args.last : {post_add_content: true}
  options[:post_add_content] = true if options[:post_add_content].nil?
  super
  parent&.post_add_content if options[:post_add_content]
end

#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
35
36
37
38
# File 'lib/glimmer/dsl/wx/sizer_expression.rb', line 32

def can_interpret?(parent, keyword, *args, &block)
  (
    parent.is_a?(Glimmer::Wx::ControlProxy) or
    parent.is_a?(Glimmer::Wx::SizerProxy)
  ) and
    Glimmer::Wx::SizerProxy.exists?(keyword)
end

#interpret(parent, keyword, *args, &block) ⇒ Object



40
41
42
# File 'lib/glimmer/dsl/wx/sizer_expression.rb', line 40

def interpret(parent, keyword, *args, &block)
  Glimmer::Wx::SizerProxy.create(keyword, parent, args, &block)
end