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. |