Exemplo n.º 1
0
bool PenWindow::init()
{
   CEGUI::WindowManager& wm = CEGUI::WindowManager::getSingleton();
   CEGUI::Renderer* pr = CEGUI::System::getSingleton().getRenderer();

#define CREATE_BUTTON(I,J,NAME) {\
   _button[I][J] = static_cast< CEGUI::PushButton* >(\
     wm.loadWindowLayout(NAME));\
   _button[I][J]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&PenWindow::onPush, this));\
   this->addChildWindow(_button[I][J]);\
   }
   CREATE_BUTTON(EditPen::PEN_ACTION,  EditPen::ACTION_DEFAULT, "DefaultPenButton.layout");
   CREATE_BUTTON(EditPen::PEN_NEWMOVE, EditPen::MOVE_LINE,      "LineButton.layout");
   CREATE_BUTTON(EditPen::PEN_NEWMOVE, EditPen::MOVE_ELLIPSE,   "EllipseButton.layout");
   CREATE_BUTTON(EditPen::PEN_NEWMOVE, EditPen::MOVE_SPLINE,    "SplineButton.layout");
#undef CREATE_BUTTON

   {
      EvEditorPen ev;
      ev._main = EditPen::PEN_ACTION;
      ev._sub  = EditPen::ACTION_DEFAULT;
      g_pFnd->getEventManager()->queue(&ev);
   }

   return true;
}
Exemplo n.º 2
0
Arquivo: ui.c Projeto: Matsu616/uTox
/***********************************************************************
 *                                                                     *
 * Panel layout size set functions.                                    *
 *                                                                     *
 **********************************************************************/
static void sidepanel_USERBADGE(void) {
    // Converting DEFINES to magic becaues this will be moved to layout/
    // and will then get a different format/selection
    CREATE_BUTTON(avatar,     10, SIDEBAR_AVATAR_TOP, 40, 40);
    CREATE_BUTTON(name,       64, SIDEBAR_NAME_TOP, SIDEBAR_NAME_WIDTH, SIDEBAR_NAME_HEIGHT - 2);
    CREATE_BUTTON(status_msg, 64, SIDEBAR_STATUSMSG_TOP, SIDEBAR_STATUSMSG_WIDTH, SIDEBAR_STATUSMSG_HEIGHT - 2);
    CREATE_BUTTON(usr_state,  210, 10, 20, 40);
}
Exemplo n.º 3
0
Arquivo: ui.c Projeto: Matsu616/uTox
static void sidepanel_FLIST(void) {
    scrollbar_flist.panel.y      = 0;
    // scrollbar_flist.panel.width  = 230; // TODO remove?
    scrollbar_flist.panel.height = -1;

    panel_flist.x      = 0;
    panel_flist.y      = 70;
    panel_flist.width  = 230; // TODO remove?
    panel_flist.height = ROSTER_BOTTOM;


    CREATE_BUTTON(filter_friends, SIDEBAR_FILTER_FRIENDS_LEFT, SIDEBAR_FILTER_FRIENDS_TOP, SIDEBAR_FILTER_FRIENDS_WIDTH,
                  SIDEBAR_FILTER_FRIENDS_HEIGHT);
    CREATE_EDIT(search, SIDEBAR_SEARCH_LEFT, SIDEBAR_SEARCH_TOP, SIDEBAR_SEARCH_WIDTH, SIDEBAR_SEARCH_HEIGHT);

    CREATE_BUTTON(settings, SIDEBAR_BUTTON_LEFT, ROSTER_BOTTOM, SIDEBAR_BUTTON_WIDTH, SIDEBAR_BUTTON_HEIGHT);
    CREATE_BUTTON(add_new_contact, SIDEBAR_BUTTON_LEFT, ROSTER_BOTTOM, SIDEBAR_BUTTON_WIDTH, SIDEBAR_BUTTON_HEIGHT);
    button_add_new_contact.panel.disabled = true;
}
Exemplo n.º 4
0
Arquivo: ui.c Projeto: Matsu616/uTox
static void settings_PROFILE(void) {
    panel_settings_profile.y = 32;

    CREATE_EDIT(name, 10, 30, -10, 24);

    CREATE_EDIT(status_msg, 10, 85, -10, 24);

    CREATE_EDIT(toxid, 10, 140, -10, 24);
    CREATE_BUTTON(copyid, 66, 117, _BM_SBUTTON_WIDTH, _BM_SBUTTON_HEIGHT);

    CREATE_DROPDOWN(language, 10, 195, 24, -10);
}
Exemplo n.º 5
0
Arquivo: ui.c Projeto: Matsu616/uTox
static void settings_ADV(void) {
    panel_settings_adv.y = 32;

    CREATE_SWITCH(ipv6, 10, 27, _BM_SWITCH_WIDTH, _BM_SWITCH_HEIGHT);
    CREATE_SWITCH(udp,  10, 57, _BM_SWITCH_WIDTH, _BM_SWITCH_HEIGHT);

    CREATE_SWITCH(proxy,       10, 87,  _BM_SWITCH_WIDTH, _BM_SWITCH_HEIGHT);
    CREATE_EDIT(proxy_ip,      230, 87, 120, 24);
    CREATE_EDIT(proxy_port,    360, 87, 60,  24);
    CREATE_SWITCH(proxy_force, 10, 117, _BM_SWITCH_WIDTH, _BM_SWITCH_HEIGHT);

    CREATE_SWITCH(auto_update,           10, 147, _BM_SWITCH_WIDTH, _BM_SWITCH_HEIGHT);
    CREATE_SWITCH(block_friend_requests, 10, 177, _BM_SWITCH_WIDTH, _BM_SWITCH_HEIGHT);

    CREATE_BUTTON(show_password_settings, 10,  207, _BM_SBUTTON_WIDTH, _BM_SBUTTON_HEIGHT);
    CREATE_BUTTON(show_nospam,            300, 207, _BM_SBUTTON_WIDTH, _BM_SBUTTON_HEIGHT);

    CREATE_EDIT(nospam,           10,  265, -10, 24);
    CREATE_BUTTON(change_nospam,  10,  295, _BM_SBUTTON_WIDTH, _BM_SBUTTON_HEIGHT);
    CREATE_BUTTON(revert_nospam,  300, 295, _BM_SBUTTON_WIDTH, _BM_SBUTTON_HEIGHT);

    CREATE_EDIT(profile_password, 10,  85, -10, 24);
    CREATE_BUTTON(lock_uTox,      10,  295, _BM_SBUTTON_WIDTH, _BM_SBUTTON_HEIGHT);
}
Exemplo n.º 6
0
Arquivo: ui.c Projeto: Matsu616/uTox
static void settings_AV(void) {
    panel_settings_av.y = 32;

    CREATE_SWITCH(push_to_talk, 10, 9, _BM_SWITCH_WIDTH, _BM_SWITCH_HEIGHT);

    #ifndef AUDIO_FILTERING
        const uint16_t start_draw_y = 30;
        const uint16_t preview_button_pos_y = 245;
    #else
        const uint16_t start_draw_y = 60;
        const uint16_t preview_button_pos_y = 275;
        CREATE_SWITCH(audio_filtering, 10, 40, _BM_SWITCH_WIDTH, _BM_SWITCH_HEIGHT);
    #endif


    const uint16_t draw_y_vect = 30;
    CREATE_DROPDOWN(audio_in,  10, (start_draw_y + draw_y_vect + 5), 24, 360);
    CREATE_DROPDOWN(audio_out, 10, (start_draw_y + draw_y_vect + 57), 24, 360);
    CREATE_EDIT(video_fps,     10, (start_draw_y + draw_y_vect + 110), 360, 24);
    CREATE_DROPDOWN(video,     10, (start_draw_y + draw_y_vect + 162), 24, 360);

    CREATE_BUTTON(callpreview,  10, (preview_button_pos_y + 35), _BM_LBUTTON_WIDTH, _BM_LBUTTON_HEIGHT);
    CREATE_BUTTON(videopreview, 70, (preview_button_pos_y + 35), _BM_LBUTTON_WIDTH, _BM_LBUTTON_HEIGHT);
}
Exemplo n.º 7
0
Arquivo: ui.c Projeto: Matsu616/uTox
void ui_rescale(uint8_t scale) {
    ui_set_scale(scale);

    flist_re_scale();
    setscale_fonts();
    setfont(FONT_SELF_NAME);

    /* DEFAULT positions */

    panel_main.y = 0;

    scrollbar_settings.panel.y        = 32;  /* TODO magic numbers are bad */
    scrollbar_settings.content_height = 300; /* TODO magic numbers are bad */

    panel_settings_master.y        = 0;
    panel_settings_devices.y       = 32;
    panel_settings_adv.y           = 32;

    scrollbar_friend.panel.y      = MAIN_TOP;
    scrollbar_friend.panel.height = CHAT_BOX_TOP;
    messages_friend.y             = MAIN_TOP;
    messages_friend.height        = CHAT_BOX_TOP - 10;
    messages_friend.width         = -SCROLL_WIDTH;

    scrollbar_group.panel.y      = MAIN_TOP;
    scrollbar_group.panel.height = CHAT_BOX_TOP;
    messages_group.y             = MAIN_TOP;
    messages_group.height        = CHAT_BOX_TOP;
    messages_group.width         = -SCROLL_WIDTH;

    setfont(FONT_SELF_NAME);

    sidepanel_USERBADGE();
    sidepanel_FLIST();

    settings_PROFILE();
    settings_UI();
    settings_AV();
    settings_NOTIFY();
    settings_ADV();

    // FIXME for testing, remove
    CREATE_BUTTON(notify_create, 2, 2, BM_SBUTTON_WIDTH, BM_SBUTTON_HEIGHT);
    CREATE_BUTTON(notify_one, 0, -50, 40, 50);
    CREATE_BUTTON(notify_two, 200, -50, 40, 50);
    CREATE_BUTTON(notify_three, -40, -50, 40, 50);

    CREATE_BUTTON(move_notify, -40, -40, 40, 40);


    /* Setting pages */
    uint32_t settings_x = 4;
    CREATE_BUTTON(settings_sub_profile,         settings_x, 0, 12, 28);
    settings_x += 20 + UN_SCALE(UTOX_STR_WIDTH(PROFILE_BUTTON));

#ifdef ENABLE_MULTIDEVICE
    CREATE_BUTTON(settings_sub_devices,         settings_x, 0, 12, 28);
    settings_x += 20 + UN_SCALE(UTOX_STR_WIDTH(DEVICES_BUTTON));
#endif

    CREATE_BUTTON(settings_sub_ui,              settings_x, 0, 12, 28);
    settings_x += 20 + UN_SCALE(UTOX_STR_WIDTH(USER_INTERFACE_BUTTON));

    CREATE_BUTTON(settings_sub_av,              settings_x, 0, 12, 28);
    settings_x += 20 + UN_SCALE(UTOX_STR_WIDTH(AUDIO_VIDEO_BUTTON));

    CREATE_BUTTON(settings_sub_notifications,   settings_x, 0, 12, 28);
    settings_x += 20 + UN_SCALE(UTOX_STR_WIDTH(NOTIFICATIONS_BUTTON));

    CREATE_BUTTON(settings_sub_adv,             settings_x, 0, 12, 28);


    /* Devices */
    CREATE_BUTTON(add_new_device_to_self, -10 - BM_SBUTTON_WIDTH, 28, BM_SBUTTON_WIDTH, BM_SBUTTON_HEIGHT);

    CREATE_EDIT(add_new_device_to_self, 10, 27, 0 - UTOX_STR_WIDTH(ADD) - BM_SBUTTON_WIDTH, 24);


    /* Friend Add Page */
    CREATE_BUTTON(send_friend_request, -10 - _BM_SBUTTON_WIDTH, MAIN_TOP + 168, _BM_SBUTTON_WIDTH,
                  _BM_SBUTTON_HEIGHT);
    CREATE_BUTTON(accept_friend, -60, -80, _BM_SBUTTON_WIDTH, _BM_SBUTTON_HEIGHT);

    /* Friend Settings Page */
    CREATE_BUTTON(export_chatlog, 10, 208, _BM_SBUTTON_WIDTH, _BM_SBUTTON_HEIGHT);

    CREATE_EDIT(friend_pubkey,          10, 88, -10, 24);
    CREATE_EDIT(friend_alias,           10, 138, -10, 24);

    CREATE_SWITCH(friend_autoaccept_ft, 10, 168, _BM_SWITCH_WIDTH, _BM_SWITCH_HEIGHT);

    /* Group Settings */
    CREATE_EDIT(group_topic, 10, 95, -10, 24);

    /* Friend / Group Page  */
    CREATE_BUTTON(call_decline, -186, 10, _BM_LBUTTON_WIDTH, _BM_LBUTTON_HEIGHT);
    CREATE_BUTTON(call_audio,   -124, 10, _BM_LBUTTON_WIDTH, _BM_LBUTTON_HEIGHT);
    CREATE_BUTTON(call_video,    -62, 10, _BM_LBUTTON_WIDTH, _BM_LBUTTON_HEIGHT);
    CREATE_BUTTON(group_audio,   -62, 10, _BM_LBUTTON_WIDTH, _BM_LBUTTON_HEIGHT);

    CREATE_BUTTON(send_file,         6, -46, _BM_CHAT_BUTTON_WIDTH, _BM_CHAT_BUTTON_HEIGHT);
    CREATE_BUTTON(send_screenshot,   8 + _BM_CHAT_BUTTON_WIDTH, -46, _BM_CHAT_BUTTON_WIDTH, _BM_CHAT_BUTTON_HEIGHT);

    CREATE_BUTTON(chat_send_friend, -6 - _BM_CHAT_SEND_WIDTH, -46, _BM_CHAT_SEND_WIDTH, _BM_CHAT_SEND_HEIGHT);
    CREATE_BUTTON(chat_send_group,  -6 - _BM_CHAT_SEND_WIDTH, -46, _BM_CHAT_SEND_WIDTH, _BM_CHAT_SEND_HEIGHT);

    setfont(FONT_TEXT);

    // Add friend panel
    CREATE_EDIT(add_new_friend_id, 10, 28 + MAIN_TOP, -10, 24);
    CREATE_EDIT(add_new_friend_msg, 10, 76 + MAIN_TOP, -10, 84);

    /* Message entry box for friends and groups */
    CREATE_EDIT(chat_msg_friend, 10 + _BM_CHAT_BUTTON_WIDTH * 2, /* Make space for the left button  */
                -46, -64, 40); /* text is 8 high. 8 * 2.5 = 20. */

    CREATE_EDIT(chat_msg_group, 6, -46, -10 - BM_CHAT_SEND_WIDTH, 40);

    /* Confirm deletion */
    CREATE_BUTTON(confirm_deletion, 10, MAIN_TOP + 40, _BM_SBUTTON_WIDTH, _BM_SBUTTON_HEIGHT);
    CREATE_BUTTON(deny_deletion,    110, MAIN_TOP + 40, _BM_SBUTTON_WIDTH, _BM_SBUTTON_HEIGHT);

    setscale();
}