void ExternalPopupMenu::update() { if (!m_webExternalPopupMenu || !m_ownerElement) return; m_ownerElement->document().updateLayoutTree(); // disconnectClient() might have been called. if (!m_ownerElement) return; m_needsUpdate = false; if (showInternal()) return; // We failed to show a popup. Notify it to the owner. hide(); }
int main() { cpp_dec_float_20 b = 8000; b /= 3; std::cout << std::setprecision(30); std::cout << "size: " << sizeof(cpp_dec_float_20) << ", digits: " << std::numeric_limits<cpp_dec_float_20>::digits << std::endl; std::cout << "result = " << b << std::endl; std::cout << "rounded result = " << boost::math::round(b) << std::endl; std::cout << "rounded result = " << dec_round(b, -1) << std::endl; cpp_dec_float_20 b2("2666.67"); cpp_dec_float_20 b3 = dec_round(b, 2); std::cout << " equal? " << (dec_round(b, 2) == b2) << std::endl; std::cout << " diff = " << (b3 - b2) << std::endl; std::string s = b3.str(); std::cout << "str = " << s << std::endl; std::cout << "boost formated = " << boost::format("%.4f") % b3 << std::endl; std::cout << "stream formated = " << std::setprecision(4) << std::fixed << b3 << std::endl; std::cout << std::setprecision(20); cpp_dec_float_20 testvalue("12345.67890987654321"); std::cout << "origin value:" << testvalue << std::endl; cpp_dec_float_20 partvalue = testvalue.backend().extract_integer_part(); std::cout << "part value:" << partvalue << std::endl; //std::cout << "exp: " << testvalue.backend().exp << std::endl; double mantissa; boost::int32_t exponent; testvalue.backend().extract_parts(mantissa, exponent); std::cout << "mantissa: " << mantissa << ", exp: " << exponent << std::endl; showInternal("0.001234567"); showInternal("-0.001234567"); showInternal("1234567890987654321"); showInternal("-1234567890987654321"); showInternal("12345.67890987654321"); showInternal("-12345.67890987654321"); showInternal("123456789098765432.1"); showInternal("9999999912345678909876543212345.67890987654321"); return 0; }
void ExternalPopupMenu::show() { if (!showInternal()) return; #if OS(MACOSX) const WebInputEvent* currentEvent = WebViewImpl::currentInputEvent(); if (currentEvent && currentEvent->type == WebInputEvent::MouseDown) { m_syntheticEvent = adoptPtr(new WebMouseEvent); *m_syntheticEvent = *static_cast<const WebMouseEvent*>(currentEvent); m_syntheticEvent->type = WebInputEvent::MouseUp; m_dispatchEventTimer.startOneShot(0, BLINK_FROM_HERE); // FIXME: show() is asynchronous. If preparing a popup is slow and a // user released the mouse button before showing the popup, mouseup and // click events are correctly dispatched. Dispatching the synthetic // mouseup event is redundant in this case. } #endif }
int main() { cpp_dec_float_20 b = 8000; #if 0 b /= 3; std::cout << std::setprecision(30); std::cout << "size: " << sizeof(cpp_dec_float_20) << ", digits: " << std::numeric_limits<cpp_dec_float_20>::digits << std::endl; std::cout << "result = " << b << std::endl; std::cout << "rounded result = " << boost::math::round(b) << std::endl; std::cout << "rounded result = " << dec_round(b, -1) << std::endl; cpp_dec_float_20 b2("2666.67"); cpp_dec_float_20 b3 = dec_round(b, 2); std::cout << " equal? " << (dec_round(b, 2) == b2) << std::endl; std::cout << " diff = " << (b3 - b2) << std::endl; std::string s = b3.str(); std::cout << "str = " << s << std::endl; std::cout << "boost formated = " << boost::format("%.4f") % b3 << std::endl; std::cout << "stream formated = " << std::setprecision(4) << std::fixed << b3 << std::endl; std::cout << std::setprecision(20); cpp_dec_float_20 testvalue("12345.67890987654321"); std::cout << "origin value:" << testvalue << std::endl; cpp_dec_float_20 partvalue = testvalue.backend().extract_integer_part(); std::cout << "part value:" << partvalue << std::endl; //std::cout << "exp: " << testvalue.backend().exp << std::endl; double mantissa; boost::int32_t exponent; testvalue.backend().extract_parts(mantissa, exponent); std::cout << "mantissa: " << mantissa << ", exp: " << exponent << std::endl; showInternal("0.001234567"); showInternal("-0.001234567"); showInternal("1234567890987654321"); showInternal("-1234567890987654321"); showInternal("12345.67890987654321"); showInternal("-12345.67890987654321"); showInternal("123456789098765432.1"); showInternal("9999999912345678909876543212345.67890987654321"); #endif cpp_dec_float_20 tmpfee("0.29"); cpp_dec_float_20 usageV =60; cpp_dec_float_20 unitV("60"); cpp_dec_float_20 feeV; std::cout<<"tmpfee:"<<tmpfee.str().c_str()<<std::endl; std::cout<<"usageV:"<<usageV.str().c_str()<<std::endl; std::cout<<"unitV:"<<unitV.str().c_str()<<std::endl; feeV = (tmpfee *usageV)/unitV; std::cout<<"---" << (tmpfee *usageV)<<std::endl; std::cout<<"---" << (tmpfee *usageV)/60<<std::endl; std::cout<<"---" << (tmpfee *usageV)/unitV<<std::endl; std::cout<<"---" << feeV << std::endl; std::cout<<"##feeV:"<<feeV.str()<<std::endl; feeV = usageV*tmpfee; std::cout<<"feeV:"<<feeV.str().c_str()<<std::endl; int unitVV =60; feeV = usageV*tmpfee /60; std::cout<<"feeV:"<<feeV.str().c_str()<<std::endl; return 0; }