[CLEAN] Clean up.
Refine the smart hiliting feature. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@182 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
a54e45dd48
commit
84fa914ea1
@ -6018,7 +6018,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
|||||||
{
|
{
|
||||||
case WM_NCACTIVATE:
|
case WM_NCACTIVATE:
|
||||||
{
|
{
|
||||||
/* Note: lParam is -1 to prevent endless loops of calls */
|
// Note: lParam is -1 to prevent endless loops of calls
|
||||||
::SendMessage(_dockingManager.getHSelf(), WM_NCACTIVATE, wParam, (LPARAM)-1);
|
::SendMessage(_dockingManager.getHSelf(), WM_NCACTIVATE, wParam, (LPARAM)-1);
|
||||||
return ::DefWindowProc(hwnd, Message, wParam, lParam);
|
return ::DefWindowProc(hwnd, Message, wParam, lParam);
|
||||||
}
|
}
|
||||||
@ -6661,15 +6661,12 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
|||||||
_dockingManager.reSizeTo(rc);
|
_dockingManager.reSizeTo(rc);
|
||||||
//_pMainWindow->reSizeTo(rc);
|
//_pMainWindow->reSizeTo(rc);
|
||||||
|
|
||||||
//mkPosIncFindDlg();
|
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_MOVE:
|
case WM_MOVE:
|
||||||
{
|
{
|
||||||
//redraw();
|
|
||||||
//mkPosIncFindDlg();
|
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -111,13 +111,6 @@ bool Searching::readBase(const char * string, int * value, int base, int size) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Searching::buildSearchFlags(FindOption * option) {
|
|
||||||
int flags = (option->_isWholeWord ? SCFIND_WHOLEWORD : 0) |
|
|
||||||
(option->_isMatchCase ? SCFIND_MATCHCASE : 0) |
|
|
||||||
(option->_searchType == FindRegex ? SCFIND_REGEXP|SCFIND_POSIX : 0);
|
|
||||||
return flags;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FindReplaceDlg::addText2Combo(const char * txt2add, HWND hCombo, bool isUTF8)
|
void FindReplaceDlg::addText2Combo(const char * txt2add, HWND hCombo, bool isUTF8)
|
||||||
{
|
{
|
||||||
if (!hCombo) return;
|
if (!hCombo) return;
|
||||||
@ -485,6 +478,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
|||||||
case IDCANCEL : // Close
|
case IDCANCEL : // Close
|
||||||
display(false);
|
display(false);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
//Single actions
|
//Single actions
|
||||||
case IDOK : // Find Next
|
case IDOK : // Find Next
|
||||||
{
|
{
|
||||||
@ -1023,7 +1017,8 @@ int FindReplaceDlg::processAll(ProcessOperation op, const char *txt2find, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool isRegExp = pOptions->_searchType == FindRegex;
|
bool isRegExp = pOptions->_searchType == FindRegex;
|
||||||
int flags = Searching::buildSearchFlags(pOptions);
|
int flags = (op == ProcessMarkAll_2)?SCFIND_WHOLEWORD:Searching::buildSearchFlags(pOptions);
|
||||||
|
|
||||||
CharacterRange cr = (*_ppEditView)->getSelection();
|
CharacterRange cr = (*_ppEditView)->getSelection();
|
||||||
int docLength = int((*_ppEditView)->execute(SCI_GETLENGTH));
|
int docLength = int((*_ppEditView)->execute(SCI_GETLENGTH));
|
||||||
|
|
||||||
@ -1117,7 +1112,7 @@ int FindReplaceDlg::processAll(ProcessOperation op, const char *txt2find, const
|
|||||||
bool isRealloc = false;
|
bool isRealloc = false;
|
||||||
|
|
||||||
if (_maxNbCharAllocated < nbChar) //line longer than buffer, resize buffer
|
if (_maxNbCharAllocated < nbChar) //line longer than buffer, resize buffer
|
||||||
{
|
{
|
||||||
isRealloc = true;
|
isRealloc = true;
|
||||||
_maxNbCharAllocated = nbChar;
|
_maxNbCharAllocated = nbChar;
|
||||||
delete [] _line;
|
delete [] _line;
|
||||||
@ -1149,52 +1144,57 @@ int FindReplaceDlg::processAll(ProcessOperation op, const char *txt2find, const
|
|||||||
|
|
||||||
startPosition = posFind + foundTextLen;
|
startPosition = posFind + foundTextLen;
|
||||||
break; }
|
break; }
|
||||||
|
|
||||||
case ProcessReplaceAll: {
|
case ProcessReplaceAll: {
|
||||||
(*_ppEditView)->execute(SCI_SETTARGETSTART, start);
|
(*_ppEditView)->execute(SCI_SETTARGETSTART, start);
|
||||||
(*_ppEditView)->execute(SCI_SETTARGETEND, end);
|
(*_ppEditView)->execute(SCI_SETTARGETEND, end);
|
||||||
int replacedLength = (*_ppEditView)->execute(isRegExp?SCI_REPLACETARGETRE:SCI_REPLACETARGET, (WPARAM)stringSizeReplace, (LPARAM)pTextReplace);
|
int replacedLength = (*_ppEditView)->execute(isRegExp?SCI_REPLACETARGETRE:SCI_REPLACETARGET, (WPARAM)stringSizeReplace, (LPARAM)pTextReplace);
|
||||||
|
|
||||||
startPosition = (direction == DIR_UP)?posFind - replacedLength:posFind + replacedLength;
|
startPosition = (direction == DIR_UP)?posFind - replacedLength:posFind + replacedLength;
|
||||||
if ((_isInSelection) && (!isEntire))
|
if ((_isInSelection) && (!isEntire))
|
||||||
{
|
{
|
||||||
endPosition = endPosition - foundTextLen + replacedLength;
|
endPosition = endPosition - foundTextLen + replacedLength;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (direction == DIR_DOWN)
|
if (direction == DIR_DOWN)
|
||||||
endPosition = docLength = docLength - foundTextLen + replacedLength;
|
endPosition = docLength = docLength - foundTextLen + replacedLength;
|
||||||
}
|
}
|
||||||
break; }
|
break; }
|
||||||
|
|
||||||
case ProcessMarkAll: {
|
case ProcessMarkAll: {
|
||||||
if (_doStyleFoundToken)
|
if (_doStyleFoundToken)
|
||||||
{
|
{
|
||||||
(*_ppEditView)->execute(SCI_SETINDICATORCURRENT, SCE_UNIVERSAL_FOUND_STYLE);
|
(*_ppEditView)->execute(SCI_SETINDICATORCURRENT, SCE_UNIVERSAL_FOUND_STYLE);
|
||||||
(*_ppEditView)->execute(SCI_INDICATORFILLRANGE, start, end - start);
|
(*_ppEditView)->execute(SCI_INDICATORFILLRANGE, start, end - start);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_doMarkLine)
|
if (_doMarkLine)
|
||||||
{
|
{
|
||||||
int lineNumber = (*_ppEditView)->execute(SCI_LINEFROMPOSITION, posFind);
|
int lineNumber = (*_ppEditView)->execute(SCI_LINEFROMPOSITION, posFind);
|
||||||
int state = (*_ppEditView)->execute(SCI_MARKERGET, lineNumber);
|
int state = (*_ppEditView)->execute(SCI_MARKERGET, lineNumber);
|
||||||
|
|
||||||
if (!(state & (1 << MARK_BOOKMARK)))
|
if (!(state & (1 << MARK_BOOKMARK)))
|
||||||
(*_ppEditView)->execute(SCI_MARKERADD, lineNumber, MARK_BOOKMARK);
|
(*_ppEditView)->execute(SCI_MARKERADD, lineNumber, MARK_BOOKMARK);
|
||||||
}
|
}
|
||||||
startPosition = (direction == DIR_UP)?posFind - foundTextLen:posFind + foundTextLen;
|
startPosition = (direction == DIR_UP)?posFind - foundTextLen:posFind + foundTextLen;
|
||||||
break; }
|
break; }
|
||||||
|
|
||||||
case ProcessMarkAll_2: {
|
case ProcessMarkAll_2: {
|
||||||
(*_ppEditView)->execute(SCI_SETINDICATORCURRENT, SCE_UNIVERSAL_FOUND_STYLE_2);
|
(*_ppEditView)->execute(SCI_SETINDICATORCURRENT, SCE_UNIVERSAL_FOUND_STYLE_2);
|
||||||
(*_ppEditView)->execute(SCI_INDICATORFILLRANGE, start, end - start);
|
(*_ppEditView)->execute(SCI_INDICATORFILLRANGE, start, end - start);
|
||||||
|
|
||||||
startPosition = (direction == DIR_UP)?posFind - foundTextLen:posFind + foundTextLen;
|
startPosition = (direction == DIR_UP)?posFind - foundTextLen:posFind + foundTextLen;
|
||||||
break; }
|
break; }
|
||||||
|
|
||||||
case ProcessCountAll: {
|
case ProcessCountAll: {
|
||||||
startPosition = posFind + foundTextLen;
|
startPosition = posFind + foundTextLen;
|
||||||
break; }
|
break; }
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
delete [] pTextFind;
|
delete [] pTextFind;
|
||||||
delete [] pTextReplace;
|
delete [] pTextReplace;
|
||||||
return nbReplaced;
|
return nbReplaced;
|
||||||
break; }
|
break; }
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1377,13 +1377,6 @@ BOOL CALLBACK Finder::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
switch (message)
|
switch (message)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
case WM_INITDIALOG :
|
|
||||||
{
|
|
||||||
goToCenter();
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
case WM_COMMAND :
|
case WM_COMMAND :
|
||||||
{
|
{
|
||||||
switch (wParam)
|
switch (wParam)
|
||||||
@ -1460,6 +1453,7 @@ void FindIncrementDlg::display(bool toShow) const {
|
|||||||
::SetFocus(::GetDlgItem(_hSelf, IDC_INCFINDTEXT));
|
::SetFocus(::GetDlgItem(_hSelf, IDC_INCFINDTEXT));
|
||||||
_pRebar->setIDVisible(_rbBand.wID, toShow);
|
_pRebar->setIDVisible(_rbBand.wID, toShow);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
BOOL CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
switch (message)
|
switch (message)
|
||||||
|
@ -75,7 +75,11 @@ class Searching {
|
|||||||
public:
|
public:
|
||||||
static int convertExtendedToString(const char * query, char * result, int length);
|
static int convertExtendedToString(const char * query, char * result, int length);
|
||||||
static TargetRange t;
|
static TargetRange t;
|
||||||
static int buildSearchFlags(FindOption * option);
|
static int buildSearchFlags(FindOption * option) {
|
||||||
|
return (option->_isWholeWord ? SCFIND_WHOLEWORD : 0) |
|
||||||
|
(option->_isMatchCase ? SCFIND_MATCHCASE : 0) |
|
||||||
|
(option->_searchType == FindRegex ? SCFIND_REGEXP|SCFIND_POSIX : 0);
|
||||||
|
};
|
||||||
private:
|
private:
|
||||||
static bool readBase(const char * string, int * value, int base, int size);
|
static bool readBase(const char * string, int * value, int base, int size);
|
||||||
|
|
||||||
|
@ -159,15 +159,7 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
|
|||||||
|
|
||||||
case WM_MOUSEHWHEEL :
|
case WM_MOUSEHWHEEL :
|
||||||
{
|
{
|
||||||
if ((short)HIWORD(wParam) > 0)
|
::CallWindowProc(_scintillaDefaultProc, hwnd, WM_HSCROLL, ((short)HIWORD(wParam) > 0)?SB_LINERIGHT:SB_LINELEFT, NULL);
|
||||||
{
|
|
||||||
//if (execute(SCI_GETXOFFSET) < 10)
|
|
||||||
::CallWindowProc(_scintillaDefaultProc, hwnd, WM_HSCROLL, SB_LINERIGHT, NULL);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
::CallWindowProc(_scintillaDefaultProc, hwnd, WM_HSCROLL, SB_LINELEFT, NULL);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,15 +173,12 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
|
|||||||
|
|
||||||
//Have to perform the scroll first, because the first/last line do not get updated untill after the scroll has been parsed
|
//Have to perform the scroll first, because the first/last line do not get updated untill after the scroll has been parsed
|
||||||
LRESULT scrollResult = ::CallWindowProc(_scintillaDefaultProc, hwnd, Message, wParam, lParam);
|
LRESULT scrollResult = ::CallWindowProc(_scintillaDefaultProc, hwnd, Message, wParam, lParam);
|
||||||
//recalcHorizontalScrollbar();
|
|
||||||
return scrollResult;
|
return scrollResult;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_VSCROLL :
|
case WM_VSCROLL :
|
||||||
{
|
{
|
||||||
//if (LOWORD(wParam) == SB_ENDSCROLL)
|
|
||||||
//recalcHorizontalScrollbar();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -198,7 +187,6 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
|
|||||||
|
|
||||||
void ScintillaEditView::setSpecialIndicator(Style & styleToSet)
|
void ScintillaEditView::setSpecialIndicator(Style & styleToSet)
|
||||||
{
|
{
|
||||||
//execute(SCI_INDICSETSTYLE, styleToSet._styleID, INDIC_ROUNDBOX);
|
|
||||||
execute(SCI_INDICSETFORE, styleToSet._styleID, styleToSet._bgColor);
|
execute(SCI_INDICSETFORE, styleToSet._styleID, styleToSet._bgColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ void DockingCont::doDialog(bool willBeShown, bool isFloating)
|
|||||||
|
|
||||||
_isFloating = isFloating;
|
_isFloating = isFloating;
|
||||||
|
|
||||||
if (_isFloating == true)
|
if (_isFloating)
|
||||||
{
|
{
|
||||||
::SetWindowLong(_hSelf, GWL_STYLE, POPUP_STYLES);
|
::SetWindowLong(_hSelf, GWL_STYLE, POPUP_STYLES);
|
||||||
::SetWindowLong(_hSelf, GWL_EXSTYLE, POPUP_EXSTYLES);
|
::SetWindowLong(_hSelf, GWL_EXSTYLE, POPUP_EXSTYLES);
|
||||||
@ -109,24 +109,8 @@ void DockingCont::doDialog(bool willBeShown, bool isFloating)
|
|||||||
::ShowWindow(_hCaption, SW_SHOW);
|
::ShowWindow(_hCaption, SW_SHOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
//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
|
//If you want defualt GUI font
|
||||||
_hFont = (HFONT)GetStockObject(DEFAULT_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);
|
display(willBeShown);
|
||||||
@ -144,7 +128,7 @@ tTbData* DockingCont::createToolbar(tTbData data, Window **ppWin)
|
|||||||
::SetWindowLong(pTbData->hClient, GWL_EXSTYLE, CHILD_EXSTYLES);
|
::SetWindowLong(pTbData->hClient, GWL_EXSTYLE, CHILD_EXSTYLES);
|
||||||
|
|
||||||
/* restore position if plugin is in floating state */
|
/* restore position if plugin is in floating state */
|
||||||
if ((_isFloating == true) && (::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0) == 0))
|
if ((_isFloating) && (::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0) == 0))
|
||||||
{
|
{
|
||||||
reSizeToWH(pTbData->rcFloat);
|
reSizeToWH(pTbData->rcFloat);
|
||||||
}
|
}
|
||||||
@ -1206,7 +1190,7 @@ INT DockingCont::hideToolbar(tTbData *pTbData, BOOL hideClient)
|
|||||||
this->doDialog(false);
|
this->doDialog(false);
|
||||||
|
|
||||||
/* send message to docking manager for resize */
|
/* send message to docking manager for resize */
|
||||||
if (_isFloating == false)
|
if (!_isFloating)
|
||||||
{
|
{
|
||||||
::SendMessage(_hParent, WM_SIZE, 0, 0);
|
::SendMessage(_hParent, WM_SIZE, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -60,29 +60,15 @@ class DockingCont : public StaticDialog
|
|||||||
public:
|
public:
|
||||||
DockingCont();
|
DockingCont();
|
||||||
~DockingCont();
|
~DockingCont();
|
||||||
|
|
||||||
void init(HINSTANCE hInst, HWND hWnd) {
|
|
||||||
Window::init(hInst, hWnd);
|
|
||||||
};
|
|
||||||
|
|
||||||
HWND getTabWnd(void) {
|
HWND getTabWnd(void) {
|
||||||
HWND hRet = NULL;
|
return _hContTab;
|
||||||
if (isCreated())
|
|
||||||
hRet = _hContTab;
|
|
||||||
|
|
||||||
return hRet;
|
|
||||||
};
|
};
|
||||||
HWND getCaptionWnd(void) {
|
HWND getCaptionWnd(void) {
|
||||||
HWND hRet = NULL;
|
if (_isFloating == false)
|
||||||
if (isCreated())
|
return _hCaption;
|
||||||
{
|
else
|
||||||
if (_isFloating == false)
|
return _hSelf;
|
||||||
hRet = _hCaption;
|
|
||||||
else
|
|
||||||
hRet = _hSelf;
|
|
||||||
}
|
|
||||||
|
|
||||||
return hRet;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
tTbData* createToolbar(tTbData data, Window **ppWin);
|
tTbData* createToolbar(tTbData data, Window **ppWin);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "dockingResource.h"
|
#include "dockingResource.h"
|
||||||
|
|
||||||
IDD_CONTAINER_DLG DIALOGEX 0, 0, 186, 103
|
IDD_CONTAINER_DLG DIALOGEX 0, 0, 0, 0//186, 103
|
||||||
STYLE DS_SETFONT | DS_SETFOREGROUND | WS_MAXIMIZEBOX | WS_POPUP |
|
STYLE DS_SETFONT | DS_SETFOREGROUND | WS_MAXIMIZEBOX | WS_POPUP |
|
||||||
WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
||||||
EXSTYLE WS_EX_TOOLWINDOW
|
EXSTYLE WS_EX_TOOLWINDOW
|
||||||
|
@ -351,26 +351,28 @@ void DockingManager::onSize()
|
|||||||
|
|
||||||
void DockingManager::reSizeTo(RECT & rc)
|
void DockingManager::reSizeTo(RECT & rc)
|
||||||
{
|
{
|
||||||
/* store current size of client area */
|
// store current size of client area
|
||||||
_rect = rc;
|
_rect = rc;
|
||||||
|
|
||||||
/* prepare size of work area */
|
// prepare size of work area
|
||||||
_rcWork = rc;
|
_rcWork = rc;
|
||||||
|
|
||||||
if (_isInitialized == FALSE)
|
if (_isInitialized == FALSE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* set top container */
|
// set top container
|
||||||
_dockData.rcRegion[CONT_TOP].left = rc.left;
|
_dockData.rcRegion[CONT_TOP].left = rc.left;
|
||||||
_dockData.rcRegion[CONT_TOP].top = rc.top;
|
_dockData.rcRegion[CONT_TOP].top = rc.top;
|
||||||
_dockData.rcRegion[CONT_TOP].right = rc.right-rc.left;
|
_dockData.rcRegion[CONT_TOP].right = rc.right-rc.left;
|
||||||
|
|
||||||
_vSplitter[CONT_TOP]->display(false);
|
_vSplitter[CONT_TOP]->display(false);
|
||||||
|
|
||||||
if (_vContainer[CONT_TOP]->isVisible())
|
if (_vContainer[CONT_TOP]->isVisible())
|
||||||
{
|
{
|
||||||
_rcWork.top += _dockData.rcRegion[CONT_TOP].bottom + SPLITTER_WIDTH;
|
_rcWork.top += _dockData.rcRegion[CONT_TOP].bottom + SPLITTER_WIDTH;
|
||||||
_rcWork.bottom -= _dockData.rcRegion[CONT_TOP].bottom + SPLITTER_WIDTH;
|
_rcWork.bottom -= _dockData.rcRegion[CONT_TOP].bottom + SPLITTER_WIDTH;
|
||||||
|
|
||||||
/* set size of splitter */
|
// set size of splitter
|
||||||
RECT rc = {_dockData.rcRegion[CONT_TOP].left ,
|
RECT rc = {_dockData.rcRegion[CONT_TOP].left ,
|
||||||
_dockData.rcRegion[CONT_TOP].top + _dockData.rcRegion[CONT_TOP].bottom,
|
_dockData.rcRegion[CONT_TOP].top + _dockData.rcRegion[CONT_TOP].bottom,
|
||||||
_dockData.rcRegion[CONT_TOP].right ,
|
_dockData.rcRegion[CONT_TOP].right ,
|
||||||
@ -378,20 +380,21 @@ void DockingManager::reSizeTo(RECT & rc)
|
|||||||
_vSplitter[CONT_TOP]->reSizeTo(rc);
|
_vSplitter[CONT_TOP]->reSizeTo(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set bottom container */
|
// set bottom container
|
||||||
_dockData.rcRegion[CONT_BOTTOM].left = rc.left;
|
_dockData.rcRegion[CONT_BOTTOM].left = rc.left;
|
||||||
_dockData.rcRegion[CONT_BOTTOM].top = rc.top + rc.bottom - _dockData.rcRegion[CONT_BOTTOM].bottom;
|
_dockData.rcRegion[CONT_BOTTOM].top = rc.top + rc.bottom - _dockData.rcRegion[CONT_BOTTOM].bottom;
|
||||||
_dockData.rcRegion[CONT_BOTTOM].right = rc.right-rc.left;
|
_dockData.rcRegion[CONT_BOTTOM].right = rc.right-rc.left;
|
||||||
|
|
||||||
/* create temporary rect for bottom container */
|
// create temporary rect for bottom container
|
||||||
RECT rcBottom = _dockData.rcRegion[CONT_BOTTOM];
|
RECT rcBottom = _dockData.rcRegion[CONT_BOTTOM];
|
||||||
|
|
||||||
_vSplitter[CONT_BOTTOM]->display(false);
|
_vSplitter[CONT_BOTTOM]->display(false);
|
||||||
|
|
||||||
if (_vContainer[CONT_BOTTOM]->isVisible())
|
if (_vContainer[CONT_BOTTOM]->isVisible())
|
||||||
{
|
{
|
||||||
_rcWork.bottom -= _dockData.rcRegion[CONT_BOTTOM].bottom + SPLITTER_WIDTH;
|
_rcWork.bottom -= _dockData.rcRegion[CONT_BOTTOM].bottom + SPLITTER_WIDTH;
|
||||||
|
|
||||||
/* correct the visibility of bottom container when height is NULL */
|
// correct the visibility of bottom container when height is NULL
|
||||||
if (_rcWork.bottom < rc.top)
|
if (_rcWork.bottom < rc.top)
|
||||||
{
|
{
|
||||||
rcBottom.top = _rcWork.top + rc.top + SPLITTER_WIDTH;
|
rcBottom.top = _rcWork.top + rc.top + SPLITTER_WIDTH;
|
||||||
@ -403,7 +406,7 @@ void DockingManager::reSizeTo(RECT & rc)
|
|||||||
_rcWork.bottom = rc.bottom - _dockData.rcRegion[CONT_TOP].bottom;
|
_rcWork.bottom = rc.bottom - _dockData.rcRegion[CONT_TOP].bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set size of splitter */
|
// set size of splitter
|
||||||
RECT rc = {rcBottom.left,
|
RECT rc = {rcBottom.left,
|
||||||
rcBottom.top - SPLITTER_WIDTH,
|
rcBottom.top - SPLITTER_WIDTH,
|
||||||
rcBottom.right,
|
rcBottom.right,
|
||||||
@ -411,17 +414,19 @@ void DockingManager::reSizeTo(RECT & rc)
|
|||||||
_vSplitter[CONT_BOTTOM]->reSizeTo(rc);
|
_vSplitter[CONT_BOTTOM]->reSizeTo(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set left container */
|
// set left container
|
||||||
_dockData.rcRegion[CONT_LEFT].left = rc.left;
|
_dockData.rcRegion[CONT_LEFT].left = rc.left;
|
||||||
_dockData.rcRegion[CONT_LEFT].top = _rcWork.top;
|
_dockData.rcRegion[CONT_LEFT].top = _rcWork.top;
|
||||||
_dockData.rcRegion[CONT_LEFT].bottom = _rcWork.bottom;
|
_dockData.rcRegion[CONT_LEFT].bottom = _rcWork.bottom;
|
||||||
|
|
||||||
_vSplitter[CONT_LEFT]->display(false);
|
_vSplitter[CONT_LEFT]->display(false);
|
||||||
|
|
||||||
if (_vContainer[CONT_LEFT]->isVisible())
|
if (_vContainer[CONT_LEFT]->isVisible())
|
||||||
{
|
{
|
||||||
_rcWork.left += _dockData.rcRegion[CONT_LEFT].right + SPLITTER_WIDTH;
|
_rcWork.left += _dockData.rcRegion[CONT_LEFT].right + SPLITTER_WIDTH;
|
||||||
_rcWork.right -= _dockData.rcRegion[CONT_LEFT].right + SPLITTER_WIDTH;
|
_rcWork.right -= _dockData.rcRegion[CONT_LEFT].right + SPLITTER_WIDTH;
|
||||||
|
|
||||||
/* set size of splitter */
|
// set size of splitter
|
||||||
RECT rc = {_dockData.rcRegion[CONT_LEFT].right,
|
RECT rc = {_dockData.rcRegion[CONT_LEFT].right,
|
||||||
_dockData.rcRegion[CONT_LEFT].top,
|
_dockData.rcRegion[CONT_LEFT].top,
|
||||||
SPLITTER_WIDTH,
|
SPLITTER_WIDTH,
|
||||||
@ -429,12 +434,12 @@ void DockingManager::reSizeTo(RECT & rc)
|
|||||||
_vSplitter[CONT_LEFT]->reSizeTo(rc);
|
_vSplitter[CONT_LEFT]->reSizeTo(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set right container */
|
// set right container
|
||||||
_dockData.rcRegion[CONT_RIGHT].left = rc.right - _dockData.rcRegion[CONT_RIGHT].right;
|
_dockData.rcRegion[CONT_RIGHT].left = rc.right - _dockData.rcRegion[CONT_RIGHT].right;
|
||||||
_dockData.rcRegion[CONT_RIGHT].top = _rcWork.top;
|
_dockData.rcRegion[CONT_RIGHT].top = _rcWork.top;
|
||||||
_dockData.rcRegion[CONT_RIGHT].bottom = _rcWork.bottom;
|
_dockData.rcRegion[CONT_RIGHT].bottom = _rcWork.bottom;
|
||||||
|
|
||||||
/* create temporary rect for right container */
|
// create temporary rect for right container
|
||||||
RECT rcRight = _dockData.rcRegion[CONT_RIGHT];
|
RECT rcRight = _dockData.rcRegion[CONT_RIGHT];
|
||||||
|
|
||||||
_vSplitter[CONT_RIGHT]->display(false);
|
_vSplitter[CONT_RIGHT]->display(false);
|
||||||
@ -442,7 +447,7 @@ void DockingManager::reSizeTo(RECT & rc)
|
|||||||
{
|
{
|
||||||
_rcWork.right -= _dockData.rcRegion[CONT_RIGHT].right + SPLITTER_WIDTH;
|
_rcWork.right -= _dockData.rcRegion[CONT_RIGHT].right + SPLITTER_WIDTH;
|
||||||
|
|
||||||
/* correct the visibility of right container when width is NULL */
|
// correct the visibility of right container when width is NULL
|
||||||
if (_rcWork.right < 15)
|
if (_rcWork.right < 15)
|
||||||
{
|
{
|
||||||
rcRight.left = _rcWork.left + 15 + SPLITTER_WIDTH;
|
rcRight.left = _rcWork.left + 15 + SPLITTER_WIDTH;
|
||||||
@ -450,7 +455,7 @@ void DockingManager::reSizeTo(RECT & rc)
|
|||||||
_rcWork.right = 15;
|
_rcWork.right = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set size of splitter */
|
// set size of splitter
|
||||||
RECT rc = {rcRight.left - SPLITTER_WIDTH,
|
RECT rc = {rcRight.left - SPLITTER_WIDTH,
|
||||||
rcRight.top,
|
rcRight.top,
|
||||||
SPLITTER_WIDTH,
|
SPLITTER_WIDTH,
|
||||||
@ -458,8 +463,7 @@ void DockingManager::reSizeTo(RECT & rc)
|
|||||||
_vSplitter[CONT_RIGHT]->reSizeTo(rc);
|
_vSplitter[CONT_RIGHT]->reSizeTo(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set window positions of container
|
||||||
/* set window positions of container*/
|
|
||||||
if (_vContainer[CONT_BOTTOM]->isVisible())
|
if (_vContainer[CONT_BOTTOM]->isVisible())
|
||||||
{
|
{
|
||||||
::SetWindowPos(_vContainer[CONT_BOTTOM]->getHSelf(), NULL,
|
::SetWindowPos(_vContainer[CONT_BOTTOM]->getHSelf(), NULL,
|
||||||
@ -503,7 +507,6 @@ void DockingManager::reSizeTo(RECT & rc)
|
|||||||
SWP_NOZORDER);
|
SWP_NOZORDER);
|
||||||
_vSplitter[CONT_LEFT]->display();
|
_vSplitter[CONT_LEFT]->display();
|
||||||
}
|
}
|
||||||
|
|
||||||
(*_ppMainWindow)->reSizeTo(_rcWork);
|
(*_ppMainWindow)->reSizeTo(_rcWork);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -548,8 +548,6 @@ void Gripper::drawRectangle(POINT pt)
|
|||||||
{
|
{
|
||||||
HANDLE hbrushOrig = NULL;
|
HANDLE hbrushOrig = NULL;
|
||||||
RECT rc = {0};
|
RECT rc = {0};
|
||||||
//BOOL isRcTab = FALSE;
|
|
||||||
//RECT rcTab = {0};
|
|
||||||
|
|
||||||
if (!_hdc)
|
if (!_hdc)
|
||||||
_hdc = ::GetDC(NULL);
|
_hdc = ::GetDC(NULL);
|
||||||
@ -677,13 +675,13 @@ DockingCont* Gripper::contHitTest(POINT pt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* test only tabs that are visible */
|
/* test only tabs that are visible */
|
||||||
if (::IsWindowVisible(vCont[iCont]->getTabWnd()) == TRUE)
|
if (::IsWindowVisible(vCont[iCont]->getTabWnd()))
|
||||||
{
|
{
|
||||||
/* test if within tab (rect test is used, because of drag and drop behaviour) */
|
/* test if within tab (rect test is used, because of drag and drop behaviour) */
|
||||||
RECT rc = {0};
|
RECT rc = {0};
|
||||||
|
|
||||||
::GetWindowRect(vCont[iCont]->getTabWnd(), &rc);
|
::GetWindowRect(vCont[iCont]->getTabWnd(), &rc);
|
||||||
if (::PtInRect(&rc, pt) == TRUE)
|
if (::PtInRect(&rc, pt))
|
||||||
{
|
{
|
||||||
return vCont[iCont];
|
return vCont[iCont];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user