Monotone-Parent: 269cd0a16b31c221370fdeb7c63b2eb4e0684419

Monotone-Revision: 383ee921a819c519f6f0303f90a0c3b887974b85

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-11-07T18:15:16
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau 2006-11-07 18:15:16 +00:00
parent 8506eafd68
commit 66591b628c
3 changed files with 84 additions and 26 deletions

View file

@ -31,6 +31,7 @@
@interface UIxPageFrame : UIxComponent @interface UIxPageFrame : UIxComponent
{ {
NSString *title; NSString *title;
NSString *toolbar;
id item; id item;
BOOL isPopup; BOOL isPopup;
} }
@ -50,6 +51,9 @@
- (void) setPopup: (BOOL) popup; - (void) setPopup: (BOOL) popup;
- (BOOL) isPopup; - (BOOL) isPopup;
- (void) setToolbar: (NSString *) newToolbar;
- (NSString *) toolbar;
@end @end
#endif /* UIXPAGEFRAME_H */ #endif /* UIXPAGEFRAME_H */

View file

@ -28,31 +28,43 @@
@implementation UIxPageFrame @implementation UIxPageFrame
- (id) init
{
if ((self = [super init]))
{
toolbar = nil;
}
return self;
}
- (void)dealloc { - (void)dealloc {
[self->item release]; [item release];
[self->title release]; [title release];
if (toolbar)
[toolbar release];
[super dealloc]; [super dealloc];
} }
/* accessors */ /* accessors */
- (void)setTitle:(NSString *)_value { - (void)setTitle:(NSString *)_value {
ASSIGNCOPY(self->title, _value); ASSIGNCOPY(title, _value);
} }
- (NSString *)title { - (NSString *)title {
if ([self isUIxDebugEnabled]) if ([self isUIxDebugEnabled])
return self->title; return title;
return [self labelForKey: @"SOGo"]; return [self labelForKey: @"SOGo"];
} }
- (void)setItem:(id)_item { - (void)setItem:(id)_item {
ASSIGN(self->item, _item); ASSIGN(item, _item);
} }
- (id)item { - (id)item {
return self->item; return item;
} }
- (NSString *)ownerInContext { - (NSString *)ownerInContext {
@ -71,18 +83,19 @@
- (NSString *)helpURL - (NSString *)helpURL
{ {
return [NSString stringWithFormat: @"help/%@.html", self->title]; return [NSString stringWithFormat: @"help/%@.html", title];
} }
- (NSString *)helpWindowTarget - (NSString *)helpWindowTarget
{ {
return [NSString stringWithFormat: @"Help_%@", self->title]; return [NSString stringWithFormat: @"Help_%@", title];
} }
/* notifications */ /* notifications */
- (void)sleep { - (void)sleep {
[self->item release]; self->item = nil; [item release];
item = nil;
[super sleep]; [super sleep];
} }
@ -214,4 +227,14 @@
return ([[self productCSSURL] length] > 0); return ([[self productCSSURL] length] > 0);
} }
- (void) setToolbar: (NSString *) newToolbar
{
ASSIGN (toolbar, newToolbar);
}
- (NSString *) toolbar
{
return toolbar;
}
@end /* UIxPageFrame */ @end /* UIxPageFrame */

View file

@ -34,44 +34,61 @@
{ {
NSArray *toolbarConfig; NSArray *toolbarConfig;
NSArray *toolbarGroup; NSArray *toolbarGroup;
NSString *toolbar;
NSDictionary *buttonInfo; NSDictionary *buttonInfo;
} }
- (void) setToolbar: (NSString *) newToolbar;
- (NSString *) toolbar;
@end @end
@implementation UIxToolbar @implementation UIxToolbar
- (id) init
{
if ((self = [super init]))
{
toolbar = nil;
}
return self;
}
- (void)dealloc { - (void)dealloc {
[self->toolbarGroup release]; [toolbarGroup release];
[self->toolbarConfig release]; [toolbarConfig release];
[self->buttonInfo release]; [buttonInfo release];
if (toolbar)
[toolbar release];
[super dealloc]; [super dealloc];
} }
/* notifications */ /* notifications */
- (void)sleep { - (void)sleep {
[self->toolbarGroup release]; self->toolbarGroup = nil; [toolbarGroup release]; toolbarGroup = nil;
[self->toolbarConfig release]; self->toolbarConfig = nil; [toolbarConfig release]; toolbarConfig = nil;
[self->buttonInfo release]; self->buttonInfo = nil; [buttonInfo release]; buttonInfo = nil;
[super sleep]; [super sleep];
} }
/* accessors */ /* accessors */
- (void)setToolbarGroup:(id)_group { - (void)setToolbarGroup:(id)_group {
ASSIGN(self->toolbarGroup, _group); ASSIGN(toolbarGroup, _group);
} }
- (id)toolbarGroup { - (id)toolbarGroup {
return self->toolbarGroup; return toolbarGroup;
} }
- (void)setButtonInfo:(id)_info { - (void)setButtonInfo:(id)_info {
ASSIGN(self->buttonInfo, _info); ASSIGN(buttonInfo, _info);
} }
- (id)buttonInfo { - (id)buttonInfo {
return self->buttonInfo; return buttonInfo;
} }
/* toolbar */ /* toolbar */
@ -144,24 +161,28 @@
- (id)toolbarConfig { - (id)toolbarConfig {
id tb; id tb;
if (self->toolbarConfig != nil) if (toolbarConfig != nil)
return [self->toolbarConfig isNotNull] ? self->toolbarConfig : nil; return [toolbarConfig isNotNull] ? toolbarConfig : nil;
if (toolbar)
tb = toolbar;
else
tb = [[self clientObject] lookupName:@"toolbar" inContext:[self context] tb = [[self clientObject] lookupName:@"toolbar" inContext:[self context]
acquire:NO]; acquire:NO];
if ([tb isKindOfClass:[NSException class]]) { if ([tb isKindOfClass:[NSException class]]) {
[self errorWithFormat: [self errorWithFormat:
@"not toolbar configuration found on SoObject: %@ (%@)", @"not toolbar configuration found on SoObject: %@ (%@)",
[self clientObject], [[self clientObject] soClass]]; [self clientObject], [[self clientObject] soClass]];
self->toolbarConfig = [[NSNull null] retain]; toolbarConfig = [[NSNull null] retain];
return nil; return nil;
} }
if ([tb isKindOfClass:[NSString class]]) if ([tb isKindOfClass:[NSString class]])
tb = [self loadToolbarConfigFromResourceNamed:tb]; tb = [self loadToolbarConfigFromResourceNamed:tb];
self->toolbarConfig = [tb retain]; toolbarConfig = [tb retain];
return self->toolbarConfig; return toolbarConfig;
} }
/* labels */ /* labels */
@ -219,4 +240,14 @@
return (amount > 0); return (amount > 0);
} }
- (void) setToolbar: (NSString *) newToolbar
{
ASSIGN(toolbar, newToolbar);
}
- (NSString *) toolbar
{
return toolbar;
}
@end /* UIxToolbar */ @end /* UIxToolbar */