mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-17 14:16:10 -06:00
225 lines
No EOL
11 KiB
C++
225 lines
No EOL
11 KiB
C++
topic "Switch";
|
|
[2 $$0,0#00000000000000000000000000000000:Default]
|
|
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
|
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
|
[0 $$3,0#96390100711032703541132217272105:end]
|
|
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
|
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
|
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
|
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
|
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
|
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
|
[{_}%EN-US
|
|
[ {{10000@3 [s0; [*@(229)4 Switch]]}}&]
|
|
[s3;%- &]
|
|
[s1;:Switch`:`:class:%- [@(0.0.255)3 class][3 _][*3 Switch][3 _:_][@(0.0.255)3 public][3 _][*@3;3 Ct
|
|
rl]&]
|
|
[s0; Switch provides selection of mutually exclusive options (cases).&]
|
|
[s0; &]
|
|
[s2;
|
|
@@image:1287&131
|
|
(A84AFQAAAOv/AAAAAHic7ZfNaxpBGMb9f3II5BSiJIdcvATPuaaHYFQ8BjEeJCTQQOhJaLCFtlBCckkRDGKw+cJDmhYlNMGP1FjBiGURQbz3wYVl2dmdHWdHo2SGh2Bmv377vs/Mu6/SLilSUlJSUlJSUlJTpVTq+/r628XFwNzcm6Wl4MbGXjp9+aoApppzMqlIbW4mPJ5gPJ5MpXJXVzfp9MX29ke3O7C1dfBKAKaaczKpTDl9vkg+/6NcLler1VqtVq/XG41GofAb87GYCa3L5WK5M+NpHADqzbUxyYEy5bRi5ngXvujxPUu7hONa7LpYDhrnQ+UhW8w+Pj02m81Wq3V3V8LRTOaaA5KRygBQH4xhAdh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qm6bp+eXmLTw8OzrwSnLSjlYD8R/44+Wvd8dgdhmGsr79Np1/EWQLqF/kP/jf1Gxd//YfearUqlfPJyYxXgpO5S45ToH0l4ZqQQP9B/Vr5r/0dFv+f3SHLtyMjKUoJ3qnxlcN3+tA/0X+c8Qd5m3+73T46+hI0C09OB0EUx4lIpTbRP9F/vPEH/06ns7HxPpPZCpLgG+cnJXDJHxuYAvR/9E/0H6sEnPzr9e/49PCw+o8k8JKTzb5E/0f/RP9B/Tr5T00t53KvvbcQngu+5ew65lvOFvD8Qv9H/0T/Qf0i/5E/iL8v/9gCzy/0f1Qu+g9ekf/e/HHFkHthCgjEAcIvRM6/V79ghuvtfNuXyy9gvVqWyzR+IQwfvhKcfqFwUpj5OJM+Tid3kzsXOwS/EJIPXwlOvwD+e9pe/ls+e50d/jBM8AtkPt4cC1p1eM/7HpNh+4WyVEb8Lf6zX2cHdwdlVQ7yC2T+ruOgM4QrfZdYQbD9gnKvIH8s/slqcuDdgNEygvwC4fvpRfFaxDr9wvbFNvIH8Qf//et9gl8g/AQvCfQqXH7h4fFBUiUr/pR+IfJEMln9AmGNGqacXbdQ5pL5//mFnpDwjMiVCgiQIfxC5PwZ9hfCNBm+fYl5fyHMj/KVwLy/EB8JzPsLhCwKs8DwPSYjzP6Cb0j7v8xj218gZIXvqq9XCZTkLbDtL/RBAr0KLvsL0SaSyeQXTOL/SGHK2XULZS6Zwi9wAvOzXkCAAX8A/IJmnw==)
|
|
&]
|
|
[s9; Options can be visually aligned horizontally or vertically `-
|
|
U`+`+ choses alignment based on size of options and Ctrl rectangle.
|
|
Each option represents a case with associated text and value.
|
|
Switch can be assigned any Value (not only Values associated
|
|
with current cases); if there is no case with Value equal to
|
|
the Value of Switch, no case is highlighted.&]
|
|
[s0;* &]
|
|
[s0;%- [%%/ Derived from][%% ][^topic`:`/`/CtrlCore`/src`/Ctrl`$en`-us^ Ctrl]&]
|
|
[s3; &]
|
|
[s0; &]
|
|
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
|
[s3;%- &]
|
|
[s5;:Switch`:`:Switch`(`):%- [* Switch]()&]
|
|
[s2; Initializes the switch.&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:`~Switch`(`):%- [@(0.0.255) `~][* Switch]()&]
|
|
[s2; Default destructor.&]
|
|
[s3; &]
|
|
[s0;%- &]
|
|
[ {{10000F(128)G(128)@1 [s0; [* Public Method List]]}}&]
|
|
[s3;%- &]
|
|
[s5;:Switch`:`:SetLabel`(int`,const char`*`):%- [_^Switch^ Switch][@(0.0.255) `&]_[* SetLab
|
|
el]([@(0.0.255) int]_[*@3 i], [@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 text])&]
|
|
[s2; Sets text of case with specified index [*@3 i]. Text can contain
|
|
`'`\b`' for access`-key assignment. Value of case is set to [*@3 i].
|
|
If [*@3 i] is greater than current number of cases, empty cases
|
|
are added to Switch with values equivalent to their indexes.&]
|
|
[s7; [%-*C@3 i]-|Index of the case.&]
|
|
[s7; [%-*C@3 text]-|Text of the case.&]
|
|
[s7; [*/ Return value]-|`*this for chaining.&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:SetLabel`(const char`*`):%- [_^Switch^ Switch][@(0.0.255) `&]_[* SetLabel]([@(0.0.255) c
|
|
onst]_[@(0.0.255) char]_`*[*@3 text])&]
|
|
[s2; Sets content of Switch. Each line of [*@3 text ]represents one
|
|
case with value equivalent to the index of line.&]
|
|
[s7; [%-*C@3 text]-|Content of the Switch.&]
|
|
[s7; [*/ Return value]-|`*this for chaining.&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:GetLabel`(int`)const:%- [_^String^ String]_[* GetLabel]([@(0.0.255) int]_[*@3 i
|
|
])_[@(0.0.255) const]&]
|
|
[s2; Returns the text of case with specified index [*@3 i].&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:GetLabel`(`)const:%- [_^String^ String]_[* GetLabel]()_[@(0.0.255) const]&]
|
|
[s2; Returns the context of the Switch.&]
|
|
[s3;%- &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:Set`(int`,const Value`&`,const char`*`):%- [_^Switch^ Switch][@(0.0.255) `&
|
|
]_[* Set]([@(0.0.255) int]_[*@3 i], [@(0.0.255) const]_[_^Value^ Value][@(0.0.255) `&]_[*@3 val
|
|
], [@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 text])&]
|
|
[s2; Sets text of case with specified index [*@3 i]. Text can contain
|
|
`'`\b`' for access`-key assignment. Value of case is set to [*@3 val].
|
|
If [*@3 i] is greater than current number of cases, empty cases
|
|
are added to Switch with values equivalent to their indexes.&]
|
|
[s7; [%-*C@3 i]-|Index of the case.&]
|
|
[s7; [%-*C@3 val]-|Value of the case.&]
|
|
[s7; [%-*C@3 text]-|Text of the case.&]
|
|
[s7; [*/ Return value]-|`*this for chaining.&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:Set`(int`,const Value`&`):%- [_^Switch^ Switch][@(0.0.255) `&]_[* Set]([@(0.0.255) i
|
|
nt]_[*@3 i], [@(0.0.255) const]_[_^Value^ Value][@(0.0.255) `&]_[*@3 val])&]
|
|
[s2; Sets the Value of of case with specified index [*@3 i]. The text
|
|
of case is unaltered.&]
|
|
[s7; [%-*C@3 i]-|Index of the case.&]
|
|
[s7; [%-*C@3 val]-|Value of the case.&]
|
|
[s7; [*/ Return value]-|`*this for chaining.&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:Add`(const Value`&`,const char`*`):%- [_^Switch^ Switch][@(0.0.255) `&]_[* A
|
|
dd]([@(0.0.255) const]_[_^Value^ Value][@(0.0.255) `&]_[*@3 val], [@(0.0.255) const]_[@(0.0.255) c
|
|
har]_`*[*@3 text])&]
|
|
[s2; Adds a new case to the Switch.&]
|
|
[s7; [%-*C@3 val]-|Value of the case.&]
|
|
[s7; [%-*C@3 text]-|Text of the case.&]
|
|
[s7; [*/ Return value]-|`*this for chaining.&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:Add`(const char`*`):%- [_^Switch^ Switch][@(0.0.255) `&]_[* Add]([@(0.0.255) c
|
|
onst]_[@(0.0.255) char]_`*[*@3 text])&]
|
|
[s2; Adds a new case to the Switch. Value of the case is equal to
|
|
its index.&]
|
|
[s7; [%-*C@3 text]-|Text of the case.&]
|
|
[s7; [*/ Return value]-|`*this for chaining&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:EnableCase`(int`,bool`):%- [@(0.0.255) void]_[* EnableCase]([@(0.0.255) int]_
|
|
[*@3 i], [@(0.0.255) bool]_[*@3 enable]_`=_[@(0.0.255) true])&]
|
|
[s2; Enables or disables case with the specified index [*@3 i].&]
|
|
[s7; [%-*C@3 i]-|Index of the case to be enabled or disabled.&]
|
|
[s7; [%-*C@3 enable]-|Enable flag (true if case is to be enabled).&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:DisableCase`(int`):%- [@(0.0.255) void]_[* DisableCase]([@(0.0.255) int]_[*@3 i
|
|
])&]
|
|
[s2; Same as [^topic`:`/`/CtrlLib`/src`/Switch`$en`-us`#Switch`:`:EnableCase`(int`,bool`)^ E
|
|
nableCase](i, false).&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:EnableValue`(const Value`&`,bool`):%- [@(0.0.255) void]_[* EnableValue]([@(0.0.255) c
|
|
onst]_[_^Value^ Value][@(0.0.255) `&]_[*@3 val], [@(0.0.255) bool]_[*@3 enable]_`=_[@(0.0.255) t
|
|
rue])&]
|
|
[s2; Enables or disables case based on its value.&]
|
|
[s7; [%-*C@3 val]-|Value of the case to be enabled / disabled.&]
|
|
[s7; [%-*C@3 enable]-|Enable flag (true if case is to be enabled).&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:DisableValue`(const Value`&`):%- [@(0.0.255) void]_[* DisableValue]([@(0.0.255) c
|
|
onst]_[_^Value^ Value][@(0.0.255) `&]_[*@3 val])&]
|
|
[s2; Same as [^topic`:`/`/CtrlLib`/src`/Switch`$en`-us`#Switch`:`:EnableValue`(const Value`&`,bool`)^ E
|
|
nableValue](val, false).&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:Reset`(`):%- [@(0.0.255) void]_[* Reset]()&]
|
|
[s2; Removes content of the Switch.&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:GetCases`(`)const:%- [@(0.0.255) const]_[_^Array^ Array][@(0.0.255) <][_^Switch`:`:Case^ C
|
|
ase][@(0.0.255) >`&]_[* GetCases]()_[@(0.0.255) const]&]
|
|
[s2;%- Retrieves information of all cases in the Switch.&]
|
|
[s7; [*/ Return value]-|Array of [^topic`:`/`/CtrlLib`/src`/Switch`$en`-us`#Switch`:`:Case`:`:struct^ S
|
|
witch`::Case] structures.&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:operator int`(`)const:%- [* operator_int]()_[@(0.0.255) const]&]
|
|
[s2; Simplified access to Switch Value. Equivalent to (int)GetData().&]
|
|
[s6; Switch must be assigned an integer value.&]
|
|
[s7; [*/ Return value]-|Integer Value of Switch.&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:operator`=`(const Value`&`):%- [@(0.0.255) void]_[* operator`=]([@(0.0.255) c
|
|
onst]_[_^Value^ Value][@(0.0.255) `&]_[*@3 v])&]
|
|
[s2; Equivalent to SetData([%-*@3 v]).&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:SetFont`(Font`):%- [_^Switch^ Switch][@(0.0.255) `&]_[* SetFont]([_^Font^ Font
|
|
]_[*@3 f])&]
|
|
[s2; Alters the font to be used in the Switch.&]
|
|
[s7; [%-*C@3 f]-|Font to be used.&]
|
|
[s7; [*/ Return value]-|`*this for chaining.&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:GetFont`(`)const:%- [_^Font^ Font]_[* GetFont]()_[@(0.0.255) const]&]
|
|
[s2; Retrieves the font used in the Switch.&]
|
|
[s7; [*/ Return value]-|`*this for chaining.&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:MinCaseHeight`(int`):%- [_^Switch^ Switch][@(0.0.255) `&]_[* MinCaseHeight](
|
|
[@(0.0.255) int]_[*@3 cy])&]
|
|
[s2; Sets the minimal height of a case in the switch.&]
|
|
[s7; [%-*C@3 f]-|Font to be used.&]
|
|
[s7; [*/ Return value]-|`*this for chaining.&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:SetAutoDirection`(`):%- [_^Switch^ Switch][@(0.0.255) `&]_[* SetAutoDirectio
|
|
n]()&]
|
|
[s2; Sets Switch layout to automatic mode, where items are layed
|
|
out depending on the available area for switch (vertically is
|
|
the are is high enough, horizontally otherwise).&]
|
|
[s3;%- &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:SetHorizontal`(`):%- [_^Switch^ Switch][@(0.0.255) `&]_[* SetHorizontal]()&]
|
|
[s2; Forces horizontal layout.&]
|
|
[s3;%- &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:SetVertical`(`):%- [_^Switch^ Switch][@(0.0.255) `&]_[* SetVertical]()&]
|
|
[s2; Forces vertical layout.&]
|
|
[s3; &]
|
|
[s0; &]
|
|
[s0;%- &]
|
|
[ {{10000@3 [s0; [*@(229)4 Switch`::Case]]}}&]
|
|
[s3; &]
|
|
[s1;:Switch`:`:Case`:`:struct:%- [@(0.0.255)3 struct][3 _][*3 Case][3 _:_][@(0.0.255)3 public][3 _
|
|
][*@3;3 Moveable][@(0.0.255)3 <][*3 Case][@(0.0.255)3 >][3 _]&]
|
|
[s9; This structure is returned by the [^topic`:`/`/CtrlLib`/src`/Switch`$en`-us`#Switch`:`:GetCases`(`)const^ S
|
|
witch`::GetCases] method.&]
|
|
[s3; &]
|
|
[s0;%- &]
|
|
[ {{10000F(128)G(128)@1 [s0; [* Public Field List]]}}&]
|
|
[s3;%- &]
|
|
[s5;:Switch`:`:Case`:`:label:%- [_^String^ String]_[* label]&]
|
|
[s2; Text of the case.&]
|
|
[s3;%- &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:Case`:`:value:%- [_^Value^ Value]_[* value]&]
|
|
[s2; Value of the case.&]
|
|
[s3; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:Case`:`:accesskey:%- [@(0.0.255) int]_[* accesskey]&]
|
|
[s2; Access key.&]
|
|
[s5; &]
|
|
[s4;%- &]
|
|
[s5;:Switch`:`:Case`:`:enabled:%- [@(0.0.255) bool]_[* enabled]&]
|
|
[s2; Enable flag.&]
|
|
[s3; &]
|
|
[s0; ]] |