*
* Fill font style information into combobox (without using font.c directly)
*/
-static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTW *lplf)
+static BOOL SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTW *lplf)
{
#define FSTYLES 4
struct FONTSTYLE
WCHAR name[64];
LoadStringW(COMDLG32_hInstance, fontstyles[i].resId, name, 64);
j=SendMessageW(hwnd,CB_ADDSTRING,0,(LPARAM)name );
- if (j==CB_ERR) return 1;
+ if (j==CB_ERR) return TRUE;
j=SendMessageW(hwnd, CB_SETITEMDATA, j,
MAKELONG(tm.tmWeight,fontstyles[i].italic));
- if (j==CB_ERR) return 1;
+ if (j==CB_ERR) return TRUE;
}
}
- return 0;
+ return FALSE;
}
/*************************************************************************
* AddFontSizeToCombo3 [internal]
*/
-static int AddFontSizeToCombo3(HWND hwnd, UINT h, const CHOOSEFONTW *lpcf)
+static BOOL AddFontSizeToCombo3(HWND hwnd, UINT h, const CHOOSEFONTW *lpcf)
{
int j;
WCHAR buffer[20];
{
j=SendMessageW(hwnd, CB_ADDSTRING, 0, (LPARAM)buffer);
if (j!=CB_ERR) j = SendMessageW(hwnd, CB_SETITEMDATA, j, h);
- if (j==CB_ERR) return 1;
+ if (j==CB_ERR) return TRUE;
}
}
- return 0;
+ return FALSE;
}
/*************************************************************************
* SetFontSizesToCombo3 [internal]
*/
-static int SetFontSizesToCombo3(HWND hwnd, const CHOOSEFONTW *lpcf)
+static BOOL SetFontSizesToCombo3(HWND hwnd, const CHOOSEFONTW *lpcf)
{
static const BYTE sizes[]={6,7,8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72};
unsigned int i;
for (i = 0; i < sizeof(sizes)/sizeof(sizes[0]); i++)
- if (AddFontSizeToCombo3(hwnd, sizes[i], lpcf)) return 1;
- return 0;
+ if (AddFontSizeToCombo3(hwnd, sizes[i], lpcf)) return TRUE;
+ return FALSE;
}
/*************************************************************************
INT points;
points = MulDiv( lpNTM->ntmTm.tmHeight - lpNTM->ntmTm.tmInternalLeading,
72, GetScreenDPI());
- i = AddFontSizeToCombo3(hcmb3, points, lpcf);
- if(i) return 0;
+ if (AddFontSizeToCombo3(hcmb3, points, lpcf))
+ return 0;
} else if (SetFontSizesToCombo3(hcmb3, lpcf)) return 0;
if (!SendMessageW(hcmb2, CB_GETCOUNT, 0, 0))
{
+ BOOL res;
if(!(hdc = CFn_GetDC(lpcf))) return 0;
- i=SetFontStylesToCombo2(hcmb2,hdc,lplf);
+ res = SetFontStylesToCombo2(hcmb2,hdc,lplf);
CFn_ReleaseDC(lpcf, hdc);
- if (i)
+ if (res)
return 0;
}
if (!( hcmb5 = GetDlgItem(hDlg, cmb5))) return 1;
return 1 ;
}
-static INT CFn_FitFontSize( HWND hDlg, int points)
+static BOOL CFn_FitFontSize( HWND hDlg, int points)
{
int i,n;
- int ret = 0;
+ BOOL ret = FALSE;
/* look for fitting font size in combobox3 */
n=SendDlgItemMessageW(hDlg, cmb3, CB_GETCOUNT, 0, 0);
for (i=0;i<n;i++)
SendMessageW(hDlg, WM_COMMAND,
MAKEWPARAM(cmb3, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg,cmb3));
- ret = 1;
+ ret = TRUE;
break;
}
}
return ret;
}
-static INT CFn_FitFontStyle( HWND hDlg, LONG packedstyle )
+static BOOL CFn_FitFontStyle( HWND hDlg, LONG packedstyle )
{
LONG id;
- int i, ret = 0;
+ int i;
+ BOOL ret = FALSE;
/* look for fitting font style in combobox2 */
for (i=0;i<TEXT_EXTRAS;i++)
{
SendDlgItemMessageW(hDlg, cmb2, CB_SETCURSEL, i, 0);
SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb2, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg,cmb2));
- ret = 1;
+ ret = TRUE;
break;
}
}
}
-static INT CFn_FitCharSet( HWND hDlg, int charset )
+static BOOL CFn_FitCharSet( HWND hDlg, int charset )
{
int i,n,cs;
/* look for fitting char set in combobox5 */
SendDlgItemMessageW(hDlg, cmb5, CB_SETCURSEL, i, 0);
SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb5, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg,cmb2));
- return 1;
+ return TRUE;
}
}
/* no charset fits: select the first one in the list */
SendDlgItemMessageW(hDlg, cmb5, CB_SETCURSEL, 0, 0);
SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb5, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg,cmb2));
- return 0;
+ return FALSE;
}
/***********************************************************************
static LRESULT CFn_WMInitDialog(HWND hDlg, LPARAM lParam, LPCHOOSEFONTW lpcf)
{
HDC hdc;
- int i,j,init=0;
+ int i,j;
+ BOOL init = FALSE;
long pstyle;
CFn_ENUMSTRUCT s;
LPLOGFONTW lpxx;
if (lpcf->lStructSize != sizeof(CHOOSEFONTW))
{
- ERR("structure size failure !!!\n");
+ ERR("structure size failure!!!\n");
EndDialog (hDlg, 0);
return FALSE;
}
SendDlgItemMessageW(hDlg, cmb1, CB_SETCURSEL, j, 0);
SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg,cmb1));
- init=1;
+ init = TRUE;
/* look for fitting font style in combobox2 */
CFn_FitFontStyle(hDlg, pstyle);
/* look for fitting font size in combobox3 */