void PaddingPanelUI::SetAttribute(const char* name, const char* value) { int n; if (ParseWidth(name, value, n)) SetWidth(n); else if (ParseHeight(name, value, n)) SetHeight(n); else ControlUI::SetAttribute(name, value); }
void ImagePanelUI::SetAttribute(const char* name, const char* value) { int n; if (ParseWidth(name, value, n)) SetWidth(n); else if (ParseHeight(name, value, n)) SetHeight(n); else if (str::Eq(name, "image")) SetImage(value); else ControlUI::SetAttribute(name, value); }
// The width and precision of print allow '*' static int ParsePrintWidth(const char* format, int* value) { const char* f = format; int n = ParseWidth(f, value); if (n > 0) { f += n; } else if (*f == '*') { *value = -'*'; ++f; } return f - format; }
int ScanSpecification::Parse(const char* format) { const char* f = format; if (*f == '*') { ++f; this->skip = true; } f += ParseWidth(f, &this->width); f += ParseLength(f, &this->length); int this_width = ParseScanSpecifier(f, this); if (this_width == 0) return 0; f += this_width; return f - format; }