summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2002-05-02 19:12:07 +0000
committerSilenio Quarti <silenio>2002-05-02 19:12:07 +0000
commit5ad592591306fd3680ec78937fc1f7fae37c24e2 (patch)
treef2a194861e1300b6c52f882ffe90b29fd84d4160 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets
parentcdbd0fa0fe7557b729ae08b3fb2e20c60cd714f9 (diff)
downloadeclipse.platform.swt-5ad592591306fd3680ec78937fc1f7fae37c24e2.tar.gz
eclipse.platform.swt-5ad592591306fd3680ec78937fc1f7fae37c24e2.tar.xz
eclipse.platform.swt-5ad592591306fd3680ec78937fc1f7fae37c24e2.zip
*** empty log message ***
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java29
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java12
7 files changed, 79 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
index 1e332cd693..a348aa0958 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
@@ -424,6 +424,7 @@ public void setAlignment (int alignment) {
void setBackgroundColor (GdkColor color) {
super.setBackgroundColor (color);
+ OS.gtk_widget_modify_bg (fixedHandle, 0, color);
OS.gtk_widget_modify_bg (labelHandle, 0, color);
OS.gtk_widget_modify_bg (pixmapHandle, 0, color);
}
@@ -436,6 +437,7 @@ void setFontDescription (int font) {
void setForegroundColor (GdkColor color) {
super.setForegroundColor (color);
+ OS.gtk_widget_modify_fg (fixedHandle, 0, color);
OS.gtk_widget_modify_fg (labelHandle, 0, color);
OS.gtk_widget_modify_fg (pixmapHandle, 0, color);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
index f9b741809a..42edfd0d71 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
@@ -307,6 +307,11 @@ void deregister () {
WidgetTable.remove (listHandle);
}
+int fontHandle () {
+ if (entryHandle != 0) return entryHandle;
+ return super.fontHandle ();
+}
+
void hookEvents () {
// TO DO - expose, enter/exit, focus in/out
super.hookEvents ();
@@ -385,6 +390,30 @@ public void deselectAll () {
setItems (getItems ());
}
+GdkColor getBackgroundColor () {
+ int fontHandle = fontHandle ();
+ GtkStyle style = new GtkStyle ();
+ OS.memmove(style, OS.gtk_widget_get_style (fontHandle));
+ GdkColor color = new GdkColor ();
+ color.pixel = style.base0_pixel;
+ color.red = style.base0_red;
+ color.green = style.base0_green;
+ color.blue = style.base0_blue;
+ return color;
+}
+
+GdkColor getForegroundColor () {
+ int fontHandle = fontHandle ();
+ GtkStyle style = new GtkStyle ();
+ OS.memmove(style, OS.gtk_widget_get_style (fontHandle));
+ GdkColor color = new GdkColor ();
+ color.pixel = style.text0_pixel;
+ color.red = style.text0_red;
+ color.green = style.text0_green;
+ color.blue = style.text0_blue;
+ return color;
+}
+
/**
* Returns the item at the given, zero-relative index in the
* receiver's list. Throws an exception if the index is out
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index 47b595f2b2..46e1ae26df 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -1877,7 +1877,6 @@ public void setBackground (Color color) {
}
void setBackgroundColor (GdkColor color) {
- if (fixedHandle != 0) OS.gtk_widget_modify_bg (fixedHandle, 0, color);
OS.gtk_widget_modify_bg (handle, 0, color);
}
@@ -2035,7 +2034,6 @@ public void setForeground (Color color) {
}
void setForegroundColor (GdkColor color) {
- if (fixedHandle != 0) OS.gtk_widget_modify_fg (fixedHandle, 0, color);
OS.gtk_widget_modify_fg (handle, 0, color);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
index 603d99153e..e82e010785 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
@@ -324,6 +324,16 @@ public void setAlignment (int alignment) {
}
}
+void setBackgroundColor (GdkColor color) {
+ super.setBackgroundColor (color);
+ OS.gtk_widget_modify_bg (fixedHandle, 0, color);
+}
+
+void setForegroundColor (GdkColor color) {
+ super.setForegroundColor (color);
+ OS.gtk_widget_modify_fg (fixedHandle, 0, color);
+}
+
/**
* Sets the receiver's image to the argument, which may be
* null indicating that no image should be displayed.
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
index 85eb7186a2..cfdaa5fc3c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
@@ -198,8 +198,8 @@ void createHandle (int index) {
if ((style & SWT.BORDER) != 0) {
OS.gtk_clist_set_shadow_type(handle, OS.GTK_SHADOW_ETCHED_IN);
}
- int hsp = (style & SWT.H_SCROLL) == 0 ? OS.GTK_POLICY_NEVER : OS.GTK_POLICY_AUTOMATIC;
- int vsp = (style & SWT.V_SCROLL) == 0 ? OS.GTK_POLICY_NEVER : OS.GTK_POLICY_AUTOMATIC;
+ int hsp = (style & SWT.H_SCROLL) != 0 ? OS.GTK_POLICY_AUTOMATIC : OS.GTK_POLICY_NEVER;
+ int vsp = (style & SWT.V_SCROLL) != 0 ? OS.GTK_POLICY_AUTOMATIC : OS.GTK_POLICY_NEVER;
OS.gtk_scrolled_window_set_policy (scrolledHandle, hsp, vsp);
}
@@ -312,6 +312,18 @@ public void deselectAll () {
OS.gtk_signal_handler_unblock_by_data (handle, SWT.Selection);
}
+GdkColor getBackgroundColor () {
+ int fontHandle = fontHandle ();
+ GtkStyle style = new GtkStyle ();
+ OS.memmove(style, OS.gtk_widget_get_style (fontHandle));
+ GdkColor color = new GdkColor ();
+ color.pixel = style.base0_pixel;
+ color.red = style.base0_red;
+ color.green = style.base0_green;
+ color.blue = style.base0_blue;
+ return color;
+}
+
/**
* Returns the zero-relative index of the item which is currently
* has the focus in the receiver, or -1 if no item is has focus.
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index 948fa53d6a..d7b856e3ef 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -376,6 +376,18 @@ void destroyItem (TableItem item) {
items [itemCount] = null;
}
+GdkColor getBackgroundColor () {
+ int fontHandle = fontHandle ();
+ GtkStyle style = new GtkStyle ();
+ OS.memmove(style, OS.gtk_widget_get_style (fontHandle));
+ GdkColor color = new GdkColor ();
+ color.pixel = style.base0_pixel;
+ color.red = style.base0_red;
+ color.green = style.base0_green;
+ color.blue = style.base0_blue;
+ return color;
+}
+
/**
* Returns the column at the given, zero-relative index in the
* receiver. Throws an exception if the index is out of range.
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index 39f2feb4c7..0c3d1c0cb8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -328,6 +328,18 @@ int findSibling (int node, int index) {
return Sibling;
}
+GdkColor getBackgroundColor () {
+ int fontHandle = fontHandle ();
+ GtkStyle style = new GtkStyle ();
+ OS.memmove(style, OS.gtk_widget_get_style (fontHandle));
+ GdkColor color = new GdkColor ();
+ color.pixel = style.base0_pixel;
+ color.red = style.base0_red;
+ color.green = style.base0_green;
+ color.blue = style.base0_blue;
+ return color;
+}
+
/**
* Returns the item at the given point in the receiver
* or null if no such item exists. The point is in the