Пример #1
0
void SpinnerDefaultEditor::cancelEdit(void)
{
    //Reset to the old value
    std::string NewValue;
    try
    {
        getTextField()->setText(getSpinner()->getModel()->getValueAsString());
    }
    catch(boost::bad_any_cast &)
    {
        getTextField()->setText("");
    }
}
Пример #2
0
void SpinnerDefaultEditor::handleModelStateChanged(ChangeEventDetails* const e)
{
    //Update the Value of the TextField
    std::string NewValue;
    try
    {
        getTextField()->setText(getSpinner()->getModel()->getValueAsString());
    }
    catch(boost::bad_any_cast &)
    {
        getTextField()->setText("");
    }
}
Пример #3
0
static void 
textFieldChanged (Widget w, XtPointer scale, XEvent *e, Boolean *cont) {
    *cont = False;
    setRgbScale ((Widget) scale, getTextField(w));
    setCell (getScale(redScale), getScale(greenScale), getScale(blueScale));
    rgbReset();
}
void AutofillPopupMenuClient::popupDidHide()
{
    WebViewImpl* webView = getWebView();
    if (!webView)
        return;

    webView->autofillPopupDidHide();
    webView->autofillClient()->didClearAutofillSelection(WebNode(getTextField()));
}
Пример #5
0
void SpinnerDefaultEditor::commitEdit(void)
{
    try
    {
        getSpinner()->getModel()->setValue(getTextField()->getText());
    }
    catch(IllegalArgumentException&)
    {
        //Reset to the old value
        std::string NewValue;
        try
        {
            getTextField()->setText(getSpinner()->getModel()->getValueAsString());
        }
        catch(boost::bad_any_cast &)
        {
            getTextField()->setText("");
        }
    }
}
void AutofillPopupMenuClient::selectionChanged(unsigned listIndex, bool fireEvents)
{
    WebViewImpl* webView = getWebView();
    if (!webView)
        return;

    ASSERT_WITH_SECURITY_IMPLICATION(listIndex < m_names.size());

    webView->autofillClient()->didSelectAutofillSuggestion(WebNode(getTextField()),
                                                           m_names[listIndex],
                                                           m_labels[listIndex],
                                                           m_itemIDs[listIndex]);
}
Пример #7
0
void AutofillPopupMenuClient::selectionChanged(unsigned listIndex, bool fireEvents)
{
    WebViewImpl* webView = getWebView();
    if (!webView)
        return;

    if (m_separatorIndex != -1 && listIndex > static_cast<unsigned>(m_separatorIndex))
        --listIndex;

    ASSERT(listIndex < m_names.size());

    webView->autofillClient()->didSelectAutofillSuggestion(WebNode(getTextField()),
                                                           m_names[listIndex],
                                                           m_labels[listIndex],
                                                           m_uniqueIDs[listIndex]);
}
Пример #8
0
void SpinnerDefaultEditor::changed(ConstFieldMaskArg whichField, 
                            UInt32            origin,
                            BitVector         details)
{
    Inherited::changed(whichField, origin, details);

    if(whichField & SpinnerFieldMask)
    {
        _EditorTextFieldActionConnection.disconnect();
        if(getSpinner() != NULL)
        {
            _ModelStateChangedConnection = getSpinner()->getModel()->connectStateChanged(boost::bind(&SpinnerDefaultEditor::handleModelStateChanged, this, _1));
            
            if(getTextField() != NULL)
            {
                //Update the Value of the TextField
	            std::string NewValue;
                try
                {
                    getTextField()->setText(getSpinner()->getModel()->getValueAsString());
                }
                catch(boost::bad_any_cast &)
                {
		            getTextField()->setText("");
                }
            }
        }
    }

    if(whichField & TextFieldFieldMask)
    {
        clearChildren();
        _EditorTextFieldActionConnection.disconnect();
        _EditorTextFieldFocusLostConnection.disconnect();
        _EditorTextFieldKeyPressedConnection.disconnect();
        if(getTextField() != NULL)
        {
            pushToChildren(getTextField());
            _EditorTextFieldActionConnection = getTextField()->connectActionPerformed(boost::bind(&SpinnerDefaultEditor::handleEditorTextFieldActionPerformed, this, _1));
            _EditorTextFieldFocusLostConnection = getTextField()->connectFocusLost(boost::bind(&SpinnerDefaultEditor::handleEditorTextFieldFocusLost, this, _1));
            _EditorTextFieldKeyPressedConnection = getTextField()->connectKeyPressed(boost::bind(&SpinnerDefaultEditor::handleEditorTextFieldKeyPressed, this, _1));
        }
    }
}
void AutofillPopupMenuClient::valueChanged(unsigned listIndex, bool fireEvents)
{
    WebViewImpl* webView = getWebView();
    if (!webView)
        return;

    ASSERT_WITH_SECURITY_IMPLICATION(listIndex < m_names.size());

    if (m_useLegacyBehavior) {
        for (size_t i = 0; i < m_itemIDs.size(); ++i) {
            if (m_itemIDs[i] == WebAutofillClient::MenuItemIDSeparator) {
                if (listIndex > i)
                    listIndex--;
                break;
            }
        }
    }

    webView->autofillClient()->didAcceptAutofillSuggestion(WebNode(getTextField()),
                                                           m_names[listIndex],
                                                           m_labels[listIndex],
                                                           m_itemIDs[listIndex],
                                                           listIndex);
}
Пример #10
0
void SymbolLayer::setTextField(PropertyValue<std::string> value) {
    if (value == getTextField())
        return;
    impl->layout.textField.set(value);
    impl->observer->onLayerLayoutPropertyChanged(*this, "text-field");
}
Пример #11
0
bool SpinnerDefaultEditor::getEditable(void) const
{
    return getTextField()->getEditable();
}
Пример #12
0
void SpinnerDefaultEditor::setEditable(bool Editable)
{
    getTextField()->setEditable(Editable);
}
void AutofillPopupMenuClient::selectionCleared()
{
    WebViewImpl* webView = getWebView();
    if (webView)
        webView->autofillClient()->didClearAutofillSelection(WebNode(getTextField()));
}