And another nice Patch by Pierre Schweitzer.

- Improved sample text display (using bold font)
- Centered sample text in rect
- Continued code cleanup

svn path=/trunk/tools/RosBE-Windows/; revision=471
This commit is contained in:
Daniel Reimer 2007-10-28 20:43:08 +00:00
parent 6244783616
commit c0b1784b16
6 changed files with 42 additions and 61 deletions

View File

@ -10,7 +10,7 @@ BEGIN
COMBOBOX IDC_BACK, 100, 10, 100, 100, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST
LTEXT "Schriftfarbe", 0x0, 10, 35, 75, 12
COMBOBOX IDC_FONT, 100, 35, 100, 100, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST
CONTROL "Beispieltext", ID_EXAMPLE, "static", WS_CHILD | WS_VISIBLE | WS_TABSTOP | SS_CENTER, 113, 58, 125, 36
CONTROL "\n\nBeispieltext", ID_EXAMPLE, "static", WS_CHILD | WS_VISIBLE | WS_TABSTOP | SS_CENTER, 113, 58, 125, 36
CONTROL "Kompilierdauer anzeigen", ID_SHOWBUILDTIME, "button", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 55, 100, 12
CONTROL "Logs speichern", ID_SAVELOGS, "button", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 143, 100, 12
CONTROL "CCache benutzen", ID_USECCACHE, "button", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 70, 100, 12

View File

@ -10,7 +10,7 @@ BEGIN
COMBOBOX IDC_BACK, 100, 10, 100, 100, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST
LTEXT "Font Color", 0x0, 10, 35, 75, 12
COMBOBOX IDC_FONT, 100, 35, 100, 100, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST
CONTROL "Sample text", ID_EXAMPLE, "static", WS_CHILD | WS_VISIBLE | WS_TABSTOP | SS_CENTER, 113, 58, 125, 36
CONTROL "\n\nSample text", ID_EXAMPLE, "static", WS_CHILD | WS_VISIBLE | WS_TABSTOP | SS_CENTER, 113, 58, 125, 36
CONTROL "Show Build Time", ID_SHOWBUILDTIME, "button", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 55, 100, 12
CONTROL "Save Logs", ID_SAVELOGS, "button", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 143, 100, 12
CONTROL "Use CCache", ID_USECCACHE, "button", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 70, 100, 12

View File

@ -10,7 +10,7 @@ BEGIN
COMBOBOX IDC_BACK, 100, 10, 100, 100, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST
LTEXT "Couleur de la police", 0x0, 10, 35, 75, 12
COMBOBOX IDC_FONT, 100, 35, 100, 100, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST
CONTROL "Texte d'exemple", ID_EXAMPLE, "static", WS_CHILD | WS_VISIBLE | WS_TABSTOP | SS_CENTER, 125, 58, 120, 36
CONTROL "\n\nTexte d'exemple", ID_EXAMPLE, "static", WS_CHILD | WS_VISIBLE | WS_TABSTOP | SS_CENTER, 125, 58, 120, 36
CONTROL "Montrer le temps de compilation", ID_SHOWBUILDTIME, "button", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 55, 110, 12
CONTROL "Sauvegarder le journal", ID_SAVELOGS, "button", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 143, 100, 12
CONTROL "Utiliser CCache", ID_USECCACHE, "button", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 70, 100, 12

View File

@ -12,7 +12,7 @@ BEGIN
COMBOBOX IDC_BACK, 100, 10, 100, 100, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST
LTEXT "Öâåò Øðèôòà", 0x0, 10, 35, 75, 12
COMBOBOX IDC_FONT, 100, 35, 100, 100, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST
CONTROL "Sample text", ID_EXAMPLE, "static", WS_CHILD | WS_VISIBLE | WS_TABSTOP | SS_CENTER, 113, 58, 125, 36
CONTROL "\n\nSample text", ID_EXAMPLE, "static", WS_CHILD | WS_VISIBLE | WS_TABSTOP | SS_CENTER, 113, 58, 125, 36
CONTROL "Ïîêàçûâàòü Âðåìÿ", ID_SHOWBUILDTIME, "button", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 55, 100, 12
CONTROL "Âåñòè Ëîãè", ID_SAVELOGS, "button", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 143, 100, 12
CONTROL "Use CCache", ID_USECCACHE, "button", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 70, 100, 12

View File

@ -124,12 +124,14 @@ INT_PTR CALLBACK
DlgProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
static HICON hIcon;
static HFONT hFont;
switch (Msg)
{
case WM_INITDIALOG:
{
WCHAR Path[MAX_PATH];
LOGFONT lf;
hIcon = LoadImage( hInstance,
MAKEINTRESOURCE(ID_OPTICON),
@ -140,6 +142,12 @@ DlgProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
if(hIcon)
SendMessage(Dlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
GetObject(GetStockObject(ANSI_FIXED_FONT), sizeof(LOGFONT), &lf);
lf.lfWeight = FW_BOLD;
hFont = CreateFont(lf.lfHeight, lf.lfWidth, lf.lfEscapement, lf.lfOrientation, lf.lfWeight,
lf.lfItalic, lf.lfUnderline, lf.lfStrikeOut, lf.lfCharSet, lf.lfOutPrecision,
lf.lfClipPrecision, lf.lfQuality, lf.lfPitchAndFamily, lf.lfFaceName);
for(UINT i = 0; i < sizeof(Colors) / sizeof(char *); i++)
{
SendDlgItemMessage(Dlg, IDC_BACK, CB_ADDSTRING, 0, (LPARAM) (Colors[i]));
@ -192,55 +200,29 @@ DlgProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
PathInfo.hwndOwner = Dlg;
PathInfo.lpszTitle = L"Please choose a directory where the the logs should be stored:";
if (wParam == ID_BROWSEMGW)
if ((wParam == ID_BROWSEMGW) || (wParam == ID_BROWSEOBJ) || (wParam == ID_BROWSEOUT))
{
HINSTANCE hDLL;
ILCREATEFROMPATHW ILCreateFromPathW;
Control = ID_MGWDIR;
PathInfo.lpszTitle = L"Please choose the directory where MingW is located:";
hDLL = LoadLibrary(L"shell32.dll");
if (hDLL)
if (wParam == ID_BROWSEOBJ)
{
ILCreateFromPathW = (ILCREATEFROMPATHW)GetProcAddress(hDLL, "ILCreateFromPathW");
if (ILCreateFromPathW)
{
GetDlgItemText(Dlg, ID_MGWDIR, path, MAX_PATH);
PathInfo.pidlRoot = ILCreateFromPathW(path);
}
FreeLibrary(hDLL);
Control = ID_OBJDIR;
PathInfo.lpszTitle = L"Please choose the directory where you want to save OBJ Files to:";
}
}
if (wParam == ID_BROWSEOBJ)
{
HINSTANCE hDLL;
ILCREATEFROMPATHW ILCreateFromPathW;
Control = ID_OBJDIR;
PathInfo.lpszTitle = L"Please choose the directory where you want to save OBJ Files to:";
hDLL = LoadLibrary(L"shell32.dll");
if (hDLL)
else if (wParam == ID_BROWSEOUT)
{
ILCreateFromPathW = (ILCREATEFROMPATHW)GetProcAddress(hDLL, "ILCreateFromPathW");
if (ILCreateFromPathW)
{
GetDlgItemText(Dlg, ID_OBJDIR, path, MAX_PATH);
PathInfo.pidlRoot = ILCreateFromPathW(path);
}
FreeLibrary(hDLL);
Control = ID_OUTDIR;
PathInfo.lpszTitle = L"Please choose the directory where you want to save OBJ Files to:";
}
}
if (wParam == ID_BROWSEOUT)
{
HINSTANCE hDLL;
ILCREATEFROMPATHW ILCreateFromPathW;
Control = ID_OUTDIR;
PathInfo.lpszTitle = L"Please choose the directory where you want to save OBJ Files to:";
hDLL = LoadLibrary(L"shell32.dll");
if (hDLL)
{
ILCreateFromPathW = (ILCREATEFROMPATHW)GetProcAddress(hDLL, "ILCreateFromPathW");
if (ILCreateFromPathW)
{
GetDlgItemText(Dlg, ID_OUTDIR, path, MAX_PATH);
GetDlgItemText(Dlg, Control, path, MAX_PATH);
PathInfo.pidlRoot = ILCreateFromPathW(path);
}
FreeLibrary(hDLL);
@ -254,34 +236,32 @@ DlgProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
case ID_STRIP:
case ID_USECCACHE:
case ID_SHOWBUILDTIME:
case ID_OTHEROBJ:
case ID_OTHEROUT:
{
EnableWindow(GetDlgItem(Dlg, ID_OK), TRUE);
break;
if ((wParam != ID_OTHEROBJ) && (wParam != ID_OTHEROUT))
break;
}
case ID_SAVELOGS:
{
BOOL WriteLogSet;
WriteLogSet = SendDlgItemMessage(Dlg, ID_SAVELOGS, BM_GETCHECK, 0, 0) == BST_CHECKED;
EnableWindow(GetDlgItem(Dlg, ID_BROWSE), WriteLogSet);
EnableWindow(GetDlgItem(Dlg, ID_LOGDIR), WriteLogSet);
break;
}
case ID_OTHEROBJ:
{
BOOL WriteLogSet;
WriteLogSet = SendDlgItemMessage(Dlg, ID_OTHEROBJ, BM_GETCHECK, 0, 0) == BST_CHECKED;
EnableWindow(GetDlgItem(Dlg, ID_BROWSEOBJ), WriteLogSet);
EnableWindow(GetDlgItem(Dlg, ID_OBJDIR), WriteLogSet);
EnableWindow(GetDlgItem(Dlg, ID_OK), TRUE);
break;
}
case ID_OTHEROUT:
{
BOOL WriteLogSet;
WriteLogSet = SendDlgItemMessage(Dlg, ID_OTHEROUT, BM_GETCHECK, 0, 0) == BST_CHECKED;
EnableWindow(GetDlgItem(Dlg, ID_BROWSEOUT), WriteLogSet);
EnableWindow(GetDlgItem(Dlg, ID_OUTDIR), WriteLogSet);
EnableWindow(GetDlgItem(Dlg, ID_OK), TRUE);
INT Dialog1, Dialog2;
Dialog1 = ID_BROWSE;
Dialog2 = ID_LOGDIR;
WriteLogSet = SendDlgItemMessage(Dlg, wParam, BM_GETCHECK, 0, 0) == BST_CHECKED;
if (wParam == ID_OTHEROBJ)
{
Dialog1 = ID_BROWSEOBJ;
Dialog2 = ID_OBJDIR;
}
else if (wParam == ID_OTHEROUT)
{
Dialog1 = ID_BROWSEOUT;
Dialog2 = ID_OUTDIR;
}
EnableWindow(GetDlgItem(Dlg, Dialog1), WriteLogSet);
EnableWindow(GetDlgItem(Dlg, Dialog2), WriteLogSet);
break;
}
}
@ -292,8 +272,10 @@ DlgProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
case WM_CTLCOLORSTATIC:
{
HFONT hFontOld;
if((HWND)lParam == GetDlgItem(Dlg, ID_EXAMPLE))
{
hFontOld = SelectObject((HDC)wParam, hFont);
SetTextColor((HDC)wParam, ColorsRGB[SendDlgItemMessage(Dlg, IDC_FONT, CB_GETCURSEL, 0, 0)]);
SetBkColor((HDC)wParam, ColorsRGB[SendDlgItemMessage(Dlg, IDC_BACK, CB_GETCURSEL, 0, 0)]);
return (LONG)CreateSolidBrush(ColorsRGB[SendDlgItemMessage(Dlg, IDC_BACK, CB_GETCURSEL, 0, 0)]);

View File

@ -1,4 +1,3 @@
ToDo:
- Load old settings
- Improve Save button status (disabled if no changes, even if user played with param)
- Improve font preview (having a bold could be better)