API  0.9.7
 All Classes Files Functions Variables Macros Groups Pages
CPPanel.j
Go to the documentation of this file.
1 /*
2  * CPPanel.j
3  * AppKit
4  *
5  * Created by Francisco Tolmasky.
6  * Copyright 2008, 280 North, Inc.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 
24 
27 
49 /*
50  @global
51  @class CPWindow
52 */
54 
55 @implementation CPPanel : CPWindow
56 {
57  BOOL _becomesKeyOnlyIfNeeded;
58  BOOL _worksWhenModal;
59 }
60 
64 - (BOOL)isFloatingPanel
65 {
66  return [self level] == CPFloatingWindowLevel;
67 }
68 
74 - (void)setFloatingPanel:(BOOL)isFloatingPanel
75 {
76  [self setLevel:isFloatingPanel ? CPFloatingWindowLevel : CPNormalWindowLevel];
77 }
78 
83 - (BOOL)becomesKeyOnlyIfNeeded
84 {
85  return _becomesKeyOnlyIfNeeded;
86 }
87 
92 - (void)setBecomesKeyOnlyIfNeeded:(BOOL)shouldBecomeKeyOnlyIfNeeded
93 {
94  _becomesKeyOnlyIfNeeded = shouldBecomeKeyOnlyIfNeeded
95 }
96 
97 - (BOOL)worksWhenModal
98 {
99  return _worksWhenModal;
100 }
101 
106 - (void)setWorksWhenModal:(BOOL)shouldWorkWhenModal
107 {
108  _worksWhenModal = shouldWorkWhenModal;
109 }
110 
111 - (BOOL)canBecomeMainWindow
112 {
113  return NO;
114 }
115 
116 - (BOOL)canBecomeKeyWindow
117 {
118  return YES;
119 }
120 
121 @end