mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-25 23:05:13 +02:00
[BUG_FIXED] Fix shorcut mapper crash bug.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@527 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
d37b20de07
commit
a371d017c1
@ -360,6 +360,7 @@ void DisplayColumn(HWND hWnd,int SI,int c,int offset,HFONT hfont,HFONT hcolumnhe
|
|||||||
RECT rect,rectsave;
|
RECT rect,rectsave;
|
||||||
HFONT holdfont;
|
HFONT holdfont;
|
||||||
int r;
|
int r;
|
||||||
|
TCHAR buffer[1000];
|
||||||
int iDataType,iProtection;
|
int iDataType,iProtection;
|
||||||
if(BGHS[SI].columnwidths[c]==0){return;}
|
if(BGHS[SI].columnwidths[c]==0){return;}
|
||||||
|
|
||||||
@ -413,8 +414,8 @@ void DisplayColumn(HWND hWnd,int SI,int c,int offset,HFONT hfont,HFONT hcolumnhe
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetCell(&BGcell,r,c);
|
SetCell(&BGcell,r,c);
|
||||||
generic_string buffer = TEXT("");
|
lstrcpy(buffer, TEXT(""));
|
||||||
SendMessage(hWnd,BGM_GETCELLDATA,(WPARAM)&BGcell,(LPARAM)buffer.c_str());
|
SendMessage(hWnd,BGM_GETCELLDATA,(WPARAM)&BGcell,(LPARAM)buffer);
|
||||||
if(BGHS[SI].COLUMNSNUMBERED)
|
if(BGHS[SI].COLUMNSNUMBERED)
|
||||||
{
|
{
|
||||||
if(c>0)
|
if(c>0)
|
||||||
@ -425,14 +426,12 @@ void DisplayColumn(HWND hWnd,int SI,int c,int offset,HFONT hfont,HFONT hcolumnhe
|
|||||||
if(high == 0){high = 32;}else{high+=64;}
|
if(high == 0){high = 32;}else{high+=64;}
|
||||||
if(low == 0){low=26;}
|
if(low == 0){low=26;}
|
||||||
low += 64;
|
low += 64;
|
||||||
TCHAR info[64];
|
wsprintf(buffer, TEXT("%c%c"), high,low);
|
||||||
wsprintf(info, TEXT("%c%c"), high,low);
|
|
||||||
buffer = info;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rectsave=rect;
|
rectsave=rect;
|
||||||
DrawEdge(gdc,&rect,EDGE_ETCHED,BF_MIDDLE|BF_RECT|BF_ADJUST);
|
DrawEdge(gdc,&rect,EDGE_ETCHED,BF_MIDDLE|BF_RECT|BF_ADJUST);
|
||||||
DrawTextEx(gdc,(LPTSTR)buffer.c_str(),-1,&rect,DT_END_ELLIPSIS|DT_CENTER|DT_WORDBREAK|DT_NOPREFIX,NULL);
|
DrawTextEx(gdc,buffer,-1,&rect,DT_END_ELLIPSIS|DT_CENTER|DT_WORDBREAK|DT_NOPREFIX,NULL);
|
||||||
rect=rectsave;
|
rect=rectsave;
|
||||||
|
|
||||||
r=BGHS[SI].topvisiblerow;
|
r=BGHS[SI].topvisiblerow;
|
||||||
@ -462,13 +461,11 @@ void DisplayColumn(HWND hWnd,int SI,int c,int offset,HFONT hfont,HFONT hcolumnhe
|
|||||||
rect.bottom = rect.top + BGHS[SI].rowheight;
|
rect.bottom = rect.top + BGHS[SI].rowheight;
|
||||||
rectsave=rect;
|
rectsave=rect;
|
||||||
SetCell(&BGcell,r,c);
|
SetCell(&BGcell,r,c);
|
||||||
buffer = TEXT("");
|
lstrcpy(buffer, TEXT(""));
|
||||||
SendMessage(hWnd,BGM_GETCELLDATA,(WPARAM)&BGcell,(LPARAM)buffer.c_str());
|
SendMessage(hWnd,BGM_GETCELLDATA,(WPARAM)&BGcell,(LPARAM)buffer);
|
||||||
if((c==0)&&(BGHS[SI].ROWSNUMBERED))
|
if((c==0)&&(BGHS[SI].ROWSNUMBERED))
|
||||||
{
|
{
|
||||||
TCHAR info[64];
|
wsprintf(buffer, TEXT("%d"), r);
|
||||||
wsprintf(info, TEXT("%d"), r);
|
|
||||||
buffer = info;
|
|
||||||
}
|
}
|
||||||
if(c==0)
|
if(c==0)
|
||||||
{
|
{
|
||||||
@ -541,17 +538,17 @@ void DisplayColumn(HWND hWnd,int SI,int c,int offset,HFONT hfont,HFONT hcolumnhe
|
|||||||
{
|
{
|
||||||
if(BGHS[SI].ELLIPSIS)
|
if(BGHS[SI].ELLIPSIS)
|
||||||
{
|
{
|
||||||
DrawTextEx(gdc, (LPTSTR)buffer.c_str(),-1,&rect,DT_END_ELLIPSIS|DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX,NULL);
|
DrawTextEx(gdc,buffer,-1,&rect,DT_END_ELLIPSIS|DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX,NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DrawTextEx(gdc,(LPTSTR)buffer.c_str(),-1,&rect,DT_LEFT|DT_WORDBREAK|DT_EDITCONTROL|DT_NOPREFIX,NULL);
|
DrawTextEx(gdc,buffer,-1,&rect,DT_LEFT|DT_WORDBREAK|DT_EDITCONTROL|DT_NOPREFIX,NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(iDataType == 2)//NUMERIC
|
if(iDataType == 2)//NUMERIC
|
||||||
{
|
{
|
||||||
DrawTextEx(gdc,(LPTSTR)buffer.c_str(),-1,&rect,DT_END_ELLIPSIS|DT_RIGHT|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX,NULL);
|
DrawTextEx(gdc,buffer,-1,&rect,DT_END_ELLIPSIS|DT_RIGHT|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(iDataType == 3)//BOOLEAN TRUE
|
if(iDataType == 3)//BOOLEAN TRUE
|
||||||
@ -593,8 +590,8 @@ void DisplayColumn(HWND hWnd,int SI,int c,int offset,HFONT hfont,HFONT hcolumnhe
|
|||||||
if(iDataType == 5) //user drawn graphic
|
if(iDataType == 5) //user drawn graphic
|
||||||
{
|
{
|
||||||
WPARAM wParam;
|
WPARAM wParam;
|
||||||
buffer = TEXT(" ");
|
buffer[0]=0x20;
|
||||||
BGHS[SI].ownerdrawitem = generic_atoi(buffer.c_str());
|
BGHS[SI].ownerdrawitem = generic_atoi(buffer);
|
||||||
wParam=MAKEWPARAM((UINT)::GetMenu(hWnd),BGN_OWNERDRAW);
|
wParam=MAKEWPARAM((UINT)::GetMenu(hWnd),BGN_OWNERDRAW);
|
||||||
SendMessage(GetParent(hWnd),WM_COMMAND,wParam,(LPARAM)&rect);
|
SendMessage(GetParent(hWnd),WM_COMMAND,wParam,(LPARAM)&rect);
|
||||||
}
|
}
|
||||||
@ -627,9 +624,14 @@ void DisplayColumn(HWND hWnd,int SI,int c,int offset,HFONT hfont,HFONT hcolumnhe
|
|||||||
SelectObject(gdc,holdpen);
|
SelectObject(gdc,holdpen);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SelectObject(gdc,holdfont);
|
SelectObject(gdc,holdfont);
|
||||||
DeleteObject(holdfont);
|
DeleteObject(holdfont);
|
||||||
ReleaseDC(hWnd,gdc);
|
ReleaseDC(hWnd,gdc);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1540,7 +1540,6 @@ BOOL CALLBACK PrintSettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
|||||||
default :
|
default :
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user