From 3728914b67bd00a8b771027767ab899d29ec9d30 Mon Sep 17 00:00:00 2001 From: Grant Gayed Date: Thu, 2 Aug 2012 11:42:02 -0400 Subject: Bug 345296 - Remove qt from org.eclipse.swt --- .../qt/org/eclipse/swt/widgets/Group.java | 293 --------------------- 1 file changed, 293 deletions(-) delete mode 100644 bundles/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Group.java (limited to 'bundles/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Group.java') diff --git a/bundles/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Group.java b/bundles/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Group.java deleted file mode 100644 index 9af907e13e..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Group.java +++ /dev/null @@ -1,293 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. - * Portion Copyright (c) 2009-2010 compeople AG (http://www.compeople.de). - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Compeople AG - QtJambi/Qt based implementation for Windows/Mac OS X/Linux - *******************************************************************************/ -package org.eclipse.swt.widgets; - -import com.trolltech.qt.gui.QContentsMargins; -import com.trolltech.qt.gui.QGroupBox; -import com.trolltech.qt.gui.QWidget; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.SWTException; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.internal.qt.QtSWTConverter; - -/** - * Instances of this class provide an etched border with an optional title. - *

- * Shadow styles are hints and may not be honoured by the platform. To create a - * group with the default shadow style for the platform, do not specify a shadow - * style. - *

- *
Styles:
- *
SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_OUT, SHADOW_NONE
- *
Events:
- *
(none)
- *
- *

- * Note: Only one of the above styles may be specified. - *

- *

- * IMPORTANT: This class is not intended to be subclassed. - *

- * - * @see SWT Example: - * ControlExample - * @see Sample code and further - * information - * @noextend This class is not intended to be subclassed by clients. - */ - -public class Group extends Composite { - - /** - * Constructs a new instance of this class given its parent and a style - * value describing its behavior and appearance. - *

- * The style value is either one of the style constants defined in class - * SWT which is applicable to instances of this class, or must - * be built by bitwise OR'ing together (that is, using the - * int "|" operator) two or more of those SWT - * style constants. The class description lists the style constants that are - * applicable to the class. Style bits are also inherited from superclasses. - *

- * - * @param parent - * a composite control which will be the parent of the new - * instance (cannot be null) - * @param style - * the style of control to construct - * - * @exception IllegalArgumentException - * - * @exception SWTException - * - * - * @see SWT#SHADOW_ETCHED_IN - * @see SWT#SHADOW_ETCHED_OUT - * @see SWT#SHADOW_IN - * @see SWT#SHADOW_OUT - * @see SWT#SHADOW_NONE - * @see Widget#checkSubclass - * @see Widget#getStyle - */ - public Group(Composite parent, int style) { - super(parent, checkStyle(style)); - } - - @Override - protected QWidget createQWidget(int style) { - state |= DRAW_BACKGROUND; - state |= CANVAS; - //TODO apply SWT.SHADOW_* styles - return new QGroupBox(); - } - - QGroupBox getQGroupBox() { - return (QGroupBox) getQWidget(); - } - - static int checkStyle(int style) { - style |= SWT.NO_FOCUS; - /* - * Even though it is legal to create this widget with scroll bars, they - * serve no useful purpose because they do not automatically scroll the - * widget's client area. The fix is to clear the SWT style. - */ - return style & ~(SWT.H_SCROLL | SWT.V_SCROLL); - } - - @Override - protected void checkSubclass() { - if (!isValidSubclass()) { - error(SWT.ERROR_INVALID_SUBCLASS); - } - } - - @Override - public Rectangle getClientArea() { - checkWidget(); - if (!isVisible()) { - updateQLayouts(); - } - - Rectangle clientArea = QtSWTConverter.convert(getQWidget().contentsRect()); - if (clientArea.width < 0) { - clientArea.width = 0; - } - if (clientArea.height < 0) { - clientArea.height = 0; - } - - return clientArea; - } - - @Override - public Rectangle computeTrim(int x, int y, int width, int height) { - QContentsMargins margins = getQGroupBox().getContentsMargins(); - return new Rectangle(x - margins.left, y - margins.top, width + margins.left + margins.right, height - + margins.top + margins.bottom); - } - - @Override - String getNameText() { - return getText(); - } - - /** - * Returns the receiver's text, which is the string that the is used as the - * title. If the text has not previously been set, returns an empty - * string. - * - * @return the text - * - * @exception SWTException - * - */ - public String getText() { - checkWidget(); - return getQGroupBox().title(); - } - - @Override - boolean mnemonicHit(char key) { - return setFocus(); - } - - @Override - boolean mnemonicMatch(char key) { - char mnemonic = findMnemonic(getText()); - if (mnemonic == '\0') { - return false; - } - return Character.toUpperCase(key) == Character.toUpperCase(mnemonic); - } - - void printWidget(int /* long */hwnd, int /* long */hdc, GC gc) { - // TODO - throw new UnsupportedOperationException("not yet implemented");//$NON-NLS-1$ - // /* - // * Bug in Windows. For some reason, PrintWindow() returns success but - // * does nothing when it is called on a printer. The fix is to just go - // * directly to WM_PRINT in this case. - // */ - // boolean success = false; - // if ( !( OS.GetDeviceCaps( gc.handle, OS.TECHNOLOGY ) == - // OS.DT_RASPRINTER ) ) { - // success = OS.PrintWindow( hwnd, hdc, 0 ); - // } - // - // /* - // * Bug in Windows. For some reason, PrintWindow() fails when it is - // * called on a push button. The fix is to detect the failure and use - // * WM_PRINT instead. Note that WM_PRINT cannot be used all the time - // * because it fails for browser controls when the browser has focus. - // */ - // if ( !success ) { - // /* - // * Bug in Windows. For some reason, WM_PRINT when called with - // * PRF_CHILDREN will not draw the tool bar divider for tool bar - // * children that do not have CCS_NODIVIDER. The fix is to draw the - // * group box and iterate through the children, drawing each one. - // */ - // int flags = OS.PRF_CLIENT | OS.PRF_NONCLIENT | OS.PRF_ERASEBKGND; - // OS.SendMessage( hwnd, OS.WM_PRINT, hdc, flags ); - // int nSavedDC = OS.SaveDC( hdc ); - // Control[] children = _getChildren(); - // Rectangle rect = getBounds(); - // OS.IntersectClipRect( hdc, 0, 0, rect.width, rect.height ); - // for ( int i = children.length - 1; i >= 0; --i ) { - // Point location = children[i].getLocation(); - // int graphicsMode = OS.GetGraphicsMode( hdc ); - // if ( graphicsMode == OS.GM_ADVANCED ) { - // float[] lpXform = { 1, 0, 0, 1, location.x, location.y }; - // OS.ModifyWorldTransform( hdc, lpXform, OS.MWT_LEFTMULTIPLY ); - // } else { - // OS.SetWindowOrgEx( hdc, -location.x, -location.y, null ); - // } - // int /* long */topHandle = children[i].topHandle(); - // int bits = OS.GetWindowLong( topHandle, OS.GWL_STYLE ); - // if ( ( bits & OS.WS_VISIBLE ) == 0 ) { - // OS.DefWindowProc( topHandle, OS.WM_SETREDRAW, 1, 0 ); - // } - // children[i].printWidget( topHandle, hdc, gc ); - // if ( ( bits & OS.WS_VISIBLE ) == 0 ) { - // OS.DefWindowProc( topHandle, OS.WM_SETREDRAW, 0, 0 ); - // } - // if ( graphicsMode == OS.GM_ADVANCED ) { - // float[] lpXform = { 1, 0, 0, 1, -location.x, -location.y }; - // OS.ModifyWorldTransform( hdc, lpXform, OS.MWT_LEFTMULTIPLY ); - // } - // } - // OS.RestoreDC( hdc, nSavedDC ); - // } - } - - @Override - public void setFont(Font font) { - checkWidget(); - Rectangle oldRect = getClientArea(); - super.setFont(font); - Rectangle newRect = getClientArea(); - if (!oldRect.equals(newRect)) { - sendResize(); - } - } - - /** - * Sets the receiver's text, which is the string that will be displayed as - * the receiver's title, to the argument, which may not be null. - * The string may include the mnemonic character.

Mnemonics are - * indicated by an '&' that causes the next character to be the - * mnemonic. When the user presses a key sequence that matches the mnemonic, - * focus is assigned to the first child of the group. On most platforms, the - * mnemonic appears underlined but may be emphasised in a platform specific - * manner. The mnemonic indicator character '&' can be escaped by - * doubling it in the string, causing a single '&' to be displayed.

- * - * @param string - * the new text - * - * @exception IllegalArgumentException - * - * @exception SWTException - * - */ - public void setText(String string) { - checkWidget(); - if (string == null) { - error(SWT.ERROR_NULL_ARGUMENT); - } - getQGroupBox().setTitle(string); - } -} -- cgit