From 4201622edd219c006e672e8b6df64b8ad7e3cdcb Mon Sep 17 00:00:00 2001 From: koldo Date: Fri, 2 Mar 2018 13:50:28 +0000 Subject: [PATCH] SysInfo_demo_gui: Updated namespaces and time callbacks git-svn-id: svn://ultimatepp.org/upp/trunk@11814 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- bazaar/SysInfo_demo_gui/SysInfo_demo_gui.h | 5 +++++ bazaar/SysInfo_demo_gui/main.cpp | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bazaar/SysInfo_demo_gui/SysInfo_demo_gui.h b/bazaar/SysInfo_demo_gui/SysInfo_demo_gui.h index 436c18eb7..627f6d71c 100644 --- a/bazaar/SysInfo_demo_gui/SysInfo_demo_gui.h +++ b/bazaar/SysInfo_demo_gui/SysInfo_demo_gui.h @@ -36,7 +36,9 @@ struct WindowsList_ : WithWindowsList { } void Fill(); void ButUpdate_Push(); +#if defined(PLATFORM_WIN32) void ButTopmost_Push(); +#endif void MenuCallback(Bar &bar); void CbCopy(); }; @@ -106,6 +108,9 @@ public: void TimerFun(); void Exit(); + +private: + TimeCallback timeCallback; }; diff --git a/bazaar/SysInfo_demo_gui/main.cpp b/bazaar/SysInfo_demo_gui/main.cpp index 639b1815a..0a1100b6c 100644 --- a/bazaar/SysInfo_demo_gui/main.cpp +++ b/bazaar/SysInfo_demo_gui/main.cpp @@ -40,7 +40,7 @@ void SpecialFolders::Fill() { const char *ext[] = {".html", ".doc", ".png", ".pdf", ".txt", ".xyz", ""}; for (int i = 0; *ext[i] != 0; ++i) DefaultExes.Add(ext[i], GetExtExecutable(ext[i])); -#if defined(PLATFORM_WIN32) +#if defined(PLATFORM_WIN32) ButInstalledSoftware.WhenPush = THISBACK(ButInstalledSoftware_Push); #else SoftwareInstalled.Enable(false); @@ -356,13 +356,18 @@ void WindowsList_::Fill() { } Windows.SetEditable(); ButUpdate.WhenPush = THISBACK(ButUpdate_Push); + #if defined(PLATFORM_WIN32) ButTopmost.WhenPush = THISBACK(ButTopmost_Push); + #else + ButTopmost.Disable(); + #endif static MenuBar bar; //GetList().StdToolBar(bar); //bar(2).Remove();bar(1).Remove(); //GetList().WhenToolBar=THISBACK(cb); Windows.WhenBar = THISBACK(MenuCallback); } +#if defined(PLATFORM_WIN32) void WindowsList_::ButTopmost_Push() { int row = Windows.GetCursor(); if (row < 0) @@ -370,6 +375,7 @@ void WindowsList_::ButTopmost_Push() { int64 id = ScanInt64(String(Windows.Get(row, 1))); Window_TopMost(id); } +#endif void WindowsList_::CbCopy() { String text; @@ -631,7 +637,7 @@ SysInfoDemo::SysInfoDemo() menu.Set(THISBACK(MainMenu)); menu.WhenHelp = info; - SetTimeCallback(-500, THISBACK(TimerFun)); + timeCallback.Set(-500, THISBACK(TimerFun)); Sizeable().Zoomable(); }