From: <zou...@us...> - 2008-02-11 13:03:22
|
Revision: 997 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=997&view=rev Author: zouzou123gen Date: 2008-02-09 04:12:59 -0800 (Sat, 09 Feb 2008) Log Message: ----------- WinUtil::Seeds::menuExtended to remember the bitmap background Modified Paths: -------------- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h dcplusplus/trunk/win32/HubFrame.cpp dcplusplus/trunk/win32/MDIChildFrame.h dcplusplus/trunk/win32/MainWindow.cpp dcplusplus/trunk/win32/PrivateFrame.cpp dcplusplus/trunk/win32/WinUtil.cpp dcplusplus/trunk/win32/WinUtil.h Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h 2008-02-08 17:19:21 UTC (rev 996) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h 2008-02-09 12:12:59 UTC (rev 997) @@ -174,8 +174,7 @@ typedef std::tr1::shared_ptr< MenuType > WidgetMenuExtendedPtr; struct Seed { - Seed(bool popup_, const MenuColorInfo& colorInfo_) : popup(popup_), colorInfo(colorInfo_) { } - Seed() : popup(false) { } + Seed(const MenuColorInfo& colorInfo_ = MenuColorInfo()) : popup(true), colorInfo(colorInfo_) { } bool popup; MenuColorInfo colorInfo; }; @@ -565,7 +564,7 @@ { // create popup menu pointer WidgetMenuExtendedPtr retVal ( new MenuType(this->itsParent) ); - retVal->create( Seed(true, itsColorInfo) ); + retVal->create( Seed(itsColorInfo) ); // init structure for new item MENUITEMINFO info; Modified: dcplusplus/trunk/win32/HubFrame.cpp =================================================================== --- dcplusplus/trunk/win32/HubFrame.cpp 2008-02-08 17:19:21 UTC (rev 996) +++ dcplusplus/trunk/win32/HubFrame.cpp 2008-02-09 12:12:59 UTC (rev 997) @@ -1170,10 +1170,7 @@ } bool HubFrame::handleTabContextMenu(const SmartWin::ScreenCoordinate& pt) { - WidgetMenuExtended::Seed cs; - cs.popup = true; - cs.colorInfo.colorImageBackground = RGB(255, 0, 255); // DC++ bitmaps use RGB(255, 0, 255) as their background (transparent) color - WidgetMenuExtendedPtr menu = createExtendedMenu(cs); + WidgetMenuExtendedPtr menu = createExtendedMenu(WinUtil::Seeds::menuExtended); menu->setTitle(SmartUtil::cutText(getText(), SmartWin::WidgetTabView::MAX_TITLE_LENGTH)); Modified: dcplusplus/trunk/win32/MDIChildFrame.h =================================================================== --- dcplusplus/trunk/win32/MDIChildFrame.h 2008-02-08 17:19:21 UTC (rev 996) +++ dcplusplus/trunk/win32/MDIChildFrame.h 2008-02-09 12:12:59 UTC (rev 997) @@ -186,10 +186,7 @@ } bool handleContextMenu(const SmartWin::ScreenCoordinate& pt) { - WidgetMenuExtended::Seed cs; - cs.popup = true; - cs.colorInfo.colorImageBackground = RGB(255, 0, 255); // DC++ bitmaps use RGB(255, 0, 255) as their background (transparent) color - SmartWin::WidgetMenuExtended::ObjectType menu = createExtendedMenu(cs); + SmartWin::WidgetMenuExtended::ObjectType menu = createExtendedMenu(WinUtil::Seeds::menuExtended); menu->setTitle(SmartUtil::cutText(getText(), SmartWin::WidgetTabView::MAX_TITLE_LENGTH)); menu->appendItem(IDC_CLOSE_WINDOW, T_("&Close"), std::tr1::bind(&ThisType::close, this, true), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_EXIT))); menu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); Modified: dcplusplus/trunk/win32/MainWindow.cpp =================================================================== --- dcplusplus/trunk/win32/MainWindow.cpp 2008-02-08 17:19:21 UTC (rev 996) +++ dcplusplus/trunk/win32/MainWindow.cpp 2008-02-09 12:12:59 UTC (rev 997) @@ -178,8 +178,8 @@ dcdebug("initMenu\n"); { - WidgetMenuExtended::Seed cs; - cs.colorInfo.colorImageBackground = RGB(255, 0, 255); // DC++ bitmaps use RGB(255, 0, 255) as their background (transparent) color + WidgetMenuExtended::Seed cs = WinUtil::Seeds::menuExtended; + cs.popup = false; mainMenu = createExtendedMenu(cs); } Modified: dcplusplus/trunk/win32/PrivateFrame.cpp =================================================================== --- dcplusplus/trunk/win32/PrivateFrame.cpp 2008-02-08 17:19:21 UTC (rev 996) +++ dcplusplus/trunk/win32/PrivateFrame.cpp 2008-02-09 12:12:59 UTC (rev 997) @@ -360,10 +360,7 @@ } bool PrivateFrame::handleTabContextMenu(const SmartWin::ScreenCoordinate& pt) { - WidgetMenuExtended::Seed cs; - cs.popup = true; - cs.colorInfo.colorImageBackground = RGB(255, 0, 255); // DC++ bitmaps use RGB(255, 0, 255) as their background (transparent) color - WidgetMenuExtendedPtr menu = createExtendedMenu(cs); + WidgetMenuExtendedPtr menu = createExtendedMenu(WinUtil::Seeds::menuExtended); menu->setTitle(SmartUtil::cutText(getText(), SmartWin::WidgetTabView::MAX_TITLE_LENGTH)); Modified: dcplusplus/trunk/win32/WinUtil.cpp =================================================================== --- dcplusplus/trunk/win32/WinUtil.cpp 2008-02-08 17:19:21 UTC (rev 996) +++ dcplusplus/trunk/win32/WinUtil.cpp 2008-02-09 12:12:59 UTC (rev 997) @@ -62,6 +62,7 @@ const SmartWin::WidgetComboBox::Seed WinUtil::Seeds::comboBoxStatic; const SmartWin::WidgetComboBox::Seed WinUtil::Seeds::comboBoxEdit; const SmartWin::WidgetListView::Seed WinUtil::Seeds::listView; +const SmartWin::WidgetMenuExtended::Seed WinUtil::Seeds::menuExtended; const SmartWin::WidgetTextBox::Seed WinUtil::Seeds::textBox; const SmartWin::WidgetTreeView::Seed WinUtil::Seeds::treeView; @@ -123,6 +124,7 @@ SmartWin::WidgetComboBox::Seed& xcomboBoxEdit = const_cast<SmartWin::WidgetComboBox::Seed&>(Seeds::comboBoxEdit); SmartWin::WidgetComboBox::Seed& xcomboBoxStatic = const_cast<SmartWin::WidgetComboBox::Seed&>(Seeds::comboBoxStatic); SmartWin::WidgetListView::Seed& xlistView = const_cast<SmartWin::WidgetListView::Seed&>(Seeds::listView); + SmartWin::WidgetMenuExtended::Seed& xmenuExtended = const_cast<SmartWin::WidgetMenuExtended::Seed&>(Seeds::menuExtended); SmartWin::WidgetTextBox::Seed& xtextBox = const_cast<SmartWin::WidgetTextBox::Seed&>(Seeds::textBox); SmartWin::WidgetTreeView::Seed& xtreeView = const_cast<SmartWin::WidgetTreeView::Seed&>(Seeds::treeView); @@ -133,7 +135,10 @@ xlistView.exStyle = WS_EX_CLIENTEDGE; xlistView.lvStyle = LVS_EX_HEADERDRAGDROP | LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP | LVS_EX_DOUBLEBUFFER; xlistView.font = font; - + + // DC++ bitmaps use RGB(255, 0, 255) as their background (transparent) color + xmenuExtended.colorInfo.colorImageBackground = RGB(255, 0, 255); + xtextBox.exStyle = WS_EX_CLIENTEDGE; xtextBox.font = font; Modified: dcplusplus/trunk/win32/WinUtil.h =================================================================== --- dcplusplus/trunk/win32/WinUtil.h 2008-02-08 17:19:21 UTC (rev 996) +++ dcplusplus/trunk/win32/WinUtil.h 2008-02-09 12:12:59 UTC (rev 997) @@ -71,6 +71,7 @@ static const SmartWin::WidgetComboBox::Seed comboBoxStatic; static const SmartWin::WidgetComboBox::Seed comboBoxEdit; static const SmartWin::WidgetListView::Seed listView; + static const SmartWin::WidgetMenuExtended::Seed menuExtended; static const SmartWin::WidgetTextBox::Seed textBox; static const SmartWin::WidgetTreeView::Seed treeView; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |