[ros-diffs] [gedmurphy] 30435: load the header text from the resources

gedmurphy at svn.reactos.org gedmurphy at svn.reactos.org
Wed Nov 14 12:34:10 CET 2007


Author: gedmurphy
Date: Wed Nov 14 14:34:10 2007
New Revision: 30435

URL: http://svn.reactos.org/svn/reactos?rev=30435&view=rev
Log:
load the header text from the resources

Modified:
    trunk/reactos/base/applications/mstsc/connectdialog.c
    trunk/reactos/base/applications/mstsc/lang/en-US.rc
    trunk/reactos/base/applications/mstsc/res/header.bmp
    trunk/reactos/base/applications/mstsc/res/header.pdn
    trunk/reactos/base/applications/mstsc/resource.h
    trunk/reactos/base/applications/mstsc/rsrc.rc

Modified: trunk/reactos/base/applications/mstsc/connectdialog.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/connectdialog.c?rev=30435&r1=30434&r2=30435&view=diff
==============================================================================
--- trunk/reactos/base/applications/mstsc/connectdialog.c (original)
+++ trunk/reactos/base/applications/mstsc/connectdialog.c Wed Nov 14 14:34:10 2007
@@ -52,6 +52,7 @@
         ReLoadDisplayPage(pInfo);
     }
 }
+
 
 static VOID
 DoSaveAs(PINFO pInfo)
@@ -932,6 +933,8 @@
                           GWLP_USERDATA,
                           (LONG_PTR)pInfo);
 
+        pInfo->hSelf = hwnd;
+
         /* add main settings pointer */
         pInfo->pRdpSettings = pRdpSettings;
 
@@ -1090,16 +1093,79 @@
                 HDC hdcMem = CreateCompatibleDC(hdc);
                 if (hdcMem)
                 {
+                    WCHAR lpBuffer[32];
+                    RECT bmpRc, txtRc;
+                    LOGFONTW lf;
+                    HFONT hFont;
+
+                    GetClientRect(pInfo->hSelf, &bmpRc);
+
                     SelectObject(hdcMem, pInfo->hHeader);
-                    BitBlt(hdc,
-                           0,
-                           0,
-                           pInfo->headerbitmap.bmWidth,
-                           pInfo->headerbitmap.bmHeight,
-                           hdcMem,
-                           0,
-                           0,
-                           SRCCOPY);
+                    StretchBlt(hdc,
+                               0,
+                               0,
+                               bmpRc.right,
+                               pInfo->headerbitmap.bmHeight,
+                               hdcMem,
+                               0,
+                               0,
+                               pInfo->headerbitmap.bmWidth,
+                               pInfo->headerbitmap.bmHeight,
+                               SRCCOPY);
+
+                    txtRc.left = bmpRc.right * 0.25;
+                    txtRc.top = 10;
+                    txtRc.right = bmpRc.right * 0.75;
+                    txtRc.bottom = pInfo->headerbitmap.bmHeight * 0.5;
+
+                    ZeroMemory(&lf, sizeof(LOGFONT));
+
+                    if (LoadStringW(hInst, IDS_HEADERTEXT1, lpBuffer, 32))
+                    {
+                        lf.lfHeight = 24;
+                        lf.lfCharSet = OEM_CHARSET;
+                        lf.lfQuality = DEFAULT_QUALITY;
+                        lf.lfWeight = FW_MEDIUM;
+                        wcscpy(lf.lfFaceName, L"Tahoma");
+
+                        hFont = CreateFontIndirectW(&lf);
+                        if (hFont)
+                        {
+                            SelectObject(hdc, hFont);
+
+                            DPtoLP(hdc, (PPOINT)&txtRc, 2);
+                            SetTextColor(hdc, RGB(255,255,255));
+                            SetBkMode(hdc, TRANSPARENT);
+                            DrawTextW(hdc, lpBuffer, -1, &txtRc, DT_BOTTOM | DT_SINGLELINE);
+                            DeleteObject(hFont);
+                        }
+                    }
+
+                    txtRc.left = bmpRc.right * 0.25;
+                    txtRc.top = txtRc.bottom - 5;
+                    txtRc.right = bmpRc.right * 0.75;
+                    txtRc.bottom = pInfo->headerbitmap.bmHeight * 0.9;
+
+                    if (LoadStringW(hInst, IDS_HEADERTEXT2, lpBuffer, 32))
+                    {
+                        lf.lfHeight = 30;
+                        lf.lfCharSet = OEM_CHARSET;
+                        lf.lfQuality = DEFAULT_QUALITY;
+                        lf.lfWeight = FW_EXTRABOLD;
+                        wcscpy(lf.lfFaceName, L"Tahoma");
+
+                        hFont = CreateFontIndirectW(&lf);
+                        if (hFont)
+                        {
+                            SelectObject(hdc, hFont);
+
+                            DPtoLP(hdc, (PPOINT)&txtRc, 2);
+                            SetTextColor(hdc, RGB(255,255,255));
+                            SetBkMode(hdc, TRANSPARENT);
+                            DrawTextW(hdc, lpBuffer, -1, &txtRc, DT_TOP | DT_SINGLELINE);
+                        }
+                    }
+
                     DeleteDC(hdcMem);
                 }
 

Modified: trunk/reactos/base/applications/mstsc/lang/en-US.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/lang/en-US.rc?rev=30435&r1=30434&r2=30435&view=diff
==============================================================================
--- trunk/reactos/base/applications/mstsc/lang/en-US.rc (original)
+++ trunk/reactos/base/applications/mstsc/lang/en-US.rc Wed Nov 14 14:34:10 2007
@@ -38,14 +38,14 @@
     LTEXT           "", IDC_SETTINGS_RESOLUTION_TEXT, 56, 62, 120, 10, SS_CENTER
 END
 
-IDD_CONNECTDIALOG DIALOGEX 0, 0, 260, 267
+IDD_CONNECTDIALOG DIALOGEX 0, 0, 260, 262
 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Remote Desktop Connection"
 FONT 8, "MS Shell Dlg", 400, 0, 0x1
 BEGIN
-    DEFPUSHBUTTON   "Connect",IDOK,147,249,50,14
-    PUSHBUTTON      "Cancel",IDCANCEL,203,249,50,14
-    CONTROL         "",IDC_TAB,"SysTabControl32",0x0,7,54,246,190
+    DEFPUSHBUTTON   "Connect",IDOK,147,245,50,14
+    PUSHBUTTON      "Cancel",IDCANCEL,203,245,50,14
+    CONTROL         "",IDC_TAB,"SysTabControl32",0x0,7,50,246,190
 END
 
 
@@ -60,4 +60,6 @@
     IDS_PIXEL               "%lux%lu Pixels"
     IDS_FULLSCREEN          "Full Screen"
     IDS_BROWSESERVER        "<Browse for more...>"
+    IDS_HEADERTEXT1         "Remote Desktop"
+    IDS_HEADERTEXT2         "Connection"
 END

Modified: trunk/reactos/base/applications/mstsc/res/header.bmp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/res/header.bmp?rev=30435&r1=30434&r2=30435&view=diff
==============================================================================
Binary files - no diff available.

Modified: trunk/reactos/base/applications/mstsc/res/header.pdn
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/res/header.pdn?rev=30435&r1=30434&r2=30435&view=diff
==============================================================================
Binary files - no diff available.

Modified: trunk/reactos/base/applications/mstsc/resource.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/resource.h?rev=30435&r1=30434&r2=30435&view=diff
==============================================================================
--- trunk/reactos/base/applications/mstsc/resource.h (original)
+++ trunk/reactos/base/applications/mstsc/resource.h Wed Nov 14 14:34:10 2007
@@ -26,14 +26,17 @@
 #define IDB_HEADER                      1100
 #define IDB_SPECT                       1101
 
-#define IDI_LOGON                       2000
-#define IDI_CONN                        2001
-#define IDI_REMOTE                      2002
-#define IDI_COLORS                      2003
-#define IDI_MSTSC                       2004
+#define IDI_MSTSC                       2000
+#define IDI_LOGON                       2001
+#define IDI_CONN                        2002
+#define IDI_REMOTE                      2003
+#define IDI_COLORS                      2004
+
 
 #define IDS_TAB_DISPLAY                 3000
 #define IDS_TAB_GENERAL                 3001
 #define IDS_PIXEL                       3006
 #define IDS_FULLSCREEN                  3007
 #define IDS_BROWSESERVER                3008
+#define IDS_HEADERTEXT1                 3009
+#define IDS_HEADERTEXT2                 3010

Modified: trunk/reactos/base/applications/mstsc/rsrc.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/rsrc.rc?rev=30435&r1=30434&r2=30435&view=diff
==============================================================================
--- trunk/reactos/base/applications/mstsc/rsrc.rc (original)
+++ trunk/reactos/base/applications/mstsc/rsrc.rc Wed Nov 14 14:34:10 2007
@@ -14,7 +14,7 @@
 IDB_HEADER  BITMAP "res/header.bmp"
 IDB_SPECT   BITMAP "res/spectrum.bmp"
 
-#include "lang/de-DE.rc"
+//#include "lang/de-DE.rc"
 #include "lang/en-US.rc"
-#include "lang/fr-FR.rc"
-#include "lang/ru-RU.rc"
+//#include "lang/fr-FR.rc"
+//#include "lang/ru-RU.rc"




More information about the Ros-diffs mailing list