mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
TopWindow: CloseBoxRejects
git-svn-id: svn://ultimatepp.org/upp/trunk@7806 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
1b23228d8b
commit
fd19fc13f8
3 changed files with 13 additions and 4 deletions
|
|
@ -68,7 +68,7 @@ bool TopWindow::IsShowEnabled() const
|
|||
|
||||
void TopWindow::DefaultBreak()
|
||||
{
|
||||
if(FindAction(IDCANCEL))
|
||||
if(FindAction(IDCANCEL) || close_rejects)
|
||||
RejectBreak(IDCANCEL);
|
||||
else
|
||||
if(FindAction(IDNO))
|
||||
|
|
@ -80,10 +80,7 @@ void TopWindow::DefaultBreak()
|
|||
if(FindAction(IDYES))
|
||||
AcceptBreak(IDYES);
|
||||
else
|
||||
if(FindAction(IDOK))
|
||||
AcceptBreak(IDOK);
|
||||
else
|
||||
RejectBreak(IDCANCEL);
|
||||
}
|
||||
|
||||
void TopWindow::Close()
|
||||
|
|
@ -504,6 +501,7 @@ TopWindow::TopWindow()
|
|||
overlapped.Clear();
|
||||
dokeys = true;
|
||||
fullscreen = frameless = urgent = false;
|
||||
close_rejects = false;
|
||||
}
|
||||
|
||||
TopWindow::~TopWindow()
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ private:
|
|||
bool tool:1;
|
||||
bool frameless:1;
|
||||
bool urgent:1;
|
||||
bool close_rejects:1;
|
||||
byte state;
|
||||
Image icon, largeicon;
|
||||
|
||||
|
|
@ -163,6 +164,7 @@ public:
|
|||
bool IsUrgent() const { return urgent; }
|
||||
TopWindow& NoAccessKeysDistribution() { dokeys = false; return *this; }
|
||||
TopWindow& NoCloseBox(bool b = true) { noclosebox = b; return *this; }
|
||||
TopWindow& CloseBoxRejects(bool b = true) { close_rejects = b; return *this; }
|
||||
|
||||
TopWindow& Icon(const Image& m);
|
||||
TopWindow& LargeIcon(const Image& m);
|
||||
|
|
|
|||
|
|
@ -454,6 +454,15 @@ its child windows before opening. This method disables this behaviour.&]
|
|||
[s7; [*/ Return value]-|`*this.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:TopWindow`:`:CloseBoxRejects`(bool`):%- [_^TopWindow^ TopWindow][@(0.0.255) `&]_[* Clo
|
||||
seBoxRejects]([@(0.0.255) bool]_[*@3 b]_`=_[@(0.0.255) true])&]
|
||||
[s2; When active, pressing window title close button always rejects
|
||||
the dialog. When not active, the action depends on Acceptors/Rejectors
|
||||
present, performing first of IDCANCEL `-> reject, IDNO `-> reject,
|
||||
IDEXIT `-> accept, IDYES `-> Accept, and IDOK `-> Accept as default
|
||||
action if nothing else is present.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:TopWindow`:`:Icon`(const Image`&`):%- [_^TopWindow^ TopWindow][@(0.0.255) `&]_[* Icon](
|
||||
[@(0.0.255) const]_[_^Image^ Image][@(0.0.255) `&]_[*@3 m])&]
|
||||
[s2; Defines icon for TopWindow that is usually displayed in window
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue