mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
NSBrowser rewrite.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5339 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
009e69756d
commit
135cf168a5
6 changed files with 2198 additions and 1180 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
1999-11-30 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* Headers/gnustep/gui/NSBrowser.m: Add some ivars, removed others.
|
||||
* Source/NSBrowser.m: Rewrite for better functionality.
|
||||
|
||||
* Source/NSBrowserCell.m (-drawInteriorWithFrame:inView): Check
|
||||
to make sure we have a controlView.
|
||||
* Source/NSCell.m: Likewise.
|
||||
* Source/NSView.m (-lockFocusInRect:): Check to make sure
|
||||
we have a window.
|
||||
(patches from F. Wolff <wolff@cybercable.fr>).
|
||||
|
||||
Tue Nov 30 19:44:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSWindow.m: Rewrote ([-encodeWithCoder:]) and
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
@class NSCell;
|
||||
@class NSMatrix;
|
||||
@class NSScroller;
|
||||
//@class NSBox;
|
||||
|
||||
@interface NSBrowser : NSControl <NSCoding>
|
||||
{
|
||||
|
@ -55,8 +56,12 @@
|
|||
BOOL _separatesColumns;
|
||||
BOOL _takesTitleFromPreviousColumn;
|
||||
BOOL _isTitled;
|
||||
|
||||
//NSBox *_horizontalScrollerBox;
|
||||
NSScroller *_horizontalScroller;
|
||||
BOOL _hasHorizontalScroller;
|
||||
BOOL _skipUpdateScroller;
|
||||
|
||||
BOOL _acceptsArrowKeys;
|
||||
BOOL _sendsActionOnArrowKeys;
|
||||
BOOL _passiveDelegate;
|
||||
|
|
3344
Source/NSBrowser.m
3344
Source/NSBrowser.m
File diff suppressed because it is too large
Load diff
|
@ -110,7 +110,7 @@ static NSFont *leafFont;
|
|||
// A GNUstep experimental feature
|
||||
if ([[NSUserDefaults standardUserDefaults]
|
||||
boolForKey: @"GSBrowserCellFontify"])
|
||||
{
|
||||
{
|
||||
gsFontifyCells = YES;
|
||||
cellClass = [NSTextFieldCell class];
|
||||
//nonLeafColor = RETAIN ([colorClass colorWithCalibratedWhite: 0.222
|
||||
|
@ -315,6 +315,8 @@ static NSFont *leafFont;
|
|||
NSColor *backColor;
|
||||
|
||||
control_view = controlView; // remember last view cell was drawn in
|
||||
if (![controlView window])
|
||||
return;
|
||||
[controlView lockFocus];
|
||||
if (cell_highlighted || cell_state)
|
||||
{
|
||||
|
|
|
@ -704,6 +704,9 @@ static NSColor *shadowCol;
|
|||
//
|
||||
- (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView
|
||||
{
|
||||
if (![controlView window])
|
||||
return;
|
||||
|
||||
cellFrame = [self drawingRectForBounds: cellFrame];
|
||||
[controlView lockFocus];
|
||||
|
||||
|
@ -747,10 +750,11 @@ static NSColor *shadowCol;
|
|||
[self setControlView: controlView];
|
||||
|
||||
// do nothing if cell's frame rect is zero
|
||||
if (NSIsEmptyRect(cellFrame))
|
||||
if (NSIsEmptyRect(cellFrame) || ![controlView window])
|
||||
return;
|
||||
|
||||
[controlView lockFocus];
|
||||
|
||||
// draw the border if needed
|
||||
if ([self isBordered])
|
||||
{
|
||||
|
@ -1063,14 +1067,17 @@ static NSColor *shadowCol;
|
|||
[(NSControl*)controlView sendAction: action to: target];
|
||||
}
|
||||
}
|
||||
|
||||
// Tell ourselves to stop tracking
|
||||
[self stopTracking: last_point
|
||||
at: point
|
||||
inView: controlView
|
||||
mouseIsUp: mouseWentUp];
|
||||
|
||||
|
||||
if (cell_continuous)
|
||||
[NSEvent stopPeriodicEvents];
|
||||
|
||||
// Return YES only if the mouse went up within the cell
|
||||
if (mouseWentUp && [controlView mouse: point inRect: cellFrame])
|
||||
{
|
||||
|
|
|
@ -1237,6 +1237,8 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
struct NSWindow_struct *window_t;
|
||||
NSRect wrect;
|
||||
|
||||
NSAssert(window != nil, NSInternalInconsistencyException);
|
||||
|
||||
[ctxt lockFocusView: self inRect: rect];
|
||||
wrect = [self convertRect: rect toView: nil];
|
||||
window_t = (struct NSWindow_struct *)window;
|
||||
|
@ -1300,6 +1302,8 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
struct NSWindow_struct *window_t;
|
||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||
|
||||
NSAssert(window != nil, NSInternalInconsistencyException);
|
||||
|
||||
/* Restore our original gstate */
|
||||
DPSgrestore(ctxt);
|
||||
/* Restore gstate of nesting lockFocus (if any) */
|
||||
|
|
Loading…
Reference in a new issue