From d05d4f02ce38d3ce4fabca0a95c58465fca7f451 Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 6 Apr 2013 15:24:08 +0000 Subject: [PATCH] CtrlCore: GetScreenSize deprecated, implemented using GetVirtualScreenArea git-svn-id: svn://ultimatepp.org/upp/trunk@5961 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlCore/CtrlCore.h | 5 +++-- uppsrc/CtrlCore/DrawX11.cpp | 5 ----- uppsrc/CtrlCore/UtilWin32.cpp | 5 ----- uppsrc/Geom/Ctrl/pathCtrl.cpp | 1 - uppsrc/GridCtrl/GridCtrl.cpp | 12 ++---------- uppsrc/ScatterCtrl/ScatterCtrl.cpp | 6 +++--- uppsrc/SqlCtrl/SqlConsole.cpp | 3 --- uppsrc/TCtrlLib/Help/DlgHelp.cpp | 1 - 8 files changed, 8 insertions(+), 30 deletions(-) diff --git a/uppsrc/CtrlCore/CtrlCore.h b/uppsrc/CtrlCore/CtrlCore.h index 376a13054..23dbb6cf0 100644 --- a/uppsrc/CtrlCore/CtrlCore.h +++ b/uppsrc/CtrlCore/CtrlCore.h @@ -45,8 +45,7 @@ struct GuiLock { ~GuiLock() { LeaveGuiMutex(); } }; -bool ScreenInPaletteMode(); -Size GetScreenSize(); +bool ScreenInPaletteMode(); // Deprecated typedef ImageDraw SystemImageDraw; @@ -1251,6 +1250,8 @@ public: virtual ~Ctrl(); }; +inline Size GetScreenSize() { return Ctrl::GetVirtualScreenArea().GetSize(); } // Deprecated + String GuiPlatformGetKeyDesc(dword key); bool GuiPlatformHasSizeGrip(); void GuiPlatformGripResize(TopWindow *q); diff --git a/uppsrc/CtrlCore/DrawX11.cpp b/uppsrc/CtrlCore/DrawX11.cpp index b34d64efc..5f9bdefa1 100644 --- a/uppsrc/CtrlCore/DrawX11.cpp +++ b/uppsrc/CtrlCore/DrawX11.cpp @@ -453,11 +453,6 @@ bool ScreenInPaletteMode() return Xpalette; } -Size GetScreenSize() -{ - return Size(Xwidth, Xheight); -} - END_UPP_NAMESPACE #endif diff --git a/uppsrc/CtrlCore/UtilWin32.cpp b/uppsrc/CtrlCore/UtilWin32.cpp index c183ce72b..324bcc193 100644 --- a/uppsrc/CtrlCore/UtilWin32.cpp +++ b/uppsrc/CtrlCore/UtilWin32.cpp @@ -11,11 +11,6 @@ bool ScreenInPaletteMode() return ScreenInfo().PaletteMode(); } -Size GetScreenSize() -{ - return ScreenInfo().GetPageSize(); -} - HRGN GetFrameRgn(const Rect& rect, int n) { HRGN rgn = CreateRectRgnIndirect(rect); Rect r = rect; diff --git a/uppsrc/Geom/Ctrl/pathCtrl.cpp b/uppsrc/Geom/Ctrl/pathCtrl.cpp index 3e0b615dd..e57804b4a 100644 --- a/uppsrc/Geom/Ctrl/pathCtrl.cpp +++ b/uppsrc/Geom/Ctrl/pathCtrl.cpp @@ -1630,7 +1630,6 @@ DlgPathEditor::DlgPathEditor() menu_bar.Set(THISBACK(ToolRoot)); tool_bar.Set(THISBACK(ToolRoot)); dialog << path.SizePos(); -// dialog.SetRect(CalcWindowRect(dialog, Ctrl::GetWorkStock.GetScreenSize() >> 1)); dialog.Sizeable().Zoomable(); dialog.SetMinSize(Size(300, 200)); path.WhenRescan = THISBACK(Rescan); diff --git a/uppsrc/GridCtrl/GridCtrl.cpp b/uppsrc/GridCtrl/GridCtrl.cpp index 802fb644d..e3aa9df59 100644 --- a/uppsrc/GridCtrl/GridCtrl.cpp +++ b/uppsrc/GridCtrl/GridCtrl.cpp @@ -2056,9 +2056,9 @@ void GridCtrl::SyncPopup() GetItemAttrs(it, r, c, vi, hi, popup.style, popup.gd, popup.fg, popup.bg, popup.fnt); popup.gd->row = r < fixed_rows ? -1 : r - fixed_rows; popup.gd->col = c < fixed_cols ? -1 : c - fixed_cols; - Size scrsz = GetScreenSize(); + Rect scr = GetWorkArea(); int margin = popup.gd->lm + popup.gd->rm; - int cx = min(600, min((int) (scrsz.cx * 0.4), max(it.rcx + margin + 2, hi.nsize + 1))); + int cx = min(600, min((int) (scr.right * 0.4), max(it.rcx + margin + 2, hi.nsize + 1))); int lines = popup.gd->GetLinesCount(cx - margin - 2, WString(val), popup.fnt, true); int cy = max(lines * Draw::GetStdFontCy() + popup.gd->tm + popup.gd->bm + 2, vi.nsize + 1); if(fr && r == 0) @@ -3402,7 +3402,6 @@ GridCtrl::CurState GridCtrl::SetCursor0(Point p, int opt, int dirx, int diry) bool hidden = true; bool clickable = true; - bool editable = true; bool group = true; if(cur) @@ -3413,7 +3412,6 @@ GridCtrl::CurState GridCtrl::SetCursor0(Point p, int opt, int dirx, int diry) bool hy = diry != 0 ? v.hidden : false; hidden = hx || hy; clickable = h.clickable && v.clickable; - editable = h.editable && v.editable; if(oit && oit->group >= 0 && !select_row) { nit = &GetItem(tmpcur); @@ -6051,9 +6049,6 @@ bool GridCtrl::Go0(int jump, bool scroll, bool goleft, bool ctrlmode) if(IsEmpty()) return false; - bool samerow = false; - bool doall = true; - if(!ready) { UpdateSizes(); @@ -6070,9 +6065,6 @@ bool GridCtrl::Go0(int jump, bool scroll, bool goleft, bool ctrlmode) sbx.Set(sbx.Get() + 5); return false; } - - samerow = true; - doall = false; } if(jump == GO_PREV) diff --git a/uppsrc/ScatterCtrl/ScatterCtrl.cpp b/uppsrc/ScatterCtrl/ScatterCtrl.cpp index e6b331d7f..1f245fe7e 100644 --- a/uppsrc/ScatterCtrl/ScatterCtrl.cpp +++ b/uppsrc/ScatterCtrl/ScatterCtrl.cpp @@ -206,11 +206,11 @@ void ScatterCtrl::LabelPopUp(bool down, Point &pt) if (IsNull(popLT)) popLT = pt; popRB = pt; - Size sz = GetScreenSize(); + Rect wa = GetWorkArea(); Rect rc = GetScreenRect(); - if (sz.cx - (rc.left + pt.x) < 200) + if (wa.right - (rc.left + pt.x) < 200) pt.x -= 200; - if (sz.cy - (rc.top + pt.y) < 200) + if (wa.bottom - (rc.top + pt.y) < 200) pt.y -= 200; ProcessPopUp(pt); } diff --git a/uppsrc/SqlCtrl/SqlConsole.cpp b/uppsrc/SqlCtrl/SqlConsole.cpp index 4cd4f75b7..6380bdad2 100644 --- a/uppsrc/SqlCtrl/SqlConsole.cpp +++ b/uppsrc/SqlCtrl/SqlConsole.cpp @@ -740,9 +740,6 @@ SqlConsole::SqlConsole(SqlSession& session) Add(schema.BottomPos(0, ecy).RightPos(0, 80)); schema.SetLabel(t_("&Schema")); schema <<= THISBACK(ObjectTree); -// hide = callback(this, &SqlConsole::Hide); -// Size sz = Stock.GetScreenSize(); -// SetRect((sz.cx - 600) / 2, (sz.cy - 400) / 2, 600, 400); ActiveFocus(command); } diff --git a/uppsrc/TCtrlLib/Help/DlgHelp.cpp b/uppsrc/TCtrlLib/Help/DlgHelp.cpp index 9009a3d3a..5fc79556e 100644 --- a/uppsrc/TCtrlLib/Help/DlgHelp.cpp +++ b/uppsrc/TCtrlLib/Help/DlgHelp.cpp @@ -603,7 +603,6 @@ DlgHelpEditor::DlgHelpEditor() HelpTopic("DlgHelpEditor"); WhenClose = THISBACK(OnFileClose); Sizeable().Zoomable(); -// CalcWindowRect(*this, (Stock.GetScreenSize() * 3) >> 2); AddFrame(menubar); AddFrame(toolbar); AddFrame(statusbar);