예제 #1
0
static int get_drop_command(const char *filename, int flags)
{
    const char *e;

    e = file_extension(filename);
    if (*e && stristr(".bmp.gif.png.jpg.jpeg", e)) {
        unsigned modkey = get_modkeys() & (MK_ALT|MK_SHIFT|MK_CONTROL);
        const char *mode;
        if (0 == modkey)
            mode = "full";
        else
        if (MK_SHIFT == modkey)
            mode = "center";
        else
        if (MK_CONTROL == modkey)
            mode = "tile";
        else
            return 0;
        if (0 == (flags & 1))
            post_command_fmt("@BBCore.rootCommand bsetroot -%s \"%s\"", mode, filename);
        return 1;
    }

    // whether its a style is checked only once by looking at
    // the file's contents on DragEnter
    if (flags & 2) {
        if (0 == (flags & 1))
            post_command_fmt(MM_STYLE_BROAM, filename);
        return 1;
    }

    return 0;
}
예제 #2
0
void IntegerItem::Invoke(int button)
{
    if (0 == m_direction)
        return;
    m_direction = 0;
    m_count = 0;
    if (INVOKE_LEFT & button) {
        if (strstr(m_pszCommand, "%d"))
            post_command_fmt(m_pszCommand, m_value);
        else
            post_command_fmt("%s %d", m_pszCommand, m_value);
    }
}
예제 #3
0
void StringItem::Invoke(int button)
{
    char *buff;
    int len;
    if (Settings_menu.showBroams)
        return;
    len = 1 + GetWindowTextLength(hText);
    buff = (char*)m_alloc(len);
    GetWindowText(hText, buff, len);
    replace_str(&m_pszTitle, buff);
    if (SendMessage(hText, EM_GETMODIFY, 0, 0) || (button & INVOKE_RET)) {
        SendMessage(hText, EM_SETMODIFY, FALSE, 0);
        if (strstr(m_pszCommand, "%s") || strstr(m_pszCommand, "%q"))
            post_command_fmt(m_pszCommand, buff);
        else
            post_command_fmt("%s %s", m_pszCommand, buff);
    }
    m_free(buff);
}