From: <zou...@us...> - 2008-02-18 20:19:31
|
Revision: 1016 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1016&view=rev Author: zouzou123gen Date: 2008-02-18 12:19:27 -0800 (Mon, 18 Feb 2008) Log Message: ----------- Fixed clicking on active tab Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp dcplusplus/trunk/win32/MainWindow.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2008-02-17 23:43:00 UTC (rev 1015) +++ dcplusplus/trunk/changelog.txt 2008-02-18 20:19:27 UTC (rev 1016) @@ -36,6 +36,7 @@ * Fixed a few hardcoded dc++'s (thanks steven sheehy) * Don't always show the tray icon after killing and re-opening explorer.exe (poy) * Updated links (thanks pietry) +* Fixed clicking on active tab (poy) -- 0.704 2007-12-14 -- * Hub lists added to utilize Coral's distributed network (ullner) Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h 2008-02-17 23:43:00 UTC (rev 1015) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h 2008-02-18 20:19:27 UTC (rev 1016) @@ -31,6 +31,8 @@ public: /// Fills with default parameters Seed(); + + bool toggleActive; }; void add(WidgetChildWindow* w, const IconPtr& icon); @@ -85,6 +87,8 @@ std::tr1::function<void (const SmartUtil::tstring&)> titleChangedFunction; + bool toggleActive; + bool inTab; typedef std::list<WidgetChildWindow*> WindowList; Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp 2008-02-17 23:43:00 UTC (rev 1015) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp 2008-02-18 20:19:27 UTC (rev 1016) @@ -7,7 +7,8 @@ WindowClass WidgetTabView::windowClass(_T("WidgetTabView"), &WidgetTabView::wndProc, NULL, ( HBRUSH )( COLOR_WINDOW + 1 )); WidgetTabView::Seed::Seed() : - Widget::Seed(windowClass.getClassName(), WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE) + Widget::Seed(windowClass.getClassName(), WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE), + toggleActive(false) { } @@ -15,6 +16,7 @@ PolicyType(w), tab(0), tip(0), + toggleActive(false), inTab(false), active(-1), dragging(-1) @@ -22,6 +24,7 @@ void WidgetTabView::create(const Seed & cs) { PolicyType::create(cs); + toggleActive = cs.toggleActive; WidgetTabSheet::Seed tcs; tcs.style = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE | @@ -311,8 +314,12 @@ } if(dropPos == dragging) { - // the tab hasn't moved; select it - setActive(dropPos); + // the tab hasn't moved; handle the click + if(dropPos == active) { + if(toggleActive) + next(); + } else + setActive(dropPos); dragging = -1; return; } Modified: dcplusplus/trunk/win32/MainWindow.cpp =================================================================== --- dcplusplus/trunk/win32/MainWindow.cpp 2008-02-17 23:43:00 UTC (rev 1015) +++ dcplusplus/trunk/win32/MainWindow.cpp 2008-02-18 20:19:27 UTC (rev 1016) @@ -309,6 +309,7 @@ void MainWindow::initTabs() { WidgetTabView::Seed cs; cs.style = WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE; + cs.toggleActive = BOOLSETTING(TOGGLE_ACTIVE_WINDOW); tabs = createTabView(cs); tabs->onTitleChanged(std::tr1::bind(&MainWindow::handleTabsTitleChanged, this, _1)); paned->setFirst(tabs); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |