![]() |
API 0.9.5
|
00001 /* 00002 * CPPanel.j 00003 * AppKit 00004 * 00005 * Created by Francisco Tolmasky. 00006 * Copyright 2008, 280 North, Inc. 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2.1 of the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this library; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00021 */ 00022 00023 00024 00025 CPOKButton = 1; 00026 CPCancelButton = 0; 00027 00049 /* 00050 @global 00051 @class CPWindow 00052 */ 00053 CPDocModalWindowMask = 1 << 6; 00054 00055 @implementation CPPanel : CPWindow 00056 { 00057 BOOL _becomesKeyOnlyIfNeeded; 00058 BOOL _worksWhenModal; 00059 } 00060 00064 - (BOOL)isFloatingPanel 00065 { 00066 return [self level] == CPFloatingWindowLevel; 00067 } 00068 00074 - (void)setFloatingPanel:(BOOL)isFloatingPanel 00075 { 00076 [self setLevel:isFloatingPanel ? CPFloatingWindowLevel : CPNormalWindowLevel]; 00077 } 00078 00083 - (BOOL)becomesKeyOnlyIfNeeded 00084 { 00085 return _becomesKeyOnlyIfNeeded; 00086 } 00087 00092 - (void)setBecomesKeyOnlyIfNeeded:(BOOL)shouldBecomeKeyOnlyIfNeeded 00093 { 00094 _becomesKeyOnlyIfNeeded = shouldBecomeKeyOnlyIfNeeded 00095 } 00096 00097 - (BOOL)worksWhenModal 00098 { 00099 return _worksWhenModal; 00100 } 00101 00106 - (void)setWorksWhenModal:(BOOL)shouldWorkWhenModal 00107 { 00108 _worksWhenModal = shouldWorkWhenModal; 00109 } 00110 00111 - (BOOL)canBecomeMainWindow 00112 { 00113 return NO; 00114 } 00115 00116 @end