Bug 170011 - [CTabFolder] feature request: allow writing text/image to tabless folder
Summary: [CTabFolder] feature request: allow writing text/image to tabless folder
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Duong Nguyen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-09 15:23 EST by Paul E. Keyser CLA
Modified: 2019-09-06 15:32 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul E. Keyser CLA 2007-01-09 15:23:35 EST
Build ID:  M20060921-0945

Steps To Reproduce:
1.Create a CTabFolder, backed by some data-model
2.Allow user to delete any tab
3.User deletes last tab; coder wishes to write message in CTablFolder area -- no way to do so


More information:
I'd like to be able to display some sort of useful help message to the user after they close (delete) all tabs in a CTabFolder (that is valid in my app, but perhaps was not intended by CTabFolder). 

I'm aware of bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=25615

I've tried to make use of Snippet 214, but it fails (or maybe I copied the code wrongly); "folder()" of course just returns the CTabFolder, and the code is called at a time when the user deletes the last tab, and the folder().getBounds() is fine, e.g. Rectangle {29, 28, 576, 237}:

            final Image old = folder().getBackgroundImage();
            if (null != old) {
                old.dispose();
            }
            final Rectangle bounds = folder().getBounds();
            final Display display = Display.getCurrent();
            final Image newImage = new Image(display, Math.max(1, bounds.width), 1);
            final GC gc = new GC(newImage);

            // temporarily just copy the Snippet 214 image; later write text:
            gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
            gc.setBackground(display.getSystemColor(SWT.COLOR_BLUE));
            gc.fillGradientRectangle(bounds.x, bounds.y, bounds.width, 1, false);

            gc.dispose();
            folder().setBackgroundImage(newImage);
            folder().getParent().layout();
Comment 1 Eclipse Webmaster CLA 2019-09-06 15:32:59 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.