View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001406 | Plugins | EMenu | public | 2010-06-12 17:04 | 2010-07-07 06:44 |
Reporter | igor_yudincev | Assigned To | alexy | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | x86 | OS | Windows | OS Version | XP SP2 |
Product Version | 2.0 | ||||
Fixed in Version | 2.0 | ||||
Summary | 0001406: Плагин не работает с большим буфером консоли | ||||
Description | При расчёте координат меню не учитываются размеры видимого окна консоли. | ||||
Additional Information | Патч прилагается. | ||||
Tags | No tags attached. | ||||
|
build35.patch (2,279 bytes)
Index: EMenu.rc =================================================================== --- EMenu.rc (revision 4771) +++ EMenu.rc (working copy) @@ -2,7 +2,7 @@ #include <windows.h> #include "resource.h" -#define PLUGIN_BUILD 34 +#define PLUGIN_BUILD 35 #define PLUGIN_DESC "EMenu Plugin for FAR Manager" #define PLUGIN_NAME "EMenu" #define PLUGIN_FILENAME "EMenu.dll" Index: FarMenu.cpp =================================================================== --- FarMenu.cpp (revision 4771) +++ FarMenu.cpp (working copy) @@ -184,21 +184,42 @@ else { RECT rc; - CONSOLE_SCREEN_BUFFER_INFO csbi; - HANDLE hStdOutput=GetStdHandle(STD_OUTPUT_HANDLE); - if (!GetClientRect(hFarWnd, &rc) - || INVALID_HANDLE_VALUE==hStdOutput - || !GetConsoleScreenBufferInfo(hStdOutput, &csbi)) - { + if (!GetClientRect(hFarWnd, &rc)) assert(0); - } - else - { - if (pt.x>=rc.left && pt.x<=rc.right && pt.y>=rc.top && pt.y<=rc.bottom) + else { + bool success=false; + COORD console_size; +#ifndef UNICODE + CONSOLE_SCREEN_BUFFER_INFO csbi; + HANDLE hStdOutput=GetStdHandle(STD_OUTPUT_HANDLE); + if (INVALID_HANDLE_VALUE!=hStdOutput + && GetConsoleScreenBufferInfo(hStdOutput, &csbi)) { - *pnX=int(csbi.dwSize.X*pt.x/(rc.right-rc.left)); - *pnY=int(csbi.dwSize.Y*pt.y/(rc.bottom-rc.top)); + success=true; + console_size.X=csbi.dwSize.X; + console_size.Y=csbi.dwSize.Y; } +#else + SMALL_RECT console_rect; + if (thePlug->AdvControl(ACTL_GETFARRECT,(void*)&console_rect)) + { + success=true; + console_size.X=console_rect.Right-console_rect.Left+1; + console_size.Y=console_rect.Bottom-console_rect.Top+1; + } +#endif + if (!success) + { + assert(0); + } + else + { + if (pt.x>=rc.left && pt.x<=rc.right && pt.y>=rc.top && pt.y<=rc.bottom) + { + *pnX=int(console_size.X*pt.x/(rc.right-rc.left)); + *pnY=int(console_size.Y*pt.y/(rc.bottom-rc.top)); + } + } } } } |
|
>При расчёте координат меню не учитываются размеры видимого окна консоли А как увидеть проблему? |
|
> А как увидеть проблему? Настроить Menu position (•) At the mouse cursor, включить большой буфер консоли и вызвать диалог плагина. |
|
закомитил |
Date Modified | Username | Field | Change |
---|---|---|---|
2010-06-12 17:04 | igor_yudincev | New Issue | |
2010-06-12 17:04 | igor_yudincev | File Added: build35.patch | |
2010-06-12 18:35 | JohnDoe | Note Added: 0005478 | |
2010-06-12 19:00 | igor_yudincev | Note Added: 0005480 | |
2010-07-03 18:13 | alexy | Note Added: 0005551 | |
2010-07-03 18:13 | alexy | Assigned To | => alexy |
2010-07-03 18:13 | alexy | Status | new => feedback |
2010-07-06 22:29 | igor_yudincev | Status | feedback => resolved |
2010-07-07 06:44 | alexy | Status | resolved => closed |
2010-07-07 06:44 | alexy | Resolution | open => fixed |
2010-07-07 06:44 | alexy | Fixed in Version | => 2.0 |