[BUG_FIXED] Fix language switching to English not working bug.

[MODIFY] Reduce PostIt/FullScreen restore button size.
[BUG_FIXED] Fix PostIt wrong restore button position after toggling off fullScreen mode.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@627 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2010-03-24 21:08:50 +00:00
parent 468f93b3c1
commit b127612e16
4 changed files with 22 additions and 8 deletions

View File

@ -3227,6 +3227,20 @@ void Notepad_plus::fullScreenToggle()
//::SetForegroundWindow(_hSelf);
_beforeSpecialView.isFullScreen = !_beforeSpecialView.isFullScreen;
::SendMessage(_hSelf, WM_SIZE, 0, 0);
if (_beforeSpecialView.isPostIt)
{
// show restore button on the right position
RECT rect;
GetWindowRect(_restoreButton.getHSelf(), &rect);
int w = rect.right - rect.left;
int h = rect.bottom - rect.top;
RECT nppRect;
GetWindowRect(_hSelf, &nppRect);
int x = nppRect.right - w - w;
int y = nppRect.top + 1;
::MoveWindow(_restoreButton.getHSelf(), x, y, w, h, FALSE);
}
}
void Notepad_plus::postItToggle()
@ -3292,8 +3306,8 @@ void Notepad_plus::postItToggle()
RECT nppRect;
GetWindowRect(_hSelf, &nppRect);
int x = nppRect.right - w;
int y = nppRect.top;
int x = nppRect.right - w - w;
int y = nppRect.top + 1;
::MoveWindow(_restoreButton.getHSelf(), x, y, w, h, FALSE);
_pEditView->getFocus();
@ -4010,7 +4024,7 @@ bool Notepad_plus::reloadLang()
return false;
}
_nativeLangSpeaker.init(nativeLangDocRootA);
_nativeLangSpeaker.init(nativeLangDocRootA, true);
pNppParam->reloadContextMenuFromXmlTree(_mainMenuHandle);

View File

@ -790,11 +790,11 @@ BEGIN
EDITTEXT IDC_VALUE_EDIT,49,2,18,14,ES_NUMBER,WS_EX_DLGMODALFRAME
END
IDD_BUTTON_DLG DIALOGEX 0, 0, 51, 17
IDD_BUTTON_DLG DIALOGEX 0, 0, 12, 10
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
PUSHBUTTON "Restore",IDC_RESTORE_BUTTON,0,0,51,17
PUSHBUTTON "+",IDC_RESTORE_BUTTON,0,0,12,10
END
// xp style

View File

@ -23,7 +23,7 @@
#include "localization.h"
void NativeLangSpeaker::init(TiXmlDocumentA *nativeLangDocRootA)
void NativeLangSpeaker::init(TiXmlDocumentA *nativeLangDocRootA, bool loadIfEnglish)
{
if (nativeLangDocRootA)
{
@ -43,7 +43,7 @@ void NativeLangSpeaker::init(TiXmlDocumentA *nativeLangDocRootA)
// get original file name (defined by Notpad++) from the attribute
_fileName = element->Attribute("filename");
if (_fileName && stricmp("english.xml", _fileName) == 0)
if (!loadIfEnglish && _fileName && stricmp("english.xml", _fileName) == 0)
{
_nativeLangA = NULL;
return;

View File

@ -25,7 +25,7 @@
class NativeLangSpeaker {
public:
NativeLangSpeaker():_nativeLangA(NULL), _nativeLangEncoding(CP_ACP), _isRTL(false), _fileName(NULL){};
void init(TiXmlDocumentA *nativeLangDocRootA);
void init(TiXmlDocumentA *nativeLangDocRootA, bool loadIfEnglish = false);
/*
void set(TiXmlNodeA *nativeLangA, int nativeLangEncoding) {
_nativeLangA = nativeLangA;