//----------------------------------------------------------------------------- CMenuItem* COptionMenu::addEntry (UTF8StringPtr title, int32_t index, int32_t itemFlags) { if (UTF8StringView (title) == "-") return addSeparator (index); CMenuItem* item = new CMenuItem (title, 0, 0, 0, itemFlags); return addEntry (item, index); }
//----------------------------------------------------------------------------- UTF8StringBuffer newWithString (UTF8StringPtr string) { if (string == 0) return 0; UTF8StringBuffer buffer = (UTF8StringBuffer)std::malloc (UTF8StringView (string).calculateByteCount ()); std::strcpy (buffer, string); return buffer; }
//------------------------------------------------------------------------ void CTextLabel::setText (UTF8StringPtr txt) { if (txt && UTF8StringView (txt) == text) return; text = txt; if (textTruncateMode != kTruncateNone) calculateTruncatedText (); setDirty (true); }
//----------------------------------------------------------------------------- void CFontDesc::setName (UTF8StringPtr newName) { if (name && newName && UTF8StringView (name) == newName) return; String::free (name); name = String::newWithString (newName); freePlatformFont (); }
//---------------------------------------------------------------------------------------------------- bool UIFocusSettingsController::stringToValue (UTF8StringPtr txt, float& result, CTextEdit::StringToValueUserData* userData) { if (txt) { float value = UTF8StringView (txt).toFloat (); result = value; return true; } return false; }
//----------------------------------------------------------------------------- bool CFontDesc::operator == (const CFontDesc& f) const { if (UTF8StringView (name) == f.getName ()) return false; if (size != f.getSize ()) return false; if (style != f.getStyle ()) return false; return true; }
//------------------------------------------------------------------------ bool CCommandMenuItem::isCommandName (IdStringPtr name) const { return UTF8StringView (commandName) == name; }
//------------------------------------------------------------------------ bool CCommandMenuItem::isCommandCategory (IdStringPtr category) const { return UTF8StringView (commandCategory) == category; }