$win = new SDPanel(); $win->setCaption("Add Budget"); $token = new InputText(80); $table = new Table(); $table->setRowsStyle("100%"); $table->setWidth("100%"); $table->setHeight("100%"); $table->setClass("table.white"); $table_form = new Table(); $table_form->setRowsStyle("76dip;76dip"); $table_form->setClass("table.forms"); $money_value = new InputNumeric(15); $money_value->setClass("input.form"); $input_date = new InputDate(); $input_date->setClass("input.form"); $button = new Button(); $button->setCaption("Confirm"); $button->onTap(confirm()); $button->setClass("button.blue"); $table_form->addControl($money_value, 1, 1, 1, 1, "Center", "Middle"); $table_form->addControl($input_date, 2, 1, 1, 1, "Center", "Middle"); $table_button = new Table(); $table_button->addControl($button, 1, 1, 1, 1, "Center", "Middle"); $table->addControl($table_form, 1, 1); $table->addControl($table_button, 2, 1); $win->addControl($table); function confirm() { $token = StorageAPI::Get("token"); ProgressIndicator::ShowWithTitle("Adding budget...");
//Define the acrtion bar $bar = new ActionBar(); $btn_delete = new ButtonBar(); $btn_delete->setCaption("Delete"); $btn_delete->onTap(removeTask()); $btn_delete->setImage("img/deleteBar.png"); $bar->addControl($btn_delete); $win->addControl($bar); //Items definition $name = new InputText(); $name->setClass("input.Common"); $description = new InputText(); $description->setClass("input.Common"); $date = new InputDate(); $date->setLabelCaption("Task date"); $date->setClass("input.Common"); $addToCalendar = new InputBoolean(); $addToCalendar->setLabelCaption("Add to my calendar"); $addToCalendar->setLabelPosition("Right"); //Main table definition $table = new Table(); $table->setClass("table.Background"); $table_form = new Table(); $table_form->setClass("table.Form"); $table_form->setRowsStyle("65dip;65dip;120dip;55dip"); $table_form->setHeight("90%"); $table_form->addControl($name, 1, 1, 1, 2); $table_form->addControl($date, 2, 1, 1, 2); $table_form->addControl($description, 3, 1, 1, 2, "Left", "Top"); $table_form->addControl($addToCalendar, 4, 1, 1, 1, "Left", "Top"); $btn_save = new Button();