mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
CtrlLib: EditField::SetColor
git-svn-id: svn://ultimatepp.org/upp/trunk@8347 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
81e6470554
commit
2a299aa84f
4 changed files with 19 additions and 6 deletions
|
|
@ -291,7 +291,7 @@ zhTW("\345\233\233")
|
|||
|
||||
T_("date\vFr")
|
||||
caES("Dive")
|
||||
csCZ("Pa")
|
||||
csCZ("P\303\241")
|
||||
deDE("Fr")
|
||||
esES("Vi")
|
||||
fiFI("Pe")
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ protected:
|
|||
const Convert *convert;
|
||||
const Convert *inactive_convert;
|
||||
Font font;
|
||||
Color textcolor;
|
||||
|
||||
WString nulltext;
|
||||
Color nullink;
|
||||
|
|
@ -233,6 +234,7 @@ public:
|
|||
bool IsAutoFormat() const { return autoformat; }
|
||||
EditField& SetCharset(byte cs) { charset = cs; return *this; }
|
||||
EditField& SetFont(Font _font);
|
||||
EditField& SetColor(Color c);
|
||||
EditField& ClickSelect(bool b = true) { clickselect = b; return *this; }
|
||||
bool IsClickSelect() const { return clickselect; }
|
||||
EditField& InitCaps(bool b = true) { initcaps = b; return *this; }
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ void EditField::Paint(Draw& w)
|
|||
Color paper = enabled && !IsReadOnly() ? (HasFocus() ? style->focus : style->paper) : style->disabled;
|
||||
if(nobg)
|
||||
paper = Null;
|
||||
Color ink = enabled ? style->text : style->textdisabled;
|
||||
Color ink = enabled ? Nvl(textcolor, style->text) : style->textdisabled;
|
||||
if(enabled && (convert && convert->Scan(text).IsError() || errorbg))
|
||||
paper = style->invalid;
|
||||
int fcy = font.GetCy();
|
||||
|
|
@ -1044,6 +1044,7 @@ void EditField::Reset()
|
|||
SetStyle(StyleDefault());
|
||||
SetFrame(edge);
|
||||
font = StdFont();
|
||||
textcolor = Null;
|
||||
showspaces = false;
|
||||
no_internal_margin = false;
|
||||
fsell = fselh = -1;
|
||||
|
|
@ -1056,6 +1057,13 @@ EditField& EditField::SetFont(Font _font)
|
|||
return *this;
|
||||
}
|
||||
|
||||
EditField& EditField::SetColor(Color c)
|
||||
{
|
||||
textcolor = c;
|
||||
Refresh();
|
||||
return *this;
|
||||
}
|
||||
|
||||
EditField& EditField::NullText(const Image& icon, const char *text, Font fnt, Color ink)
|
||||
{
|
||||
nullicon = icon;
|
||||
|
|
|
|||
|
|
@ -17,9 +17,7 @@ trl][3 , ][@(0.0.255)3 private][3 _][*@3;3 TextArrayOps]&]
|
|||
[s0;%% &]
|
||||
[s2;%%
|
||||
@@image:406&143
|
||||
γ沃<EFBFBD>懦涼園ー、推ッ<EFBFBD>ア絶サア<EFBFBD>ス靈カヌ魵痰<EFBFBD><EFBFBD>癲。莖テ<EFBFBD>ア袙汲漕袿闥偏ェ<EFBFBD>牴ウ晶ス
|
||||
狷且フ<EFBFBD>ハ<EFBFBD>埆干ュ否ヌ掠ュォ勀ァ川<EFBFBD>エ<EFBFBD>ラモ眩厰ネス貭。数、ミンネァか狎。、ヨ苫ェ<EFBFBD>揣ア<EFBFBD>澗モン<EFBFBD><EFBFBD>カハ<EFBFBD>
|
||||
<EFBFBD>イナア<EFBFBD>
|
||||
(A0EAFwAAAAAAAAAAAHic7ZfBCYAwEASvcyuxEDuxBSE96MtH7uJhgoZd2GEfIeSxwwUx5diLgpFl3egSFU4qpOAwsw+7vUQKDkwF18pumjuACrGtW0eXKa0reqeQ7HMpNG/X0+G/GVBI5kKhkJSkUMgngqngPqFWE88AKvQihTH0p4pAU4Eu89+2SpILMkWx/w==)
|
||||
&]
|
||||
[s0; &]
|
||||
[s9;%% This widget is used whenever there is a type of value that
|
||||
|
|
@ -280,9 +278,14 @@ onst]&]
|
|||
[s4; &]
|
||||
[s5;:EditField`:`:SetFont`(Font`): [_^EditField^ EditField][@(0.0.255) `&]_[* SetFont]([_^Font^ F
|
||||
ont]_[*@3 `_font])&]
|
||||
[s2;%% [%- Sets the ][%-*@3 font]. Returns `*this.&]
|
||||
[s2;%% [%- Sets the ][%-*@3 font] of displayed text. Returns `*this.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:EditField`:`:SetColor`(Color`): [_^EditField^ EditField][@(0.0.255) `&]_[* SetColor]([_^Color^ C
|
||||
olor]_[*@3 c])&]
|
||||
[s2;%% [%- Sets the color] of displayed text. Returns `*this.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:EditField`:`:ClickSelect`(bool`): [_^EditField^ EditField][@(0.0.255) `&]_[* ClickSele
|
||||
ct]([@(0.0.255) bool]_[*@3 b]_`=_[@(0.0.255) true])&]
|
||||
[s2; In ClickSelect mode, all the text of EditField is select when
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue