summaryrefslogtreecommitdiffstats
path: root/win/ttkWinTheme.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2007-01-11 19:59:26 (GMT)
committerjenglish <jenglish@flightlab.com>2007-01-11 19:59:26 (GMT)
commitc48f4f5bf3717299252cba2e4faa31f395ce1689 (patch)
tree8277dd861a947f2adb0b4634f031f9c651f7e8d0 /win/ttkWinTheme.c
parent72b0a491e8d2e18f644d6698540fbe79918d17ea (diff)
downloadtk-c48f4f5bf3717299252cba2e4faa31f395ce1689.zip
tk-c48f4f5bf3717299252cba2e4faa31f395ce1689.tar.gz
tk-c48f4f5bf3717299252cba2e4faa31f395ce1689.tar.bz2
Revert previous change to keep in sync with Tile codebase.
The minor warnings from GCC fixed in the previous revision were false positives due to improper use of "-Wconversion". Still compiles cleanly with "gcc -Wall -Werror" (gcc 3.3.5).
Diffstat (limited to 'win/ttkWinTheme.c')
-rw-r--r--win/ttkWinTheme.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c
index b2f8c0b..f080c8c 100644
--- a/win/ttkWinTheme.c
+++ b/win/ttkWinTheme.c
@@ -1,6 +1,6 @@
/* winTheme.c - Copyright (C) 2004 Pat Thoyts <patthoyts@users.sf.net>
*
- * $Id: ttkWinTheme.c,v 1.3 2007/01/11 15:35:41 dkf Exp $
+ * $Id: ttkWinTheme.c,v 1.4 2007/01/11 19:59:26 jenglish Exp $
*/
#ifdef _MSC_VER
@@ -146,8 +146,8 @@ static void FrameControlElementDraw(
HDC hdc = TkWinGetDrawableDC(Tk_Display(tkwin), d, &dcState);
DrawFrameControl(hdc, &rc,
- (DWORD) elementData->classId, (DWORD) elementData->partId
- | Ttk_StateTableLookup(elementData->stateMap, state));
+ elementData->classId,
+ elementData->partId|Ttk_StateTableLookup(elementData->stateMap, state));
TkWinReleaseDrawableDC(d, hdc, &dcState);
}
@@ -292,7 +292,7 @@ static void ButtonBorderElementGeometry(
ButtonBorderElement *bd = elementRecord;
int relief = TK_RELIEF_RAISED;
int defaultState = TTK_BUTTON_DEFAULT_DISABLED;
- int cx, cy;
+ short int cx, cy;
Tk_GetReliefFromObj(NULL, bd->reliefObj, &relief);
Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState);
@@ -329,10 +329,9 @@ static void ButtonBorderElementDraw(
if (defaultState == TTK_BUTTON_DEFAULT_ACTIVE) {
XColor *highlightColor =
- Tk_GetColorFromObj(tkwin, bd->highlightColorObj);
+ Tk_GetColorFromObj(tkwin, bd->highlightColorObj);
GC gc = Tk_GCForColor(highlightColor, d);
- XDrawRectangle(Tk_Display(tkwin), d, gc, b.x, b.y,
- (unsigned)b.width-1, (unsigned)b.height-1);
+ XDrawRectangle(Tk_Display(tkwin), d, gc, b.x,b.y,b.width-1,b.height-1);
}
if (defaultState != TTK_BUTTON_DEFAULT_DISABLED) {
++b.x; ++b.y; b.width -= 2; b.height -= 2;
@@ -342,13 +341,13 @@ static void ButtonBorderElementDraw(
rc = BoxToRect(b);
DrawFrameControl(hdc, &rc,
- (DWORD) DFC_BUTTON, /* classId */ (DWORD) DFCS_BUTTONPUSH
- | Ttk_StateTableLookup(pushbutton_statemap, state));
+ DFC_BUTTON, /* classId */
+ DFCS_BUTTONPUSH | Ttk_StateTableLookup(pushbutton_statemap, state));
/* Draw focus ring:
*/
if (state & TTK_STATE_FOCUS) {
- int borderWidth = 3; /* @@@ Use GetSystemMetrics?*/
+ short int borderWidth = 3; /* @@@ Use GetSystemMetrics?*/
rc = BoxToRect(Ttk_PadBox(b, Ttk_UniformPadding(borderWidth)));
DrawFocusRect(hdc, &rc);
}
@@ -425,8 +424,7 @@ static void FillFocusElementDraw(
GC gc = Tk_GCForColor(fillColor, d);
HDC hdc;
- XFillRectangle(Tk_Display(tkwin),d,gc,
- b.x,b.y,(unsigned)b.width,(unsigned)b.height);
+ XFillRectangle(Tk_Display(tkwin),d,gc, b.x,b.y,b.width,b.height);
hdc = TkWinGetDrawableDC(Tk_Display(tkwin), d, &dcState);
DrawFocusRect(hdc, &rc);
TkWinReleaseDrawableDC(d, hdc, &dcState);