mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
Multimonitor fixes: window resizing, MenuBar & PopUpTable positioning
git-svn-id: svn://ultimatepp.org/upp/trunk@1012 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
58480817ef
commit
8acbaa873b
7 changed files with 42 additions and 7 deletions
|
|
@ -1296,6 +1296,8 @@ public:
|
|||
static Rect GetVirtualScreenArea();
|
||||
static Rect GetPrimaryWorkArea();
|
||||
static Rect GetPrimaryScreenArea();
|
||||
static void GetWorkArea(Array<Rect>& rc);
|
||||
static Rect GetWorkArea(Point pt);
|
||||
static int GetKbdDelay();
|
||||
static int GetKbdSpeed();
|
||||
static bool IsAlphaSupported();
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ Size Ctrl::GetStdSize() const
|
|||
|
||||
Size Ctrl::GetMaxSize() const
|
||||
{
|
||||
return GetWorkArea().Size();
|
||||
return GetVirtualWorkArea().Size();
|
||||
}
|
||||
|
||||
void Ctrl::SyncLayout(int force)
|
||||
|
|
|
|||
|
|
@ -828,17 +828,35 @@ static BOOL CALLBACK sMonEnumProc(HMONITOR monitor, HDC hdc, LPRECT lprcMonitor,
|
|||
Zero(moninfo);
|
||||
moninfo.cbSize = sizeof(moninfo);
|
||||
MultiMon().GetMonitorInfo(monitor, &moninfo);
|
||||
*(Rect *)data |= Rect(moninfo.rcWork);
|
||||
((Array<Rect> *)data)->Add(Rect(moninfo.rcWork));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void Ctrl::GetWorkArea(Array<Rect>& rc)
|
||||
{
|
||||
MultiMon().EnumDisplayMonitors(NULL, NULL, &sMonEnumProc, (LPARAM)&rc);
|
||||
}
|
||||
|
||||
Rect Ctrl::GetVirtualWorkArea()
|
||||
{
|
||||
Rect out = GetPrimaryWorkArea();
|
||||
MultiMon().EnumDisplayMonitors(NULL, NULL, &sMonEnumProc, (LPARAM)&out);
|
||||
Array<Rect> rc;
|
||||
GetWorkArea(rc);
|
||||
for(int i = 0; i < rc.GetCount(); i++)
|
||||
out |= rc[i];
|
||||
return out;
|
||||
}
|
||||
|
||||
Rect Ctrl::GetWorkArea(Point pt)
|
||||
{
|
||||
Array<Rect> rc;
|
||||
GetWorkArea(rc);
|
||||
for(int i = 0; i < rc.GetCount(); i++)
|
||||
if(rc[i].Contains(pt))
|
||||
return rc[i];
|
||||
return GetPrimaryWorkArea();
|
||||
}
|
||||
|
||||
Rect Ctrl::GetVirtualScreenArea()
|
||||
{
|
||||
return RectC(GetSystemMetrics(SM_XVIRTUALSCREEN),
|
||||
|
|
|
|||
|
|
@ -417,11 +417,26 @@ Rect Ctrl::GetDefaultWindowRect()
|
|||
return RectC(pos + 20, pos + 20, cx, cy);
|
||||
}
|
||||
|
||||
void Ctrl::GetWorkArea(Array<Rect>& out)
|
||||
{
|
||||
out.Add(GetPrimaryWorkArea());
|
||||
}
|
||||
|
||||
Rect Ctrl::GetWorkArea() const
|
||||
{
|
||||
return GetPrimaryWorkArea();
|
||||
}
|
||||
|
||||
Rect Ctrl::GetWorkArea(Point pt)
|
||||
{
|
||||
Array<Rect> rc;
|
||||
GetWorkArea(rc);
|
||||
for(int i = 0; i < rc.GetCount(); i++)
|
||||
if(rc[i].Contains(pt))
|
||||
return rc[i];
|
||||
return GetPrimaryWorkArea();
|
||||
}
|
||||
|
||||
Rect Ctrl::GetVirtualWorkArea()
|
||||
{
|
||||
return GetPrimaryWorkArea();
|
||||
|
|
|
|||
|
|
@ -487,7 +487,7 @@ void MenuBar::PopUp(Ctrl *owner, Point p, Size rsz)
|
|||
szcy = false;
|
||||
WhenHelp = parentmenu->WhenHelp;
|
||||
}
|
||||
Rect r = GetWorkArea();
|
||||
Rect r = GetWorkArea(p);
|
||||
restorefocus = GetFocusCtrl();
|
||||
LLOG("PopUp " << UPP::Name(this) << " set restorefocus:" << UPP::Name(restorefocus));
|
||||
DistributeAccessKeys();
|
||||
|
|
@ -517,7 +517,7 @@ void MenuBar::PopUp(Ctrl *owner, Point p, Size rsz)
|
|||
}
|
||||
}
|
||||
if(p.x + sz.cx > r.right) {
|
||||
p.x = max(p.x + rsz.cx - sz.cx, 0);
|
||||
p.x = max(p.x + rsz.cx - sz.cx, r.left);
|
||||
szx = szcx;
|
||||
pane.LeftPos(0, sz.cx);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ void PopUpTable::PopUp(Ctrl *owner, int x, int top, int bottom, int width) {
|
|||
DoClose();
|
||||
int h = AddFrameSize(width, min(droplines * GetLineCy(), GetTotalCy())).cy;
|
||||
Rect rt = RectC(x, bottom, width, h);
|
||||
Rect area = Ctrl::GetWorkArea();
|
||||
Rect area = Ctrl::GetWorkArea(Point(x, top));
|
||||
bool up = false;
|
||||
if(rt.bottom > area.bottom) {
|
||||
up = true;
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
#define IDE_VERSION "902r182"
|
||||
#define IDE_VERSION "902r183"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue