Adapt to latest changes

Including removal of the manual inclusion of text headers!
devs/xartigas/homescreen_example
Xavi Artigas 3 years ago
parent cba451e99b
commit 6f183d62c2
  1. 15
      apps/c/calculator/src/calculator.c
  2. 3
      apps/c/texteditor/src/texteditor_main.c
  3. 20
      apps/csharp/calculator/src/calculator.cs
  4. 3
      reference/c/ui/src/focus_main.c
  5. 2
      reference/c/ui/src/ui_container.c
  6. 3
      tutorial/c/hello-gui/src/gui_main.c

@ -2,11 +2,8 @@
#include <Elementary.h>
#include <Efl_Ui.h>
// Temporary workaround until Unified Text stops using Legacy classes internally
#include <efl_ui_text.eo.h>
#include <efl_text_interactive.eo.h>
static Efl_Ui_Text *_screen = NULL; // Text widget showing current value
static Efl_Ui_Textbox *_screen = NULL; // Text widget showing current value
static int _prev_value = 0; // Value introduced before an operation (first operand
static int _curr_value = 0; // Value currently being introduced (second operand)
static char _operation = '='; // Last operation button pressed
@ -138,8 +135,8 @@ _button_add(Efl_Ui_Table *table, const char *text, const char *command, int posx
// Buttons can only have simple text (no font, styles or markup) but can swallow
// any other object we want.
// Therefore we create a more complex Efl_Ui_Text object and use it as content for the button.
Efl_Ui_Text *label =
efl_add(EFL_UI_TEXT_CLASS, button,
Efl_Ui_Textbox *label =
efl_add(EFL_UI_TEXTBOX_CLASS, button,
efl_text_interactive_editable_set(efl_added, EINA_FALSE),
efl_text_horizontal_align_set(efl_added, 0.5),
efl_text_vertical_align_set(efl_added, 0.5),
@ -189,8 +186,8 @@ _gui_setup()
_button_add(table, "=", "=", 2, 4, 128, 128, 128);
_button_add(table, "C", "C", 0, 4, 0, 0, 0);
// Create a big Efl.Ui.Text screen to display the current input
_screen = efl_add(EFL_UI_TEXT_CLASS, table,
// Create a big Efl.Ui.Textbox screen to display the current input
_screen = efl_add(EFL_UI_TEXTBOX_CLASS, table,
efl_text_set(efl_added, "0"),
efl_text_multiline_set(efl_added, EINA_FALSE),
efl_text_interactive_editable_set(efl_added, EINA_FALSE),
@ -200,7 +197,7 @@ _gui_setup()
efl_text_vertical_align_set(efl_added, 0.5),
efl_text_effect_type_set(efl_added, EFL_TEXT_STYLE_EFFECT_TYPE_GLOW),
efl_text_glow_color_set(efl_added, 128, 128, 128, 128),
efl_event_callback_add(efl_added, EFL_UI_TEXT_EVENT_CHANGED,
efl_event_callback_add(efl_added, EFL_UI_TEXTBOX_EVENT_CHANGED,
_screen_changed_cb, NULL));
efl_text_font_family_set(_screen, "Sans");
efl_text_font_size_set(_screen, 48);

@ -2,9 +2,6 @@
#include <Elementary.h>
#include <Efl_Ui.h>
// Temporary workaround until Unified Text stops using Legacy classes internally
#include <efl_ui_textbox.eo.h>
#include <efl_text_interactive.eo.h>
Efl_Ui_Textbox *_editor;
Efl_Ui_Button *_toolbar_new;

@ -4,7 +4,7 @@ using System;
public class Calculator : Efl.Csharp.Application
{
private Efl.Ui.Text screen; // Text widget showing current value
private Efl.Ui.Textbox screen; // Text widget showing current value
private int prevValue = 0; // Value introduced before an operation (first operand)
private int currValue = 0; // Value currently being introduced (second operand)
private char operation = '='; // Last operation button pressed
@ -123,13 +123,14 @@ public class Calculator : Efl.Csharp.Application
// Buttons can only have simple text (no font, styles or markup) but can swallow
// any other object we want.
// Therefore we create a more complex Efl.Ui.Text object and use it as content for the button.
var label = new Efl.Ui.Text(table);
var label = new Efl.Ui.Textbox(table);
label.Editable = false;
label.Halign = 0.5;
label.Valign = 0.5;
label.HorizontalAlign = 0.5;
label.VerticalAlign = 0.5;
label.Color = (r, g, b, 255);
label.SetText(text);
label.Font = ("Sans", (Efl.Font.Size)36);
label.FontFamily = "Sans";
label.FontSize = 36;
button.Content = label;
}
@ -167,15 +168,16 @@ public class Calculator : Efl.Csharp.Application
AddButton(table, "C", 'C', 0, 4, 0, 0, 0);
// Create a big Efl.Ui.Text screen to display the current input
screen = new Efl.Ui.Text(table);
screen = new Efl.Ui.Textbox(table);
screen.SetText("0");
screen.Font = ("Sans", (Efl.Font.Size)48);
screen.FontFamily = "Sans";
screen.FontSize = 48;
screen.Multiline = false;
screen.Editable = false;
screen.SelectionAllowed = false;
table.PackTable(screen, 0, 0, 4, 1);
screen.Halign = 0.9;
screen.Valign = 0.5;
screen.HorizontalAlign = 0.9;
screen.VerticalAlign = 0.5;
screen.EffectType = Efl.TextStyleEffectType.Glow;
screen.GlowColor = (128, 128, 128, 128);
screen.ChangedEvent += ScreenChangedCb;

@ -2,9 +2,6 @@
#include <Elementary.h>
#include <Efl_Ui.h>
// Temporary workaround until Unified Text stops using Legacy classes internally
#include <efl_ui_textbox.eo.h>
#include <efl_text_interactive.eo.h>
static void
_gui_about_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)

@ -2,8 +2,6 @@
#include <Elementary.h>
#include <Efl_Ui.h>
// Temporary workaround until Unified Text stops using Legacy classes internally
#include <efl_ui_textbox.eo.h>
/*
* Efl.UI container examples.

@ -2,9 +2,6 @@
#include <Elementary.h>
#include <Efl_Ui.h>
// Temporary workaround until Unified Text stops using Legacy classes internally
#include <efl_ui_textbox.eo.h>
#include <efl_text_interactive.eo.h>
static void
_gui_quit_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)

Loading…
Cancel
Save