[ros-diffs] [dreimer] 29939: And another nice Patch by Pierre Schweitzer. - Improved sample text display (using bold font) - Centered sample text in rect - Continued code cleanup

dreimer at svn.reactos.org dreimer at svn.reactos.org
Sun Oct 28 21:43:08 CET 2007


Author: dreimer
Date: Sun Oct 28 23:43:08 2007
New Revision: 29939

URL: http://svn.reactos.org/svn/reactos?rev=29939&view=rev
Log:
And another nice Patch by Pierre Schweitzer.
- Improved sample text display (using bold font)
- Centered sample text in rect
- Continued code cleanup

Modified:
    trunk/tools/RosBE-Windows/Tools/config/lang/de-DE.rc
    trunk/tools/RosBE-Windows/Tools/config/lang/en-US.rc
    trunk/tools/RosBE-Windows/Tools/config/lang/fr-FR.rc
    trunk/tools/RosBE-Windows/Tools/config/lang/ru-RU.rc
    trunk/tools/RosBE-Windows/Tools/config/options.c
    trunk/tools/RosBE-Windows/Tools/config/todo.txt

Modified: trunk/tools/RosBE-Windows/Tools/config/lang/de-DE.rc
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Tools/config/lang/de-DE.rc?rev=29939&r1=29938&r2=29939&view=diff
==============================================================================
--- trunk/tools/RosBE-Windows/Tools/config/lang/de-DE.rc (original)
+++ trunk/tools/RosBE-Windows/Tools/config/lang/de-DE.rc Sun Oct 28 23:43:08 2007
@@ -10,7 +10,7 @@
   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

Modified: trunk/tools/RosBE-Windows/Tools/config/lang/en-US.rc
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Tools/config/lang/en-US.rc?rev=29939&r1=29938&r2=29939&view=diff
==============================================================================
--- trunk/tools/RosBE-Windows/Tools/config/lang/en-US.rc (original)
+++ trunk/tools/RosBE-Windows/Tools/config/lang/en-US.rc Sun Oct 28 23:43:08 2007
@@ -10,7 +10,7 @@
   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

Modified: trunk/tools/RosBE-Windows/Tools/config/lang/fr-FR.rc
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Tools/config/lang/fr-FR.rc?rev=29939&r1=29938&r2=29939&view=diff
==============================================================================
--- trunk/tools/RosBE-Windows/Tools/config/lang/fr-FR.rc (original)
+++ trunk/tools/RosBE-Windows/Tools/config/lang/fr-FR.rc Sun Oct 28 23:43:08 2007
@@ -10,7 +10,7 @@
   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

Modified: trunk/tools/RosBE-Windows/Tools/config/lang/ru-RU.rc
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Tools/config/lang/ru-RU.rc?rev=29939&r1=29938&r2=29939&view=diff
==============================================================================
--- trunk/tools/RosBE-Windows/Tools/config/lang/ru-RU.rc (original)
+++ trunk/tools/RosBE-Windows/Tools/config/lang/ru-RU.rc Sun Oct 28 23:43:08 2007
@@ -12,7 +12,7 @@
   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

Modified: trunk/tools/RosBE-Windows/Tools/config/options.c
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Tools/config/options.c?rev=29939&r1=29938&r2=29939&view=diff
==============================================================================
--- trunk/tools/RosBE-Windows/Tools/config/options.c (original)
+++ trunk/tools/RosBE-Windows/Tools/config/options.c Sun Oct 28 23:43:08 2007
@@ -124,12 +124,14 @@
 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 @@
             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 @@
                         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:";
+                            if (wParam == ID_BROWSEOBJ)
+                            {
+                                Control = ID_OBJDIR;
+                                PathInfo.lpszTitle = L"Please choose the directory where you want to save OBJ Files to:";
+                            }
+                            else if (wParam == ID_BROWSEOUT)
+                            {
+                                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_MGWDIR, path, MAX_PATH);
-                                    PathInfo.pidlRoot = ILCreateFromPathW(path);
-                                }
-                                FreeLibrary(hDLL);
-                            }
-                        }
-                        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)
-                            {
-                                ILCreateFromPathW = (ILCREATEFROMPATHW)GetProcAddress(hDLL, "ILCreateFromPathW");
-                                if (ILCreateFromPathW)
-                                {
-                                    GetDlgItemText(Dlg, ID_OBJDIR, path, MAX_PATH);
-                                    PathInfo.pidlRoot = ILCreateFromPathW(path);
-                                }
-                                FreeLibrary(hDLL);
-                            }
-                        }
-                        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,36 +236,34 @@
                     case ID_STRIP:
                     case ID_USECCACHE:
                     case ID_SHOWBUILDTIME:
+                    case ID_OTHEROBJ:
+                    case ID_OTHEROUT:
                     {
                         EnableWindow(GetDlgItem(Dlg, ID_OK), TRUE);
+                        if ((wParam != ID_OTHEROBJ) && (wParam != ID_OTHEROUT))
+                            break;
+                    }
+                    case ID_SAVELOGS:
+                    {
+                        BOOL WriteLogSet;
+                        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;
                     }
-                    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);
-                        break;
-                    }
                 }
 
             }
@@ -292,8 +272,10 @@
 
         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)]);

Modified: trunk/tools/RosBE-Windows/Tools/config/todo.txt
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Tools/config/todo.txt?rev=29939&r1=29938&r2=29939&view=diff
==============================================================================
--- trunk/tools/RosBE-Windows/Tools/config/todo.txt (original)
+++ trunk/tools/RosBE-Windows/Tools/config/todo.txt Sun Oct 28 23:43:08 2007
@@ -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)




More information about the Ros-diffs mailing list