Commit e5d414ea authored by Martin Fuchs's avatar Martin Fuchs Committed by Alexandre Julliard

Immediately refresh child windows after changing the font.

parent 3a3307d4
...@@ -181,7 +181,6 @@ FONT 8, "MS Shell Dlg" ...@@ -181,7 +181,6 @@ FONT 8, "MS Shell Dlg"
STRINGTABLE STRINGTABLE
{ {
IDS_FONT_SEL_DLG_NAME "Applying font settings" IDS_FONT_SEL_DLG_NAME "Applying font settings"
IDS_FONT_SEL_DLG_INFO "Changed font settings apply only to newly started windows."
IDS_FONT_SEL_ERROR "Error while selecting new font." IDS_FONT_SEL_ERROR "Error while selecting new font."
IDS_FILE_MOVE_ERROR "Error while moving file or directory." IDS_FILE_MOVE_ERROR "Error while moving file or directory."
} }
...@@ -182,7 +182,6 @@ FONT 8, "MS Shell Dlg" ...@@ -182,7 +182,6 @@ FONT 8, "MS Shell Dlg"
STRINGTABLE STRINGTABLE
{ {
IDS_FONT_SEL_DLG_NAME "Applica le impostazioni dei font" IDS_FONT_SEL_DLG_NAME "Applica le impostazioni dei font"
IDS_FONT_SEL_DLG_INFO "I cambiamenti alle impostazioni dei font vengono applicati solo alle finestre apertesuccesivamente."
IDS_FONT_SEL_ERROR "Si verificato un errore durante la selezione del nuovo font." IDS_FONT_SEL_ERROR "Si verificato un errore durante la selezione del nuovo font."
IDS_FILE_MOVE_ERROR "Si verificato un errore durante lo spostamento del file o della directory." IDS_FILE_MOVE_ERROR "Si verificato un errore durante lo spostamento del file o della directory."
} }
...@@ -182,7 +182,6 @@ FONT 8, "MS Shell Dlg" ...@@ -182,7 +182,6 @@ FONT 8, "MS Shell Dlg"
STRINGTABLE STRINGTABLE
{ {
IDS_FONT_SEL_DLG_NAME "Wprowadzanie ustawie czcionki" IDS_FONT_SEL_DLG_NAME "Wprowadzanie ustawie czcionki"
IDS_FONT_SEL_DLG_INFO "Nowe ustawienia czcionki zadziaaj jedynie dla nowo otwartych okien."
IDS_FONT_SEL_ERROR "Bd przy wybieraniu czcionki" IDS_FONT_SEL_ERROR "Bd przy wybieraniu czcionki"
IDS_FILE_MOVE_ERROR "Bd przy przenoszeniu pliku." IDS_FILE_MOVE_ERROR "Bd przy przenoszeniu pliku."
} }
/* /*
* Copyright 2000 Martin Fuchs * Copyright 2000, 2003 Martin Fuchs
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -72,7 +72,6 @@ ...@@ -72,7 +72,6 @@
/* string table */ /* string table */
#define IDS_FONT_SEL_DLG_NAME 1101 #define IDS_FONT_SEL_DLG_NAME 1101
#define IDS_FONT_SEL_DLG_INFO 1102
#define IDS_FONT_SEL_ERROR 1103 #define IDS_FONT_SEL_ERROR 1103
#define IDS_FILE_MOVE_ERROR 1104 #define IDS_FILE_MOVE_ERROR 1104
......
/* /*
* Winefile * Winefile
* *
* Copyright 2000 Martin Fuchs * Copyright 2000, 2003, 2004 Martin Fuchs
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -1490,7 +1490,7 @@ static HWND create_child_window(ChildWnd* child) ...@@ -1490,7 +1490,7 @@ static HWND create_child_window(ChildWnd* child)
mcs.y = child->pos.rcNormalPosition.top; mcs.y = child->pos.rcNormalPosition.top;
mcs.cx = child->pos.rcNormalPosition.right-child->pos.rcNormalPosition.left; mcs.cx = child->pos.rcNormalPosition.right-child->pos.rcNormalPosition.left;
mcs.cy = child->pos.rcNormalPosition.bottom-child->pos.rcNormalPosition.top; mcs.cy = child->pos.rcNormalPosition.bottom-child->pos.rcNormalPosition.top;
mcs.style = 1; mcs.style = 0;
mcs.lParam = 0; mcs.lParam = 0;
hcbthook = SetWindowsHookEx(WH_CBT, CBTProc, 0, GetCurrentThreadId()); hcbthook = SetWindowsHookEx(WH_CBT, CBTProc, 0, GetCurrentThreadId());
...@@ -1817,12 +1817,13 @@ LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam ...@@ -1817,12 +1817,13 @@ LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam
case ID_WINDOW_ARRANGE: case ID_WINDOW_ARRANGE:
SendMessage(Globals.hmdiclient, WM_MDIICONARRANGE, 0, 0); SendMessage(Globals.hmdiclient, WM_MDIICONARRANGE, 0, 0);
break; break;
case ID_SELECT_FONT: { case ID_SELECT_FONT: {
TCHAR dlg_name[BUFFER_LEN], dlg_info[BUFFER_LEN];
CHOOSEFONT chFont; CHOOSEFONT chFont;
LOGFONT lFont; LOGFONT lFont;
HDC hdc = GetDC(hwnd); HDC hdc = GetDC(hwnd);
char dlg_name[255], dlg_info[255];
chFont.lStructSize = sizeof(CHOOSEFONT); chFont.lStructSize = sizeof(CHOOSEFONT);
chFont.hwndOwner = hwnd; chFont.hwndOwner = hwnd;
chFont.hDC = NULL; chFont.hDC = NULL;
...@@ -1837,20 +1838,32 @@ LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam ...@@ -1837,20 +1838,32 @@ LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam
chFont.nFontType = SIMULATED_FONTTYPE; chFont.nFontType = SIMULATED_FONTTYPE;
chFont.nSizeMin = 0; chFont.nSizeMin = 0;
chFont.nSizeMax = 24; chFont.nSizeMax = 24;
if(ChooseFont(&chFont)) {
LoadString(Globals.hInstance, IDS_FONT_SEL_DLG_NAME, dlg_name, MAX_LOAD_STRING); if (ChooseFont(&chFont)) {
LoadString(Globals.hInstance, IDS_FONT_SEL_DLG_INFO, dlg_info, MAX_LOAD_STRING); HWND childWnd;
MessageBox(hwnd,dlg_info,dlg_name,MB_OK|MB_ICONINFORMATION);
Globals.hfont = CreateFontIndirect(&lFont); Globals.hfont = CreateFontIndirect(&lFont);
SelectFont(hdc, Globals.hfont); SelectFont(hdc, Globals.hfont);
GetTextExtentPoint32(hdc, TEXT(" "), 1, &Globals.spaceSize); GetTextExtentPoint32(hdc, TEXT(" "), 1, &Globals.spaceSize);
/* change font in all open child windows */
for(childWnd=GetWindow(Globals.hmdiclient,GW_CHILD); childWnd; childWnd=GetNextWindow(childWnd,GW_HWNDNEXT)) {
ChildWnd* child = (ChildWnd*) GetWindowLong(childWnd, GWL_USERDATA);
SetWindowFont(child->left.hwnd, Globals.hfont, TRUE);
SetWindowFont(child->right.hwnd, Globals.hfont, TRUE);
ListBox_SetItemHeight(child->left.hwnd, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3));
ListBox_SetItemHeight(child->right.hwnd, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3));
InvalidateRect(child->left.hwnd, NULL, TRUE);
InvalidateRect(child->right.hwnd, NULL, TRUE);
}
} }
else if(CommDlgExtendedError()) { else if (CommDlgExtendedError()) {
LoadString(Globals.hInstance, IDS_FONT_SEL_DLG_NAME, dlg_name, MAX_LOAD_STRING); LoadString(Globals.hInstance, IDS_FONT_SEL_DLG_NAME, dlg_name, BUFFER_LEN);
LoadString(Globals.hInstance, IDS_FONT_SEL_ERROR, dlg_info, MAX_LOAD_STRING); LoadString(Globals.hInstance, IDS_FONT_SEL_ERROR, dlg_info, BUFFER_LEN);
MessageBox(hwnd,dlg_info,dlg_name,MB_OK); MessageBox(hwnd, dlg_info, dlg_name, MB_OK);
} }
ReleaseDC(hwnd,hdc);
ReleaseDC(hwnd, hdc);
break; break;
} }
......
/* /*
* Copyright 2000 Martin Fuchs * Copyright 2000, 2003, 2004 Martin Fuchs
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -75,9 +75,7 @@ enum IMAGE { ...@@ -75,9 +75,7 @@ enum IMAGE {
IMG_FOLDER, IMG_OPEN_FOLDER, IMG_FOLDER_PLUS,IMG_OPEN_PLUS, IMG_OPEN_MINUS, IMG_FOLDER, IMG_OPEN_FOLDER, IMG_FOLDER_PLUS,IMG_OPEN_PLUS, IMG_OPEN_MINUS,
IMG_FOLDER_UP, IMG_FOLDER_CUR IMG_FOLDER_UP, IMG_FOLDER_CUR
}; };
#ifndef MAX_LOAD_STRING
#define MAX_LOAD_STRING 256
#endif
#define IMAGE_WIDTH 16 #define IMAGE_WIDTH 16
#define IMAGE_HEIGHT 13 #define IMAGE_HEIGHT 13
#define SPLIT_WIDTH 5 #define SPLIT_WIDTH 5
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment