From a03ca89d0b68052ec51fd64bd570eabe9d5aa337 Mon Sep 17 00:00:00 2001 From: donho Date: Mon, 24 Mar 2008 14:06:20 +0000 Subject: [PATCH] [BUG_FIXED] Fix the bug that the first new document is set as "New Document setting". git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@152 f5eea248-9336-0410-98b8-ebc06183d4e3 --- .../ScitillaComponent/ScintillaEditView.cpp | 3 +++ .../WinControls/DockingWnd/DockingCont.cpp | 24 ++++++++++++++----- PowerEditor/src/WinControls/ToolBar/ToolBar.h | 2 +- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 8727ee2f..baee2842 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -860,6 +860,9 @@ char * ScintillaEditView::attatchDefaultDoc(int nb) // set current index to 0 _currentIndex = 0; + if (getCurrentBuffer()._unicodeMode != uni8Bit) + execute(SCI_SETCODEPAGE, SC_CP_UTF8); + return _buffers[_currentIndex]._fullPathName; } diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp index 7094e423..8de03ebe 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp @@ -109,12 +109,24 @@ void DockingCont::doDialog(bool willBeShown, bool isFloating) ::ShowWindow(_hCaption, SW_SHOW); } - _hFont = ::CreateFont(14, 0, 0, 0, - FW_NORMAL, FALSE, FALSE, FALSE, - ANSI_CHARSET, OUT_DEFAULT_PRECIS, - CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, - DEFAULT_PITCH | FF_ROMAN, - "MS Shell Dlg"); + //If you want to use titlebar metrics + //NONCLIENTMETRICS ncm; + //ncm.cbSize = sizeof(ncm); + //if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0)) { + // ncm.lfCaptionFont.lfWeight = FW_NORMAL; + // _hFont = ::CreateFontIndirect(&ncm.lfCaptionFont); + //} + + //If you want defualt GUI font + _hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); + + //If you want MS Shell Dlg + //_hFont = ::CreateFont(14, 0, 0, 0, + // FW_NORMAL, FALSE, FALSE, FALSE, + // ANSI_CHARSET, OUT_DEFAULT_PRECIS, + // CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, + // DEFAULT_PITCH | FF_ROMAN, + // "MS Shell Dlg"); } display(willBeShown); diff --git a/PowerEditor/src/WinControls/ToolBar/ToolBar.h b/PowerEditor/src/WinControls/ToolBar/ToolBar.h index 92b4155a..2b74c6a6 100644 --- a/PowerEditor/src/WinControls/ToolBar/ToolBar.h +++ b/PowerEditor/src/WinControls/ToolBar/ToolBar.h @@ -189,7 +189,7 @@ public : _rbBand.hwndChild = _pToolBar->getHSelf(); int dwBtnSize = SendMessage(_pToolBar->getHSelf(), TB_GETBUTTONSIZE, 0,0); _rbBand.cyMinChild = HIWORD(dwBtnSize); - ::SendMessage(_hSelf, RB_INSERTBAND, (WPARAM)0, (LPARAM)&_rbBand); + ::SendMessage(_hSelf, RB_SETBANDINFO, (WPARAM)0, (LPARAM)&_rbBand); }; private: