Page MenuHomePhabricator

Entry Object
Updated 1,671 Days AgoPublic

Introduction

This document was created to clarify some points about the Entry Object, which is part of Edje and Elementary.

The Entry expands the capability of the Evas Textblock Object, allowing live editing of the text, text filtering options, selection, clickable links, theming, scroll support etc.

Edje Entry

Edje is powerful as a theming layer. setting up a themed Textblock Object (=Edje Entry) is easy, by setting a few lines in an edje file.

// entry.edc (use 'edje_cc entry.edc' to produce entry.edj)
collections {
   group { name: "main";
      styles {
         style { name: "entry_textblock_style";
            base: "font=Sans font_size=24 color=#000 text_class=entry";
            tag:  "ps" "ps";
         }
      }
      parts {
         part { name: "elm.text";
            type: TEXTBLOCK;
            scale: 1;
            entry_mode: NONE; //textblock specific
            select_mode: EXPLICIT; //textblock specific
            description { state: "default" 0.0;
                text {
                style: "entry_textblock_style"; //style must be set
                }                                                                
            }                                                                    
         }                                                                       
      }                                                                          
   }                                                                             
}

Note the styles property, which corresponds to the style used by the textblock object. For a full list of the blocks and properties, see the Edje Data Collection Reference.

Adding to the source code the following lines will add the Entry object.

//...
   entry = edje_object_add(evas_object_evas_get(win));
   edje_object_file_set(entry, "entry.edj", "main");
   evas_object_show(entry);
//...

Entry Widget (Elementary)

While the Edje Entry object allows for fast interaction with the Evas Textblock object, the Elementary Entry Widget interacts only with the Edje Entry object. The capabilities of the Textblock are expanded and provide a set a features but simply instantiating an Elm_Entry class object.

entry = elm_entry_add(win);
evas_object_show(entry);

This minimal code instantiates an Entry Widget, that provides the following features:

  • Interactive text editing (typing)
    • Caret indicating current text position
    • Text selection
    • Text operations (copy, paste, cut etc.)
    • Keyboard and mouse interactions (moving the caret, pasting from clipboard, word/char boundaries caret advance)
  • Scrollable interface
    • Shows scrolling bars when content exceeds set size
  • Text-guidance
    • Can add hinting on what text should be entered by the user
  • Pop-up panels
    • Allows adding "anchors" to text, which open pop-ups upon clicks
  • ATSPI interface
    • Implements the Elementary ATSPI interface
  • File loading
    • Allows loading of text files as content
  • Expanded events handling
    • Provides an additional set of event signals to which a user may register callbacks
Last Author
herdsman
Last Edited
Dec 25 2014, 12:19 AM
Projects
None
Subscribers
JackDanielZ