mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
AttrText:conversion from Value
git-svn-id: svn://ultimatepp.org/upp/trunk@2723 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
4e8cf8758a
commit
01bc8d46a1
3 changed files with 18 additions and 1 deletions
|
|
@ -13,6 +13,11 @@ AttrText::operator Value() const
|
|||
return RawToValue(*this);
|
||||
}
|
||||
|
||||
AttrText::AttrText(const Value& v)
|
||||
{
|
||||
*this = ValueTo<AttrText>(v);
|
||||
}
|
||||
|
||||
void AttrText::Init()
|
||||
{
|
||||
ink = Null;
|
||||
|
|
@ -95,7 +100,7 @@ void StdDisplayClass::Paint0(Draw& w, const Rect& r, const Value& q,
|
|||
paper = t.paper;
|
||||
if(!IsNull(t.ink))
|
||||
ink = t.ink;
|
||||
if(!IsNull(t.normalink) && (s & (CURSOR|FOCUS)) != (CURSOR|FOCUS))
|
||||
if(!IsNull(t.normalink) && !(s & (CURSOR|SELECT|READONLY)))
|
||||
ink = t.normalink;
|
||||
if(!IsNull(t.font))
|
||||
font = t.font;
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ struct AttrText {
|
|||
AttrText& SetImage(const Image& m, int spc = 4) { img = m; imgspc = spc; return *this; }
|
||||
|
||||
operator Value() const;
|
||||
AttrText(const Value& v);
|
||||
|
||||
AttrText(const char *text);
|
||||
AttrText(const wchar *text);
|
||||
|
|
|
|||
|
|
@ -158,6 +158,12 @@ perator`=([@(0.0.255) const]_[_^WString^ WString][@(0.0.255) `&]_[@3 s])&]
|
|||
[s7; [*/ Return value]-|`*this.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:AttrText`:`:NormalInk`(Color`):%- [_^AttrText^ AttrText][@(0.0.255) `&]_[* NormalInk](
|
||||
[_^Color^ Color]_[*@3 c])&]
|
||||
[s2; Sets the text color to be used if the item is not in selected
|
||||
nor focused nor read`-only state.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:AttrText`:`:Paper`(Color`):%- [_^AttrText^ AttrText][@(0.0.255) `&]_Paper([_^Color^ Co
|
||||
lor]_[@3 c])&]
|
||||
[s2; Sets the paper color.&]
|
||||
|
|
@ -200,6 +206,11 @@ SetImage([@(0.0.255) const]_[_^Image^ Image][@(0.0.255) `&]_[@3 m], [@(0.0.255)
|
|||
[s7; [*/ Return value]-|AttrText as raw Value.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:AttrText`:`:AttrText`(const Value`&`):%- [* AttrText]([@(0.0.255) const]_[_^Value^ Val
|
||||
ue][@(0.0.255) `&]_[*@3 v])&]
|
||||
[s2; Converts Value to AttrText.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:AttrText`:`:AttrText`(const char`*`):%- AttrText([@(0.0.255) const]_[@(0.0.255) char
|
||||
]_`*[@3 text])&]
|
||||
[s2; Constructs AttrText, assigning the text attribute and all other
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue