mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-25 14:22:54 -06:00
OptionTree behaviour improved
git-svn-id: svn://ultimatepp.org/upp/trunk@1932 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
1562f322a9
commit
55a8cd9dc4
4 changed files with 18 additions and 14 deletions
|
|
@ -596,12 +596,14 @@ void Option::PerformAction() {
|
|||
RefreshPush();
|
||||
}
|
||||
|
||||
void Option::Set(int b) {
|
||||
Option& Option::Set(int b)
|
||||
{
|
||||
if(b != option) {
|
||||
option = b;
|
||||
Update();
|
||||
RefreshPush();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Option::Option() {
|
||||
|
|
|
|||
|
|
@ -179,8 +179,8 @@ protected:
|
|||
bool showlabel;
|
||||
|
||||
public:
|
||||
void Set(int b);
|
||||
int Get() const { return option; }
|
||||
Option& Set(int b);
|
||||
int Get() const { return option; }
|
||||
|
||||
operator int() const { return option; }
|
||||
void operator=(int b) { Set(b); }
|
||||
|
|
|
|||
|
|
@ -1612,14 +1612,21 @@ int OptionTree::Insert(int parentid, int i, const Image& img, Option& opt, const
|
|||
return id;
|
||||
}
|
||||
|
||||
int OptionTree::Add(int parentid, const Image& img, const char *text)
|
||||
{
|
||||
return Insert(parentid, GetChildCount(parentid), img, text);
|
||||
}
|
||||
|
||||
int OptionTree::Insert(int parentid, int i, const Image& img, const char *text)
|
||||
{
|
||||
return Insert(parentid, i, img, aux.Add().NoNotNull(), text);
|
||||
return Insert(parentid, i, img, aux.Add().NoNotNull().Set(Get(parentid)), text);
|
||||
}
|
||||
|
||||
int OptionTree::Insert(int parentid, int i, const char *text)
|
||||
{
|
||||
return Insert(parentid, i, aux.Add().NoNotNull().Set(Get(parentid)), text);
|
||||
}
|
||||
|
||||
|
||||
int OptionTree::Add(int parentid, const Image& img, const char *text)
|
||||
{
|
||||
return Insert(parentid, GetChildCount(parentid), img, text);
|
||||
}
|
||||
|
||||
int OptionTree::Add(int parentid, Option& opt, const char *text)
|
||||
|
|
@ -1637,11 +1644,6 @@ int OptionTree::Add(int parentid, const char *text)
|
|||
return Insert(parentid, GetChildCount(parentid), text);
|
||||
}
|
||||
|
||||
int OptionTree::Insert(int parentid, int i, const char *text)
|
||||
{
|
||||
return Insert(parentid, i, aux.Add().NoNotNull(), text);
|
||||
}
|
||||
|
||||
void OptionTree::SetLabel(int id, const char *text)
|
||||
{
|
||||
Node n = GetNode(id);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ and standard appearance.&]
|
|||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Public Method List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:Option`:`:Set`(int`): [@(0.0.255) void]_[* Set]([@(0.0.255) int]_[*@3 b])&]
|
||||
[s5;:Option`:`:Set`(int`): [_^Option^ Option][@(0.0.255) `&]_[* Set]([@(0.0.255) int]_[*@3 b])&]
|
||||
[s2;%% Sets Option to the specified state (0, 1 or Null).&]
|
||||
[s7;%% [%-*C@3 b]-|State.&]
|
||||
[s3;%% &]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue