语言

Menu
Sites
Language
Entry Widget Background

Hello,

I am creating a Tizen Native Mobile App , There is a form having 2 to 3 Entry Widgets , i want to add Background to my Entry Widgets ,

 i already tried many ways to do this but each have some problems, 

1. i tried it using EDC Layout but the swallow part of the EDC  remains Fixed at its position

2. in some way Entry Widget disappears when the keypad is visible

3. in some way Entry is not Scrollable it remains fixed at its position

" i need a Entry widget in scroller with the Background or some Border etc "

Please Help ,

Dinal Jivani

响应

7 回复
Shaswati Saha

Here's a solution about adding background to EFL widgets. Would you please give it a try?

Shaswati Saha

Hi Dinal Jivani,

What's the status right now? Could you implement custom entry widget with background and border? Please let me know. 

However, if you're facing any difficulty, please share here. I've tried to design a custom entry (as below image) by myself and I guess it'll help to fulfill your requirement.

Dinal Jivani

yes Thanks Shaswati Saha for the above link that helped me alot ,

i had Created the view in the EDC layout using RECT and SWALLOW parts...but i dont know whether i am going in right way or not..

how did you created the the above view can you please share the code ?

below is the view i had created :

Shaswati Saha

My idea is simple, I've just changed bg color and given a border with very thin four rectangles. I'm sharing my EDC code below, please have a look.

collections {
   base_scale: 1.8;
   group { name: "elm/entry/base/customized";
      parts {
         part
         name: "shade";
         type: RECT;
         description{ 
            state: "default" 0.0;
            color: 20 200 200 255;
            rel1.relative: 0.1 0.4;
            rel2.relative: 0.9 0.5;
         }
      }
      part { name: "basic_entry";
         type: EXTERNAL;
         source: "elm/entry";
         description { state: "default" 0;
            align: 0 0;
            rel1.relative: 0.1 0.4;
            rel2.relative: 0.9 0.5;
            params {
               string: "style" "default";
               string: "text" "some text";
               bool: "editable" "1";
               bool: "single line" "1";
               bool: "password" "0";
            }
         }
      }
      part {
         type: RECT;
         name: "rect1";
         description {
            state: "default" 0.0;
            color: 25 30 200 255;
            rel1.relative: 0.1 0.5;
            rel2.relative: 0.9 0.51;
         }

      }
      part {
         type: RECT;
         name: "rect2";
         description {
            state: "default" 0.0;
            color: 25 30 200 255;
            rel1.relative: 0.1 0.393;
            rel2.relative: 0.9 0.4;
         }

      }
      part {
         type: RECT;
         name: "rect3";
         description {
            state: "default" 0.0;
            color: 25 30 200 255;
            rel1.relative: 0.09 0.3934;
            rel2.relative: 0.1 0.51;
         }

      }
      part {
         type: RECT;
         name: "rect4";
         description {
            state: "default" 0.0;
            color: 25 30 200 255;
            rel1.relative: 0.9 0.3934;
            rel2.relative: 0.911 0.51;
         }

      }
   }

 

Dinal Jivani

Thanks Alot ,

but what will be the code of elm/entry in .C file ? I mean to say is how the entry widget will fetch this style to itslef ?

and i have to do this same stylings for each entry ? or i can use this same style to more then one entry field on screen

Shaswati Saha

Here's my C code to apply custom style implemented using EDC.

char edj_path[PATH_MAX] = "";
app_get_resource("edje/custom_button.edj", edj_path, (int)PATH_MAX);
elm_theme_extension_add(NULL, edj_path);

Evas_Object *custom_entry = elm_entry_add(ad->conform);
elm_object_style_set(custom_entry, "customized");
evas_object_size_hint_weight_set(custom_entry, 1.0, 0.0);
evas_object_size_hint_align_set(custom_entry, -1.0, 0.0);
evas_object_show(custom_entry);

 

Dinal Jivani

Hello Shaswati Saha , 

i had tried using this , it works well

but how should i add guide text that we are giving using

 elm_object_part_text_set(Entry, "elm.guide", "<color=#D3D3D3>Add Title</font_size>");  function 

and how should i add more customixation to params Part in EDC for e.g. :

evas_object_size_hint_weight_set(Entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(Entry, EVAS_HINT_FILL, 0.5);
elm_entry_text_style_user_push(Entry, "DEFAULT='font=Tizen:style=Light font_size=35 color=#707070 '");
elm_object_part_text_set(Entry, "elm.guide", "<font_size=33  color=#D3D3D3>Add Title</font_size>");
elm_entry_input_panel_return_key_type_set(Entry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE);
elm_entry_markup_filter_append(Entry,elm_entry_filter_limit_size, &limit_size);
Etc........
 
how should i include them to the params ?