Class: Rfm::Metadata::FieldControl

Inherits:
Object
  • Object
show all
Defined in:
lib/rfm/metadata/field_control.rb

Overview

The FieldControl object represents a field on a FileMaker layout. You can find out what field style the field uses, and the value list attached to it.

Attributes

  • name is the name of the field

  • style is any one of:

    • :edit_box - a normal editable field

    • :scrollable - an editable field with scroll bar

    • :popup_menu - a pop-up menu

    • :checkbox_set - a set of checkboxes

    • :radio_button_set - a set of radio buttons

    • :popup_list - a pop-up list

    • :calendar - a pop-up calendar

  • value_list_name is the name of the attached value list, if any

  • value_list is an array of strings representing the value list items, or nil if this field has no attached value list

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, style, value_list_name, value_list) ⇒ FieldControl

Returns a new instance of FieldControl.



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

def initialize(name, style, value_list_name, value_list)
  @name = name
  case style
  when "EDITTEXT"
    @style = :edit_box
  when "POPUPMENU"
    @style = :popup_menu
  when "CHECKBOX"
    @style = :checkbox_set
  when "RADIOBUTTONS"
    @style = :radio_button_set
  when "POPUPLIST"
    @style = :popup_list
  when "CALENDAR"
    @style = :calendar
  when "SCROLLTEXT"
    @style = :scrollable
  else
    nil
  end
  @value_list_name = value_list_name
  @value_list = value_list
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



49
50
51
# File 'lib/rfm/metadata/field_control.rb', line 49

def name
  @name
end

#styleObject (readonly)

Returns the value of attribute style.



49
50
51
# File 'lib/rfm/metadata/field_control.rb', line 49

def style
  @style
end

#value_listObject (readonly)

Returns the value of attribute value_list.



49
50
51
# File 'lib/rfm/metadata/field_control.rb', line 49

def value_list
  @value_list
end

#value_list_nameObject (readonly)

Returns the value of attribute value_list_name.



49
50
51
# File 'lib/rfm/metadata/field_control.rb', line 49

def value_list_name
  @value_list_name
end