mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-06-01 06:12:23 -06:00
CtrlLib: TabCtrl::NoAccept
git-svn-id: svn://ultimatepp.org/upp/trunk@2049 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
626d569bf6
commit
269853edf8
4 changed files with 17 additions and 4 deletions
|
|
@ -408,7 +408,8 @@ void CodeEditor::FindReplace(bool pick_selection, bool pick_text, bool replace)
|
|||
find_text = Get(l, h - l).ToWString();
|
||||
find_pos = h;
|
||||
}
|
||||
findreplace.find <<= find_text;
|
||||
if(find_text.GetCount())
|
||||
findreplace.find <<= find_text;
|
||||
}
|
||||
if(IsSelection() && replace) {
|
||||
findreplace.itext = GetI();
|
||||
|
|
|
|||
|
|
@ -461,7 +461,7 @@ bool TabCtrl::HotKey(dword key)
|
|||
|
||||
bool TabCtrl::Accept()
|
||||
{
|
||||
if(tab.GetCount() == 0)
|
||||
if(tab.GetCount() == 0 || no_accept)
|
||||
return true;
|
||||
int ii = Get();
|
||||
if(accept_current)
|
||||
|
|
@ -498,7 +498,7 @@ TabCtrl::TabCtrl()
|
|||
hot = -1;
|
||||
sel = -1;
|
||||
x0 = 0;
|
||||
accept_current = false;
|
||||
no_accept = accept_current = false;
|
||||
Ctrl::Add(tabs);
|
||||
Ctrl::Add(pane);
|
||||
tabs.BackPaint().IgnoreMouse();
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ private:
|
|||
Tabs tabs;
|
||||
Button left, right;
|
||||
ParentCtrl pane;
|
||||
bool accept_current;
|
||||
bool accept_current, no_accept;
|
||||
|
||||
const Style *style;
|
||||
|
||||
|
|
@ -130,6 +130,7 @@ public:
|
|||
|
||||
static const Style& StyleDefault();
|
||||
|
||||
TabCtrl& NoAccept(bool ac = true) { no_accept = ac; return *this; }
|
||||
TabCtrl& AcceptCurrent(bool ac = true) { accept_current = ac; return *this; }
|
||||
TabCtrl& AcceptAll() { return AcceptCurrent(false); }
|
||||
TabCtrl& SetStyle(const Style& s) { style = &s; Refresh(); return *this; }
|
||||
|
|
|
|||
|
|
@ -366,6 +366,11 @@ nt]_[*@3 i])&]
|
|||
[s2; Sets tab [*@3 i ]as active. You can also use SetData (or operator<<`=).&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:TabCtrl`:`:Set`(Ctrl`&`):%- [@(0.0.255) void]_[* Set]([_^Ctrl^ Ctrl][@(0.0.255) `&]_[*@3 s
|
||||
lave])&]
|
||||
[s2; Sets tab with [%-*@3 slave] widget as active.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:TabCtrl`:`:Get`(`)const:%- [@(0.0.255) int]_[* Get]()_[@(0.0.255) const]&]
|
||||
[s2; Returns the index of active tab. You can also use GetData (or
|
||||
operator`~).&]
|
||||
|
|
@ -399,6 +404,12 @@ them.&]
|
|||
[s2; Same as Add([%-*@3 c]). Returns `*this.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:TabCtrl`:`:NoAccept`(bool`):%- [_^TabCtrl^ TabCtrl][@(0.0.255) `&]_[* NoAccept]([@(0.0.255) b
|
||||
ool]_[*@3 ac]_`=_[@(0.0.255) true])&]
|
||||
[s2; If active, TabCtrl Accept method does not call any of slave
|
||||
widgets Accept.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:TabCtrl`:`:AcceptCurrent`(bool`):%- [_^TabCtrl^ TabCtrl][@(0.0.255) `&]_[* AcceptCurre
|
||||
nt]([@(0.0.255) bool]_[*@3 ac]_`=_[@(0.0.255) true])&]
|
||||
[s2; If AcceptCurrent is active (default is not active), TabCtrl
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue