/*
 * Voip.fx
 *
 * Created on Nov 30, 2009, 8:04:42 PM
 */
package mdot_gui;

import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.layout.HBox;
import javafx.scene.input.MouseEvent;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.Text;

/**
 * @author Jamie Lynn
 */
public class Voip extends CustomNode {

    public override function create(): Node {
        visible = false;
        id = "Voip";
        Group {
            var txtStatus = Text {
                        font: Font { size: 22 }
                        fill: Color.WHITE
                        content: bind MainScreen.voipCallStatus;
                    }
            content: [
                Text {
                    translateX: Constants.WINDOW_WIDTH / 2 - 35
                    translateY: Constants.WINDOW_HEIGHT / 5
                    font: Font { size: 40 }
                    fill: Color.WHITE
                    content: "Voip"
                }
                ToggleButton {
                    id: "btnCallHangup"
                    index: 0
                    translateX: Constants.WINDOW_WIDTH / 2 - Constants.BUTTON_SIZE / 2;
                    translateY: Constants.WINDOW_HEIGHT / 3;
                    imageButton1: CommonFunctionsFX.getImage("call_lg");
                    imageButton2: CommonFunctionsFX.getImage("hangup_lg");
                    //Start
                    onclickButton1Action: function () {
                        mjua_edit.VoipControl.test.makeCall();
                    }
                    //Stop
                    onclickButton2Action: function () {
                        mjua_edit.VoipControl.test.endCall();
                    }
                }
                Group {
                    translateX: (Constants.WINDOW_WIDTH / 3)
                    translateY: (Constants.WINDOW_HEIGHT / 5) * 3.5;
                    content: txtStatus
                }
            ]
        }
    }

}

