self->selection = WOExtGetProperty(_config, @"selection");
self->headerStyle = WOExtGetProperty(_config, @"headerStyle");
+ self->bodyStyle = WOExtGetProperty(_config, @"bodyStyle");
self->tabStyle = WOExtGetProperty(_config, @"tabStyle");
self->selectedTabStyle = WOExtGetProperty(_config, @"selectedTabStyle");
[self->selection release];
[self->headerStyle release];
+ [self->bodyStyle release];
[self->tabStyle release];
[self->selectedTabStyle release];
NSString *activeTabKey;
activeTabKey = [self->selection stringValueInComponent:[_ctx component]];
-
+ NSLog(@"%s activeTabKey:%@", __PRETTY_FUNCTION__, activeTabKey);
nestedState = [self saveNestedStateInContext:_ctx];
[_ctx appendElementIDComponent:@"b"];
[_ctx appendElementIDComponent:activeTabKey];
isActive:(BOOL)_isActive isLeft:(BOOL)_isLeft
doScript:(BOOL)_doScript keys:(NSArray *)_keys
{
- BOOL doBgIcon;
- BOOL doImages;
NSString *headUri = nil;
- NSString *imgUri = nil;
NSString *label = nil;
- NSString *bgcolor = nil;
- NSString *w = nil;
- NSString *h = nil;
NSString *scriptHref = nil;
NSString *styleName = nil;
+ WEClientCapabilities *ccaps;
WOComponent *comp;
- doImages = ![[[_ctx request] clientCapabilities] isTextModeBrowser];
+ ccaps = [[_ctx request] clientCapabilities];
comp = [_ctx component];
headUri = _info->uri;
- if (_info->asBackground == 0)
- doBgIcon = [self->asBackground boolValueInComponent:comp];
- else
- doBgIcon = (_info->asBackground == 1) ? YES : NO;
-
if ((label = _info->label) == nil)
label = _info->key;
- if (doImages) {
- /* lookup image */
- NSString *imgName = nil;
-
- if (_isActive) {
- imgName = _info->selIcon; // selectedTabIcon
- if (imgName == nil)
- imgName = [self->selectedTabIcon stringValueInComponent:comp];
- }
- else if (_isLeft) {
- imgName = _info->leftIcon; // leftTabIcon
- if (imgName == nil)
- imgName = [self->leftTabIcon stringValueInComponent:comp];
- }
- else {
- imgName = _info->tabIcon; // tabIcon
- if (imgName == nil)
- imgName = [self->tabIcon stringValueInComponent:comp];
- }
-
- if (imgName == nil) {
- imgName = _info->icon;
- }
-
- imgUri = WEUriOfResource(imgName, _ctx);
-
- if ([imgUri length] < 1)
- doImages = NO;
- }
-
if (_isActive) {
- bgcolor = (_info->activeBg)
- ? _info->activeBg
- : [self->activeBgColor stringValueInComponent:comp];
styleName = (_info->selectedTabStyle)
? _info->selectedTabStyle
: [self->selectedTabStyle stringValueInComponent:comp];
}
else {
- bgcolor = (_info->inactiveBg)
- ? _info->inactiveBg
- : [self->inactiveBgColor stringValueInComponent:comp];
styleName = (_info->tabStyle)
? _info->tabStyle
: [self->tabStyle stringValueInComponent:comp];
}
- w = (_info->width)
- ? _info->width
- : [self->width stringValueInComponent:comp];
- h = (_info->height)
- ? _info->height
- : [self->height stringValueInComponent:comp];
-
[_response appendContentString:@"<td align='center' valign='middle'"];
- if (w) {
- [_response appendContentString:@" width='"];
- [_response appendContentHTMLAttributeValue:w];
- [_response appendContentCharacter:'\''];
- }
- if (h) {
- [_response appendContentString:@" height='"];
- [_response appendContentHTMLAttributeValue:h];
- [_response appendContentCharacter:'\''];
- }
- if (bgcolor) {
- [_response appendContentString:@" bgcolor='"];
- [_response appendContentHTMLAttributeValue:bgcolor];
- [_response appendContentCharacter:'\''];
- }
if (styleName) {
[_response appendContentString:@" class='"];
[_response appendContentHTMLAttributeValue:styleName];
[_response appendContentCharacter:'\''];
}
- if (doBgIcon && doImages) {
- WEClientCapabilities *ccaps;
-
- ccaps = [[_ctx request] clientCapabilities];
-
- [_response appendContentString:@" background='"];
- [_response appendContentHTMLAttributeValue:imgUri];
- [_response appendContentCharacter:'\''];
- // click on td background
- if ([ccaps isInternetExplorer] && [ccaps isJavaScriptBrowser]) {
+ // click on td background
+ if ([ccaps isInternetExplorer] && [ccaps isJavaScriptBrowser]) {
[_response appendContentString:@" onclick=\"window.location.href='"];
- [_response appendContentHTMLAttributeValue:headUri];
+ [_response appendContentHTMLAttributeValue:headUri];
[_response appendContentString:@"'\""];
- }
}
[_response appendContentCharacter:'>'];
-
- if (!doImages) [_response appendContentString:@"["];
-
- [_response appendContentString:@"<a style=\"text-decoration:none;\" href=\""];
- if (_doScript && doImages && (_info->isScript || _isActive)) {
+ [_response appendContentString:@"<a href=\""];
+
+ if (_doScript && (_info->isScript || _isActive)) {
scriptHref =
[self scriptHref:_info inContext:_ctx isLeft:_isLeft keys:_keys];
[_response appendContentHTMLAttributeValue:scriptHref];
[_response appendContentString:@"\" "];
[_response appendContentString:
[NSString stringWithFormat:@"name='%@TabLink'", _info->key]];
+ if (styleName) {
+ [_response appendContentString:@" class='"];
+ [_response appendContentHTMLAttributeValue:styleName];
+ [_response appendContentCharacter:'\''];
+ }
[_response appendContentString:@">"];
- if (!doImages && _isActive)
- [_response appendContentString:@"<b>"];
-
- if (doImages && !doBgIcon) {
- [_response appendContentString:@"<img border='0' src='"];
- [_response appendContentString:imgUri];
- [_response appendContentString:@"' name='"];
- [_response appendContentString:_info->key];
- [_response appendContentString:@"TabImg' alt='"];
- [_response appendContentHTMLAttributeValue:label];
- [_response appendContentString:@"' title='"];
- [_response appendContentHTMLAttributeValue:label];
- [_response appendContentString:@"'"];
- [_response appendContentString:@" />"];
- }
- else {
- NSString *fc = [self->fontColor stringValueInComponent:comp];
- NSString *fs = [self->fontSize stringValueInComponent:comp];
- NSString *ff = [self->fontFace stringValueInComponent:comp];
- BOOL hasFont;
-
- hasFont = (fc || fs || ff) ? YES : NO;
-
- if ([label length] < 1)
+ if ([label length] < 1)
label = _info->key;
- [_response appendContentString:@"<nobr>"];
- if (hasFont) WEAppendFont(_response, fc, ff, fs); // <font>
-
- if (_isActive) [_response appendContentString:@"<b>"];
- [_response appendContentHTMLString:label];
- if (_isActive) [_response appendContentString:@"</b>"];
-
- if (hasFont) [_response appendContentString:@"</font>"]; // </font>
- [_response appendContentString:@"</nobr>"];
- }
-
- if (!doImages && _isActive)
- [_response appendContentString:@"</b>"];
+ [_response appendContentString:@"<nobr>"];
+ [_response appendContentHTMLString:label];
+ [_response appendContentString:@"</nobr>"];
[_response appendContentString:@"</a>"];
- if (!doImages) [_response appendContentString:@"]"];
-
[_response appendContentString:@"</td>"];
-
- if (_doScript && doImages && (_info->isScript || _isActive)) {
+
+#if 0
+ if (_doScript && (_info->isScript || _isActive)) {
NSString *k; // key
NSString *s; // selected tab icon
NSString *u; // unselected tab icon
#undef _appendStr_
#endif
}
+#endif
}
- (void)appendSubmitButton:(UIxTabItemInfo *)_info
keys:(NSArray *)keys activeKey:(NSString *)activeKey
doScript:(BOOL)doScript
{
- unsigned i, count;
- BOOL doForm;
+ unsigned i, count;
+ BOOL doForm;
+ NSString *styleName;
doForm = NO; /* generate form controls ? */
[_response appendContentString:@"<tr><td colspan='2'>"];
- [_response appendContentString:
- @"<table border='0' cellpadding='0' cellspacing='0'><tr>"];
+ styleName = [self->headerStyle stringValueInComponent:[_ctx component]];
+ if(styleName) {
+ [_response appendContentString:
+ @"<table border='0' cellpadding='0' cellspacing='0' class='"];
+ [_response appendContentHTMLAttributeValue:styleName];
+ [_response appendContentString:@"'><tr>"];
+ }
+ else {
+ [_response appendContentString:
+ @"<table border='0' cellpadding='0' cellspacing='0'><tr>"];
+ }
+
for (i = 0, count = [keys count]; i < count; i++) {
UIxTabItemInfo *info;
NSString *key;
doScript:(BOOL)doScript
isLeftActive:(BOOL)isLeftActive
{
+ NSString *styleName;
[_response appendContentString:@" <tr"];
+
+ styleName = [self->bodyStyle stringValueInComponent:[_ctx component]];
+ if(styleName) {
+ [_response appendContentString:@" class='"];
+ [_response appendContentHTMLAttributeValue:styleName];
+ [_response appendContentCharacter:'\''];
+ }
if (bgcolor) {
[_response appendContentString:@" bgcolor=\""];
[_response appendContentHTMLAttributeValue:bgcolor];
{
WEClientCapabilities *ccaps;
BOOL indentContent;
-
+ NSString *styleName;
+
+ styleName = [self->bodyStyle stringValueInComponent:[_ctx component]];
ccaps = [[_ctx request] clientCapabilities];
-
+
/* put additional padding table into content ??? */
indentContent = [ccaps isFastTableBrowser] && ![ccaps isTextModeBrowser];
- [_response appendContentString:@"<tr><td colspan='2'"];
-
+ [_response appendContentString:@"<tr"];
+ if(styleName) {
+ [_response appendContentString:@" class='"];
+ [_response appendContentHTMLAttributeValue:styleName];
+ [_response appendContentCharacter:'\''];
+ }
+ [_response appendContentString:@"><td colspan='2'"];
if (bgcolor) {
[_response appendContentString:@" bgcolor=\""];
[_response appendContentHTMLAttributeValue:bgcolor];
- [_response appendContentString:@"\""];
+ [_response appendContentCharacter:'\"'];
}
- [_response appendContentString:@">"];
+ [_response appendContentCharacter:'>'];
if (indentContent) {
/* start padding table */