mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Pop up a panel explaining the problem when requested a non implemented
panel; added standard info panel support git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5844 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a25e85609b
commit
157ba7eb35
2 changed files with 56 additions and 2 deletions
|
@ -30,6 +30,7 @@
|
|||
#define _GNUstep_H_NSApplication
|
||||
|
||||
#include <AppKit/NSResponder.h>
|
||||
#include <AppKit/GSInfoPanel.h>
|
||||
|
||||
@class NSArray;
|
||||
@class NSMutableArray;
|
||||
|
@ -69,18 +70,20 @@ extern NSString *NSEventTrackingRunLoopMode;
|
|||
NSMenu *main_menu;
|
||||
NSMenuItem *windows_menu;
|
||||
unsigned current_mod;
|
||||
// 8 bits
|
||||
BOOL app_is_running;
|
||||
BOOL app_should_quit;
|
||||
BOOL app_is_active;
|
||||
BOOL app_is_hidden;
|
||||
BOOL unhide_on_activation;
|
||||
BOOL windows_need_update;
|
||||
BOOL inTrackingLoop;
|
||||
NSImage *app_icon;
|
||||
NSMutableArray *_hidden;
|
||||
NSMutableArray *_inactive;
|
||||
NSWindow *_hidden_key;
|
||||
NSWindow *_app_icon_window;
|
||||
BOOL inTrackingLoop;
|
||||
GSInfoPanel *_infoPanel;
|
||||
|
||||
// Reserved for back-end use
|
||||
void *be_app_reserved;
|
||||
|
@ -184,6 +187,17 @@ extern NSString *NSEventTrackingRunLoopMode;
|
|||
- (void) orderFrontDataLinkPanel: (id)sender;
|
||||
- (void) orderFrontHelpPanel: (id)sender;
|
||||
- (void) runPageLayout: (id)sender;
|
||||
/* GNUstep extensions displaying an infoPanel, title is 'Info' */
|
||||
/* For a list of the useful values in the dictionary, see GSInfoPanel.h.
|
||||
The entries are mostly compatible with macosx. */
|
||||
- (void) orderFrontStandardInfoPanel: (id)sender;
|
||||
- (void) orderFrontStandardInfoPanelWithOptions: (NSDictionary *)dictionary;
|
||||
/* macosx extensions displaying an aboutPanel, title is 'About'.
|
||||
NB: These two methods do exactly the same as the two methods above,
|
||||
only the title is different. */
|
||||
- (void) orderFrontStandardAboutPanel: (id)sender;
|
||||
- (void) orderFrontStandardAboutPanelWithOptions: (NSDictionary *)dictionary;
|
||||
|
||||
|
||||
/*
|
||||
* Getting the main menu
|
||||
|
|
|
@ -719,6 +719,8 @@ static NSCell* tileCell = nil;
|
|||
NSZoneFree(NSDefaultMallocZone(), tmp);
|
||||
}
|
||||
|
||||
TEST_RELEASE (_infoPanel);
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -1612,19 +1614,57 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException);
|
|||
* Showing Standard Panels
|
||||
*/
|
||||
- (void) orderFrontColorPanel: sender
|
||||
{
|
||||
{
|
||||
NSRunAlertPanel (NULL, @"Color Panel not implemented yet",
|
||||
@"OK", NULL, NULL);
|
||||
}
|
||||
|
||||
- (void) orderFrontDataLinkPanel: sender
|
||||
{
|
||||
NSRunAlertPanel (NULL, @"Data Link Panel not implemented yet",
|
||||
@"OK", NULL, NULL);
|
||||
}
|
||||
|
||||
- (void) orderFrontHelpPanel: sender
|
||||
{
|
||||
NSRunAlertPanel (NULL, @"Help Panel not implemented yet",
|
||||
@"OK", NULL, NULL)
|
||||
}
|
||||
|
||||
- (void) runPageLayout: sender
|
||||
{
|
||||
NSRunAlertPanel (NULL, @"Page Layout Panel not implemented yet",
|
||||
@"OK", NULL, NULL);
|
||||
}
|
||||
|
||||
/* infoPanel, macosx API -- 'About' in the title */
|
||||
- (void) orderFrontStandardAboutPanel: sender
|
||||
{
|
||||
[self orderFrontStandardAboutPanel: sender];
|
||||
}
|
||||
|
||||
- (void) orderFrontStandardAboutPanelWithOptions: (NSDictionary *)options
|
||||
{
|
||||
if (_infoPanel == nil)
|
||||
_infoPanel = [[GSInfoPanel alloc] initWithDictionary: options];
|
||||
|
||||
[_infoPanel setTitle: @"About"];
|
||||
[_infoPanel orderFront: self];
|
||||
}
|
||||
|
||||
/* infoPanel, GNUstep API -- 'Info' in the title */
|
||||
- (void) orderFrontStandardInfoPanel: sender
|
||||
{
|
||||
[self orderFrontStandardInfoPanelWithOptions: nil];
|
||||
}
|
||||
|
||||
- (void) orderFrontStandardInfoPanelWithOptions: (NSDictionary *)options
|
||||
{
|
||||
if (_infoPanel == nil)
|
||||
_infoPanel = [[GSInfoPanel alloc] initWithDictionary: options];
|
||||
|
||||
[_infoPanel setTitle: @"Info"];
|
||||
[_infoPanel orderFront: self];
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue