1 
2 #include "studiox_includes.h"
3 
4 extern "C" {
5 #include "gx_multi_line_text_view.h"
6 #include "gx_utility.h"
7 }
8 
9 #ifdef _DEBUG
10 #define new DEBUG_NEW
11 #endif
12 
ml_text_input_service_provider()13 ml_text_input_service_provider::ml_text_input_service_provider()
14 {
15 }
16 
GetVarDeclaration()17 CString ml_text_input_service_provider::GetVarDeclaration()
18 {
19     return CString("GX_MULTI_LINE_TEXT_INPUT_MEMBERS_DECLARE");
20 }
21 
22 
DeclarePropertiesStruct()23 CString ml_text_input_service_provider::DeclarePropertiesStruct()
24 {
25 CString out;
26 
27     if (project_lib_version() >= GX_WHITESPACE_IS_UBYTE)
28     {
29         out = (""
30             "typedef struct\n"
31             "{\n"
32             "    GX_RESOURCE_ID string_id;\n"
33             "    GX_RESOURCE_ID font_id;\n"
34             "    GX_RESOURCE_ID normal_text_color_id;\n"
35             "    GX_RESOURCE_ID selected_text_color_id;\n"
36             "    GX_RESOURCE_ID disabled_text_color_id;\n"
37             "    GX_RESOURCE_ID readonly_fill_color_id;\n"
38             "    GX_RESOURCE_ID readonly_text_color_id;\n"
39             "    GX_UBYTE whitespace;\n"
40             "    GX_BYTE  line_space;\n"
41             "    GX_CHAR *buffer;\n"
42             "    UINT buffer_size;\n"
43             "} GX_MULTI_LINE_TEXT_INPUT_PROPERTIES;\n\n");
44     }
45     else if (project_lib_version() > 50401)
46     {
47         out = (""
48             "typedef struct\n"
49             "{\n"
50             "    GX_RESOURCE_ID string_id;\n"
51             "    GX_RESOURCE_ID font_id;\n"
52             "    GX_RESOURCE_ID normal_text_color_id;\n"
53             "    GX_RESOURCE_ID selected_text_color_id;\n"
54             "    GX_RESOURCE_ID disabled_text_color_id;\n"
55             "    GX_RESOURCE_ID readonly_fill_color_id;\n"
56             "    GX_RESOURCE_ID readonly_text_color_id;\n"
57             "    GX_BYTE  whitespace;\n"
58             "    GX_BYTE  line_space;\n"
59             "    GX_CHAR *buffer;\n"
60             "    UINT buffer_size;\n"
61             "} GX_MULTI_LINE_TEXT_INPUT_PROPERTIES;\n\n");
62     }
63     else if (project_lib_version() >= 50303)
64     {
65         out = (""
66             "typedef struct\n"
67             "{\n"
68             "    GX_RESOURCE_ID string_id;\n"
69             "    GX_RESOURCE_ID font_id;\n"
70             "    GX_RESOURCE_ID normal_text_color_id;\n"
71             "    GX_RESOURCE_ID selected_text_color_id;\n"
72             "    GX_BYTE  whitespace;\n"
73             "    GX_BYTE  line_space;\n"
74             "    GX_CHAR *buffer;\n"
75             "    UINT buffer_size;\n"
76             "} GX_MULTI_LINE_TEXT_INPUT_PROPERTIES;\n\n");
77     }
78     else
79     {
80         out = (""
81             "typedef struct\n"
82             "{\n"
83             "    GX_RESOURCE_ID string_id;\n"
84             "    GX_RESOURCE_ID font_id;\n"
85             "    GX_RESOURCE_ID normal_text_color_id;\n"
86             "    GX_RESOURCE_ID selected_text_color_id;\n"
87             "    GX_CHAR *buffer;\n"
88             "    UINT buffer_size;\n"
89             "} GX_MULTI_LINE_TEXT_INPUT_PROPERTIES;\n\n");
90     }
91 
92     return out;
93 }
94 
WriteExtendedProperties(screen_generator * gen,CString & prefix,widget_info * info)95 CString ml_text_input_service_provider::WriteExtendedProperties(screen_generator *gen, CString &prefix, widget_info *info)
96 {
97     CString props;
98     CString out;
99     CString propname = prefix + info->app_name;
100     CString buffer;
101 
102     if (!info->ewi.text_info.dynamic_buffer)
103     {
104         buffer.Format(_T("%s_buffer"), propname);
105 
106         out.Format(_T("GX_CHAR %s_buffer[%d];\n"),
107             propname, info->ewi.text_info.buffer_size);
108     }
109     else
110     {
111         buffer = "GX_NULL";
112 
113         out = "";
114     }
115 
116     if (project_lib_version() > 50401)
117     {
118         props.Format(_T("GX_MULTI_LINE_TEXT_INPUT_PROPERTIES %s_properties =\n")
119             _T("{\n")
120             _T("    %s, /* string id */\n")
121             _T("    %s, /* font id */\n")
122             _T("    %s, /* normal text color */\n")
123             _T("    %s, /* selected text color */\n")
124             _T("    %s, /* disabled text color */\n")
125             _T("    %s, /* readonly fill color */\n")
126             _T("    %s, /* readonly text color */\n")
127             _T("    %d, /* whitespace */\n")
128             _T("    %d, /* line_space */\n")
129             _T("    %s,  /* buffer */\n")
130             _T("    %d /* buffer size */\n};\n"),
131             propname,
132             gen->GetStringIdName(info->string_id[0]),
133             gen->GetFontIdName(info->font_id[0]),
134             gen->GetColorIdName(info->color_id[NORMAL_TEXT_COLOR_INDEX]),
135             gen->GetColorIdName(info->color_id[SELECTED_TEXT_COLOR_INDEX]),
136             gen->GetColorIdName(info->color_id[DISABLED_TEXT_COLOR_INDEX]),
137             gen->GetColorIdName(info->color_id[READONLY_FILL_COLOR_INDEX]),
138             gen->GetColorIdName(info->color_id[READONLY_TEXT_COLOR_INDEX]),
139             info->ewi.text_info.whitespace,
140             info->ewi.text_info.line_space,
141             buffer,
142             info->ewi.text_info.buffer_size);
143     }
144     else if (project_lib_version() >= 50303)
145     {
146         props.Format(_T("GX_MULTI_LINE_TEXT_INPUT_PROPERTIES %s_properties =\n")
147             _T("{\n")
148             _T("    %s, /* string id */\n")
149             _T("    %s, /* font id */\n")
150             _T("    %s, /* normal text color */\n")
151             _T("    %s, /* selected text color */\n")
152             _T("    %d, /* whitespace */\n")
153             _T("    %d, /* line_space */\n")
154             _T("    %s,  /* buffer */\n")
155             _T("    %d /* buffer size */\n};\n"),
156             propname,
157             gen->GetStringIdName(info->string_id[0]),
158             gen->GetFontIdName(info->font_id[0]),
159             gen->GetColorIdName(info->color_id[NORMAL_TEXT_COLOR_INDEX]),
160             gen->GetColorIdName(info->color_id[SELECTED_TEXT_COLOR_INDEX]),
161             info->ewi.text_info.whitespace,
162             info->ewi.text_info.line_space,
163             buffer,
164             info->ewi.text_info.buffer_size);
165     }
166     else
167     {
168         props.Format(_T("GX_MULTI_LINE_TEXT_INPUT_PROPERTIES %s_properties =\n")
169             _T("{\n")
170             _T("    %s, /* string id */\n")
171             _T("    %s, /* font id */\n")
172             _T("    %s, /* normal text color */\n")
173             _T("    %s, /* selected text color */\n")
174             _T("    %s,  /* buffer */\n")
175             _T("    %d /* buffer size */\n};\n"),
176             propname,
177             gen->GetStringIdName(info->string_id[0]),
178             gen->GetFontIdName(info->font_id[0]),
179             gen->GetColorIdName(info->color_id[NORMAL_TEXT_COLOR_INDEX]),
180             gen->GetColorIdName(info->color_id[SELECTED_TEXT_COLOR_INDEX]),
181             buffer,
182             info->ewi.text_info.buffer_size);
183     }
184 
185     out += props;
186     return out;
187 }
188 
GetCreateFromDefFunctionName()189 CString ml_text_input_service_provider::GetCreateFromDefFunctionName()
190 {
191     return CString("gx_studio_multi_line_text_input_create");
192 }
193 
GetCreateFromDefFunction(int version)194 CString ml_text_input_service_provider::GetCreateFromDefFunction(int version)
195 {
196     CString out;
197     MakeCreatePreamble("multi_line_text_input", version, out);
198     studiox_project* project = GetOpenProject();
199 
200     if (!project)
201     {
202         return out;
203     }
204 
205     if (version >= GX_VERSION_STRING_LENGTH_FIX)
206     {
207         CString string;
208         string.Format(_T("{\n")
209             _T("    UINT status;\n")
210             _T("    GX_STRING text;\n")
211             _T("    GX_MULTI_LINE_TEXT_INPUT *input = (GX_MULTI_LINE_TEXT_INPUT *) control_block;\n")
212             _T("    GX_MULTI_LINE_TEXT_INPUT_PROPERTIES *props = (GX_MULTI_LINE_TEXT_INPUT_PROPERTIES *) info->properties;\n")
213             _T("    status = gx_multi_line_text_input_create(input, info->widget_name, parent, props->buffer, props->buffer_size, info->style, info->widget_id, &info->size);\n")
214             _T("    if (status == GX_SUCCESS)\n")
215             _T("    {\n")
216             _T("        gx_multi_line_text_view_font_set((GX_MULTI_LINE_TEXT_VIEW *) input, props->font_id);\n")
217             _T("        gx_multi_line_text_input_fill_color_set(input, info->normal_fill_color_id, info->selected_fill_color_id,\n")
218             _T("                                                info->disabled_fill_color_id, props->readonly_fill_color_id);\n")
219             _T("        gx_multi_line_text_input_text_color_set(input, props->normal_text_color_id, props->selected_text_color_id,\n")
220             _T("                                                props->disabled_text_color_id, props->readonly_text_color_id);\n")
221             _T("        gx_multi_line_text_view_whitespace_set((GX_MULTI_LINE_TEXT_VIEW *) input, props->whitespace);\n")
222             _T("        gx_multi_line_text_view_line_space_set((GX_MULTI_LINE_TEXT_VIEW *) input, props->line_space);\n")
223             _T("        if(props->buffer && (props->buffer_size > 0) && props->string_id)\n")
224             _T("        {\n")
225             _T("            gx_display_string_get_ext(%s_display_table[0].display, props->string_id, &text);\n")// FIXME: string set issue
226             _T("            if(text.gx_string_ptr)\n")
227             _T("            {\n")
228             _T("                gx_multi_line_text_input_text_set_ext(input, &text);\n")
229             _T("            }\n")
230             _T("        }\n")
231             _T("    }\n")
232             _T("    return status;\n")
233             _T("}\n"),
234             project->mHeader.project_name);
235 
236         out += string;
237     }
238     else if (version > 50401)
239     {
240         out += "{\n"
241             "    UINT status;\n"
242             "    GX_CONST GX_CHAR *text;\n"
243             "    GX_MULTI_LINE_TEXT_INPUT *input = (GX_MULTI_LINE_TEXT_INPUT *) control_block;\n"
244             "    GX_MULTI_LINE_TEXT_INPUT_PROPERTIES *props = (GX_MULTI_LINE_TEXT_INPUT_PROPERTIES *) info->properties;\n"
245             "    status = gx_multi_line_text_input_create(input, info->widget_name, parent, props->buffer, props->buffer_size, info->style, info->widget_id, &info->size);\n"
246             "    if (status == GX_SUCCESS)\n"
247             "    {\n"
248             "        gx_multi_line_text_view_font_set((GX_MULTI_LINE_TEXT_VIEW *) input, props->font_id);\n"
249             "        gx_multi_line_text_input_fill_color_set(input, info->normal_fill_color_id, info->selected_fill_color_id,\n"
250             "                                                info->disabled_fill_color_id, props->readonly_fill_color_id);\n"
251             "        gx_multi_line_text_input_text_color_set(input, props->normal_text_color_id, props->selected_text_color_id,\n"
252             "                                                props->disabled_text_color_id, props->readonly_text_color_id);\n"
253             "        gx_multi_line_text_view_whitespace_set((GX_MULTI_LINE_TEXT_VIEW *) input, props->whitespace);\n"
254             "        gx_multi_line_text_view_line_space_set((GX_MULTI_LINE_TEXT_VIEW *) input, props->line_space);\n"
255             "        if(props->buffer && (props->buffer_size > 0) && props->string_id)\n"
256             "        {\n"
257             "            gx_system_string_get(props->string_id, &text);\n"
258             "            if(text)\n"
259             "            {\n"
260             "                gx_multi_line_text_input_text_set(input, text);\n"
261             "            }\n"
262             "        }\n"
263             "    }\n"
264             "    return status;\n"
265             "}\n";
266     }
267     else if (version >= 50303)
268     {
269         out += "{\n"
270             "    UINT status;\n"
271             "    GX_MULTI_LINE_TEXT_INPUT *input = (GX_MULTI_LINE_TEXT_INPUT *) control_block;\n"
272             "    GX_MULTI_LINE_TEXT_INPUT_PROPERTIES *props = (GX_MULTI_LINE_TEXT_INPUT_PROPERTIES *) info->properties;\n"
273             "    status = gx_multi_line_text_input_create(input, info->widget_name, parent, props->buffer, props->buffer_size, info->style, info->widget_id, &info->size);\n"
274             "    if (status == GX_SUCCESS)\n"
275             "    {\n"
276             "        gx_multi_line_text_view_font_set((GX_MULTI_LINE_TEXT_VIEW *) input, props->font_id);\n"
277             "        gx_multi_line_text_view_text_color_set((GX_MULTI_LINE_TEXT_VIEW *) input, props->normal_text_color_id, props->selected_text_color_id);\n"
278             "        gx_multi_line_text_view_whitespace_set((GX_MULTI_LINE_TEXT_VIEW *) input, props->whitespace);\n"
279             "        gx_multi_line_text_view_line_space_set((GX_MULTI_LINE_TEXT_VIEW *) input, props->line_space);\n"
280             "    }\n"
281             "    return status;\n"
282             "}\n";
283     }
284     else
285     {
286         out += "{\n"
287             "    UINT status;\n"
288             "    GX_MULTI_LINE_TEXT_INPUT *input = (GX_MULTI_LINE_TEXT_INPUT *) control_block;\n"
289             "    GX_MULTI_LINE_TEXT_INPUT_PROPERTIES *props = (GX_MULTI_LINE_TEXT_INPUT_PROPERTIES *) info->properties;\n"
290             "    status = gx_multi_line_text_input_create(input, info->widget_name, parent, props->buffer, props->buffer_size, info->style, info->widget_id, &info->size);\n"
291             "    if (status == GX_SUCCESS)\n"
292             "    {\n"
293             "        gx_multi_line_text_view_font_set((GX_MULTI_LINE_TEXT_VIEW *) input, props->font_id);\n"
294             "        gx_multi_line_text_view_text_color_set((GX_MULTI_LINE_TEXT_VIEW *) input, props->normal_text_color_id, props->selected_text_color_id);\n"
295             "    }\n"
296             "    return status;\n"
297             "}\n";
298     }
299 
300     return out;
301 }
302 
CreateNewInstance(GX_WIDGET * parent)303 widget_info *ml_text_input_service_provider::CreateNewInstance(GX_WIDGET *parent)
304 {
305     int parent_size;
306 
307     GX_RECTANGLE size = parent->gx_widget_size;
308     gx_utility_rectangle_define(&size, 0, 0, 79, 23);
309     parent_size = (parent->gx_widget_size.gx_rectangle_right -
310                    parent->gx_widget_size.gx_rectangle_left) / 2;
311     size.gx_rectangle_right = size.gx_rectangle_left + parent_size;
312 
313     parent_size = (parent->gx_widget_size.gx_rectangle_bottom -
314                    parent->gx_widget_size.gx_rectangle_top) / 2;
315     size.gx_rectangle_bottom = size.gx_rectangle_top + parent_size;
316 
317     gx_utility_rectangle_center(&size, &parent->gx_widget_size);
318 
319     GX_MULTI_LINE_TEXT_INPUT *input = new GX_MULTI_LINE_TEXT_INPUT;
320 
321     GX_CHAR *buffer = new GX_CHAR[100];
322     memset(buffer, 0, 100);
323 
324     gx_multi_line_text_input_create(input, "text_input", parent, buffer, 100,
325         GX_STYLE_ENABLED|GX_STYLE_BORDER_THIN|GX_STYLE_TEXT_CENTER, 0, &size);
326     gx_widget_style_remove(input, GX_STYLE_DRAW_SELECTED);
327     widget_info *info = InitWidgetInfo((GX_WIDGET *) input);
328 
329     info->font_id[0] = input->gx_multi_line_text_view_font_id;
330     info->color_id[NORMAL_TEXT_COLOR_INDEX] = input->gx_multi_line_text_view_normal_text_color;
331     info->color_id[SELECTED_TEXT_COLOR_INDEX] = input->gx_multi_line_text_view_selected_text_color;
332     info->color_id[DISABLED_TEXT_COLOR_INDEX] = input->gx_multi_line_text_view_disabled_text_color;
333     info->color_id[READONLY_FILL_COLOR_INDEX] = input->gx_multi_line_text_input_readonly_fill_color;
334     info->color_id[READONLY_TEXT_COLOR_INDEX] = input->gx_multi_line_text_input_readonly_text_color;
335     info->string_id[0] = 0;
336     info->ewi.text_info.whitespace = 0;
337     info->ewi.text_info.line_space = 0;
338     info->ewi.text_info.buffer_size = 100;
339     info->ewi.text_info.dynamic_buffer = FALSE;
340     return info;
341 }
342 
GenerateFromInfo(GX_WIDGET * parent,widget_info * info)343 GX_WIDGET *ml_text_input_service_provider::GenerateFromInfo(GX_WIDGET *parent, widget_info *info)
344 {
345     GX_MULTI_LINE_TEXT_INPUT *input = new GX_MULTI_LINE_TEXT_INPUT;
346     GX_CHAR *text = NULL;
347 
348     if (info ->ewi.text_info.buffer_size > 1)
349     {
350         text = new GX_CHAR[info->ewi.text_info.buffer_size + 1];
351         memset(text, 0, info->ewi.text_info.buffer_size + 1);
352     }
353 
354     if (text && info->string_id[0])
355     {
356         GetStringText(text, info->ewi.text_info.buffer_size, info);
357     }
358 
359     gx_multi_line_text_input_create(input,
360         (CHAR *) info->app_name.GetString(),
361         parent,
362         text, info->ewi.text_info.buffer_size,
363         info->style, 0,
364         &info->size);
365 
366     gx_multi_line_text_input_fill_color_set(input,
367         info->color_id[NORMAL_FILL_COLOR_INDEX], info->color_id[SELECTED_FILL_COLOR_INDEX],
368         info->color_id[DISABLED_FILL_COLOR_INDEX], info->color_id[READONLY_FILL_COLOR_INDEX]);
369 
370     gx_multi_line_text_input_text_color_set(input,
371         info->color_id[NORMAL_TEXT_COLOR_INDEX], info->color_id[SELECTED_TEXT_COLOR_INDEX],
372         info->color_id[DISABLED_TEXT_COLOR_INDEX], info->color_id[READONLY_TEXT_COLOR_INDEX]);
373 
374     GX_MULTI_LINE_TEXT_VIEW *view = (GX_MULTI_LINE_TEXT_VIEW *)input;
375     gx_multi_line_text_view_font_set(view, info->font_id[0]);
376 
377     gx_multi_line_text_view_whitespace_set(view, info->ewi.text_info.whitespace);
378     gx_multi_line_text_view_line_space_set(view, info->ewi.text_info.line_space);
379 
380     return ((GX_WIDGET *) input);
381 }
382 
SaveToProject(xml_writer & writer,studiox_project * project,int display,widget_info * info)383 void ml_text_input_service_provider::SaveToProject(xml_writer &writer, studiox_project *project, int display, widget_info *info)
384 {
385     widget_service_provider::SaveToProject(writer, project, display, info);
386     WriteStringId(writer, project, display, "string_id", info->string_id[0]);
387     WriteFontId(writer, project, display, "font_id", info->font_id[0]);
388     WriteColorId(writer, project, display, "normal_text_color", info->color_id[NORMAL_TEXT_COLOR_INDEX]);
389     WriteColorId(writer, project, display, "selected_text_color", info->color_id[SELECTED_TEXT_COLOR_INDEX]);
390     WriteColorId(writer, project, display, "disabled_fill_color", info->color_id[DISABLED_FILL_COLOR_INDEX]);
391     WriteColorId(writer, project, display, "disabled_text_color", info->color_id[DISABLED_TEXT_COLOR_INDEX]);
392     WriteColorId(writer, project, display, "readonly_fill_color", info->color_id[READONLY_FILL_COLOR_INDEX]);
393     WriteColorId(writer, project, display, "readonly_text_color", info->color_id[READONLY_TEXT_COLOR_INDEX]);
394     writer.WriteInt("whitespace", info->ewi.text_info.whitespace);
395     writer.WriteInt("line_space", info->ewi.text_info.line_space);
396 
397     writer.WriteString("buffer_allocator", info->callback_func);
398     writer.WriteInt("buffer_size", info->ewi.text_info.buffer_size);
399     writer.WriteBool("dynamic_buffer", info->ewi.text_info.dynamic_buffer);
400 }
401 
ReadFromProject(xml_reader & reader,studiox_project * project,int display,widget_info * info,ULONG valid_styles)402 void ml_text_input_service_provider::ReadFromProject(xml_reader &reader, studiox_project *project, int display, widget_info *info, ULONG valid_styles)
403 {
404     valid_styles |= GX_STYLE_TEXT_ALIGNMENT_MASK|GX_STYLE_TEXT_COPY|GX_STYLE_CURSOR_BLINK|GX_STYLE_CURSOR_ALWAYS|GX_STYLE_TEXT_INPUT_NOTIFY_ALL|GX_STYLE_TEXT_INPUT_READONLY;
405     widget_service_provider::ReadFromProject(reader, project, display, info, valid_styles);
406     info->string_id[0] = ReadStringId(reader, project, display, "string_id");
407     if (info->string_id[0] < 0 || info->string_id[0] > 100000)
408     {
409         info->string_id[0] = 0;
410     }
411     info->font_id[0] = ReadFontId(reader, project, display, "font_id");
412     info->color_id[NORMAL_TEXT_COLOR_INDEX] = ReadColorId(reader, project, display, "normal_text_color");
413     info->color_id[SELECTED_TEXT_COLOR_INDEX] = ReadColorId(reader, project, display, "selected_text_color");
414 
415     if (project->mHeader.project_version > 54)
416     {
417         info->color_id[DISABLED_TEXT_COLOR_INDEX] = ReadColorId(reader, project, display, "disabled_text_color");
418         info->color_id[READONLY_FILL_COLOR_INDEX] = ReadColorId(reader, project, display, "readonly_fill_color");
419         info->color_id[READONLY_TEXT_COLOR_INDEX] = ReadColorId(reader, project, display, "readonly_text_color");
420     }
421     else
422     {
423         //selected color is start been used after project version 54
424         //set selected color to normal color for old projects
425         info->color_id[DISABLED_TEXT_COLOR_INDEX] = info->color_id[NORMAL_TEXT_COLOR_INDEX];
426         info->color_id[READONLY_FILL_COLOR_INDEX] = GX_COLOR_ID_READONLY_FILL;
427         info->color_id[READONLY_TEXT_COLOR_INDEX] = GX_COLOR_ID_READONLY_TEXT;
428     }
429 
430     reader.ReadInt("whitespace", info->ewi.text_info.whitespace, 0);
431     reader.ReadInt("line_space", info->ewi.text_info.line_space, 0);
432 
433     reader.ReadString("buffer_allocator", info->callback_func);
434     reader.ReadInt("buffer_size", info->ewi.text_info.buffer_size, 100);
435     reader.ReadBool("dynamic_buffer", info->ewi.text_info.dynamic_buffer);
436 }
437 
AssignText(widget_info * info,int index,GX_RESOURCE_ID string_id)438 void ml_text_input_service_provider::AssignText(widget_info *info, int index,
439     GX_RESOURCE_ID string_id)
440 {
441     info->string_id[0] = string_id;
442     GX_WIDGET *widget = info->widget;
443 
444     if (widget)
445     {
446         GX_MULTI_LINE_TEXT_INPUT *input = (GX_MULTI_LINE_TEXT_INPUT *)widget;
447 
448         GX_CHAR *text = (GX_CHAR *) input->gx_multi_line_text_view_text.gx_string_ptr;
449         GX_STRING string;
450 
451         if (text && info->ewi.text_info.buffer_size > 1)
452         {
453             GetStringText(text, info->ewi.text_info.buffer_size, info);
454             input->gx_multi_line_text_view_text_id = string_id;
455             string.gx_string_ptr = text;
456             string.gx_string_length = strlen(text);
457             _gx_multi_line_text_input_text_set_ext(input, &string);
458         }
459         gx_system_dirty_mark(widget);
460     }
461 }
462 
AssignColor(widget_info * info,int index,GX_RESOURCE_ID color_id)463 void ml_text_input_service_provider::AssignColor(widget_info *info, int index, GX_RESOURCE_ID color_id)
464 {
465     GX_MULTI_LINE_TEXT_INPUT *input = (GX_MULTI_LINE_TEXT_INPUT *) (info->widget);
466 
467     switch (index)
468     {
469     case READONLY_FILL_COLOR_INDEX:
470         if (input)
471         {
472             gx_multi_line_text_input_fill_color_set(input, input->gx_widget_normal_fill_color, input->gx_widget_selected_fill_color,
473                 input->gx_widget_disabled_fill_color, color_id);
474         }
475 
476         info->color_id[READONLY_FILL_COLOR_INDEX] = color_id;
477         break;
478 
479     case READONLY_TEXT_COLOR_INDEX:
480         if (input)
481         {
482             gx_multi_line_text_input_text_color_set(input, input->gx_multi_line_text_view_normal_text_color,
483                 input->gx_multi_line_text_view_selected_text_color,
484                 input->gx_multi_line_text_view_disabled_text_color, color_id);
485         }
486 
487         info->color_id[READONLY_TEXT_COLOR_INDEX] = color_id;
488         break;
489 
490     default:
491         ml_text_view_service_provider::AssignColor(info, index, color_id);
492     }
493 }
494