Ejemplo n.º 1
0
CScopeWindow::CScopeWindow (UG_S16 sPosX0, UG_S16 sPosY0, CRecorder *pRecorder, CScopeConfig *pConfig)
:	m_pRecorder (pRecorder),
	m_pConfig (pConfig),
	m_nChannelEnable (0),
	m_pTimeLine (0)
{
	assert (m_pRecorder != 0);

	UG_WindowCreate (&m_Window, m_ObjectList, s_ObjectCount, Callback);
	UG_WindowSetStyle (&m_Window, WND_STYLE_2D | WND_STYLE_HIDE_TITLE);
	UG_WindowResize (&m_Window, sPosX0, sPosY0, sPosX0+WIDTH-1, sPosY0+HEIGHT-1);

	UG_TextboxCreate (&m_Window, &m_Textbox1, TXB_ID_0, 5, 5, 149, 25);
	UG_TextboxSetFont (&m_Window, TXB_ID_0, &FONT_10X16);
	UG_TextboxSetText (&m_Window, TXB_ID_0, "TinyScope Pi");
	UG_TextboxSetBackColor (&m_Window, TXB_ID_0, C_LIGHT_GRAY);
	UG_TextboxSetForeColor (&m_Window, TXB_ID_0, C_BLACK);
	UG_TextboxSetAlignment (&m_Window, TXB_ID_0, ALIGN_CENTER);

	UG_WindowShow (&m_Window);

	UG_Update ();

	UpdateChart ();
}
Ejemplo n.º 2
0
void sms_info_window_create(void)
{
    static UG_BUTTON buttons[3];
    static UG_OBJECT objects[3];
    char *actions[] = { "1", "G" };
    int i = 0;

    UG_WindowCreate(&g_sms_info_window, objects,
            sizeof(objects) / sizeof(*objects), sms_info_window_callback);
    UG_WindowSetStyle(&g_sms_info_window, WND_STYLE_2D);

    for (i = 0; i < 2; i++) {
        int index = i;
        UG_ButtonCreate(&g_sms_info_window, buttons + index, index, 120 * i,
                200, 120 * i + 120 - 1, 239);
        UG_ButtonSetFont(&g_sms_info_window, index, &FONT_ICON24);
        UG_ButtonSetText(&g_sms_info_window, index, actions[i]);
        UG_ButtonSetStyle(&g_sms_info_window, index,
                BTN_STYLE_2D | BTN_STYLE_TOGGLE_COLORS | BTN_STYLE_NO_BORDERS);

    }

    UG_ButtonCreate(&g_sms_info_window, buttons + 2, 2, 10, 10, 229, 189);
    UG_ButtonSetFont(&g_sms_info_window, 2, &FONT_SIZE20);
    UG_ButtonSetStyle(&g_sms_info_window, 2,
            BTN_STYLE_2D | BTN_STYLE_NO_BORDERS);
    UG_ButtonSetBackColor(&g_sms_info_window, 2, 0);
    UG_ButtonSetAlignment(&g_sms_info_window, 2, ALIGN_TOP_LEFT);
    UG_ButtonSetHSpace(&g_sms_info_window, 2, 8);
}
Ejemplo n.º 3
0
void sms_new_window_create(void)
{
    static UG_BUTTON buttons[14];
    static UG_OBJECT objects[14];
    char *actions[] = { "1", "4", "3", "F" };
    int i = 0;
    int index;

    UG_WindowCreate(&g_sms_new_window, objects,
            sizeof(objects) / sizeof(*objects), sms_new_window_callback);
    UG_WindowSetStyle(&g_sms_new_window, WND_STYLE_2D);

    for (i = 0; i < 4; i++) {
        index = i;
        UG_ButtonCreate(&g_sms_new_window, buttons + index, index, 60 * i,
                200, 60 * i + 60 - 1, 239);
        UG_ButtonSetFont(&g_sms_new_window, index, &FONT_ICON24);
        UG_ButtonSetText(&g_sms_new_window, index, actions[i]);
        UG_ButtonSetStyle(&g_sms_new_window, index,
                BTN_STYLE_2D | BTN_STYLE_TOGGLE_COLORS | BTN_STYLE_NO_BORDERS);

    }

    index = 4;
    UG_ButtonCreate(&g_sms_new_window, buttons + index, index, 0, 0, 39, 39);
    UG_ButtonSetFont(&g_sms_new_window, index, &FONT_SIZE20);
    UG_ButtonSetStyle(&g_sms_new_window, index,
            BTN_STYLE_2D | BTN_STYLE_TOGGLE_COLORS | BTN_STYLE_NO_BORDERS);
    UG_ButtonSetText(&g_sms_new_window, index, "To");
    //UG_ButtonSetBackColor(&g_sms_new_window, index, 0);

    index = 5;
    UG_ButtonCreate(&g_sms_new_window, buttons + index, index, 40, 0, 239, 39);
    UG_ButtonSetFont(&g_sms_new_window, index, &FONT_SIZE20);
    UG_ButtonSetStyle(&g_sms_new_window, index,
            BTN_STYLE_2D | BTN_STYLE_TOGGLE_COLORS | BTN_STYLE_NO_BORDERS);
    //UG_ButtonSetBackColor(&g_sms_new_window, index, 0);



    for (i = 0; i < 4; i++) {
        index = 6 + i;
        UG_ButtonCreate(&g_sms_new_window, buttons + index, index, 0, 40 * i + 40, 39, 40 * i + 80 - 1);
        UG_ButtonSetFont(&g_sms_new_window, index, &FONT_ICON24);
        UG_ButtonSetStyle(&g_sms_new_window, index,
                BTN_STYLE_2D | BTN_STYLE_TOGGLE_COLORS | BTN_STYLE_NO_BORDERS);
        UG_ButtonSetBackColor(&g_sms_new_window, index, 0xc44d58);

        index += 4;
        UG_ButtonCreate(&g_sms_new_window, buttons + index, index, 40, 40 * i + 40, 239, 40 * i + 80 - 1);
        UG_ButtonSetFont(&g_sms_new_window, index, &FONT_SIZE20);
        UG_ButtonSetStyle(&g_sms_new_window, index,
                BTN_STYLE_2D | BTN_STYLE_TOGGLE_COLORS | BTN_STYLE_NO_BORDERS);
        UG_ButtonSetBackColor(&g_sms_new_window, index, 0xc44d58);
        UG_ButtonSetAlignment(&g_sms_new_window, index, ALIGN_CENTER_LEFT);
        UG_ButtonSetHSpace(&g_sms_new_window, index, 8);
    }
}
void settings_window_create(void)
{
    char *button_texts[] = { "1", //icon font
                "", "", "-", "3", "+", "-", "3", "+"};
    static UG_BUTTON buttons[16];
    static UG_OBJECT objects[16];
    int id = 0;
    int i = 0;
    int j = 0;

    UG_WindowCreate(&g_settings_window, objects, 16, settings_window_callback);
    UG_WindowSetStyle(&g_settings_window, WND_STYLE_2D);

    for (i = 0; i < 3; i++) {
        for (j = 0; j < 3; j++) {
            id = i * 3 + j;
            UG_ButtonCreate(&g_settings_window, buttons + id, id, 80 * j,
                    200 - i * 80, 80 * j + 79, 239 - i * 80);
            UG_ButtonSetFont(&g_settings_window, id, &FONT_SIZE20);
            UG_ButtonSetText(&g_settings_window, id,
                    button_texts[id]);
            UG_ButtonSetStyle(&g_settings_window, id,
                    BTN_STYLE_2D | BTN_STYLE_TOGGLE_COLORS
                            | BTN_STYLE_NO_BORDERS);
        }
    }

    UG_ButtonSetFont(&g_settings_window, 0, &FONT_ICON24);

    id++;
    UG_ButtonCreate(&g_settings_window, buttons + id, id, 0, 0, 239, 39);
    UG_ButtonSetFont(&g_settings_window, id, &FONT_SIZE20);
    UG_ButtonSetText(&g_settings_window, id, "Brightness");
    UG_ButtonSetStyle(&g_settings_window, id,
            BTN_STYLE_2D | BTN_STYLE_NO_BORDERS);
    UG_ButtonSetBackColor(&g_settings_window, id, 0);

    id++;
    UG_ButtonCreate(&g_settings_window, buttons + id, id, 0, 80, 239, 119);
    UG_ButtonSetFont(&g_settings_window, id, &FONT_SIZE20);
    UG_ButtonSetText(&g_settings_window, id, "Sound");
    UG_ButtonSetStyle(&g_settings_window, id,
            BTN_STYLE_2D | BTN_STYLE_NO_BORDERS);
    UG_ButtonSetBackColor(&g_settings_window, id, 0);

    settings_load();
}
Ejemplo n.º 5
0
void sms_inbox_window_create(void)
{
    static UG_BUTTON buttons[9];
    static UG_OBJECT objects[9];
    char *actions[] = { "1", "4", "3", "A" };
    int i = 0;
    int offset = 0;

    UG_WindowCreate(&g_sms_inbox_window, objects,
            sizeof(objects) / sizeof(*objects), sms_inbox_window_callback);
    UG_WindowSetStyle(&g_sms_inbox_window, WND_STYLE_2D);

    for (i = 0; i < 2; i++) {
        UG_ButtonCreate(&g_sms_inbox_window, buttons + i, i, 0, 80 * i + 40,
                239, 80 * (i + 1) + 40 - 1);
        UG_ButtonSetFont(&g_sms_inbox_window, i, &FONT_SIZE20);
        UG_ButtonSetStyle(&g_sms_inbox_window, i,
                BTN_STYLE_2D | BTN_STYLE_TOGGLE_COLORS | BTN_STYLE_NO_BORDERS);

        UG_ButtonSetAlignment(&g_sms_inbox_window, i, ALIGN_CENTER_LEFT);
        UG_ButtonSetHSpace(&g_sms_inbox_window, i, 8);
    }

    offset += 2;
    for (i = 0; i < 4; i++) {
        int index = offset + i;
        UG_ButtonCreate(&g_sms_inbox_window, buttons + index, index, 60 * i,
                200, 60 * i + 60 - 1, 239);
        UG_ButtonSetFont(&g_sms_inbox_window, index, &FONT_ICON24);
        UG_ButtonSetText(&g_sms_inbox_window, index, actions[i]);
        UG_ButtonSetStyle(&g_sms_inbox_window, index,
                BTN_STYLE_2D | BTN_STYLE_TOGGLE_COLORS | BTN_STYLE_NO_BORDERS);

    }

    offset += 4;
    UG_ButtonCreate(&g_sms_inbox_window, buttons + offset, offset, 0, 0, 239, 39);
    UG_ButtonSetFont(&g_sms_inbox_window, offset, &FONT_SIZE20);
    UG_ButtonSetText(&g_sms_inbox_window, offset, "Inbox");
    UG_ButtonSetStyle(&g_sms_inbox_window, offset,
            BTN_STYLE_2D | BTN_STYLE_NO_BORDERS);
    UG_ButtonSetBackColor(&g_sms_inbox_window, offset, 0x000000);
}
Ejemplo n.º 6
0
void dial_window_create(void)
{
    static UG_BUTTON buttons[16];
    static UG_OBJECT objects[16];
    int i = 0;
    int j = 0;

    UG_WindowCreate(&g_dial_window, objects, 16, dial_window_callback);
    UG_WindowSetStyle(&g_dial_window, WND_STYLE_2D);

    for(i = 0; i < 4; i++) {
        for(j = 0; j < 3; j++) {
            int index = i * 3 + j;
            UG_ButtonCreate(
                &g_dial_window, buttons + index, index, 80 * j, 40 * (i + 1), 80 * (j + 1) - 1, 40 * (i + 2) - 1);
            UG_ButtonSetFont(&g_dial_window, index, &FONT_SIZE20);
            UG_ButtonSetText(&g_dial_window, index, g_dial_button_text[index]);
            UG_ButtonSetStyle(&g_dial_window, index, BTN_STYLE_2D | BTN_STYLE_TOGGLE_COLORS | BTN_STYLE_NO_BORDERS);
        }
    }

    for(j = 0; j < 3; j++) {
        int index = 4 * 3 + j;
        UG_ButtonCreate(
            &g_dial_window, buttons + index, index, 80 * j, 40 * (i + 1), 80 * (j + 1) - 1, 40 * (i + 2) - 1);
        UG_ButtonSetFont(&g_dial_window, index, &FONT_ICON24);
        UG_ButtonSetText(&g_dial_window, index, g_dial_button_text[index]);
        UG_ButtonSetStyle(&g_dial_window, index, BTN_STYLE_2D | BTN_STYLE_TOGGLE_COLORS | BTN_STYLE_NO_BORDERS);
    }

    UG_ButtonCreate(&g_dial_window, buttons + 15, 15, 0, 0, 239, 39);
    UG_ButtonSetFont(&g_dial_window, 15, &FONT_SIZE20);
    UG_ButtonSetText(&g_dial_window, 15, g_outgoing_number);
    UG_ButtonSetStyle(&g_dial_window, 15, BTN_STYLE_2D | BTN_STYLE_NO_BORDERS);
    UG_ButtonSetBackColor(&g_dial_window, 15, 0); // 0x37474f);

    // UG_ButtonSetBackColor(&g_dial_window, CALL_BTN_ID, 0x4CAF50);
}
Ejemplo n.º 7
0
void sms_sending_window_create(void)
{
    static UG_BUTTON button;
    static UG_TEXTBOX textboxs[2];
    static UG_OBJECT objects[3];

    UG_WindowCreate(&g_sms_sending_window, objects, 3, sms_sending_window_callback);

    UG_TextboxCreate(&g_sms_sending_window, textboxs, TXB_ID_0, 10, 10, 230, 80);
    UG_TextboxSetFont(&g_sms_sending_window, TXB_ID_0, &FONT_SIZE20);
    UG_TextboxSetText(&g_sms_sending_window, 0, "Sending   message");

    UG_TextboxCreate(&g_sms_sending_window, textboxs + 1, TXB_ID_1, 10, 90, 230,
            170);
    UG_TextboxSetFont(&g_sms_sending_window, TXB_ID_1, &FONT_SIZE20);

    UG_ButtonCreate(&g_sms_sending_window, &button, BTN_ID_0, 0, 180, 239, 239);
    UG_ButtonSetFont(&g_sms_sending_window, BTN_ID_0, &FONT_SIZE20);
    UG_ButtonSetText(&g_sms_sending_window, BTN_ID_0, "OK");
    UG_ButtonSetStyle(&g_sms_sending_window, BTN_ID_0,
            BTN_STYLE_2D | BTN_STYLE_TOGGLE_COLORS | BTN_STYLE_NO_BORDERS);
    //UG_ButtonSetBackColor(&g_sms_sending_window, BTN_ID_0, 0xf44336);
}
Ejemplo n.º 8
0
void contact_list_window_create(void)
{
    static UG_BUTTON buttons[9];
    static UG_OBJECT objects[9];
    char* actions[] = { "1", "4", "3", "B" };
    int i = 0;

    UG_WindowCreate(&g_contact_list_window, objects, sizeof(objects) / sizeof(*objects), contact_list_window_callback);
    UG_WindowSetStyle(&g_contact_list_window, WND_STYLE_2D);

    for(i = 0; i < 4; i++) {
        UG_ButtonCreate(&g_contact_list_window, buttons + i, i, 0, 40 * i + 40, 239, 40 * (i + 1) + 40 - 1);
        UG_ButtonSetFont(&g_contact_list_window, i, &FONT_SIZE20);
        UG_ButtonSetStyle(&g_contact_list_window, i, BTN_STYLE_2D | BTN_STYLE_TOGGLE_COLORS | BTN_STYLE_NO_BORDERS);

        UG_ButtonSetAlignment(&g_contact_list_window, i, ALIGN_CENTER_LEFT);
        UG_ButtonSetHSpace(&g_contact_list_window, i, 8);
    }

    for(i = 0; i < 4; i++) {
        int index = 4 + i;
        UG_ButtonCreate(&g_contact_list_window, buttons + index, index, 60 * i, 200, 60 * i + 60 - 1, 239);
        UG_ButtonSetFont(&g_contact_list_window, index, &FONT_ICON24);
        UG_ButtonSetText(&g_contact_list_window, index, actions[i]);
        UG_ButtonSetStyle(&g_contact_list_window, index, BTN_STYLE_2D | BTN_STYLE_TOGGLE_COLORS | BTN_STYLE_NO_BORDERS);
    }

    UG_ButtonCreate(&g_contact_list_window, buttons + 8, 8, 0, 0, 239, 39);
    UG_ButtonSetFont(&g_contact_list_window, 8, &FONT_SIZE20);
    UG_ButtonSetText(&g_contact_list_window, 8, "Contacts");
    UG_ButtonSetStyle(&g_contact_list_window, 8, BTN_STYLE_2D | BTN_STYLE_NO_BORDERS);
    UG_ButtonSetBackColor(&g_contact_list_window, 8, 0x000000);

    book_open();
    dial_window_create();
}