James Hawkins : msi: Read the font color from the database, and use it for the text control.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jun 27 15:49:09 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 3c56550ea5141b48ec19a7a44b3e49f0bf7c6b2e
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=3c56550ea5141b48ec19a7a44b3e49f0bf7c6b2e

Author: James Hawkins <truiken at gmail.com>
Date:   Tue Jun 27 02:04:16 2006 -0700

msi: Read the font color from the database, and use it for the text control.

---

 dlls/msi/dialog.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index 5d36d93..ce1af99 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -71,6 +71,7 @@ typedef struct msi_font_tag
 {
     struct msi_font_tag *next;
     HFONT hfont;
+    COLORREF color;
     WCHAR name[1];
 } msi_font;
 
@@ -243,6 +244,8 @@ static UINT msi_dialog_add_font( MSIRECO
     font->next = dialog->font_list;
     dialog->font_list = font;
 
+    font->color = MSI_RecordGetInteger( rec, 4 );
+
     memset( &lf, 0, sizeof lf );
     face = MSI_RecordGetString( rec, 2 );
     lf.lfHeight = MSI_RecordGetInteger( rec, 3 );
@@ -563,6 +566,7 @@ static msi_control *msi_dialog_add_contr
 
 struct msi_text_info
 {
+    msi_font *font;
     WNDPROC oldproc;
     DWORD attributes;
 };
@@ -592,6 +596,9 @@ MSIText_WndProc(HWND hWnd, UINT msg, WPA
 
     info = GetPropW(hWnd, szButtonData);
 
+    if ( info->font )
+        SetTextColor( (HDC)wParam, info->font->color );
+
     if( msg == WM_CTLCOLORSTATIC &&
        ( info->attributes & msidbControlAttributesTransparent ) )
     {
@@ -619,6 +626,8 @@ static UINT msi_dialog_text_control( msi
 {
     msi_control *control;
     struct msi_text_info *info;
+    LPCWSTR text, ptr;
+    LPWSTR font_name;
 
     TRACE("%p %p\n", dialog, rec);
 
@@ -630,6 +639,11 @@ static UINT msi_dialog_text_control( msi
     if( !info )
         return ERROR_SUCCESS;
 
+    text = MSI_RecordGetString( rec, 10 );
+    font_name = msi_dialog_get_style( text, &ptr );
+    info->font = ( font_name ) ? msi_dialog_find_font( dialog, font_name ) : NULL;
+    msi_free( font_name );
+
     info->attributes = MSI_RecordGetInteger( rec, 8 );
     if( info->attributes & msidbControlAttributesTransparent )
         SetWindowLongPtrW( control->hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT );




More information about the wine-cvs mailing list