From: <arn...@us...> - 2007-07-23 22:10:48
|
Revision: 805 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=805&view=rev Author: arnetheduck Date: 2007-07-23 15:10:47 -0700 (Mon, 23 Jul 2007) Log Message: ----------- More compile fixes Modified Paths: -------------- dcplusplus/trunk/smartwin/include/smartwin/Application.h dcplusplus/trunk/smartwin/include/smartwin/SmartWin.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMDIChild.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenu.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetWindowBase.h dcplusplus/trunk/smartwin/source/Application.cpp dcplusplus/trunk/smartwin/source/Widget.cpp dcplusplus/trunk/smartwin/source/widgets/WidgetDialog.cpp dcplusplus/trunk/smartwin/source/widgets/WidgetMDIChild.cpp dcplusplus/trunk/smartwin/source/widgets/WidgetMDIParent.cpp dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp dcplusplus/trunk/smartwin/source/widgets/WidgetModalDialog.cpp Removed Paths: ------------- dcplusplus/trunk/smartwin/include/smartwin/Command.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zou...@us...> - 2007-11-30 18:30:30
|
Revision: 916 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=916&view=rev Author: zouzou123gen Date: 2007-11-30 10:30:26 -0800 (Fri, 30 Nov 2007) Log Message: ----------- WidgetTabView fixes (add & addWidget merged; active window check in WM_SETTEXT) Modified Paths: -------------- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h 2007-11-29 23:07:27 UTC (rev 915) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h 2007-11-30 18:30:26 UTC (rev 916) @@ -32,10 +32,7 @@ Seed(); }; - void add(WidgetChildWindow* w, const IconPtr& icon) { - addWidget(w, icon, w->getText(), w->getVisible()); - w->onTextChanging(std::tr1::bind(&WidgetTabView::handleTextChanging, this, w, _1)); - } + void add(WidgetChildWindow* w, const IconPtr& icon); void mark(WidgetChildWindow* w); @@ -109,7 +106,6 @@ void layout(); int addIcon(const IconPtr& icon); - void addWidget(WidgetChildWindow* w, const IconPtr& icon, const SmartUtil::tstring& title, bool visible); void swapWidgets(WidgetChildWindow* oldW, WidgetChildWindow* newW); }; Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp 2007-11-29 23:07:27 UTC (rev 915) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp 2007-11-30 18:30:26 UTC (rev 916) @@ -33,15 +33,15 @@ tab->onContextMenu(std::tr1::bind(&WidgetTabView::handleContextMenu, this, _1)); } -void WidgetTabView::addWidget(WidgetChildWindow* w, const IconPtr& icon, const SmartUtil::tstring& title, bool visible) { +void WidgetTabView::add(WidgetChildWindow* w, const IconPtr& icon) { int image = addIcon(icon); size_t tabs = tab->size(); TabInfo* ti = new TabInfo(w); - tab->addPage(cutTitle(title), tabs, reinterpret_cast<LPARAM>(ti), image); + tab->addPage(cutTitle(w->getText()), tabs, reinterpret_cast<LPARAM>(ti), image); viewOrder.push_front(w); - if(viewOrder.size() == 1 || visible) { + if(viewOrder.size() == 1 || w->getVisible()) { if(viewOrder.size() > 1) { swapWidgets(viewOrder.back(), w); } else { @@ -51,6 +51,8 @@ } layout(); + + w->onTextChanging(std::tr1::bind(&WidgetTabView::handleTextChanging, this, w, _1)); } WidgetChildWindow* WidgetTabView::getActive() { @@ -165,7 +167,7 @@ tab->setHeader(i, cutTitle(newText)); layout(); - if(titleChangedFunction) + if((i == active) && titleChangedFunction) titleChangedFunction(newText); } return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zou...@us...> - 2008-02-17 23:43:06
|
Revision: 1015 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1015&view=rev Author: zouzou123gen Date: 2008-02-17 15:43:00 -0800 (Sun, 17 Feb 2008) Log Message: ----------- continue previous revision's menu fix & fix tab tooltips Modified Paths: -------------- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h 2008-02-17 22:27:10 UTC (rev 1014) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h 2008-02-17 23:43:00 UTC (rev 1015) @@ -94,6 +94,7 @@ std::vector<IconPtr> icons; int active; int dragging; + SmartUtil::tstring tipText; int findTab(WidgetChildWindow* w); @@ -106,7 +107,7 @@ bool handleTextChanging(WidgetChildWindow* w, const SmartUtil::tstring& newText); bool handleSized(const WidgetSizedEventResult&); void handleTabSelected(); - LRESULT handleToolTip(WPARAM /*wParam*/, LPARAM lParam); + LRESULT handleToolTip(LPARAM lParam); void handleLeftMouseDown(const MouseEventResult& mouseEventResult); void handleLeftMouseUp(const MouseEventResult& mouseEventResult); bool handleContextMenu(SmartWin::ScreenCoordinate pt); Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp 2008-02-17 22:27:10 UTC (rev 1014) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp 2008-02-17 23:43:00 UTC (rev 1015) @@ -584,7 +584,7 @@ canvas.setTextColor( isGrayed ? ::GetSysColor( COLOR_GRAYTEXT ) : wrapper->isMenuTitleItem ? colorInfo.colorTitleText : data->TextColor ); // Select item font - FontPtr font((static_cast<int>(::GetMenuDefaultItem(wrapper->menu->handle(), TRUE, GMDI_USEDISABLED)) == wrapper->index) ? itsTitleFont : data->Font); + FontPtr font((static_cast<int>(::GetMenuDefaultItem(wrapper->menu->handle(), TRUE, GMDI_USEDISABLED)) == wrapper->index) ? wrapper->menu->itsTitleFont : data->Font); HGDIOBJ oldFont = ::SelectObject( canvas.handle(), font->handle() ); Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp 2008-02-17 22:27:10 UTC (rev 1014) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp 2008-02-17 23:43:00 UTC (rev 1015) @@ -38,7 +38,7 @@ tip = WidgetCreator<WidgetToolTip>::attach(this, tab->getToolTips()); // created and managed by the tab control thanks to the TCS_TOOLTIPS style if(tip) { tip->addRemoveStyle(TTS_NOPREFIX, true); - tip->onRaw(std::tr1::bind(&WidgetTabView::handleToolTip, this, _1, _2), Message(WM_NOTIFY, TTN_GETDISPINFO)); + tip->onRaw(std::tr1::bind(&WidgetTabView::handleToolTip, this, _2), Message(WM_NOTIFY, TTN_GETDISPINFO)); } } @@ -277,11 +277,13 @@ return image; } -LRESULT WidgetTabView::handleToolTip(WPARAM /*wParam*/, LPARAM lParam) { +LRESULT WidgetTabView::handleToolTip(LPARAM lParam) { LPNMTTDISPINFO ttdi = reinterpret_cast<LPNMTTDISPINFO>(lParam); TabInfo* ti = getTabInfo(ttdi->hdr.idFrom); // here idFrom corresponds to the index of the tab - if(ti) - ttdi->lpszText = const_cast<LPTSTR>(ti->w->getText().c_str()); + if(ti) { + tipText = ti->w->getText(); + ttdi->lpszText = const_cast<LPTSTR>(tipText.c_str()); + } return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zou...@us...> - 2008-03-04 23:27:16
|
Revision: 1025 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1025&view=rev Author: zouzou123gen Date: 2008-03-04 15:26:14 -0800 (Tue, 04 Mar 2008) Log Message: ----------- fix problems when tabs were added/removed during tab drag&drop Modified Paths: -------------- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h 2008-03-04 23:19:17 UTC (rev 1024) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h 2008-03-04 23:26:14 UTC (rev 1025) @@ -97,7 +97,7 @@ Rectangle clientSize; std::vector<IconPtr> icons; int active; - int dragging; + WidgetChildWindow* dragging; SmartUtil::tstring tipText; int findTab(WidgetChildWindow* w); Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp 2008-03-04 23:19:17 UTC (rev 1024) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp 2008-03-04 23:26:14 UTC (rev 1025) @@ -19,7 +19,7 @@ toggleActive(false), inTab(false), active(-1), - dragging(-1) + dragging(0) { } void WidgetTabView::create(const Seed & cs) { @@ -81,6 +81,9 @@ viewOrder.remove(w); + if(w == dragging) + dragging = 0; + int i = findTab(w); if(i != -1) { delete getTabInfo(i); @@ -291,12 +294,12 @@ } void WidgetTabView::handleLeftMouseDown(const MouseEventResult& mouseEventResult) { - int i = tab->hitTest(mouseEventResult.pos); - if(i != -1) { + TabInfo* ti = getTabInfo(tab->hitTest(mouseEventResult.pos)); + if(ti) { if(mouseEventResult.isShiftPressed) - getTabInfo(i)->w->close(); + ti->w->close(); else { - dragging = i; + dragging = ti->w; ::SetCapture(tab->handle()); } } @@ -305,7 +308,13 @@ void WidgetTabView::handleLeftMouseUp(const MouseEventResult& mouseEventResult) { ::ReleaseCapture(); - if(dragging != -1) { + if(dragging) { + int dragPos = findTab(dragging); + dragging = 0; + + if(dragPos == -1) + return; + int dropPos = tab->hitTest(mouseEventResult.pos); if(dropPos == -1) { @@ -313,30 +322,27 @@ dropPos = tab->size() - 1; } - if(dropPos == dragging) { + if(dropPos == dragPos) { // the tab hasn't moved; handle the click if(dropPos == active) { if(toggleActive) next(); } else setActive(dropPos); - dragging = -1; return; } // save some information about the tab before we erase it - TabInfo* ti = getTabInfo(dragging); - int image = tab->getImage(dragging); + TabInfo* ti = getTabInfo(dragPos); + int image = tab->getImage(dragPos); - tab->erase(dragging); + tab->erase(dragPos); tab->addPage(formatTitle(ti->w->getText()), dropPos, reinterpret_cast<LPARAM>(ti), image); active = tab->getSelectedIndex(); layout(); - - dragging = -1; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |