comparison dwt/custom/CTabItem.d @ 315:349b8c12e243

Sync dwt/custom with dwt-linux
author Frank Benoit <benoit@tionex.de>
date Tue, 07 Oct 2008 16:18:26 +0200
parents fd9c62a2998e
children
comparison
equal deleted inserted replaced
314:0e2b4fed7a0f 315:349b8c12e243
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * Port to the D programming language: 10 * Port to the D programming language:
11 * Frank Benoit <benoit@tionex.de> 11 * Frank Benoit <benoit@tionex.de>
12 *******************************************************************************/ 12 *******************************************************************************/
13 module dwt.custom.CTabItem; 13 module dwt.custom.CTabItem;
14
15 import dwt.dwthelper.utils;
14 16
15 17
16 18
17 import dwt.DWT; 19 import dwt.DWT;
18 import dwt.DWTException; 20 import dwt.DWTException;
27 import dwt.widgets.Control; 29 import dwt.widgets.Control;
28 import dwt.widgets.Display; 30 import dwt.widgets.Display;
29 import dwt.widgets.Item; 31 import dwt.widgets.Item;
30 import dwt.widgets.Widget; 32 import dwt.widgets.Widget;
31 import dwt.custom.CTabFolder; 33 import dwt.custom.CTabFolder;
32 import dwt.dwthelper.utils;
33 34
34 /** 35 /**
35 * Instances of this class represent a selectable user interface object 36 * Instances of this class represent a selectable user interface object
36 * that represent a page in a notebook widget. 37 * that represent a page in a notebook widget.
37 * 38 *
772 } 773 }
773 /** 774 /**
774 * Returns <code>true</code> to indicate that the receiver's close button should be shown. 775 * Returns <code>true</code> to indicate that the receiver's close button should be shown.
775 * Otherwise return <code>false</code>. The initial value is defined by the style (DWT.CLOSE) 776 * Otherwise return <code>false</code>. The initial value is defined by the style (DWT.CLOSE)
776 * that was used to create the receiver. 777 * that was used to create the receiver.
777 * 778 *
778 * @return <code>true</code> if the close button should be shown 779 * @return <code>true</code> if the close button should be shown
779 * 780 *
780 * @exception DWTException <ul> 781 * @exception DWTException <ul>
781 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 782 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
782 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 783 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
783 * </ul> 784 * </ul>
784 * 785 *
785 * @since 3.4 786 * @since 3.4
786 */ 787 */
787 public bool getShowClose() { 788 public bool getShowClose() {
788 checkWidget(); 789 checkWidget();
789 return showClose; 790 return showClose;
1021 } 1022 }
1022 /** 1023 /**
1023 * Sets to <code>true</code> to indicate that the receiver's close button should be shown. 1024 * Sets to <code>true</code> to indicate that the receiver's close button should be shown.
1024 * If the parent (CTabFolder) was created with DWT.CLOSE style, changing this value has 1025 * If the parent (CTabFolder) was created with DWT.CLOSE style, changing this value has
1025 * no effect. 1026 * no effect.
1026 * 1027 *
1027 * @param close the new state of the close button 1028 * @param close the new state of the close button
1028 * 1029 *
1029 * @exception DWTException <ul> 1030 * @exception DWTException <ul>
1030 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 1031 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
1031 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 1032 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
1032 * </ul> 1033 * </ul>
1033 * 1034 *
1034 * @since 3.4 1035 * @since 3.4
1035 */ 1036 */
1036 public void setShowClose(bool close) { 1037 public void setShowClose(bool close) {
1037 checkWidget(); 1038 checkWidget();
1038 if (showClose is close) return; 1039 if (showClose is close) return;
1040 parent.updateItems(); 1041 parent.updateItems();
1041 parent.redrawTabs(); 1042 parent.redrawTabs();
1042 } 1043 }
1043 public override void setText (String string) { 1044 public override void setText (String string) {
1044 checkWidget(); 1045 checkWidget();
1045 // DWT extension: allow null string 1046 // DWT extension: allow null for zero length string
1046 //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 1047 //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
1047 if (string==getText()) return; 1048 if (string.equals (getText())) return;
1048 super.setText(string); 1049 super.setText(string);
1049 shortenedText = null; 1050 shortenedText = null;
1050 shortenedTextWidth = 0; 1051 shortenedTextWidth = 0;
1051 if (!parent.updateTabHeight(false)) { 1052 if (!parent.updateTabHeight(false)) {
1052 parent.updateItems(); 1053 parent.updateItems();