# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1052969924 0 # Node ID a4197ddfc50d9f4587919c9442652a814a474855 # Parent 9ffdbfd836521751f62cc5f0bdbffdbaf09becae Changes to calculate groupbox border widths and take this into account when calculating window positions. diff -r 9ffdbfd83652 -r a4197ddfc50d dw.h --- a/dw.h Wed May 14 22:09:01 2003 +0000 +++ b/dw.h Thu May 15 03:38:44 2003 +0000 @@ -47,8 +47,8 @@ #define DW_SIGNAL_VALUE_CHANGED "value_changed" #define DW_SIGNAL_SWITCH_PAGE "switch-page" -#if defined(__OS2__) || defined(__WIN32__) || defined(WINNT) || defined(__EMX__) -/* OS/2 or Windows */ +#if defined(__OS2__) || defined(__WIN32__) || defined(__MAC__) || defined(WINNT) || defined(__EMX__) +/* OS/2, Windows or MacOS */ #if defined(__IBMC__) && !defined(API) #define API _System @@ -222,25 +222,94 @@ extern HMQ dwhmq; #endif +#if defined(__MAC__) +/* MacOS specific section */ +#include + +typedef ControlRef HWND; +typedef void *HMTX; +typedef void *HEV; +typedef void *HMOD; +typedef void *HPIXMAP; +typedef void *HTREEITEM; +typedef void *HMENUI; + +#define DW_DT_LEFT 0 +#define DW_DT_QUERYEXTENT 0 +#define DW_DT_UNDERSCORE 0 +#define DW_DT_STRIKEOUT 0 +#define DW_DT_TEXTATTRS 0 +#define DW_DT_EXTERNALLEADING 0 +#define DW_DT_CENTER 0 +#define DW_DT_RIGHT 0 +#define DW_DT_TOP 0 +#define DW_DT_VCENTER 0 +#define DW_DT_BOTTOM 0 +#define DW_DT_HALFTONE 0 +#define DW_DT_MNEMONIC 0 +#define DW_DT_WORDBREAK 0 +#define DW_DT_ERASERECT 0 + +#define DW_FCF_TITLEBAR 0 +#define DW_FCF_SYSMENU 0 +#define DW_FCF_MENU 0 +#define DW_FCF_SIZEBORDER FCF_SIZEBORDER +#define DW_FCF_MINBUTTON FCF_MINBUTTON +#define DW_FCF_MAXBUTTON FCF_MAXBUTTON +#define DW_FCF_MINMAX FCF_MINMAX +#define DW_FCF_VERTSCROLL FCF_VERTSCROLL +#define DW_FCF_HORZSCROLL FCF_HORZSCROLL +#define DW_FCF_DLGBORDER FCF_DLGBORDER +#define DW_FCF_BORDER FCF_BORDER +#define DW_FCF_SHELLPOSITION FCF_SHELLPOSITION +#define DW_FCF_TASKLIST FCF_TASKLIST +#define DW_FCF_NOBYTEALIGN FCF_NOBYTEALIGN +#define DW_FCF_NOMOVEWITHOWNER FCF_NOMOVEWITHOWNER +#define DW_FCF_SYSMODAL FCF_SYSMODAL +#define DW_FCF_HIDEBUTTON FCF_HIDEBUTTON +#define DW_FCF_HIDEMAX FCF_HIDEMAX +#define DW_FCF_AUTOICON FCF_AUTOICON + +#define DW_CFA_BITMAPORICON CFA_BITMAPORICON +#define DW_CFA_STRING CFA_STRING +#define DW_CFA_ULONG CFA_ULONG +#define DW_CFA_TIME CFA_TIME +#define DW_CFA_DATE CFA_DATE +#define DW_CFA_CENTER CFA_CENTER +#define DW_CFA_LEFT CFA_LEFT +#define DW_CFA_RIGHT CFA_RIGHT +#define DW_CFA_HORZSEPARATOR CFA_HORZSEPARATOR +#define DW_CFA_SEPARATOR CFA_SEPARATOR + +#define DW_CRA_SELECTED CRA_SELECTED +#define DW_CRA_CURSORED CRA_CURSORED + +#define DW_LS_MULTIPLESEL LS_MULTIPLESEL + +#define DW_LIT_NONE -1 + +#define DW_MLE_CASESENSITIVE MLFSEARCH_CASESENSITIVE + +#define DW_POINTER_ARROW SPTR_ARROW +#define DW_POINTER_CLOCK SPTR_WAIT + +/* flag values for dw_messagebox() */ +#define DW_MB_OK MB_OK +#define DW_MB_OKCANCEL MB_OKCANCEL +#define DW_MB_YESNO MB_YESNO +#define DW_MB_YESNOCANCEL MB_YESNOCANCEL + +#define DW_MB_WARNING MB_WARNING +#define DW_MB_ERROR MB_ERROR +#define DW_MB_INFORMATION MB_INFORMATION +#define DW_MB_QUESTION MB_QUERY +#endif + /* Windows specific section */ #if defined(__WIN32__) || defined(WINNT) #include #include -/* Cygwin doesn't seem to have these... */ -#if defined(__CYGWIN32__) -#define LVS_EX_GRIDLINES 0x00000001 -#define LVS_EX_FULLROWSELECT 0x00000020 -#define LVM_SETEXTENDEDLISTVIEWSTYLE (0x1000 + 54) -#define ListView_SetExtendedListViewStyle(hwndLV, dw) (DWORD)SendMessage((hwndLV), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dw) -#endif -#ifndef UDM_SETPOS32 -#define UDM_SETPOS32 (WM_USER+113) -#endif -#ifndef UDM_GETPOS32 -#define UDM_GETPOS32 (WM_USER+114) -#endif - #if defined(MSVC) && !defined(API) #define API _cdecl #endif diff -r 9ffdbfd83652 -r a4197ddfc50d os2/dw.c --- a/os2/dw.c Wed May 14 22:09:01 2003 +0000 +++ b/os2/dw.c Thu May 15 03:38:44 2003 +0000 @@ -880,10 +880,25 @@ /* Used for the SIZEEXPAND */ int nux = *usedx, nuy = *usedy; int nupx = *usedpadx, nupy = *usedpady; + int textheight = 0; (*usedx) += (thisbox->pad * 2); (*usedy) += (thisbox->pad * 2); + if(thisbox->grouphwnd) + { + char *text = dw_window_get_text(thisbox->grouphwnd); + + if(text) + { + dw_font_text_extents(thisbox->grouphwnd, 0, text, NULL, &textheight); + dw_free(text); + } + + (*usedx) += 6; + (*usedy) += textheight ? (3 + textheight) : 6; + } + for(z=0;zcount;z++) { if(thisbox->items[z].type == TYPEBOX) @@ -1087,6 +1102,12 @@ currentx += thisbox->pad; currenty += thisbox->pad; + if(thisbox->grouphwnd) + { + currentx += 3; + currenty += 3; + } + /* The second pass is for expansion and actual placement. */ if(pass > 1) { diff -r 9ffdbfd83652 -r a4197ddfc50d win/dw.c --- a/win/dw.c Wed May 14 22:09:01 2003 +0000 +++ b/win/dw.c Thu May 15 03:38:44 2003 +0000 @@ -847,6 +847,20 @@ (*usedx) += (thisbox->pad * 2); (*usedy) += (thisbox->pad * 2); + if(thisbox->grouphwnd) + { + char *text = dw_window_get_text(thisbox->grouphwnd); + + if(text) + { + dw_font_text_extents(thisbox->grouphwnd, 0, text, NULL, &textheight); + dw_free(text); + } + + (*usedx) += 6; + (*usedy) += textheight ? (3 + textheight) : 6; + } + for(z=0;zcount;z++) { if(thisbox->items[z].type == TYPEBOX) @@ -1050,6 +1064,12 @@ currentx += thisbox->pad; currenty += thisbox->pad; + if(thisbox->grouphwnd) + { + currentx += 3; + currenty += textheight ? textheight : 3; + } + /* The second pass is for expansion and actual placement. */ if(pass > 1) {