You can subscribe to this list here.
2003 |
Jan
(30) |
Feb
(20) |
Mar
(151) |
Apr
(86) |
May
(23) |
Jun
(25) |
Jul
(107) |
Aug
(141) |
Sep
(55) |
Oct
(85) |
Nov
(65) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(22) |
Feb
(18) |
Mar
(3) |
Apr
(16) |
May
(69) |
Jun
(3) |
Jul
(1) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(6) |
Dec
(1) |
2005 |
Jan
(2) |
Feb
(16) |
Mar
|
Apr
|
May
|
Jun
(47) |
Jul
(1) |
Aug
|
Sep
(6) |
Oct
(4) |
Nov
|
Dec
(34) |
2006 |
Jan
(39) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(5) |
Oct
|
Nov
(4) |
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2008 |
Jan
|
Feb
|
Mar
(26) |
Apr
(1) |
May
(1) |
Jun
|
Jul
(5) |
Aug
(2) |
Sep
(8) |
Oct
(8) |
Nov
(22) |
Dec
(30) |
2009 |
Jan
(10) |
Feb
(13) |
Mar
(14) |
Apr
(14) |
May
(32) |
Jun
(25) |
Jul
(36) |
Aug
(10) |
Sep
(2) |
Oct
|
Nov
|
Dec
(10) |
2010 |
Jan
(9) |
Feb
(4) |
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
(2) |
Jul
(1) |
Aug
(4) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: <kr_...@us...> - 2004-05-07 14:24:05
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10560/src/cbits/Win32 Modified Files: ConfigKey.c Frame.c Internals.h Util.c Log Message: Persist the frame state between sessions Index: ConfigKey.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/ConfigKey.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConfigKey.c 23 Jul 2003 16:25:21 -0000 1.2 --- ConfigKey.c 7 May 2004 14:23:47 -0000 1.3 *************** *** 7,11 **** FrameData *pFrameData; HKEY hSoftwareKey, hAppKey, hKey; ! pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); --- 7,11 ---- FrameData *pFrameData; HKEY hSoftwareKey, hAppKey, hKey; ! pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); *************** *** 19,26 **** *s = '\\'; } ! s++; } ! if (RegOpenKeyEx(HKEY_CURRENT_USER, "Software", 0, KEY_READ, &hSoftwareKey) != ERROR_SUCCESS) return NULL; --- 19,26 ---- *s = '\\'; } ! s++; } ! if (RegOpenKeyEx(HKEY_CURRENT_USER, "Software", 0, KEY_READ, &hSoftwareKey) != ERROR_SUCCESS) return NULL; *************** *** 39,43 **** RegCloseKey(hAppKey); } ! RegCloseKey(hSoftwareKey); --- 39,43 ---- RegCloseKey(hAppKey); } ! RegCloseKey(hSoftwareKey); *************** *** 50,54 **** DWORD dwType, dwLength; char *szValue, *szValueName; ! hKey = openKey(szName, &szValueName); if (!hKey) --- 50,54 ---- DWORD dwType, dwLength; char *szValue, *szValueName; ! hKey = openKey(szName, &szValueName); if (!hKey) *************** *** 62,78 **** if (dwType != REG_SZ && dwType != REG_EXPAND_SZ) ! { RegCloseKey(hKey); return strdup(defvalue); } ! szValue = malloc(dwLength); if (RegQueryValueEx(hKey, szValueName, NULL, &dwType, szValue, &dwLength) != ERROR_SUCCESS) ! { RegCloseKey(hKey); free(szValue); return strdup(defvalue); } ! RegCloseKey(hKey); return szValue; --- 62,78 ---- if (dwType != REG_SZ && dwType != REG_EXPAND_SZ) ! { RegCloseKey(hKey); return strdup(defvalue); } ! szValue = malloc(dwLength); if (RegQueryValueEx(hKey, szValueName, NULL, &dwType, szValue, &dwLength) != ERROR_SUCCESS) ! { RegCloseKey(hKey); free(szValue); return strdup(defvalue); } ! RegCloseKey(hKey); return szValue; *************** *** 98,102 **** DWORD dwType, dwLength, dwValue; char *szValueName; ! hKey = openKey(szName, &szValueName); if (!hKey) --- 98,102 ---- DWORD dwType, dwLength, dwValue; char *szValueName; ! hKey = openKey(szName, &szValueName); if (!hKey) *************** *** 115,119 **** return defvalue; } ! RegCloseKey(hKey); return dwValue; --- 115,119 ---- return defvalue; } ! RegCloseKey(hKey); return dwValue; *************** *** 140,144 **** char *szValueName; char buffer[64]; ! hKey = openKey(szName, &szValueName); if (!hKey) --- 140,144 ---- char *szValueName; char buffer[64]; ! hKey = openKey(szName, &szValueName); if (!hKey) *************** *** 153,161 **** if (dwType != REG_SZ && dwType != REG_EXPAND_SZ) ! { RegCloseKey(hKey); return defvalue; } ! RegCloseKey(hKey); return atof(buffer); --- 153,161 ---- if (dwType != REG_SZ && dwType != REG_EXPAND_SZ) ! { RegCloseKey(hKey); return defvalue; } ! RegCloseKey(hKey); return atof(buffer); *************** *** 183,187 **** DWORD dwType, dwLength, dwValue; char *szValueName; ! hKey = openKey(szName, &szValueName); if (!hKey) --- 183,187 ---- DWORD dwType, dwLength, dwValue; char *szValueName; ! hKey = openKey(szName, &szValueName); if (!hKey) *************** *** 200,204 **** return defvalue; } ! RegCloseKey(hKey); return (dwValue != 0); --- 200,204 ---- return defvalue; } ! RegCloseKey(hKey); return (dwValue != 0); Index: Frame.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Frame.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Frame.c 7 May 2004 13:41:09 -0000 1.24 --- Frame.c 7 May 2004 14:23:48 -0000 1.25 *************** *** 6,9 **** --- 6,10 ---- #include "MenuHandlesMap.h" #include "Canvas.h" + #include "ConfigKey.h" #include "Internals.h" #include "Handlers_stub.h" *************** *** 22,25 **** --- 23,60 ---- } + void SaveWindowState(HWND hWnd) + { + char *keyName; + WINDOWPLACEMENT wp; + wp.length = sizeof(wp); + + if (GetWindowPlacement(hWnd, &wp)) + { + if (IsIconic(hWnd)) + // never restore to Iconic state + wp.showCmd = SW_SHOW; + + if ((wp.flags & WPF_RESTORETOMAXIMIZED) != 0) + // if maximized and maybe iconic restore maximized state + wp.showCmd = SW_SHOWMAXIMIZED; + + // and write it to the registry + keyName = strdup("HToolkit.FrameState"); + osSetConfigIntKey(keyName, wp.showCmd); + free(keyName); + } + } + + void RestoreWindowState(HWND hWnd, int nShow) + { + char *keyName; + + keyName = strdup("HToolkit.FrameState"); + nShow = osGetConfigIntKey(keyName, nShow); + free(keyName); + + ShowWindow(hWnd, nShow); + } + LRESULT CALLBACK HFrameSharedFunction(int DocumentInterface, HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { *************** *** 33,36 **** --- 68,72 ---- { case WM_CLOSE: + SaveWindowState(hWnd); // save the current window placement to be restored the next time handleProcessDismiss(); return 0; Index: Internals.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Internals.h 7 May 2004 12:45:42 -0000 1.20 --- Internals.h 7 May 2004 14:23:48 -0000 1.21 *************** *** 72,74 **** --- 72,77 ---- void DrawCheckListBoxItem(LPDRAWITEMSTRUCT lpDIS); + void SaveWindowState(HWND hWnd); + void RestoreWindowState(HWND hWnd, int nShow); + #endif Index: Util.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Util.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Util.c 25 Nov 2003 14:12:22 -0000 1.29 --- Util.c 7 May 2004 14:23:48 -0000 1.30 *************** *** 118,122 **** wc.lpszClassName = "HMDIWINDOW"; RegisterClass(&wc); ! // CompoundControl class wc.style = CS_DBLCLKS; --- 118,122 ---- wc.lpszClassName = "HMDIWINDOW"; RegisterClass(&wc); ! // CompoundControl class wc.style = CS_DBLCLKS; *************** *** 131,135 **** wc.lpszClassName = "HCOMPOUND"; RegisterClass(&wc); ! // GroupBox class GetClassInfo(ghModule, "BUTTON", &wc); --- 131,135 ---- wc.lpszClassName = "HCOMPOUND"; RegisterClass(&wc); ! // GroupBox class GetClassInfo(ghModule, "BUTTON", &wc); *************** *** 147,151 **** wc.lpszClassName = "HCHECKLISTBOX"; RegisterClass(&wc); ! // DockBar class wc.style = CS_DBLCLKS; --- 147,151 ---- wc.lpszClassName = "HCHECKLISTBOX"; RegisterClass(&wc); ! // DockBar class wc.style = CS_DBLCLKS; *************** *** 160,164 **** wc.lpszClassName = "HDOCKBAR"; RegisterClass(&wc); ! // ToolBar class (subclass of the standard ToolBar class) GetClassInfo(ghModule, TOOLBARCLASSNAME, &wc); --- 160,164 ---- wc.lpszClassName = "HDOCKBAR"; RegisterClass(&wc); ! // ToolBar class (subclass of the standard ToolBar class) GetClassInfo(ghModule, TOOLBARCLASSNAME, &wc); *************** *** 168,172 **** wc.lpszClassName = "HTOOLBAR"; RegisterClass(&wc); ! // Notebook class (subclass of the standard TabCtrl class) GetClassInfo(ghModule, WC_TABCONTROL, &wc); --- 168,172 ---- wc.lpszClassName = "HTOOLBAR"; RegisterClass(&wc); ! // Notebook class (subclass of the standard TabCtrl class) GetClassInfo(ghModule, WC_TABCONTROL, &wc); *************** *** 176,180 **** wc.lpszClassName = "HNOTEBOOK"; RegisterClass(&wc); ! // NotebookPage class wc.style = CS_DBLCLKS; --- 176,180 ---- wc.lpszClassName = "HNOTEBOOK"; RegisterClass(&wc); ! // NotebookPage class wc.style = CS_DBLCLKS; *************** *** 194,198 **** InitCommonControlsEx(&icc); } ! if (ghWndFrame == NULL) { --- 194,198 ---- InitCommonControlsEx(&icc); } ! if (ghWndFrame == NULL) { *************** *** 223,227 **** ); } ! { // Store appVersion for future usage FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); --- 223,227 ---- ); } ! { // Store appVersion for future usage FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); *************** *** 229,233 **** } ! ShowWindow(ghWndFrame,SW_NORMAL); UpdateWindow(ghWndFrame); } --- 229,233 ---- } ! RestoreWindowState(ghWndFrame, SW_NORMAL); UpdateWindow(ghWndFrame); } *************** *** 259,263 **** MSG msg; FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ! while (GetMessage(&msg, NULL, 0, 0) != 0) { --- 259,263 ---- MSG msg; FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ! while (GetMessage(&msg, NULL, 0, 0) != 0) { |
From: <kr_...@us...> - 2004-05-07 13:41:18
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1037/src/cbits/Win32 Modified Files: Frame.c Log Message: comments Index: Frame.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Frame.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Frame.c 25 Feb 2004 12:57:11 -0000 1.23 --- Frame.c 7 May 2004 13:41:09 -0000 1.24 *************** *** 17,21 **** int n = 0; while (lpchText[n] && lpchText[n] != '\t') n++; ! DrawText(hdc, lpchText, n, lpRect, DT_SINGLELINE|DT_VCENTER|DT_LEFT); DrawText(hdc, lpchText+n+1, -1, lpRect, DT_SINGLELINE|DT_VCENTER|DT_RIGHT); --- 17,21 ---- int n = 0; while (lpchText[n] && lpchText[n] != '\t') n++; ! DrawText(hdc, lpchText, n, lpRect, DT_SINGLELINE|DT_VCENTER|DT_LEFT); DrawText(hdc, lpchText+n+1, -1, lpRect, DT_SINGLELINE|DT_VCENTER|DT_RIGHT); *************** *** 41,45 **** free(pData->lpszAppVersion); deleteMenuHandlesMap(pData->pMenuHandlesMap); ! while (pData->statusContexts) { --- 41,46 ---- free(pData->lpszAppVersion); deleteMenuHandlesMap(pData->pMenuHandlesMap); ! ! // clear StatusBar context stack while (pData->statusContexts) { *************** *** 48,60 **** free(context); } ! while (pData->first_indicator) { IndicatorHandle indicator; ! indicator = pData->first_indicator; handleIndicatorDestroy(indicator); pData->first_indicator = pData->first_indicator->next; ! if (pData->first_indicator) pData->first_indicator->prev = NULL; --- 49,62 ---- free(context); } ! ! // clear StatusBar indicators list while (pData->first_indicator) { IndicatorHandle indicator; ! indicator = pData->first_indicator; handleIndicatorDestroy(indicator); pData->first_indicator = pData->first_indicator->next; ! if (pData->first_indicator) pData->first_indicator->prev = NULL; *************** *** 64,68 **** } pData->last_indicator = NULL; ! free(pData); PostQuitMessage(0); --- 66,70 ---- } pData->last_indicator = NULL; ! free(pData); PostQuitMessage(0); *************** *** 92,96 **** GetWindowText(hWnd,pData->lpszAppName,nLen+1); } ! pData->hLeftBar = CreateWindow("HDOCKBAR", NULL, --- 94,98 ---- GetWindowText(hWnd,pData->lpszAppName,nLen+1); } ! pData->hLeftBar = CreateWindow("HDOCKBAR", NULL, *************** *** 137,141 **** pData->first_indicator = NULL; pData->last_indicator = NULL; ! SetWindowLong(hWnd,GWL_USERDATA,(LONG) pData); } --- 139,143 ---- pData->first_indicator = NULL; pData->last_indicator = NULL; ! SetWindowLong(hWnd,GWL_USERDATA,(LONG) pData); } *************** *** 154,158 **** osSetMenuItemChecked(handle, !osGetMenuItemChecked(handle)); else ! handleMenuCommand(handle); } } --- 156,160 ---- osSetMenuItemChecked(handle, !osGetMenuItemChecked(handle)); else ! handleMenuCommand(handle); } } *************** *** 161,169 **** { LPMEASUREITEMSTRUCT lpMIS = (LPMEASUREITEMSTRUCT) lParam; ! if (lpMIS->CtlType == ODT_MENU) { handle = getMenuHandle(pData->pMenuHandlesMap, lpMIS->itemID); ! if (handle && handle->bitmap) { --- 163,171 ---- { LPMEASUREITEMSTRUCT lpMIS = (LPMEASUREITEMSTRUCT) lParam; ! if (lpMIS->CtlType == ODT_MENU) { handle = getMenuHandle(pData->pMenuHandlesMap, lpMIS->itemID); ! if (handle && handle->bitmap) { *************** *** 174,195 **** long lDims; WORD wCheckWidth, wCheckHeight; ! hDC = GetDC(hWnd); ! ZeroMemory(&ncm,sizeof(ncm)); ncm.cbSize = sizeof(ncm); ! // Get the menu dimensions SystemParametersInfo(SPI_GETNONCLIENTMETRICS,0,(PVOID)&ncm,FALSE); ! ! // Create a font based on menu metrics hFont = CreateFontIndirect(&ncm.lfMenuFont); hOldFont = SelectObject(hDC, hFont); ! // Draw out menu item caption - text. pos = getMenuPos(pData->pMenuHandlesMap, handle); hParent = getParentHMENU(handle); ! ZeroMemory(&mii,sizeof(mii)); mii.cbSize = sizeof(mii); --- 176,197 ---- long lDims; WORD wCheckWidth, wCheckHeight; ! hDC = GetDC(hWnd); ! ZeroMemory(&ncm,sizeof(ncm)); ncm.cbSize = sizeof(ncm); ! // Get the menu dimensions SystemParametersInfo(SPI_GETNONCLIENTMETRICS,0,(PVOID)&ncm,FALSE); ! ! // Create a font based on menu metrics hFont = CreateFontIndirect(&ncm.lfMenuFont); hOldFont = SelectObject(hDC, hFont); ! // Draw out menu item caption - text. pos = getMenuPos(pData->pMenuHandlesMap, handle); hParent = getParentHMENU(handle); ! ZeroMemory(&mii,sizeof(mii)); mii.cbSize = sizeof(mii); *************** *** 201,221 **** mii.cch++; mii.dwTypeData = malloc(mii.cch); ! if (mii.dwTypeData) { GetMenuItemInfo(hParent, pos, TRUE, &mii); ! ZeroMemory(&rc,sizeof(rc)); DrawText(hDC,mii.dwTypeData,mii.cch,&rc,DT_SINGLELINE|DT_VCENTER|DT_LEFT|DT_CALCRECT); ! lDims = GetMenuCheckMarkDimensions(); wCheckWidth = (WORD)(LOWORD(lDims)+Spacing); wCheckHeight = (WORD)(HIWORD(lDims)+Spacing); ! wCheckWidth = (WORD)max(handle->bitmap->destsize.cx, wCheckWidth); wCheckHeight = (WORD)max(handle->bitmap->destsize.cy, wCheckHeight); ! lpMIS->itemWidth = (rc.right-rc.left) + wCheckWidth + (Spacing*3); // Text width ! lpMIS->itemHeight = max((rc.bottom-rc.top),wCheckHeight) + (Spacing*2); // Text Height } --- 203,223 ---- mii.cch++; mii.dwTypeData = malloc(mii.cch); ! if (mii.dwTypeData) { GetMenuItemInfo(hParent, pos, TRUE, &mii); ! ZeroMemory(&rc,sizeof(rc)); DrawText(hDC,mii.dwTypeData,mii.cch,&rc,DT_SINGLELINE|DT_VCENTER|DT_LEFT|DT_CALCRECT); ! lDims = GetMenuCheckMarkDimensions(); wCheckWidth = (WORD)(LOWORD(lDims)+Spacing); wCheckHeight = (WORD)(HIWORD(lDims)+Spacing); ! wCheckWidth = (WORD)max(handle->bitmap->destsize.cx, wCheckWidth); wCheckHeight = (WORD)max(handle->bitmap->destsize.cy, wCheckHeight); ! lpMIS->itemWidth = (rc.right-rc.left) + wCheckWidth + (Spacing*3); // Text width ! lpMIS->itemHeight = max((rc.bottom-rc.top),wCheckHeight) + (Spacing*2); // Text Height } *************** *** 226,230 **** DeleteObject(hFont); ReleaseDC(hWnd,hDC); ! } } } --- 228,232 ---- DeleteObject(hFont); ReleaseDC(hWnd,hDC); ! } } } *************** *** 237,241 **** { handle = getMenuHandle(pData->pMenuHandlesMap, lpDIS->itemID); ! if (handle && handle->bitmap) { --- 239,243 ---- { handle = getMenuHandle(pData->pMenuHandlesMap, lpDIS->itemID); ! if (handle && handle->bitmap) { *************** *** 248,275 **** HBRUSH hFillBrush; struct CanvasHandle canvas; ! canvas.hDC = lpDIS->hDC; ! // Check box dimensions lDims = GetMenuCheckMarkDimensions(); wCheckWidth = LOWORD(lDims); wCheckHeight = HIWORD(lDims); ! wWidth = max(handle->bitmap->destsize.cx, wCheckWidth) + (Spacing*2); wHeight = max(handle->bitmap->destsize.cy, wCheckHeight) + (Spacing*2); ! rcFrame.left = lpDIS->rcItem.left; rcFrame.top = lpDIS->rcItem.top; rcFrame.right = lpDIS->rcItem.bottom - lpDIS->rcItem.top; rcFrame.bottom= lpDIS->rcItem.top+wHeight; ! rcBox.left = rcFrame.left+1; rcBox.top = rcFrame.top+1; rcBox.right = rcFrame.right-1; rcBox.bottom= rcFrame.bottom-1; ! // Save off context attributes nIndexDC = SaveDC(lpDIS->hDC); ! // create brush for selection state if (lpDIS->itemState & ODS_SELECTED) --- 250,277 ---- HBRUSH hFillBrush; struct CanvasHandle canvas; ! canvas.hDC = lpDIS->hDC; ! // Check box dimensions lDims = GetMenuCheckMarkDimensions(); wCheckWidth = LOWORD(lDims); wCheckHeight = HIWORD(lDims); ! wWidth = max(handle->bitmap->destsize.cx, wCheckWidth) + (Spacing*2); wHeight = max(handle->bitmap->destsize.cy, wCheckHeight) + (Spacing*2); ! rcFrame.left = lpDIS->rcItem.left; rcFrame.top = lpDIS->rcItem.top; rcFrame.right = lpDIS->rcItem.bottom - lpDIS->rcItem.top; rcFrame.bottom= lpDIS->rcItem.top+wHeight; ! rcBox.left = rcFrame.left+1; rcBox.top = rcFrame.top+1; rcBox.right = rcFrame.right-1; rcBox.bottom= rcFrame.bottom-1; ! // Save off context attributes nIndexDC = SaveDC(lpDIS->hDC); ! // create brush for selection state if (lpDIS->itemState & ODS_SELECTED) *************** *** 280,286 **** else hFillBrush = CreateSolidBrush(GetBkColor(lpDIS->hDC)); ! SetBkMode(lpDIS->hDC,TRANSPARENT); ! // Add some spacing before drawing the text and hi-lite rcFill.left = lpDIS->rcItem.left; --- 282,288 ---- else hFillBrush = CreateSolidBrush(GetBkColor(lpDIS->hDC)); ! SetBkMode(lpDIS->hDC,TRANSPARENT); ! // Add some spacing before drawing the text and hi-lite rcFill.left = lpDIS->rcItem.left; *************** *** 288,301 **** rcFill.right = lpDIS->rcItem.right; rcFill.bottom= lpDIS->rcItem.bottom; ! if ((lpDIS->itemState & ODS_SELECTED) && (lpDIS->itemState & ODS_CHECKED)) rcFill.left+=wWidth+Spacing; ! FillRect(lpDIS->hDC, &rcFill, hFillBrush); ! rc = lpDIS->rcItem; rc.left += wWidth+Spacing; rc.right-= Spacing; ! // Draw out the bitmap associated with the menu item. pt.x = rcFrame.left+(((rcFrame.right-rcFrame.left) - handle->bitmap->destsize.cx)/2); --- 290,303 ---- rcFill.right = lpDIS->rcItem.right; rcFill.bottom= lpDIS->rcItem.bottom; ! if ((lpDIS->itemState & ODS_SELECTED) && (lpDIS->itemState & ODS_CHECKED)) rcFill.left+=wWidth+Spacing; ! FillRect(lpDIS->hDC, &rcFill, hFillBrush); ! rc = lpDIS->rcItem; rc.left += wWidth+Spacing; rc.right-= Spacing; ! // Draw out the bitmap associated with the menu item. pt.x = rcFrame.left+(((rcFrame.right-rcFrame.left) - handle->bitmap->destsize.cx)/2); *************** *** 303,317 **** osDrawBitmap(pt.x, pt.y, handle->bitmap, &canvas); ! ! // Draw bounding frame if (lpDIS->itemState & ODS_SELECTED) DrawEdge(lpDIS->hDC,&rcFrame,BDR_RAISEDINNER,BF_RECT); ! rc.left+=Spacing; ! ! // Draw out menu item caption - text. pos = getMenuPos(pData->pMenuHandlesMap, handle); hParent = getParentHMENU(handle); ! ZeroMemory(&mii,sizeof(mii)); mii.cbSize = sizeof(mii); --- 305,319 ---- osDrawBitmap(pt.x, pt.y, handle->bitmap, &canvas); ! ! // Draw bounding frame if (lpDIS->itemState & ODS_SELECTED) DrawEdge(lpDIS->hDC,&rcFrame,BDR_RAISEDINNER,BF_RECT); ! rc.left+=Spacing; ! ! // Draw out menu item caption - text. pos = getMenuPos(pData->pMenuHandlesMap, handle); hParent = getParentHMENU(handle); ! ZeroMemory(&mii,sizeof(mii)); mii.cbSize = sizeof(mii); *************** *** 323,337 **** mii.cch++; mii.dwTypeData = malloc(mii.cch); ! if (mii.dwTypeData) { GetMenuItemInfo(hParent, pos, TRUE, &mii); ! if (lpDIS->itemState & ODS_GRAYED) ! { ! // This will give it a disable text look if (!(lpDIS->itemState & ODS_SELECTED)) { ! SetTextColor(lpDIS->hDC, GetSysColor(COLOR_3DHILIGHT)); OffsetRect(&rc,1,1); DrawMenuText(lpDIS->hDC,mii.dwTypeData,&rc); --- 325,339 ---- mii.cch++; mii.dwTypeData = malloc(mii.cch); ! if (mii.dwTypeData) { GetMenuItemInfo(hParent, pos, TRUE, &mii); ! if (lpDIS->itemState & ODS_GRAYED) ! { ! // This will give it a disable text look if (!(lpDIS->itemState & ODS_SELECTED)) { ! SetTextColor(lpDIS->hDC, GetSysColor(COLOR_3DHILIGHT)); OffsetRect(&rc,1,1); DrawMenuText(lpDIS->hDC,mii.dwTypeData,&rc); *************** *** 351,357 **** DrawMenuText(lpDIS->hDC,mii.dwTypeData,&rc); } ! free(mii.dwTypeData); ! RestoreDC(lpDIS->hDC,nIndexDC); } --- 353,359 ---- DrawMenuText(lpDIS->hDC,mii.dwTypeData,&rc); } ! free(mii.dwTypeData); ! RestoreDC(lpDIS->hDC,nIndexDC); } *************** *** 363,367 **** HMENU hMenu; int i, nCount; ! hMenu = (HMENU) wParam; nCount = GetMenuItemCount((HMENU) wParam); --- 365,369 ---- HMENU hMenu; int i, nCount; ! hMenu = (HMENU) wParam; nCount = GetMenuItemCount((HMENU) wParam); *************** *** 371,375 **** mii.fMask = MIIM_ID; GetMenuItemInfo(hMenu, i, TRUE, &mii); ! handle = getMenuHandle(pData->pMenuHandlesMap, (UINT) mii.wID); if (handle) handleMenuUpdate(handle); --- 373,377 ---- mii.fMask = MIIM_ID; GetMenuItemInfo(hMenu, i, TRUE, &mii); ! handle = getMenuHandle(pData->pMenuHandlesMap, (UINT) mii.wID); if (handle) handleMenuUpdate(handle); *************** *** 398,402 **** IndicatorHandle indicator; LPNMMOUSE lpnm = (LPNMMOUSE) lParam; ! if (lpnm->hdr.code == NM_DBLCLK && lpnm->dwItemSpec > 0) { --- 400,404 ---- IndicatorHandle indicator; LPNMMOUSE lpnm = (LPNMMOUSE) lParam; ! if (lpnm->hdr.code == NM_DBLCLK && lpnm->dwItemSpec > 0) { *************** *** 463,467 **** if (!pData->hClientWnd) return -1; ! DrawMenuBar(hWnd); } --- 465,469 ---- if (!pData->hClientWnd) return -1; ! DrawMenuBar(hWnd); } |
From: <kr_...@us...> - 2004-05-07 13:09:58
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26605/src/cbits/Win32 Modified Files: ToolBar.c Window.c Log Message: Replace ScreenToClient to MapWindowPoints function in places where an entire rectangle is transformed. This simplifies the code. Index: ToolBar.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/ToolBar.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ToolBar.c 31 Aug 2003 12:56:26 -0000 1.18 --- ToolBar.c 7 May 2004 13:09:46 -0000 1.19 *************** *** 23,27 **** { TOOL_SUBMENU = 1 , TOOL_SEPARATOR = 2 ! , TOOL_ITEM = 4 , TOOL_CHECK_ITEM = 8 , TOOL_RADIO_ITEM = 16 --- 23,27 ---- { TOOL_SUBMENU = 1 , TOOL_SEPARATOR = 2 ! , TOOL_ITEM = 4 , TOOL_CHECK_ITEM = 8 [...1136 lines suppressed...] ! handleToolDestroy(toolItem); ! SendMessage(toolItem->hToolBar, TB_DELETEBUTTON, osGetToolItemPos(toolItem), 0); ! next = toolItem->nextInGroup; while (next->nextInGroup != toolItem) *************** *** 1197,1201 **** next->nextInGroup = toolItem->nextInGroup; free(toolItem); ! RelayoutFrameBars(); } --- 1195,1199 ---- next->nextInGroup = toolItem->nextInGroup; free(toolItem); ! RelayoutFrameBars(); } Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** Window.c 7 May 2004 12:44:34 -0000 1.64 --- Window.c 7 May 2004 13:09:46 -0000 1.65 *************** *** 16,20 **** { RECT rect; - POINT origin; HWND hCtrl = GetTopWindow(hWnd); --- 16,19 ---- *************** *** 24,31 **** { GetWindowRect(hCtrl,&rect); ! origin.x = rect.left; ! origin.y = rect.top; ! ScreenToClient(hWnd,&origin); ! SetWindowPos(hCtrl,NULL,origin.x+dx,origin.y+dy,0,0,SWP_NOSIZE|SWP_NOZORDER); } --- 23,28 ---- { GetWindowRect(hCtrl,&rect); ! MapWindowPoints(NULL, hWnd, (LPPOINT) &rect, 2); ! SetWindowPos(hCtrl,NULL,rect.left+dx,rect.top+dy,0,0,SWP_NOSIZE|SWP_NOZORDER); } *************** *** 37,42 **** { RECT rect; - POINT upLeft; - POINT downRight; HRGN hTmpRgn; HWND hCtrl = GetTopWindow(hWnd); --- 34,37 ---- *************** *** 47,58 **** { GetWindowRect(hCtrl,&rect); ! upLeft.x = rect.left; ! upLeft.y = rect.top; ! ScreenToClient(hWnd,&upLeft); ! downRight.x = rect.right; ! downRight.y = rect.bottom; ! ScreenToClient(hWnd,&downRight); ! ! hTmpRgn = CreateRectRgn(upLeft.x, upLeft.y, downRight.x, downRight.y); CombineRgn(hRgn, hRgn, hTmpRgn, RGN_DIFF); DeleteObject(hTmpRgn); --- 42,47 ---- { GetWindowRect(hCtrl,&rect); ! MapWindowPoints(NULL, hWnd, (LPPOINT) &rect, 2); ! hTmpRgn = CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom); CombineRgn(hRgn, hRgn, hTmpRgn, RGN_DIFF); DeleteObject(hTmpRgn); *************** *** 183,187 **** GetCursorPos(&pos); if (hParent) ! ScreenToClient(hParent, &pos); break; default: --- 172,176 ---- GetCursorPos(&pos); if (hParent) ! MapWindowPoints(NULL, hParent, &pos, 1); break; default: *************** *** 1358,1363 **** GetWindowRect(ctrl, &rect); ! ScreenToClient(hParent, ((LPPOINT) &rect) ); ! ScreenToClient(hParent, ((LPPOINT) &rect)+1); InvalidateRect(hParent,&rect,FALSE); } --- 1347,1351 ---- GetWindowRect(ctrl, &rect); ! MapWindowPoints(NULL, hParent, (LPPOINT) &rect, 2); InvalidateRect(hParent,&rect,FALSE); } |
From: <kr_...@us...> - 2004-05-07 12:45:52
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21556/src/include Modified Files: Canvas.h Log Message: Remove GetResolution and GetScaleFactors functions Index: Canvas.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Canvas.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Canvas.h 24 Aug 2003 19:02:45 -0000 1.7 --- Canvas.h 7 May 2004 12:45:43 -0000 1.8 *************** *** 50,61 **** extern void osReleaseTemporaryCanvas(CanvasHandle canvas); - - // Get the resolution of a picture - extern void osGetResolution(CanvasHandle canvas,int*,int*); - - // Get scaling factors, which have to be applied to coordinates for clipping regions in case - // of emulating the screen resolution for printing (MM_ISOTROPIC) - extern void osGetScaleFactor(CanvasHandle canvas,int*,int*,int*,int*); - unsigned int osGetDialogColor(); unsigned int osGetWindowColor(); --- 50,53 ---- |
From: <kr_...@us...> - 2004-05-07 12:45:52
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21556/src/cbits/Win32 Modified Files: Canvas.c Internals.h Log Message: Remove GetResolution and GetScaleFactors functions Index: Canvas.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Canvas.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Canvas.c 24 Aug 2003 19:02:45 -0000 1.9 --- Canvas.c 7 May 2004 12:45:42 -0000 1.10 *************** *** 2,10 **** #include "Internals.h" ! int osGetVertResolution (void) { ! static int res = 0; ! if (res == 0) { HDC screen; --- 2,10 ---- #include "Internals.h" ! int osMMtoVPixels(double mm) { ! static int vres = 0; ! if (vres == 0) { HDC screen; *************** *** 15,48 **** exit(1); } ! res = GetDeviceCaps (screen, LOGPIXELSY); DeleteDC (screen); }; ! return res; ! } /* osGetVertResolution */ ! int osGetHorzResolution (void) { ! static int res = 0; ! if (res == 0) { HDC screen; screen = CreateDC ("DISPLAY", NULL, NULL, NULL); ! res = GetDeviceCaps (screen, LOGPIXELSX); DeleteDC (screen); }; ! return res; ! } /* osGetHorzResolution */ ! ! int osMMtoVPixels(double mm) ! { ! return (int) ((mm/25.4) * osGetVertResolution()); ! } ! ! int osMMtoHPixels(double mm) ! { ! return (int) ((mm/25.4) * osGetHorzResolution()); } --- 15,38 ---- exit(1); } ! vres = GetDeviceCaps (screen, LOGPIXELSY); DeleteDC (screen); }; ! return (int) ((mm/25.4) * vres); ! } ! int osMMtoHPixels(double mm) { ! static int hres = 0; ! if (hres == 0) { HDC screen; screen = CreateDC ("DISPLAY", NULL, NULL, NULL); ! hres = GetDeviceCaps (screen, LOGPIXELSX); DeleteDC (screen); }; ! return (int) ((mm/25.4) * hres); } *************** *** 343,347 **** SetBkMode(canvas->hDC, bkMode ? OPAQUE : TRANSPARENT); ! SelectObject (canvas->hDC, font); canvas->theFont = font; --- 333,337 ---- SetBkMode(canvas->hDC, bkMode ? OPAQUE : TRANSPARENT); ! SelectObject (canvas->hDC, font); canvas->theFont = font; *************** *** 561,599 **** /*----------------------------- ! Font stuff -----------------------------*/ - void osGetResolution(CanvasHandle canvas, int *xResP, int *yResP) - { - int mapMode = GetMapMode(canvas->hDC); - if (mapMode==MM_ISOTROPIC) - { *xResP = osGetHorzResolution(); - *yResP = osGetVertResolution(); - } - else - { *xResP = GetDeviceCaps(canvas->hDC,LOGPIXELSX); - *yResP = GetDeviceCaps(canvas->hDC,LOGPIXELSY); - }; - } /* osGetResolution */ - - void osGetScaleFactor(CanvasHandle canvas, int *nh, int *dh, int *nv, int *dv) - { - if (GetMapMode(canvas->hDC)==MM_TEXT) - { *nh = 1; - *dh = 1; - *nv = 1; - *dv = 1; - } - else - { SIZE sRes,pRes; - GetWindowExtEx (canvas->hDC,&sRes); - GetViewportExtEx(canvas->hDC,&pRes); - *nh = pRes.cx; - *dh = sRes.cx; - *nv = pRes.cy; - *dv = sRes.cy; - }; - } /* osGetScaleFactor */ - unsigned int osGetDialogColor() { --- 551,557 ---- /*----------------------------- ! Colors stuff -----------------------------*/ unsigned int osGetDialogColor() { Index: Internals.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Internals.h 7 May 2004 10:22:00 -0000 1.19 --- Internals.h 7 May 2004 12:45:42 -0000 1.20 *************** *** 72,77 **** void DrawCheckListBoxItem(LPDRAWITEMSTRUCT lpDIS); - int osGetVertResolution(); - int osGetHorzResolution(); - #endif --- 72,74 ---- |
From: <kr_...@us...> - 2004-05-07 12:45:51
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21556/src/cbits/GTK Modified Files: Canvas.c Log Message: Remove GetResolution and GetScaleFactors functions Index: Canvas.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Canvas.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Canvas.c 7 Oct 2003 19:44:09 -0000 1.15 --- Canvas.c 7 May 2004 12:45:41 -0000 1.16 *************** *** 444,448 **** gdk_colormap_free_colors(colormap, &whiteColor, 1); gdk_colormap_free_colors(colormap, &blackColor, 1); ! canvas->theFont = font; pango_layout_set_font_description(canvas->layout, font->font_descr); --- 444,448 ---- gdk_colormap_free_colors(colormap, &whiteColor, 1); gdk_colormap_free_colors(colormap, &blackColor, 1); ! canvas->theFont = font; pango_layout_set_font_description(canvas->layout, font->font_descr); *************** *** 663,680 **** } /* osDrawBitmap */ - void osGetResolution(CanvasHandle canvas, int *xResP, int *yResP) - { - *xResP = gdk_screen_width(); - *yResP = gdk_screen_height(); - } /* osGetResolution */ - - void osGetScaleFactor(CanvasHandle canvas, int *nh, int *dh, int *nv, int *dv) - { - *nh = 1; - *dh = 1; - *nv = 1; - *dv = 1; - } /* osGetScaleFactor */ - unsigned int gdk_color_to_rgb(GdkColor color) { --- 663,666 ---- |
From: <kr_...@us...> - 2004-05-07 12:45:50
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21556/src/Port Modified Files: Canvas.hs Log Message: Remove GetResolution and GetScaleFactors functions Index: Canvas.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Canvas.hs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Canvas.hs 24 Aug 2003 19:02:45 -0000 1.17 --- Canvas.hs 7 May 2004 12:45:41 -0000 1.18 *************** *** 51,55 **** -- * Resolution , mmToVPixels, mmToHPixels - , getResolution, getScaleFactor ) where --- 51,54 ---- *************** *** 339,372 **** foreign import ccall "osMMtoHPixels" mmToHPixels :: Double -> IO Int - -- | Get the resolution of a canvas in pixels per logical inch. - getResolution :: CanvasHandle -> IO Size - getResolution canvas - = alloca $ \pw -> - alloca $ \ph -> - do osGetResolution canvas pw ph - w <- peek pw - h <- peek ph - return (fromCSize w h) - foreign import ccall osGetResolution :: CanvasHandle -> Ptr CInt -> Ptr CInt -> IO () - - -- | Get scaling factors, which have to be applied to coordinates for clipping regions in case - -- of emulating the screen resolution for printing. The function returns the pixel size of the - -- window and the pixel size of the actual view port. - getScaleFactor :: CanvasHandle -> IO (Size,Size) - getScaleFactor canvas - = alloca $ \px0 -> - alloca $ \py0 -> - alloca $ \px1 -> - alloca $ \py1 -> - do osGetScaleFactor canvas px0 px1 py0 py1 - x0 <- peek px0 - x1 <- peek px1 - y0 <- peek py0 - y1 <- peek py1 - return (fromCSize x0 y0, fromCSize x1 y1) - foreign import ccall osGetScaleFactor :: CanvasHandle -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr CInt -> IO () - - - {----------------------------------------------------------------------------------------- World transformations --- 338,341 ---- |
From: <kr_...@us...> - 2004-05-07 12:44:47
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21144/src/cbits/Win32 Modified Files: Window.c Log Message: Support for the Center/CenterOnParent/Mouse positioning Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Window.c 9 Mar 2004 15:06:22 -0000 1.63 --- Window.c 7 May 2004 12:44:34 -0000 1.64 *************** *** 45,49 **** { if (GetWindowLong(hCtrl,GWL_STYLE) & WS_VISIBLE) ! { GetWindowRect(hCtrl,&rect); upLeft.x = rect.left; --- 45,49 ---- { if (GetWindowLong(hCtrl,GWL_STYLE) & WS_VISIBLE) ! { GetWindowRect(hCtrl,&rect); upLeft.x = rect.left; *************** *** 132,135 **** --- 132,194 ---- DrawSizeGripLine(hDC,rect.right,rect.bottom,GetSysColor(COLOR_3DFACE),3); } + + static void CenterToScreen(POINT *pos, SIZE sz) + { + HDC screen; + screen = CreateDC ("DISPLAY", NULL, NULL, NULL); + if (screen==NULL) + { + printf("CreateDC returned NULL.\n"); + exit(1); + } + pos->x = (GetDeviceCaps(screen,HORZRES)-sz.cx)/2; + pos->y = (GetDeviceCaps(screen,VERTRES)-sz.cy)/2; + DeleteDC (screen); + } + + static void SetupWindowPosition(HWND hWnd) + { + SIZE sz; + POINT pos; + HWND hParent; + WindowData *pData; + RECT rc; + + pData = (WindowData *) GetWindowLong(hWnd,GWL_USERDATA); + + pos.x = pData->windowPosRect.left; + pos.y = pData->windowPosRect.top; + sz.cx = pData->windowPosRect.right-pData->windowPosRect.left; + sz.cy = pData->windowPosRect.bottom-pData->windowPosRect.top; + + hParent = GetParent(hWnd); + + switch (pData->windowPos) + { + case 0: + break; + case 1: + CenterToScreen(&pos, sz); + break; + case 2: + if (hParent) + GetClientRect(hParent, &rc); + else + GetWindowRect(GetWindow(hWnd, GW_OWNER), &rc); + + pos.x = ((rc.right+rc.left)-sz.cx)/2; + pos.y = ((rc.bottom+rc.top)-sz.cy)/2; + break; + case 3: + GetCursorPos(&pos); + if (hParent) + ScreenToClient(hParent, &pos); + break; + default: + return; + } + + SetWindowPos(hWnd,NULL,pos.x,pos.y,sz.cx,sz.cy,SWP_NOZORDER); + } LRESULT CALLBACK HWindowSharedFunction(WNDPROC pDefWindowProc, HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) *************** *** 162,167 **** pData->MinTrackSize.cx = 0; pData->MinTrackSize.cy = 0; SetWindowLong(hWnd,GWL_USERDATA,(LONG) pData); ! SetFocus(hWnd); } --- 221,227 ---- pData->MinTrackSize.cx = 0; pData->MinTrackSize.cy = 0; + pData->windowPos = -1; SetWindowLong(hWnd,GWL_USERDATA,(LONG) pData); ! SetFocus(hWnd); } *************** *** 212,216 **** } } ! handleControlCommand(hCtrl); } --- 272,276 ---- } } ! handleControlCommand(hCtrl); } *************** *** 220,224 **** FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); MenuHandle handle = getMenuHandle(pData->pMenuHandlesMap, (UINT) LOWORD(wParam)); ! if (handle) { --- 280,284 ---- FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); MenuHandle handle = getMenuHandle(pData->pMenuHandlesMap, (UINT) LOWORD(wParam)); ! if (handle) { *************** *** 232,236 **** { NMHDR *pNMHDR = (NMHDR *) lParam; ! if (pNMHDR->code == UDN_DELTAPOS) { --- 292,296 ---- { NMHDR *pNMHDR = (NMHDR *) lParam; ! if (pNMHDR->code == UDN_DELTAPOS) { *************** *** 487,494 **** pos.x = pData->Origin.x+GET_X_LPARAM(lParam); pos.y = pData->Origin.y+GET_Y_LPARAM(lParam); ! pData->bInDragMode = TRUE; handleWindowMouse(hWnd,evMouseLeftDown,pos.x,pos.y,GetModifiers()); ! SetCapture(hWnd); } --- 547,554 ---- pos.x = pData->Origin.x+GET_X_LPARAM(lParam); pos.y = pData->Origin.y+GET_Y_LPARAM(lParam); ! pData->bInDragMode = TRUE; handleWindowMouse(hWnd,evMouseLeftDown,pos.x,pos.y,GetModifiers()); ! SetCapture(hWnd); } *************** *** 552,559 **** pos.x = GET_X_LPARAM(lParam); pos.y = GET_Y_LPARAM(lParam); ! if (pos.x != 1 || pos.y != 1) ScreenToClient(hWnd, &pos); ! pos.x += pData->Origin.x; pos.y += pData->Origin.y; --- 612,619 ---- pos.x = GET_X_LPARAM(lParam); pos.y = GET_Y_LPARAM(lParam); ! if (pos.x != 1 || pos.y != 1) ScreenToClient(hWnd, &pos); ! pos.x += pData->Origin.x; pos.y += pData->Origin.y; *************** *** 630,634 **** { HDC hDC = (HDC) wParam; ! while (hWnd && !pData->hBackBrush) { --- 690,694 ---- { HDC hDC = (HDC) wParam; ! while (hWnd && !pData->hBackBrush) { *************** *** 636,640 **** pData = (WindowData *) GetWindowLong(hWnd,GWL_USERDATA); } ! SelectObject(hDC, pData->hBackBrush); SetBkColor(hDC, pData->backColor); --- 696,700 ---- pData = (WindowData *) GetWindowLong(hWnd,GWL_USERDATA); } ! SelectObject(hDC, pData->hBackBrush); SetBkColor(hDC, pData->backColor); *************** *** 671,675 **** char *title; int nTextLen; ! nTextLen = strlen(s); title = malloc(strlen(pFrameData->lpszAppName)+nTextLen+6); --- 731,735 ---- char *title; int nTextLen; ! nTextLen = strlen(s); title = malloc(strlen(pFrameData->lpszAppName)+nTextLen+6); *************** *** 683,687 **** SetWindowText(ghWndFrame, title); } ! free(title); } --- 743,747 ---- SetWindowText(ghWndFrame, title); } ! free(title); } *************** *** 713,717 **** switch (uMsg) ! { case WM_DESTROY: { --- 773,777 ---- switch (uMsg) ! { case WM_DESTROY: { *************** *** 919,923 **** pData->hBackBrush = CreateBrushIndirect(&lb); } ! pData->backColor = backColor; pData->foreColor = foreColor; --- 979,983 ---- pData->hBackBrush = CreateBrushIndirect(&lb); } ! pData->backColor = backColor; pData->foreColor = foreColor; *************** *** 1053,1057 **** void osSetWindowVisible(WindowHandle window, BOOL visible) { ! ShowWindow(window, visible ? SW_SHOW : SW_HIDE); } --- 1113,1123 ---- void osSetWindowVisible(WindowHandle window, BOOL visible) { ! if (visible) ! { ! SetupWindowPosition(window); ! ShowWindow(window, SW_SHOW); ! } ! else ! ShowWindow(window, SW_HIDE); } *************** *** 1065,1069 **** MSG msg; ! ShowWindow(window, SW_SHOW); SetActiveWindow(window); EnableWindow(GetWindow(window, GW_OWNER), FALSE); --- 1131,1135 ---- MSG msg; ! osSetWindowVisible(window, TRUE); SetActiveWindow(window); EnableWindow(GetWindow(window, GW_OWNER), FALSE); *************** *** 1284,1294 **** HWND hParent; LONG lStyle; ! ! lStyle = GetWindowLong(ctrl, GWL_STYLE); ! lStyle = visible ? (lStyle | WS_VISIBLE) : (lStyle & ~WS_VISIBLE); SetWindowLong(ctrl, GWL_STYLE, lStyle); ! hParent = GetParent(ctrl); ! GetWindowRect(ctrl, &rect); ScreenToClient(hParent, ((LPPOINT) &rect) ); --- 1350,1360 ---- HWND hParent; LONG lStyle; ! ! lStyle = GetWindowLong(ctrl, GWL_STYLE); ! lStyle = visible ? (lStyle | WS_VISIBLE) : (lStyle & ~WS_VISIBLE); SetWindowLong(ctrl, GWL_STYLE, lStyle); ! hParent = GetParent(ctrl); ! GetWindowRect(ctrl, &rect); ScreenToClient(hParent, ((LPPOINT) &rect) ); *************** *** 1397,1409 **** } ! void osSetWindowRect(WindowHandle window, int x0, int y0, int x1, int y1) { ! char buffer[20]; ! HWND hTargetWnd; ! GetClassName(window,buffer,sizeof(buffer)); ! hTargetWnd = (_stricmp(buffer, "HSDIWINDOW") == 0) ? ghWndFrame : window; ! ! SetWindowPos(hTargetWnd,NULL,x0,y0,abs(x1-x0),abs(y1-y0),SWP_NOZORDER); } --- 1463,1514 ---- } ! void osSetWindowPosition(WindowHandle window, int position, int x0, int y0, int x1, int y1) { ! char buffer[20]; ! GetClassName(window,buffer,sizeof(buffer)); ! ! if (_stricmp(buffer, "HSDIWINDOW") == 0) ! { ! POINT pos; ! SIZE sz; ! ! pos.x = x0; ! pos.y = y0; ! sz.cx = x1-x0; ! sz.cy = y1-y0; ! ! switch (position) ! { ! // When the window is a SDI window then the WinPosCenterToParent is the same as WinPosCenter ! case 1: ! case 2: ! CenterToScreen(&pos, sz); ! break; ! case 3: ! GetCursorPos(&pos); ! break; ! } ! ! SetWindowPos(ghWndFrame,NULL,pos.x,pos.y,sz.cx,sz.cy,SWP_NOZORDER); ! } ! else ! { ! WindowData *pData = (WindowData *) GetWindowLong(window,GWL_USERDATA); ! ! // if the window is a child window then the WinPosCenter is the same as WinPosCenterToParent ! if (GetParent(window) && position == 1) ! pData->windowPos = 2; ! else ! pData->windowPos = position; ! ! pData->windowPosRect.left = x0; ! pData->windowPosRect.top = y0; ! pData->windowPosRect.right = x1; ! pData->windowPosRect.bottom = y1; ! ! if (GetWindowLong(window,GWL_STYLE) & WS_VISIBLE) ! SetupWindowPosition(window); ! } } *************** *** 1424,1439 **** HWND hTargetWnd; FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ! hTargetWnd = hwnd; if (pFrameData->DocumentInterface == 1 && GetParent(hwnd) == ghWndFrame) hTargetWnd = ghWndFrame; ! style = GetWindowLong(hTargetWnd, GWL_STYLE); if (resizeable) ! if (style & DS_MODALFRAME) style |= WS_THICKFRAME; else style |= WS_THICKFRAME | WS_MAXIMIZEBOX; ! else style &= ~(WS_THICKFRAME | WS_MAXIMIZEBOX); SetWindowLong(hTargetWnd, GWL_STYLE, style); --- 1529,1544 ---- HWND hTargetWnd; FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ! hTargetWnd = hwnd; if (pFrameData->DocumentInterface == 1 && GetParent(hwnd) == ghWndFrame) hTargetWnd = ghWndFrame; ! style = GetWindowLong(hTargetWnd, GWL_STYLE); if (resizeable) ! if (style & DS_MODALFRAME) style |= WS_THICKFRAME; else style |= WS_THICKFRAME | WS_MAXIMIZEBOX; ! else style &= ~(WS_THICKFRAME | WS_MAXIMIZEBOX); SetWindowLong(hTargetWnd, GWL_STYLE, style); *************** *** 1465,1469 **** osForceContainerReLayout(window); } ! handleContainerReLayout(window); } --- 1570,1574 ---- osForceContainerReLayout(window); } ! handleContainerReLayout(window); } |
From: <kr_...@us...> - 2004-05-07 10:22:08
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25805/src/cbits/Win32 Modified Files: Internals.h Log Message: add declarations for osGetVertResolution and osGetHorzResolution Index: Internals.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Internals.h 7 May 2004 10:20:26 -0000 1.18 --- Internals.h 7 May 2004 10:22:00 -0000 1.19 *************** *** 72,74 **** --- 72,77 ---- void DrawCheckListBoxItem(LPDRAWITEMSTRUCT lpDIS); + int osGetVertResolution(); + int osGetHorzResolution(); + #endif |
From: <kr_...@us...> - 2004-05-07 10:20:36
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25455/src/cbits/Win32 Modified Files: Internals.h Log Message: Make compatible with the latest mingw32 Index: Internals.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Internals.h 25 Nov 2003 14:12:22 -0000 1.17 --- Internals.h 7 May 2004 10:20:26 -0000 1.18 *************** *** 6,16 **** #include "MenuHandlesMap.h" - #ifndef NCCALCSIZE_PARAMS - typedef struct tagNCCALCSIZE_PARAMS { - RECT rgrc[3]; - PWINDOWPOS lppos; - } NCCALCSIZE_PARAMS, *LPNCCALCSIZE_PARAMS; - #endif - extern BOOL gInKey; extern int gCurChar; --- 6,9 ---- *************** *** 37,41 **** LPSTR lpszAppVersion; MenuHandlesMap *pMenuHandlesMap; ! HWND hLeftBar, hTopBar, hRightBar, hBottomBar; HWND hStatusBar; --- 30,34 ---- LPSTR lpszAppVersion; MenuHandlesMap *pMenuHandlesMap; ! HWND hLeftBar, hTopBar, hRightBar, hBottomBar; HWND hStatusBar; *************** *** 64,67 **** --- 57,63 ---- SIZE MinTrackSize; + + int windowPos; + RECT windowPosRect; } WindowData; |
From: <kr_...@us...> - 2004-05-07 07:57:19
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31719/src/cbits/GTK Modified Files: Window.c Log Message: Remove WinPosCenterAlways. Now we always use GTK_WIN_POS_CENTER_ALWAYS Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Window.c,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** Window.c 6 May 2004 10:27:46 -0000 1.44 --- Window.c 7 May 2004 07:57:10 -0000 1.45 *************** *** 842,849 **** switch (position) { ! case 1: gtk_window_set_position(GTK_WINDOW(toplevel), GTK_WIN_POS_CENTER); break; ! case 2: gtk_window_set_position(GTK_WINDOW(toplevel), GTK_WIN_POS_MOUSE); break; ! case 3: gtk_window_set_position(GTK_WINDOW(toplevel), GTK_WIN_POS_CENTER_ALWAYS); break; ! case 4: gtk_window_set_position(GTK_WINDOW(toplevel), GTK_WIN_POS_CENTER_ON_PARENT); break; default: gtk_window_move(GTK_WINDOW(toplevel), x0, y0); --- 842,848 ---- switch (position) { ! case 1: gtk_window_set_position(GTK_WINDOW(toplevel), GTK_WIN_POS_CENTER_ALWAYS); break; ! case 2: gtk_window_set_position(GTK_WINDOW(toplevel), GTK_WIN_POS_CENTER_ON_PARENT); break; ! case 3: gtk_window_set_position(GTK_WINDOW(toplevel), GTK_WIN_POS_MOUSE); break; default: gtk_window_move(GTK_WINDOW(toplevel), x0, y0); |
From: <kr_...@us...> - 2004-05-07 07:57:19
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31719/src/Port Modified Files: Types.hs Log Message: Remove WinPosCenterAlways. Now we always use GTK_WIN_POS_CENTER_ALWAYS Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Types.hs,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Types.hs 6 May 2004 10:27:46 -0000 1.36 --- Types.hs 7 May 2004 07:57:10 -0000 1.37 *************** *** 750,756 **** = WinPosExact Rect | WinPosCenter Size - | WinPosMouse Size - | WinPosCenterAlways Size | WinPosCenterOnParent Size deriving (Eq,Show) --- 750,755 ---- = WinPosExact Rect | WinPosCenter Size | WinPosCenterOnParent Size + | WinPosMouse Size deriving (Eq,Show) *************** *** 758,764 **** withCWindowPosition (WinPosExact rect) f = withCRect rect (f 0) withCWindowPosition (WinPosCenter size) f = withCSize size (f 1 0 0) ! withCWindowPosition (WinPosMouse size) f = withCSize size (f 2 0 0) ! withCWindowPosition (WinPosCenterAlways size) f = withCSize size (f 3 0 0) ! withCWindowPosition (WinPosCenterOnParent size) f = withCSize size (f 4 0 0) {----------------------------------------------------------------------------------------- --- 757,762 ---- withCWindowPosition (WinPosExact rect) f = withCRect rect (f 0) withCWindowPosition (WinPosCenter size) f = withCSize size (f 1 0 0) ! withCWindowPosition (WinPosCenterOnParent size) f = withCSize size (f 2 0 0) ! withCWindowPosition (WinPosMouse size) f = withCSize size (f 3 0 0) {----------------------------------------------------------------------------------------- |
From: <kr_...@us...> - 2004-05-06 10:27:55
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23600/gio/src/Graphics/UI/GIO Modified Files: Types.hs Window.hs Log Message: Support for the Center/CenterOnParent/Mouse positioning Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Types.hs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Types.hs 16 Nov 2003 13:26:55 -0000 1.18 --- Types.hs 6 May 2004 10:27:47 -0000 1.19 *************** *** 69,72 **** --- 69,75 ---- , PositionType(..) + -- * WindowPosition + , WindowPosition(..) + -- * Render Index: Window.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Window.hs,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Window.hs 16 Nov 2003 09:24:21 -0000 1.33 --- Window.hs 6 May 2004 10:27:47 -0000 1.34 *************** *** 11,15 **** -} ----------------------------------------------------------------------------------------- ! module Graphics.UI.GIO.Window (Window, window, dialog, view, runDialog, showWindow, hideWindow) where import qualified Graphics.UI.Port as Lib --- 11,15 ---- -} ----------------------------------------------------------------------------------------- ! module Graphics.UI.GIO.Window (Window, window, dialog, view, windowPos, runDialog, showWindow, hideWindow) where import qualified Graphics.UI.Port as Lib *************** *** 22,26 **** {-------------------------------------------------------------------- ! --------------------------------------------------------------------} -- | A main window widget. --- 22,26 ---- {-------------------------------------------------------------------- ! --------------------------------------------------------------------} -- | A main window widget. *************** *** 32,36 **** , vbufferMode :: Var BufferMode , vpaint :: Var PaintFunction ! , vlayout :: Var Layout } --- 32,36 ---- , vbufferMode :: Var BufferMode , vpaint :: Var PaintFunction ! , vlayout :: Var Layout } *************** *** 121,124 **** --- 121,130 ---- view = newStdAttr hwindow Lib.getWindowViewSize Lib.setWindowViewSize + -- | The 'windowPos' attribute is a write only and allows to set the position of the window. + -- The position can be specified using the exact bounding rectangle or in a way relative + -- to the parent window or to the screen. + windowPos :: Attr Window WindowPosition + windowPos = writeAttr "windowPos" (\w pos -> Lib.setWindowPosition (hwindow w) pos) + instance Visible Window where visible = newStdAttr hwindow Lib.getWindowVisible Lib.setWindowVisible *************** *** 133,143 **** instance Dimensions Window where ! frame = newStdAttr hwindow Lib.getWindowFrame Lib.setWindowFrame instance Drawn Window where pen = newAttr (getVar . vpen) (\w pen -> setVar (vpen w) pen >> recolorWindow w) ! bufferMode = newStdAttr vbufferMode getVar setVar ! instance HasFont Window where font = mapAttr penFont (\pen c -> pen{penFont=c}) pen --- 139,149 ---- instance Dimensions Window where ! frame = newStdAttr hwindow Lib.getWindowRect (\hwnd rect -> Lib.setWindowPosition hwnd (WinPosExact rect)) instance Drawn Window where pen = newAttr (getVar . vpen) (\w pen -> setVar (vpen w) pen >> recolorWindow w) ! bufferMode = newStdAttr vbufferMode getVar setVar ! instance HasFont Window where font = mapAttr penFont (\pen c -> pen{penFont=c}) pen |
From: <kr_...@us...> - 2004-05-06 10:27:55
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23600/port/src/include Modified Files: Window.h Log Message: Support for the Center/CenterOnParent/Mouse positioning Index: Window.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Window.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Window.h 12 Oct 2003 23:14:57 -0000 1.15 --- Window.h 6 May 2004 10:27:47 -0000 1.16 *************** *** 93,97 **** void osReleaseWindowCanvas(WindowHandle window,CanvasHandle canvas); ! void osSetWindowRect(WindowHandle window, int x0, int y0, int x1, int y1); void osGetWindowRect(WindowHandle window, int *res); void osSetWindowResizeable(WindowHandle window, int resizeable); --- 93,97 ---- void osReleaseWindowCanvas(WindowHandle window,CanvasHandle canvas); ! void osSetWindowPosition(WindowHandle window, int position, int x0, int y0, int x1, int y1); void osGetWindowRect(WindowHandle window, int *res); void osSetWindowResizeable(WindowHandle window, int resizeable); |
From: <kr_...@us...> - 2004-05-06 10:27:55
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23600/port/src/cbits/GTK Modified Files: Window.c Log Message: Support for the Center/CenterOnParent/Mouse positioning Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Window.c,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** Window.c 20 Oct 2003 19:11:33 -0000 1.43 --- Window.c 6 May 2004 10:27:46 -0000 1.44 *************** *** 834,838 **** } ! void osSetWindowRect(WindowHandle window, int x0, int y0, int x1, int y1) { GtkWidget *toplevel = gtk_widget_get_toplevel(window); --- 834,838 ---- } ! void osSetWindowPosition(WindowHandle window, int position, int x0, int y0, int x1, int y1) { GtkWidget *toplevel = gtk_widget_get_toplevel(window); *************** *** 840,844 **** if (toplevel != gFrameWidget || gDocumentInterface == 1) { ! gtk_window_move(GTK_WINDOW(toplevel), x0, y0); gFrameWidth = abs(x1 - x0); --- 840,852 ---- if (toplevel != gFrameWidget || gDocumentInterface == 1) { ! switch (position) ! { ! case 1: gtk_window_set_position(GTK_WINDOW(toplevel), GTK_WIN_POS_CENTER); break; ! case 2: gtk_window_set_position(GTK_WINDOW(toplevel), GTK_WIN_POS_MOUSE); break; ! case 3: gtk_window_set_position(GTK_WINDOW(toplevel), GTK_WIN_POS_CENTER_ALWAYS); break; ! case 4: gtk_window_set_position(GTK_WINDOW(toplevel), GTK_WIN_POS_CENTER_ON_PARENT); break; ! default: ! gtk_window_move(GTK_WINDOW(toplevel), x0, y0); ! } gFrameWidth = abs(x1 - x0); |
From: <kr_...@us...> - 2004-05-06 10:27:55
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23600/port/src/Port Modified Files: Types.hs Window.hs Log Message: Support for the Center/CenterOnParent/Mouse positioning Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Types.hs,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Types.hs 22 Feb 2004 10:29:56 -0000 1.35 --- Types.hs 6 May 2004 10:27:46 -0000 1.36 *************** *** 71,78 **** -- * Document interface , DocumentInterface(..) ! -- * PositionType , PositionType(..) -- * Primitive Handles , WindowHandle --- 71,81 ---- -- * Document interface , DocumentInterface(..) ! -- * PositionType , PositionType(..) + -- * Window position + , WindowPosition(..) + -- * Primitive Handles , WindowHandle *************** *** 100,113 **** , withCSize, withCSizeResult, fromCSize , withCRect, withCRectResult, fromCRect ! , fromCModifiers, toCModifiers , fromCKey, toCKey , fromCMouseEvent , fromCKeyboardEvent ! , toCDocumentInterface ! , toCPositionType, fromCPositionType , fromCInt, toCInt , CWord, fromCWord, toCWord --- 103,118 ---- , withCSize, withCSizeResult, fromCSize , withCRect, withCRectResult, fromCRect ! , fromCModifiers, toCModifiers , fromCKey, toCKey , fromCMouseEvent , fromCKeyboardEvent ! , toCDocumentInterface ! , toCPositionType, fromCPositionType + , withCWindowPosition + , fromCInt, toCInt , CWord, fromCWord, toCWord *************** *** 720,724 **** ----------------------------------------------------------------------------------------- ! data PositionType = PosLeft | PosTop | PosRight --- 725,729 ---- ----------------------------------------------------------------------------------------- ! data PositionType = PosLeft | PosTop | PosRight *************** *** 738,741 **** --- 743,765 ---- fromCPositionType 3 = PosBottom + ----------------------------------------------------------------------------------------- + -- WindowPosition + ----------------------------------------------------------------------------------------- + + data WindowPosition + = WinPosExact Rect + | WinPosCenter Size + | WinPosMouse Size + | WinPosCenterAlways Size + | WinPosCenterOnParent Size + deriving (Eq,Show) + + withCWindowPosition :: WindowPosition -> (CInt -> CInt -> CInt -> CInt -> CInt -> IO a) -> IO a + withCWindowPosition (WinPosExact rect) f = withCRect rect (f 0) + withCWindowPosition (WinPosCenter size) f = withCSize size (f 1 0 0) + withCWindowPosition (WinPosMouse size) f = withCSize size (f 2 0 0) + withCWindowPosition (WinPosCenterAlways size) f = withCSize size (f 3 0 0) + withCWindowPosition (WinPosCenterOnParent size) f = withCSize size (f 4 0 0) + {----------------------------------------------------------------------------------------- Buffermode & Pattern Index: Window.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Window.hs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Window.hs 12 Oct 2003 23:14:56 -0000 1.17 --- Window.hs 6 May 2004 10:27:46 -0000 1.18 *************** *** 25,29 **** -- * Properties , setWindowVisible, getWindowVisible ! , setWindowFrame, getWindowFrame , setWindowResizeable , setWindowColor --- 25,29 ---- -- * Properties , setWindowVisible, getWindowVisible ! , setWindowPosition, getWindowRect , setWindowResizeable , setWindowColor *************** *** 57,72 **** foreign import ccall "osInvalidateWindow" invalidateWindow :: WindowHandle -> IO () ! -- | Move and resize the outer frame of a window. ! setWindowFrame :: WindowHandle -> Rect -> IO () ! setWindowFrame hwnd rect ! = withCRect rect $ \x0 y0 x1 y1 -> ! osSetWindowRect hwnd x0 y0 x1 y1 ! foreign import ccall osSetWindowRect :: WindowHandle -> CInt -> CInt -> CInt -> CInt -> IO () ! -- | Get the outer frame of a window. ! getWindowFrame :: WindowHandle -> IO Rect ! getWindowFrame hwnd ! = withCRectResult $ \crect -> ! osGetWindowRect hwnd crect foreign import ccall osGetWindowRect :: WindowHandle -> Ptr CInt -> IO () --- 57,70 ---- foreign import ccall "osInvalidateWindow" invalidateWindow :: WindowHandle -> IO () ! -- | Sets the position of the window. The position can be specified using the exact bounding rectangle ! -- or in a way relative to the parent window or to the screen. ! setWindowPosition :: WindowHandle -> WindowPosition -> IO () ! setWindowPosition hwnd pos = withCWindowPosition pos (osSetWindowPosition hwnd) ! foreign import ccall osSetWindowPosition :: WindowHandle -> CInt -> CInt -> CInt -> CInt -> CInt -> IO () ! -- | Gets the smallest rectangle which bounds the outer frame of the window. Use the 'setWindowPosition' function ! -- to move\/resize the window ! getWindowRect :: WindowHandle -> IO Rect ! getWindowRect hwnd = withCRectResult (osGetWindowRect hwnd) foreign import ccall osGetWindowRect :: WindowHandle -> Ptr CInt -> IO () |
From: <kr_...@us...> - 2004-05-05 22:10:30
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31835/src/cbits/GTK Modified Files: ToolBar.c Log Message: move to GTK 2.4 Index: ToolBar.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/ToolBar.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ToolBar.c 14 Dec 2003 10:51:39 -0000 1.11 --- ToolBar.c 5 May 2004 22:10:16 -0000 1.12 *************** *** 10,13 **** --- 10,14 ---- toolbar = gtk_toolbar_new(); + gtk_toolbar_set_show_arrow(toolbar,FALSE); gtk_signal_connect (GTK_OBJECT(toolbar), "destroy", GTK_SIGNAL_FUNC(handleWindowDestroy), |
From: <kr_...@us...> - 2004-05-05 21:09:56
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18961 Modified Files: gtkdropdownbutton.c gtkdropdowntoolbutton.c Log Message: move to GTK 2.4 Index: gtkdropdownbutton.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/gtkdropdownbutton.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gtkdropdownbutton.c 22 Aug 2003 21:45:08 -0000 1.1 --- gtkdropdownbutton.c 5 May 2004 21:09:47 -0000 1.2 *************** *** 95,98 **** --- 95,234 ---- }; + static const GtkBorder default_default_border = { 1, 1, 1, 1 }; + static const GtkBorder default_default_outside_border = { 0, 0, 0, 0 }; + + static void + gtk_button_get_props (GtkButton *button, + GtkBorder *default_border, + GtkBorder *default_outside_border, + gboolean *interior_focus) + { + GtkWidget *widget = GTK_WIDGET (button); + GtkBorder *tmp_border; + + if (default_border) + { + gtk_widget_style_get (widget, "default_border", &tmp_border, NULL); + + if (tmp_border) + { + *default_border = *tmp_border; + g_free (tmp_border); + } + else + *default_border = default_default_border; + } + + if (default_outside_border) + { + gtk_widget_style_get (widget, "default_outside_border", &tmp_border, NULL); + + if (tmp_border) + { + *default_outside_border = *tmp_border; + g_free (tmp_border); + } + else + *default_outside_border = default_default_outside_border; + } + + if (interior_focus) + gtk_widget_style_get (widget, "interior_focus", interior_focus, NULL); + } + + void _gtk_button_paint (GtkButton *button, + GdkRectangle *area, + GtkStateType state_type, + GtkShadowType shadow_type, + const gchar *main_detail, + const gchar *default_detail) + { + GtkWidget *widget; + gint width, height; + gint x, y; + gint border_width; + GtkBorder default_border; + GtkBorder default_outside_border; + gboolean interior_focus; + gint focus_width; + gint focus_pad; + + if (GTK_WIDGET_DRAWABLE (button)) + { + widget = GTK_WIDGET (button); + border_width = GTK_CONTAINER (widget)->border_width; + + gtk_button_get_props (button, &default_border, &default_outside_border, &interior_focus); + gtk_widget_style_get (GTK_WIDGET (widget), + "focus-line-width", &focus_width, + "focus-padding", &focus_pad, + NULL); + + x = widget->allocation.x + border_width; + y = widget->allocation.y + border_width; + width = widget->allocation.width - border_width * 2; + height = widget->allocation.height - border_width * 2; + + if (GTK_WIDGET_HAS_DEFAULT (widget) && + GTK_BUTTON (widget)->relief == GTK_RELIEF_NORMAL) + { + gtk_paint_box (widget->style, widget->window, + GTK_STATE_NORMAL, GTK_SHADOW_IN, + area, widget, "buttondefault", + x, y, width, height); + + x += default_border.left; + y += default_border.top; + width -= default_border.left + default_border.right; + height -= default_border.top + default_border.bottom; + } + else if (GTK_WIDGET_CAN_DEFAULT (widget)) + { + x += default_outside_border.left; + y += default_outside_border.top; + width -= default_outside_border.left + default_outside_border.right; + height -= default_outside_border.top + default_outside_border.bottom; + } + + if (!interior_focus && GTK_WIDGET_HAS_FOCUS (widget)) + { + x += focus_width + focus_pad; + y += focus_width + focus_pad; + width -= 2 * (focus_width + focus_pad); + height -= 2 * (focus_width + focus_pad); + } + + if (button->relief != GTK_RELIEF_NONE || button->depressed || + GTK_WIDGET_STATE(widget) == GTK_STATE_PRELIGHT) + gtk_paint_box (widget->style, widget->window, + state_type, + shadow_type, area, widget, "button", + x, y, width, height); + + if (GTK_WIDGET_HAS_FOCUS (widget)) + { + if (interior_focus) + { + x += widget->style->xthickness + focus_pad; + y += widget->style->ythickness + focus_pad; + width -= 2 * (widget->style->xthickness + focus_pad); + height -= 2 * (widget->style->ythickness + focus_pad); + } + else + { + x -= focus_width + focus_pad; + y -= focus_width + focus_pad; + width += 2 * (focus_width + focus_pad); + height += 2 * (focus_width + focus_pad); + } + + gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget), + area, widget, "button", + x, y, width, height); + } + } + } + + static GtkButtonClass *parent_class = NULL; Index: gtkdropdowntoolbutton.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/gtkdropdowntoolbutton.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gtkdropdowntoolbutton.c 14 Dec 2003 10:51:39 -0000 1.2 --- gtkdropdowntoolbutton.c 5 May 2004 21:09:47 -0000 1.3 *************** *** 59,62 **** --- 59,66 ---- } + GtkWidget *_gtk_tool_button_get_button (GtkToolButton *button) + { + return GTK_BIN(button)->child; + } static void |
From: <kr_...@us...> - 2004-05-05 21:08:03
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18651 Modified Files: FileDialog.c Log Message: use the new GtkFileChooser widget Index: FileDialog.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/FileDialog.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FileDialog.c 1 May 2003 17:12:42 -0000 1.8 --- FileDialog.c 5 May 2004 21:07:54 -0000 1.9 *************** *** 4,44 **** char *osSelectDirectory(char *title, WindowHandle owner) { ! GtkWidget *file_selector = gtk_file_selection_new(title); ! if (owner) owner = gtk_widget_get_toplevel(owner); else owner = gFrameWidget; - gtk_window_set_transient_for(GTK_WINDOW(file_selector), GTK_WINDOW(owner)); for (;;) { ! if (gtk_dialog_run(GTK_DIALOG(file_selector)) == GTK_RESPONSE_OK) { ! gchar *file_name; ! G_CONST_RETURN gchar *fname = gtk_file_selection_get_filename(GTK_FILE_SELECTION(file_selector)); ! if (!g_file_test(fname, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) { ! GtkWidget *dialog = ! gtk_message_dialog_new (GTK_WINDOW(file_selector), ! GTK_DIALOG_DESTROY_WITH_PARENT, ! GTK_MESSAGE_ERROR, ! GTK_BUTTONS_OK, ! "%s directory not found", ! fname); ! gtk_dialog_run (GTK_DIALOG (dialog)); ! gtk_widget_destroy (dialog); ! continue; } - - file_name = g_strdup(fname); - gtk_widget_destroy(file_selector); - return file_name; - } - else - { - gtk_widget_destroy(file_selector); - return NULL; } } } --- 4,70 ---- char *osSelectDirectory(char *title, WindowHandle owner) { ! GtkWidget *dialog; ! char *filename; ! if (owner) owner = gtk_widget_get_toplevel(owner); else owner = gFrameWidget; + dialog = gtk_file_chooser_dialog_new (title, + GTK_WINDOW(owner), + GTK_FILE_CHOOSER_ACTION_SAVE, + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + NULL); + gtk_file_chooser_set_action(GTK_FILE_CHOOSER(dialog), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); + + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) + filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); + else + filename = NULL; + + gtk_widget_destroy (dialog); + + return filename; + } + + static void SetFileChooserFilter(GtkFileChooser *chooser, char *filter) + { for (;;) { ! GtkFileFilter *ffilter; ! char *name, *exts, *ext, *s; ! ! name = filter; ! exts = name + strlen(name)+1; ! filter = exts + strlen(exts)+1; ! ! if (*name == 0 || *exts == 0) ! break; ! ! ffilter = gtk_file_filter_new(); ! gtk_file_filter_set_name(ffilter, name); ! ! s = exts; ! for (;;) { ! ext = s; ! while (*s != ';' && *s != 0) ! s++; ! ! if (*s) { ! *(s++) = 0; ! gtk_file_filter_add_pattern(ffilter, ext); ! } ! else ! { ! gtk_file_filter_add_pattern(ffilter, ext); ! break; } } + + gtk_file_chooser_add_filter(chooser, ffilter); } } *************** *** 46,228 **** char *osSelectInputFile(char *title, char *filter, WindowHandle owner) { ! GtkWidget *file_selector = gtk_file_selection_new(title); ! if (owner) owner = gtk_widget_get_toplevel(owner); else owner = gFrameWidget; - gtk_window_set_transient_for(GTK_WINDOW(file_selector), GTK_WINDOW(owner)); ! for (;;) ! { ! if (gtk_dialog_run(GTK_DIALOG(file_selector)) == GTK_RESPONSE_OK) ! { ! gchar *file_name; ! G_CONST_RETURN gchar *fname = gtk_file_selection_get_filename(GTK_FILE_SELECTION(file_selector)); ! if (!g_file_test(fname, G_FILE_TEST_EXISTS)) ! { ! GtkWidget *dialog = ! gtk_message_dialog_new (GTK_WINDOW(file_selector), ! GTK_DIALOG_DESTROY_WITH_PARENT, ! GTK_MESSAGE_ERROR, ! GTK_BUTTONS_OK, ! "%s file not found", ! fname); ! gtk_dialog_run (GTK_DIALOG (dialog)); ! gtk_widget_destroy (dialog); ! continue; ! } ! if (g_file_test(fname, G_FILE_TEST_IS_DIR)) ! { ! GtkWidget *dialog = ! gtk_message_dialog_new (GTK_WINDOW(file_selector), ! GTK_DIALOG_DESTROY_WITH_PARENT, ! GTK_MESSAGE_ERROR, ! GTK_BUTTONS_OK, ! "Path %s is a directory", ! fname); ! gtk_dialog_run (GTK_DIALOG (dialog)); ! gtk_widget_destroy (dialog); ! continue; ! } ! file_name = g_strdup(fname); ! gtk_widget_destroy(file_selector); ! return file_name; ! } ! else ! { ! gtk_widget_destroy(file_selector); ! return NULL; ! } ! } } char *osSelectInputFiles(char *title, char *filter, WindowHandle owner) { ! GtkWidget *file_selector = gtk_file_selection_new(title); ! if (owner) owner = gtk_widget_get_toplevel(owner); else owner = gFrameWidget; - gtk_window_set_transient_for(GTK_WINDOW(file_selector), GTK_WINDOW(owner)); - gtk_file_selection_set_select_multiple(GTK_FILE_SELECTION(file_selector), gtk_true()); ! for (;;) { ! if (gtk_dialog_run(GTK_DIALOG(file_selector)) == GTK_RESPONSE_OK) ! { ! int pos_size; ! gchar *buffer; ! gchar **fname, **files = gtk_file_selection_get_selections(GTK_FILE_SELECTION(file_selector)); ! ! pos_size = 1; ! for (fname = files; *fname; fname++) ! { ! if (!g_file_test(*fname, G_FILE_TEST_EXISTS)) ! { ! GtkWidget *dialog = ! gtk_message_dialog_new (GTK_WINDOW(file_selector), ! GTK_DIALOG_DESTROY_WITH_PARENT, ! GTK_MESSAGE_ERROR, ! GTK_BUTTONS_OK, ! "%s file not found", ! *fname); ! gtk_dialog_run (GTK_DIALOG (dialog)); ! gtk_widget_destroy (dialog); ! break; ! } ! if (g_file_test(*fname, G_FILE_TEST_IS_DIR)) ! { ! GtkWidget *dialog = ! gtk_message_dialog_new (GTK_WINDOW(file_selector), ! GTK_DIALOG_DESTROY_WITH_PARENT, ! GTK_MESSAGE_ERROR, ! GTK_BUTTONS_OK, ! "Path %s is a directory", ! *fname); ! gtk_dialog_run (GTK_DIALOG (dialog)); ! gtk_widget_destroy (dialog); ! break; ! } ! ! pos_size += strlen(*fname)+1; ! } ! ! if (*fname) ! { ! g_strfreev(files); ! continue; ! } ! ! buffer = malloc(pos_size); ! if (!buffer) ! return NULL; ! pos_size = 0; ! for (fname = files; *fname; fname++) ! { ! strcpy(buffer+pos_size,*fname); ! pos_size += strlen(*fname)+1; ! } ! ! gtk_widget_destroy(file_selector); ! g_strfreev(files); ! return buffer; ! } ! else { ! gtk_widget_destroy(file_selector); return NULL; } } } char *osSelectOutputFile(char *title, char *filter, char *nameptr, WindowHandle owner) { ! GtkWidget *file_selector = gtk_file_selection_new(title); ! if (owner) owner = gtk_widget_get_toplevel(owner); else owner = gFrameWidget; - gtk_window_set_transient_for(GTK_WINDOW(file_selector), GTK_WINDOW(owner)); ! gtk_file_selection_set_filename(GTK_FILE_SELECTION(file_selector), nameptr); ! for (;;) ! { ! if (gtk_dialog_run(GTK_DIALOG(file_selector)) == GTK_RESPONSE_OK) ! { ! gchar *file_name; ! G_CONST_RETURN gchar *fname = gtk_file_selection_get_filename(GTK_FILE_SELECTION(file_selector)); ! if (g_file_test(fname, G_FILE_TEST_EXISTS)) ! { ! gint res; ! GtkWidget *dialog = ! gtk_message_dialog_new (GTK_WINDOW(file_selector), ! GTK_DIALOG_DESTROY_WITH_PARENT, ! GTK_MESSAGE_WARNING, ! GTK_BUTTONS_YES_NO, ! "%s already exists. Do you want to replace id?", ! fname); ! res = gtk_dialog_run (GTK_DIALOG (dialog)); ! gtk_widget_destroy (dialog); ! if (res == GTK_RESPONSE_NO) continue; ! } ! file_name = g_strdup(fname); ! gtk_widget_destroy(file_selector); ! return file_name; ! } ! else ! { ! gtk_widget_destroy(file_selector); ! return NULL; ! } ! } } --- 72,188 ---- char *osSelectInputFile(char *title, char *filter, WindowHandle owner) { ! GtkWidget *dialog; ! char *filename; ! if (owner) owner = gtk_widget_get_toplevel(owner); else owner = gFrameWidget; ! dialog = gtk_file_chooser_dialog_new (title, ! GTK_WINDOW(owner), ! GTK_FILE_CHOOSER_ACTION_SAVE, ! GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, ! GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, ! NULL); ! gtk_file_chooser_set_action(GTK_FILE_CHOOSER(dialog), GTK_FILE_CHOOSER_ACTION_OPEN); ! SetFileChooserFilter(GTK_FILE_CHOOSER (dialog), filter); ! if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) ! filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); ! else ! filename = NULL; ! gtk_widget_destroy (dialog); ! ! return filename; } char *osSelectInputFiles(char *title, char *filter, WindowHandle owner) { ! GtkWidget *dialog; ! char *buffer; ! if (owner) owner = gtk_widget_get_toplevel(owner); else owner = gFrameWidget; ! dialog = gtk_file_chooser_dialog_new (title, ! GTK_WINDOW(owner), ! GTK_FILE_CHOOSER_ACTION_SAVE, ! GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, ! GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, ! NULL); ! gtk_file_chooser_set_action(GTK_FILE_CHOOSER(dialog), GTK_FILE_CHOOSER_ACTION_OPEN); ! gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), TRUE); ! ! SetFileChooserFilter(GTK_FILE_CHOOSER (dialog), filter); ! ! if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { ! int buffer_size; ! GSList *lst, *files_list; ! files_list = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER(dialog)); ! buffer_size = 1; ! lst = files_list; ! while (lst) { ! buffer_size += strlen((char *) lst->data)+1; ! lst = lst->next; ! } ! ! buffer = malloc(buffer_size); ! if (!buffer) return NULL; + + buffer_size = 0; + lst = files_list; + while (lst) + { + strcpy(buffer+buffer_size,(char *) lst->data); + buffer_size += strlen((char *) lst->data)+1; + lst = lst->next; } + *(buffer+buffer_size) = 0; + + g_slist_free(files_list); } + else + buffer = NULL; + + gtk_widget_destroy (dialog); + + return buffer; } char *osSelectOutputFile(char *title, char *filter, char *nameptr, WindowHandle owner) { ! GtkWidget *dialog; ! char *filename; ! if (owner) owner = gtk_widget_get_toplevel(owner); else owner = gFrameWidget; ! dialog = gtk_file_chooser_dialog_new (title, ! GTK_WINDOW(owner), ! GTK_FILE_CHOOSER_ACTION_SAVE, ! GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, ! GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, ! NULL); ! gtk_file_chooser_set_action(GTK_FILE_CHOOSER(dialog), GTK_FILE_CHOOSER_ACTION_SAVE); ! SetFileChooserFilter(GTK_FILE_CHOOSER (dialog), filter); ! if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) ! filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); ! else ! filename = NULL; ! gtk_widget_destroy (dialog); ! return filename; } |
From: <kr_...@us...> - 2004-05-05 21:07:05
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18473 Modified Files: Menu.c Log Message: bugfix Index: Menu.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Menu.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Menu.c 16 Nov 2003 08:40:04 -0000 1.13 --- Menu.c 5 May 2004 21:06:56 -0000 1.14 *************** *** 20,29 **** { gchar* hint = g_object_get_data(G_OBJECT(menuitem), apphelper_statusbar_hint); ! gnome_appbar_push(GNOME_APPBAR(GNOME_APP(gFrameWidget)->statusbar), hint); } static void menu_remove_hint_from_statusbar(GtkWidget *menu) { ! gnome_appbar_pop(GNOME_APPBAR(GNOME_APP(gFrameWidget)->statusbar)); } --- 20,31 ---- { gchar* hint = g_object_get_data(G_OBJECT(menuitem), apphelper_statusbar_hint); ! // if (GNOME_APP(gFrameWidget)->statusbar) ! // gnome_appbar_push(GNOME_APPBAR(GNOME_APP(gFrameWidget)->statusbar), hint); } static void menu_remove_hint_from_statusbar(GtkWidget *menu) { ! // if (GNOME_APP(gFrameWidget)->statusbar) ! // gnome_appbar_pop(GNOME_APPBAR(GNOME_APP(gFrameWidget)->statusbar)); } |
From: <br...@us...> - 2004-04-27 19:27:20
|
Update of /cvsroot/htoolkit/HSQL/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13819/src Modified Files: HSQL.hsc Log Message: getFieldValueMB now falls back to fromSqlValue if from fromNonNullSqlCStringLen returns Nothing. Added rules for using SqlDouble as Int, Int64 and Integer since at least MySQL sets the type of sums on INT columns to SqlDouble. It makes sense for the user to be able to treat a sum of integers as an integer. Index: HSQL.hsc =================================================================== RCS file: /cvsroot/htoolkit/HSQL/src/HSQL.hsc,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** HSQL.hsc 31 Mar 2004 16:12:46 -0000 1.12 --- HSQL.hsc 27 Apr 2004 19:27:12 -0000 1.13 *************** *** 210,213 **** --- 210,214 ---- fromSqlValue SqlSmallInt s = Just (read s) fromSqlValue SqlBigInt s = Just (read s) + fromSqlValue SqlDouble s = Just (truncate (read s :: Double)) fromSqlValue _ _ = Nothing *************** *** 233,236 **** --- 234,238 ---- fromSqlValue SqlSmallInt s = Just (read s) fromSqlValue SqlBigInt s = Just (read s) + fromSqlValue SqlDouble s = Just (truncate (read s :: Double)) fromSqlValue _ s = Nothing *************** *** 243,246 **** --- 245,249 ---- fromSqlValue SqlSmallInt s = Just (read s) fromSqlValue SqlBigInt s = Just (read s) + fromSqlValue SqlDouble s = Just (truncate (read s :: Double)) fromSqlValue _ _ = Nothing *************** *** 528,534 **** -> IO (Maybe a) -- ^ Field value or Nothing getFieldValueMB stmt name = checkHandle (stmtClosed stmt) $ ! stmtGetCol stmt colNumber (name,sqlType,nullable) fromNonNullSqlCStringLen where (sqlType,nullable,colNumber) = findFieldInfo name (stmtFields stmt) 0 -- | Retrieves the value of field with the specified name. --- 531,544 ---- -> IO (Maybe a) -- ^ Field value or Nothing getFieldValueMB stmt name = checkHandle (stmtClosed stmt) $ ! stmtGetCol stmt colNumber (name,sqlType,nullable) fromCStr where (sqlType,nullable,colNumber) = findFieldInfo name (stmtFields stmt) 0 + fromCStr t c l = do m <- fromNonNullSqlCStringLen t c l + case m of + Just _ -> return m + Nothing -> + do str <- peekCStringLen (c, l) + return (fromSqlValue t str) + -- | Retrieves the value of field with the specified name. |
From: <br...@us...> - 2004-04-26 16:28:48
|
Update of /cvsroot/htoolkit/HSQL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18430 Modified Files: configure.ac Log Message: Add -Isrc/HSQL when compiling MySQL driver. Index: configure.ac =================================================================== RCS file: /cvsroot/htoolkit/HSQL/configure.ac,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** configure.ac 14 Apr 2004 13:59:22 -0000 1.17 --- configure.ac 26 Apr 2004 16:28:40 -0000 1.18 *************** *** 330,333 **** --- 330,334 ---- esac + CPPFLAGS="$CPPFLAGS -Isrc/HSQL" fi |
From: <br...@us...> - 2004-04-14 13:59:30
|
Update of /cvsroot/htoolkit/HSQL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8181 Modified Files: configure.ac Log Message: Fixed typo in GHC_DIR assignment. Before, GHC_DIR would be the Hugs dir if prefix was not set. Index: configure.ac =================================================================== RCS file: /cvsroot/htoolkit/HSQL/configure.ac,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** configure.ac 11 Apr 2004 16:00:00 -0000 1.16 --- configure.ac 14 Apr 2004 13:59:22 -0000 1.17 *************** *** 72,76 **** GHC_DIR="$prefix/lib/HSQL/GHC" else ! GHC_DIR="$ac_default_prefix/lib/HSQL/Hugs" fi --- 72,76 ---- GHC_DIR="$prefix/lib/HSQL/GHC" else ! GHC_DIR="$ac_default_prefix/lib/HSQL/GHC" fi |
From: <kr_...@us...> - 2004-04-11 17:24:35
|
Update of /cvsroot/htoolkit/HSQL/RPM In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18171 Modified Files: HSQL.spec Log Message: Move to ghc-6.2.1 Index: HSQL.spec =================================================================== RCS file: /cvsroot/htoolkit/HSQL/RPM/HSQL.spec,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HSQL.spec 11 Apr 2004 16:09:43 -0000 1.1 --- HSQL.spec 11 Apr 2004 17:10:55 -0000 1.2 *************** *** 9,13 **** BuildRoot: /tmp/HSQL-root Source: HSQL.tar.gz ! Requires: ghc = 6.2 Requires: hugs98 = Nov2003 Requires: sqlite >= 2.8.12 --- 9,13 ---- BuildRoot: /tmp/HSQL-root Source: HSQL.tar.gz ! Requires: ghc = 6.2.1 Requires: hugs98 = Nov2003 Requires: sqlite >= 2.8.12 |
From: <kr_...@us...> - 2004-04-11 16:23:22
|
Update of /cvsroot/htoolkit/HSQL/RPM In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7315 Added Files: HSQL.spec Log Message: Added RPM specification file --- NEW FILE: HSQL.spec --- Summary: Haskell database interaction library Name: HSQL Version: 1.4 Release: 1 Copyright: BSD vendor: HToolkit Team packager: Krasimir Angelov <ka2...@ya...> Group: Development/Libraries BuildRoot: /tmp/HSQL-root Source: HSQL.tar.gz Requires: ghc = 6.2 Requires: hugs98 = Nov2003 Requires: sqlite >= 2.8.12 Requires: postgresql-libs >= 7.4.1 Requires: unixODBC >= 2.2.5 Requires: MySQL-shared >= 4.1.1 %description HSQL allows haskell programmers to interact with databases using MySQL, PostgreSQL, ODBC and SQLite. %prep %setup -n HSQL %post ghc-pkg -u --auto-ghci-libs <<- \EOF Package {name = "hsql", auto=True, import_dirs = ["/usr/lib/HSQL/GHC/imports"], source_dirs = [], library_dirs = ["/usr/lib/HSQL/GHC","/usr/lib","/usr/local/lib/mysql"], hs_libraries = ["HSsql"], extra_libraries = ["sqlite","mysqlclient","pq","odbc","mysqlclient","z","crypt","nsl","m","sqlite"], include_dirs = [], c_includes = [], package_deps = ["base"], extra_ghc_opts = [], extra_cc_opts = [], extra_ld_opts = [], framework_dirs = [], extra_frameworks = [] } EOF %postun ghc-pkg -r hsql %build ./configure --prefix=$RPM_BUILD_ROOT/usr --enable-mysql --enable-postgres --enable-odbc --enable-sqlite make make docs %install make install %files %defattr (-,root,root) #GHC /usr/lib/HSQL/GHC/HSsql.o /usr/lib/HSQL/GHC/libHSsql.a /usr/lib/HSQL/GHC/imports/Database/HSQL /usr/lib/HSQL/GHC/imports/Database/HSQL.hi #Hugs /usr/lib/HSQL/Hugs/libraries/Database/HSQL /usr/lib/HSQL/Hugs/libraries/Database/HSQL.hs /usr/lib/HSQL/Hugs/libraries/Database/HSQL.so #GHC-Docs /usr/doc/HSQL |