Guest User

Untitled

a guest
Nov 30th, 2012
43
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. Draw fields/buttons tooltips
  3. */
  4. for(u32 i=0; i<m_fields.size(); i++)
  5. {
  6. const FieldSpec &spec = m_fields[i];
  7. if (spec.has_tooltip)
  8. {
  9. core::rect<s32> rect = spec.rect;
  10. bool hovering = rect.isPointInside(m_pointer);
  11. if (hovering)
  12. {
  13. std::string tooltip_text = spec.tooltip;
  14. if(tooltip_text != "")
  15. {
  16. m_tooltip_element->setVisible(true);
  17. this->bringToFront(m_tooltip_element);
  18. m_tooltip_element->setText(narrow_to_wide(tooltip_text).c_str());
  19. s32 tooltip_x = m_pointer.X + 15;
  20. s32 tooltip_y = m_pointer.Y + 15;
  21. s32 tooltip_width = m_tooltip_element->getTextWidth() + 15;
  22. s32 tooltip_height = m_tooltip_element->getTextHeight() + 5;
  23. m_tooltip_element->setRelativePosition(core::rect<s32>(
  24. core::position2d<s32>(tooltip_x, tooltip_y),
  25. core::dimension2d<s32>(tooltip_width, tooltip_height)));
  26. }
  27. }
  28. }
  29. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×