Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 154187 - intermediate state for the check box and radio button
Summary: intermediate state for the check box and radio button
Status: RESOLVED DUPLICATE of bug 22261
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-17 04:21 EDT by RK CLA
Modified: 2006-08-21 11:15 EDT (History)
1 user (show)

See Also:


Attachments
sample image for semi-checked state. (26.71 KB, image/jpeg)
2006-08-17 04:28 EDT, RK CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description RK CLA 2006-08-17 04:21:48 EDT
is it possible to control the look & feel for the check mark and the rectangle box around it? e.g., if we have to implement a semi-checked state as available for "Wrap" and "Merge" check boxes in the "Format" dialog in MS Excel. This is shown if you select multiple cells in MS excel and some of them have wrap enabled and some not OR some are merged and some are not.

It should not be confused with a disabled check box as a disabled check box does not show the focus and also its caption is grayed out.

If you click on this semi-checked state, it will show a fully check state first, i.e., white background and black check mark. Second click will remove the check mark. Third check will again show the semi-checked state.

If currently this is not available, then is there any work-around to achieve this?

I have a similar requirement for Radio button also.

thnx.
Comment 1 RK CLA 2006-08-17 04:28:10 EDT
Created attachment 48077 [details]
sample image for semi-checked state.

attaching an image for the sample.

thnx.
Comment 2 Florian Priester CLA 2006-08-17 09:06:50 EDT
Please see bug 22261 for the check box part.

In the absence of greyed radio buttons, one could use a combo box
with some kind of "<Mixed>" entry.
Comment 3 Grant Gayed CLA 2006-08-21 11:15:09 EDT
Marking report as a duplicate.  The only workaround I can think of, which is a bit crazy, is to use a one-item table.  See snippet below:

public static void main(String [] args) {
	Display display = new Display();
	Shell shell = new Shell(display);
	shell.setBounds(10,10,200,200);
	shell.setLayout(new GridLayout());
	new Button(shell, SWT.CHECK).setText("normal button 1");
	Table table = new Table(shell, SWT.CHECK);
	table.setBackground(shell.getBackground());
	TableItem item = new TableItem(table,SWT.NONE);
	item.setText("gray");
	item.setGrayed(true);
	new Button(shell, SWT.CHECK).setText("normal button 2");
	shell.open();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch()) display.sleep();
	}
	display.dispose();
}


*** This bug has been marked as a duplicate of 22261 ***