mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 08:21:00 +00:00
Add MacOSX 10.3 methods and constants.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25362 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d9dd70caf8
commit
a7ba44ca0b
4 changed files with 165 additions and 23 deletions
|
@ -1,3 +1,9 @@
|
|||
2007-07-28 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/AppKit/NSBrowser.h,
|
||||
* Source/NSBrowser.m: Add MacOSX 10.3 methods and constants.
|
||||
* Source/externs.m: Define new string constant.
|
||||
|
||||
2007-07-27 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/AppKit/NSBox.h,
|
||||
|
|
|
@ -41,6 +41,15 @@
|
|||
@class NSScroller;
|
||||
//@class NSBox;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
||||
typedef enum _NSBrowserColumnResizingType
|
||||
{
|
||||
NSBrowserNoColumnResizing,
|
||||
NSBrowserAutoColumnResizing,
|
||||
NSBrowserUserColumnResizing
|
||||
} NSBrowserColumnResizingType;
|
||||
#endif
|
||||
|
||||
@interface NSBrowser : NSControl <NSCoding>
|
||||
{
|
||||
// Attributes
|
||||
|
@ -67,6 +76,7 @@
|
|||
BOOL _sendsActionOnArrowKeys;
|
||||
BOOL _acceptsAlphaNumericalKeys;
|
||||
BOOL _sendsActionOnAlphaNumericalKeys;
|
||||
BOOL _prefersAllColumnUserResizing;
|
||||
|
||||
BOOL _passiveDelegate;
|
||||
id _browserDelegate;
|
||||
|
@ -82,6 +92,8 @@
|
|||
int _lastColumnLoaded;
|
||||
int _firstVisibleColumn;
|
||||
int _lastVisibleColumn;
|
||||
NSString *_columnsAutosaveName;
|
||||
NSBrowserColumnResizingType _columnResizing;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -148,6 +160,10 @@
|
|||
- (void) setMaxVisibleColumns: (int)columnCount;
|
||||
- (void) setMinColumnWidth: (int)columnWidth;
|
||||
- (void) setSeparatesColumns: (BOOL)flag;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
||||
- (float) columnWidthForColumnContentWidth: (float)columnContentWidth;
|
||||
- (float) columnContentWidthForColumnWidth: (float)columnWidth;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Manipulating Columns
|
||||
|
@ -233,6 +249,24 @@
|
|||
//
|
||||
- (void) tile;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
||||
//
|
||||
// Resizing
|
||||
//
|
||||
- (NSBrowserColumnResizingType) columnResizingType;
|
||||
- (void) setColumnResizingType:(NSBrowserColumnResizingType) type;
|
||||
- (BOOL) prefersAllColumnUserResizing;
|
||||
- (void) setPrefersAllColumnUserResizing: (BOOL)flag;
|
||||
- (float) widthOfColumn: (int)column;
|
||||
- (void) setWidth: (float)columnWidth ofColumn: (int)columnIndex;
|
||||
|
||||
//
|
||||
// Autosave names
|
||||
//
|
||||
+ (void) removeSavedColumnsWithAutosaveName: (NSString *)name;
|
||||
- (NSString *) columnsAutosaveName;
|
||||
- (void) setColumnsAutosaveName: (NSString *)name;
|
||||
#endif
|
||||
@end
|
||||
|
||||
//
|
||||
|
@ -266,7 +300,19 @@
|
|||
- (void) browserDidScroll: (NSBrowser *)sender;
|
||||
- (void) browserWillScroll: (NSBrowser *)sender;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
||||
- (float) browser: (NSBrowser *)browser
|
||||
shouldSizeColumn: (int)column
|
||||
forUserResize: (BOOL)flag
|
||||
toWidth: (float)width;
|
||||
- (float) browser: (NSBrowser *)browser
|
||||
sizeToFitWidthOfColumn: (int)column;
|
||||
- (void) browserColumnConfigurationDidChange: (NSNotification *)notification;
|
||||
#endif
|
||||
@end
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
||||
APPKIT_EXPORT NSString *NSBrowserColumnConfigurationDidChangeNotification;
|
||||
#endif
|
||||
|
||||
#endif // _GNUstep_H_NSBrowser
|
||||
|
|
|
@ -76,6 +76,7 @@ static NSTextFieldCell *titleCell;
|
|||
id _columnScrollView;
|
||||
id _columnMatrix;
|
||||
NSString *_columnTitle;
|
||||
float _width;
|
||||
}
|
||||
|
||||
- (void) setIsLoaded: (BOOL)flag;
|
||||
|
@ -1250,6 +1251,74 @@ static NSTextFieldCell *titleCell;
|
|||
[self tile];
|
||||
}
|
||||
|
||||
- (float) columnWidthForColumnContentWidth: (float)columnContentWidth
|
||||
{
|
||||
float cw;
|
||||
|
||||
cw = columnContentWidth;
|
||||
if (scrollerWidth > cw)
|
||||
{
|
||||
cw = scrollerWidth;
|
||||
}
|
||||
|
||||
// Take the border into account
|
||||
if (_separatesColumns)
|
||||
cw += 2 * (_sizeForBorderType(NSBezelBorder)).width;
|
||||
|
||||
return cw;
|
||||
}
|
||||
|
||||
- (float) columnContentWidthForColumnWidth: (float)columnWidth
|
||||
{
|
||||
float cw;
|
||||
|
||||
// Take the border into account
|
||||
if (_separatesColumns)
|
||||
cw -= 2 * (_sizeForBorderType(NSBezelBorder)).width;
|
||||
|
||||
return cw;
|
||||
}
|
||||
|
||||
- (NSBrowserColumnResizingType) columnResizingType
|
||||
{
|
||||
return _columnResizing;
|
||||
}
|
||||
|
||||
- (void) setColumnResizingType:(NSBrowserColumnResizingType) type
|
||||
{
|
||||
_columnResizing = type;
|
||||
}
|
||||
|
||||
- (BOOL) prefersAllColumnUserResizing
|
||||
{
|
||||
return _prefersAllColumnUserResizing;
|
||||
}
|
||||
|
||||
- (void) setPrefersAllColumnUserResizing: (BOOL)flag
|
||||
{
|
||||
_prefersAllColumnUserResizing = flag;
|
||||
}
|
||||
|
||||
- (float) widthOfColumn: (int)column
|
||||
{
|
||||
NSBrowserColumn *browserColumn;
|
||||
|
||||
browserColumn = [_browserColumns objectAtIndex: column];
|
||||
|
||||
return browserColumn->_width;
|
||||
}
|
||||
|
||||
- (void) setWidth: (float)columnWidth ofColumn: (int)column
|
||||
{
|
||||
NSBrowserColumn *browserColumn;
|
||||
|
||||
browserColumn = [_browserColumns objectAtIndex: column];
|
||||
|
||||
browserColumn->_width = columnWidth;
|
||||
// FIXME: Send a notifiaction
|
||||
}
|
||||
|
||||
|
||||
/**<p> Returns YES if the title of a column is set to the string value of
|
||||
the selected NSCell in the previous column. By default YES</p>
|
||||
<p>See Also: -setTakesTitleFromPreviousColumn: -selectedCellInColumn:</p>
|
||||
|
@ -1714,6 +1783,21 @@ static NSTextFieldCell *titleCell;
|
|||
return [self frameOfColumn: column];
|
||||
}
|
||||
|
||||
+ (void) removeSavedColumnsWithAutosaveName: (NSString *)name
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] removeObjectForKey: name];
|
||||
}
|
||||
|
||||
- (NSString *) columnsAutosaveName
|
||||
{
|
||||
return _columnsAutosaveName;
|
||||
}
|
||||
|
||||
- (void) setColumnsAutosaveName: (NSString *)name
|
||||
{
|
||||
// FIXME: More to do. The whole column width saving is missing!
|
||||
ASSIGN(_columnsAutosaveName, name);
|
||||
}
|
||||
|
||||
/*
|
||||
* Arranging browser components
|
||||
|
@ -2083,7 +2167,10 @@ static NSTextFieldCell *titleCell;
|
|||
titleCell = [GSBrowserTitleCell new];
|
||||
}
|
||||
|
||||
self = [super initWithFrame: rect];
|
||||
if ((self = [super initWithFrame: rect]) == nil)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Class setting
|
||||
_browserCellPrototype = [[[NSBrowser cellClass] alloc] init];
|
||||
|
@ -2536,7 +2623,7 @@ static NSTextFieldCell *titleCell;
|
|||
[aCoder encodeInt: _maxVisibleColumns forKey: @"NSNumberOfVisibleColumns"];
|
||||
[aCoder encodeInt: _minColumnWidth forKey: @"NSMinColumnWidth"];
|
||||
|
||||
//[aCoder encodeInt: columnResizingType forKey: @"NSColumnResizingType"]];
|
||||
[aCoder encodeInt: _columnResizing forKey: @"NSColumnResizingType"];
|
||||
//[aCoder encodeInt: prefWidth forKey: @"NSPreferedColumnWidth"];
|
||||
}
|
||||
else
|
||||
|
@ -2691,7 +2778,7 @@ static NSTextFieldCell *titleCell;
|
|||
|
||||
if ([aDecoder containsValueForKey: @"NSColumnResizingType"])
|
||||
{
|
||||
//[self setColumnResizingType: [aDecoder decodeIntForKey: @"NSColumnResizingType"]];
|
||||
[self setColumnResizingType: [aDecoder decodeIntForKey: @"NSColumnResizingType"]];
|
||||
}
|
||||
|
||||
if ([aDecoder containsValueForKey: @"NSPreferedColumnWidth"])
|
||||
|
|
|
@ -114,6 +114,9 @@ NSString *NSImageGamma = @"NSImageGamma";
|
|||
NSString *NSImageProgressive = @"NSImageProgressive";
|
||||
NSString *NSImageEXIFData = @"NSImageEXIFData"; // No support yet in GNUstep
|
||||
|
||||
// NSBrowser notification
|
||||
NSString *NSBrowserColumnConfigurationDidChangeNotification = @"NSBrowserColumnConfigurationDidChange";
|
||||
|
||||
// NSColor Global strings
|
||||
NSString *NSCalibratedWhiteColorSpace = @"NSCalibratedWhiteColorSpace";
|
||||
NSString *NSCalibratedBlackColorSpace = @"NSCalibratedBlackColorSpace";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue