RE: Upgraded tabbed_pane_widget

"Christian Boulanger" <[email protected]> Mon, 29 Sep 2003 18:14:11 +0200
Newsgroups gmane.comp.windows.devel.netwindows
Message-ID <000901c386a4$b8b5da30$16abfea9@Laptop>
OK, I got it to work. It required some hacking, though.

1) This is how I construct the tabbed-pane-within-split-pane:

    // split pane
    
    cont = document.getElementById("container");
    splitwin = new NW_WIDGET_FACTORY_split_pane(true, "200", true, 5);
    cont.appendChild(splitwin.domNode);
    splitwin.fixHeight();
    left_pane =  splitwin.pane1obj.contentNode;
    right_pane = splitwin.pane2obj.contentNode;
    
    //hack
    left_pane.style.height = "470px";   // without absolute size, scrollbars
are incorrect
    right_pane.style.height = "470px";

    // tabbed pane
    
    bib_pane = NW_WIDGET_FACTORY_tabbed_pane(600,470); // fixme: automatic
resizing?
    
    var start_tab = new NW_WIDGET_tab_ds("Introduction", "start.html");
    start_tab.getContent();
    bib_pane.addTab(start_tab);
    
    // hack
    start_tab.content.style.display = "block";  // otherwise, nothing is
displayed
    bib_pane.domNode.style.margin = "0px";      
	// there is a large gap over the tab labels, some space still
remains after this hack

    right_pane.appendChild(bib_pane.domNode);

There is still a really oversized padding within the pane content box which
I would like to get rid of eventually.

2) To get this to work in IE, I had to remove the source of exceptions
thrown in the widget:

tabbed_pane_widget.js

266	if((this.name.trim() != "")&&(!this.content)){
		__util__.setClass(content, "TabbedPane-content-div-" +
this.name );
	}

Needed to be changed to 

266	if((this.name.trim() != "")&&(***this.content)){
		__util__.setClass(**this**.content,
"TabbedPane-content-div-" + this.name );
	}

I don't know if this is what the author intended, but it works like this now
without IE throwing an exception.

3) I can creat new tabs with the following code

    // open bibliography 
    
    var newBibTab = document.createElement("div");
    var newBib = new _bibliography_(
        treeObj.type,
        treeObj.sourceName,
        treeObj.curBranchName,
        branchId,
        newBibTab
    );
    var newTab = new NW_WIDGET_tab_ds(treeObj.curBranchName,"",newBibTab);
    bib_pane.addTab(newTab);
    newTab.content.style.display = "block";

Several problems remain:
- The added tab does not display automatically, I have to click on it
- If I try bib_pane.switchDisp(newTab), an exception is thrown inside nW.
- the new tab content is temporarily attached to the bottom of the currently
visible tab (this disappears after clicking the tabs).

So much feedback for now...

Christian 


_______________________________________________
The netWindows developers list: [email protected]
http://netwindows.org/mailman/listinfo/devel_netwindows.org