@@ -130,6 +130,8 @@ MCPropertyInfo MCField::kProperties[] =
130130 DEFINE_RW_OBJ_LIST_PROPERTY (P_TAB_WIDTHS, ItemsOfLooseUInt, MCField, TabWidths)
131131 DEFINE_RO_OBJ_LIST_PROPERTY (P_PAGE_HEIGHTS, LinesOfLooseUInt, MCField, PageHeights)
132132 DEFINE_RO_OBJ_CUSTOM_PROPERTY (P_PAGE_RANGES, InterfaceFieldRanges, MCField, PageRanges)
133+
134+ DEFINE_RW_OBJ_ENUM_PROPERTY (P_KEYBOARD_TYPE, InterfaceKeyboardType, MCField, KeyboardType)
133135
134136 DEFINE_RW_OBJ_NON_EFFECTIVE_OPTIONAL_ENUM_PROPERTY (P_TEXT_ALIGN, InterfaceTextAlign, MCField, TextAlign)
135137 DEFINE_RO_OBJ_EFFECTIVE_ENUM_PROPERTY (P_TEXT_ALIGN, InterfaceTextAlign, MCField, TextAlign)
@@ -257,6 +259,8 @@ MCField::MCField()
257259
258260 // MM-2014-08-11: [[ Bug 13149 ]] Used to flag if a recompute is required during the next draw.
259261 m_recompute = false ;
262+
263+ keyboard_type = kMCInterfaceKeyboardTypeNone ;
260264}
261265
262266MCField::MCField (const MCField &fref) : MCControl(fref)
@@ -273,6 +277,8 @@ MCField::MCField(const MCField &fref) : MCControl(fref)
273277 foundlength = 0 ;
274278 cursor_movement = fref.cursor_movement ;
275279 text_direction= fref.text_direction ;
280+ keyboard_type = fref.keyboard_type ;
281+
276282 if (fref.vscrollbar != NULL )
277283 {
278284 vscrollbar = new (nothrow) MCScrollbar (*fref.vscrollbar );
@@ -2560,6 +2566,7 @@ void MCField::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool p
25602566#define FIELD_EXTRA_TEXTDIRECTION (1 << 0 )
25612567// SN-2015-04-30: [[ Bug 15175 ]] TabAlignment flag added
25622568#define FIELD_EXTRA_TABALIGN (1 << 1 )
2569+ #define FIELD_EXTRA_KEYBOARDTYPE (1 << 2 )
25632570
25642571IO_stat MCField::extendedsave (MCObjectOutputStream& p_stream, uint4 p_part, uint32_t p_version)
25652572{
@@ -2582,6 +2589,12 @@ IO_stat MCField::extendedsave(MCObjectOutputStream& p_stream, uint4 p_part, uint
25822589 t_size += sizeof (uint16_t );
25832590 t_size += sizeof (int8_t ) * nalignments;
25842591 }
2592+
2593+ if (keyboard_type != kMCInterfaceKeyboardTypeNone )
2594+ {
2595+ t_flags |= FIELD_EXTRA_KEYBOARDTYPE;
2596+ t_size += sizeof (int8_t );
2597+ }
25852598
25862599 IO_stat t_stat;
25872600 t_stat = p_stream . WriteTag (t_flags, t_size);
@@ -2597,6 +2610,11 @@ IO_stat MCField::extendedsave(MCObjectOutputStream& p_stream, uint4 p_part, uint
25972610 t_stat = p_stream . WriteS8 ((int8_t )alignments[i]);
25982611 }
25992612
2613+ if (t_stat == IO_NORMAL && (t_flags & FIELD_EXTRA_KEYBOARDTYPE))
2614+ {
2615+ t_stat = p_stream . WriteS8 ((int8_t )keyboard_type);
2616+ }
2617+
26002618 if (t_stat == IO_NORMAL)
26012619 t_stat = MCObject::extendedsave (p_stream, p_part, p_version);
26022620
@@ -2656,6 +2674,16 @@ IO_stat MCField::extendedload(MCObjectInputStream& p_stream, uint32_t p_version,
26562674 }
26572675 }
26582676
2677+ if (t_stat == IO_NORMAL && (t_flags & FIELD_EXTRA_KEYBOARDTYPE) != 0 )
2678+ {
2679+ int8_t t_value;
2680+ t_stat = checkloadstat (p_stream . ReadS8 (t_value));
2681+ if (t_stat == IO_NORMAL)
2682+ {
2683+ keyboard_type = static_cast <MCInterfaceKeyboardType>(t_value);
2684+ }
2685+ }
2686+
26592687 if (t_stat == IO_NORMAL)
26602688 t_stat = checkloadstat (p_stream . Skip (t_length));
26612689
@@ -2681,7 +2709,9 @@ IO_stat MCField::save(IO_handle stream, uint4 p_part, bool p_force_ext, uint32_t
26812709 // AL-2014-09-12: [[ Bug 13315 ]] Force an extension if field has explicit textDirection.
26822710 // SN-2015-04-30: [[ Bug 15175 ]] Force an extension if field has tabalign.
26832711 bool t_has_extension;
2684- t_has_extension = text_direction != kMCTextDirectionAuto || nalignments != 0 ;
2712+ t_has_extension = text_direction != kMCTextDirectionAuto ||
2713+ nalignments != 0 ||
2714+ keyboard_type != kMCInterfaceKeyboardTypeNone ;
26852715
26862716 if ((stat = MCObject::save (stream, p_part, t_has_extension || p_force_ext, p_version)) != IO_NORMAL)
26872717 return stat;
0 commit comments