#include "IME27.h"

IME27::IME27(HmiApp* app, STTWidget *par, const string& id, const string& desc) : STTPage(app->getRuntime(), par, id, desc) {
	hmiApp = app;
}

IME27::~IME27() {
}

void IME27::onInit() {

}

void IME27::createParts() {
	setMainArg(0, 0, 320, 240);
	setMainStyle(0, 0x0, 0xffffff, 0, 255, 0, 0xc0c0c0, "./images/img1763449642_320X240R0.jpg");

	/*----------------------------- MButton : wMMButton79                -----------------------------*/
	wMMButton79 = new STTButton(p_rt, this, "wMMButton79", 1);
	wMMButton79->setMainArg(8, 65, 54, 48, false);
	wMMButton79->setImg("1", "./images/img17635440133840_54X48R0.png", "1");
	wMMButton79->setImg("0", "", "1");

	/*----------------------------- MButton : wMMButton80                -----------------------------*/
	wMMButton80 = new STTButton(p_rt, this, "wMMButton80", 1);
	wMMButton80->setMainArg(71, 65, 54, 48, false);
	wMMButton80->setImg("1", "./images/img17635440133840_54X48R0.png", "2");
	wMMButton80->setImg("0", "", "2");

	/*----------------------------- MButton : wMMButton81                -----------------------------*/
	wMMButton81 = new STTButton(p_rt, this, "wMMButton81", 1);
	wMMButton81->setMainArg(132, 65, 54, 48, false);
	wMMButton81->setImg("1", "./images/img17635440133840_54X48R0.png", "3");
	wMMButton81->setImg("0", "", "3");

	/*----------------------------- MButton : wMMButton82                -----------------------------*/
	wMMButton82 = new STTButton(p_rt, this, "wMMButton82", 1);
	wMMButton82->setMainArg(194, 65, 54, 48, false);
	wMMButton82->setImg("1", "./images/img17635440133840_54X48R0.png", "-");
	wMMButton82->setImg("0", "", "-");

	/*----------------------------- MButton : wMMButton83                -----------------------------*/
	wMMButton83 = new STTButton(p_rt, this, "wMMButton83", 1);
	wMMButton83->setMainArg(256, 65, 54, 48, false);
	wMMButton83->setImg("1", "./images/img17635440133840_54X48R0.png", "Del");
	wMMButton83->setImg("0", "", "Del");

	/*----------------------------- MButton : wMMButton84                -----------------------------*/
	wMMButton84 = new STTButton(p_rt, this, "wMMButton84", 1);
	wMMButton84->setMainArg(8, 121, 54, 48, false);
	wMMButton84->setImg("1", "./images/img17635440133840_54X48R0.png", "4");
	wMMButton84->setImg("0", "", "4");

	/*----------------------------- MButton : wMMButton85                -----------------------------*/
	wMMButton85 = new STTButton(p_rt, this, "wMMButton85", 1);
	wMMButton85->setMainArg(71, 121, 54, 48, false);
	wMMButton85->setImg("1", "./images/img17635440133840_54X48R0.png", "5");
	wMMButton85->setImg("0", "", "5");

	/*----------------------------- MButton : wMMButton86                -----------------------------*/
	wMMButton86 = new STTButton(p_rt, this, "wMMButton86", 1);
	wMMButton86->setMainArg(132, 121, 54, 48, false);
	wMMButton86->setImg("1", "./images/img17635440133840_54X48R0.png", "6");
	wMMButton86->setImg("0", "", "6");

	/*----------------------------- MButton : wMMButton87                -----------------------------*/
	wMMButton87 = new STTButton(p_rt, this, "wMMButton87", 1);
	wMMButton87->setMainArg(194, 121, 54, 48, false);
	wMMButton87->setImg("1", "./images/img17635440133840_54X48R0.png", ".");
	wMMButton87->setImg("0", "", ".");

	/*----------------------------- MButton : wMMButton88                -----------------------------*/
	wMMButton88 = new STTButton(p_rt, this, "wMMButton88", 1);
	wMMButton88->setMainArg(256, 121, 54, 48, false);
	wMMButton88->setImg("1", "./images/img17635440133840_54X48R0.png", "Esc");
	wMMButton88->setImg("0", "", "Esc");

	/*----------------------------- MButton : wMMButton89                -----------------------------*/
	wMMButton89 = new STTButton(p_rt, this, "wMMButton89", 1);
	wMMButton89->setMainArg(8, 176, 54, 48, false);
	wMMButton89->setImg("1", "./images/img17635440133840_54X48R0.png", "7");
	wMMButton89->setImg("0", "", "7");

	/*----------------------------- MButton : wMMButton90                -----------------------------*/
	wMMButton90 = new STTButton(p_rt, this, "wMMButton90", 1);
	wMMButton90->setMainArg(71, 176, 54, 48, false);
	wMMButton90->setImg("1", "./images/img17635440133840_54X48R0.png", "8");
	wMMButton90->setImg("0", "", "8");

	/*----------------------------- MButton : wMMButton91                -----------------------------*/
	wMMButton91 = new STTButton(p_rt, this, "wMMButton91", 1);
	wMMButton91->setMainArg(132, 176, 54, 48, false);
	wMMButton91->setImg("1", "./images/img17635440133840_54X48R0.png", "9");
	wMMButton91->setImg("0", "", "9");

	/*----------------------------- MButton : wMMButton92                -----------------------------*/
	wMMButton92 = new STTButton(p_rt, this, "wMMButton92", 1);
	wMMButton92->setMainArg(194, 176, 54, 48, false);
	wMMButton92->setImg("1", "./images/img17635440133840_54X48R0.png", "0");
	wMMButton92->setImg("0", "", "0");

	/*----------------------------- MButton : wMMButton93                -----------------------------*/
	wMMButton93 = new STTButton(p_rt, this, "wMMButton93", 1);
	wMMButton93->setMainArg(256, 176, 54, 48, false);
	wMMButton93->setImg("1", "./images/img17635440133840_54X48R0.png", "Ent");
	wMMButton93->setImg("0", "", "Ent");

	/*----------------------------- TextArea : wMTextArea9               -----------------------------*/
	wMTextArea9 = new STTTextArea(p_rt, this, "wMTextArea9");
	wMTextArea9->setMainArg(8, 23, 260, 36, false, false, TextAlign::LEFT, -1, -1, -99999999, 99999999, false);
	wMTextArea9->setMainStyle(7, 0xffffff, 0xffffff, 0, 2, 0xc0c0c0, 4, 0, 4, 4, 255);
	wMTextArea9->setPlaceholderText("")->setMaxLength(0)->setAcceptedChars("")->setImeMode(IME::NA);
	wMTextArea9->setFont(0x0, 16, "文泉驿微米黑", 0);

	/*----------------------------- MButton : wMMButton94                -----------------------------*/
	wMMButton94 = new STTButton(p_rt, this, "wMMButton94", 1);
	wMMButton94->setMainArg(281, 1, 38, 33, false);
	wMMButton94->setImg("1", "./images/img17635440133840_38X33R0.png", "Del");
	wMMButton94->setImg("0", "", "Del");

	/*----------------------------- Label : wMLabel134                   -----------------------------*/
	wMLabel134 = new STTLabel(p_rt, this, "wMLabel134");
	wMLabel134->setMainArg(7, 3, 42, 19, "Min:", TextAlign::LEFT, LabelLongMode::WRAP, 30);
	wMLabel134->setFonts(0xffffff, 16, "文泉驿微米黑", 0);
	wMLabel134->setMainStyle(0, 0xffffff, 0xffffff, GradDir::NONE, 0, 0x0, 0);
	wMLabel134->setFormatText(TextAlign::LEFT, LabelLongMode::WRAP, 30);

	/*----------------------------- Label : wMLabel135                   -----------------------------*/
	wMLabel135 = new STTLabel(p_rt, this, "wMLabel135");
	wMLabel135->setMainArg(130, 3, 46, 19, "Max:", TextAlign::LEFT, LabelLongMode::WRAP, 30);
	wMLabel135->setFonts(0xffffff, 16, "文泉驿微米黑", 0);
	wMLabel135->setMainStyle(0, 0xffffff, 0xffffff, GradDir::NONE, 0, 0x0, 0);
	wMLabel135->setFormatText(TextAlign::LEFT, LabelLongMode::WRAP, 30);

	/*----------------------------- TextNumber : wMTextNumber4           -----------------------------*/
	wMTextNumber4 = new STTTextArea(p_rt, this, "wMTextNumber4");
	wMTextNumber4->setMainArg(48, 2, 76, 20, false, true, TextAlign::CENTER, -1, -1, -99999999, 99999999, false);
	wMTextNumber4->setMainStyle(7, 0xffffff, 0xffffff, 0, 2, 0xc0c0c0, 0, 0, 4, 4, 255);
	wMTextNumber4->setPlaceholderText("")->setMaxLength(0)->setAcceptedChars("")->setImeMode(IME::DIGITAL);
	wMTextNumber4->setFont(0x0, 16, "文泉驿微米黑", 0);
	wMTextNumber4->setText("8888");

	/*----------------------------- TextNumber : wMTextNumber5           -----------------------------*/
	wMTextNumber5 = new STTTextArea(p_rt, this, "wMTextNumber5");
	wMTextNumber5->setMainArg(175, 2, 92, 20, false, true, TextAlign::CENTER, -1, -1, -99999999, 99999999, false);
	wMTextNumber5->setMainStyle(7, 0xffffff, 0xffffff, 0, 2, 0xc0c0c0, 0, 0, 4, 4, 255);
	wMTextNumber5->setPlaceholderText("")->setMaxLength(0)->setAcceptedChars("")->setImeMode(IME::DIGITAL);
	wMTextNumber5->setFont(0x0, 16, "文泉驿微米黑", 0);
	wMTextNumber5->setText("8888");

	/*called after widget created.*/

	return; //createParts END
}

void IME27::onLoad() {

}

bool IME27::onClosing() {
	return true;
}

void IME27::onDispose() {

}

void IME27::wMButton1_clk_cb(uint16_t code, LvEvent e) {
	/*wMButton1（0）的点击事件*/
	NumPad::sendCode(NumPad::KEY_0);
}

void IME27::wMButton2_clk_cb(uint16_t code, LvEvent e) {
	/*wMButton2（1）的点击事件*/
	NumPad::sendCode(NumPad::KEY_1);
}

void IME27::wMButton3_clk_cb(uint16_t code, LvEvent e) {
	/*wMButton3（2）的点击事件*/
	NumPad::sendCode(NumPad::KEY_2);
}

void IME27::wMButton4_clk_cb(uint16_t code, LvEvent e) {
	/*wMButton4（3）的点击事件*/
	NumPad::sendCode(NumPad::KEY_3);
}

void IME27::wMButton5_clk_cb(uint16_t code, LvEvent e) {
	/*wMButton5（4）的点击事件*/
	NumPad::sendCode(NumPad::KEY_4);
}

void IME27::wMButton6_clk_cb(uint16_t code, LvEvent e) {
	/*wMButton6（5）的点击事件*/
	NumPad::sendCode(NumPad::KEY_5);
}

void IME27::wMButton7_clk_cb(uint16_t code, LvEvent e) {
	/*wMButton7（6）的点击事件*/
	NumPad::sendCode(NumPad::KEY_6);
}

void IME27::wMButton8_clk_cb(uint16_t code, LvEvent e) {
	/*wMButton8（7）的点击事件*/
	NumPad::sendCode(NumPad::KEY_7);
}

void IME27::wMButton9_clk_cb(uint16_t code, LvEvent e) {
	/*wMButton9（8）的点击事件*/
	NumPad::sendCode(NumPad::KEY_8);
}

void IME27::wMButton10_clk_cb(uint16_t code, LvEvent e) {
	/*wMButton10（9）的点击事件*/
	NumPad::sendCode(NumPad::KEY_9);
}

void IME27::wMButton11_clk_cb(uint16_t code, LvEvent e) {
	/*wMButton11（+/-）的点击事件*/
	NumPad::sendCode(NumPad::KEY_SIGN);
}

void IME27::wMButton12_clk_cb(uint16_t code, LvEvent e) {
	/*wMButton12（.）的点击事件*/
	NumPad::sendCode(NumPad::KEY_Point);
}

void IME27::wMButton20_clk_cb(uint16_t code, LvEvent e) {
	/*wMButton20（DEL）的点击事件*/
	NumPad::sendCode(NumPad::KEY_BACK);
}

void IME27::wMButton21_clk_cb(uint16_t code, LvEvent e) {
	/*wMButton21（确定）的点击事件*/
	NumPad::sendCode(NumPad::KEY_ENTER);
}

void IME27::wMButton22_clk_cb(uint16_t code, LvEvent e) {
	/*wMButton22（取消）的点击事件*/
	NumPad::sendCode(NumPad::KEY_CANCEL);
}
