summaryrefslogtreecommitdiffstats
path: root/win
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
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')
-rw-r--r--win/ttkWinMonitor.c12
-rw-r--r--win/ttkWinTheme.c22
-rw-r--r--win/ttkWinXPTheme.c4
3 files changed, 18 insertions, 20 deletions
diff --git a/win/ttkWinMonitor.c b/win/ttkWinMonitor.c
index 2fa63b0..bf23e39 100644
--- a/win/ttkWinMonitor.c
+++ b/win/ttkWinMonitor.c
@@ -1,4 +1,4 @@
-/* $Id: ttkWinMonitor.c,v 1.5 2007/01/11 15:35:41 dkf Exp $
+/* $Id: ttkWinMonitor.c,v 1.6 2007/01/11 19:59:26 jenglish Exp $
*/
#ifdef _MSC_VER
@@ -80,7 +80,7 @@ CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp)
HWND hwnd = NULL;
CHAR title[32] = "TtkMonitorWindow";
CHAR name[32] = "TtkMonitorClass";
-
+
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = (WNDPROC)WndProc;
@@ -93,11 +93,11 @@ CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp)
wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
wc.lpszMenuName = name;
wc.lpszClassName = name;
-
+
if (RegisterClassEx(&wc)) {
- hwnd = CreateWindow(name, title, WS_OVERLAPPEDWINDOW,
- (int) CW_USEDEFAULT, (int) CW_USEDEFAULT, (int) CW_USEDEFAULT,
- (int) CW_USEDEFAULT, NULL, NULL, hinst, NULL);
+ hwnd = CreateWindow( name, title, WS_OVERLAPPEDWINDOW,
+ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
+ NULL, NULL, hinst, NULL );
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG)interp);
ShowWindow(hwnd, SW_HIDE);
UpdateWindow(hwnd);
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);
diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c
index 0d249dd..9df6d2f 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -1,5 +1,5 @@
/*
- * $Id: ttkWinXPTheme.c,v 1.5 2007/01/11 15:35:41 dkf Exp $
+ * $Id: ttkWinXPTheme.c,v 1.6 2007/01/11 19:59:26 jenglish Exp $
*
* Tk theme engine which uses the Windows XP "Visual Styles" API
* Adapted from Georgios Petasis' XP theme patch.
@@ -565,7 +565,7 @@ ThumbElementDraw(
return;
elementData->procs->DrawThemeBackground(elementData->hTheme,
- elementData->hDC, elementData->info->partId, (int) stateId,
+ elementData->hDC, elementData->info->partId, stateId,
&rc, NULL);
FreeElementData(elementData);