mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 18:11:06 +00:00
Data link implementation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20045 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
05af0a68bc
commit
55d59ae5c2
8 changed files with 130 additions and 36 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2004-09-12 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Headers/NSDataLinkPanel.h: Added new attributes.
|
||||
* Source/NSDataLinkPanel.m: Implemented some
|
||||
methods.
|
||||
* Panels/English.lproj/GSDataLinkPanel.gorm: Updated
|
||||
graphics and added link to new ivar.
|
||||
* Source/NSDataLink.m:
|
||||
* Source/NSDataLinkManager.m: Code cleanup.
|
||||
|
||||
2004-09-11 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Source/NSCell.m: Reverted previous change.
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
@interface NSDataLinkPanel : NSPanel <NSCoding>
|
||||
{
|
||||
// Attributes
|
||||
// Outlets
|
||||
id _sourceField;
|
||||
id _lastUpdateField;
|
||||
id _openSourceButton;
|
||||
|
@ -50,6 +50,12 @@
|
|||
id _breakLinkButton;
|
||||
id _breakAllLinksButton;
|
||||
id _updateModeButton;
|
||||
|
||||
// Attributes
|
||||
NSDataLinkManager *_currentDataLinkManager;
|
||||
NSDataLink *_currentDataLink;
|
||||
BOOL _multipleSelection;
|
||||
NSView *_accessoryView;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -165,7 +165,8 @@
|
|||
_updateDestinationButton,
|
||||
_openSourceButton,
|
||||
_lastUpdateField,
|
||||
_sourceField
|
||||
_sourceField,
|
||||
_updateView
|
||||
);
|
||||
Super = NSPanel;
|
||||
};
|
||||
|
|
BIN
Panels/English.lproj/GSDataLinkPanel.gorm/data.info
Normal file
BIN
Panels/English.lproj/GSDataLinkPanel.gorm/data.info
Normal file
Binary file not shown.
Binary file not shown.
|
@ -89,7 +89,8 @@
|
|||
}
|
||||
|
||||
- (void)writeToPasteboard:(NSPasteboard *)pasteboard
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// Information about the Link
|
||||
|
|
|
@ -98,31 +98,40 @@
|
|||
}
|
||||
|
||||
- (void)breakAllLinks
|
||||
{}
|
||||
{
|
||||
NSLog(@"Break all links.");
|
||||
}
|
||||
|
||||
- (void)writeLinksToPasteboard:(NSPasteboard *)pasteboard
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// Informing the Link Manager of Document Status
|
||||
//
|
||||
- (void)noteDocumentClosed
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
- (void)noteDocumentEdited
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
- (void)noteDocumentReverted
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
- (void)noteDocumentSaved
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
- (void)noteDocumentSavedAs:(NSString *)path
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
- (void)noteDocumentSavedTo:(NSString *)path
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// Getting and Setting Information about the Link Manager
|
||||
|
@ -202,7 +211,8 @@ cheapCopyAllowed:(BOOL)flag
|
|||
|
||||
- (void)dataLinkManager:(NSDataLinkManager *)sender
|
||||
didBreakLink:(NSDataLink *)link
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
- (BOOL)dataLinkManager:(NSDataLinkManager *)sender
|
||||
isUpdateNeededForLink:(NSDataLink *)link
|
||||
|
@ -212,20 +222,25 @@ cheapCopyAllowed:(BOOL)flag
|
|||
|
||||
- (void)dataLinkManager:(NSDataLinkManager *)sender
|
||||
startTrackingLink:(NSDataLink *)link
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
- (void)dataLinkManager:(NSDataLinkManager *)sender
|
||||
stopTrackingLink:(NSDataLink *)link
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
- (void)dataLinkManagerCloseDocument:(NSDataLinkManager *)sender
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
- (void)dataLinkManagerDidEditLinks:(NSDataLinkManager *)sender
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
- (void)dataLinkManagerRedrawLinkOutlines:(NSDataLinkManager *)sender
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
- (BOOL)dataLinkManagerTracksLinksIndividually:(NSDataLinkManager *)sender
|
||||
{
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
/** <title>NSDataLinkPanel</title>
|
||||
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
Author: Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
Author: Scott Christley <scottc@net-community.com>
|
||||
Date: 1996
|
||||
Date: 1996, 2003, 2004
|
||||
|
||||
This file is part of the GNUstep GUI Library.
|
||||
|
||||
|
@ -25,6 +26,9 @@
|
|||
|
||||
#include "config.h"
|
||||
#include "AppKit/NSDataLinkPanel.h"
|
||||
#include "AppKit/NSDataLinkManager.h"
|
||||
#include "AppKit/NSDataLink.h"
|
||||
#include "AppKit/NSView.h"
|
||||
#include "AppKit/NSNibLoading.h"
|
||||
#include "GSGuiPrivate.h"
|
||||
|
||||
|
@ -77,6 +81,10 @@ static NSDataLinkPanel *_sharedDataLinkPanel;
|
|||
|
||||
@implementation NSApplication (NSDataLinkPanel)
|
||||
|
||||
/**
|
||||
* Order the data link panel to the front. If it has not already
|
||||
* been instantiated, instantiate it.
|
||||
*/
|
||||
- (void) orderFrontDataLinkPanel: sender
|
||||
{
|
||||
NSDataLinkPanel *dataLinkPanel = [NSDataLinkPanel sharedDataLinkPanel];
|
||||
|
@ -91,9 +99,6 @@ static NSDataLinkPanel *_sharedDataLinkPanel;
|
|||
|
||||
@implementation NSDataLinkPanel
|
||||
|
||||
//
|
||||
// Class methods
|
||||
//
|
||||
+ (void)initialize
|
||||
{
|
||||
if (self == [NSDataLinkPanel class])
|
||||
|
@ -103,92 +108,148 @@ static NSDataLinkPanel *_sharedDataLinkPanel;
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Initializing
|
||||
//
|
||||
/**
|
||||
* Initializes and returns the shared panel.
|
||||
*/
|
||||
+ (NSDataLinkPanel *)sharedDataLinkPanel
|
||||
{
|
||||
if(_sharedDataLinkPanel == nil)
|
||||
{
|
||||
id controller = [[GSDataLinkPanelController alloc] init];
|
||||
_sharedDataLinkPanel = [controller panel];
|
||||
[_sharedDataLinkPanel setDelegate: controller];
|
||||
}
|
||||
NSLog(@"%@",_sharedDataLinkPanel);
|
||||
return _sharedDataLinkPanel;
|
||||
}
|
||||
|
||||
//
|
||||
// Keeping the Panel Up to Date
|
||||
//
|
||||
/**
|
||||
* Get the currently selected array of links and thier respective managers.
|
||||
* Return the whether or not multiple links are selected in flag.
|
||||
*/
|
||||
+ (void)getLink:(NSDataLink **)link
|
||||
manager:(NSDataLinkManager **)linkManager
|
||||
isMultiple:(BOOL *)flag
|
||||
{
|
||||
[[NSDataLinkPanel sharedDataLinkPanel]
|
||||
getLink: link
|
||||
manager: linkManager
|
||||
isMultiple: flag];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the currently selected array of links and their respective managers.
|
||||
* If all of the given links should be selected flag should be YES.
|
||||
*/
|
||||
+ (void)setLink:(NSDataLink *)link
|
||||
manager:(NSDataLinkManager *)linkManager
|
||||
isMultiple:(BOOL)flag
|
||||
{
|
||||
[[NSDataLinkPanel sharedDataLinkPanel]
|
||||
setLink: link
|
||||
manager: linkManager
|
||||
isMultiple: flag];
|
||||
}
|
||||
|
||||
//
|
||||
// Instance methods
|
||||
//
|
||||
|
||||
//
|
||||
// Keeping the Panel Up to Date
|
||||
//
|
||||
/**
|
||||
* Get the currently selected array of links and thier respective managers.
|
||||
* Return the whether or not multiple links are selected in flag.
|
||||
*/
|
||||
- (void)getLink:(NSDataLink **)link
|
||||
manager:(NSDataLinkManager **)linkManager
|
||||
isMultiple:(BOOL *)flag
|
||||
{
|
||||
ASSIGN(*link, _currentDataLink);
|
||||
ASSIGN(*linkManager, _currentDataLinkManager);
|
||||
*flag = _multipleSelection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the currently selected array of links and their respective managers.
|
||||
* If all of the given links should be selected flag should be YES.
|
||||
*/
|
||||
- (void)setLink:(NSDataLink *)link
|
||||
manager:(NSDataLinkManager *)linkManager
|
||||
isMultiple:(BOOL)flag
|
||||
{
|
||||
ASSIGN(_currentDataLink, link);
|
||||
ASSIGN(_currentDataLinkManager, linkManager);
|
||||
_multipleSelection = flag;
|
||||
}
|
||||
|
||||
//
|
||||
// Customizing the Panel
|
||||
//
|
||||
|
||||
/**
|
||||
* Add an accessory view to the panel.
|
||||
*/
|
||||
- (NSView *)accessoryView
|
||||
{
|
||||
// not yet implemented.
|
||||
return nil;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the accessory view.
|
||||
*/
|
||||
- (void)setAccessoryView:(NSView *)aView
|
||||
{
|
||||
// not yet implemented.
|
||||
}
|
||||
|
||||
//
|
||||
// Responding to User Input
|
||||
//
|
||||
|
||||
/**
|
||||
* Called when the user presses the Break All Links button.
|
||||
* Invokes breakAllLinks on the current link manager.
|
||||
*/
|
||||
- (void)pickedBreakAllLinks:(id)sender
|
||||
{
|
||||
NSLog(@"Break all links...");
|
||||
[_currentDataLinkManager breakAllLinks];
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the user presses the Break button.
|
||||
* Invokes break on the current link.
|
||||
*/
|
||||
- (void)pickedBreakLink:(id)sender
|
||||
{
|
||||
NSLog(@"Break link...");
|
||||
[_currentDataLink break];
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the user presses the Open Source button.
|
||||
* Invokes openSource on the current link.
|
||||
*/
|
||||
- (void)pickedOpenSource:(id)sender
|
||||
{
|
||||
NSLog(@"Open Source...");
|
||||
[_currentDataLink openSource];
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the Update Destination button
|
||||
* Invokes updateDestination on the current link.
|
||||
*/
|
||||
- (void)pickedUpdateDestination:(id)sender
|
||||
{
|
||||
NSLog(@"Update destination...");
|
||||
[_currentDataLink updateDestination];
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the user selects an update mode from the pull down.
|
||||
* Invokes setUpdateMode: on the current link.
|
||||
*/
|
||||
- (void)pickedUpdateMode:(id)sender
|
||||
{
|
||||
NSLog(@"Update mode..");
|
||||
NSDataLinkUpdateMode mode = (NSDataLinkUpdateMode)[sender tag];
|
||||
[_currentDataLink setUpdateMode: mode];
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue