NSStatusBarButton implementation

This commit is contained in:
Gregory John Casamento 2020-07-31 02:40:41 -04:00
parent 27f43a6cda
commit 3322db37c2
6 changed files with 139 additions and 1 deletions

View file

@ -1,3 +1,11 @@
2020-07-31 Gregory John Casamento <greg.casamento@gmail.com>
* Headers/AppKit/AppKit.h: Add header
* Headers/AppKit/NSStatusBarButton.h: Declaration
* MISSING: Remove file from list
* Source/GNUmakefile: Add to compilation
* Source/NSStatusBarButton.m: Definition of class.
2020-07-30 Gregory John Casamento <greg.casamento@gmail.com>
* Headers/AppKit/AppKit.h

View file

@ -133,6 +133,7 @@
#import <AppKit/NSSpellProtocol.h>
#import <AppKit/NSSplitView.h>
#import <AppKit/NSStatusBar.h>
#import <AppKit/NSStatusBarButton.h>
#import <AppKit/NSStatusItem.h>
#import <AppKit/NSStringDrawing.h>
#import <AppKit/NSText.h>

View file

@ -0,0 +1,53 @@
/* Definition of class NSStatusBarButton
Copyright (C) 2020 Free Software Foundation, Inc.
By: Gregory John Casamento
Date: 31-07-2020
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110 USA.
*/
#ifndef _NSStatusBarButton_h_GNUSTEP_GUI_INCLUDE
#define _NSStatusBarButton_h_GNUSTEP_GUI_INCLUDE
#import <AppKit/NSButton.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST)
#if defined(__cplusplus)
extern "C" {
#endif
@interface NSStatusBarButton : NSButton
{
BOOL _appearsDisabled;
}
- (BOOL) appearsDisabled;
- (void) setAppearsDisabled: (BOOL)flag;
@end
#if defined(__cplusplus)
}
#endif
#endif /* GS_API_MACOSX */
#endif /* _NSStatusBarButton_h_GNUSTEP_GUI_INCLUDE */

View file

@ -20,7 +20,6 @@ MISSING HEADERS
> NSRuleEditor.h
> NSSliderAccessory.h
> NSStackView.h
> NSStatusBarButton.h
> NSTableCellView.h
> NSTableRowView.h
> NSTableViewRowAction.h

View file

@ -249,6 +249,7 @@ NSStepper.m \
NSStepperCell.m \
NSStringDrawing.m \
NSStatusBar.m \
NSStatusBarButton.m \
NSStatusItem.m \
NSTabView.m \
NSTabViewController.m \
@ -542,6 +543,7 @@ NSStoryboardSegue.h \
NSSeguePerforming.h \
NSStringDrawing.h \
NSStatusBar.h \
NSStatusBarButton.h \
NSStatusItem.h \
NSSwitch.h \
NSTabView.h \

View file

@ -0,0 +1,75 @@
/* Implementation of class NSStatusBarButton
Copyright (C) 2020 Free Software Foundation, Inc.
By: Gregory John Casamento
Date: 31-07-2020
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110 USA.
*/
#import "AppKit/NSStatusBarButton.h"
@implementation NSStatusBarButton
- (BOOL) appearsDisabled
{
return _appearsDisabled;
}
- (void) setAppearsDisabled: (BOOL)flag
{
_appearsDisabled = flag;
}
- (void) encodeWithCoder: (NSCoder *)coder
{
[super encodeWithCoder: coder];
if ([coder allowsKeyedCoding])
{
[coder encodeBool: _appearsDisabled
forKey: @"NSAppearsDisabled"];
}
else
{
[coder encodeValueOfObjCType: @encode(BOOL)
at: &_appearsDisabled];
}
}
- (instancetype) initWithCoder: (NSCoder *)coder
{
self = [super initWithCoder: coder];
if (self != nil)
{
if ([coder allowsKeyedCoding])
{
if ([coder containsValueForKey: @"NSAppearsDisabled"])
{
_appearsDisabled = [coder decodeBoolForKey: @"NSAppearsDisabled"];
}
}
else
{
[coder decodeValueOfObjCType: @encode(BOOL)
at: &_appearsDisabled];
}
}
return self;
}
@end