]> err.no Git - scalable-opengroupware.org/commitdiff
stylesheet work
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 14 Jun 2004 14:41:46 +0000 (14:41 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 14 Jun 2004 14:41:46 +0000 (14:41 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@32 d1b88da0-ebda-0310-925b-ed51d893ca5b

ZideStore/UI-X/ChangeLog
ZideStore/UI-X/Common/UIxTabView.h
ZideStore/UI-X/Common/UIxTabView.m
ZideStore/UI-X/Common/zidestoreui.css
ZideStore/UI-X/Scheduler/OGoCalSelectTab.m
ZideStore/UI-X/Scheduler/OGoCalSelectTab.wox

index a21da544dd6d42cacbea011a4eb8b04d7669b7d3..00be6031265739c2143dea18460c2cce2d2b5410 100644 (file)
@@ -1,3 +1,14 @@
+2004-06-14  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * Common/UIxTabView.[hm]: more stylesheet support via headerStyle
+         and bodyStyle bindings.
+       
+       * Common/zidestoreui.css: styles for tabs, resembling OGo look.
+
+       * Scheduler/OGoCalSelectTab.m: implemented dateLabel (for testing).
+
+       * Scheduler/OGoCalSelectTab.wox: corrected selection binding namespace.
+
 2004-06-08  Helge Hess  <helge.hess@opengroupware.org>
 
        * Scheduler/NOTES: added class hierarchy
index 699a5e45e467b5838e52cd957bb9234f72f12245..8224b442dd7419c6d00f5c3bec956efec607060e 100644 (file)
@@ -48,6 +48,7 @@
 
   /* config: */
   WOAssociation *headerStyle;
+  WOAssociation *bodyStyle;
   WOAssociation *tabStyle;
   WOAssociation *selectedTabStyle;
 
index e43c51acb8553fe627574fd1bc12cca78eb2c9a2..19fb8729387aac53f4b9e5997d2d9d2c4ee026dc 100644 (file)
@@ -61,6 +61,7 @@ static NSNumber *YesNumber;
     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");
 
@@ -92,6 +93,7 @@ static NSNumber *YesNumber;
   [self->selection release];
 
   [self->headerStyle release];
+  [self->bodyStyle release];
   [self->tabStyle release];
   [self->selectedTabStyle release];
 
@@ -144,7 +146,7 @@ static NSNumber *YesNumber;
   NSString *activeTabKey;
   
   activeTabKey = [self->selection stringValueInComponent:[_ctx component]];
-  
+  NSLog(@"%s activeTabKey:%@", __PRETTY_FUNCTION__, activeTabKey);
   nestedState = [self saveNestedStateInContext:_ctx];
   [_ctx appendElementIDComponent:@"b"];
   [_ctx appendElementIDComponent:activeTabKey];
@@ -289,132 +291,53 @@ static NSNumber *YesNumber;
   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];
@@ -426,54 +349,25 @@ static NSNumber *YesNumber;
   [_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
@@ -539,6 +433,7 @@ static NSNumber *YesNumber;
 #undef _appendStr_
 #endif
   }
+#endif
 }
 
 - (void)appendSubmitButton:(UIxTabItemInfo *)_info
@@ -597,15 +492,26 @@ static NSNumber *YesNumber;
   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;
@@ -651,7 +557,15 @@ static NSNumber *YesNumber;
   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];
@@ -727,20 +641,27 @@ static NSNumber *YesNumber;
 {
   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 */
index 170bc423fa17e82441c5d2fc2c27383d2b41e56a..00804b54fe71c49f3cd953aa6be1416e0259221a 100644 (file)
@@ -33,6 +33,7 @@ a:hover {
 .linecolor {
   background-color: #06348B;
 }
+
 font.defaultfont {
   text-decoration:  none;
   font-family:      Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
@@ -40,6 +41,48 @@ font.defaultfont {
   color:            #000000;
 }
 
+/* tabs */
+
+.tab {
+  color:            #000000;
+  background-color: #e8e8e0;
+  font-size:        10pt;
+  text-decoration:  none;
+  width:            100px; 
+  height:           22px;
+  border-top:       1px solid #06348b;
+  border-right:     1px solid #06348b;
+}
+
+a.tab, a.tab:active, a.tab:link, a.tab:visited, a.tab:hover {
+  color:            #000000;
+  border:           none;
+  text-decoration:  none;
+}
+
+.tab_selected {
+  color:            #000000;
+  background-color: #f5f5e9;
+  font-size:        10pt;
+  text-decoration:  none;
+  font-weight:      bold;
+  width:            100px; 
+  height:           22px;
+  border-top:       1px solid #06348b;
+  border-right:     1px solid #06348b;
+}
+
+a.tab_selected, a.tab_selected:active, a.tab_selected:link, a.tab_selected:visited, a.tab_selected:hover {
+  color:            #000000;
+  border:           none;
+  text-decoration:  none;
+}
+
+.tabview_body {
+  background-color: #f5f5e9;
+}
+
+
 /* buttons */
 
 .button_auto {
index a8bc839e742d7d64a2c86304590cee315172c4a6..e79e9f2214fdc6fba908b97359df46202b4039c0 100644 (file)
@@ -58,7 +58,7 @@
 }
 
 - (NSString *)dayLabel {
-    return @"TODO: day";
+    return [self->currentDate descriptionWithCalendarFormat:@"%d"];
 }
 
 - (NSString *)weekLabel {
index 4a02b5575bb57638269faf2abb2f0643f0d1da9d..d2e5422328073e53fc4036fd4b2d0ca617b58d8a 100644 (file)
@@ -5,9 +5,10 @@
              xmlns:const="http://www.skyrix.com/od/constant"
              xmlns:rsrc="OGo:url"
              xmlns:uix="OGo:uix"
-             selection="selection"
+             var:selection="selection"
              const:tabStyle="tab"
-             const:selectedTabStyle="selectedTab"
+             const:selectedTabStyle="tab_selected"
+             const:bodyStyle="tabview_body"
 >
      <uix:tab const:key="day" var:label="dayLabel" const:href="dayoverview">
      <var:component-content />