void FieldStringEditor::Reconfig() { kit_->push_style(); kit_->style(style_); Painter* p = new Painter(output_); p->SetColors(kit_->foreground(), kit_->background()); p->SetFont(kit_->font()); Resource::unref(output_); output_ = p; StringEditor::Reconfig(); kit_->pop_style(); }
void TextLineAdjuster::addButtons() { WidgetKit* kit = WidgetKit::instance(); LayoutKit* lkit = LayoutKit::instance(); Style* style = kit->style(); Stepper* left = kit->left_mover(adjustable_); Stepper* right = kit->right_mover(adjustable_); Coord mover_size = 15.0; style->find_attribute("mover_size", mover_size); box_->prepend(lkit->h_fixed_span(left, mover_size)); box_->append(lkit->h_fixed_span(right, mover_size)); }
TextRegion::TextRegion() { line1_ = 0; column1_ = 0; line2_ = 0; column2_ = 0; WidgetKit* kit = WidgetKit::instance(); Style* style = kit->style(); String gui("monochrome"); if (gui == kit->gui()) { color_ = new Color(*kit->foreground(), 0.25); } else { color_ = new Color(.7, .8, 1, 1); } Resource::ref(color_); }
Text::Text(unsigned initialLines, unsigned initialColumns, TextBuffer* t) { handler_ = new TextHandler(this); Resource::ref(handler_); dirty_ = false; text_ = t; insertion_.line_ = 0; insertion_.column_ = 0; WidgetKit* kit = WidgetKit::instance(); Style* s = kit->style(); String gui("monochrome"); if (gui == kit->gui()) insertion_.color_ = new Color(*kit->foreground()); else insertion_.color_ = new Color(1, .5, .5, 1); Resource::ref(insertion_.color_); insertion_.width_ = 2; initialLines_ = Math::max(initialLines, 1u); initialColumns_ = Math::max(initialColumns, 1u); font_ = kit->font(); Resource::ref(font_); textColor_ = new Color(*kit->foreground()); Resource::ref(textColor_); readOnly_ = false; canvas_ = 0; allocation_ = 0; curLowerX_ = 0; curUpperX_ = 0; curLowerY_ = 0; curUpperY_ = 0; textBuffer_ = 0; needWidth_ = false; width_ = 0; ctl_pn_col_ = -1; escape_ = 10; }