summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2009-05-14 00:53:04 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2009-05-14 00:53:04 (GMT)
commitd6ae9ac6b68ade20d79d00780b721ba419701f0b (patch)
treece1858139a85cb202f0ab4ed0983c33143debec5 /generic
parenta49b9d01cc58374d6882839ff6e9ca8c14c88c0a (diff)
downloadtk-d6ae9ac6b68ade20d79d00780b721ba419701f0b.zip
tk-d6ae9ac6b68ade20d79d00780b721ba419701f0b.tar.gz
tk-d6ae9ac6b68ade20d79d00780b721ba419701f0b.tar.bz2
Backported support for the Vista theme.
This requires the vsapi element engine, the hover state and the theme script definition.
Diffstat (limited to 'generic')
-rw-r--r--generic/ttk/ttkState.c9
-rw-r--r--generic/ttk/ttkTheme.h4
-rw-r--r--generic/ttk/ttkWidget.c12
3 files changed, 21 insertions, 4 deletions
diff --git a/generic/ttk/ttkState.c b/generic/ttk/ttkState.c
index 8923fa6..1c0db7d 100644
--- a/generic/ttk/ttkState.c
+++ b/generic/ttk/ttkState.c
@@ -1,5 +1,5 @@
/*
- * $Id: ttkState.c,v 1.1 2006/10/31 01:42:26 hobbs Exp $
+ * $Id: ttkState.c,v 1.1.4.1 2009/05/14 00:53:04 patthoyts Exp $
*
* Tk widget state utilities.
*
@@ -27,6 +27,13 @@ static const char *stateNames[] =
"alternate", /* Widget-specific alternate display style */
"invalid", /* Bad value */
"readonly", /* Editing/modification disabled */
+ "hover", /* Mouse cursor is over widget */
+ "reserved1", /* Reserved for future extension */
+ "reserved2", /* Reserved for future extension */
+ "reserved3", /* Reserved for future extension */
+ "user3", /* User-definable state */
+ "user2", /* User-definable state */
+ "user1", /* User-definable state */
NULL
};
diff --git a/generic/ttk/ttkTheme.h b/generic/ttk/ttkTheme.h
index 5e7dc88..6d95c01 100644
--- a/generic/ttk/ttkTheme.h
+++ b/generic/ttk/ttkTheme.h
@@ -1,4 +1,4 @@
-/* $Id: ttkTheme.h,v 1.13 2007/12/13 15:26:26 dgp Exp $
+/* $Id: ttkTheme.h,v 1.13.2.1 2009/05/14 00:53:04 patthoyts Exp $
* Copyright (c) 2003 Joe English. Freely redistributable.
*
* Declarations for Tk theme engine.
@@ -48,7 +48,7 @@ typedef unsigned int Ttk_State;
#define TTK_STATE_ALTERNATE (1<<6)
#define TTK_STATE_INVALID (1<<7)
#define TTK_STATE_READONLY (1<<8)
-#define TTK_STATE_USER7 (1<<9)
+#define TTK_STATE_HOVER (1<<9)
#define TTK_STATE_USER6 (1<<10)
#define TTK_STATE_USER5 (1<<11)
#define TTK_STATE_USER4 (1<<12)
diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c
index 5f05ab4..6bc085b 100644
--- a/generic/ttk/ttkWidget.c
+++ b/generic/ttk/ttkWidget.c
@@ -1,4 +1,4 @@
-/* $Id: ttkWidget.c,v 1.11.2.1 2008/12/22 18:34:55 jenglish Exp $
+/* $Id: ttkWidget.c,v 1.11.2.2 2009/05/14 00:53:04 patthoyts Exp $
* Copyright (c) 2003, Joe English
*
* Core widget utilities.
@@ -241,6 +241,8 @@ static const unsigned CoreEventMask
| FocusChangeMask
| VirtualEventMask
| ActivateMask
+ | EnterWindowMask
+ | LeaveWindowMask
;
static void CoreEventProc(ClientData clientData, XEvent *eventPtr)
@@ -309,6 +311,14 @@ static void CoreEventProc(ClientData clientData, XEvent *eventPtr)
corePtr->state |= TTK_STATE_BACKGROUND;
TtkRedisplayWidget(corePtr);
break;
+ case LeaveNotify:
+ corePtr->state &= ~TTK_STATE_HOVER;
+ TtkRedisplayWidget(corePtr);
+ break;
+ case EnterNotify:
+ corePtr->state |= TTK_STATE_HOVER;
+ TtkRedisplayWidget(corePtr);
+ break;
case VirtualEvent:
if (!strcmp("ThemeChanged", ((XVirtualEvent *)(eventPtr))->name)) {
(void)UpdateLayout(corePtr->interp, corePtr);