From 7a3d8522b88158ecdb6169051e7e5dbea9a7127e Mon Sep 17 00:00:00 2001 From: koldo Date: Mon, 5 Dec 2016 09:19:34 +0000 Subject: [PATCH] *SysInfo_demo_gui: Some updates after U++ changes and luoganda report git-svn-id: svn://ultimatepp.org/upp/trunk@10517 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- bazaar/SysInfo_demo_gui/SysInfo_demo_gui.h | 1 + bazaar/SysInfo_demo_gui/SysInfo_demo_gui.lay | 1 + bazaar/SysInfo_demo_gui/main.cpp | 16 +++++++++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/bazaar/SysInfo_demo_gui/SysInfo_demo_gui.h b/bazaar/SysInfo_demo_gui/SysInfo_demo_gui.h index 09ef14eb7..436c18eb7 100644 --- a/bazaar/SysInfo_demo_gui/SysInfo_demo_gui.h +++ b/bazaar/SysInfo_demo_gui/SysInfo_demo_gui.h @@ -36,6 +36,7 @@ struct WindowsList_ : WithWindowsList { } void Fill(); void ButUpdate_Push(); + void ButTopmost_Push(); void MenuCallback(Bar &bar); void CbCopy(); }; diff --git a/bazaar/SysInfo_demo_gui/SysInfo_demo_gui.lay b/bazaar/SysInfo_demo_gui/SysInfo_demo_gui.lay index 5f7e7d612..539b6fc41 100644 --- a/bazaar/SysInfo_demo_gui/SysInfo_demo_gui.lay +++ b/bazaar/SysInfo_demo_gui/SysInfo_demo_gui.lay @@ -159,6 +159,7 @@ END_LAYOUT LAYOUT(WindowsList, 672, 120) ITEM(Label, dv___0, SetLabel(t_("Windows list")).SetFrame(ThinOutsetFrame()).HSizePosZ(0, 4).TopPosZ(0, 16)) ITEM(ArrayCtrl, Windows, HSizePosZ(0, 4).VSizePosZ(16, 36)) + ITEM(Button, ButTopmost, SetLabel(t_("Set Topmost")).LeftPosZ(104, 88).BottomPosZ(5, 23)) ITEM(Button, ButUpdate, SetLabel(t_("Update")).LeftPosZ(4, 88).BottomPosZ(5, 23)) END_LAYOUT diff --git a/bazaar/SysInfo_demo_gui/main.cpp b/bazaar/SysInfo_demo_gui/main.cpp index 0afc6d744..639b1815a 100644 --- a/bazaar/SysInfo_demo_gui/main.cpp +++ b/bazaar/SysInfo_demo_gui/main.cpp @@ -233,6 +233,7 @@ void SystemInfo::ButUpdate_Push() { Fill(); } + #if defined(PLATFORM_WIN32) || defined (PLATFORM_WIN64) #define SetBit(uIntFlagBuff, Bit) (uIntFlagBuff |= (Bit)) @@ -355,12 +356,21 @@ void WindowsList_::Fill() { } Windows.SetEditable(); ButUpdate.WhenPush = THISBACK(ButUpdate_Push); + ButTopmost.WhenPush = THISBACK(ButTopmost_Push); static MenuBar bar; //GetList().StdToolBar(bar); //bar(2).Remove();bar(1).Remove(); //GetList().WhenToolBar=THISBACK(cb); Windows.WhenBar = THISBACK(MenuCallback); } +void WindowsList_::ButTopmost_Push() { + int row = Windows.GetCursor(); + if (row < 0) + return; + int64 id = ScanInt64(String(Windows.Get(row, 1))); + Window_TopMost(id); +} + void WindowsList_::CbCopy() { String text; HeaderCtrl& header = Windows.HeaderObject(); @@ -462,11 +472,11 @@ void ScreenGrabTab::ButGrab_Push() { bool ret; if (~SwGrabMode == 0) - ret = Record_Desktop(EditFileNameGrab, EditTime, EditFrameRate, OpGrabMouse); + ret = Record_Desktop(~EditFileNameGrab, EditTime, EditFrameRate, OpGrabMouse); else if (~SwGrabMode == 1) - ret = Record_Window(EditFileNameGrab, EditTime, GetWindowIdFromCaption(EditWindowTitle, false), EditFrameRate, OpGrabMouse); + ret = Record_Window(~EditFileNameGrab, EditTime, GetWindowIdFromCaption(~EditWindowTitle, false), EditFrameRate, OpGrabMouse); else if (~SwGrabMode == 2) - ret = Record_DesktopRectangle(EditFileNameGrab, EditTime, EditLeft, EditTop, EditWidth, EditHeight, EditFrameRate, OpGrabMouse); + ret = Record_DesktopRectangle(~EditFileNameGrab, EditTime, EditLeft, EditTop, EditWidth, EditHeight, EditFrameRate, OpGrabMouse); else throw Exc("Unexpected value"); if (!ret)