Languages

Menu
Sites
Language
on elm_entry, How can I get the text with right align ?

today, I'm making the health app as below.

This entered text is displayed by left align.

But, I want to change the align as right.

How can I change it ?

Please help me.

Thanks.


    Evas_Object *entry = elm_entry_add(box);
    elm_entry_single_line_set(entry, EINA_TRUE);
    elm_entry_scrollable_set(entry, EINA_TRUE);
    elm_scroller_policy_set(entry, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF);
    Elm_Entry_Filter_Limit_Size limit = {VALUE_CHAR_LIMIT, VALUE_BYTE_LIMIT};
    elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit);
    elm_entry_cnp_mode_set(entry, ELM_CNP_MODE_PLAINTEXT);
 elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_NUMBERONLY);

    evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 evas_object_size_hint_max_set(entry, ELM_SCALE_SIZE(100), ELM_SCALE_SIZE(BUTTON_SCALE_HEIGHT));
    evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);

    elm_object_part_text_set(entry, "elm.guide", value_guide);
    evas_object_smart_callback_add(entry, "changed", _weight_entry_changed_cb, view_data);
    evas_object_show(entry);
    elm_entry_entry_set(entry, view_data->weight);

Responses

5 Replies
Vikram

Hi,

Seems the currently tizen native app not support your requires.

I want to know, the text in entry is need the user to input? Or I mean, did the text must be input by user? If not, I think you can use a edc group with text part, it can be set to right alignment.

Jean Yang

Hi, 

I think you can try the cursor position to control the input order:  

Eina_Bool elm_entry_cursor_prev (Evas_Object *obj)
Moves the cursor one place to the left within the entry. 

elm_entry_cursor_line_end_set (ad->input_field_entry);

 

Alex Dem

Hi,
As I know
It is possible to set cursor position indside of entry. See Native 'UI Controls' example->'Entry' and just add into file edc_resource/entry.edc  :
    rel1.relative: 0.5 0; or rel1.offset: 100 0;

group { name: "entry_layout";
   parts {
      part { name: "bg";
         type: RECT;
         scale: 1;
         description { state: "default" 0.0;
            color: 220 220 220 255;
         }
      }
      part { name: "entry_part";
         type: SWALLOW;
         scale: 1;
         description { state: "default" 0.0;
            rel1.to: "bg";
            rel2.to: "bg";
            rel1.relative: 0.5 0;
           }
      }
   }
}

But it does not mean that entered text will be alignment to right and I did not face how to perform such text alignment .
Alexey.

Ashwini Kumar

Hi Guys,

I am having another issue with Entry widget.

I have registered a callback for "changed" event.

Whenever I enter anything thru the keybord input the text is displayed in the Entry field, but the callback function is not called.

I am expecting the "changed" callback to be hit on every character entered. It is getting called only when I press "SPACE" bar on the keyboard.

Am i missing anything..... Your inputs are welcome.

Thanx,

Ashwini

Jean Yang

Hello Ashwini,

Please trun off the prediction input and try again.