You can subscribe to this list here.
2006 |
Jan
|
Feb
(24) |
Mar
(9) |
Apr
(4) |
May
(7) |
Jun
(13) |
Jul
(19) |
Aug
(1) |
Sep
(12) |
Oct
(20) |
Nov
(1) |
Dec
(15) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
(6) |
Mar
(24) |
Apr
(1) |
May
(10) |
Jun
(30) |
Jul
(46) |
Aug
(20) |
Sep
(12) |
Oct
(27) |
Nov
(51) |
Dec
(58) |
2008 |
Jan
(40) |
Feb
(40) |
Mar
(78) |
Apr
(138) |
May
(4) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
(2) |
Jul
(10) |
Aug
(1) |
Sep
(11) |
Oct
(31) |
Nov
(7) |
Dec
(1) |
2011 |
Jan
(1) |
Feb
|
Mar
(3) |
Apr
|
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
(2) |
Dec
(2) |
2013 |
Jan
(3) |
Feb
(5) |
Mar
(1) |
Apr
|
May
|
Jun
(11) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2014 |
Jan
(2) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
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-02-17 22:27:18
|
Revision: 1014 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1014&view=rev Author: zouzou123gen Date: 2008-02-17 14:27:10 -0800 (Sun, 17 Feb 2008) Log Message: ----------- menu changes: simplify parent args, use the wrapper in draw functions; fix a GDB-specific crash Modified Paths: -------------- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenu.h dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp dcplusplus/trunk/win32/ADLSearchFrame.cpp dcplusplus/trunk/win32/DirectoryListingFrame.cpp dcplusplus/trunk/win32/FavHubsFrame.cpp dcplusplus/trunk/win32/FinishedFrameBase.h dcplusplus/trunk/win32/HubFrame.cpp dcplusplus/trunk/win32/MDIChildFrame.h dcplusplus/trunk/win32/MainWindow.cpp dcplusplus/trunk/win32/PrivateFrame.cpp dcplusplus/trunk/win32/PublicHubsFrame.cpp dcplusplus/trunk/win32/QueueFrame.cpp dcplusplus/trunk/win32/SearchFrame.cpp dcplusplus/trunk/win32/ShellContextMenu.cpp dcplusplus/trunk/win32/ShellContextMenu.h dcplusplus/trunk/win32/SpyFrame.cpp dcplusplus/trunk/win32/TransferView.cpp dcplusplus/trunk/win32/UsersFrame.cpp dcplusplus/trunk/win32/WaitingUsersFrame.cpp Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenu.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenu.h 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenu.h 2008-02-17 22:27:10 UTC (rev 1014) @@ -73,46 +73,6 @@ */ typedef std::tr1::shared_ptr< MenuItemData > MenuItemDataPtr; -namespace private_ -{ - // //////////////////////////////////////////////////////////////////////// - // Menu item data wrapper, used internally - // MENUITEMINFO's dwItemData *should* point to it - // //////////////////////////////////////////////////////////////////////// - struct ItemDataWrapper - { - // The menu item belongs to - // For some messages (e.g. WM_MEASUREITEM), - // Windows doesn't specify it, so - // we need to keep this - HMENU menu; - - // Item index in the menu - // This is needed, because ID's for items - // are not unique (although Windows claims) - // e.g. we can have an item with ID 0, - // that is either separator or popup menu - int index; - - // Specifies if item is menu title - bool isMenuTitleItem; - - // Contains item data - MenuItemDataPtr data; - - // Wrapper Constructor - ItemDataWrapper( HMENU owner, int itemIndex, MenuItemDataPtr itemData, bool isTitleItem = false ) - : menu( owner ) - , index( itemIndex ) - , isMenuTitleItem( isTitleItem ) - , data( itemData ) - {} - - ~ItemDataWrapper() - {} - }; -} - /// Struct for coloring different areas of WidgetMenu /** Contains the different color settings of the WidgetMenu <br> * Default values to constructor makes menu look roughly like MSVC++7.1 menus @@ -164,15 +124,8 @@ * Class for creating a Menu Control which then can be attached to e.g. a * WidgetWindow. <br> * Note for Desktop version only! <br> -* After you have created a menu you must call WidgetMenu::attach() to make it -* "attach" to the WidgetWindow you want it to belong to. <br> -* Do not be fooled, a WidgetMenu is a much more advanced menu type then the -* "normal" WidgetMenu and contains support for visualizations far beyond the -* capabilities of the WidgetMenu. <br> -* If you need those truly awesome visual menu effects use this menu control instead -* of the WidgetMenu. */ -class WidgetMenu : public boost::enable_shared_from_this< WidgetMenu > +class WidgetMenu : public boost::enable_shared_from_this< WidgetMenu >, boost::noncopyable { // friends friend class WidgetCreator< WidgetMenu >; @@ -244,8 +197,8 @@ return itsHandle; } - HWND getParent() const { - return itsParent ? itsParent->handle() : 0; + Widget* getParent() const { + return itsParent; } /// Actually creates the menu @@ -400,7 +353,7 @@ * < li >TPM_VERPOSANIMATION : Animates the menu from top to bottom< /li > * < /ul > */ - unsigned trackPopupMenu( Widget * mainWindow, const ScreenCoordinate& sc, unsigned flags = 0 ); + unsigned trackPopupMenu( const ScreenCoordinate& sc, unsigned flags = 0 ); /// Sets menu title /** A WidgetMenu can have a title, this function sets that title @@ -475,24 +428,59 @@ /// Constructor Taking pointer to parent explicit WidgetMenu( SmartWin::Widget * parent ); + // //////////////////////////////////////////////////////////////////////// + // Menu item data wrapper, used internally + // MENUITEMINFO's dwItemData *should* point to it + // //////////////////////////////////////////////////////////////////////// + struct ItemDataWrapper + { + // The menu item belongs to + // For some messages (e.g. WM_MEASUREITEM), + // Windows doesn't specify it, so + // we need to keep this + const WidgetMenu* menu; + + // Item index in the menu + // This is needed, because ID's for items + // are not unique (although Windows claims) + // e.g. we can have an item with ID 0, + // that is either separator or popup menu + int index; + + // Specifies if item is menu title + bool isMenuTitleItem; + + // Contains item data + MenuItemDataPtr data; + + // Wrapper Constructor + ItemDataWrapper( const WidgetMenu* menu_, int itemIndex, MenuItemDataPtr itemData, bool isTitleItem = false ) + : menu( menu_ ) + , index( itemIndex ) + , isMenuTitleItem( isTitleItem ) + , data( itemData ) + {} + + ~ItemDataWrapper() + {} + }; + // This is used during menu destruction - static void destroyItemDataWrapper( private_::ItemDataWrapper * wrapper ); + static void destroyItemDataWrapper( ItemDataWrapper * wrapper ); // True is menu is "system menu" (icon in top left of window) bool isSysMenu; + // its sub menus + std::vector< ObjectType > itsChildren; // work around for gcc std::vector< ObjectType > & itsChildrenRef; + // its item data + std::vector < ItemDataWrapper * > itsItemData; // work around for gcc - std::vector < private_::ItemDataWrapper * > & itsItemDataRef; + std::vector < ItemDataWrapper * > & itsItemDataRef; - // its sub menus - std::vector< ObjectType > itsChildren; - - // its item data - std::vector < private_::ItemDataWrapper * > itsItemData; - HMENU itsHandle; Widget* itsParent; @@ -514,13 +502,11 @@ typedef std::map<unsigned, Widget::CallbackType> CallbackMap; CallbackMap callbacks; - void addCommands(Widget* widget); + void addCommands(); // Returns item index in the menu item list // If no item with specified id is found, - 1 is returned int getItemIndex( unsigned int id ); - - WidgetMenu( const WidgetMenu & ); // Never implemented intentionally }; // end namespace SmartWin Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp 2008-02-17 22:27:10 UTC (rev 1014) @@ -49,6 +49,7 @@ itsParent(parent), drawSidebar(false) { + xAssert(itsParent != NULL, _T("A WidgetMenu must have a parent")); } void WidgetMenu::create(const Seed& cs) @@ -84,15 +85,15 @@ void WidgetMenu::attach() { - addCommands(itsParent); - if ( ::SetMenu( getParent(), this->itsHandle ) == FALSE ) + addCommands(); + if ( ::SetMenu( itsParent->handle(), itsHandle ) == FALSE ) throw xCeption( _T( "Couldn't attach menu to the parent window" ) ); } WidgetMenu::ObjectType WidgetMenu::appendPopup( const SmartUtil::tstring & text, MenuItemDataPtr itemData ) { // create popup menu pointer - ObjectType retVal ( new WidgetMenu(this->itsParent) ); + ObjectType retVal ( new WidgetMenu(itsParent) ); retVal->create( Seed(ownerDrawn, itsColorInfo) ); // init structure for new item @@ -110,21 +111,21 @@ info.hSubMenu = retVal->handle(); // get position to insert - int position = ::GetMenuItemCount( this->itsHandle ); + int position = ::GetMenuItemCount( itsHandle ); - private_::ItemDataWrapper * wrapper; + ItemDataWrapper * wrapper = NULL; if(ownerDrawn) { info.fMask |= MIIM_DATA | MIIM_FTYPE; info.fType = MFT_OWNERDRAW; // create item data - wrapper = new private_::ItemDataWrapper( this->itsHandle, position, itemData ); - info.dwItemData = reinterpret_cast< UINT_PTR >( wrapper ); + wrapper = new ItemDataWrapper( this, position, itemData ); + info.dwItemData = reinterpret_cast< ULONG_PTR >( wrapper ); } // append to this menu at the end - if ( ::InsertMenuItem( this->itsHandle, position, TRUE, & info ) ) + if ( ::InsertMenuItem( itsHandle, position, TRUE, & info ) ) { if(ownerDrawn) itsItemData.push_back( wrapper ); @@ -137,10 +138,10 @@ WidgetMenu::ObjectType WidgetMenu::getSystemMenu() { // get system menu for the utmost parent - HMENU handle = ::GetSystemMenu( this->getParent(), FALSE ); + HMENU handle = ::GetSystemMenu( itsParent->handle(), FALSE ); // create pointer to system menu - ObjectType sysMenu( new WidgetMenu( this->getParent() ) ); + ObjectType sysMenu( new WidgetMenu( itsParent->handle() ) ); // create(take) system menu sysMenu->isSysMenu = true; @@ -154,22 +155,22 @@ } #endif -void WidgetMenu::addCommands(Widget* widget) { +void WidgetMenu::addCommands() { for(CallbackMap::iterator i = callbacks.begin(); i != callbacks.end(); ++i) { - widget->setCallback(Message(WM_COMMAND, i->first), i->second); + itsParent->setCallback(Message(WM_COMMAND, i->first), i->second); } for(std::vector< ObjectType >::iterator i = itsChildren.begin(); i != itsChildren.end(); ++i) { - (*i)->addCommands(widget); + (*i)->addCommands(); } } int WidgetMenu::getItemIndex( unsigned int id ) { int index = 0; - const int itemCount = ::GetMenuItemCount( this->itsHandle ); + const int itemCount = ::GetMenuItemCount( itsHandle ); for ( index = 0; index < itemCount; ++index ) - if ( ::GetMenuItemID( this->itsHandle, index ) == id ) // exit the loop if found + if ( ::GetMenuItemID( itsHandle, index ) == id ) // exit the loop if found return index; return - 1; @@ -193,7 +194,7 @@ std::for_each( itsItemDataRef.begin(), itsItemDataRef.end(), destroyItemDataWrapper ); } -void WidgetMenu::destroyItemDataWrapper( private_::ItemDataWrapper * wrapper ) +void WidgetMenu::destroyItemDataWrapper( ItemDataWrapper * wrapper ) { if ( 0 != wrapper ) delete wrapper; @@ -270,12 +271,12 @@ // set flag mi.fMask = MIIM_STRING; - if ( ::GetMenuItemInfo( this->itsHandle, id, byPosition, & mi ) == FALSE ) + if ( ::GetMenuItemInfo( itsHandle, id, byPosition, & mi ) == FALSE ) throw xCeption( _T( "Couldn't get item info in WidgetMenu::getText" ) ); boost::scoped_array< TCHAR > buffer( new TCHAR[++mi.cch] ); mi.dwTypeData = buffer.get(); - if ( ::GetMenuItemInfo( this->itsHandle, id, byPosition, & mi ) == FALSE ) + if ( ::GetMenuItemInfo( itsHandle, id, byPosition, & mi ) == FALSE ) throw xCeption( _T( "Couldn't get item info in WidgetMenu::getText" ) ); return mi.dwTypeData; } @@ -288,7 +289,7 @@ mi.fMask = MIIM_STRING; mi.dwTypeData = (TCHAR*) text.c_str(); - if ( ::SetMenuItemInfo( this->itsHandle, id, FALSE, & mi ) == FALSE ) + if ( ::SetMenuItemInfo( itsHandle, id, FALSE, & mi ) == FALSE ) throw xCeption( _T( "Couldn't set item info in WidgetMenu::setText" ) ); } @@ -320,13 +321,13 @@ // created info for title item MenuItemDataPtr data( new MenuItemData( itsTitleFont ) ); - private_::ItemDataWrapper * wrapper = new private_::ItemDataWrapper( this->itsHandle, 0, data, true ); + ItemDataWrapper * wrapper = new ItemDataWrapper( this, 0, data, true ); // set item data - info.dwItemData = ( ULONG_PTR ) wrapper; + info.dwItemData = reinterpret_cast< ULONG_PTR >( wrapper ); - if ( ( !hasTitle && ::InsertMenuItem( this->itsHandle, 0, TRUE, & info ) ) || - ( hasTitle && ::SetMenuItemInfo( this->itsHandle, 0, TRUE, & info ) ) ) + if ( ( !hasTitle && ::InsertMenuItem( itsHandle, 0, TRUE, & info ) ) || + ( hasTitle && ::SetMenuItemInfo( itsHandle, 0, TRUE, & info ) ) ) { size_t i = 0; @@ -345,18 +346,18 @@ if ( ( id != 0 ) || ( drawInfo->CtlType != ODT_MENU ) ) // if not intended for us return false; + // get item data wrapper + ItemDataWrapper * wrapper = reinterpret_cast< ItemDataWrapper * >( drawInfo->itemData ); + xAssert( wrapper != 0, _T( "Unsupported menu item in drawItem()" ) ); + // setup colors - MenuColorInfo colorInfo = this->itsColorInfo; + MenuColorInfo colorInfo = wrapper->menu->itsColorInfo; COLORREF colorMenuBar = colorInfo.colorMenuBar; COLORREF colorMenuDraw = colorInfo.colorMenu; // color for drawing menu COLORREF colorFillHighlighted = ColorUtilities::lightenColor( colorInfo.colorHighlight, 0.7 ); - // get item data wrapper - private_::ItemDataWrapper * wrapper = reinterpret_cast< private_::ItemDataWrapper * >( drawInfo->itemData ); - xAssert( wrapper != 0, _T( "Unsupported menu item in drawItem()" ) ); - // if processing menu bar - const bool isMenuBar = ::GetMenu( getParent() ) == wrapper->menu; + const bool isMenuBar = ::GetMenu( wrapper->menu->getParent()->handle() ) == wrapper->menu->handle(); // change menu draw color for menubars if ( isMenuBar ) @@ -370,7 +371,7 @@ // set flags info.fMask = MIIM_CHECKMARKS | MIIM_FTYPE | MIIM_DATA | MIIM_STATE | MIIM_STRING; - if ( ::GetMenuItemInfo( wrapper->menu, wrapper->index, TRUE, & info ) == FALSE ) + if ( ::GetMenuItemInfo( wrapper->menu->handle(), wrapper->index, TRUE, & info ) == FALSE ) throw xCeption ( _T( "Couldn't get menu item info in drawItem()" ) ); // check if item is owner drawn @@ -411,7 +412,7 @@ drawInfo->rcItem.bottom - drawInfo->rcItem.top ); // height // setup buffered canvas - BufferedCanvas< FreeCanvas > canvas( reinterpret_cast<HWND>(wrapper->menu), drawInfo->hDC ); + BufferedCanvas< FreeCanvas > canvas( reinterpret_cast<HWND>(wrapper->menu->handle()), drawInfo->hDC ); // this will conain adjusted sidebar width int sidebarWidth = 0; @@ -425,10 +426,10 @@ HFONT titleFont = NULL; // get title font info and adjust item rectangle - if ( this->drawSidebar ) + if ( wrapper->menu->drawSidebar ) { // get title font - FontPtr font = this->itsTitleFont; + FontPtr font = wrapper->menu->itsTitleFont; // get logical info for title font ::GetObject( font->handle(), sizeof( LOGFONT ), & lf ); @@ -444,7 +445,7 @@ memset( & textSize, 0, sizeof( SIZE ) ); HGDIOBJ oldFont = ::SelectObject( canvas.handle(), titleFont ); - ::GetTextExtentPoint32( canvas.handle(), this->itsTitle.c_str(), ( int ) this->itsTitle.size(), & textSize ); + ::GetTextExtentPoint32( canvas.handle(), wrapper->menu->itsTitle.c_str(), ( int ) wrapper->menu->itsTitle.size(), & textSize ); ::SelectObject( canvas.handle(), oldFont ); // set sidebar width to text height @@ -456,7 +457,7 @@ } // draw sidebar with menu title - if ( ( drawInfo->itemAction & ODA_DRAWENTIRE ) && ( this->drawSidebar ) && !this->itsTitle.empty() ) + if ( ( drawInfo->itemAction & ODA_DRAWENTIRE ) && ( wrapper->menu->drawSidebar ) && !wrapper->menu->itsTitle.empty() ) { // select title font and color HGDIOBJ oldFont = ::SelectObject ( canvas.handle(), titleFont ); @@ -479,7 +480,7 @@ // draw title textRectangle.pos.y += 10; - canvas.drawText( this->itsTitle, textRectangle, DT_BOTTOM | DT_SINGLELINE ); + canvas.drawText( wrapper->menu->itsTitle, textRectangle, DT_BOTTOM | DT_SINGLELINE ); // clear canvas.setTextColor( oldColor ); @@ -561,7 +562,7 @@ // get item text const int length = info.cch + 1; std::vector< TCHAR > buffer( length ); - int count = ::GetMenuString( wrapper->menu, wrapper->index, & buffer[0], length, MF_BYPOSITION ); + int count = ::GetMenuString( wrapper->menu->handle(), wrapper->index, & buffer[0], length, MF_BYPOSITION ); SmartUtil::tstring itemText( buffer.begin(), buffer.begin() + count ); // index will contain accelerator position @@ -583,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, TRUE, GMDI_USEDISABLED)) == wrapper->index) ? itsTitleFont : data->Font); + FontPtr font((static_cast<int>(::GetMenuDefaultItem(wrapper->menu->handle(), TRUE, GMDI_USEDISABLED)) == wrapper->index) ? itsTitleFont : data->Font); HGDIOBJ oldFont = ::SelectObject( canvas.handle(), font->handle() ); @@ -690,7 +691,7 @@ } // blast buffer into screen - if ( ( drawInfo->itemAction & ODA_DRAWENTIRE ) && this->drawSidebar ) // adjustment for sidebar + if ( ( drawInfo->itemAction & ODA_DRAWENTIRE ) && wrapper->menu->drawSidebar ) // adjustment for sidebar { itemRectangle.pos.x -= sidebarWidth; itemRectangle.size.x += sidebarWidth; @@ -704,8 +705,8 @@ if ( measureInfo->CtlType != ODT_MENU ) // if not intended for us return false; - // get data wrapper - private_::ItemDataWrapper * wrapper = reinterpret_cast< private_::ItemDataWrapper * >( measureInfo->itemData ); + // get item data wrapper + ItemDataWrapper * wrapper = reinterpret_cast< ItemDataWrapper * >( measureInfo->itemData ); xAssert( wrapper != 0, _T( "Unsupported menu item type in measureItem()" ) ); // this will contain item size @@ -721,7 +722,7 @@ info.fMask = MIIM_FTYPE | MIIM_DATA | MIIM_CHECKMARKS | MIIM_STRING; // try to get item info - if ( ::GetMenuItemInfo( wrapper->menu, wrapper->index, TRUE, & info ) == FALSE ) + if ( ::GetMenuItemInfo( wrapper->menu->handle(), wrapper->index, TRUE, & info ) == FALSE ) throw xCeption ( _T( "Couldn't get item info in measureItem()" ) ); // check if item is owner drawn @@ -736,11 +737,11 @@ } // are we processing menu bar ? - const bool isMenuBar = ::GetMenu( getParent() ) == wrapper->menu; + const bool isMenuBar = ::GetMenu( wrapper->menu->getParent()->handle() ) == wrapper->menu->handle(); // compute text width and height by simulating write to dc // get its DC - HDC hdc = ::GetDC( getParent() ); + HDC hdc = ::GetDC( wrapper->menu->getParent()->handle() ); // get the item data MenuItemDataPtr data = wrapper->data; @@ -749,7 +750,7 @@ // get item text const int length = info.cch + 1; std::vector< TCHAR > buffer ( length ); - int count = ::GetMenuString( wrapper->menu, wrapper->index, & buffer[0], length, MF_BYPOSITION ); + int count = ::GetMenuString( wrapper->menu->handle(), wrapper->index, & buffer[0], length, MF_BYPOSITION ); SmartUtil::tstring itemText ( buffer.begin(), buffer.begin() + count ); // now get text extents @@ -761,7 +762,7 @@ ::SelectObject( hdc, oldFont ); // release DC - ::ReleaseDC( reinterpret_cast<HWND>(wrapper->menu), hdc ); + ::ReleaseDC( reinterpret_cast<HWND>(wrapper->menu->handle()), hdc ); // adjust item size itemWidth = textSize.cx + borderGap; @@ -808,17 +809,17 @@ } // adjust width for system menu items - if ( this->isSysMenu ) + if ( wrapper->menu->isSysMenu ) itemWidth = (std::max)( ( UINT ) minSysMenuItemWidth, itemWidth ); // adjust width for sidebar - if ( this->drawSidebar ) + if ( wrapper->menu->drawSidebar ) { // get title text extents SIZE textSize; memset( & textSize, 0, sizeof( SIZE ) ); - ::GetTextExtentPoint32( hdc, this->itsTitle.c_str(), ( int ) this->itsTitle.size(), & textSize ); + ::GetTextExtentPoint32( hdc, wrapper->menu->itsTitle.c_str(), ( int ) wrapper->menu->itsTitle.size(), & textSize ); itemWidth += textSize.cy; } @@ -840,34 +841,34 @@ itemInfo.fType = MFT_SEPARATOR; // get position to insert - int position = ::GetMenuItemCount( this->itsHandle ); + int position = ::GetMenuItemCount( itsHandle ); - private_::ItemDataWrapper * wrapper; + ItemDataWrapper * wrapper = NULL; if(ownerDrawn) { itemInfo.fMask |= MIIM_DATA; itemInfo.fType |= MFT_OWNERDRAW; // create item data wrapper - wrapper = new private_::ItemDataWrapper( this->itsHandle, position, MenuItemDataPtr( new MenuItemData() ) ); + wrapper = new ItemDataWrapper( this, position, MenuItemDataPtr( new MenuItemData() ) ); itemInfo.dwItemData = reinterpret_cast< ULONG_PTR >( wrapper ); } - if ( ::InsertMenuItem( this->itsHandle, position, TRUE, & itemInfo ) && ownerDrawn ) + if ( ::InsertMenuItem( itsHandle, position, TRUE, & itemInfo ) && ownerDrawn ) itsItemDataRef.push_back( wrapper ); } void WidgetMenu::removeItem( unsigned itemIndex ) { // has sub menus ? - HMENU popup = ::GetSubMenu( this->itsHandle, itemIndex ); + HMENU popup = ::GetSubMenu( itsHandle, itemIndex ); // try to remove item - if ( ::RemoveMenu( this->itsHandle, itemIndex, MF_BYPOSITION ) == TRUE ) + if ( ::RemoveMenu( itsHandle, itemIndex, MF_BYPOSITION ) == TRUE ) { size_t i = 0; if(ownerDrawn) { - private_::ItemDataWrapper * wrapper = 0; + ItemDataWrapper * wrapper = 0; int itemRemoved = -1; for ( i = 0; i < itsItemDataRef.size(); ++i ) @@ -913,7 +914,7 @@ int WidgetMenu::getCount() { - int count = ::GetMenuItemCount( this->itsHandle ); + int count = ::GetMenuItemCount( itsHandle ); if( count == -1 ) throw xCeption( _T( "Couldn't get item count in getCount()" ) ); return count; @@ -941,26 +942,26 @@ // set position to insert bool itemExists = index != - 1; - index = itemExists ? index : ::GetMenuItemCount( this->itsHandle ); + index = itemExists ? index : ::GetMenuItemCount( itsHandle ); - private_::ItemDataWrapper * wrapper; + ItemDataWrapper * wrapper = NULL; if(ownerDrawn) { info.fMask |= MIIM_DATA | MIIM_FTYPE; info.fType = MFT_OWNERDRAW; // set item data - wrapper = new private_::ItemDataWrapper( this->itsHandle, index, itemData ); + wrapper = new ItemDataWrapper( this, index, itemData ); info.dwItemData = reinterpret_cast< ULONG_PTR >( wrapper ); } - if ( ( !itemExists && ::InsertMenuItem( this->itsHandle, id, FALSE, & info ) == TRUE ) || - ( itemExists && ::SetMenuItemInfo( this->itsHandle, id, FALSE, & info ) == TRUE ) ) + if ( ( !itemExists && ::InsertMenuItem( itsHandle, id, FALSE, & info ) == TRUE ) || + ( itemExists && ::SetMenuItemInfo( itsHandle, id, FALSE, & info ) == TRUE ) ) { if(ownerDrawn) itsItemDataRef.push_back( wrapper ); } else - throw xCeption( _T( "Couldn't insert/update item in the WidgetMenu::appendItem" ) ); + throw xCeption( _T( "Couldn't insert/update item in WidgetMenu::appendItem" ) ); } void WidgetMenu::appendItem(unsigned int id, const SmartUtil::tstring & text, BitmapPtr image) @@ -971,10 +972,9 @@ appendItem(id, text, itemData); } -unsigned WidgetMenu::trackPopupMenu( Widget * mainWindow, const ScreenCoordinate& sc, unsigned flags ) +unsigned WidgetMenu::trackPopupMenu( const ScreenCoordinate& sc, unsigned flags ) { - xAssert( mainWindow != 0, _T( "Widget can't be null while trying to display Popup Menu" ) ); - addCommands(mainWindow); + addCommands(); long x = sc.getPoint().x, y = sc.getPoint().y; @@ -985,7 +985,7 @@ y = HIWORD( pos ); } - int retVal = ::TrackPopupMenu(this->itsHandle, flags, x, y, 0, mainWindow->handle(), 0 ); + int retVal = ::TrackPopupMenu(itsHandle, flags, x, y, 0, itsParent->handle(), 0 ); return retVal; } Modified: dcplusplus/trunk/win32/ADLSearchFrame.cpp =================================================================== --- dcplusplus/trunk/win32/ADLSearchFrame.cpp 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/ADLSearchFrame.cpp 2008-02-17 22:27:10 UTC (rev 1014) @@ -296,7 +296,7 @@ contextMenu->setItemEnabled(IDC_EDIT, false, status); contextMenu->setItemEnabled(IDC_REMOVE, false, status); - contextMenu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + contextMenu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } Modified: dcplusplus/trunk/win32/DirectoryListingFrame.cpp =================================================================== --- dcplusplus/trunk/win32/DirectoryListingFrame.cpp 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/DirectoryListingFrame.cpp 2008-02-17 22:27:10 UTC (rev 1014) @@ -411,7 +411,7 @@ WidgetMenuPtr menu = createMenu(cs); CShellContextMenu shellMenu; shellMenu.SetPath(Text::utf8ToWide(path)); - shellMenu.ShowContextMenu(menu, this, pt); + shellMenu.ShowContextMenu(menu, pt); return true; } } @@ -421,7 +421,7 @@ contextMenu = makeMultiMenu(); } usingDirMenu = false; - contextMenu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + contextMenu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } return false; @@ -437,7 +437,7 @@ if(dirs->getSelection()) { WidgetMenuPtr contextMenu = makeDirMenu(); usingDirMenu = true; - contextMenu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + contextMenu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } Modified: dcplusplus/trunk/win32/FavHubsFrame.cpp =================================================================== --- dcplusplus/trunk/win32/FavHubsFrame.cpp 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/FavHubsFrame.cpp 2008-02-17 22:27:10 UTC (rev 1014) @@ -292,7 +292,7 @@ menu->setItemEnabled(IDC_MOVE_DOWN, false, status); menu->setItemEnabled(IDC_REMOVE, false, status); - menu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + menu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } Modified: dcplusplus/trunk/win32/FinishedFrameBase.h =================================================================== --- dcplusplus/trunk/win32/FinishedFrameBase.h 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/FinishedFrameBase.h 2008-02-17 22:27:10 UTC (rev 1014) @@ -230,7 +230,7 @@ pShellMenu->appendItem(IDC_REMOVE_ALL, T_("Remove &all"), std::tr1::bind(&ThisType::handleRemoveAll, this)); pShellMenu->appendSeparatorItem(); - UINT idCommand = shellMenu.ShowContextMenu(pShellMenu, static_cast<T*>(this), pt); + UINT idCommand = shellMenu.ShowContextMenu(pShellMenu, pt); if(idCommand != 0) this->postMessage(WM_COMMAND, idCommand); return true; @@ -245,7 +245,7 @@ contextMenu->appendItem(IDC_REMOVE, T_("&Remove"), std::tr1::bind(&ThisType::handleRemove, this)); contextMenu->appendItem(IDC_REMOVE_ALL, T_("Remove &all"), std::tr1::bind(&ThisType::handleRemoveAll, this)); contextMenu->setDefaultItem(IDC_OPEN_FILE); - contextMenu->trackPopupMenu(static_cast<T*>(this), pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + contextMenu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } return false; Modified: dcplusplus/trunk/win32/HubFrame.cpp =================================================================== --- dcplusplus/trunk/win32/HubFrame.cpp 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/HubFrame.cpp 2008-02-17 22:27:10 UTC (rev 1014) @@ -1154,7 +1154,7 @@ inTabMenu = false; - menu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + menu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } return false; @@ -1178,7 +1178,7 @@ inTabMenu = true; - menu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + menu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } Modified: dcplusplus/trunk/win32/MDIChildFrame.h =================================================================== --- dcplusplus/trunk/win32/MDIChildFrame.h 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/MDIChildFrame.h 2008-02-17 22:27:10 UTC (rev 1014) @@ -189,7 +189,7 @@ SmartWin::WidgetMenu::ObjectType menu = createMenu(WinUtil::Seeds::menu); menu->setTitle(getParent()->getTabText(this)); 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); + menu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } Modified: dcplusplus/trunk/win32/MainWindow.cpp =================================================================== --- dcplusplus/trunk/win32/MainWindow.cpp 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/MainWindow.cpp 2008-02-17 22:27:10 UTC (rev 1014) @@ -1004,7 +1004,7 @@ trayMenu->setDefaultItem(0,TRUE); ::GetCursorPos(&pt.getPoint()); ::SetForegroundWindow(handle()); - trayMenu->trackPopupMenu(this, pt, TPM_BOTTOMALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON); + trayMenu->trackPopupMenu(pt, TPM_BOTTOMALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON); postMessage(WM_NULL); } else if(lParam == WM_MOUSEMOVE && ((lastMove + 1000) < GET_TICK()) ) { NOTIFYICONDATA nid; Modified: dcplusplus/trunk/win32/PrivateFrame.cpp =================================================================== --- dcplusplus/trunk/win32/PrivateFrame.cpp 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/PrivateFrame.cpp 2008-02-17 22:27:10 UTC (rev 1014) @@ -387,7 +387,7 @@ menu->appendSeparatorItem(); menu->appendItem(IDC_CLOSE_WINDOW, T_("&Close"), std::tr1::bind(&PrivateFrame::close, this, true), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_EXIT))); - menu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + menu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } Modified: dcplusplus/trunk/win32/PublicHubsFrame.cpp =================================================================== --- dcplusplus/trunk/win32/PublicHubsFrame.cpp 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/PublicHubsFrame.cpp 2008-02-17 22:27:10 UTC (rev 1014) @@ -449,7 +449,7 @@ menu->appendItem(IDC_ADD, T_("Add To &Favorites"), std::tr1::bind(&PublicHubsFrame::handleAdd, this), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_FAVORITE_HUBS))); menu->appendItem(IDC_COPY_HUB, T_("Copy &address to clipboard"), std::tr1::bind(&PublicHubsFrame::handleCopyHub, this)); menu->setDefaultItem(IDC_CONNECT); - menu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + menu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } return false; Modified: dcplusplus/trunk/win32/QueueFrame.cpp =================================================================== --- dcplusplus/trunk/win32/QueueFrame.cpp 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/QueueFrame.cpp 2008-02-17 22:27:10 UTC (rev 1014) @@ -1068,7 +1068,7 @@ } else { contextMenu = makeMultiMenu(); } - contextMenu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + contextMenu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } @@ -1085,7 +1085,7 @@ if(dirs->getSelection()) { usingDirMenu = true; WidgetMenuPtr contextMenu = makeDirMenu(); - contextMenu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + contextMenu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } Modified: dcplusplus/trunk/win32/SearchFrame.cpp =================================================================== --- dcplusplus/trunk/win32/SearchFrame.cpp 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/SearchFrame.cpp 2008-02-17 22:27:10 UTC (rev 1014) @@ -635,7 +635,7 @@ } WidgetMenuPtr contextMenu = makeMenu(); - contextMenu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + contextMenu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } return false; Modified: dcplusplus/trunk/win32/ShellContextMenu.cpp =================================================================== --- dcplusplus/trunk/win32/ShellContextMenu.cpp 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/ShellContextMenu.cpp 2008-02-17 22:27:10 UTC (rev 1014) @@ -101,7 +101,7 @@ bDelete = true; // indicates that m_psfFolder should be deleted by CShellContextMenu } -UINT CShellContextMenu::ShowContextMenu(SmartWin::WidgetMenu::ObjectType& menu, SmartWin::Widget * parent, const SmartWin::ScreenCoordinate& pt) +UINT CShellContextMenu::ShowContextMenu(SmartWin::WidgetMenu::ObjectType& menu, const SmartWin::ScreenCoordinate& pt) { int iMenuType = 0; // to know which version of IContextMenu is supported LPCONTEXTMENU pContextMenu; // common pointer to IContextMenu and higher version interface @@ -116,7 +116,7 @@ WNDPROC OldWndProc; if(iMenuType > 1) // only attach if its version 2 or 3 { - OldWndProc = (WNDPROC) SetWindowLong(parent->handle(), GWL_WNDPROC, (DWORD) HookWndProc); + OldWndProc = (WNDPROC) SetWindowLong(menu->getParent()->handle(), GWL_WNDPROC, (DWORD) HookWndProc); if(iMenuType == 2) g_IContext2 = (LPCONTEXTMENU2) pContextMenu; else // version 3 @@ -125,10 +125,10 @@ else OldWndProc = NULL; - UINT idCommand = menu->trackPopupMenu(parent, pt, TPM_RETURNCMD | TPM_LEFTALIGN); + UINT idCommand = menu->trackPopupMenu(pt, TPM_RETURNCMD | TPM_LEFTALIGN); if(OldWndProc) // unattach - SetWindowLong(parent->handle(), GWL_WNDPROC, (DWORD) OldWndProc); + SetWindowLong(menu->getParent()->handle(), GWL_WNDPROC, (DWORD) OldWndProc); if(idCommand >= ID_SHELLCONTEXTMENU_MIN && idCommand <= ID_SHELLCONTEXTMENU_MAX) { Modified: dcplusplus/trunk/win32/ShellContextMenu.h =================================================================== --- dcplusplus/trunk/win32/ShellContextMenu.h 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/ShellContextMenu.h 2008-02-17 22:27:10 UTC (rev 1014) @@ -35,7 +35,7 @@ void SetPath(const wstring& strPath); - UINT ShowContextMenu(SmartWin::WidgetMenu::ObjectType& menu, SmartWin::Widget * parent, const SmartWin::ScreenCoordinate& pt); + UINT ShowContextMenu(SmartWin::WidgetMenu::ObjectType& menu, const SmartWin::ScreenCoordinate& pt); private: bool bDelete; Modified: dcplusplus/trunk/win32/SpyFrame.cpp =================================================================== --- dcplusplus/trunk/win32/SpyFrame.cpp 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/SpyFrame.cpp 2008-02-17 22:27:10 UTC (rev 1014) @@ -188,7 +188,7 @@ WidgetMenuPtr contextMenu = createMenu(WinUtil::Seeds::menu); contextMenu->appendItem<WidgetMenu::SimpleDispatcher>(IDC_SEARCH, T_("&Search"), std::tr1::bind(&SpyFrame::handleSearch, this, searches->getText(searches->getSelectedIndex(), COLUMN_STRING)), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_SEARCH))); - contextMenu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + contextMenu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } return false; Modified: dcplusplus/trunk/win32/TransferView.cpp =================================================================== --- dcplusplus/trunk/win32/TransferView.cpp 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/TransferView.cpp 2008-02-17 22:27:10 UTC (rev 1014) @@ -210,7 +210,7 @@ /// @todo Fix multiple selection menu... ConnectionInfo* ii = connections->getSelectedData(); WidgetMenuPtr contextMenu = makeContextMenu(ii); - contextMenu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + contextMenu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } @@ -226,7 +226,7 @@ WidgetMenuPtr menu = createMenu(WinUtil::Seeds::menu); DownloadInfo* di = downloads->getSelectedData(); WinUtil::addHashItems(menu, di->tth, di->columns[DOWNLOAD_COLUMN_FILE]); - menu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + menu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } Modified: dcplusplus/trunk/win32/UsersFrame.cpp =================================================================== --- dcplusplus/trunk/win32/UsersFrame.cpp 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/UsersFrame.cpp 2008-02-17 22:27:10 UTC (rev 1014) @@ -186,7 +186,7 @@ menu->appendItem(IDC_EDIT, T_("&Properties"), std::tr1::bind(&UsersFrame::handleProperties, this)); menu->appendItem(IDC_REMOVE, T_("&Remove"), std::tr1::bind(&UsersFrame::handleRemove, this)); - menu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + menu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } Modified: dcplusplus/trunk/win32/WaitingUsersFrame.cpp =================================================================== --- dcplusplus/trunk/win32/WaitingUsersFrame.cpp 2008-02-17 22:03:38 UTC (rev 1013) +++ dcplusplus/trunk/win32/WaitingUsersFrame.cpp 2008-02-17 22:27:10 UTC (rev 1014) @@ -83,7 +83,7 @@ menu->appendItem(IDC_GRANTSLOT, T_("Grant &extra slot"), std::tr1::bind(&WaitingUsersFrame::onGrantSlot, this)); menu->appendItem(IDC_ADD_TO_FAVORITES, T_("Add To &Favorites"), std::tr1::bind(&WaitingUsersFrame::onAddToFavorites, this)); menu->appendItem(IDC_PRIVATEMESSAGE, T_("&Send private message"), std::tr1::bind(&WaitingUsersFrame::onPrivateMessage, this)); - menu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + menu->trackPopupMenu(pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2008-02-17 22:03:43
|
Revision: 1013 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1013&view=rev Author: arnetheduck Date: 2008-02-17 14:03:38 -0800 (Sun, 17 Feb 2008) Log Message: ----------- Typo Modified Paths: -------------- dcplusplus/trunk/win32/TransferView.cpp Modified: dcplusplus/trunk/win32/TransferView.cpp =================================================================== --- dcplusplus/trunk/win32/TransferView.cpp 2008-02-17 21:23:07 UTC (rev 1012) +++ dcplusplus/trunk/win32/TransferView.cpp 2008-02-17 22:03:38 UTC (rev 1013) @@ -735,7 +735,7 @@ } void TransferView::onTransferTick(Transfer* t) { - UpdateInfo* ui = new UpdateInfo(d->getUser(), true); + UpdateInfo* ui = new UpdateInfo(t->getUser(), true); ui->setTransfered(t->getPos(), t->getActual()); ui->setSpeed(t->getAverageSpeed()); ui->setChunk(t->getPos(), t->getSize()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2008-02-17 21:23:25
|
Revision: 1012 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1012&view=rev Author: arnetheduck Date: 2008-02-17 13:23:07 -0800 (Sun, 17 Feb 2008) Log Message: ----------- Cleanup Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/DownloadManager.cpp dcplusplus/trunk/dcpp/Exception.h dcplusplus/trunk/dcpp/QueueManager.cpp dcplusplus/trunk/dcpp/QueueManager.h dcplusplus/trunk/dcpp/UploadManager.cpp dcplusplus/trunk/dcpp/UploadManager.h dcplusplus/trunk/dcpp/UploadManagerListener.h dcplusplus/trunk/win32/AboutDlg.cpp dcplusplus/trunk/win32/MainWindow.cpp dcplusplus/trunk/win32/PrivateFrame.h dcplusplus/trunk/win32/TransferView.cpp dcplusplus/trunk/win32/TransferView.h dcplusplus/trunk/win32/WaitingUsersFrame.cpp dcplusplus/trunk/win32/WaitingUsersFrame.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2008-02-17 11:51:38 UTC (rev 1011) +++ dcplusplus/trunk/changelog.txt 2008-02-17 21:23:07 UTC (rev 1012) @@ -35,6 +35,7 @@ * [L#190955] Fixed 100% on remove all sources in queue * 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) -- 0.704 2007-12-14 -- * Hub lists added to utilize Coral's distributed network (ullner) Modified: dcplusplus/trunk/dcpp/DownloadManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/DownloadManager.cpp 2008-02-17 11:51:38 UTC (rev 1011) +++ dcplusplus/trunk/dcpp/DownloadManager.cpp 2008-02-17 21:23:07 UTC (rev 1012) @@ -447,7 +447,6 @@ aConn->disconnect(); } - void DownloadManager::removeDownload(Download* d) { if(d->getFile()) { if(d->getActual() > 0) { Modified: dcplusplus/trunk/dcpp/Exception.h =================================================================== --- dcplusplus/trunk/dcpp/Exception.h 2008-02-17 11:51:38 UTC (rev 1011) +++ dcplusplus/trunk/dcpp/Exception.h 2008-02-17 21:23:07 UTC (rev 1012) @@ -21,11 +21,14 @@ namespace dcpp { -class Exception +class Exception : std::exception { public: Exception() { } Exception(const string& aError) throw() : error(aError) { dcdrun(if(error.size()>0)) dcdebug("Thrown: %s\n", error.c_str()); } + + virtual const char* what() const throw() { return getError().c_str(); } + virtual ~Exception() throw() { } virtual const string& getError() const throw() { return error; } protected: Modified: dcplusplus/trunk/dcpp/QueueManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/QueueManager.cpp 2008-02-17 11:51:38 UTC (rev 1011) +++ dcplusplus/trunk/dcpp/QueueManager.cpp 2008-02-17 21:23:07 UTC (rev 1012) @@ -42,12 +42,6 @@ #undef ff #endif -#ifndef _WIN32 -#include <sys/types.h> -#include <dirent.h> -#include <fnmatch.h> -#endif - namespace dcpp { QueueItem* QueueManager::FileQueue::add(const string& aTarget, int64_t aSize, @@ -235,7 +229,6 @@ } void QueueManager::UserQueue::removeDownload(QueueItem* qi, const UserPtr& user) { - // Remove the download from running running.erase(user); for(DownloadList::iterator i = qi->getDownloads().begin(); i != qi->getDownloads().end(); ++i) { @@ -355,10 +348,9 @@ if(!BOOLSETTING(KEEP_LISTS)) { string path = Util::getListPath(); StringList filelists = File::findFiles(path, "*.xml.bz2"); - StringList filelists2 = File::findFiles(path, "*.DcLst"); - filelists.insert(filelists.end(), filelists2.begin(), filelists2.end()); - std::for_each(filelists.begin(), filelists.end(), &File::deleteFile); + filelists = File::findFiles(path, "*.DcLst"); + std::for_each(filelists.begin(), filelists.end(), &File::deleteFile); } } @@ -408,6 +400,7 @@ string target = Util::getListPath() + nick + aUser->getCID().toBase32(); if (!aInitialDir.empty()) { + Lock l(cs); dirMap[aUser->getCID().toBase32()] = aInitialDir; } @@ -433,7 +426,7 @@ ConnectionManager::getInstance()->getDownloadConnection(aUser); } -void QueueManager::add(const string& aTarget, int64_t aSize, const TTHValue& root, UserPtr aUser, +void QueueManager::add(const string& aTarget, int64_t aSize, const TTHValue& root, const UserPtr& aUser, int aFlags /* = QueueItem::FLAG_RESUME */, bool addBad /* = true */) throw(QueueException, FileException) { bool wantConnection = true; @@ -545,7 +538,7 @@ } /** Add a source to an existing queue item */ -bool QueueManager::addSource(QueueItem* qi, UserPtr aUser, Flags::MaskType addBad) throw(QueueException, FileException) { +bool QueueManager::addSource(QueueItem* qi, const UserPtr& aUser, Flags::MaskType addBad) throw(QueueException, FileException) { bool wantConnection = (qi->getPriority() != QueueItem::PAUSED) && !userQueue.getRunning(aUser); if(qi->isSource(aUser)) { Modified: dcplusplus/trunk/dcpp/QueueManager.h =================================================================== --- dcplusplus/trunk/dcpp/QueueManager.h 2008-02-17 11:51:38 UTC (rev 1011) +++ dcplusplus/trunk/dcpp/QueueManager.h 2008-02-17 21:23:07 UTC (rev 1012) @@ -73,7 +73,7 @@ { public: /** Add a file to the queue. */ - void add(const string& aTarget, int64_t aSize, const TTHValue& root, UserPtr aUser, + void add(const string& aTarget, int64_t aSize, const TTHValue& root, const UserPtr& aUser, int aFlags = QueueItem::FLAG_RESUME, bool addBad = true) throw(QueueException, FileException); /** Add a user's filelist to the queue. */ void addList(const UserPtr& aUser, int aFlags, const string& aInitialDir = Util::emptyString) throw(QueueException, FileException); @@ -224,7 +224,7 @@ /** Sanity check for the target filename */ static string checkTarget(const string& aTarget, int64_t aSize, int& flags) throw(QueueException, FileException); /** Add a source to an existing queue item */ - bool addSource(QueueItem* qi, UserPtr aUser, Flags::MaskType addBad) throw(QueueException, FileException); + bool addSource(QueueItem* qi, const UserPtr& aUser, Flags::MaskType addBad) throw(QueueException, FileException); void processList(const string& name, UserPtr& user, int flags); Modified: dcplusplus/trunk/dcpp/UploadManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/UploadManager.cpp 2008-02-17 11:51:38 UTC (rev 1011) +++ dcplusplus/trunk/dcpp/UploadManager.cpp 2008-02-17 21:23:07 UTC (rev 1012) @@ -387,7 +387,7 @@ return u; } -const UploadManager::FileSet& UploadManager::getWaitingUserFiles(const UserPtr &u) { +const UploadManager::FileSet& UploadManager::getWaitingUserFiles(const UserPtr& u) { Lock l(cs); return waitingFiles.find(u)->second; } Modified: dcplusplus/trunk/dcpp/UploadManager.h =================================================================== --- dcplusplus/trunk/dcpp/UploadManager.h 2008-02-17 11:51:38 UTC (rev 1011) +++ dcplusplus/trunk/dcpp/UploadManager.h 2008-02-17 21:23:07 UTC (rev 1012) @@ -59,7 +59,7 @@ typedef unordered_map<UserPtr, FileSet, User::Hash> FilesMap; void clearUserFiles(const UserPtr&); UserList getWaitingUsers(); - const FileSet& getWaitingUserFiles(const UserPtr &); + const FileSet& getWaitingUserFiles(const UserPtr&); /** @internal */ void addConnection(UserConnectionPtr conn); Modified: dcplusplus/trunk/dcpp/UploadManagerListener.h =================================================================== --- dcplusplus/trunk/dcpp/UploadManagerListener.h 2008-02-17 11:51:38 UTC (rev 1011) +++ dcplusplus/trunk/dcpp/UploadManagerListener.h 2008-02-17 21:23:07 UTC (rev 1012) @@ -21,8 +21,8 @@ virtual void on(Tick, const UploadList&) throw() { } virtual void on(Complete, Upload*) throw() { } virtual void on(Failed, Upload*, const string&) throw() { } - virtual void on(WaitingAddFile, const UserPtr, const string&) throw() { } - virtual void on(WaitingRemoveUser, const UserPtr) throw() { } + virtual void on(WaitingAddFile, const UserPtr&, const string&) throw() { } + virtual void on(WaitingRemoveUser, const UserPtr&) throw() { } }; Modified: dcplusplus/trunk/win32/AboutDlg.cpp =================================================================== --- dcplusplus/trunk/win32/AboutDlg.cpp 2008-02-17 11:51:38 UTC (rev 1011) +++ dcplusplus/trunk/win32/AboutDlg.cpp 2008-02-17 21:23:07 UTC (rev 1012) @@ -53,7 +53,7 @@ } bool AboutDlg::handleInitDialog() { - setItemText(IDC_VERSION, Text::toT("DC++ " VERSIONSTRING "\n(c) Copyright 2001-2007 Jacek Sieka\nEx-codeveloper: Per Lind\303\251n\nGraphics: Martin Skogevall et al.\nDC++ is licenced under GPL\nhttp://dcplusplus.sourceforge.net/")); + setItemText(IDC_VERSION, Text::toT("DC++ " VERSIONSTRING "\n(c) Copyright 2001-2008 Jacek Sieka\nEx-codeveloper: Per Lind\303\251n\nGraphics: Martin Skogevall et al.\nDC++ is licenced under GPL\nhttp://dcplusplus.sourceforge.net/")); setItemText(IDC_TTH, WinUtil::tth); setItemText(IDC_THANKS, Text::toT(thanks)); setItemText(IDC_TOTALS, str(TF_("Upload: %1%, Download: %2%") % Text::toT(Util::formatBytes(SETTING(TOTAL_UPLOAD))) % Text::toT(Util::formatBytes(SETTING(TOTAL_DOWNLOAD))))); Modified: dcplusplus/trunk/win32/MainWindow.cpp =================================================================== --- dcplusplus/trunk/win32/MainWindow.cpp 2008-02-17 11:51:38 UTC (rev 1011) +++ dcplusplus/trunk/win32/MainWindow.cpp 2008-02-17 21:23:07 UTC (rev 1012) @@ -66,14 +66,14 @@ UPnP_TCPConnection(0), UPnP_UDPConnection(0) { - links.homepage = _T("http://dcpp.net/"); + links.homepage = _T("http://dcplusplus.sourceforge.net/"); links.downloads = links.homepage + _T("download/"); links.geoipfile = _T("http://www.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip"); links.faq = links.homepage + _T("faq/"); - links.help = links.homepage + _T("forum/"); - links.discuss = links.homepage + _T("forum/"); - links.features = links.homepage + _T("bugzilla/"); - links.bugs = links.homepage + _T("bugzilla/"); + links.help = links.homepage + _T("help/"); + links.discuss = links.homepage + _T("discussion/"); + links.features = links.homepage + _T("featurereq/"); + links.bugs = links.homepage + _T("bugs/"); links.donate = _T("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=arnetheduck%40gmail%2ecom&item_name=DCPlusPlus&no_shipping=1&return=http%3a%2f%2fdcplusplus%2esf%2enet%2f&cancel_return=http%3a%2f%2fdcplusplus%2esf%2enet%2f&cn=Greeting&tax=0¤cy_code=EUR&bn=PP%2dDonationsBF&charset=UTF%2d8"); initWindow(); @@ -849,7 +849,6 @@ if(xml.findChild("Version")) { if(Util::toDouble(xml.getChildData()) > VERSIONFLOAT) { xml.resetCurrentChild(); - xml.resetCurrentChild(); if(xml.findChild("Title")) { const string& title = xml.getChildData(); xml.resetCurrentChild(); @@ -865,43 +864,42 @@ } } } - + } + xml.resetCurrentChild(); + if(xml.findChild("Links")) { + xml.stepIn(); + if(xml.findChild("Homepage")) { + links.homepage = Text::toT(xml.getChildData()); + } xml.resetCurrentChild(); - if(xml.findChild("Links")) { - xml.stepIn(); - if(xml.findChild("Homepage")) { - links.homepage = Text::toT(xml.getChildData()); - } - xml.resetCurrentChild(); - if(xml.findChild("Downloads")) { - links.downloads = Text::toT(xml.getChildData()); - } - xml.resetCurrentChild(); - if(xml.findChild("GeoIP database update")) { - links.geoipfile = Text::toT(xml.getChildData()); - } - xml.resetCurrentChild(); - if(xml.findChild("Faq")) { - links.faq = Text::toT(xml.getChildData()); - } - xml.resetCurrentChild(); - if(xml.findChild("Bugs")) { - links.bugs = Text::toT(xml.getChildData()); - } - xml.resetCurrentChild(); - if(xml.findChild("Features")) { - links.features = Text::toT(xml.getChildData()); - } - xml.resetCurrentChild(); - if(xml.findChild("Help")) { - links.help = Text::toT(xml.getChildData()); - } - xml.resetCurrentChild(); - if(xml.findChild("Forum")) { - links.discuss = Text::toT(xml.getChildData()); - } - xml.stepOut(); + if(xml.findChild("Downloads")) { + links.downloads = Text::toT(xml.getChildData()); } + xml.resetCurrentChild(); + if(xml.findChild("GeoIP database update")) { + links.geoipfile = Text::toT(xml.getChildData()); + } + xml.resetCurrentChild(); + if(xml.findChild("Faq")) { + links.faq = Text::toT(xml.getChildData()); + } + xml.resetCurrentChild(); + if(xml.findChild("Bugs")) { + links.bugs = Text::toT(xml.getChildData()); + } + xml.resetCurrentChild(); + if(xml.findChild("Features")) { + links.features = Text::toT(xml.getChildData()); + } + xml.resetCurrentChild(); + if(xml.findChild("Help")) { + links.help = Text::toT(xml.getChildData()); + } + xml.resetCurrentChild(); + if(xml.findChild("Forum")) { + links.discuss = Text::toT(xml.getChildData()); + } + xml.stepOut(); } xml.stepOut(); } catch (const Exception&) { Modified: dcplusplus/trunk/win32/PrivateFrame.h =================================================================== --- dcplusplus/trunk/win32/PrivateFrame.h 2008-02-17 11:51:38 UTC (rev 1011) +++ dcplusplus/trunk/win32/PrivateFrame.h 2008-02-17 21:23:07 UTC (rev 1012) @@ -38,7 +38,7 @@ static void gotMessage(SmartWin::WidgetTabView* mdiParent, const UserPtr& from, const UserPtr& to, const UserPtr& replyTo, const tstring& aMessage); static void openWindow(SmartWin::WidgetTabView* mdiParent, const UserPtr& replyTo, const tstring& aMessage = Util::emptyStringT); - static bool isOpen(const UserPtr u) { return frames.find(u) != frames.end(); } + static bool isOpen(const UserPtr& u) { return frames.find(u) != frames.end(); } static void closeAll(); static void closeAllOffline(); Modified: dcplusplus/trunk/win32/TransferView.cpp =================================================================== --- dcplusplus/trunk/win32/TransferView.cpp 2008-02-17 11:51:38 UTC (rev 1011) +++ dcplusplus/trunk/win32/TransferView.cpp 2008-02-17 21:23:07 UTC (rev 1012) @@ -734,15 +734,17 @@ speak(CONNECTIONS_UPDATE, ui); } -void TransferView::on(DownloadManagerListener::Tick, const DownloadList& dl) throw() { - for(DownloadList::const_iterator j = dl.begin(); j != dl.end(); ++j) { - Download* d = *j; +void TransferView::onTransferTick(Transfer* t) { + UpdateInfo* ui = new UpdateInfo(d->getUser(), true); + ui->setTransfered(t->getPos(), t->getActual()); + ui->setSpeed(t->getAverageSpeed()); + ui->setChunk(t->getPos(), t->getSize()); + tasks.add(CONNECTIONS_UPDATE, ui); +} - UpdateInfo* ui = new UpdateInfo(d->getUser(), true); - ui->setTransfered(d->getPos(), d->getActual()); - ui->setSpeed(d->getAverageSpeed()); - ui->setChunk(d->getPos(), d->getSize()); - tasks.add(CONNECTIONS_UPDATE, ui); +void TransferView::on(DownloadManagerListener::Tick, const DownloadList& dl) throw() { + for(DownloadList::const_iterator i = dl.begin(); i != dl.end(); ++i) { + onTransferTick(*i); } std::vector<TickInfo*> dis; @@ -812,15 +814,8 @@ } void TransferView::on(UploadManagerListener::Tick, const UploadList& ul) throw() { - for(UploadList::const_iterator j = ul.begin(); j != ul.end(); ++j) { - Upload* u = *j; - - UpdateInfo* ui = new UpdateInfo(u->getUser(), false); - ui->setTransfered(u->getPos(), u->getActual()); - ui->setSpeed(u->getAverageSpeed()); - ui->setChunk(u->getPos(), u->getSize()); - - tasks.add(CONNECTIONS_UPDATE, ui); + for(UploadList::const_iterator i = ul.begin(); i != ul.end(); ++i) { + onTransferTick(*i); } speak(); @@ -841,6 +836,7 @@ ui->setStatus(ConnectionInfo::STATUS_WAITING); ui->setStatusString(T_("Idle")); + ui->setChunk(aTransfer->getPos(), aTransfer->getSize()); speak(CONNECTIONS_UPDATE, ui); } Modified: dcplusplus/trunk/win32/TransferView.h =================================================================== --- dcplusplus/trunk/win32/TransferView.h 2008-02-17 11:51:38 UTC (rev 1011) +++ dcplusplus/trunk/win32/TransferView.h 2008-02-17 21:23:07 UTC (rev 1012) @@ -291,6 +291,7 @@ virtual void on(QueueManagerListener::Removed, QueueItem*) throw(); + void onTransferTick(Transfer* aTransfer); void onTransferComplete(Transfer* aTransfer, bool isUpload); void starting(UpdateInfo* ui, Transfer* t); Modified: dcplusplus/trunk/win32/WaitingUsersFrame.cpp =================================================================== --- dcplusplus/trunk/win32/WaitingUsersFrame.cpp 2008-02-17 11:51:38 UTC (rev 1011) +++ dcplusplus/trunk/win32/WaitingUsersFrame.cpp 2008-02-17 21:23:07 UTC (rev 1012) @@ -180,11 +180,11 @@ } // UploadManagerListener -void WaitingUsersFrame::on(UploadManagerListener::WaitingRemoveUser, const UserPtr aUser) throw() { +void WaitingUsersFrame::on(UploadManagerListener::WaitingRemoveUser, const UserPtr& aUser) throw() { speak(SPEAK_REMOVE_USER, (LPARAM)new UserItem(aUser)); } -void WaitingUsersFrame::on(UploadManagerListener::WaitingAddFile, const UserPtr aUser, const string& aFilename) throw() { +void WaitingUsersFrame::on(UploadManagerListener::WaitingAddFile, const UserPtr& aUser, const string& aFilename) throw() { speak(SPEAK_ADD_FILE, (LPARAM)new pair<UserPtr, string>(aUser, aFilename)); } Modified: dcplusplus/trunk/win32/WaitingUsersFrame.h =================================================================== --- dcplusplus/trunk/win32/WaitingUsersFrame.h 2008-02-17 11:51:38 UTC (rev 1011) +++ dcplusplus/trunk/win32/WaitingUsersFrame.h 2008-02-17 21:23:07 UTC (rev 1012) @@ -89,8 +89,8 @@ void updateSearch(int index, BOOL doDelete = TRUE); // UploadManagerListener - virtual void on(UploadManagerListener::WaitingRemoveUser, const UserPtr) throw(); - virtual void on(UploadManagerListener::WaitingAddFile, const UserPtr, const string&) throw(); + virtual void on(UploadManagerListener::WaitingRemoveUser, const UserPtr&) throw(); + virtual void on(UploadManagerListener::WaitingAddFile, const UserPtr&, const string&) throw(); }; #endif /* WAITING_QUEUE_FRAME_H */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2008-02-17 11:51:41
|
Revision: 1011 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1011&view=rev Author: arnetheduck Date: 2008-02-17 03:51:38 -0800 (Sun, 17 Feb 2008) Log Message: ----------- Patches, download manager cleanup, copyright year Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/ADLSearch.cpp dcplusplus/trunk/dcpp/ADLSearch.h dcplusplus/trunk/dcpp/AdcCommand.cpp dcplusplus/trunk/dcpp/AdcCommand.h dcplusplus/trunk/dcpp/AdcHub.cpp dcplusplus/trunk/dcpp/AdcHub.h dcplusplus/trunk/dcpp/BZUtils.cpp dcplusplus/trunk/dcpp/BZUtils.h dcplusplus/trunk/dcpp/BitInputStream.h dcplusplus/trunk/dcpp/BitOutputStream.h dcplusplus/trunk/dcpp/BloomFilter.h dcplusplus/trunk/dcpp/BufferedSocket.cpp dcplusplus/trunk/dcpp/BufferedSocket.h dcplusplus/trunk/dcpp/BufferedSocketListener.h dcplusplus/trunk/dcpp/CID.h dcplusplus/trunk/dcpp/Client.cpp dcplusplus/trunk/dcpp/Client.h dcplusplus/trunk/dcpp/ClientManager.cpp dcplusplus/trunk/dcpp/ClientManager.h dcplusplus/trunk/dcpp/ClientManagerListener.h dcplusplus/trunk/dcpp/ConnectionManager.cpp dcplusplus/trunk/dcpp/ConnectionManager.h dcplusplus/trunk/dcpp/ConnectionManagerListener.h dcplusplus/trunk/dcpp/CriticalSection.h dcplusplus/trunk/dcpp/CryptoManager.cpp dcplusplus/trunk/dcpp/CryptoManager.h dcplusplus/trunk/dcpp/DCPlusPlus.cpp dcplusplus/trunk/dcpp/DCPlusPlus.h dcplusplus/trunk/dcpp/DirectoryListing.cpp dcplusplus/trunk/dcpp/DirectoryListing.h dcplusplus/trunk/dcpp/Download.cpp dcplusplus/trunk/dcpp/DownloadManager.cpp dcplusplus/trunk/dcpp/DownloadManager.h dcplusplus/trunk/dcpp/DownloadManagerListener.h dcplusplus/trunk/dcpp/Encoder.cpp dcplusplus/trunk/dcpp/Encoder.h dcplusplus/trunk/dcpp/Exception.h dcplusplus/trunk/dcpp/FastAlloc.h dcplusplus/trunk/dcpp/FavoriteManager.cpp dcplusplus/trunk/dcpp/FavoriteManager.h dcplusplus/trunk/dcpp/FavoriteManagerListener.h dcplusplus/trunk/dcpp/FavoriteUser.h dcplusplus/trunk/dcpp/File.cpp dcplusplus/trunk/dcpp/File.h dcplusplus/trunk/dcpp/FilteredFile.h dcplusplus/trunk/dcpp/FinishedManager.cpp dcplusplus/trunk/dcpp/FinishedManager.h dcplusplus/trunk/dcpp/FinishedManagerListener.h dcplusplus/trunk/dcpp/HashManager.cpp dcplusplus/trunk/dcpp/HashManager.h dcplusplus/trunk/dcpp/HashValue.h dcplusplus/trunk/dcpp/HttpConnection.cpp dcplusplus/trunk/dcpp/HttpConnection.h dcplusplus/trunk/dcpp/HubEntry.h dcplusplus/trunk/dcpp/LogManager.cpp dcplusplus/trunk/dcpp/LogManager.h dcplusplus/trunk/dcpp/MerkleCheckOutputStream.h dcplusplus/trunk/dcpp/MerkleTree.h dcplusplus/trunk/dcpp/NmdcHub.cpp dcplusplus/trunk/dcpp/NmdcHub.h dcplusplus/trunk/dcpp/Pointer.h dcplusplus/trunk/dcpp/QueueItem.cpp dcplusplus/trunk/dcpp/QueueItem.h dcplusplus/trunk/dcpp/QueueManager.cpp dcplusplus/trunk/dcpp/QueueManager.h dcplusplus/trunk/dcpp/QueueManagerListener.h dcplusplus/trunk/dcpp/ResourceManager.cpp dcplusplus/trunk/dcpp/ResourceManager.h dcplusplus/trunk/dcpp/SFVReader.cpp dcplusplus/trunk/dcpp/SFVReader.h dcplusplus/trunk/dcpp/SSLSocket.cpp dcplusplus/trunk/dcpp/SSLSocket.h dcplusplus/trunk/dcpp/SearchManager.cpp dcplusplus/trunk/dcpp/SearchManager.h dcplusplus/trunk/dcpp/SearchManagerListener.h dcplusplus/trunk/dcpp/Segment.h dcplusplus/trunk/dcpp/Semaphore.h dcplusplus/trunk/dcpp/ServerSocket.cpp dcplusplus/trunk/dcpp/ServerSocket.h dcplusplus/trunk/dcpp/SettingsManager.cpp dcplusplus/trunk/dcpp/SettingsManager.h dcplusplus/trunk/dcpp/ShareManager.cpp dcplusplus/trunk/dcpp/ShareManager.h dcplusplus/trunk/dcpp/SimpleXML.cpp dcplusplus/trunk/dcpp/SimpleXML.h dcplusplus/trunk/dcpp/Singleton.h dcplusplus/trunk/dcpp/Socket.cpp dcplusplus/trunk/dcpp/Socket.h dcplusplus/trunk/dcpp/Speaker.h dcplusplus/trunk/dcpp/Streams.h dcplusplus/trunk/dcpp/StringSearch.h dcplusplus/trunk/dcpp/StringTokenizer.cpp dcplusplus/trunk/dcpp/StringTokenizer.h dcplusplus/trunk/dcpp/TaskQueue.h dcplusplus/trunk/dcpp/Text.cpp dcplusplus/trunk/dcpp/Text.h dcplusplus/trunk/dcpp/Thread.cpp dcplusplus/trunk/dcpp/Thread.h dcplusplus/trunk/dcpp/TigerHash.cpp dcplusplus/trunk/dcpp/TigerHash.h dcplusplus/trunk/dcpp/TimerManager.cpp dcplusplus/trunk/dcpp/TimerManager.h dcplusplus/trunk/dcpp/Transfer.cpp dcplusplus/trunk/dcpp/Transfer.h dcplusplus/trunk/dcpp/Upload.cpp dcplusplus/trunk/dcpp/UploadManager.cpp dcplusplus/trunk/dcpp/UploadManager.h dcplusplus/trunk/dcpp/User.cpp dcplusplus/trunk/dcpp/User.h dcplusplus/trunk/dcpp/UserCommand.h dcplusplus/trunk/dcpp/UserConnection.cpp dcplusplus/trunk/dcpp/UserConnection.h dcplusplus/trunk/dcpp/UserConnectionListener.h dcplusplus/trunk/dcpp/Util.cpp dcplusplus/trunk/dcpp/Util.h dcplusplus/trunk/dcpp/ZUtils.cpp dcplusplus/trunk/dcpp/ZUtils.h dcplusplus/trunk/dcpp/forward.h dcplusplus/trunk/dcpp/stdinc.cpp dcplusplus/trunk/dcpp/stdinc.h dcplusplus/trunk/dcpp/version.h dcplusplus/trunk/help/gen_changelog.py dcplusplus/trunk/win32/ADLSProperties.cpp dcplusplus/trunk/win32/ADLSProperties.h dcplusplus/trunk/win32/ADLSearchFrame.cpp dcplusplus/trunk/win32/ADLSearchFrame.h dcplusplus/trunk/win32/AboutDlg.cpp dcplusplus/trunk/win32/AboutDlg.h dcplusplus/trunk/win32/Advanced3Page.cpp dcplusplus/trunk/win32/Advanced3Page.h dcplusplus/trunk/win32/AdvancedPage.cpp dcplusplus/trunk/win32/AdvancedPage.h dcplusplus/trunk/win32/Appearance2Page.cpp dcplusplus/trunk/win32/Appearance2Page.h dcplusplus/trunk/win32/AppearancePage.cpp dcplusplus/trunk/win32/AppearancePage.h dcplusplus/trunk/win32/AspectSpeaker.h dcplusplus/trunk/win32/AspectStatus.h dcplusplus/trunk/win32/AspectUserCommand.h dcplusplus/trunk/win32/CertificatesPage.cpp dcplusplus/trunk/win32/CertificatesPage.h dcplusplus/trunk/win32/CommandDlg.cpp dcplusplus/trunk/win32/CommandDlg.h dcplusplus/trunk/win32/DirectoryListingFrame.cpp dcplusplus/trunk/win32/DirectoryListingFrame.h dcplusplus/trunk/win32/DownloadPage.cpp dcplusplus/trunk/win32/DownloadPage.h dcplusplus/trunk/win32/FavHubProperties.cpp dcplusplus/trunk/win32/FavHubProperties.h dcplusplus/trunk/win32/FavHubsFrame.cpp dcplusplus/trunk/win32/FavHubsFrame.h dcplusplus/trunk/win32/FavoriteDirsPage.cpp dcplusplus/trunk/win32/FavoriteDirsPage.h dcplusplus/trunk/win32/FinishedDLFrame.cpp dcplusplus/trunk/win32/FinishedDLFrame.h dcplusplus/trunk/win32/FinishedFrameBase.h dcplusplus/trunk/win32/FinishedULFrame.cpp dcplusplus/trunk/win32/FinishedULFrame.h dcplusplus/trunk/win32/GeneralPage.cpp dcplusplus/trunk/win32/GeneralPage.h dcplusplus/trunk/win32/HashProgressDlg.cpp dcplusplus/trunk/win32/HashProgressDlg.h dcplusplus/trunk/win32/HoldRedraw.h dcplusplus/trunk/win32/HubFrame.cpp dcplusplus/trunk/win32/HubFrame.h dcplusplus/trunk/win32/HubListsDlg.cpp dcplusplus/trunk/win32/HubListsDlg.h dcplusplus/trunk/win32/LineDlg.cpp dcplusplus/trunk/win32/LineDlg.h dcplusplus/trunk/win32/LogPage.cpp dcplusplus/trunk/win32/LogPage.h dcplusplus/trunk/win32/MDIChildFrame.h dcplusplus/trunk/win32/MagnetDlg.cpp dcplusplus/trunk/win32/MagnetDlg.h dcplusplus/trunk/win32/MainWindow.cpp dcplusplus/trunk/win32/MainWindow.h dcplusplus/trunk/win32/MainWindowFactory.cpp dcplusplus/trunk/win32/NetworkPage.cpp dcplusplus/trunk/win32/NetworkPage.h dcplusplus/trunk/win32/NotepadFrame.cpp dcplusplus/trunk/win32/NotepadFrame.h dcplusplus/trunk/win32/PrivateFrame.cpp dcplusplus/trunk/win32/PrivateFrame.h dcplusplus/trunk/win32/PropPage.cpp dcplusplus/trunk/win32/PropPage.h dcplusplus/trunk/win32/PublicHubsFrame.cpp dcplusplus/trunk/win32/PublicHubsFrame.h dcplusplus/trunk/win32/QueueFrame.cpp dcplusplus/trunk/win32/QueueFrame.h dcplusplus/trunk/win32/QueuePage.cpp dcplusplus/trunk/win32/QueuePage.h dcplusplus/trunk/win32/SearchFrame.cpp dcplusplus/trunk/win32/SearchFrame.h dcplusplus/trunk/win32/SettingsDialog.cpp dcplusplus/trunk/win32/SettingsDialog.h dcplusplus/trunk/win32/ShellContextMenu.cpp dcplusplus/trunk/win32/ShellContextMenu.h dcplusplus/trunk/win32/SplashWindow.cpp dcplusplus/trunk/win32/SpyFrame.cpp dcplusplus/trunk/win32/SpyFrame.h dcplusplus/trunk/win32/StaticFrame.h dcplusplus/trunk/win32/StatsFrame.cpp dcplusplus/trunk/win32/StatsFrame.h dcplusplus/trunk/win32/SystemFrame.cpp dcplusplus/trunk/win32/SystemFrame.h dcplusplus/trunk/win32/TabsPage.cpp dcplusplus/trunk/win32/TabsPage.h dcplusplus/trunk/win32/TextFrame.cpp dcplusplus/trunk/win32/TextFrame.h dcplusplus/trunk/win32/TransferView.cpp dcplusplus/trunk/win32/UCPage.cpp dcplusplus/trunk/win32/UCPage.h dcplusplus/trunk/win32/UPnP.cpp dcplusplus/trunk/win32/UPnP.h dcplusplus/trunk/win32/UploadPage.cpp dcplusplus/trunk/win32/UploadPage.h dcplusplus/trunk/win32/UserInfoBase.cpp dcplusplus/trunk/win32/UserInfoBase.h dcplusplus/trunk/win32/UsersFrame.cpp dcplusplus/trunk/win32/UsersFrame.h dcplusplus/trunk/win32/WaitingUsersFrame.h dcplusplus/trunk/win32/WidgetFactory.h dcplusplus/trunk/win32/WidgetPaned.h dcplusplus/trunk/win32/WidgetTextBox.h dcplusplus/trunk/win32/WinUtil.cpp dcplusplus/trunk/win32/WinUtil.h dcplusplus/trunk/win32/WindowsPage.cpp dcplusplus/trunk/win32/WindowsPage.h dcplusplus/trunk/win32/stdafx.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2008-02-15 16:46:35 UTC (rev 1010) +++ dcplusplus/trunk/changelog.txt 2008-02-17 11:51:38 UTC (rev 1011) @@ -15,24 +15,25 @@ * Fixed search spy crash * Upgraded to bzip 1.0.4 (thanks mikejj) * Tab tooltips (thanks poy) -* Allow spaces in the description field (poy) -* [ADC] Handle third person formatting (thanks poy) -* Fix right-click issue when chat history is long (thanks poy) -* In waiting users, show requested chunk (since we can't know % done) -* Fixed crash when download connection was disconnected before any data was received +* [L#185724] Allow spaces in the description field (poy) +* [L#180321] [ADC] Handle third person formatting (thanks poy) +* [L#186429] Fix right-click issue when chat history is long (thanks poy) +* [L#188107] In waiting users, show requested chunk (since we can't know % done) +* [L#188585] Fixed crash when download connection was disconnected before any data was received * Fixed crash due to race condition on idle check (thans bigmuscle) * Fixed crash when copying identity * Fixed potential timer race condition (thanks bigmuscle) * The good parts of partially downloaded segments are now added to queue (thanks bigmuscle) * Fancy menus (thanks poy) -* [ADC] Added /me handling (thanks poy) -* Fixed issues with scrolling (thanks poy) -* Fixed re-add sources showing wrong sources (thanks poy) -* Fixed kick message filtering (thanks mikejj) +* [L#180321] [ADC] Added /me handling (thanks poy) +* [L#187288] Fixed issues with scrolling (thanks poy) +* [L#190463] Fixed re-add sources showing wrong sources (thanks poy) +* [L#190469] Fixed kick message filtering (thanks mikejj) * version.xml now use Coral (ullner) * [ADC] Number of files counts unique files when sending stats to hub * [ADC] Fixed kick handling -* Fixed 100% on remove all sources in queue +* [L#190955] Fixed 100% on remove all sources in queue +* Fixed a few hardcoded dc++'s (thanks steven sheehy) * Don't always show the tray icon after killing and re-opening explorer.exe (poy) -- 0.704 2007-12-14 -- @@ -115,26 +116,26 @@ * Fixed one of several possible crashes at exit -- 0.700 2007-10-11 -- -* [bug 1102] Fixed move/rename queue folder (thanks mikael eman) -* [bug 1124] Fixed thread shutdown on *nix (thanks mikael eman) +* [B#1102] Fixed move/rename queue folder (thanks mikael eman) +* [B#1124] Fixed thread shutdown on *nix (thanks mikael eman) * Fixed invalid share size -* [bug 1127] Fixed crash on invalid file list (thanks steven sheehy) -* [bug 1019] Reworked initial filelist dir (thanks mikael eman) +* [B#1127] Fixed crash on invalid file list (thanks steven sheehy) +* [B#1019] Reworked initial filelist dir (thanks mikael eman) * Moved to smartwin to enable mingw compiling (thanks cologic, ullner, poy) * Removed notepad loading compatibility code for notepad texts from versions < 0.20 * Fixed time issues with DC++ running for more than 49 days -* [bug 980] Fixed PM's when popup is disabled (thanks ullner) -* [bug 1066] Search for alternates not available on uploads (thanks ullner) -* [bug 1104] Better error message on dupe source (thanks ullner) -* [bug 1132] Download queue updated when users go offline (thanks stephan hohe) -* [bug 1133] Fixed max tab rows being reset (thanks mikejj) -* [bug 1134] Use SO_REUSEADDR for connection manager socket (thanks mikael eman) -* [bug 1136] Fixed dupe changelog rebuild (thanks mikejj) -* [bug 1139] Fixed download delay in some cases (thanks mikael eman) -* [bug 1144] Added possibility to add many hub lists in one go (use ; as separator) (thanks poy) -* [bug 1152] Only refresh if there are directories shared (thanks ullner) -* [bug 1153] More shell menus (thanks poy) -* [bug 1159] Removed unnecessary resume position reset (thanks cologic) +* [B#980] Fixed PM's when popup is disabled (thanks ullner) +* [B#1066] Search for alternates not available on uploads (thanks ullner) +* [B#1104] Better error message on dupe source (thanks ullner) +* [B#1132] Download queue updated when users go offline (thanks stephan hohe) +* [B#1133] Fixed max tab rows being reset (thanks mikejj) +* [B#1134] Use SO_REUSEADDR for connection manager socket (thanks mikael eman) +* [B#1136] Fixed dupe changelog rebuild (thanks mikejj) +* [B#1139] Fixed download delay in some cases (thanks mikael eman) +* [B#1144] Added possibility to add many hub lists in one go (use ; as separator) (thanks poy) +* [B#1152] Only refresh if there are directories shared (thanks ullner) +* [B#1153] More shell menus (thanks poy) +* [B#1159] Removed unnecessary resume position reset (thanks cologic) * Removed rollback support - advanced TTH resume is now always used (thanks cologic) * Switched to mingw/stlport5.1 * Uninstaller removes adc registry key (thanks ullner) @@ -159,31 +160,31 @@ * SFV checking is now default * Fixed TLS port not being greyed out * Automatic hub reconnection is only done if at least one successful connection has been made -* [bug 1080] Better nick tab completion (thanks cologic) -* [bug 1081] Added user IP in hub frame (thanks cologic) +* [B#1080] Better nick tab completion (thanks cologic) +* [B#1081] Added user IP in hub frame (thanks cologic) * No more STLport for the time being * Linux checks for invalid file types (thanks steven sheehy) * Fixed potential crash when search began with space -* [bug 1085] Better sound playing settings (thanks cologic / ullner) -* [bug 1111] OpenSSL compatibility and some unix fixes (thanks steven sheehy) -* [bug 1056] Added option to sort fav users above other users in hub frame (thanks poy) -* [bug 1063] Added option to show shell context menu in finished frame (thanks poy) -* [bug 1092] Fixed TTH tree being redownloaded (thanks stephan hohe) -* [bug 1097] Fixed waiting users being removed (thanks stephan hohe) -* [bug 1110] Added new adc hub list (thanks mafa_45) -* [bug 1091] Added new nmdc hub lists (thanks poy) -* [bug 1112] Port sign cleanup (thanks steven sheehy) +* [B#1085] Better sound playing settings (thanks cologic / ullner) +* [B#1111] OpenSSL compatibility and some unix fixes (thanks steven sheehy) +* [B#1056] Added option to sort fav users above other users in hub frame (thanks poy) +* [B#1063] Added option to show shell context menu in finished frame (thanks poy) +* [B#1092] Fixed TTH tree being redownloaded (thanks stephan hohe) +* [B#1097] Fixed waiting users being removed (thanks stephan hohe) +* [B#1110] Added new adc hub list (thanks mafa_45) +* [B#1091] Added new nmdc hub lists (thanks poy) +* [B#1112] Port sign cleanup (thanks steven sheehy) * [ADC] Fixed client-to-client connection sequence -* [bug 1064] Updated to YaSSL 1.5.0, should fix crash -* [bug 446] Public hub lists are cached and downloaded only when user requests it (thanks poy) -* [bug 1117] Fixed subfolders being created on filelist downloads (thanks mikael eman) -* [bug 1096] Updated credits in about box -* [bug 1123] Removed some typecasts (thanks stephan hohe) -* [bug 1099] Fixed "Readd all" spin -* [bug 1095] Fixed about dialog +* [B#1064] Updated to YaSSL 1.5.0, should fix crash +* [B#446] Public hub lists are cached and downloaded only when user requests it (thanks poy) +* [B#1117] Fixed subfolders being created on filelist downloads (thanks mikael eman) +* [B#1096] Updated credits in about box +* [B#1123] Removed some typecasts (thanks stephan hohe) +* [B#1099] Fixed "Readd all" spin +* [B#1095] Fixed about dialog -- 0.698 2006-10-10 -- -* [bug 1065] Code cleanup (thanks steven sheehy) +* [B#1065] Code cleanup (thanks steven sheehy) * Fixed readme.txt (thanks ullner) * More code cleanup * Fixed trusted/untrusted upload view @@ -198,20 +199,20 @@ * Fixed a few random crashes * [ADC] Removed obsolete DSC command * Fixed user list not being updated in some cases -* [bug 1071] Added fasthash for unix (thanks steven sheehy) +* [B#1071] Added fasthash for unix (thanks steven sheehy) -- 0.697 2006-09-29 -- * [ADC] Fixed a few protocol issues * Some code cleanup * Queue frame fixes and memory saves * TLS port change without restart fixed -* [bug 1007] Fixed nick character check +* [B#1007] Fixed nick character check * Fixed some transfer view sorting issues -* [bug 59] Added option to match all local lists +* [B#59] Added option to match all local lists -- 0.696 2006-09-22 -- * Fixed a possible deadlock -* [bug 1058] Removed some whitespace (big thanks to mikejj) +* [B#1058] Removed some whitespace (big thanks to mikejj) * Removed the possibility to download files without TTH * Removed the possibility to read *.DcLst files (no TTH, no i18n support) * Files with no TTH no longer show up in search and directory listings @@ -223,44 +224,44 @@ * Upgraded yaSSL to 1.4.0 * Fixed some SSL connection issues * Fixed on-the-fly compression of file lists -* [bug 1055] Stopped files.xml.bz2 from being deleted on linux (thanks dorian) -* [bug 1061] Log page fix (thanks fleetcommand) -* [bug 1033] Altered NMDC hubname/description detection slightly (thanks fleetcommand) -* [bug 1059] Fixed the possibility for users to become hidden in some cases (thanks fleetcommand) +* [B#1055] Stopped files.xml.bz2 from being deleted on linux (thanks dorian) +* [B#1061] Log page fix (thanks fleetcommand) +* [B#1033] Altered NMDC hubname/description detection slightly (thanks fleetcommand) +* [B#1059] Fixed the possibility for users to become hidden in some cases (thanks fleetcommand) -- 0.695 2006-09-10 -- * PM popup/ignore options updated, in nmdc a hub is any nick which hasn't sent a hello or myinfo, and a bot is a nick with myinfo without connection type -* [bug 125] Fixed out-of-order PM/quit -* [bug 224] Slots are no longer granted to disconnected users, instead disconnection is delayed a minute +* [B#125] Fixed out-of-order PM/quit +* [B#224] Slots are no longer granted to disconnected users, instead disconnection is delayed a minute * [NMDC] Fixed extra space in chat -* [bug 395] Fixed password being blanked -* [bug 419] Allowed changing case only when moving file in queue -* [bug 736] Fixed escaping of menu items -* [bug 1013] Fixed gcc warnings (thanks steven sheehy) -* [bug 1023] Fixed some large stack allocations (thanks steven sheehy) -* [bug 1026] Fixed some potential buffer overflows (thanks steven sheehy) -* [bug 1027] Improved unix socket support (thanks steven sheehy) -* [bug 1028] Improved big endian support (thanks steven sheehy) -* [bug 1029] Fixed BSD compile issue (thanks steven sheehy) -* [bug 1031] Fixed a crash after closing hub window (thanks bigmuscle/mikejj) -* [bug 1032] Fixed certificates help (thanks mikejj) +* [B#395] Fixed password being blanked +* [B#419] Allowed changing case only when moving file in queue +* [B#736] Fixed escaping of menu items +* [B#1013] Fixed gcc warnings (thanks steven sheehy) +* [B#1023] Fixed some large stack allocations (thanks steven sheehy) +* [B#1026] Fixed some potential buffer overflows (thanks steven sheehy) +* [B#1027] Improved unix socket support (thanks steven sheehy) +* [B#1028] Improved big endian support (thanks steven sheehy) +* [B#1029] Fixed BSD compile issue (thanks steven sheehy) +* [B#1031] Fixed a crash after closing hub window (thanks bigmuscle/mikejj) +* [B#1032] Fixed certificates help (thanks mikejj) * Added possibility to store configuration files in separate directory * Switched back to unicows for w9x users, opencow was missing too many functions -* [bug 876] Fixed lost tooltips (thanks poy and bigmuscle) -* [bug 1041] Fixed about tab order (thanks mikejj) -* [bug 1042] Fixed experts tab order (thanks mikejj) -* [bug 1047] Fixed possible nmdc crash (thanks guitarm) -* [bug 1049] Added tooltip to tab bar (thanks poy) -* [bug 1053] Fixed vista detection (thanks ullner) -* [bug 988] Fixed duplicate nicks -* [bug 1015] Fixed chevron text +* [B#876] Fixed lost tooltips (thanks poy and bigmuscle) +* [B#1041] Fixed about tab order (thanks mikejj) +* [B#1042] Fixed experts tab order (thanks mikejj) +* [B#1047] Fixed possible nmdc crash (thanks guitarm) +* [B#1049] Added tooltip to tab bar (thanks poy) +* [B#1053] Fixed vista detection (thanks ullner) +* [B#988] Fixed duplicate nicks +* [B#1015] Fixed chevron text * Default hub lists updated -- 0.694 2006-07-10 -- * Fixed crash in certificates page -* [bug 1005] Fixed linux compile issue (thanks tpo) -* [bug 1004] Fixed browse file list on self +* [B#1005] Fixed linux compile issue (thanks tpo) +* [B#1004] Fixed browse file list on self * Both .crt and .pem files are read as trusted certificates -- 0.693 2006-07-09 -- @@ -268,58 +269,58 @@ * Added language code to example language xml -- 0.692 2006-07-09 -- -* [bug 927] Fixed OP detection bug really (thanks mikejj) -* [bug 938] Added a few more ADC info fields (thanks ullner) -* [bug 939] Fixed hub info update (thanks ullner) -* [bug 940] Fixed a 64-bit compile error (thanks steven sheehy) -* [bug 942] Fixed atomic operations on unices (thanks tobias nygren) -* [bug 943] Fixed unix utsname compile issue (thanks tobias nygren) -* [bug 944] Fixed unix string conversion bug (thanks tobias nygren) -* [bug 945] Fixed unix mutex initialiser (thanks tobias nygren) -* [bug 946] Tiger hash supports big endian and 64-bit architectures (thanks tobias nygren) -* [bug 941] Updated usercount display (thanks mikejj) -* [bug 951] Fixed issue with high port numbers (thanks tpo) -* [bug 958] Search spy tth option automagically saved (thanks ullner) -* [bug 959] Code cleanup (thanks mikejj) -* [bug 966] Max hash speed fixed when fast hashing method is not used (thanks steven sheehy) -* [bug 967] Fixed path case-sensitivity issue (thanks steven sheehy) +* [B#927] Fixed OP detection bug really (thanks mikejj) +* [B#938] Added a few more ADC info fields (thanks ullner) +* [B#939] Fixed hub info update (thanks ullner) +* [B#940] Fixed a 64-bit compile error (thanks steven sheehy) +* [B#942] Fixed atomic operations on unices (thanks tobias nygren) +* [B#943] Fixed unix utsname compile issue (thanks tobias nygren) +* [B#944] Fixed unix string conversion bug (thanks tobias nygren) +* [B#945] Fixed unix mutex initialiser (thanks tobias nygren) +* [B#946] Tiger hash supports big endian and 64-bit architectures (thanks tobias nygren) +* [B#941] Updated usercount display (thanks mikejj) +* [B#951] Fixed issue with high port numbers (thanks tpo) +* [B#958] Search spy tth option automagically saved (thanks ullner) +* [B#959] Code cleanup (thanks mikejj) +* [B#966] Max hash speed fixed when fast hashing method is not used (thanks steven sheehy) +* [B#967] Fixed path case-sensitivity issue (thanks steven sheehy) * Fixed auto-reconnect -* [bug 936] Fixed duplicate entries in search hubs +* [B#936] Fixed duplicate entries in search hubs * Fixed some hub title display issues * Some spring cleanup -* [bug 970] Unix file permissions correctly set (thanks steven sheehy) +* [B#970] Unix file permissions correctly set (thanks steven sheehy) * [ADC] Allowed $ and | in nick/description * Fixed targetdrive bug for temp target location * Fixed a crash bug when hash data cannot be saved * Possibly fixed issues with queue items not being updated * Added warning when someone tries to spam hublist.org or dcpp.net with your client -* [bug 968] Fixed unix compile issue (thanks mikejj) -* [bug 975] Fixed silly warning (thanks mikejj) -* [bug 978] Fixed 64-bit compiler issue (thanks steven sheehy) -* [bug 988] Only unique nicks diplayed in title bar +* [B#968] Fixed unix compile issue (thanks mikejj) +* [B#975] Fixed silly warning (thanks mikejj) +* [B#978] Fixed 64-bit compiler issue (thanks steven sheehy) +* [B#988] Only unique nicks diplayed in title bar * Added protection from hubs/clients sending junk data resulting in high memory usage / crash * Updated to yaSSL 1.3.7 * Added a few TLS options; [U] in transfer status means untrusted TLS (encrypted but certificate not validated) * Added certificate generation, OpenSSL must be installed and in PATH for this to work -* [bug 996] Fixed an issue where directories that are hard to delete were created -* [bug 1000] Fixed linux compile issue (thanks steven sheehy) -* [bug 949] Fixed a crash when reading invalid XML files +* [B#996] Fixed an issue where directories that are hard to delete were created +* [B#1000] Fixed linux compile issue (thanks steven sheehy) +* [B#949] Fixed a crash when reading invalid XML files * TLS port may now be specified in settings and is only opened if TLS is enabled * Added TLS port to /connection -* [bug 977] Added copy hub address to hub right-click menu (thanks mikejj) -* [bug 1001] Fixed assertion on unix (thanks steven sheehy) +* [B#977] Added copy hub address to hub right-click menu (thanks mikejj) +* [B#1001] Fixed assertion on unix (thanks steven sheehy) -- 0.691 2006-06-03 -- * Links to bugzilla in html changelog -* [bug 122] Added userlist filter (thanks trem) -* [bug 578] Added search for alternates to transfers menu (thanks trem) -* [bug 861] Fixed auto-prio not being set correctly (thanks trem) -* [bug 878] Added close all ... to window menu (thanks trem) -* [bug 903] Holding shift while minimizing will use opposite tray setting (thanks joakim tosteberg) -* [bug 923] PM history always read (thanks trem) -* [bug 927] Fixed OP detection bug (thanks mikejj) -* [bug 929] Fixed list view flicker issues (thanks trem) -* [bug 931] Improved keyboard navigation (thanks trem) +* [B#122] Added userlist filter (thanks trem) +* [B#578] Added search for alternates to transfers menu (thanks trem) +* [B#861] Fixed auto-prio not being set correctly (thanks trem) +* [B#878] Added close all ... to window menu (thanks trem) +* [B#903] Holding shift while minimizing will use opposite tray setting (thanks joakim tosteberg) +* [B#923] PM history always read (thanks trem) +* [B#927] Fixed OP detection bug (thanks mikejj) +* [B#929] Fixed list view flicker issues (thanks trem) +* [B#931] Improved keyboard navigation (thanks trem) * Added "all" to hub list field search (thanks trem) * Fixed bug when sending active ADC search results * Updated to ADC 0.11 @@ -342,29 +343,29 @@ * Another fix for opencow * Fixed user command parameters not being remembered * Fixed ADC op commands -* [bug 464] Added option for masked password prompt (thanks ullner) -* [bug 922] Updated help links (thanks xan) +* [B#464] Added option for masked password prompt (thanks ullner) +* [B#922] Updated help links (thanks xan) * Fixed op count -* [bug 230] Added settings to tray menu -* [bug 403] Unfinished file lists deleted since they're never resumed anyway -* [bug 639] Separated remove user from queue menu option -* [bug 766] Fixed broken app titlebar +* [B#230] Added settings to tray menu +* [B#403] Unfinished file lists deleted since they're never resumed anyway +* [B#639] Separated remove user from queue menu option +* [B#766] Fixed broken app titlebar * Removed support for generating NMDC-style file lists (old clients won't be able to download from you) -- 0.689 2006-04-01 -- * Fixed displaying of available bytes when user list is off * Fixed a potential crash when not showing user list * Fixed 100% CPU bug on upload -* [bug 853] Fixed missing function in opencow +* [B#853] Fixed missing function in opencow -- 0.688 2006-03-18 -- * Fixed public hubs sorting (thanks mikejj) * Fixed a ZPipe issue (thanks jove) -* [bug 858] Fixed a 100% cpu / crash bug -* [bug 872] Fixed a pm issue hopefully -* [bug 812] Fixed pm's being sent to bots +* [B#858] Fixed a 100% cpu / crash bug +* [B#872] Fixed a pm issue hopefully +* [B#812] Fixed pm's being sent to bots * Files with invalid crc-32, as per their sfv file, are no longer shared -* [bug 873] Added connect to hub option (thanks joakim tosteberg) +* [B#873] Added connect to hub option (thanks joakim tosteberg) * Fixed an issue with linux file reading (thanks bart vullings and steven) * Added back/forward mouse/keyboard navigation to directory listing frame @@ -393,15 +394,15 @@ * Fixed "browse list" being available for NMDC users * [ADC] Removed obsolete CI field * Fixed missing upload progress -* [bug 89] Readded dynamic compression disabling +* [B#89] Readded dynamic compression disabling * Added filelist download speed to filelist browser status bar * Added advanced hublist filter (thanks trem) -* [bug 579] Fixed 0-byte files not being created if directory doesn't exist -* [bug 804] Cleaned up project files (thanks mikejj) +* [B#579] Fixed 0-byte files not being created if directory doesn't exist +* [B#804] Cleaned up project files (thanks mikejj) * Socket buffer size = 0 now means use system default -* [bug 789] Fixed wrong nick being copied (thanks ullner) -* [bug 794] [ADC] Fixed automatic reconnect (thanks ullner) -* [bug 806] Fixed description for favorite hubs (thanks ullner) +* [B#789] Fixed wrong nick being copied (thanks ullner) +* [B#794] [ADC] Fixed automatic reconnect (thanks ullner) +* [B#806] Fixed description for favorite hubs (thanks ullner) * Updated to latest ADC specs, this will break 0.68/0.681/0.6811 queue sources and fav users (for NMDC as well) * Fixed a bufferedsocket crash * [ADC] Fixed quitting user processing (thanks ullner) @@ -414,8 +415,8 @@ * Changed to open source version unicows for win9x users, perhaps this one will work better for you (see it as a last attempt; if it doesn't work, w9x support will be phased out completely unless someone else solves the win9x issues) -* [bug 774] Fixed invalid description being sent if hub modifies it -* [bug 818] Fixed default exit mnemonic +* [B#774] Fixed invalid description being sent if hub modifies it +* [B#818] Fixed default exit mnemonic * Fixed some more crashes (thanks bigmuscle) * Fixed some shutdown issues * Updated country database @@ -429,12 +430,12 @@ * Minor user command fix (thanks garg) * Removed some duplicate code (thanks trem) * Ctrl-a to select all items in a list (thanks garg) -* [bug 484] Added a check for multiple refreshes running at the same time (thanks trem) +* [B#484] Added a check for multiple refreshes running at the same time (thanks trem) * Fixed a few crashes here and there * Fixed no-slots message not being sent out always * Fixed yassl build locations (thanks mikejj) * Added ip resolve cache when searching (thanks trem) -* [bug 413] Failed file moves are now reported to the system log +* [B#413] Failed file moves are now reported to the system log -- 0.68 2006-01-08 -- * Changed the user identification process completely to work better with ADC. This leads to a more strict interpretation of @@ -443,7 +444,7 @@ this will rarely be used (since file lists are free and downloaded almost instantly) * Fixed international timestamps (thanks ullner) * Fixed targetdrive docs (thanks ullner) -* [bug 485] Fixed transfer list view flicker on WinXP +* [B#485] Fixed transfer list view flicker on WinXP * New connection settings, please check settings page * Connection type strings changed * No longer falls back to passive mode on failed UPnP @@ -451,35 +452,35 @@ * Removed some old favorite file format compatibility code * Added country to search frame (thanks paka) * Strftime fix (thanks garg) -* [bug 521] Help instead of readme shown on first startup (thanks paka) -* [bug 553] Minimize to tray and confirm appexit default to true (thanks paka) -* [bug 452] Fixed example.xml language file generation (thanks tpo) -* [bug 556] Fixed last searches purge (thanks sulan) -* [bug 73] Added option to disconnect slow sources (thanks paka) +* [B#521] Help instead of readme shown on first startup (thanks paka) +* [B#553] Minimize to tray and confirm appexit default to true (thanks paka) +* [B#452] Fixed example.xml language file generation (thanks tpo) +* [B#556] Fixed last searches purge (thanks sulan) +* [B#73] Added option to disconnect slow sources (thanks paka) * ADC hub counts updated correctly (thanks ullner) -* [bug 325] Added error message when adding dupe fav hub (thanks ullner) +* [B#325] Added error message when adding dupe fav hub (thanks ullner) * Updated bzip2 to 1.0.3 (thanks garg) * Some small *nix fixes (thanks poison) * Source path no longer saved for TTH enabled clients (saves memory and queue file space) -* [bug 335] Search window settings saved automatically (thanks mikejj) +* [B#335] Search window settings saved automatically (thanks mikejj) * Open folder selects file in explorer (thanks mikejj) * Local echo in pm window formatted as the other side should see it (thanks paka) * Fixed debug assertion (thanks tpo) * Dirty tabs settings improved (thanks ullner) * ZLib upgraded to 1.2.3, possibly fixing security issues (thanks garg) * Slot grants now last one connection instead of 10 minutes -* [bug 632] Subtotals shown when selecting users in hub frame (thanks cologic) -* [bug 625] /u chat command opens url (thanks pur) +* [B#632] Subtotals shown when selecting users in hub frame (thanks cologic) +* [B#625] /u chat command opens url (thanks pur) * [NMDC] The first word of hub name is taken as short name for displaying purposes when space is limited -* [bug 629] Waiting users frame added (thanks cologic) +* [B#629] Waiting users frame added (thanks cologic) * Removed old versions check (thanks cologic) -* [bug 635] Added option to limit maximum file list size to open (thanks paka) +* [B#635] Added option to limit maximum file list size to open (thanks paka) * Filelist transfer logging default to off (thanks paka) * Added some checks when creating fav hubs (thanks tpo) * More settings screen updates (thanks ullner) * Fixed linux file moving (thanks naga) -* [bug 260] Added option to only download files with TTH (thanks ullner) -* [bug 708] Fixed registry creation functions used (thanks ullner) +* [B#260] Added option to only download files with TTH (thanks ullner) +* [B#708] Fixed registry creation functions used (thanks ullner) * Updated WTL * Rewrote socket code to remove some old hacks and add some new (major change) * Now using standard windows error messages for socket errors @@ -497,12 +498,12 @@ * Improved hashing error reporting * Fixed hash database rebuild * Added /removefav command to remove a favorite hub (thanks ullner) -* [bug 717] Fixed search combo box (thanks mikejj) +* [B#717] Fixed search combo box (thanks mikejj) * Added option to change auto-refresh interval (thanks ullner) -* [bug 740] Removed tab completion option (thanks ullner) -* [bug 743] Added registry key creation failure notification (thanks ullner) -* [bug 717] Fixed dropdown sizes (thanks mikejj) -* [bug 760] Fixed list subtraction issue (thanks cologic) +* [B#740] Removed tab completion option (thanks ullner) +* [B#743] Added registry key creation failure notification (thanks ullner) +* [B#717] Fixed dropdown sizes (thanks mikejj) +* [B#760] Fixed list subtraction issue (thanks cologic) * Added some right-to-left support, but it probably needs more work * [NMDC] Minislots are no longer given to old DC++ clients (<0.304) * [ADC] Directory size returned with search results @@ -517,7 +518,7 @@ * Fixed context menu open for multi-screen setups (thanks trem) * Changed country database to the original format so that users can update by themselves (thanks paka) * Fixed some registry issues (thanks trem) -* [bug 443] Fixed localised number encodings (thanks trem) +* [B#443] Fixed localised number encodings (thanks trem) * Updated sorting to use a more windows-like order (thanks trem) * Fixed an issue with restore all (thanks krzysztof tyszecki) * Added list view tooltips @@ -538,10 +539,10 @@ -- 0.671 2005-03-19 -- * Added possibility to set minislot size (thanks ullner) -* [bug 22] Added possibility for multiline away messages and user commands (thanks ullner) +* [B#22] Added possibility for multiline away messages and user commands (thanks ullner) * Added file type to queue frame (thanks ullner) * Changed stats frame to use standard colors (thanks yoji) -* [bug 439] Fixed purge button (thanks ullner) +* [B#439] Fixed purge button (thanks ullner) * Fixed search frame only tth issue (thanks naga) * Updated to ADC 0.9 * Fixed a crash bug (thanks trem) @@ -557,40 +558,40 @@ * Basic ADC transfers now work * Added option to specify bind address for sockets (thanks sed) * Made the connection flood trigger slighly less sensitive -* [bug 58] Fixed strange user list behaviour -* [bug 83] Consolidated auto-open window options +* [B#58] Fixed strange user list behaviour +* [B#83] Consolidated auto-open window options * Fixed some context menu stuff -- 0.670 2005-02-04 -- * Fixed an issue with international formats of float numbers (also fixes UDP port setting) * Fixed a minor crash log output address issue * Split off color and sound to a new page (thanks ullner) -* [bug 359] Fixed an issue with negative search terms (thanks naga) +* [B#359] Fixed an issue with negative search terms (thanks naga) * Added option to filter TTH results in search spy (thanks joakim tosteberg) -* [bug 184] Updated log functionality to allow users to customize log filenames (thanks naga) +* [B#184] Updated log functionality to allow users to customize log filenames (thanks naga) * Fixes to log edit function (thanks naga) * Added possibility to filter all searches without tth (thanks naga) * More preferences splitting (thanks ullner) * Small socket fix (thanks tremor) * Search tab goes bold if set to (thanks naga) * Hopefully fixed an UPnP crash -* [bug 302] User commands in file lists (thanks joakim tosteberg) +* [B#302] User commands in file lists (thanks joakim tosteberg) * ADC url's clickable (thanks naga) -* [Bug 117] Improved search timer to avoid spamming hub (thanks naga) +* [B#117] Improved search timer to avoid spamming hub (thanks naga) * Redid some of the hash storage code, should be slighly more efficient -* [bug 94] Share is cached for faster startup +* [B#94] Share is cached for faster startup * Temporary targetnames are now filled in when download starts, not when item is added to queue, which makes temp target dir changes happen for current queue items as well, plus we get a huge memory save on huge queues. -* [bug 363] Added "Remove All Sources" to queue (thanks izzzo & garg) +* [B#363] Added "Remove All Sources" to queue (thanks izzzo & garg) * Queue menu items greyed out when there are no items (thanks izzzo) * Fixed a crash with certain empty lists (thanks garg) * Added "restore all" to undo "minimize all" (thanks guitarm) * Added optional pm history (thanks trem and ullner) * Better log file managment (thanks trem) -* [bug 412] Fixed a queue count issue on removal (thanks ullner) -* [bug 9] Fixed a queue move issue (thanks paka) -* [bug 20] Fixed upload auto-slot granting (thanks naga) +* [B#412] Fixed a queue count issue on removal (thanks ullner) +* [B#9] Fixed a queue move issue (thanks paka) +* [B#20] Fixed upload auto-slot granting (thanks naga) * Redid adl search to accomodate for partial list browsing (thanks garg) * Added initial ADC file transfers support * ADC hub connectivity improved @@ -619,10 +620,10 @@ * Added exact file size to directory listings (thanks paka) * Remove confirm fix (thanks trem) * Added option for the new tab select behaviour (thanks trem) -* [bug 116] Added possibility to download to temp folder on the same drive as target (thanks sed) +* [B#116] Added possibility to download to temp folder on the same drive as target (thanks sed) * Fixed user command string for file list context (thanks sed) -* [bug 290] Added more correct escaping of search strings (thanks sed) -* [bug 432] Fixed download directory for adlsearch matches (thanks ullner) +* [B#290] Added more correct escaping of search strings (thanks sed) +* [B#432] Fixed download directory for adlsearch matches (thanks ullner) * Some UPnP fixes (thanks nils maier) * ADL Search byte prefix fixes, might screw up your adl search settings on first load (thanks ullner) * Linux download path fix (thanks jens oknelid) @@ -631,7 +632,7 @@ * Fixed alt source download starts (thanks paka) -- 0.668 2004-11-30 -- -* [bug 311] Fixed crash on open own filelist (thanks sulan) +* [B#311] Fixed crash on open own filelist (thanks sulan) * Added option to make /join open a new window (thanks ullner) * Added mailto: to link-clicking (thanks ullner) * Fixed stack overflow with excessive xml nesting (thanks farcry) @@ -642,18 +643,18 @@ * PgUp/PgDn now scroll the chat window (thanks jonathan stone) * Small fix with line history (thanks jonathan stone) * Added option to use separate TCP and UDP ports -* [bug 303] Fixed a raw command guessing bug (thanks garg) -* [bug 345] Fixed an xml listing parsing bug -* [bug 309] Hopefully fixed nt4 startup +* [B#303] Fixed a raw command guessing bug (thanks garg) +* [B#345] Fixed an xml listing parsing bug +* [B#309] Hopefully fixed nt4 startup * Hopefully fixed an issue with downloading international search results from old clients -- 0.667 2004-11-15 -- * Improved multiple hublist support (thanks garg) * Fixed some favdirs issues (thanks naga) * Fixed a status logging issue (thanks naga) -* [bug 289] Fixed annoying login issue +* [B#289] Fixed annoying login issue * Added possibility to rename shares (thanks naga and tremor) -* [bug 106] Fixed show joins for fav users (thanks ullner) +* [B#106] Fixed show joins for fav users (thanks ullner) * Fixed some unnecessary connects when download slots are full * Fixed magnet registration issue (thanks garg) * Some code documentation work (thanks jonathan jansson) @@ -671,64 +672,64 @@ * Fixed so that a connection attempt is made when changing a transfer to highest priority -- 0.666 2004-11-03 -- -* [bug 173] Fixed copy nick to clipboard (thanks trem) +* [B#173] Fixed copy nick to clipboard (thanks trem) * Removed some old code (thanks garg) * Added tth to log codes (thanks garg) * Added # of locally filtered results to search frame (thanks garg) * Fixed a crash in the upnp code * Fixed wide formatting of time (thanks garg) -* [bug 166] Added local filtering of searches with "-" in front of the search term (thanks cologic) +* [B#166] Added local filtering of searches with "-" in front of the search term (thanks cologic) * Fixed a missing hubframe stats bug (thanks trem) -* [bug 87] TTH's are now correctly searched for in search spy (thanks trem) -* [bug 256] Fixed an issue with utf8 user commands (thanks trem) +* [B#87] TTH's are now correctly searched for in search spy (thanks trem) +* [B#256] Fixed an issue with utf8 user commands (thanks trem) * Moved to a less intrusive build procedure where stlport and wtl are local to the DC++ build (see compile.txt) * Added /log to show log for current hub / user (thanks garg) * More internationalization (thanks garg) * Updated some template code (thanks farcry) * Extended log command (thanks ullner) -* [bug 212] Fixed issue with utf-8 nicks during login to some hubs (thanks garg) +* [B#212] Fixed issue with utf-8 nicks during login to some hubs (thanks garg) * Fixed issue with utf-8 time formatting for certain languages in certain locales * Removed search optimisation obsoleted by tth's and bloom filters (those of you with a large number of files in your share, post on the forum if you notice any big increase in CPU usage) -* [bug 69] Added option not to download files already in share (by TTH) (thanks TPO) +* [B#69] Added option not to download files already in share (by TTH) (thanks TPO) * Help file work (garg, ullner) * Added petabytes (PiB) (thanks garg) * Clicking on active tab will deactivate it (thanks garg) -* [bug 227] Fixed an issue with loading invalid virtual names when upgrading (thanks garg) -* [bug 256] Fixed another issue with user commands (thanks garg) +* [B#227] Fixed an issue with loading invalid virtual names when upgrading (thanks garg) +* [B#256] Fixed another issue with user commands (thanks garg) * Updated to WTL 7.5.4291 -* [bug 183] Hopefully fixed a few issues with w9x and Unicode +* [B#183] Hopefully fixed a few issues with w9x and Unicode * Fixed common control initialization * Unix makefile now generates a shared lib (thanks jeremy huddleston) * Slight memory save for hash database -* [bug 130] Added favorite hub removal confirmation option (thanks ullner) -* [bug 5] Fixed broken redirect (thanks garg) +* [B#130] Added favorite hub removal confirmation option (thanks ullner) +* [B#5] Fixed broken redirect (thanks garg) * Added spy frame column saving (thanks garg) * ADL Search autoqueue saved now (thanks garg) * Window minimization issue fix (thanks garg) -* [bug 129] Fixed some issues with downloading >4GiB files -* [bug 15] ADL Search goto directory fixed (thanks garg) +* [B#129] Fixed some issues with downloading >4GiB files +* [B#15] ADL Search goto directory fixed (thanks garg) * Some fixes for compiling on osx (thanks jonathan jansson) * Removed Makedefs in favour of a python script * FastAlloc disabled in debug builds -* [bug 266] Fixed a crash with offline users and user commands (thanks naga) -* [bug 165] Fixed a case insensitivity issue (thanks farcry) -* [bug 18] Added favorite download directories (thanks naga) +* [B#266] Fixed a crash with offline users and user commands (thanks naga) +* [B#165] Fixed a case insensitivity issue (thanks farcry) +* [B#18] Added favorite download directories (thanks naga) * Fixed MyINFO spam when hashing -- 0.4034 2004-10-03 -- * Help file additions (thanks naga & ullner) -* [bug 170] Fixed a few issues with files not being hashed correctly (thanks garg) +* [B#170] Fixed a few issues with files not being hashed correctly (thanks garg) * More ADC fixes (thanks sed) * Fixed some ADLSearch stuff (thanks garg) * Added item count to finished frames (thanks garg) * Fixed user commands encoding (thanks garg) * Added last search time to search spy (thanks ullner) -* [bug 3] Fixed queue size growing on queue item move +* [B#3] Fixed queue size growing on queue item move * Fixed missing file list on 0 byte share -* [bug 185] Fixed missing search results (thanks garg) +* [B#185] Fixed missing search results (thanks garg) -- 0.4033 2004-09-27 -- *** WARNING *** @@ -745,7 +746,7 @@ * Files that can't be moved to the target drive from the temp folder are now renamed to their real name * Text with unix and mac line end encodings should now be correctly displayed -* [bug 35] TTH Values are used for right click download menus when available +* [B#35] TTH Values are used for right click download menus when available * Upgraded to WTL 7.5.4196 * Updated license to allow others to release legal binaries compiled against WTL * Moved the core structures to UTF-8 to allow correct internationalisation (major change) @@ -758,7 +759,7 @@ * Removed autosearch string, it's not used any more * Fixed a tth hash speed bug (hashing should be much faster now) * File listings are now generated on the fly when someone needs them -* [bug 127] Added UPnP support (thanks mark gillespie) +* [B#127] Added UPnP support (thanks mark gillespie) * Ctrl-L now opens file lists (thanks garg) * Various ADC patches (thanks sedulus) * Slightly changed temporary download name @@ -774,7 +775,7 @@ * Files scheduled for viewing are always set to highest prio * Added rudimentary automake and autoconf support for the client part, perhaps this will encourage someone to finish a nice linux port -* [bug 162] Fixed dupe usercommands on reconnect (thanks sed) +* [B#162] Fixed dupe usercommands on reconnect (thanks sed) * Links now clickable in PM's and notepad as well (thanks naga) * Files are no longer hashed if the shared directory is removed while hashing * Added hash progress dialog, hashing is run at a higher priority when dialog is shown @@ -782,7 +783,7 @@ * Better strategy for removing old filelists on exit (thanks garg) * Added Geo-IP license and fixes (thanks garg) * Added Help file - make sure you read it (thanks garg) -* [bug 169] Fixed a memory leak with rollback buffers under certain conditions +* [B#169] Fixed a memory leak with rollback buffers under certain conditions * ADC INF updates only send the necessary info (thanks sed) -- 0.4032 2004-08-08 -- Modified: dcplusplus/trunk/dcpp/ADLSearch.cpp =================================================================== --- dcplusplus/trunk/dcpp/ADLSearch.cpp 2008-02-15 16:46:35 UTC (rev 1010) +++ dcplusplus/trunk/dcpp/ADLSearch.cpp 2008-02-17 11:51:38 UTC (rev 1011) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2007 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2008 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/dcpp/ADLSearch.h =================================================================== --- dcplusplus/trunk/dcpp/ADLSearch.h 2008-02-15 16:46:35 UTC (rev 1010) +++ dcplusplus/trunk/dcpp/ADLSearch.h 2008-02-17 11:51:38 UTC (rev 1011) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2007 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2008 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/dcpp/AdcCommand.cpp =================================================================== --- dcplusplus/trunk/dcpp/AdcCommand.cpp 2008-02-15 16:46:35 UTC (rev 1010) +++ dcplusplus/trunk/dcpp/AdcCommand.cpp 2008-02-17 11:51:38 UTC (rev 1011) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2007 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2008 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/dcpp/AdcCommand.h =================================================================== --- dcplusplus/trunk/dcpp/AdcCommand.h 2008-02-15 16:46:35 UTC (rev 1010) +++ dcplusplus/trunk/dcpp/AdcCommand.h 2008-02-17 11:51:38 UTC (rev 1011) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2007 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2008 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/dcpp/AdcHub.cpp =================================================================== --- dcplusplus/trunk/dcpp/AdcHub.cpp 2008-02-15 16:46:35 UTC (rev 1010) +++ dcplusplus/trunk/dcpp/AdcHub.cpp 2008-02-17 11:51:38 UTC (rev 1011) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2007 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2008 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -573,7 +573,7 @@ uint16_t port = secure ? ConnectionManager::getInstance()->getSecurePort() : ConnectionManager::getInstance()->getPort(); if(port == 0) { // Oops? - LogManager::getInstance()->message(_("Not listening for connections - please restart DC++")); + LogManager::getInstance()->message(str(F_("Not listening for connections - please restart %1%") % APPNAME)); return; } send(AdcCommand(AdcCommand::CMD_CTM, user.getIdentity().getSID(), AdcCommand::TYPE_DIRECT).addParam(*proto).addParam(Util::toString(port)).addParam(token)); Modified: dcplusplus/trunk/dcpp/AdcHub.h =================================================================== --- dcplusplus/trunk/dcpp/AdcHub.h 2008-02-15 16:46:35 UTC (rev 1010) +++ dcplusplus/trunk/dcpp/AdcHub.h 2008-02-17 11:51:38 UTC (rev 1011) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2007 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2008 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/dcpp/BZUtils.cpp =================================================================== --- dcplusplus/trunk/dcpp/BZUtils.cpp 2008-02-15 16:46:35 UTC (rev 1010) +++ dcplusplus/trunk/dcpp/BZUtils.cpp 2008-02-17 11:51:38 UTC (rev 1011) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2007 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2008 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/dcpp/BZUtils.h =================================================================== --- dcplusplus/trunk/dcpp/BZUtils.h 2008-02-15 16:46:35 UTC (rev 1010) +++ dcplusplus/trunk/dcpp/BZUtils.h 2008-02-17 11:51:38 UTC (rev 1011) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2007 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2008 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/dcpp/BitInputStream.h =================================================================== --- dcplusplus/trunk/dcpp/BitInputStream.h 2008-02-15 16:46:35 UTC (rev 1010) +++ dcplusplus/trunk/dcpp/BitInputStream.h 2008-02-17 11:51:38 UTC (rev 1011) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2007 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2008 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/dcpp/BitOutputStream.h =================================================================== --- dcplusplus/trunk/dcpp/BitOutputStream.h 2008-02-15 16:46:35 UTC (rev 1010) +++ dcplusplus/trunk/dcpp/BitOutputStream.h 2008-02-17 11:51:38 UTC (rev 1011) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2007 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2008 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/dcpp/BloomFilter.h =================================================================== --- dcplusplus/trunk/dcpp/BloomFilter.h 2008-02-15 16:46:35 UTC (rev 1010) +++ dcplusplus/trunk/dcpp/BloomFilter.h 2008-02-17 11:51:38 UTC (rev 1011) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2007 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2008 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/dcpp/BufferedSocket.cpp =================================================================== --- dcplusplus/trunk/dcpp/BufferedSocket.cpp 2008-02-15 16:46:35 UTC (rev 1010) +++ dcplusplus/trunk/dcpp/BufferedSocket.cpp 2008-02-17 11:51:38 UTC (rev 1011) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2007 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2008 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -430,6 +430,9 @@ return false; case ACCEPTED: break; + case UPDATED: + fire(BufferedSocketListener::Updated()); + break; } delete p.second; Modified: dcplusplus/trunk/dcpp/BufferedSocket.h =================================================================== --- dcplusplus/trunk/dcpp/BufferedSocket.h 2008-02-15 16:46:35 UTC (rev 1010) +++ dcplusplus/trunk/dcpp/BufferedSocket.h 2008-02-17 11:51:38 UTC (rev 1011) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2007 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2008 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -77,10 +77,13 @@ bool isTrusted() const { return sock && sock->isTrusted(); } std::string getCipherName() const { return sock ? sock->getCipherName() : Util::emptyString; } - void write(const string& aData) throw() { write(aData.data(), aData.length()); } + void write(const string& aData) { write(aData.data(), aData.length()); } void write(const char* aBuf, size_t aLen) throw(); /** Send the file f over this socket. */ - void transmitFile(InputStream* f) throw() { Lock l(cs); addTask(SEND_FILE, new SendFileInfo(f)); } + void transmitFile(InputStream* f) { Lock l(cs); addTask(SEND_FILE, new SendFileInfo(f)); } + + /** Send an updated signal to all listeners */ + void updated() { Lock l(cs); addTask(UPDATED, 0); } void disconnect(bool graceless = false) throw() { Lock l(cs); if(graceless) disconnecting = true; addTask(DISCONNECT, 0); } @@ -94,7 +97,8 @@ SEND_DATA, SEND_FILE, SHUTDOWN, - ACCEPTED + ACCEPTED, + UPDATED }; struct TaskData { Modified: dcplusplus/trunk/dcpp/BufferedSocketListener.h =================================================================== --- dcplusplus/trunk/dcpp/BufferedSocketListener.h 2008-02-15 16:46:35 UTC (rev 1010) +++ dcplusplus/trunk/dcpp/BufferedSocketListener.h 2008-02-17 11:51:38 UTC (rev 1011) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2007 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2008 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,6 +34,7 @@ typedef X<5> ModeChange; typedef X<6> TransmitDone; typedef X<7> Failed; + typedef X<8> Updated; virtual void on(Connecting) throw() { } virtual void on(Connected) throw() { } @@ -43,6 +44,7 @@ virtual void on(ModeChange) throw() { } virtual void on(TransmitDone) throw() { } virtual void on(Failed, const string&) throw() { } + virtual void on(Updated) throw() { } }; } // namespace dcpp Modified: dcplusplus/trunk/dcpp/CID.h =================================================================== --- dcplusplus/trunk/dcpp/CID.h 2008-02-15 16:46:35 UTC (rev 1010) +++... [truncated message content] |
From: <zou...@us...> - 2008-02-15 16:46:48
|
Revision: 1010 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1010&view=rev Author: zouzou123gen Date: 2008-02-15 08:46:35 -0800 (Fri, 15 Feb 2008) Log Message: ----------- Don't always show the tray icon after killing and re-opening explorer.exe Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/win32/MainWindow.cpp dcplusplus/trunk/win32/MainWindow.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2008-02-13 22:50:42 UTC (rev 1009) +++ dcplusplus/trunk/changelog.txt 2008-02-15 16:46:35 UTC (rev 1010) @@ -33,6 +33,7 @@ * [ADC] Number of files counts unique files when sending stats to hub * [ADC] Fixed kick handling * Fixed 100% on remove all sources in queue +* Don't always show the tray icon after killing and re-opening explorer.exe (poy) -- 0.704 2007-12-14 -- * Hub lists added to utilize Coral's distributed network (ullner) Modified: dcplusplus/trunk/win32/MainWindow.cpp =================================================================== --- dcplusplus/trunk/win32/MainWindow.cpp 2008-02-13 22:50:42 UTC (rev 1009) +++ dcplusplus/trunk/win32/MainWindow.cpp 2008-02-15 16:46:35 UTC (rev 1010) @@ -98,7 +98,7 @@ onClosing(std::tr1::bind(&MainWindow::closing, this)); - onRaw(std::tr1::bind(&MainWindow::trayMessage, this, _1, _2), SmartWin::Message(RegisterWindowMessage(_T("TaskbarCreated")))); + onRaw(std::tr1::bind(&MainWindow::handleTrayMessage, this), SmartWin::Message(RegisterWindowMessage(_T("TaskbarCreated")))); onRaw(std::tr1::bind(&MainWindow::handleEndSession, this, _1, _2), SmartWin::Message(WM_ENDSESSION)); onRaw(std::tr1::bind(&MainWindow::handleWhereAreYou, this, _1, _2), SmartWin::Message(SingleInstance::WMU_WHERE_ARE_YOU)); @@ -507,8 +507,9 @@ return true; } -LRESULT MainWindow::trayMessage(WPARAM wParam, LPARAM lParam) { - updateTray(true); +LRESULT MainWindow::handleTrayMessage() { + if(BOOLSETTING(MINIMIZE_TRAY) && isIconic()) + updateTray(true); return 0; } Modified: dcplusplus/trunk/win32/MainWindow.h =================================================================== --- dcplusplus/trunk/win32/MainWindow.h 2008-02-13 22:50:42 UTC (rev 1009) +++ dcplusplus/trunk/win32/MainWindow.h 2008-02-15 16:46:35 UTC (rev 1010) @@ -167,7 +167,7 @@ bool handleSized(const SmartWin::WidgetSizedEventResult& sz); LRESULT handleSpeaker(WPARAM wParam, LPARAM lParam); - LRESULT trayMessage(WPARAM wParam, LPARAM lParam); + LRESULT handleTrayMessage(); LRESULT handleCopyData(WPARAM wParam, LPARAM lParam); LRESULT handleWhereAreYou(WPARAM wParam, LPARAM lParam); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2008-02-13 22:50:46
|
Revision: 1009 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1009&view=rev Author: arnetheduck Date: 2008-02-13 14:50:42 -0800 (Wed, 13 Feb 2008) Log Message: ----------- typo fix (change variables as well?) Modified Paths: -------------- dcplusplus/trunk/win32/TransferView.cpp Modified: dcplusplus/trunk/win32/TransferView.cpp =================================================================== --- dcplusplus/trunk/win32/TransferView.cpp 2008-02-13 22:36:24 UTC (rev 1008) +++ dcplusplus/trunk/win32/TransferView.cpp 2008-02-13 22:50:42 UTC (rev 1009) @@ -43,7 +43,7 @@ N_("Status"), N_("Speed"), N_("Chunk"), - N_("Transfered (Ratio)"), + N_("Transferred (Ratio)"), N_("Queued"), N_("Cipher"), N_("IP") @@ -818,6 +818,7 @@ UpdateInfo* ui = new UpdateInfo(u->getUser(), false); ui->setTransfered(u->getPos(), u->getActual()); ui->setSpeed(u->getAverageSpeed()); + ui->setChunk(u->getPos(), u->getSize()); tasks.add(CONNECTIONS_UPDATE, ui); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2008-02-13 22:36:25
|
Revision: 1008 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1008&view=rev Author: arnetheduck Date: 2008-02-13 14:36:24 -0800 (Wed, 13 Feb 2008) Log Message: ----------- Warning fixes Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/win32/ADLSearchFrame.cpp dcplusplus/trunk/win32/HubFrame.cpp dcplusplus/trunk/win32/NotepadFrame.cpp dcplusplus/trunk/win32/PublicHubsFrame.cpp dcplusplus/trunk/win32/WaitingUsersFrame.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2008-02-13 22:06:33 UTC (rev 1007) +++ dcplusplus/trunk/changelog.txt 2008-02-13 22:36:24 UTC (rev 1008) @@ -31,6 +31,8 @@ * Fixed kick message filtering (thanks mikejj) * version.xml now use Coral (ullner) * [ADC] Number of files counts unique files when sending stats to hub +* [ADC] Fixed kick handling +* Fixed 100% on remove all sources in queue -- 0.704 2007-12-14 -- * Hub lists added to utilize Coral's distributed network (ullner) Modified: dcplusplus/trunk/win32/ADLSearchFrame.cpp =================================================================== --- dcplusplus/trunk/win32/ADLSearchFrame.cpp 2008-02-13 22:06:33 UTC (rev 1007) +++ dcplusplus/trunk/win32/ADLSearchFrame.cpp 2008-02-13 22:36:24 UTC (rev 1008) @@ -110,8 +110,6 @@ } void ADLSearchFrame::layout() { - const int border = 2; - SmartWin::Rectangle r(SmartWin::Point(0, 0), getClientAreaSize()); layoutStatus(r); Modified: dcplusplus/trunk/win32/HubFrame.cpp =================================================================== --- dcplusplus/trunk/win32/HubFrame.cpp 2008-02-13 22:06:33 UTC (rev 1007) +++ dcplusplus/trunk/win32/HubFrame.cpp 2008-02-13 22:36:24 UTC (rev 1008) @@ -1097,6 +1097,7 @@ case GREATER: insert = (size < ui.getIdentity().getBytesShared()); break; case LESS: insert = (size > ui.getIdentity().getBytesShared()); break; case NOT_EQUAL: insert = (size != ui.getIdentity().getBytesShared()); break; + case NONE: ; break; } } else { if(sel >= COLUMN_LAST) { Modified: dcplusplus/trunk/win32/NotepadFrame.cpp =================================================================== --- dcplusplus/trunk/win32/NotepadFrame.cpp 2008-02-13 22:06:33 UTC (rev 1007) +++ dcplusplus/trunk/win32/NotepadFrame.cpp 2008-02-13 22:36:24 UTC (rev 1008) @@ -66,8 +66,6 @@ } void NotepadFrame::layout() { - const int border = 2; - SmartWin::Rectangle r(SmartWin::Point(0, 0), getClientAreaSize()); layoutStatus(r); Modified: dcplusplus/trunk/win32/PublicHubsFrame.cpp =================================================================== --- dcplusplus/trunk/win32/PublicHubsFrame.cpp 2008-02-13 22:06:33 UTC (rev 1007) +++ dcplusplus/trunk/win32/PublicHubsFrame.cpp 2008-02-13 22:36:24 UTC (rev 1008) @@ -419,6 +419,7 @@ case GREATER: insert = (size < entrySize); break; case LESS: insert = (size > entrySize); break; case NOT_EQUAL: insert = (size != entrySize); break; + case NONE: ; break; } } else { if(sel >= COLUMN_LAST) { Modified: dcplusplus/trunk/win32/WaitingUsersFrame.cpp =================================================================== --- dcplusplus/trunk/win32/WaitingUsersFrame.cpp 2008-02-13 22:06:33 UTC (rev 1007) +++ dcplusplus/trunk/win32/WaitingUsersFrame.cpp 2008-02-13 22:36:24 UTC (rev 1008) @@ -53,10 +53,7 @@ } // Recalculate frame control layout -void WaitingUsersFrame::layout() -{ - const int border = 2; - +void WaitingUsersFrame::layout() { SmartWin::Rectangle r(this->getClientAreaSize()); layoutStatus(r); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2008-02-13 22:06:36
|
Revision: 1007 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1007&view=rev Author: arnetheduck Date: 2008-02-13 14:06:33 -0800 (Wed, 13 Feb 2008) Log Message: ----------- Bugfixes Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/AdcHub.cpp dcplusplus/trunk/dcpp/ClientListener.h dcplusplus/trunk/dcpp/NmdcHub.cpp dcplusplus/trunk/dcpp/ShareManager.cpp dcplusplus/trunk/win32/HubFrame.cpp dcplusplus/trunk/win32/HubFrame.h dcplusplus/trunk/win32/QueueFrame.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2008-02-12 22:09:17 UTC (rev 1006) +++ dcplusplus/trunk/changelog.txt 2008-02-13 22:06:33 UTC (rev 1007) @@ -28,8 +28,9 @@ * [ADC] Added /me handling (thanks poy) * Fixed issues with scrolling (thanks poy) * Fixed re-add sources showing wrong sources (thanks poy) -* Partially fixed kick message filtering (thanks mikejj) +* Fixed kick message filtering (thanks mikejj) * version.xml now use Coral (ullner) +* [ADC] Number of files counts unique files when sending stats to hub -- 0.704 2007-12-14 -- * Hub lists added to utilize Coral's distributed network (ullner) Modified: dcplusplus/trunk/dcpp/AdcHub.cpp =================================================================== --- dcplusplus/trunk/dcpp/AdcHub.cpp 2008-02-12 22:09:17 UTC (rev 1006) +++ dcplusplus/trunk/dcpp/AdcHub.cpp 2008-02-13 22:06:33 UTC (rev 1007) @@ -136,8 +136,8 @@ if(!c.getParam("NI", 0, nick)) { nick = "[nick unknown]"; } - fire(ClientListener::StatusMessage(), this, u->getIdentity().getNick() + " (" + u->getIdentity().getSIDString() + - ") has same CID {" + cid + "} as " + nick + " (" + AdcCommand::fromSID(c.getFrom()) + "), ignoring."); + fire(ClientListener::StatusMessage(), this, str(F_("%1% (%2%) has same CID {%3%} as %4% (%5%), ignoring") + % u->getIdentity().getNick() % u->getIdentity().getSIDString() % cid % nick % AdcCommand::fromSID(c.getFrom()))); return; } } else { @@ -203,13 +203,13 @@ } if(!baseOk) { - fire(ClientListener::StatusMessage(), this, "Failed to negotiate base protocol"); // @todo internationalize + fire(ClientListener::StatusMessage(), this, _("Failed to negotiate base protocol")); socket->disconnect(false); return; } else if(!tigrOk) { oldPassword = true; // Some hubs fake BASE support without TIGR support =/ - fire(ClientListener::StatusMessage(), this, "Hub probably uses an old version of ADC, please encourage the owner to upgrade"); + fire(ClientListener::StatusMessage(), this, _("Hub probably uses an old version of ADC, please encourage the owner to upgrade")); } } @@ -263,13 +263,35 @@ void AdcHub::handle(AdcCommand::QUI, AdcCommand& c) throw() { uint32_t s = AdcCommand::toSID(c.getParam(0)); - putUser(s); // @todo: use the DI flag - + + OnlineUser* victim = findUser(s); + if(!victim) { + return; + } + string tmp; if(c.getParam("MS", 1, tmp)) { - fire(ClientListener::StatusMessage(), this, tmp); + OnlineUser* source = 0; + string tmp2; + if(c.getParam("ID", 1, tmp2)) { + source = findUser(AdcCommand::toSID(tmp2)); + } + + if(source) { + tmp = str(F_("%1% was kicked by %2%: %3%") % victim->getIdentity().getNick() % + source->getIdentity().getNick() % tmp); + } else { + tmp = str(F_("%1% was kicked: %2%") % victim->getIdentity().getNick() % tmp); + } + fire(ClientListener::StatusMessage(), this, tmp, ClientListener::FLAG_IS_SPAM); } + + if(c.hasFlag("DI", 1)) { + ConnectionManager::getInstance()->disconnect(victim->getUser(), false); + } + putUser(s); + if(s == sid) { if(c.getParam("TL", 1, tmp)) { if(tmp == "-1") { Modified: dcplusplus/trunk/dcpp/ClientListener.h =================================================================== --- dcplusplus/trunk/dcpp/ClientListener.h 2008-02-12 22:09:17 UTC (rev 1006) +++ dcplusplus/trunk/dcpp/ClientListener.h 2008-02-13 22:06:33 UTC (rev 1007) @@ -29,6 +29,11 @@ typedef X<17> SearchFlood; typedef X<18> NmdcSearch; typedef X<19> AdcSearch; + + enum StatusFlags { + FLAG_NORMAL = 0x00, + FLAG_IS_SPAM = 0x01 + }; virtual void on(Connecting, Client*) throw() { } virtual void on(Connected, Client*) throw() { } @@ -40,7 +45,7 @@ virtual void on(GetPassword, Client*) throw() { } virtual void on(HubUpdated, Client*) throw() { } virtual void on(Message, Client*, const OnlineUser&, const string&, bool = false) throw() { } - virtual void on(StatusMessage, Client*, const string&) throw() { } + virtual void on(StatusMessage, Client*, const string&, int = FLAG_NORMAL) throw() { } virtual void on(PrivateMessage, Client*, const OnlineUser&, const OnlineUser&, const OnlineUser&, const string&, bool = false) throw() { } virtual void on(HubUserCommand, Client*, int, int, const string&, const string&) throw() { } virtual void on(HubFull, Client*) throw() { } Modified: dcplusplus/trunk/dcpp/NmdcHub.cpp =================================================================== --- dcplusplus/trunk/dcpp/NmdcHub.cpp 2008-02-12 22:09:17 UTC (rev 1006) +++ dcplusplus/trunk/dcpp/NmdcHub.cpp 2008-02-13 22:06:33 UTC (rev 1007) @@ -198,6 +198,14 @@ return; } + if((line.find("Hub-Security") != string::npos) && (line.find("was kicked by") != string::npos)) { + fire(ClientListener::StatusMessage(), this, unescape(line), ClientListener::FLAG_IS_SPAM); + return; + } else if((line.find("is kicking") != string::npos) && (line.find("because:") != string::npos)) { + fire(ClientListener::StatusMessage(), this, unescape(line), ClientListener::FLAG_IS_SPAM); + return; + } + OnlineUser* ou = findUser(nick); if(ou) { fire(ClientListener::Message(), this, *ou, unescape(message)); Modified: dcplusplus/trunk/dcpp/ShareManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/ShareManager.cpp 2008-02-12 22:09:17 UTC (rev 1006) +++ dcplusplus/trunk/dcpp/ShareManager.cpp 2008-02-13 22:06:33 UTC (rev 1007) @@ -507,11 +507,7 @@ size_t ShareManager::getSharedFiles() const throw() { Lock l(cs); - size_t tmp = 0; - for(Directory::Map::const_iterator i = directories.begin(); i != directories.end(); ++i) { - tmp += i->second->countFiles(); - } - return tmp; + return tthIndex.size(); } class FileFindIter { Modified: dcplusplus/trunk/win32/HubFrame.cpp =================================================================== --- dcplusplus/trunk/win32/HubFrame.cpp 2008-02-12 22:09:17 UTC (rev 1006) +++ dcplusplus/trunk/win32/HubFrame.cpp 2008-02-13 22:06:33 UTC (rev 1007) @@ -877,23 +877,17 @@ } void HubFrame::on(Message, Client*, const OnlineUser& from, const string& msg, bool thirdPerson) throw() { - if(SETTING(FILTER_MESSAGES)) { - if((msg.find("Hub-Security") != string::npos) && (msg.find("was kicked by") != string::npos)) { - // Do nothing... - } else if((msg.find("is kicking") != string::npos) && (msg.find("because:") != string::npos)) { - speak(ADD_SILENT_STATUS_LINE, msg); - } else { - speak(ADD_CHAT_LINE, Util::formatMessage(from.getIdentity().getNick(), msg, thirdPerson)); - } + speak(ADD_CHAT_LINE, Util::formatMessage(from.getIdentity().getNick(), msg, thirdPerson)); +} + +void HubFrame::on(StatusMessage, Client*, const string& line, int statusFlags) throw() { + if(SETTING(FILTER_MESSAGES) && (statusFlags & ClientListener::FLAG_IS_SPAM)) { + speak(ADD_SILENT_STATUS_LINE, line); } else { - speak(ADD_CHAT_LINE, Util::formatMessage(from.getIdentity().getNick(), msg, thirdPerson)); + speak(ADD_STATUS_LINE, line); } } -void HubFrame::on(StatusMessage, Client*, const string& line) throw() { - speak(ADD_CHAT_LINE, line); -} - void HubFrame::on(PrivateMessage, Client*, const OnlineUser& from, const OnlineUser& to, const OnlineUser& replyTo, const string& line, bool thirdPerson) throw() { speak(from, to, replyTo, Util::formatMessage(from.getIdentity().getNick(), line, thirdPerson)); } Modified: dcplusplus/trunk/win32/HubFrame.h =================================================================== --- dcplusplus/trunk/win32/HubFrame.h 2008-02-12 22:09:17 UTC (rev 1006) +++ dcplusplus/trunk/win32/HubFrame.h 2008-02-13 22:06:33 UTC (rev 1007) @@ -275,7 +275,7 @@ virtual void on(GetPassword, Client*) throw(); virtual void on(HubUpdated, Client*) throw(); virtual void on(Message, Client*, const OnlineUser&, const string&, bool = false) throw(); - virtual void on(StatusMessage, Client*, const string&) throw(); + virtual void on(StatusMessage, Client*, const string&, int = ClientListener::FLAG_NORMAL) throw(); virtual void on(PrivateMessage, Client*, const OnlineUser&, const OnlineUser&, const OnlineUser&, const string&, bool = false) throw(); virtual void on(NickTaken, Client*) throw(); virtual void on(SearchFlood, Client*, const string&) throw(); Modified: dcplusplus/trunk/win32/QueueFrame.cpp =================================================================== --- dcplusplus/trunk/win32/QueueFrame.cpp 2008-02-12 22:09:17 UTC (rev 1006) +++ dcplusplus/trunk/win32/QueueFrame.cpp 2008-02-13 22:06:33 UTC (rev 1007) @@ -811,7 +811,7 @@ QueueItemInfo* ii = files->getSelectedData(); if(!user) { - for(QueueItem::SourceIter si = ii->getSources().begin(); si != ii->getSources().end(); ) { + for(QueueItem::SourceIter si = ii->getSources().begin(); si != ii->getSources().end(); ++si) { QueueManager::getInstance()->removeSource(ii->getTarget(), si->getUser(), QueueItem::Source::FLAG_REMOVED); } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pie...@us...> - 2008-02-13 08:51:39
|
Revision: 133 http://adchpp.svn.sourceforge.net/adchpp/?rev=133&view=rev Author: pietricica Date: 2008-02-13 00:51:30 -0800 (Wed, 13 Feb 2008) Log Message: ----------- 2.2 Added Paths: ----------- adchpp/tags/2.2/ Copied: adchpp/tags/2.2 (from rev 132, adchpp/trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zou...@us...> - 2008-02-12 22:09:34
|
Revision: 1006 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1006&view=rev Author: zouzou123gen Date: 2008-02-12 14:09:17 -0800 (Tue, 12 Feb 2008) Log Message: ----------- fix the sub-title of "choose folder" dialogs Modified Paths: -------------- dcplusplus/trunk/win32/WinUtil.cpp Modified: dcplusplus/trunk/win32/WinUtil.cpp =================================================================== --- dcplusplus/trunk/win32/WinUtil.cpp 2008-02-12 21:18:34 UTC (rev 1005) +++ dcplusplus/trunk/win32/WinUtil.cpp 2008-02-12 22:09:17 UTC (rev 1006) @@ -420,7 +420,8 @@ bi.hwndOwner = owner; bi.pszDisplayName = buf; - bi.lpszTitle = CT_("Choose folder"); + tstring title = T_("Choose folder"); + bi.lpszTitle = title.c_str(); bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_USENEWUI; bi.lParam = (LPARAM)target.c_str(); bi.lpfn = &browseCallbackProc; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zou...@us...> - 2008-02-12 21:18:39
|
Revision: 1005 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1005&view=rev Author: zouzou123gen Date: 2008-02-12 13:18:34 -0800 (Tue, 12 Feb 2008) Log Message: ----------- fix bold font for menu titles Modified Paths: -------------- dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp 2008-02-12 20:58:39 UTC (rev 1004) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp 2008-02-12 21:18:34 UTC (rev 1005) @@ -61,7 +61,7 @@ { LOGFONT lf; ::GetObject((HFONT)GetStockObject(DEFAULT_GUI_FONT), sizeof(lf), &lf); - lf.lfWeight *= 2; // bolder + lf.lfWeight = FW_BOLD; itsTitleFont = SmartWin::FontPtr(new SmartWin::Font(::CreateFontIndirect(&lf), true)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zou...@us...> - 2008-02-12 20:58:53
|
Revision: 1004 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1004&view=rev Author: zouzou123gen Date: 2008-02-12 12:58:39 -0800 (Tue, 12 Feb 2008) Log Message: ----------- lighter and smaller icon shadow Modified Paths: -------------- dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp 2008-02-11 14:47:45 UTC (rev 1003) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp 2008-02-12 20:58:39 UTC (rev 1004) @@ -661,16 +661,16 @@ if ( isSelected && !isDisabled ) // if selected and active, then imitate icon shadow { // adjust icon position for later drawing - imageRectangle.pos.x -= 1; - imageRectangle.pos.y -= 1; + imageRectangle.pos.x--; + imageRectangle.pos.y--; // setup brush for shadow emulation - Brush brush( ColorUtilities::darkenColor( colorInfo.colorStrip, 0.7 ) ); + Brush brush( ColorUtilities::darkenColor( colorInfo.colorStrip, 0.2 ) ); // draw the icon shadow Rectangle shadowRectangle( imageRectangle ); - shadowRectangle.pos.x += 2; - shadowRectangle.pos.y += 2; + shadowRectangle.pos.x++; + shadowRectangle.pos.y++; canvas.drawBitmap( image, shadowRectangle, colorInfo.colorImageBackground, true ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pie...@us...> - 2008-02-12 20:22:00
|
Revision: 132 http://adchpp.svn.sourceforge.net/adchpp/?rev=132&view=rev Author: pietricica Date: 2008-02-12 12:21:54 -0800 (Tue, 12 Feb 2008) Log Message: ----------- updated nsi, version, and changelog Modified Paths: -------------- adchpp/trunk/ADCHPP.nsi adchpp/trunk/adchpp/version.cpp adchpp/trunk/changelog.txt Modified: adchpp/trunk/ADCHPP.nsi =================================================================== --- adchpp/trunk/ADCHPP.nsi 2008-02-11 19:20:52 UTC (rev 131) +++ adchpp/trunk/ADCHPP.nsi 2008-02-12 20:21:54 UTC (rev 132) @@ -2,7 +2,7 @@ ; HM NIS Edit Wizard helper defines !define PRODUCT_NAME "ADCH++" -!define PRODUCT_VERSION "2.1" +!define PRODUCT_VERSION "2.2" !define PRODUCT_PUBLISHER "Jacek Sieka" !define PRODUCT_WEB_SITE "http://adchpp.sourceforge.net" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\adchppd.exe" @@ -56,9 +56,8 @@ File "adchppd.exe" File "adchpp.dll" File "_pyadchpp.dll" - File "aintl.dll" - File "alua.dll" File "Bloom.dll" + File "alua.dll" File "changelog.txt" File "License.txt" File "luadchpp.dll" @@ -137,7 +136,6 @@ Delete "$INSTDIR\changelog.txt" Delete "$INSTDIR\Bloom.dll" Delete "$INSTDIR\alua.dll" - Delete "$INSTDIR\aintl.dll" Delete "$INSTDIR\_pyadchpp.dll" Delete "$INSTDIR\adchpp.dll" Delete "$INSTDIR\adchppd.exe" Modified: adchpp/trunk/adchpp/version.cpp =================================================================== --- adchpp/trunk/adchpp/version.cpp 2008-02-11 19:20:52 UTC (rev 131) +++ adchpp/trunk/adchpp/version.cpp 2008-02-12 20:21:54 UTC (rev 132) @@ -9,8 +9,8 @@ #define strver(s) #s #define APPNAME "ADCH++" -#define VERSIONSTRING "2.1.0 (r" xstrver(ADCHPP_REVISION) ")" -#define VERSIONFLOAT 2.1 +#define VERSIONSTRING "2.2.0 (r" xstrver(ADCHPP_REVISION) ")" +#define VERSIONFLOAT 2.2 #ifndef NDEBUG #define BUILDSTRING "Debug" Modified: adchpp/trunk/changelog.txt =================================================================== --- adchpp/trunk/changelog.txt 2008-02-11 19:20:52 UTC (rev 131) +++ adchpp/trunk/changelog.txt 2008-02-12 20:21:54 UTC (rev 132) @@ -1,4 +1,4 @@ --- -- +-- 2.2 2008-02-12 -- * access.lua: fixed message type for MSG * Some minor socket fixes * Initial Bloom filter implementation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2008-02-11 19:20:58
|
Revision: 131 http://adchpp.svn.sourceforge.net/adchpp/?rev=131&view=rev Author: arnetheduck Date: 2008-02-11 11:20:52 -0800 (Mon, 11 Feb 2008) Log Message: ----------- cleanup bloom pos Modified Paths: -------------- adchpp/trunk/plugins/Bloom/src/HashBloom.cpp Modified: adchpp/trunk/plugins/Bloom/src/HashBloom.cpp =================================================================== --- adchpp/trunk/plugins/Bloom/src/HashBloom.cpp 2008-01-31 22:10:31 UTC (rev 130) +++ adchpp/trunk/plugins/Bloom/src/HashBloom.cpp 2008-02-11 19:20:52 UTC (rev 131) @@ -53,13 +53,14 @@ } size_t HashBloom::pos(const TTHValue& tth, size_t n) const { - uint64_t x = 0; - - size_t start = n * h; if((n+1)*h > TTHValue::BITS) { return 0; } + + uint64_t x = 0; + size_t start = n * h; + for(size_t i = 0; i < h; ++i) { size_t bit = start + i; size_t byte = bit / 8; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zou...@us...> - 2008-02-11 14:47:47
|
Revision: 1003 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1003&view=rev Author: zouzou123gen Date: 2008-02-11 06:47:45 -0800 (Mon, 11 Feb 2008) Log Message: ----------- extended menus everywhere, option to use basic menus Modified Paths: -------------- dcplusplus/trunk/dcpp/SettingsManager.cpp dcplusplus/trunk/dcpp/SettingsManager.h dcplusplus/trunk/smartwin/include/smartwin/GCCHeaders.h dcplusplus/trunk/smartwin/include/smartwin/WidgetFactory.h dcplusplus/trunk/smartwin/include/smartwin/WidgetFactoryPlatformSmartWinDesktop.h dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp dcplusplus/trunk/win32/ADLSearchFrame.cpp dcplusplus/trunk/win32/AdvancedPage.cpp dcplusplus/trunk/win32/DirectoryListingFrame.cpp dcplusplus/trunk/win32/FavHubsFrame.cpp dcplusplus/trunk/win32/FavHubsFrame.h dcplusplus/trunk/win32/FinishedFrameBase.h dcplusplus/trunk/win32/HubFrame.cpp dcplusplus/trunk/win32/MDIChildFrame.h dcplusplus/trunk/win32/MainWindow.cpp dcplusplus/trunk/win32/MainWindow.h dcplusplus/trunk/win32/PrivateFrame.cpp dcplusplus/trunk/win32/PublicHubsFrame.cpp dcplusplus/trunk/win32/QueueFrame.cpp dcplusplus/trunk/win32/QueueFrame.h dcplusplus/trunk/win32/SearchFrame.cpp dcplusplus/trunk/win32/ShellContextMenu.cpp dcplusplus/trunk/win32/SpyFrame.cpp dcplusplus/trunk/win32/SpyFrame.h dcplusplus/trunk/win32/TransferView.cpp dcplusplus/trunk/win32/UserInfoBase.h dcplusplus/trunk/win32/UsersFrame.cpp dcplusplus/trunk/win32/WaitingUsersFrame.cpp dcplusplus/trunk/win32/WinUtil.cpp dcplusplus/trunk/win32/WinUtil.h Added Paths: ----------- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenu.h dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp Removed Paths: ------------- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenu.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp dcplusplus/trunk/smartwin/source/widgets/WidgetMenuExtended.cpp Modified: dcplusplus/trunk/dcpp/SettingsManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/SettingsManager.cpp 2008-02-10 21:35:52 UTC (rev 1002) +++ dcplusplus/trunk/dcpp/SettingsManager.cpp 2008-02-11 14:47:45 UTC (rev 1003) @@ -77,7 +77,7 @@ "UseTLS", "AutoSearchLimit", "AltSortOrder", "AutoKickNoFavs", "PromptPassword", "SpyFrameIgnoreTthSearches", "DontDlAlreadyQueued", "MaxCommandLength", "AllowUntrustedHubs", "AllowUntrustedClients", "TLSPort", "FastHash", "SortFavUsersFirst", "ShowShellMenu", "MinSegmentSize", "FollowLinks", - "SendBloom", + "SendBloom", "OwnerDrawnMenus", "SENTRY", // Int64 "TotalUpload", "TotalDownload", @@ -273,6 +273,7 @@ setDefault(MIN_SEGMENT_SIZE, 1024); setDefault(FOLLOW_LINKS, false); setDefault(SEND_BLOOM, true); + setDefault(OWNER_DRAWN_MENUS, true); #ifdef _WIN32 setDefault(MAIN_WINDOW_STATE, SW_SHOWNORMAL); Modified: dcplusplus/trunk/dcpp/SettingsManager.h =================================================================== --- dcplusplus/trunk/dcpp/SettingsManager.h 2008-02-10 21:35:52 UTC (rev 1002) +++ dcplusplus/trunk/dcpp/SettingsManager.h 2008-02-11 14:47:45 UTC (rev 1003) @@ -90,7 +90,7 @@ USE_TLS, AUTO_SEARCH_LIMIT, ALT_SORT_ORDER, AUTO_KICK_NO_FAVS, PROMPT_PASSWORD, SPY_FRAME_IGNORE_TTH_SEARCHES, DONT_DL_ALREADY_QUEUED, MAX_COMMAND_LENGTH, ALLOW_UNTRUSTED_HUBS, ALLOW_UNTRUSTED_CLIENTS, TLS_PORT, FAST_HASH, SORT_FAVUSERS_FIRST, SHOW_SHELL_MENU, MIN_SEGMENT_SIZE, FOLLOW_LINKS, - SEND_BLOOM, + SEND_BLOOM, OWNER_DRAWN_MENUS, INT_LAST }; enum Int64Setting { INT64_FIRST = INT_LAST + 1, Modified: dcplusplus/trunk/smartwin/include/smartwin/GCCHeaders.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/GCCHeaders.h 2008-02-10 21:35:52 UTC (rev 1002) +++ dcplusplus/trunk/smartwin/include/smartwin/GCCHeaders.h 2008-02-11 14:47:45 UTC (rev 1003) @@ -81,6 +81,14 @@ #define COLOR_MENUBAR 30 #define ODS_HOTLIGHT 0x0040 #define ODS_INACTIVE 0x0080 + #if(_WIN32_WINNT >= 0x0500) + #ifndef ODS_NOACCEL + #define ODS_NOACCEL 0x0100 + #endif + #ifndef DT_HIDEPREFIX + #define DT_HIDEPREFIX 0x00100000 + #endif + #endif // Additional (gcc, normally) stuff Modified: dcplusplus/trunk/smartwin/include/smartwin/WidgetFactory.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/WidgetFactory.h 2008-02-10 21:35:52 UTC (rev 1002) +++ dcplusplus/trunk/smartwin/include/smartwin/WidgetFactory.h 2008-02-11 14:47:45 UTC (rev 1003) @@ -42,7 +42,6 @@ #include "widgets/WidgetMDIChild.h" #include "widgets/WidgetMDIFrame.h" #include "widgets/WidgetMDIParent.h" -#include "widgets/WidgetMenu.h" #include "widgets/WidgetMessageBox.h" #include "widgets/WidgetProgressBar.h" #include "widgets/WidgetRadioButton.h" @@ -202,12 +201,6 @@ /// Static object type. typedef typename WidgetStatic::ObjectType WidgetStaticPtr; - /// Menu class type. - typedef SmartWin::WidgetMenu WidgetMenu; - - /// Menu object type. - typedef typename WidgetMenu::ObjectType WidgetMenuPtr; - /// CheckBox class type. typedef SmartWin::WidgetCheckBox WidgetCheckBox; @@ -325,12 +318,6 @@ */ WidgetTreeViewPtr attachTreeView( unsigned id ); - /// Creates a Menu and returns a pointer to it. - /** The returned object is of type std::tr1::shared_ptr< WidgetMenu >, but you should use the typedef WidgetMenuPtr and not < br > - * the shared_ptr itself since this may change in future releases. - */ - WidgetMenuPtr createMenu(const typename WidgetMenu::Seed& cs = WidgetMenu::Seed()); - /// Creates a Edit Control and returns a pointer to it. /** DON'T delete the returned pointer!!! */ @@ -577,13 +564,6 @@ } template<typename ContainerWidgetType> -typename WidgetFactory< ContainerWidgetType >::WidgetMenuPtr -WidgetFactory< ContainerWidgetType >::createMenu(const typename WidgetMenu::Seed & cs) -{ - return WidgetCreator< WidgetMenu >::create( cs ); -} - -template<typename ContainerWidgetType> typename WidgetFactory< ContainerWidgetType >::WidgetTextBoxPtr WidgetFactory< ContainerWidgetType >::createTextBox( const typename WidgetTextBox::Seed & cs ) { Modified: dcplusplus/trunk/smartwin/include/smartwin/WidgetFactoryPlatformSmartWinDesktop.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/WidgetFactoryPlatformSmartWinDesktop.h 2008-02-10 21:35:52 UTC (rev 1002) +++ dcplusplus/trunk/smartwin/include/smartwin/WidgetFactoryPlatformSmartWinDesktop.h 2008-02-11 14:47:45 UTC (rev 1003) @@ -32,7 +32,7 @@ #include "WidgetFactoryPlatformCommon.h" #include "widgets/WidgetRichTextBox.h" #include "widgets/WidgetChooseFont.h" -#include "widgets/WidgetMenuExtended.h" +#include "widgets/WidgetMenu.h" #include "widgets/WidgetToolbar.h" #include "widgets/WidgetCoolbar.h" #include "WidgetCreator.h" @@ -56,11 +56,11 @@ /// RichEditBox object type. typedef typename WidgetRichTextBox::ObjectType WidgetRichTextBoxPtr; - /// ExtendedMenu class type. - typedef SmartWin::WidgetMenuExtended WidgetMenuExtended; + /// Menu class type. + typedef SmartWin::WidgetMenu WidgetMenu; - /// ExtendedMenu object type. - typedef typename WidgetMenuExtended::ObjectType WidgetMenuExtendedPtr; + /// Menu object type. + typedef typename WidgetMenu::ObjectType WidgetMenuPtr; /// ChooseFont class and object type. typedef SmartWin::WidgetChooseFont< SmartWin::Widget > WidgetChooseFont; @@ -113,14 +113,14 @@ return WidgetCreator< WidgetRichTextBox >::attach( this, id ); } - /// Creates an Extended Menu - /** The returned object is of type std::tr1::shared_ptr< WidgetMenuExtended >, but - * you should use the typedef WidgetMenuExtendedPtr and not <br> + /// Creates a Menu + /** The returned object is of type std::tr1::shared_ptr< WidgetMenu >, but + * you should use the typedef WidgetMenuPtr and not <br> * the shared_ptr itself since this may change in future releases. */ - WidgetMenuExtendedPtr createExtendedMenu(const typename WidgetMenuExtended::Seed& cs = WidgetMenuExtended::Seed()) + WidgetMenuPtr createMenu(const typename WidgetMenu::Seed& cs = WidgetMenu::Seed()) { - return WidgetCreator< WidgetMenuExtended >::create( this, cs ); + return WidgetCreator< WidgetMenu >::create( this, cs ); } /// Creates a Tool Bar and returns a pointer to it. Deleted: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenu.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenu.h 2008-02-10 21:35:52 UTC (rev 1002) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenu.h 2008-02-11 14:47:45 UTC (rev 1003) @@ -1,536 +0,0 @@ -/* - Copyright ( c ) 2005, Thomas Hansen - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met : - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the SmartWin++ nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef WidgetMenu_h -#define WidgetMenu_h - -#include "../Application.h" -#include "../BasicTypes.h" -#include "../Dispatchers.h" -#include "../Widget.h" -#include "../xCeption.h" - -namespace SmartWin -{ -// begin namespace SmartWin - -// Forward declaring friends -template< class WidgetType > -class WidgetCreator; - -class WidgetMenu; - -class WidgetMenuBase : boost::noncopyable { -public: - - HMENU handle() { - return itsHandle; - } -protected: - WidgetMenuBase() : itsHandle(NULL) { } - virtual ~WidgetMenuBase() { - if(itsHandle) { - ::DestroyMenu(itsHandle); - } - } - - // Children, only "popup" menus are supposed to have children - std::vector< std::tr1::shared_ptr<WidgetMenu> > itsChildren; - - HMENU itsHandle; - - typedef std::map<unsigned, Widget::CallbackType> CallbackMap; - CallbackMap callbacks; - - void addCommands(Widget* widget); - -}; - -template< typename WidgetMenuType, enum Platform > -class WidgetMenuPlatformImplementation; - -/// Specialized functions in menu for Windows CE Windows API version -template<typename WidgetMenuType> -class WidgetMenuPlatformImplementation< WidgetMenuType, SmartWinCE > : - public WidgetMenuBase -{ - -public: - struct Seed { - Seed() { } - }; - - typedef std::tr1::shared_ptr< WidgetMenuType > WidgetMenuPtr; - - /// Actually creates the Menu - /** You should call WidgetFactory::createMenu if you instantiate class directly. - * <br> - * Only if you DERIVE from class you should call this function directly. - */ - void create(const typename WidgetMenuType::Seed cs) - { - itsCmdBar = CommandBar_Create( Application::instance().getAppHandle(), this->getParent()->handle(), 1 ); - if ( !itsCmdBar ) - { - xCeption x( _T( "CommandBar_Create in WidgetMenu::create fizzled..." ) ); - throw x; - } - itsHandle = ::CreateMenu(); - if ( !itsHandle ) - { - xCeption x( _T( "CreateMenu in WidgetMenu::create fizzled..." ) ); - throw x; - } - // Why on EARTH this works I have no idea whatsoever, but apparently it does... (casting to string!) - LPTSTR menuName = reinterpret_cast< LPTSTR >( itsHandle ); - CommandBar_InsertMenubarEx( itsCmdBar, reinterpret_cast< HINSTANCE >( 0 ), menuName, 0 ); - - // Since we're defaulting the window creation to no capture and no title we must add the X in the command bar... - CommandBar_AddAdornments( itsCmdBar, 0, 0 ); - } - - /// Appends a popup to the menu - /** Everything you "append" to a menu is added sequentially to the menu! <br> - * This specific "append" function appends a "popup" menu which is a menu - * containg other menus. <br> - * With other words a menu which is not an "option" but rather a new "subgroup". - * <br> - * The "File" menu of most application is for instance a "popup" menu while the - * File/Print is NOT a popup. <br> - * To append items to the popup created call one of the appendItem overloaded - * functions on the returned value of this function. <br> - * Also, although references to all menu objects must be kept ( since they're - * not collected automatically like other Widgets ) <br> - * you don't have to keep a reference to the return value of this function since - * it's being added as a reference to the children list <br> - * of the "this" object. <br> - * See the WidgetMenu sample project for a demonstration. - */ - WidgetMenuPtr appendPopup( const SmartUtil::tstring & name ) - { - WidgetMenuPtr retVal = WidgetMenuPtr( new WidgetMenuType( ) ); - HMENU popup = CreatePopupMenu(); - retVal->itsHandle = reinterpret_cast< HWND >( popup ); - ::AppendMenu( handle(), MF_POPUP, reinterpret_cast< unsigned int >( retVal->handle() ), name.c_str() ); - itsChildren.push_back( retVal ); - retVal->Widget::registerWidget(); - return retVal; - } - - WidgetMenuPlatformImplementation() - : Widget(0), itsCmdBar( 0 ) - {} - - virtual ~WidgetMenuPlatformImplementation() - { - if ( itsCmdBar ) - { - CommandBar_Destroy( itsCmdBar ); - } - } -private: - HWND itsCmdBar; -}; - -/// Specialized functions in menu for desktop Windows API version -template< typename WidgetMenuType > -class WidgetMenuPlatformImplementation< WidgetMenuType, SmartWinDesktop > : - public WidgetMenuBase -{ -protected: - WidgetMenuPlatformImplementation() { } -public: - struct Seed { - Seed(bool popup_) : popup(popup_) { } - Seed() : popup(false) { } - bool popup; - }; - - typedef std::tr1::shared_ptr< WidgetMenuType > WidgetMenuPtr; - - /// Attaches the menu to a parent window - /** Note! Menus can be switched between at runtime, you can have several menus - * that the EventHandlerClass switches between. <br> - * This can be done by attaching another menu object. <br> - * For an example of this see the WidgetMenu project. - */ - void attach( Widget * mainWindow ) - { - addCommands(mainWindow); - ::SetMenu( mainWindow->handle(), handle() ); - } - - /// Actually creates the Menu - /** You should call WidgetFactory::createMenu if you instantiate class directly. - * <br> - * Only if you DERIVE from class you should call this function directly. - */ - void create(const Seed& cs) - { - if(cs.popup) { - itsHandle = ::CreatePopupMenu(); - } else { - itsHandle = ::CreateMenu(); - } - if ( !itsHandle ) - { - xCeption x( _T( "CreateMenu in WidgetManu::create fizzled..." ) ); - throw x; - } - } - - /// Appends a popup to the menu - /** Everything you "append" to a menu is added sequentially to the menu <br> - * This specific "append" function appends a "popup" menu which is a menu - * containg other menus. <br> - * With other words a menu which is not an "option" but rather a new "subgroup". - * <br> - * The "File" menu of most application is for instance a "popup" menu while the - * File/Print is often NOT a popup. <br> - * To append items to the popup created call one of the appendItem overloaded - * functions on the returned value of this function. <br> - * Also, although references to all menu objects must be kept ( since they're - * not collected automatically like other Widgets ) <br> - * you don't have to keep a reference to the return value of this function since - * it's being added as a reference to the children list <br> - * of the "this" object. <br> - * See the WidgetMenu project for a demonstration. - */ - WidgetMenuPtr appendPopup( const SmartUtil::tstring & name ) - { - - WidgetMenuPtr retVal = WidgetMenuPtr( new WidgetMenuType( ) ); - - retVal->create(Seed(true)); - ::AppendMenu( handle(), MF_POPUP, reinterpret_cast< unsigned int >( retVal->handle() ), name.c_str() ); - itsChildren.push_back( retVal ); - return retVal; - } - - /// Returns the "System Menu" - /** The system menu is a special menu that ( normally ) is accessed by pressing - * the "window icon" at the top left of the window. <br> - * In SmartWin++ this menu can ALSO be easily manipulated and added items to - * etc... <br> - * Also, although references to all menu objects must be kept ( since they're - * not collected automatically like other Widgets ) <br> - * you don't have to keep a reference to the return value of this function since - * it's being added as a reference to the children list <br> - * of the "this" object. <br> - * See the WidgetMenu sample project for a demonstration. - */ -#ifdef PORT_ME - WidgetMenuPtr getSystemMenu() - { - HMENU h = ::GetSystemMenu( internal_::getTypedParentOrThrow < EventHandlerClass * >( this )->handle(), FALSE ); - WidgetMenuPtr sysMenu( new WidgetMenu( this->getParent() ) ); - sysMenu->Widget::itsHandle = reinterpret_cast< HWND >( h ); - sysMenu->Widget::registerWidget(); - sysMenu->isSysMenu = true; - - // We're assuming that the system menu has the same lifespan as the "this" - // menu, we must keep a reference to te system menu otherwise it will be - // "lost", therefore we add it up as a child to the "this" menu... - itsChildren.push_back( sysMenu ); - return sysMenu; - } -#endif -}; - -/// Menu class -/** \ingroup WidgetControls - * \WidgetUsageInfo - * \image html menu.PNG - * Class for creating a Menu Control which then can be attached to a WidgetWindow. - * <br> - * Note for Desktop applications only! <br> - * After you have created a menu you must call WidgetMenu::attach() to make it - * "attach" to the WidgetWindow you want it to belong to. <br> - * Related class : <br> - * WidgetMenuExtended - */ -class WidgetMenu : - public WidgetMenuPlatformImplementation< WidgetMenu, CurrentPlatform >, - public boost::enable_shared_from_this<WidgetMenu > -{ -protected: - typedef WidgetMenuPlatformImplementation< WidgetMenu, CurrentPlatform > PlatformImplementation; - - // friends - friend class WidgetMenuPlatformImplementation< WidgetMenu, CurrentPlatform >; - friend class WidgetCreator< WidgetMenu >; -public: - - WidgetMenu(); - - struct IdDispatcher - { - typedef std::tr1::function<void (unsigned)> F; - - IdDispatcher(const F& f_) : f(f_) { } - - bool operator()(const MSG& msg, LRESULT& ret) { - f(LOWORD(msg.wParam)); - return true; - } - - F f; - }; - - typedef Dispatchers::VoidVoid<> SimpleDispatcher; - - /// Class type - typedef WidgetMenu ThisType; - - /// Object type - typedef PlatformImplementation::WidgetMenuPtr ObjectType; - - /// Creational info - typedef PlatformImplementation::Seed Seed; - /// \ingroup eventsSignatures - - /// \ingroup EventHandlersWidgetMenu - /// Appends a "normal" menu item - /** eventHandler is the function that will receive the "click" event from the - * menu item. <br> - * Event handler's signature must be "void foo(unsigned int )" - * and it must be contained as a member <br> - * of the class that is defined as the EventHandlerClass, normally either the - * WidgetWindow derived class or the class derived from WidgetMenu. <br> - * See e.g. WidgetFun for an example. <br> - * The reason to why we have this "id" is because the same event handler can be - * defined for several menu items <br> - * even in fact across menu objects, therefore this number should be unique - * across the application. - */ - void appendItem( unsigned int id, const SmartUtil::tstring & name, const IdDispatcher::F& f ) { - appendItem(id, name, (ULONG_PTR)0, f); - } - void appendItem( unsigned int id, const SmartUtil::tstring & name, ULONG_PTR data, const IdDispatcher::F& f ); - void appendItem( unsigned int id, const SmartUtil::tstring & name, ULONG_PTR data, const SimpleDispatcher::F& f ); - void appendItem( unsigned int id, const SmartUtil::tstring& name, ULONG_PTR data = NULL); - - ULONG_PTR getData(unsigned int id, bool byPosition = false); - - /// Appends a separator item to the menu - /** A menu separator is basically just "air" between menu items. <br> - * A separator cannot be "clicked" or "chosen". - */ - void appendSeparatorItem(); - - /// Returns the text of a specific menu item - /** Which menu item you wish to retrieve the text for is defined by the "id" - * parameter of the function. - */ - SmartUtil::tstring getText( unsigned idOrPos, bool byPos ); - - /// Sets the text of a specific menu item - /** Which menu item you wish to set the text is defined by the "id" - * parameter of the function. - */ - void setText( unsigned id, const SmartUtil::tstring& text ); - - /// Checks (or uncheck) a specific menu item - /** Which menu item you wish to check ( or uncheck ) is passed in as the "id" - * parameter. <br> - * If the "value" parameter is true the item will be checked, otherwise it will - * be unchecked - */ - void checkItem( unsigned id, bool value = true ); - - /// Returns a boolean indicating if a specific menu item is checked or not - /** Which menu item you wish to check must be passed as the "id" parameter of the - * function - */ - bool getCheckedState( unsigned id ); - - /// Enables (or disables) a specific menu item - /** Which menu item you wish to enable ( or disable ) is passed in as the "id" - * parameter. <br> - * If the "value" parameter is true the item becomes enabled, otherwise disabled - */ - void setItemEnabled( unsigned id, bool value = true ); - - /// Returns a boolean indicating if a specific menu item is enabled or not - /** Which menu item you wish to check must be passed as the "id" parameter to the - * function. - */ - bool getItemEnabled( unsigned id ); - - /// Return the id associated with a certain position - UINT getId(unsigned postition); - - /// Return the number of items in the menu - int getCount(); - - UINT getMenuState(UINT id, bool byPosition = false); - - /// Return true if the item is a separator (by position) - bool isSeparator(UINT id, bool byPosition = false); - /// Return true if the menu item is checked - bool isChecked(UINT id, bool byPosition = false); - /// Return true if the menu item is a popup menu - bool isPopup(UINT id, bool byPosition = false); - /// Return true if the menu item is enabled (not grey and not disabled) - bool isEnabled(UINT id, bool byPosition = false); - - void setDefaultItem(UINT id, bool byPosition = false); - - ObjectType getChild(UINT position); - - /// Displays and handles a menu which can appear anywhere in the window. - /** Typically called by a Right Mouse click. If both the x and the y coordinates - * are - 1 ( default ), it'll show the context menu at the mouse position when - * the system last received a message, basically the "right" place. Depending on - * the flags it might return the id of the menu item selected, or 0 if none was - * chosen. Flags with TPM_RETURNCMD will return the menu - item, but not call - * the Event Handler. - * < ul > - * < li >TPM_CENTERALIGN : Centers the shortcut menu horizontally relative to the coordinate specified by the x parameter< /li > - * < li >TPM_LEFTALIGN : Function positions the shortcut menu so that its left side is aligned with the coordinate specified by the x parameter< /li > - * < li >TPM_RIGHTALIGN : Opposite of LEFTALIGN< /li > - * < li >TPM_BOTTOMALIGN : Aligns menu bottoms to the coordinate specified by the y parameter< /li > - * < li >TPM_TOPALIGN : Opposite of BOTTOMALIGN< /li > - * < li >TPM_VCENTERALIGN : Centers vertically relative to the y parameter< /li > - * < li >TPM_NONOTIFY : Restricts the menu from sending notifications when user clicks item< /li > - * < li >TPM_RETURNCMD : returns the menu item identifier of the user's selection in the return value but DOES NOT carry out the event handler< /li > - * < li >TPM_LEFTBUTTON : Restricts users to selecting menu items with only left mouse button< /li > - * < li >TPM_RIGHTBUTTON : User can choose menu item with both mouse buttons< /li > - * < /ul > - * None of the following are used by default but can be manually chosen if you - * manually call SystemParametersInfo - * < ul > - * < li >TPM_HORNEGANIMATION : Animates the menu from right to left< /li > - * < li >TPM_HORPOSANIMATION : Animates the menu from left to right< /li > - * < li >TPM_NOANIMATION : Displays menu without animation< /li > - * < li >TPM_VERNEGANIMATION : Animates the menu from bottom to top< /li > - * < li >TPM_VERPOSANIMATION : Animates the menu from top to bottom< /li > - * < /ul > - */ - unsigned trackPopupMenu( Widget * mainWindow, const ScreenCoordinate& sc, unsigned flags = 0 ); - - bool isSystemMenu() - { - return isSysMenu; - } - -private: - // True is menu is "system menu" (icon in top left of window) - bool isSysMenu; -}; - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Implementation of class -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -inline ULONG_PTR WidgetMenu::getData(unsigned int id, bool byPosition) { - MENUITEMINFO mii = { sizeof(MENUITEMINFO) }; - mii.fMask = MIIM_DATA; - ::GetMenuItemInfo(this->handle(), id, byPosition, &mii); - return mii.dwItemData; -} - -inline void WidgetMenu::appendSeparatorItem() -{ - ::AppendMenu( this->handle(), MF_SEPARATOR, 0, 0 ); -} - -inline UINT WidgetMenu::getId(UINT position) -{ - return ::GetMenuItemID( this->handle(), position ); -} - -inline void WidgetMenu::checkItem( unsigned id, bool value ) -{ - ::CheckMenuItem( this->handle(), id, value ? MF_CHECKED : MF_UNCHECKED ); -} - -inline bool WidgetMenu::getCheckedState( unsigned id ) -{ - return isChecked(id); -} - -inline void WidgetMenu::setItemEnabled( unsigned id, bool value ) -{ - if ( ::EnableMenuItem( this->handle(), id, value ? MF_ENABLED : MF_GRAYED ) == - 1 ) - { - xCeption x( _T( "Couldn't enable/disable the menu item, item doesn't exist" ) ); - throw x; - } -} - -inline bool WidgetMenu::getItemEnabled( unsigned id ) -{ - return isEnabled(id); -} - -inline int WidgetMenu::getCount() -{ - int count = ::GetMenuItemCount( this->handle() ); - if( count == -1 ) - throw xCeption( _T( "Couldn't get item count in getCount()" ) ); - return count; -} - -inline UINT WidgetMenu::getMenuState( UINT id, bool byPosition ) -{ - return ::GetMenuState(this->handle(), id, byPosition ? MF_BYPOSITION : MF_BYCOMMAND); -} - -inline void WidgetMenu::setDefaultItem( UINT id, bool byPosition ) -{ - ::SetMenuDefaultItem(this->handle(), id, byPosition); -} - -inline bool WidgetMenu::isChecked( UINT id, bool byPosition ) -{ - return (getMenuState(id, byPosition) & MF_CHECKED) == MF_CHECKED; -} - -inline bool WidgetMenu::isEnabled( UINT id, bool byPosition ) -{ - return !(getMenuState(id, byPosition) & (MF_DISABLED | MF_GRAYED)); -} - -inline bool WidgetMenu::isPopup( UINT id, bool byPosition ) -{ - return (getMenuState(id, byPosition) & MF_POPUP) == MF_POPUP; -} - -inline bool WidgetMenu::isSeparator( UINT id, bool byPosition ) -{ - return (getMenuState(id, byPosition) & MF_SEPARATOR) == MF_SEPARATOR; -} - -inline WidgetMenu::WidgetMenu( ) - : isSysMenu( false ) -{ -} -// end namespace SmartWin -} - -#endif Copied: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenu.h (from rev 1000, dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h) =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenu.h (rev 0) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenu.h 2008-02-11 14:47:45 UTC (rev 1003) @@ -0,0 +1,530 @@ +/* + Copyright ( c ) 2005, Thomas Hansen + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met : + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the SmartWin++ nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef WINCE +#ifndef WidgetMenu_h +#define WidgetMenu_h + +#include "../Application.h" +#include "../BasicTypes.h" +#include "../CanvasClasses.h" +#include "../Dispatchers.h" + +namespace SmartWin +{ +// begin namespace SmartWin + +// Forward declaring friends +template< class WidgetType > +class WidgetCreator; + +/// Contains information about menu item +struct MenuItemData +{ + /// Menu item text color + COLORREF TextColor; + + /// Menu item font + FontPtr Font; + + /// Menu item image + BitmapPtr Image; + + /// Creates new menu item with specified data + MenuItemData( + FontPtr font = FontPtr( new SmartWin::Font( ( HFONT )::GetStockObject( DEFAULT_GUI_FONT ), false ) ), + BitmapPtr image = BitmapPtr( new Bitmap( ( HBITMAP ) NULL ) ), // defaults to empty bitmap + COLORREF textColor = ::GetSysColor( COLOR_MENUTEXT ) ) + : TextColor( textColor ), + Font( font ), + Image( image ) + {} +}; + +/// \ingroup GlobalStuff +// MenuItemDataPtr type, contains rendering data for e.g. WidgetMenu +/** Helps easily create color values and so on for a WidgetMenu item! <br> +* Each Menu Item can have different colors and so on, use this smart pointer to set +* those values! +*/ +typedef std::tr1::shared_ptr< MenuItemData > MenuItemDataPtr; + +namespace private_ +{ + // //////////////////////////////////////////////////////////////////////// + // Menu item data wrapper, used internally + // MENUITEMINFO's dwItemData *should* point to it + // //////////////////////////////////////////////////////////////////////// + struct ItemDataWrapper + { + // The menu item belongs to + // For some messages (e.g. WM_MEASUREITEM), + // Windows doesn't specify it, so + // we need to keep this + HMENU menu; + + // Item index in the menu + // This is needed, because ID's for items + // are not unique (although Windows claims) + // e.g. we can have an item with ID 0, + // that is either separator or popup menu + int index; + + // Specifies if item is menu title + bool isMenuTitleItem; + + // Contains item data + MenuItemDataPtr data; + + // Wrapper Constructor + ItemDataWrapper( HMENU owner, int itemIndex, MenuItemDataPtr itemData, bool isTitleItem = false ) + : menu( owner ) + , index( itemIndex ) + , isMenuTitleItem( isTitleItem ) + , data( itemData ) + {} + + ~ItemDataWrapper() + {} + }; +} + +/// Struct for coloring different areas of WidgetMenu +/** Contains the different color settings of the WidgetMenu <br> +* Default values to constructor makes menu look roughly like MSVC++7.1 menus +*/ +struct MenuColorInfo +{ + /// Menu color + COLORREF colorMenu; + + /// Strip bar color + COLORREF colorStrip; + + /// Menu bar color + COLORREF colorMenuBar; + + /// Highlighted menu item color + COLORREF colorHighlight; + + /// Title text color + COLORREF colorTitleText; + + /// Item image background color, used for transparency effects + COLORREF colorImageBackground; + + /// Constructs MenuColorInfo objects + /** If all the default arguments are used it will construct an object making + * menus look roughly like they do in MSVC++ 7.1 <br> + * Pass your own arguments to construct other color effects + */ + MenuColorInfo( COLORREF menuColor = ColorUtilities::darkenColor( ::GetSysColor( COLOR_WINDOW ), 0.02 ), + COLORREF stripColor = ColorUtilities::darkenColor( ::GetSysColor( COLOR_3DFACE ), 0.02 ), + COLORREF menuBarColor = ::GetSysColor( COLOR_MENUBAR ), + COLORREF highlightColor = ::GetSysColor( COLOR_HIGHLIGHT ), + COLORREF titleTextColor = ::GetSysColor( COLOR_MENUTEXT ), + COLORREF imageBackground = RGB( 0, 0, 0 ) ) // black + : colorMenu( menuColor ), + colorStrip( stripColor ), + colorMenuBar( menuBarColor ), + colorHighlight( highlightColor ), + colorTitleText( titleTextColor ), + colorImageBackground( imageBackground ) + {} +}; + +/// Menu class +/** \ingroup WidgetControls +* \WidgetUsageInfo +* \image html menu.png +* Class for creating a Menu Control which then can be attached to e.g. a +* WidgetWindow. <br> +* Note for Desktop version only! <br> +* After you have created a menu you must call WidgetMenu::attach() to make it +* "attach" to the WidgetWindow you want it to belong to. <br> +* Do not be fooled, a WidgetMenu is a much more advanced menu type then the +* "normal" WidgetMenu and contains support for visualizations far beyond the +* capabilities of the WidgetMenu. <br> +* If you need those truly awesome visual menu effects use this menu control instead +* of the WidgetMenu. +*/ +class WidgetMenu : public boost::enable_shared_from_this< WidgetMenu > +{ + // friends + friend class WidgetCreator< WidgetMenu >; + +public: + /// Type of object + typedef WidgetMenu ThisType; + + /// Object type + typedef std::tr1::shared_ptr<WidgetMenu> ObjectType; + + struct Seed { + Seed(bool ownerDrawn_ = true, const MenuColorInfo& colorInfo_ = MenuColorInfo()) : popup(true), ownerDrawn(ownerDrawn_), colorInfo(colorInfo_) { } + bool popup; + bool ownerDrawn; + MenuColorInfo colorInfo; + }; + + struct IdDispatcher + { + typedef std::tr1::function<void (unsigned)> F; + + IdDispatcher(const F& f_) : f(f_) { } + + bool operator()(const MSG& msg, LRESULT& ret) { + f(LOWORD(msg.wParam)); + return true; + } + + F f; + }; + + typedef Dispatchers::VoidVoid<> SimpleDispatcher; + + struct DrawItemDispatcher { + typedef std::tr1::function<bool (int, LPDRAWITEMSTRUCT)> F; + + DrawItemDispatcher(const F& f_) : f(f_) { } + + bool operator()(const MSG& msg, LRESULT& ret) { + return f(msg.wParam, reinterpret_cast<LPDRAWITEMSTRUCT>(msg.lParam)); + } + + F f; + }; + + struct MeasureItemDispatcher { + typedef std::tr1::function<bool (LPMEASUREITEMSTRUCT)> F; + + MeasureItemDispatcher(const F& f_) : f(f_) { } + + bool operator()(const MSG& msg, LRESULT& ret) { + return f(reinterpret_cast<LPMEASUREITEMSTRUCT>(msg.lParam)); + } + + F f; + }; + + /// Rendering settting settings + static const int borderGap; /// Gap between the border and item + static const int pointerGap; /// Gap between item text and sub - menu pointer + static const int textIconGap; /// Gap between text and icon + static const int textBorderGap; /// Gap between text and rectangel border + static const int separatorHeight; /// Defines default height for rectangle containing separator + static const int minSysMenuItemWidth; /// Minimum width for system menu items + static Point defaultImageSize; /// Default image size, used when no image is available + + HMENU handle() const { + return itsHandle; + } + + HWND getParent() const { + return itsParent ? itsParent->handle() : 0; + } + + /// Actually creates the menu + /** Creates the menu, the menu will be created initially empty! + */ + void create(const Seed& cs); + + /// Attaches the menu to the parent window + void attach(); + + /// Appends a popup to the menu + /** Everything you "append" to a menu is added sequentially to the menu <br> + * This specific "append" function appends a "popup" menu which is a menu + * containing other menus. <br> + * With other words a menu which is not an "option" but rather a new "subgroup". + * <br> + * The "File" menu of most application is for instance a "popup" menu while the + * File/Print is often NOT a popup. <br> + * To append items to the popup created call one of the appendItem overloaded + * functions on the returned value of this function. <br> + * Also, although references to all menu objects must be kept ( since they're + * not collected automatically like other Widgets ) <br> + * you don't have to keep a reference to the return value of this function since + * it's being added as a reference to the children list of the "this" object. + * <br> + * A popup is basically another branch in the menu hierarchy <br> + * See the WidgetMenu project for a demonstration. + */ + ObjectType appendPopup( const SmartUtil::tstring & text, MenuItemDataPtr itemData = MenuItemDataPtr(new MenuItemData()) ); + + /// Returns the "System Menu" + /** The system menu is a special menu that ( normally ) is accessed by pressing + * the "window icon" at the top left of the window. <br> + * In SmartWin++ this menu can ALSO be easily manipulated and added items to + * etc... <br> + * Also, although references to all menu objects must be kept ( since they're + * not collected automatically like other Widgets ) <br> + * you don't have to keep a reference to the return value of this function since + * it's being added as a reference to the children list <br> + * of the "this" object. <br> + * See the WidgetMenu sample project for a demonstration. + */ + ObjectType getSystemMenu(); + + /// Setting event handler for Draw Item Event + /** The Draw Item Event will be raised when the menu needs to draw itself, if you + * wish to truly be creative and be 100% in control you must handle this Event + * and do the actualy drawing of the Menu yourself, but for most people it will + * be enough to just manipulate the background colors etc of the MenuItemData + * given to the menu in the appendItem function <br> + * Note! <br> + * If this event is handled you also MUST handle the Measure Item Event!! + */ + bool handleDrawItem(int id, LPDRAWITEMSTRUCT drawInfo); + + /// Setting event handler for Measure Item Event + /** The Measure Item Event is nessecary to handle if you want to draw the menu + * yourself since it is inside this Event Handler you're telling the system how + * much space you need to actually do the drawing <br> + * Note! <br> + * If this event is handled you also MUST handle the Draw Item Event!! + */ + bool handleMeasureItem(LPMEASUREITEMSTRUCT measureInfo); + + /// Appends a separator item to the menu + /** A menu separator is basically just "air" between menu items.< br > + * A separator cannot be "clicked" or "chosen". + */ + void appendSeparatorItem(); + + /// Appends a Menu Item + /** eventHandler is the function that will receive the "click" event from the + * menu item. <br> + * Event handler's signature must be "void foo( ObjectType, unsigned + * int )" and it must be contained as a member <br> + * of the class that is defined as the Widget, normally either the + * WidgetWindow derived class or the class derived from WidgetMenu. <br> + * See e.g. WidgetMenu for an example. <br> + * The reason to why we have this "id" is because the same event handler can be + * defined for several menu items even in fact across menu objects, therefore + * this number should be unique across the application. + */ + void appendItem(unsigned int id, const SmartUtil::tstring & text, MenuItemDataPtr itemData = MenuItemDataPtr(new MenuItemData())); + + template<typename DispatcherType> + void appendItem(unsigned int id, const SmartUtil::tstring & text, const typename DispatcherType::F& f, MenuItemDataPtr itemData = MenuItemDataPtr(new MenuItemData())) { + appendItem(id, text, itemData); + callbacks.insert(std::make_pair(id, DispatcherType(f))); + } + + void appendItem(unsigned int id, const SmartUtil::tstring & text, const IdDispatcher::F& f, MenuItemDataPtr itemData = MenuItemDataPtr(new MenuItemData())) { + appendItem<IdDispatcher>(id, text, f, itemData); + } + + void appendItem(unsigned int id, const SmartUtil::tstring & text, BitmapPtr image); + + template<typename DispatcherType> + void appendItem(unsigned int id, const SmartUtil::tstring & text, const typename DispatcherType::F& f, BitmapPtr image) { + MenuItemDataPtr itemData(new MenuItemData()); + if(ownerDrawn) + itemData->Image = image; + appendItem<DispatcherType>(id, text, f, itemData); + } + + void appendItem(unsigned int id, const SmartUtil::tstring & text, const IdDispatcher::F& f, BitmapPtr image) { + appendItem<IdDispatcher>(id, text, f, image); + } + + /// Removes specified item from this menu + /** Call this function to actually DELETE a menu item from the menu hierarchy. + * Note that you have to specify the item position; and whenever you remove an item, + * all subsequent items change positions. To remove a range of items, remove from + * end to start. + */ + void removeItem( unsigned itemIndex ); + + /// Remove all items from the menu + /** Will also delete any submenus. + */ + void removeAllItems(); + + /// Return the number of items in the menu + int getCount(); + + /// Displays and handles a menu which can appear anywhere in the window. + /** Typically called by a Right Mouse click. If both the x and the y coordinate + * is - 1 ( default ) it'll show the context menu on the position the mouse was + * at when the system last recieved a message, basically the "right" place... + * <br> + * Depending on the flags it might return the id of the menu item selected, or 0 + * if none was chosen. Flags with TPM_RETURNCMD will return the menu - item, but + * not do the menu command. + * < ul > + * < li >TPM_CENTERALIGN : Centers the shortcut menu horizontally relative to the coordinate specified by the x parameter< /li > + * < li >TPM_LEFTALIGN : Function positions the shortcut menu so that its left side is aligned with the coordinate specified by the x parameter< /li > + * < li >TPM_RIGHTALIGN : Opposite of LEFTALIGN< /li > + * < li >TPM_BOTTOMALIGN : Aligns menu bottoms to the coordinate specified by the y parameter< /li > + * < li >TPM_TOPALIGN : Opposite of BOTTOMALIGN< /li > + * < li >TPM_VCENTERALIGN : Centers vertically relative to the y parameter< /li > + * < li >TPM_NONOTIFY : Restricts the menu from sending notifications when user clicks item< /li > + * < li >TPM_RETURNCMD : returns the menu item identifier of the user's selection in the return value but DOES NOT carry out the event handler< /li > + * < li >TPM_LEFTBUTTON : Restricts users to selecting menu items with only left mouse button< /li > + * < li >TPM_RIGHTBUTTON : User can choose menu item with both mouse buttons< /li > + * < /ul > + * None of the following are used by default but can be manually chosen if you + * manually call SystemParametersInfo + * < ul > + * < li >TPM_HORNEGANIMATION : Animates the menu from right to left< /li > + * < li >TPM_HORPOSANIMATION : Animates the menu from left to right< /li > + * < li >TPM_NOANIMATION : Displays menu without animation< /li > + * < li >TPM_VERNEGANIMATION : Animates the menu from bottom to top< /li > + * < li >TPM_VERPOSANIMATION : Animates the menu from top to bottom< /li > + * < /ul > + */ + unsigned trackPopupMenu( Widget * mainWindow, const ScreenCoordinate& sc, unsigned flags = 0 ); + + /// Sets menu title + /** A WidgetMenu can have a title, this function sets that title + */ + void setTitle( const SmartUtil::tstring & title, bool drawSidebar = false ); + + /// Sets title font + /** Create a font through e.g. createFont in WidgetFactory or similar and set the + * title font to the menu title through using this function + */ + void setTitleFont( FontPtr font ); + + /// Removes menu title + /** If clearSidebar is true, sidebar is removed + */ + void clearTitle( bool clearSidebar = false ); + + /// Checks (or uncheck) a specific menu item + /** Which menu item you wish to check ( or uncheck ) is passed in as the "id" + * parameter. <br> + * If the "value" parameter is true the item will be checked, otherwise it will + * be unchecked + */ + void checkItem( unsigned id, bool value = true ); + + /// Enables (or disables) a specific menu item + /** Which menu item you wish to enable ( or disable ) is passed in as the "id" + * parameter. <br> + * If the "value" parameter is true the item becomes enabled, otherwise disabled + */ + void setItemEnabled( unsigned id, bool byPosition = false, bool value = true ); + + UINT getMenuState(UINT id, bool byPosition = false); + + /// Return true if the item is a separator (by position) + bool isSeparator(UINT id, bool byPosition = false); + /// Return true if the menu item is checked + bool isChecked(UINT id, bool byPosition = false); + /// Return true if the menu item is a popup menu + bool isPopup(UINT id, bool byPosition = false); + /// Return true if the menu item is enabled (not grey and not disabled) + bool isEnabled(UINT id, bool byPosition = false); + + void setDefaultItem(UINT id, bool byPosition = false); + + /// Returns true if menu is "system menu" (icon in top left of window) + bool isSystemMenu() + { + return isSysMenu; + } + + /// Returns the text of a specific menu item + /** Which menu item you wish to retrieve the text for is defined by the "id" + * parameter of the function. + */ + SmartUtil::tstring getText( unsigned idOrPos, bool byPos ); + + /// Sets the text of a specific menu item + /** Which menu item you wish to set the text is defined by the "id" + * parameter of the function. + */ + void setText( unsigned id, const SmartUtil::tstring& text ); + + /// Returns item data + MenuItemDataPtr getData( int itemIndex ); + + ObjectType getChild(UINT position); + + virtual ~WidgetMenu(); + +private: + /// Constructor Taking pointer to parent + explicit WidgetMenu( SmartWin::Widget * parent ); + + // This is used during menu destruction + static void destroyItemDataWrapper( private_::ItemDataWrapper * wrapper ); + + // True is menu is "system menu" (icon in top left of window) + bool isSysMenu; + + // work around for gcc + std::vector< ObjectType > & itsChildrenRef; + + // work around for gcc + std::vector < private_::ItemDataWrapper * > & itsItemDataRef; + + // its sub menus + std::vector< ObjectType > itsChildren; + + // its item data + std::vector < private_::ItemDataWrapper * > itsItemData; + + HMENU itsHandle; + + Widget* itsParent; + + bool ownerDrawn; + + // Contains information about menu colors + MenuColorInfo itsColorInfo; + + // Menu title + SmartUtil::tstring itsTitle; + + // Menu title font + FontPtr itsTitleFont; + + // if true title is drawn as sidebar + bool drawSidebar; + + typedef std::map<unsigned, Widget::CallbackType> CallbackMap; + CallbackMap callbacks; + + void addCommands(Widget* widget); + + // Returns item index in the menu item list + // If no item with specified id is found, - 1 is returned + int getItemIndex( unsigned int id ); + + WidgetMenu( const WidgetMenu & ); // Never implemented intentionally +}; + +// end namespace SmartWin +} + +#endif +#endif Deleted: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h 2008-02-10 21:35:52 UTC (rev 1002) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h 2008-02-11 14:47:45 UTC (rev 1003) @@ -1,638 +0,0 @@ -/* - Copyright ( c ) 2005, Thomas Hansen - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met : - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the SmartWin++ nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef WINCE -#ifndef WidgetMenuExtended_h -#define WidgetMenuExtended_h - -#include "../Application.h" -#include "../BasicTypes.h" -#include "../CanvasClasses.h" - -namespace SmartWin -{ -// begin namespace SmartWin - -// Forward declaring friends -template< class WidgetType > -class WidgetCreator; - -/// Contains extended information about extended menu item -struct MenuItemData -{ - /// Menu item text color - COLORREF TextColor; - - /// Menu item font - FontPtr Font; - - /// Menu item image - BitmapPtr Image; - - /// Creates new menu item with specified data - MenuItemData( - FontPtr font = FontPtr( new SmartWin::Font( ( HFONT )::GetStockObject( DEFAULT_GUI_FONT ), false ) ), // defaults to SYSTEM_FONT - BitmapPtr image = BitmapPtr( new Bitmap( ( HBITMAP ) NULL ) ), // defaults to empty bitmap - COLORREF textColor = ::GetSysColor( COLOR_MENUTEXT ) ) - : TextColor( textColor ), - Font( font ), - Image( image ) - {} -}; - -/// \ingroup GlobalStuff -// MenuItemDataPtr type, contains rendering data for e.g. WidgetMenuExtended -/** Helps easily create color values and so on for a WidgetMenuExtended item! <br> -* Each Menu Item can have different colors and so on, use this smart pointer to set -* those values! -*/ -typedef std::tr1::shared_ptr< MenuItemData > MenuItemDataPtr; - -namespace private_ -{ - // //////////////////////////////////////////////////////////////////////// - // Menu item data wrapper, used internally - // MENUITEMINFO's dwItemData *should* point to it - // //////////////////////////////////////////////////////////////////////// - struct ItemDataWrapper - { - // The menu item belongs to - // For some messages (e.g. WM_MEASUREITEM), - // Windows doesn't specify it, so - // we need to keep this - HMENU menu; - - // Item index in the menu - // This is needed, because ID's for items - // are not unique (although Windows claims) - // e.g. we can have an item with ID 0, - // that is either separator or popup menu - int index; - - // Specifies if item is menu title - bool isMenuTitleItem; - - // Contains item data - MenuItemDataPtr data; - - // Wrapper Constructor - ItemDataWrapper( HMENU owner, int itemIndex, MenuItemDataPtr itemData, bool isTitleItem = false ) - : menu( owner ) - , index( itemIndex ) - , isMenuTitleItem( isTitleItem ) - , data( itemData ) - {} - - ~ItemDataWrapper() - {} - }; -} - -/// Struct for coloring different areas of WidgetMenuExtended -/** Contains the different color settings of the WidgetMenuExtended <br> -* Default values to constructor makes menu look roughly like MSVC++7.1 menus -*/ -struct MenuColorInfo -{ - /// Menu color - COLORREF colorMenu; - - /// Strip bar color - COLORREF colorStrip; - - /// Menu bar color - COLORREF colorMenuBar; - - /// Highlighted menu item color - COLORREF colorHighlight; - - /// Title text color - COLORREF colorTitleText; - - /// Item image background color, used for transparency effects - COLORREF colorImageBackground; - - /// Constructs MenuColorInfo objects - /** If all the default arguments are used it will construct an object making - * menus look roughly like they do in MSVC++ 7.1 <br> - * Pass your own arguments to construct other color effects - */ - MenuColorInfo( COLORREF menuColor = ColorUtilities::darkenColor( ::GetSysColor( COLOR_WINDOW ), 0.02 ), - COLORREF stripColor = ColorUtilities::darkenColor( ::GetSysColor( COLOR_3DFACE ), 0.02 ), - COLORREF menuBarColor = ::GetSysColor( COLOR_MENUBAR ), - COLORREF highlightColor = ::GetSysColor( COLOR_HIGHLIGHT ), - COLORREF titleTextColor = ::GetSysColor( COLOR_MENUTEXT ), - COLORREF imageBackground = RGB( 0, 0, 0 ) ) // black - : colorMenu( menuColor ), - colorStrip( stripColor ), - colorMenuBar( menuBarColor ), - colorHighlight( highlightColor ), - colorTitleText( titleTextColor ), - colorImageBackground( imageBackground ) - {} -}; - -// Platform specific implementation -template< class MenuType, Platform > -class WidgetMenuExtendedPlatformImplementation; - -/// Specialized functions in menu for desktop Windows API version -/** This class contains all the functions in the WidgetMenuExtended which only works -* in the Desktop Version of the OS. <br> -* Though WidgetMenuExtended class does not actually WORK on WinCE we plan to MAKE -* it work in future versions, therefore we have created the CurrentPlatform -* specialization classes for it here...!! -*/ -template< typename MenuType > -class WidgetMenuExtendedPlatformImplementation< MenuType, SmartWinDesktop > -{ -public: - typedef std::tr1::shared_ptr< MenuType > WidgetMenuExtendedPtr; - - struct Seed { - Seed(const MenuColorInfo& colorInfo_ = MenuColorInfo()) : popup(true), colorInfo(colorInfo_) { } - bool popup; - MenuColorInfo colorInfo; - }; - - HMENU handle() const { - return itsHandle; - } - - HWND getParent() const { - return itsParent ? itsParent->handle() : 0; - } - - /// Actually creates the menu - /** Creates the menu, the menu will be created initially empty! - */ - void create(const Seed& cs); - - /// Attaches the menu to the parent window - void attach(); - - /// Appends a popup to the menu - /** Everything you "append" to a menu is added sequentially to the menu <br> - * This specific "append" function appends a "popup" menu which is a menu - * containing other menus. <br> - * With other words a menu which is not an "option" but rather a new "subgroup". - * <br> - * The "File" menu of most application is for instance a "popup" menu while the - * File/Print is often NOT a popup. <br> - * To append items to the popup created call one of the appendItem overloaded - * functions on the returned value of this function. <br> - * Also, although references to all menu objects must be kept ( since they're - * not collected automatically like other Widgets ) <br> - * you don't have to keep a reference to the return value of this function since - * it's being added as a reference to the children list of the "this" object. - * <br> - * A popup is basically another branch in the menu hierarchy <br> - * See the WidgetMenu project for a demonstration. - */ - WidgetMenuExtendedPtr appendPopup( const SmartUtil::tstring & text, MenuItemDataPtr itemData = MenuItemDataPtr(new MenuItemData()) ); - - /// Returns the "System Menu" - /** The system menu is a special menu that ( normally ) is accessed by pressing - * the "window icon" at the top left of the window. <br> - * In SmartWin++ this menu can ALSO be easily manipulated and added items to - * etc... <br> - * Also, although references to all menu objects must be kept ( since they're - * not collected automatically like other Widgets ) <br> - * you don't have to keep a reference to the return value of this function since - * it's being added as a reference to the children list <br> - * of the "this" object. <br> - * See the WidgetMenu sample project for a demonstration. - */ - WidgetMenuExtendedPtr getSystemMenu(); - - /// Rendering settting settings - static const int borderGap; /// Gap between the border and item - static const int pointerGap; /// Gap between item text and sub - menu pointer - static const int textIconGap; /// Gap between text and icon - static const int textBorderGap; /// Gap between text and rectangel border - static const int separatorHeight; /// Defines default height for rectangle containing separator - static const int minSysMenuItemWidth; /// Minimum width for system menu items - static Point defaultImageSize; /// Default image size, used when no image is available - -protected: - // its sub menus - std::vector< WidgetMenuExtendedPtr > itsChildren; - - // its item data - std::vector < private_::ItemDataWrapper * > itsItemData; - - HMENU itsHandle; - - Widget* itsParent; - - // Contains information about menu colors - MenuColorInfo itsColorInfo; - - typedef std::map<unsigned, Widget::CallbackType> CallbackMap; - CallbackMap callbacks; - - void addCommands(Widget* widget); -}; - -/// Extended Menu class -/** \ingroup WidgetControls -* \WidgetUsageInfo -* \image html menuextended.png -* Class for creating an Extended Menu Control which then can be attached to e.g. a -* WidgetWindow. <br> -* Note for Desktop version only! <br> -* After you have created a menu you must call WidgetMenu::attach() to make it -* "attach" to the WidgetWindow you want it to belong to. <br> -* Do not be fooled, a WidgetMenuExtended is a much more advanced menu type then the -* "normal" WidgetMenu and contains support for visualizations far beyond the -* capabilities of the WidgetMenu. <br> -* If you need those truly awesome visual menu effects use this menu control instead -* of the WidgetMenu. -*/ -class WidgetMenuExtended : - public WidgetMenuExtendedPlatformImplementation< WidgetMenuExtended, CurrentPlatform >, - public boost::enable_shared_from_this< WidgetMenuExtended > -{ - // friends - friend class WidgetMenuExtendedPlatformImplementation< WidgetMenuExtended, CurrentPlatform >; - friend class WidgetCreator< WidgetMenuExtended >; - - typedef WidgetMenuExtendedPlatformImplementation< WidgetMenuExtended, CurrentPlatform > Implementation; -public: - /// Type of object - typedef WidgetMenuExtended ThisType; - - /// Object type - typedef WidgetMenuExtendedPlatformImplementation< WidgetMenuExtended, CurrentPlatform >::WidgetMenuExtendedPtr ObjectType; - - struct IdDispatcher - { - typedef std::tr1::function<void (unsigned)> F; - - IdDispatcher(const F& f_) : f(f_) { } - - bool operator()(const MSG& msg, LRESULT& ret) { - f(LOWORD(msg.wParam)); - return true; - } - - F f; - }; - - struct DrawItemDispatcher { - typedef std::tr1::function<bool (int, LPDRAWITEMSTRUCT)> F; - - DrawItemDispatcher(const F& f_) : f(f_) { } - - bool operator()(const MSG& msg, LRESULT& ret) { - return f(msg.wParam, reinterpret_cast<LPDRAW... [truncated message content] |
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. |
From: <zou...@us...> - 2008-02-11 13:03:09
|
Revision: 1000 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1000&view=rev Author: zouzou123gen Date: 2008-02-09 16:32:56 -0800 (Sat, 09 Feb 2008) Log Message: ----------- scroll fixes Modified Paths: -------------- dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectScrollable.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTextBox.h dcplusplus/trunk/win32/HubFrame.cpp dcplusplus/trunk/win32/PrivateFrame.cpp dcplusplus/trunk/win32/SystemFrame.cpp Modified: dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectScrollable.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectScrollable.h 2008-02-09 22:14:47 UTC (rev 999) +++ dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectScrollable.h 2008-02-10 00:32:56 UTC (rev 1000) @@ -44,6 +44,8 @@ { typedef Dispatchers::VoidVoid<> Dispatcher; public: + bool scrollIsAtEnd(); + /// \ingroup EventHandlersAspectScrollable /// Setting the event handler for the "scrolling horizontally" event /** A scrolling event occurs when for instance a WidgetSliders value is being @@ -75,6 +77,18 @@ {} }; +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Implementation of class +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +template< class WidgetType > +bool AspectScrollable< WidgetType >::scrollIsAtEnd() +{ + SCROLLINFO scrollInfo = { sizeof(SCROLLINFO), SIF_RANGE | SIF_PAGE | SIF_POS }; + BOOL ret = ::GetScrollInfo(static_cast<WidgetType*>(this)->handle(), SB_VERT, &scrollInfo); + xAssert(ret != FALSE, _T("Can't get scroll info in scrollIsAtEnd")); + return (scrollInfo.nPos == static_cast<int>(scrollInfo.nMax - std::max(scrollInfo.nPage - 1, 0u))); +} + // end namespace SmartWin } Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTextBox.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTextBox.h 2008-02-09 22:14:47 UTC (rev 999) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTextBox.h 2008-02-10 00:32:56 UTC (rev 1000) @@ -34,6 +34,7 @@ #include "../aspects/AspectControl.h" #include "../aspects/AspectFocus.h" #include "../aspects/AspectFont.h" +#include "../aspects/AspectScrollable.h" #include "../aspects/AspectText.h" #include "../aspects/AspectUpdate.h" @@ -70,6 +71,7 @@ public AspectControl< WidgetTextBoxBase >, public AspectFocus< WidgetTextBoxBase >, public AspectFont< WidgetTextBoxBase >, + public AspectScrollable< WidgetTextBoxBase >, public AspectText< WidgetTextBoxBase >, public AspectUpdate< WidgetTextBoxBase > { Modified: dcplusplus/trunk/win32/HubFrame.cpp =================================================================== --- dcplusplus/trunk/win32/HubFrame.cpp 2008-02-09 22:14:47 UTC (rev 999) +++ dcplusplus/trunk/win32/HubFrame.cpp 2008-02-10 00:32:56 UTC (rev 1000) @@ -203,6 +203,8 @@ } void HubFrame::layout() { + bool scroll = chat->scrollIsAtEnd(); + const int border = 2; SmartWin::Rectangle r(getClientAreaSize()); @@ -233,6 +235,9 @@ paned->setSecond(0); } paned->setRect(r); + + if(scroll) + chat->sendMessage(WM_VSCROLL, SB_BOTTOM); } void HubFrame::updateStatus() { @@ -415,11 +420,7 @@ } line += Text::toDOS(aLine); - SCROLLINFO scrollInfo = { sizeof(SCROLLINFO), SIF_RANGE | SIF_PAGE | SIF_POS }; - bool scroll = ( - (::GetScrollInfo(chat->handle(), SB_VERT, &scrollInfo) == 0) || // on error, let's keep scrolling... - (scrollInfo.nPos == (scrollInfo.nMax - max(scrollInfo.nPage - 1, 0u))) // scroll only if the current scroll position is at the end - ); + bool scroll = chat->scrollIsAtEnd(); HoldRedraw hold(chat, !scroll); size_t limit = chat->getTextLimit(); Modified: dcplusplus/trunk/win32/PrivateFrame.cpp =================================================================== --- dcplusplus/trunk/win32/PrivateFrame.cpp 2008-02-09 22:14:47 UTC (rev 999) +++ dcplusplus/trunk/win32/PrivateFrame.cpp 2008-02-10 00:32:56 UTC (rev 1000) @@ -144,11 +144,7 @@ } line += aLine; - SCROLLINFO scrollInfo = { sizeof(SCROLLINFO), SIF_RANGE | SIF_PAGE | SIF_POS }; - bool scroll = ( - (::GetScrollInfo(chat->handle(), SB_VERT, &scrollInfo) == 0) || // on error, let's keep scrolling... - (scrollInfo.nPos == (scrollInfo.nMax - max(scrollInfo.nPage - 1, 0u))) // scroll only if the current scroll position is at the end - ); + bool scroll = chat->scrollIsAtEnd(); HoldRedraw hold(chat, !scroll); size_t limit = chat->getTextLimit(); @@ -228,6 +224,8 @@ } void PrivateFrame::layout() { + bool scroll = chat->scrollIsAtEnd(); + const int border = 2; SmartWin::Rectangle r(getClientAreaSize()); @@ -240,6 +238,9 @@ r.size.y -= rm.size.y + border; chat->setBounds(r); + + if(scroll) + chat->sendMessage(WM_VSCROLL, SB_BOTTOM); } void PrivateFrame::updateTitle() { Modified: dcplusplus/trunk/win32/SystemFrame.cpp =================================================================== --- dcplusplus/trunk/win32/SystemFrame.cpp 2008-02-09 22:14:47 UTC (rev 999) +++ dcplusplus/trunk/win32/SystemFrame.cpp 2008-02-10 00:32:56 UTC (rev 1000) @@ -52,26 +52,34 @@ } void SystemFrame::addLine(time_t t, const tstring& msg) { - int limit = log->getTextLimit(); - if(log->length() + static_cast<int>(msg.size()) > limit) { - HoldRedraw hold(log); + bool scroll = log->scrollIsAtEnd(); + HoldRedraw hold(log, !scroll); + + size_t limit = log->getTextLimit(); + if(log->length() + msg.size() > limit) { + HoldRedraw hold2(log, scroll); log->setSelection(0, log->lineIndex(log->lineFromChar(limit / 10))); log->replaceSelection(_T("")); } log->addTextLines(Text::toT("\r\n[" + Util::getShortTimeString(t) + "] ") + msg); - log->sendMessage(WM_VSCROLL, SB_BOTTOM); + if(scroll) + log->sendMessage(WM_VSCROLL, SB_BOTTOM); + setDirty(SettingsManager::BOLD_SYSTEM_LOG); } void SystemFrame::layout() { - const int border = 2; + bool scroll = log->scrollIsAtEnd(); SmartWin::Rectangle r(this->getClientAreaSize()); layoutStatus(r); log->setBounds(r); + + if(scroll) + log->sendMessage(WM_VSCROLL, SB_BOTTOM); } HRESULT SystemFrame::handleSpeaker(WPARAM wp, LPARAM lp) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zou...@us...> - 2008-02-11 11:00:40
|
Revision: 1001 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1001&view=rev Author: zouzou123gen Date: 2008-02-10 11:19:16 -0800 (Sun, 10 Feb 2008) Log Message: ----------- fix ampersands in tab menu titles, revert some changes of r996 Modified Paths: -------------- dcplusplus/trunk/smartwin/SmartUtil/StringUtils.cpp dcplusplus/trunk/smartwin/SmartUtil/StringUtils.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabSheet.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h dcplusplus/trunk/smartwin/source/widgets/WidgetTabSheet.cpp dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp dcplusplus/trunk/win32/HubFrame.cpp dcplusplus/trunk/win32/MDIChildFrame.h dcplusplus/trunk/win32/PrivateFrame.cpp Modified: dcplusplus/trunk/smartwin/SmartUtil/StringUtils.cpp =================================================================== --- dcplusplus/trunk/smartwin/SmartUtil/StringUtils.cpp 2008-02-10 00:32:56 UTC (rev 1000) +++ dcplusplus/trunk/smartwin/SmartUtil/StringUtils.cpp 2008-02-10 19:19:16 UTC (rev 1001) @@ -3,12 +3,6 @@ #include "UtilSystemHeaders.h" namespace SmartUtil { - tstring cutText(tstring str, unsigned int maxLength) { - if(str.length() > maxLength) - str = str.substr(0, maxLength - 3) + _T("..."); - return str; - } - tstring escapeMenu(tstring str) { tstring::size_type i = 0; while( (i = str.find(_T('&'), i)) != tstring::npos) { Modified: dcplusplus/trunk/smartwin/SmartUtil/StringUtils.h =================================================================== --- dcplusplus/trunk/smartwin/SmartUtil/StringUtils.h 2008-02-10 00:32:56 UTC (rev 1000) +++ dcplusplus/trunk/smartwin/SmartUtil/StringUtils.h 2008-02-10 19:19:16 UTC (rev 1001) @@ -4,7 +4,6 @@ #include "tstring.h" namespace SmartUtil { -tstring cutText(tstring str, unsigned int maxLength); tstring escapeMenu(tstring str); } Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabSheet.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabSheet.h 2008-02-10 00:32:56 UTC (rev 1000) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabSheet.h 2008-02-10 19:19:16 UTC (rev 1001) @@ -130,12 +130,9 @@ // Commented in AspectSelection int getSelectedIndex() const; - /// Returns the text of the currently selected tab - /** Use this function to retrieve the header text of the currently selected tab. - */ - SmartUtil::tstring getSelectedHeader() const; + SmartUtil::tstring getText(unsigned idx) const; - void setHeader(unsigned idx, const SmartUtil::tstring& text); + void setText(unsigned idx, const SmartUtil::tstring& text); /// Setting the event handler for the "selection changing" event /** The event handler must have the signature "bool foo( WidgetTabSheet * Widget, @@ -322,10 +319,10 @@ TabCtrl_SetCurSel( this->handle(), idx ); } -inline void WidgetTabSheet::setHeader( unsigned index, const SmartUtil::tstring& header ) +inline void WidgetTabSheet::setText( unsigned index, const SmartUtil::tstring& text ) { TCITEM item = { TCIF_TEXT }; - item.pszText = const_cast < TCHAR * >( header.c_str() ); + item.pszText = const_cast < TCHAR * >( text.c_str() ); TabCtrl_SetItem(this->handle(), index, &item); } Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h 2008-02-10 00:32:56 UTC (rev 1000) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h 2008-02-10 19:19:16 UTC (rev 1001) @@ -44,6 +44,8 @@ WidgetChildWindow* getActive(); void setActive(WidgetChildWindow* w) { setActive(findTab(w)); } + SmartUtil::tstring getTabText(WidgetChildWindow* w); + void onTitleChanged(const std::tr1::function<void (const SmartUtil::tstring&)>& f) { titleChangedFunction = f; } @@ -60,8 +62,6 @@ void create( const Seed & cs = Seed() ); - enum { MAX_TITLE_LENGTH = 20 }; - protected: friend class WidgetCreator<WidgetTabView>; @@ -70,6 +70,8 @@ virtual ~WidgetTabView() { } private: + enum { MAX_TITLE_LENGTH = 20 }; + struct TabInfo { TabInfo(WidgetChildWindow* w_) : w(w_) { } WidgetChildWindow* w; Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetTabSheet.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetTabSheet.cpp 2008-02-10 00:32:56 UTC (rev 1000) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetTabSheet.cpp 2008-02-10 19:19:16 UTC (rev 1001) @@ -59,19 +59,17 @@ TabCtrl_SetImageList(handle(), imageList->handle()); } -inline SmartUtil::tstring WidgetTabSheet::getSelectedHeader() const +SmartUtil::tstring WidgetTabSheet::getText(unsigned idx) const { - TCITEM item; - item.mask = TCIF_TEXT; + TCITEM item = { TCIF_TEXT }; TCHAR buffer[200]; item.cchTextMax = 198; item.pszText = buffer; - if ( !TabCtrl_GetItem( this->handle(), getSelectedIndex(), & item ) ) + if ( !TabCtrl_GetItem( this->handle(), idx, & item ) ) { - throw xCeption( _T( "Couldn't retrieve text of currently selected TabSheet item." ) ); + throw xCeption( _T( "Couldn't retrieve text in WidgetTabSheet::getText." ) ); } return buffer; } - } Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp 2008-02-10 00:32:56 UTC (rev 1000) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp 2008-02-10 19:19:16 UTC (rev 1001) @@ -92,6 +92,13 @@ titleChangedFunction(SmartUtil::tstring()); } +SmartUtil::tstring WidgetTabView::getTabText(WidgetChildWindow* w) { + int i = findTab(w); + if(i != -1) + return tab->getText(i); + return SmartUtil::tstring(); +} + void WidgetTabView::onTabContextMenu(WidgetChildWindow* w, const std::tr1::function<bool (const ScreenCoordinate& pt)>& f) { TabInfo* ti = getTabInfo(w); if(ti) { @@ -174,7 +181,7 @@ bool WidgetTabView::handleTextChanging(WidgetChildWindow* w, const SmartUtil::tstring& newText) { int i = findTab(w); if(i != -1) { - tab->setHeader(i, formatTitle(newText)); + tab->setText(i, formatTitle(newText)); layout(); if((i == active) && titleChangedFunction) @@ -184,7 +191,9 @@ } SmartUtil::tstring WidgetTabView::formatTitle(SmartUtil::tstring title) { - return SmartUtil::escapeMenu(SmartUtil::cutText(title, MAX_TITLE_LENGTH)); + if(title.length() > MAX_TITLE_LENGTH) + title = title.substr(0, MAX_TITLE_LENGTH - 3) + _T("..."); + return SmartUtil::escapeMenu(title); } bool WidgetTabView::handleSized(const WidgetSizedEventResult& sz) { Modified: dcplusplus/trunk/win32/HubFrame.cpp =================================================================== --- dcplusplus/trunk/win32/HubFrame.cpp 2008-02-10 00:32:56 UTC (rev 1000) +++ dcplusplus/trunk/win32/HubFrame.cpp 2008-02-10 19:19:16 UTC (rev 1001) @@ -1168,7 +1168,7 @@ bool HubFrame::handleTabContextMenu(const SmartWin::ScreenCoordinate& pt) { WidgetMenuExtendedPtr menu = createExtendedMenu(WinUtil::Seeds::menuExtended); - menu->setTitle(SmartUtil::cutText(getText(), SmartWin::WidgetTabView::MAX_TITLE_LENGTH)); + menu->setTitle(getParent()->getTabText(this)); if(!FavoriteManager::getInstance()->isFavoriteHub(url)) { menu->appendItem(IDC_ADD_TO_FAVORITES, T_("Add To &Favorites"), std::tr1::bind(&HubFrame::addAsFavorite, this), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_FAVORITE_HUBS))); Modified: dcplusplus/trunk/win32/MDIChildFrame.h =================================================================== --- dcplusplus/trunk/win32/MDIChildFrame.h 2008-02-10 00:32:56 UTC (rev 1000) +++ dcplusplus/trunk/win32/MDIChildFrame.h 2008-02-10 19:19:16 UTC (rev 1001) @@ -187,7 +187,7 @@ bool handleContextMenu(const SmartWin::ScreenCoordinate& pt) { SmartWin::WidgetMenuExtended::ObjectType menu = createExtendedMenu(WinUtil::Seeds::menuExtended); - menu->setTitle(SmartUtil::cutText(getText(), SmartWin::WidgetTabView::MAX_TITLE_LENGTH)); + menu->setTitle(getParent()->getTabText(this)); 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); return true; Modified: dcplusplus/trunk/win32/PrivateFrame.cpp =================================================================== --- dcplusplus/trunk/win32/PrivateFrame.cpp 2008-02-10 00:32:56 UTC (rev 1000) +++ dcplusplus/trunk/win32/PrivateFrame.cpp 2008-02-10 19:19:16 UTC (rev 1001) @@ -375,7 +375,7 @@ bool PrivateFrame::handleTabContextMenu(const SmartWin::ScreenCoordinate& pt) { WidgetMenuExtendedPtr menu = createExtendedMenu(WinUtil::Seeds::menuExtended); - menu->setTitle(SmartUtil::cutText(getText(), SmartWin::WidgetTabView::MAX_TITLE_LENGTH)); + menu->setTitle(getParent()->getTabText(this)); menu->appendItem(IDC_GETLIST, T_("&Get file list"), std::tr1::bind(&PrivateFrame::handleGetList, this)); menu->appendItem(IDC_MATCH_QUEUE, T_("&Match queue"), std::tr1::bind(&PrivateFrame::handleMatchQueue, this)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ul...@us...> - 2008-02-10 21:35:57
|
Revision: 1002 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1002&view=rev Author: ullner Date: 2008-02-10 13:35:52 -0800 (Sun, 10 Feb 2008) Log Message: ----------- version.xml use Coral; fixed todo for quick connect/nick missing; removed non-coral'd hub lists Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/SettingsManager.cpp dcplusplus/trunk/win32/AboutDlg.cpp dcplusplus/trunk/win32/MainWindow.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2008-02-10 19:19:16 UTC (rev 1001) +++ dcplusplus/trunk/changelog.txt 2008-02-10 21:35:52 UTC (rev 1002) @@ -13,7 +13,7 @@ * Added tab drag/drop (thanks poy) * Changed Pothead to mikejj * Fixed search spy crash -* Upgraded to bzip 1.0.4 (thanks pothead) +* Upgraded to bzip 1.0.4 (thanks mikejj) * Tab tooltips (thanks poy) * Allow spaces in the description field (poy) * [ADC] Handle third person formatting (thanks poy) @@ -29,6 +29,7 @@ * Fixed issues with scrolling (thanks poy) * Fixed re-add sources showing wrong sources (thanks poy) * Partially fixed kick message filtering (thanks mikejj) +* version.xml now use Coral (ullner) -- 0.704 2007-12-14 -- * Hub lists added to utilize Coral's distributed network (ullner) Modified: dcplusplus/trunk/dcpp/SettingsManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/SettingsManager.cpp 2008-02-10 19:19:16 UTC (rev 1001) +++ dcplusplus/trunk/dcpp/SettingsManager.cpp 2008-02-10 21:35:52 UTC (rev 1002) @@ -136,7 +136,7 @@ setDefault(IGNORE_BOT_PMS, false); setDefault(LIST_DUPES, true); setDefault(BUFFER_SIZE, 64); - setDefault(HUBLIST_SERVERS, "http://hublist.hubtracker.com/hublist.xml.bz2;http://dchublist.com/hublist.xml.bz2;http://adchublist.com/hublist.xml.bz2;http://www.hublist.org/PublicHubList.xml.bz2;http://dclist.eu/hublist.xml.bz2;http://download.hublist.cz/hublist.xml.bz2;http://hublist.awenet.info/PublicHubList.xml.bz2;http://hublist.hubtracker.com.nyud.net/hublist.xml.bz2;http://dchublist.com.nyud.net/hublist.xml.bz2;http://adchublist.com.nyud.net/hublist.xml.bz2;http://www.hublist.org.nyud.net/PublicHubList.xml.bz2;http://dclist.eu.nyud.net/hublist.xml.bz2;http://download.hublist.cz.nyud.net/hublist.xml.bz2;http://hublist.awenet.info.nyud.net/PublicHubList.xml.bz2"); + setDefault(HUBLIST_SERVERS, "http://hublist.hubtracker.com.nyud.net/hublist.xml.bz2;http://dchublist.com.nyud.net/hublist.xml.bz2;http://adchublist.com.nyud.net/hublist.xml.bz2;http://www.hublist.org.nyud.net/PublicHubList.xml.bz2;http://dclist.eu.nyud.net/hublist.xml.bz2;http://download.hublist.cz.nyud.net/hublist.xml.bz2;http://hublist.awenet.info.nyud.net/PublicHubList.xml.bz2"); setDefault(DOWNLOAD_SLOTS, 3); setDefault(MAX_DOWNLOAD_SPEED, 0); setDefault(LOG_DIRECTORY, Util::getConfigPath() + "Logs" PATH_SEPARATOR_STR); Modified: dcplusplus/trunk/win32/AboutDlg.cpp =================================================================== --- dcplusplus/trunk/win32/AboutDlg.cpp 2008-02-10 19:19:16 UTC (rev 1001) +++ dcplusplus/trunk/win32/AboutDlg.cpp 2008-02-10 21:35:52 UTC (rev 1002) @@ -67,7 +67,7 @@ centerWindow(); c.addListener(this); - c.downloadFile("http://dcplusplus.sourceforge.net/version.xml"); + c.downloadFile("http://dcplusplus.sourceforge.net.nyud.net/version.xml"); return false; } Modified: dcplusplus/trunk/win32/MainWindow.cpp =================================================================== --- dcplusplus/trunk/win32/MainWindow.cpp 2008-02-10 19:19:16 UTC (rev 1001) +++ dcplusplus/trunk/win32/MainWindow.cpp 2008-02-10 21:35:52 UTC (rev 1002) @@ -106,7 +106,7 @@ c = new HttpConnection; c->addListener(this); - c->downloadFile("http://dcplusplus.sourceforge.net/version.xml"); + c->downloadFile("http://dcplusplus.sourceforge.net.nyud.net/version.xml"); File::ensureDirectory(SETTING(LOG_DIRECTORY)); startSocket(); @@ -348,9 +348,10 @@ } void MainWindow::handleQuickConnect() { - ///@todo send user to settings - if (SETTING(NICK).empty()) + if (SETTING(NICK).empty()) { + postMessage(WM_COMMAND, IDC_SETTINGS); return; + } LineDlg dlg(this, T_("Quick Connect"), T_("Address")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2008-02-09 22:14:52
|
Revision: 999 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=999&view=rev Author: arnetheduck Date: 2008-02-09 14:14:47 -0800 (Sat, 09 Feb 2008) Log Message: ----------- add requesting message when downloading, fix downloads view Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/DownloadManager.cpp dcplusplus/trunk/dcpp/DownloadManagerListener.h dcplusplus/trunk/dcpp/HashBloom.cpp dcplusplus/trunk/win32/TransferView.cpp dcplusplus/trunk/win32/TransferView.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2008-02-09 20:51:52 UTC (rev 998) +++ dcplusplus/trunk/changelog.txt 2008-02-09 22:14:47 UTC (rev 999) @@ -28,7 +28,7 @@ * [ADC] Added /me handling (thanks poy) * Fixed issues with scrolling (thanks poy) * Fixed re-add sources showing wrong sources (thanks poy) -* Partially fixed +* Partially fixed kick message filtering (thanks mikejj) -- 0.704 2007-12-14 -- * Hub lists added to utilize Coral's distributed network (ullner) Modified: dcplusplus/trunk/dcpp/DownloadManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/DownloadManager.cpp 2008-02-09 20:51:52 UTC (rev 998) +++ dcplusplus/trunk/dcpp/DownloadManager.cpp 2008-02-09 22:14:47 UTC (rev 999) @@ -192,7 +192,10 @@ if(aConn->isSet(UserConnection::FLAG_SUPPORTS_XML_BZLIST) && d->getType() == Transfer::TYPE_FULL_LIST) { d->setFlag(Download::FLAG_XML_BZ_LIST); } + + fire(DownloadManagerListener::Requesting(), d); aConn->send(d->getCommand(aConn->isSet(UserConnection::FLAG_SUPPORTS_ZLIB_GET))); + } void DownloadManager::on(AdcCommand::SND, UserConnection* aSource, const AdcCommand& cmd) throw() { Modified: dcplusplus/trunk/dcpp/DownloadManagerListener.h =================================================================== --- dcplusplus/trunk/dcpp/DownloadManagerListener.h 2008-02-09 20:51:52 UTC (rev 998) +++ dcplusplus/trunk/dcpp/DownloadManagerListener.h 2008-02-09 22:14:47 UTC (rev 999) @@ -45,11 +45,17 @@ typedef X<1> Failed; typedef X<2> Starting; typedef X<3> Tick; + typedef X<3> Requesting; /** * This is the first message sent before a download starts. - * No other messages will be sent before. + * No other messages will be sent before this. */ + virtual void on(Requesting, Download*) throw() { } + + /** + * This is the first message sent before a download starts. + */ virtual void on(Starting, Download*) throw() { } /** Modified: dcplusplus/trunk/dcpp/HashBloom.cpp =================================================================== --- dcplusplus/trunk/dcpp/HashBloom.cpp 2008-02-09 20:51:52 UTC (rev 998) +++ dcplusplus/trunk/dcpp/HashBloom.cpp 2008-02-09 22:14:47 UTC (rev 999) @@ -50,13 +50,13 @@ } size_t HashBloom::pos(const TTHValue& tth, size_t n) const { - uint64_t x = 0; - - size_t start = n * h; if((n+1)*h > TTHValue::BITS) { return 0; } + uint64_t x = 0; + + size_t start = n * h; for(size_t i = 0; i < h; ++i) { size_t bit = start + i; size_t byte = bit / 8; Modified: dcplusplus/trunk/win32/TransferView.cpp =================================================================== --- dcplusplus/trunk/win32/TransferView.cpp 2008-02-09 20:51:52 UTC (rev 998) +++ dcplusplus/trunk/win32/TransferView.cpp 2008-02-09 22:14:47 UTC (rev 999) @@ -33,7 +33,7 @@ #include <dcpp/Upload.h> int TransferView::connectionIndexes[] = { CONNECTION_COLUMN_USER, CONNECTION_COLUMN_STATUS, CONNECTION_COLUMN_SPEED, CONNECTION_COLUMN_CHUNK, CONNECTION_COLUMN_TRANSFERED, CONNECTION_COLUMN_QUEUED, CONNECTION_COLUMN_CIPHER, CONNECTION_COLUMN_IP }; -int TransferView::connectionSizes[] = { 125, 375, 100, 100, 125, 75, 100, 100 }; +int TransferView::connectionSizes[] = { 125, 375, 100, 125, 125, 75, 100, 100 }; int TransferView::downloadIndexes[] = { DOWNLOAD_COLUMN_FILE, DOWNLOAD_COLUMN_PATH, DOWNLOAD_COLUMN_STATUS, DOWNLOAD_COLUMN_TIMELEFT, DOWNLOAD_COLUMN_SPEED, DOWNLOAD_COLUMN_DONE, DOWNLOAD_COLUMN_SIZE }; int TransferView::downloadSizes[] = { 200, 300, 150, 200, 125, 100, 100 }; @@ -42,7 +42,7 @@ N_("User"), N_("Status"), N_("Speed"), - N_("Chunk size"), + N_("Chunk"), N_("Transfered (Ratio)"), N_("Queued"), N_("Cipher"), @@ -575,8 +575,9 @@ } if(ui.updateMask & UpdateInfo::MASK_CHUNK) { + chunkPos = ui.chunkPos; chunk = ui.chunk; - columns[CONNECTION_COLUMN_CHUNK] = Text::toT(Util::formatBytes(ui.chunk)); + columns[CONNECTION_COLUMN_CHUNK] = Text::toT(Util::formatBytes(chunkPos) + "/" + Util::formatBytes(chunk)); } if(ui.updateMask & UpdateInfo::MASK_SPEED) { @@ -682,7 +683,7 @@ void TransferView::starting(UpdateInfo* ui, Transfer* t) { ui->setStatus(ConnectionInfo::STATUS_RUNNING); ui->setTransfered(t->getPos(), t->getActual()); - ui->setChunk(t->getSize()); + ui->setChunk(t->getPos(), t->getSize()); const UserConnection& uc = t->getUserConnection(); ui->setCipher(Text::toT(uc.getCipherName())); tstring country = Text::toT(Util::getIpCountry(uc.getRemoteIp())); @@ -694,10 +695,21 @@ } } +void TransferView::on(DownloadManagerListener::Requesting, Download* d) throw() { + UpdateInfo* ui = new UpdateInfo(d->getUser(), true); + + starting(ui, d); + + ui->setStatusString(str(TF_("Requesting %1%") % getFile(d))); + + speak(CONNECTIONS_UPDATE, ui); + + speak(DOWNLOADS_ADD_USER, new TickInfo(d->getPath())); +} + void TransferView::on(DownloadManagerListener::Starting, Download* d) throw() { UpdateInfo* ui = new UpdateInfo(d->getUser(), true); - starting(ui, d); tstring statusString; if(d->getUserConnection().isSecure()) { @@ -720,8 +732,6 @@ ui->setStatusString(statusString); speak(CONNECTIONS_UPDATE, ui); - - speak(DOWNLOADS_ADD_USER, new TickInfo(d->getPath())); } void TransferView::on(DownloadManagerListener::Tick, const DownloadList& dl) throw() { @@ -731,7 +741,7 @@ UpdateInfo* ui = new UpdateInfo(d->getUser(), true); ui->setTransfered(d->getPos(), d->getActual()); ui->setSpeed(d->getAverageSpeed()); - + ui->setChunk(d->getPos(), d->getSize()); tasks.add(CONNECTIONS_UPDATE, ui); } Modified: dcplusplus/trunk/win32/TransferView.h =================================================================== --- dcplusplus/trunk/win32/TransferView.h 2008-02-09 20:51:52 UTC (rev 998) +++ dcplusplus/trunk/win32/TransferView.h 2008-02-09 22:14:47 UTC (rev 999) @@ -117,6 +117,7 @@ int64_t queued; int64_t speed; int64_t chunk; + int64_t chunkPos; tstring columns[CONNECTION_COLUMN_LAST]; void update(const UpdateInfo& ui); @@ -167,7 +168,8 @@ int64_t speed; void setStatusString(const tstring& aStatusString) { statusString = aStatusString; updateMask |= MASK_STATUS_STRING; } tstring statusString; - void setChunk(int64_t aChunk) { chunk = aChunk; updateMask |= MASK_CHUNK; } + void setChunk(int64_t aChunkPos, int64_t aChunk) { chunkPos = aChunkPos; chunk = aChunk; updateMask |= MASK_CHUNK; } + int64_t chunkPos; int64_t chunk; void setIP(const tstring& aIp) { ip = aIp; updateMask |= MASK_IP; } @@ -277,6 +279,7 @@ virtual void on(ConnectionManagerListener::Removed, ConnectionQueueItem* aCqi) throw(); virtual void on(ConnectionManagerListener::StatusChanged, ConnectionQueueItem* aCqi) throw(); + virtual void on(DownloadManagerListener::Requesting, Download* aDownload) throw(); virtual void on(DownloadManagerListener::Complete, Download* aDownload) throw(); virtual void on(DownloadManagerListener::Failed, Download* aDownload, const string& aReason) throw(); virtual void on(DownloadManagerListener::Starting, Download* aDownload) throw(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2008-02-09 20:51:56
|
Revision: 998 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=998&view=rev Author: arnetheduck Date: 2008-02-09 12:51:52 -0800 (Sat, 09 Feb 2008) Log Message: ----------- Patches Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/AdcHub.cpp dcplusplus/trunk/dcpp/AdcHub.h dcplusplus/trunk/dcpp/Client.h dcplusplus/trunk/dcpp/ClientManager.cpp dcplusplus/trunk/dcpp/ClientManager.h dcplusplus/trunk/dcpp/NmdcHub.cpp dcplusplus/trunk/dcpp/NmdcHub.h dcplusplus/trunk/dcpp/Text.cpp dcplusplus/trunk/dcpp/Text.h dcplusplus/trunk/win32/AppearancePage.cpp dcplusplus/trunk/win32/HubFrame.cpp dcplusplus/trunk/win32/MainWindow.cpp dcplusplus/trunk/win32/MainWindow.h dcplusplus/trunk/win32/PrivateFrame.cpp dcplusplus/trunk/win32/PrivateFrame.h dcplusplus/trunk/win32/QueueFrame.cpp dcplusplus/trunk/win32/QueueFrame.h dcplusplus/trunk/win32/SystemFrame.cpp dcplusplus/trunk/win32/WinUtil.cpp dcplusplus/trunk/win32/WinUtil.h dcplusplus/trunk/win32/resource.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/changelog.txt 2008-02-09 20:51:52 UTC (rev 998) @@ -24,7 +24,12 @@ * Fixed crash when copying identity * Fixed potential timer race condition (thanks bigmuscle) * The good parts of partially downloaded segments are now added to queue (thanks bigmuscle) - +* Fancy menus (thanks poy) +* [ADC] Added /me handling (thanks poy) +* Fixed issues with scrolling (thanks poy) +* Fixed re-add sources showing wrong sources (thanks poy) +* Partially fixed + -- 0.704 2007-12-14 -- * Hub lists added to utilize Coral's distributed network (ullner) * Use system header arrows on common controls 6+ (thanks poy) Modified: dcplusplus/trunk/dcpp/AdcHub.cpp =================================================================== --- dcplusplus/trunk/dcpp/AdcHub.cpp 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/dcpp/AdcHub.cpp 2008-02-09 20:51:52 UTC (rev 998) @@ -560,16 +560,25 @@ } } -void AdcHub::hubMessage(const string& aMessage) { +void AdcHub::hubMessage(const string& aMessage, bool thirdPerson) { if(state != STATE_NORMAL) return; - send(AdcCommand(AdcCommand::CMD_MSG, AdcCommand::TYPE_BROADCAST).addParam(aMessage)); + AdcCommand c(AdcCommand::CMD_MSG, AdcCommand::TYPE_BROADCAST); + c.addParam(aMessage); + if(thirdPerson) + c.addParam("ME", "1"); + send(c); } -void AdcHub::privateMessage(const OnlineUser& user, const string& aMessage) { +void AdcHub::privateMessage(const OnlineUser& user, const string& aMessage, bool thirdPerson) { if(state != STATE_NORMAL) return; - send(AdcCommand(AdcCommand::CMD_MSG, user.getIdentity().getSID(), AdcCommand::TYPE_ECHO).addParam(aMessage).addParam("PM", getMySID())); + AdcCommand c(AdcCommand::CMD_MSG, user.getIdentity().getSID(), AdcCommand::TYPE_ECHO); + c.addParam(aMessage); + if(thirdPerson) + c.addParam("ME", "1"); + c.addParam("PM", getMySID()); + send(c); } void AdcHub::search(int aSizeMode, int64_t aSize, int aFileType, const string& aString, const string& aToken) { Modified: dcplusplus/trunk/dcpp/AdcHub.h =================================================================== --- dcplusplus/trunk/dcpp/AdcHub.h 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/dcpp/AdcHub.h 2008-02-09 20:51:52 UTC (rev 998) @@ -36,8 +36,8 @@ virtual void connect(const OnlineUser& user, const string& token); void connect(const OnlineUser& user, string const& token, bool secure); - virtual void hubMessage(const string& aMessage); - virtual void privateMessage(const OnlineUser& user, const string& aMessage); + virtual void hubMessage(const string& aMessage, bool thirdPerson = false); + virtual void privateMessage(const OnlineUser& user, const string& aMessage, bool thirdPerson = false); virtual void sendUserCmd(const string& aUserCmd) { send(aUserCmd); } virtual void search(int aSizeMode, int64_t aSize, int aFileType, const string& aString, const string& aToken); virtual void password(const string& pwd); Modified: dcplusplus/trunk/dcpp/Client.h =================================================================== --- dcplusplus/trunk/dcpp/Client.h 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/dcpp/Client.h 2008-02-09 20:51:52 UTC (rev 998) @@ -38,8 +38,8 @@ virtual void disconnect(bool graceless); virtual void connect(const OnlineUser& user, const string& token) = 0; - virtual void hubMessage(const string& aMessage) = 0; - virtual void privateMessage(const OnlineUser& user, const string& aMessage) = 0; + virtual void hubMessage(const string& aMessage, bool thirdPerson = false) = 0; + virtual void privateMessage(const OnlineUser& user, const string& aMessage, bool thirdPerson = false) = 0; virtual void sendUserCmd(const string& aUserCmd) = 0; virtual void search(int aSizeMode, int64_t aSize, int aFileType, const string& aString, const string& aToken) = 0; virtual void password(const string& pwd) = 0; Modified: dcplusplus/trunk/dcpp/ClientManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/ClientManager.cpp 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/dcpp/ClientManager.cpp 2008-02-09 20:51:52 UTC (rev 998) @@ -290,12 +290,12 @@ } } -void ClientManager::privateMessage(const UserPtr& p, const string& msg) { +void ClientManager::privateMessage(const UserPtr& p, const string& msg, bool thirdPerson) { Lock l(cs); OnlineIter i = onlineUsers.find(p->getCID()); if(i != onlineUsers.end()) { OnlineUser* u = i->second; - u->getClient().privateMessage(*u, msg); + u->getClient().privateMessage(*u, msg, thirdPerson); } } Modified: dcplusplus/trunk/dcpp/ClientManager.h =================================================================== --- dcplusplus/trunk/dcpp/ClientManager.h 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/dcpp/ClientManager.h 2008-02-09 20:51:52 UTC (rev 998) @@ -80,7 +80,7 @@ void connect(const UserPtr& p, const string& token); void send(AdcCommand& c, const CID& to); - void privateMessage(const UserPtr& p, const string& msg); + void privateMessage(const UserPtr& p, const string& msg, bool thirdPerson); void userCommand(const UserPtr& p, const UserCommand& uc, StringMap& params, bool compatibility); Modified: dcplusplus/trunk/dcpp/NmdcHub.cpp =================================================================== --- dcplusplus/trunk/dcpp/NmdcHub.cpp 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/dcpp/NmdcHub.cpp 2008-02-09 20:51:52 UTC (rev 998) @@ -748,9 +748,9 @@ send("$RevConnectToMe " + fromUtf8(getMyNick()) + " " + fromUtf8(aUser.getIdentity().getNick()) + "|"); } -void NmdcHub::hubMessage(const string& aMessage) { +void NmdcHub::hubMessage(const string& aMessage, bool thirdPerson) { checkstate(); - send(fromUtf8( "<" + getMyNick() + "> " + escape(aMessage) + "|" ) ); + send(fromUtf8( "<" + getMyNick() + "> " + escape(thirdPerson ? "/me " + aMessage : aMessage) + "|" ) ); } void NmdcHub::myInfo(bool alwaysSend) { @@ -870,7 +870,7 @@ return tmp; } -void NmdcHub::privateMessage(const OnlineUser& aUser, const string& aMessage) { +void NmdcHub::privateMessage(const OnlineUser& aUser, const string& aMessage, bool /*thirdPerson*/) { checkstate(); send("$To: " + fromUtf8(aUser.getIdentity().getNick()) + " From: " + fromUtf8(getMyNick()) + " $" + fromUtf8(escape("<" + getMyNick() + "> " + aMessage)) + "|"); Modified: dcplusplus/trunk/dcpp/NmdcHub.h =================================================================== --- dcplusplus/trunk/dcpp/NmdcHub.h 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/dcpp/NmdcHub.h 2008-02-09 20:51:52 UTC (rev 998) @@ -39,8 +39,8 @@ virtual void connect(const OnlineUser& aUser, const string&); - virtual void hubMessage(const string& aMessage); - virtual void privateMessage(const OnlineUser& aUser, const string& aMessage); + virtual void hubMessage(const string& aMessage, bool /*thirdPerson*/ = false); + virtual void privateMessage(const OnlineUser& aUser, const string& aMessage, bool /*thirdPerson*/ = false); virtual void sendUserCmd(const string& aUserCmd) throw() { send(fromUtf8(aUserCmd)); } virtual void search(int aSizeType, int64_t aSize, int aFileType, const string& aString, const string& aToken); virtual void password(const string& aPass) { send("$MyPass " + fromUtf8(aPass) + "|"); } Modified: dcplusplus/trunk/dcpp/Text.cpp =================================================================== --- dcplusplus/trunk/dcpp/Text.cpp 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/dcpp/Text.cpp 2008-02-09 20:51:52 UTC (rev 998) @@ -417,4 +417,25 @@ return tmp; } +wstring Text::toDOS(wstring tmp) { + if(tmp.empty()) + return Util::emptyStringW; + + if(tmp[0] == L'\r' && (tmp.size() == 1 || tmp[1] != L'\n')) { + tmp.insert(1, L"\n"); + } + for(string::size_type i = 1; i < tmp.size() - 1; ++i) { + if(tmp[i] == L'\r' && tmp[i+1] != L'\n') { + // Mac ending + tmp.insert(i+1, L"\n"); + i++; + } else if(tmp[i] == L'\n' && tmp[i-1] != L'\r') { + // Unix encoding + tmp.insert(i, L"\r"); + i++; + } + } + return tmp; +} + } // namespace dcpp Modified: dcplusplus/trunk/dcpp/Text.h =================================================================== --- dcplusplus/trunk/dcpp/Text.h 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/dcpp/Text.h 2008-02-09 20:51:52 UTC (rev 998) @@ -132,6 +132,7 @@ } string toDOS(string tmp); + wstring toDOS(wstring tmp); } Modified: dcplusplus/trunk/win32/AppearancePage.cpp =================================================================== --- dcplusplus/trunk/win32/AppearancePage.cpp 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/win32/AppearancePage.cpp 2008-02-09 20:51:52 UTC (rev 998) @@ -44,7 +44,7 @@ PropPage::ListItem AppearancePage::listItems[] = { { SettingsManager::ALT_SORT_ORDER, N_("Sort all downloads first") }, - { SettingsManager::FILTER_MESSAGES, N_("Filter kick and NMDC debug messages") }, + { SettingsManager::FILTER_MESSAGES, N_("Filter kick messages") }, { SettingsManager::MINIMIZE_TRAY, N_("Minimize to tray") }, { SettingsManager::TIME_STAMPS, N_("Show timestamps in chat by default") }, { SettingsManager::STATUS_IN_CHAT, N_("View status messages in main chat") }, Modified: dcplusplus/trunk/win32/HubFrame.cpp =================================================================== --- dcplusplus/trunk/win32/HubFrame.cpp 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/win32/HubFrame.cpp 2008-02-09 20:51:52 UTC (rev 998) @@ -277,9 +277,10 @@ tstring param; tstring msg; tstring status; - if(WinUtil::checkCommand(cmd, param, msg, status)) { + bool thirdPerson = false; + if(WinUtil::checkCommand(cmd, param, msg, status, thirdPerson)) { if(!msg.empty()) { - client->hubMessage(Text::fromT(msg)); + client->hubMessage(Text::fromT(msg), thirdPerson); } if(!status.empty()) { addStatus(status); @@ -412,26 +413,21 @@ } else { line = _T("\r\n"); } - line += aLine; + line += Text::toDOS(aLine); - int limit = chat->getTextLimit(); - if(chat->length() + static_cast<int>(line.size()) > limit) { - HoldRedraw hold(chat); + SCROLLINFO scrollInfo = { sizeof(SCROLLINFO), SIF_RANGE | SIF_PAGE | SIF_POS }; + bool scroll = ( + (::GetScrollInfo(chat->handle(), SB_VERT, &scrollInfo) == 0) || // on error, let's keep scrolling... + (scrollInfo.nPos == (scrollInfo.nMax - max(scrollInfo.nPage - 1, 0u))) // scroll only if the current scroll position is at the end + ); + HoldRedraw hold(chat, !scroll); + + size_t limit = chat->getTextLimit(); + if(chat->length() + line.size() > limit) { + HoldRedraw hold2(chat, scroll); chat->setSelection(0, chat->lineIndex(chat->lineFromChar(limit / 10))); chat->replaceSelection(_T("")); } -#ifdef PORT_ME - BOOL noscroll = TRUE; - POINT p = ctrlClient.PosFromChar(ctrlClient.GetWindowTextLength() - 1); - CRect r; - ctrlClient.GetClientRect(r); - - if( r.PtInRect(p) || MDIGetActive() != m_hWnd) - noscroll = FALSE; - else { - ctrlClient.SetRedraw(FALSE); // Strange!! This disables the scrolling...???? - } -#endif if(BOOLSETTING(LOG_MAIN_CHAT)) { StringMap params; params["message"] = Text::fromT(aLine); @@ -441,11 +437,10 @@ LOG(LogManager::CHAT, params); } chat->addText(line); -#ifdef PORT_ME - if(noscroll) { - ctrlClient.SetRedraw(TRUE); - } -#endif + + if(scroll) + chat->sendMessage(WM_VSCROLL, SB_BOTTOM); + setDirty(SettingsManager::BOLD_HUB); } @@ -881,23 +876,23 @@ } void HubFrame::on(Message, Client*, const OnlineUser& from, const string& msg, bool thirdPerson) throw() { - speak(ADD_CHAT_LINE, Util::formatMessage(from.getIdentity().getNick(), msg, thirdPerson)); -} - -void HubFrame::on(StatusMessage, Client*, const string& line) throw() { if(SETTING(FILTER_MESSAGES)) { - if((line.find("Hub-Security") != string::npos) && (line.find("was kicked by") != string::npos)) { + if((msg.find("Hub-Security") != string::npos) && (msg.find("was kicked by") != string::npos)) { // Do nothing... - } else if((line.find("is kicking") != string::npos) && (line.find("because:") != string::npos)) { - speak(ADD_SILENT_STATUS_LINE, Text::toDOS(line)); + } else if((msg.find("is kicking") != string::npos) && (msg.find("because:") != string::npos)) { + speak(ADD_SILENT_STATUS_LINE, msg); } else { - speak(ADD_CHAT_LINE, Text::toDOS(line)); + speak(ADD_CHAT_LINE, Util::formatMessage(from.getIdentity().getNick(), msg, thirdPerson)); } } else { - speak(ADD_CHAT_LINE, Text::toDOS(line)); + speak(ADD_CHAT_LINE, Util::formatMessage(from.getIdentity().getNick(), msg, thirdPerson)); } } +void HubFrame::on(StatusMessage, Client*, const string& line) throw() { + speak(ADD_CHAT_LINE, line); +} + void HubFrame::on(PrivateMessage, Client*, const OnlineUser& from, const OnlineUser& to, const OnlineUser& replyTo, const string& line, bool thirdPerson) throw() { speak(from, to, replyTo, Util::formatMessage(from.getIdentity().getNick(), line, thirdPerson)); } Modified: dcplusplus/trunk/win32/MainWindow.cpp =================================================================== --- dcplusplus/trunk/win32/MainWindow.cpp 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/win32/MainWindow.cpp 2008-02-09 20:51:52 UTC (rev 998) @@ -69,13 +69,13 @@ links.homepage = _T("http://dcpp.net/"); links.downloads = links.homepage + _T("download/"); links.geoipfile = _T("http://www.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip"); - links.translations = _T("http://sourceforge.net/tracker/?atid=460289&group_id=40287"); links.faq = links.homepage + _T("faq/"); links.help = links.homepage + _T("forum/"); links.discuss = links.homepage + _T("forum/"); links.features = links.homepage + _T("bugzilla/"); links.bugs = links.homepage + _T("bugzilla/"); - + links.donate = _T("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=arnetheduck%40gmail%2ecom&item_name=DCPlusPlus&no_shipping=1&return=http%3a%2f%2fdcplusplus%2esf%2enet%2f&cancel_return=http%3a%2f%2fdcplusplus%2esf%2enet%2f&cn=Greeting&tax=0¤cy_code=EUR&bn=PP%2dDonationsBF&charset=UTF%2d8"); + initWindow(); initMenu(); initToolbar(); @@ -246,7 +246,6 @@ help->appendItem(IDC_HELP_HOMEPAGE, T_("DC++ Homepage"), std::tr1::bind(&MainWindow::handleLink, this, _1)); help->appendItem(IDC_HELP_DOWNLOADS, T_("Downloads"), std::tr1::bind(&MainWindow::handleLink, this, _1)); help->appendItem(IDC_HELP_GEOIPFILE, T_("GeoIP database update"), std::tr1::bind(&MainWindow::handleLink, this, _1)); - help->appendItem(IDC_HELP_TRANSLATIONS, T_("Translations"), std::tr1::bind(&MainWindow::handleLink, this, _1)); help->appendItem(IDC_HELP_FAQ, T_("Frequently asked questions"), std::tr1::bind(&MainWindow::handleLink, this, _1)); help->appendItem(IDC_HELP_FORUM, T_("Help forum"), std::tr1::bind(&MainWindow::handleLink, this, _1)); help->appendItem(IDC_HELP_DISCUSS, T_("DC++ discussion forum"), std::tr1::bind(&MainWindow::handleLink, this, _1)); @@ -880,10 +879,6 @@ links.geoipfile = Text::toT(xml.getChildData()); } xml.resetCurrentChild(); - if(xml.findChild("Translations")) { - links.translations = Text::toT(xml.getChildData()); - } - xml.resetCurrentChild(); if(xml.findChild("Faq")) { links.faq = Text::toT(xml.getChildData()); } @@ -949,9 +944,6 @@ case IDC_HELP_GEOIPFILE: site = links.geoipfile; break; - case IDC_HELP_TRANSLATIONS: - site = links.translations; - break; case IDC_HELP_FAQ: site = links.faq; break; @@ -968,8 +960,7 @@ site = links.bugs; break; case IDC_HELP_DONATE: - site - = Text::toT("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=arnetheduck%40gmail%2ecom&item_name=DCPlusPlus&no_shipping=1&return=http%3a%2f%2fdcplusplus%2esf%2enet%2f&cancel_return=http%3a%2f%2fdcplusplus%2esf%2enet%2f&cn=Greeting&tax=0¤cy_code=EUR&bn=PP%2dDonationsBF&charset=UTF%2d8"); + site = links.donate; break; default: dcassert(0); Modified: dcplusplus/trunk/win32/MainWindow.h =================================================================== --- dcplusplus/trunk/win32/MainWindow.h 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/win32/MainWindow.h 2008-02-09 20:51:52 UTC (rev 998) @@ -94,12 +94,12 @@ tstring homepage; tstring downloads; tstring geoipfile; - tstring translations; tstring faq; tstring help; tstring discuss; tstring features; tstring bugs; + tstring donate; } links; WidgetHPanedPtr paned; Modified: dcplusplus/trunk/win32/PrivateFrame.cpp =================================================================== --- dcplusplus/trunk/win32/PrivateFrame.cpp 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/win32/PrivateFrame.cpp 2008-02-09 20:51:52 UTC (rev 998) @@ -144,9 +144,16 @@ } line += aLine; + SCROLLINFO scrollInfo = { sizeof(SCROLLINFO), SIF_RANGE | SIF_PAGE | SIF_POS }; + bool scroll = ( + (::GetScrollInfo(chat->handle(), SB_VERT, &scrollInfo) == 0) || // on error, let's keep scrolling... + (scrollInfo.nPos == (scrollInfo.nMax - max(scrollInfo.nPage - 1, 0u))) // scroll only if the current scroll position is at the end + ); + HoldRedraw hold(chat, !scroll); + size_t limit = chat->getTextLimit(); if(chat->length() + line.size() > limit) { - HoldRedraw hold(chat); + HoldRedraw hold2(chat, scroll); chat->setSelection(0, chat->lineIndex(chat->lineFromChar(limit / 10))); chat->replaceSelection(_T("")); } @@ -160,8 +167,11 @@ params["myCID"] = ClientManager::getInstance()->getMe()->getCID().toBase32(); LOG(LogManager::PM, params); } + chat->addText(line); - chat->addText(line); + if(scroll) + chat->sendMessage(WM_VSCROLL, SB_BOTTOM); + setDirty(SettingsManager::BOLD_PM); } @@ -268,29 +278,31 @@ bool send = false; // Process special commands if(s[0] == '/') { + tstring cmd = s; tstring param; tstring message; tstring status; - if(WinUtil::checkCommand(s, param, message, status)) { + bool thirdPerson = false; + if(WinUtil::checkCommand(cmd, param, message, status, thirdPerson)) { if(!message.empty()) { - sendMessage(message); + sendMessage(message, thirdPerson); } if(!status.empty()) { addStatus(status); } - } else if(Util::stricmp(s.c_str(), _T("clear")) == 0) { + } else if(Util::stricmp(cmd.c_str(), _T("clear")) == 0) { chat->setText(Util::emptyStringT); - } else if(Util::stricmp(s.c_str(), _T("grant")) == 0) { + } else if(Util::stricmp(cmd.c_str(), _T("grant")) == 0) { UploadManager::getInstance()->reserveSlot(replyTo); addStatus(T_("Slot granted")); - } else if(Util::stricmp(s.c_str(), _T("close")) == 0) { + } else if(Util::stricmp(cmd.c_str(), _T("close")) == 0) { postMessage(WM_CLOSE); - } else if((Util::stricmp(s.c_str(), _T("favorite")) == 0) || (Util::stricmp(s.c_str(), _T("fav")) == 0)) { + } else if((Util::stricmp(cmd.c_str(), _T("favorite")) == 0) || (Util::stricmp(cmd.c_str(), _T("fav")) == 0)) { FavoriteManager::getInstance()->addFavoriteUser(replyTo); addStatus(T_("Favorite user added")); - } else if(Util::stricmp(s.c_str(), _T("getlist")) == 0) { + } else if(Util::stricmp(cmd.c_str(), _T("getlist")) == 0) { // TODO handleGetList(); - } else if(Util::stricmp(s.c_str(), _T("log")) == 0) { + } else if(Util::stricmp(cmd.c_str(), _T("log")) == 0) { StringMap params; params["hubNI"] = Util::toString(ClientManager::getInstance()->getHubNames(replyTo->getCID())); @@ -299,7 +311,7 @@ params["userNI"] = ClientManager::getInstance()->getNicks(replyTo->getCID())[0]; params["myCID"] = ClientManager::getInstance()->getMe()->getCID().toBase32(); WinUtil::openFile(Text::toT(Util::validateFileName(SETTING(LOG_DIRECTORY) + Util::formatParams(SETTING(LOG_FILE_PRIVATE_CHAT), params, true)))); - } else if(Util::stricmp(s.c_str(), _T("help")) == 0) { + } else if(Util::stricmp(cmd.c_str(), _T("help")) == 0) { addStatus(_T("*** ") + WinUtil::commands + _T(", /getlist, /clear, /grant, /close, /favorite, /log <system, downloads, uploads>")); } else { send = true; @@ -323,8 +335,8 @@ } -void PrivateFrame::sendMessage(const tstring& msg) { - ClientManager::getInstance()->privateMessage(replyTo, Text::fromT(msg)); +void PrivateFrame::sendMessage(const tstring& msg, bool thirdPerson) { + ClientManager::getInstance()->privateMessage(replyTo, Text::fromT(msg), thirdPerson); } HRESULT PrivateFrame::handleSpeaker(WPARAM, LPARAM) { Modified: dcplusplus/trunk/win32/PrivateFrame.h =================================================================== --- dcplusplus/trunk/win32/PrivateFrame.h 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/win32/PrivateFrame.h 2008-02-09 20:51:52 UTC (rev 998) @@ -42,7 +42,7 @@ static void closeAll(); static void closeAllOffline(); - void sendMessage(const tstring& msg); + void sendMessage(const tstring& msg, bool thirdPerson = false); private: typedef MDIChildFrame<PrivateFrame> BaseType; Modified: dcplusplus/trunk/win32/QueueFrame.cpp =================================================================== --- dcplusplus/trunk/win32/QueueFrame.cpp 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/win32/QueueFrame.cpp 2008-02-09 20:51:52 UTC (rev 998) @@ -1004,7 +1004,7 @@ void QueueFrame::addBrowseMenu(const WidgetMenuPtr& parent, QueueItemInfo* qii) { unsigned int pos = parent->getCount(); WidgetMenuPtr menu = parent->appendPopup(T_("&Get file list")); - if(addUsers(menu, IDC_BROWSELIST, &QueueFrame::handleBrowseList, qii, false) == 0) { + if(addUsers(menu, IDC_BROWSELIST, &QueueFrame::handleBrowseList, qii->getSources(), false) == 0) { ::EnableMenuItem(menu->handle(), pos, MF_BYPOSITION | MF_GRAYED); } } @@ -1012,7 +1012,7 @@ void QueueFrame::addPMMenu(const WidgetMenuPtr& parent, QueueItemInfo* qii) { unsigned int pos = parent->getCount(); WidgetMenuPtr menu = parent->appendPopup(T_("&Send private message")); - if(addUsers(menu, IDC_PM, &QueueFrame::handlePM, qii, false) == 0) { + if(addUsers(menu, IDC_PM, &QueueFrame::handlePM, qii->getSources(), false) == 0) { ::EnableMenuItem(menu->handle(), pos, MF_BYPOSITION | MF_GRAYED); } } @@ -1023,7 +1023,7 @@ menu->appendItem(IDC_READD, T_("All"), std::tr1::bind(&QueueFrame::handleReadd, this, UserPtr())); menu->appendSeparatorItem(); - if(addUsers(menu, IDC_READD + 1, &QueueFrame::handleReadd, qii, true) == 0) { + if(addUsers(menu, IDC_READD + 1, &QueueFrame::handleReadd, qii->getBadSources(), true) == 0) { ::EnableMenuItem(menu->handle(), pos, MF_BYPOSITION | MF_GRAYED); } } @@ -1033,7 +1033,7 @@ WidgetMenuPtr menu = parent->appendPopup(T_("Remove source")); menu->appendItem(IDC_REMOVE_SOURCE, T_("All"), std::tr1::bind(&QueueFrame::handleRemoveSource, this, UserPtr())); menu->appendSeparatorItem(); - if(addUsers(menu, IDC_REMOVE_SOURCE + 1, &QueueFrame::handleRemoveSource, qii, true) == 0) { + if(addUsers(menu, IDC_REMOVE_SOURCE + 1, &QueueFrame::handleRemoveSource, qii->getSources(), true) == 0) { ::EnableMenuItem(menu->handle(), pos, MF_BYPOSITION | MF_GRAYED); } } @@ -1041,15 +1041,15 @@ void QueueFrame::addRemoveAllMenu(const WidgetMenuPtr& parent, QueueItemInfo* qii) { unsigned int pos = parent->getCount(); WidgetMenuPtr menu = parent->appendPopup(T_("Remove user from queue")); - if(addUsers(menu, IDC_REMOVE_SOURCES, &QueueFrame::handleRemoveSources, qii, true) == 0) { + if(addUsers(menu, IDC_REMOVE_SOURCES, &QueueFrame::handleRemoveSources, qii->getSources(), true) == 0) { ::EnableMenuItem(menu->handle(), pos, MF_BYPOSITION | MF_GRAYED); } } -unsigned int QueueFrame::addUsers(const WidgetMenuPtr& menu, unsigned int startId, void (QueueFrame::*handler)(const UserPtr&), QueueItemInfo* qii, bool offline) { +unsigned int QueueFrame::addUsers(const WidgetMenuPtr& menu, unsigned int startId, void (QueueFrame::*handler)(const UserPtr&), const QueueItem::SourceList& sources, bool offline) { unsigned int id = startId; - for(QueueItem::SourceIter i = qii->getSources().begin(); i != qii->getSources().end(); ++i) { - QueueItem::Source& source = *i; + for(QueueItem::SourceConstIter i = sources.begin(); i != sources.end(); ++i) { + const QueueItem::Source& source = *i; if(offline || source.getUser()->isOnline()) { tstring nick = SmartUtil::escapeMenu(WinUtil::getNicks(source.getUser())); menu->appendItem(id++, nick, reinterpret_cast<ULONG_PTR>(&source), (const WidgetMenu::SimpleDispatcher::F&)std::tr1::bind(handler, this, source.getUser())); Modified: dcplusplus/trunk/win32/QueueFrame.h =================================================================== --- dcplusplus/trunk/win32/QueueFrame.h 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/win32/QueueFrame.h 2008-02-09 20:51:52 UTC (rev 998) @@ -274,7 +274,7 @@ void addPMMenu(const WidgetMenuPtr& parent, QueueItemInfo* qii); void addPriorityMenu(const WidgetMenuPtr& parent); void addReaddMenu(const WidgetMenuPtr& parent, QueueItemInfo* qii); - unsigned int addUsers(const WidgetMenuPtr& menu, unsigned int startId, void (QueueFrame::*handler)(const UserPtr&), QueueItemInfo* qii, bool offline); + unsigned int addUsers(const WidgetMenuPtr& menu, unsigned int startId, void (QueueFrame::*handler)(const UserPtr&), const QueueItem::SourceList& sources, bool offline); void layout(); HRESULT handleSpeaker(WPARAM wParam, LPARAM lParam); Modified: dcplusplus/trunk/win32/SystemFrame.cpp =================================================================== --- dcplusplus/trunk/win32/SystemFrame.cpp 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/win32/SystemFrame.cpp 2008-02-09 20:51:52 UTC (rev 998) @@ -59,6 +59,7 @@ log->replaceSelection(_T("")); } log->addTextLines(Text::toT("\r\n[" + Util::getShortTimeString(t) + "] ") + msg); + log->sendMessage(WM_VSCROLL, SB_BOTTOM); setDirty(SettingsManager::BOLD_SYSTEM_LOG); } Modified: dcplusplus/trunk/win32/WinUtil.cpp =================================================================== --- dcplusplus/trunk/win32/WinUtil.cpp 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/win32/WinUtil.cpp 2008-02-09 20:51:52 UTC (rev 998) @@ -217,9 +217,9 @@ #define MSGS 16 -tstring WinUtil::commands = _T("/refresh, /slots #, /search <string>, /dc++, /away <msg>, /back, /g <searchstring>, /imdb <imdbquery>, /u <url>, /rebuild"); +tstring WinUtil::commands = _T("/refresh, /me <msg>, /slots #, /search <string>, /dc++, /away <msg>, /back, /g <searchstring>, /imdb <imdbquery>, /u <url>, /rebuild"); -bool WinUtil::checkCommand(tstring& cmd, tstring& param, tstring& message, tstring& status) { +bool WinUtil::checkCommand(tstring& cmd, tstring& param, tstring& message, tstring& status, bool& thirdPerson) { string::size_type i = cmd.find(' '); if(i != string::npos) { param = cmd.substr(i+1); @@ -238,6 +238,9 @@ } else { return false; } + } else if(Util::stricmp(cmd.c_str(), _T("me")) == 0) { + message = param; + thirdPerson = true; } else if(Util::stricmp(cmd.c_str(), _T("refresh"))==0) { try { ShareManager::getInstance()->setDirty(); Modified: dcplusplus/trunk/win32/WinUtil.h =================================================================== --- dcplusplus/trunk/win32/WinUtil.h 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/win32/WinUtil.h 2008-02-09 20:51:52 UTC (rev 998) @@ -90,7 +90,7 @@ * @param status Message that should be shown in the status line. * @return True if the command was processed, false otherwise. */ - static bool checkCommand(tstring& cmd, tstring& param, tstring& message, tstring& status); + static bool checkCommand(tstring& cmd, tstring& param, tstring& message, tstring& status, bool& thirdPerson); static void openFile(const tstring& file); static void openFolder(const tstring& file); Modified: dcplusplus/trunk/win32/resource.h =================================================================== --- dcplusplus/trunk/win32/resource.h 2008-02-09 12:12:59 UTC (rev 997) +++ dcplusplus/trunk/win32/resource.h 2008-02-09 20:51:52 UTC (rev 998) @@ -129,7 +129,6 @@ #define IDC_HELP_HOMEPAGE 1061 #define IDC_HELP_DOWNLOADS 1062 #define IDC_HELP_GEOIPFILE 1063 -#define IDC_HELP_TRANSLATIONS 1064 #define IDC_HELP_FORUM 1065 #define IDC_HELP_DISCUSS 1066 #define IDC_HELP_REQUEST_FEATURE 1067 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zou...@us...> - 2008-02-08 17:19:26
|
Revision: 996 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=996&view=rev Author: zouzou123gen Date: 2008-02-08 09:19:21 -0800 (Fri, 08 Feb 2008) Log Message: ----------- tab menus have icons and a title bar + more menu icons added Modified Paths: -------------- dcplusplus/trunk/smartwin/SmartUtil/StringUtils.cpp dcplusplus/trunk/smartwin/SmartUtil/StringUtils.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp dcplusplus/trunk/smartwin/source/widgets/WidgetMenuExtended.cpp dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp dcplusplus/trunk/win32/DCPlusPlus.rc dcplusplus/trunk/win32/HubFrame.cpp dcplusplus/trunk/win32/MDIChildFrame.h dcplusplus/trunk/win32/MainWindow.cpp dcplusplus/trunk/win32/PrivateFrame.cpp dcplusplus/trunk/win32/resource.h Added Paths: ----------- dcplusplus/trunk/res/menu/DCPlusPlus.bmp dcplusplus/trunk/res/menu/Exit.bmp dcplusplus/trunk/res/menu/Hub.bmp Added: dcplusplus/trunk/res/menu/DCPlusPlus.bmp =================================================================== (Binary files differ) Property changes on: dcplusplus/trunk/res/menu/DCPlusPlus.bmp ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: dcplusplus/trunk/res/menu/Exit.bmp =================================================================== (Binary files differ) Property changes on: dcplusplus/trunk/res/menu/Exit.bmp ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: dcplusplus/trunk/res/menu/Hub.bmp =================================================================== (Binary files differ) Property changes on: dcplusplus/trunk/res/menu/Hub.bmp ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: dcplusplus/trunk/smartwin/SmartUtil/StringUtils.cpp =================================================================== --- dcplusplus/trunk/smartwin/SmartUtil/StringUtils.cpp 2008-02-08 08:43:39 UTC (rev 995) +++ dcplusplus/trunk/smartwin/SmartUtil/StringUtils.cpp 2008-02-08 17:19:21 UTC (rev 996) @@ -3,6 +3,12 @@ #include "UtilSystemHeaders.h" namespace SmartUtil { + tstring cutText(tstring str, unsigned int maxLength) { + if(str.length() > maxLength) + str = str.substr(0, maxLength - 3) + _T("..."); + return str; + } + tstring escapeMenu(tstring str) { tstring::size_type i = 0; while( (i = str.find(_T('&'), i)) != tstring::npos) { Modified: dcplusplus/trunk/smartwin/SmartUtil/StringUtils.h =================================================================== --- dcplusplus/trunk/smartwin/SmartUtil/StringUtils.h 2008-02-08 08:43:39 UTC (rev 995) +++ dcplusplus/trunk/smartwin/SmartUtil/StringUtils.h 2008-02-08 17:19:21 UTC (rev 996) @@ -4,6 +4,7 @@ #include "tstring.h" namespace SmartUtil { +tstring cutText(tstring str, unsigned int maxLength); tstring escapeMenu(tstring str); } Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h 2008-02-08 08:43:39 UTC (rev 995) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h 2008-02-08 17:19:21 UTC (rev 996) @@ -124,9 +124,6 @@ /// Strip bar color COLORREF colorStrip; - /// Title background color - COLORREF colorTitle; - /// Menu bar color COLORREF colorMenuBar; @@ -146,14 +143,12 @@ */ MenuColorInfo( COLORREF menuColor = ColorUtilities::darkenColor( ::GetSysColor( COLOR_WINDOW ), 0.02 ), COLORREF stripColor = ColorUtilities::darkenColor( ::GetSysColor( COLOR_3DFACE ), 0.02 ), - COLORREF titleColor = ColorUtilities::darkenColor( ::GetSysColor( COLOR_MENUBAR ), 0.1 ), COLORREF menuBarColor = ::GetSysColor( COLOR_MENUBAR ), COLORREF highlightColor = ::GetSysColor( COLOR_HIGHLIGHT ), COLORREF titleTextColor = ::GetSysColor( COLOR_MENUTEXT ), COLORREF imageBackground = RGB( 0, 0, 0 ) ) // black : colorMenu( menuColor ), colorStrip( stripColor ), - colorTitle( titleColor ), colorMenuBar( menuBarColor ), colorHighlight( highlightColor ), colorTitleText( titleTextColor ), @@ -452,11 +447,16 @@ */ void checkItem( unsigned int id, bool setChecked, bool radioMark ); - /// Returns true if item is checked - bool isItemEnabled( unsigned int id ); + UINT getMenuState(UINT id, bool byPosition = false); - /// Returns true if item is checked - bool isItemChecked( unsigned int id ); + /// Return true if the item is a separator (by position) + bool isSeparator(UINT id, bool byPosition = false); + /// Return true if the menu item is checked + bool isChecked(UINT id, bool byPosition = false); + /// Return true if the menu item is a popup menu + bool isPopup(UINT id, bool byPosition = false); + /// Return true if the menu item is enabled (not grey and not disabled) + bool isEnabled(UINT id, bool byPosition = false); /// Returns true if menu is "system menu" (icon in top left of window) bool isSystemMenu() @@ -464,15 +464,23 @@ return isSysMenu; } - /// Returns item text - SmartUtil::tstring getItemText( unsigned int id ); + /// Returns the text of a specific menu item + /** Which menu item you wish to retrieve the text for is defined by the "id" + * parameter of the function. + */ + SmartUtil::tstring getText( unsigned idOrPos, bool byPos ); - /// Sets item text - void setItemText( unsigned int id, SmartUtil::tstring text ); + /// Sets the text of a specific menu item + /** Which menu item you wish to set the text is defined by the "id" + * parameter of the function. + */ + void setText( unsigned id, const SmartUtil::tstring& text ); /// Returns item data MenuItemDataPtr getData( int itemIndex ); + ObjectType getChild(UINT position); + virtual ~WidgetMenuExtended(); protected: Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h 2008-02-08 08:43:39 UTC (rev 995) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h 2008-02-08 17:19:21 UTC (rev 996) @@ -60,6 +60,8 @@ void create( const Seed & cs = Seed() ); + enum { MAX_TITLE_LENGTH = 20 }; + protected: friend class WidgetCreator<WidgetTabView>; @@ -68,7 +70,6 @@ virtual ~WidgetTabView() { } private: - enum { MAX_TITLE_LENGTH = 20 }; struct TabInfo { TabInfo(WidgetChildWindow* w_) : w(w_) { } WidgetChildWindow* w; Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp 2008-02-08 08:43:39 UTC (rev 995) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetMenu.cpp 2008-02-08 17:19:21 UTC (rev 996) @@ -36,7 +36,7 @@ { MENUITEMINFO mi = { sizeof(MENUITEMINFO) }; - mi.fMask = MIIM_TYPE; + mi.fMask = MIIM_STRING; if ( ::GetMenuItemInfo( this->handle(), id, byPosition, & mi ) == 0 ) { xAssert( false, _T( "Error while trying to get MenuItemInfo in WidgetMenu::getText..." ) ); @@ -59,7 +59,7 @@ info.dwTypeData = (TCHAR*) text.c_str(); if ( ::SetMenuItemInfo( this->handle(), id, FALSE, & info ) == FALSE ) - throw xCeption( _T( "Couldn't set item info in setItemText()" ) ); + throw xCeption( _T( "Couldn't set item info in WidgetMenu::setText" ) ); } void WidgetMenuBase::addCommands(Widget* widget) { Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetMenuExtended.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetMenuExtended.cpp 2008-02-08 08:43:39 UTC (rev 995) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetMenuExtended.cpp 2008-02-08 17:19:21 UTC (rev 996) @@ -101,74 +101,58 @@ ::CheckMenuRadioItem( this->itsHandle, id, id, id, id ); } -bool WidgetMenuExtended::isItemEnabled( unsigned int id ) +UINT WidgetMenuExtended::getMenuState( UINT id, bool byPosition ) { - // init struct for item info - MENUITEMINFO info; - memset( & info, 0, sizeof( MENUITEMINFO ) ); - info.cbSize = sizeof( MENUITEMINFO ); + return ::GetMenuState(this->handle(), id, byPosition ? MF_BYPOSITION : MF_BYCOMMAND); +} - // set flag - info.fMask = MIIM_STATE; +bool WidgetMenuExtended::isChecked( UINT id, bool byPosition ) +{ + return (getMenuState(id, byPosition) & MF_CHECKED) == MF_CHECKED; +} - // get item info - if ( ::GetMenuItemInfo( this->itsHandle, id, FALSE, & info ) == FALSE ) - throw xCeption( _T( "Couldn't get item info in isItemEnabled()" ) ); - - return ( info.fState & MFS_ENABLED ) == MFS_ENABLED; +bool WidgetMenuExtended::isEnabled( UINT id, bool byPosition ) +{ + return !(getMenuState(id, byPosition) & (MF_DISABLED | MF_GRAYED)); } -bool WidgetMenuExtended::isItemChecked( unsigned int id ) +bool WidgetMenuExtended::isPopup( UINT id, bool byPosition ) { - // init struct for item info - MENUITEMINFO info; - memset( & info, 0, sizeof( MENUITEMINFO ) ); - info.cbSize = sizeof( MENUITEMINFO ); + return (getMenuState(id, byPosition) & MF_POPUP) == MF_POPUP; +} - // set flag - info.fMask = MIIM_STATE; - - // get item info - if ( ::GetMenuItemInfo( this->itsHandle, id, FALSE, & info ) == FALSE ) - throw xCeption( _T( "Couldn't get item info in isItemChecked()" ) ); - - return ( info.fState & MF_CHECKED ) == MF_CHECKED; +bool WidgetMenuExtended::isSeparator( UINT id, bool byPosition ) +{ + return (getMenuState(id, byPosition) & MF_SEPARATOR) == MF_SEPARATOR; } -SmartUtil::tstring WidgetMenuExtended::getItemText( unsigned int id ) +SmartUtil::tstring WidgetMenuExtended::getText( unsigned id, bool byPosition ) { - MENUITEMINFO info; - memset( & info, 0, sizeof( MENUITEMINFO ) ); - info.cbSize = sizeof( MENUITEMINFO ); + MENUITEMINFO mi = { sizeof(MENUITEMINFO) }; // set flag - info.fMask = MIIM_STRING; + mi.fMask = MIIM_STRING; - if ( ::GetMenuItemInfo( this->itsHandle, id, FALSE, & info ) == FALSE ) - throw xCeption( _T( "Couldn't get item info in getItemText()" ) ); + if ( ::GetMenuItemInfo( this->itsHandle, id, byPosition, & mi ) == FALSE ) + throw xCeption( _T( "Couldn't get item info in WidgetMenuExtended::getText" ) ); - boost::scoped_array< TCHAR > buffer( new TCHAR[++info.cch] ); - info.dwTypeData = buffer.get(); - - if ( ::GetMenuItemInfo( this->itsHandle, id, FALSE, & info ) == FALSE ) - throw xCeption( _T( "Couldn't get item info in getItemText()" ) ); - - SmartUtil::tstring retVal = info.dwTypeData; - return retVal; + boost::scoped_array< TCHAR > buffer( new TCHAR[++mi.cch] ); + mi.dwTypeData = buffer.get(); + if ( ::GetMenuItemInfo( this->itsHandle, id, byPosition, & mi ) == FALSE ) + throw xCeption( _T( "Couldn't get item info in WidgetMenuExtended::getText" ) ); + return mi.dwTypeData; } -void WidgetMenuExtended::setItemText( unsigned int id, SmartUtil::tstring text ) +void WidgetMenuExtended::setText( unsigned id, const SmartUtil::tstring& text ) { - MENUITEMINFO info; - memset( & info, 0, sizeof( MENUITEMINFO ) ); - info.cbSize = sizeof( MENUITEMINFO ); + MENUITEMINFO mi = { sizeof(MENUITEMINFO) }; // set flag - info.fMask = MIIM_STRING; - info.dwTypeData = (TCHAR*) text.c_str(); + mi.fMask = MIIM_STRING; + mi.dwTypeData = (TCHAR*) text.c_str(); - if ( ::SetMenuItemInfo( this->itsHandle, id, FALSE, & info ) == FALSE ) - throw xCeption( _T( "Couldn't set item info in setItemText()" ) ); + if ( ::SetMenuItemInfo( this->itsHandle, id, FALSE, & mi ) == FALSE ) + throw xCeption( _T( "Couldn't set item info in WidgetMenuExtended::setText" ) ); } void WidgetMenuExtended::setTitle( const SmartUtil::tstring & title, bool drawSidebar /* = false */) @@ -224,7 +208,6 @@ // setup colors MenuColorInfo colorInfo = this->itsColorInfo; COLORREF colorMenuBar = colorInfo.colorMenuBar; - COLORREF colorTitle = colorInfo.colorTitle; COLORREF colorMenuDraw = colorInfo.colorMenu; // color for drawing menu COLORREF colorFillHighlighted = ColorUtilities::lightenColor( colorInfo.colorHighlight, 0.7 ); @@ -351,7 +334,7 @@ Rectangle textRectangle( 0, 0, sidebarWidth, rect.bottom - rect.top ); // draw background - Brush brush ( colorInfo.colorTitle ); + Brush brush ( colorInfo.colorMenuBar ); canvas.fillRectangle( textRectangle, brush ); // draw title @@ -372,7 +355,7 @@ // set item background if ( wrapper->isMenuTitleItem ) // for title { - Brush brush ( colorTitle ); + Brush brush ( colorMenuBar ); canvas.fillRectangle( itemRectangle, brush ); // draw raised border @@ -859,9 +842,20 @@ return retVal; } +WidgetMenuExtended::ObjectType WidgetMenuExtended::getChild( unsigned position ) { + HMENU h = ::GetSubMenu(handle(), position); + for(size_t i = 0; i < this->itsChildren.size(); ++i) { + ObjectType& menu = this->itsChildren[i]; + if(menu->handle() == h) { + return menu; + } + } + return ObjectType(); +} + WidgetMenuExtended::WidgetMenuExtended( SmartWin::Widget* parent ) : isSysMenu( false ), -itsTitleFont( new Font( _T( "Tahoma" ), 20, 10 ) ), +itsTitleFont( new Font( DefaultGuiFont ) ), drawSidebar( false ), itsChildrenRef( WidgetMenuExtendedPlatformImplementation< WidgetMenuExtended, CurrentPlatform >::itsChildren ), itsItemDataRef( WidgetMenuExtendedPlatformImplementation< WidgetMenuExtended, CurrentPlatform >::itsItemData ) Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp 2008-02-08 08:43:39 UTC (rev 995) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp 2008-02-08 17:19:21 UTC (rev 996) @@ -184,10 +184,7 @@ } SmartUtil::tstring WidgetTabView::formatTitle(SmartUtil::tstring title) { - if(title.length() > MAX_TITLE_LENGTH) { - title = title.substr(0, MAX_TITLE_LENGTH - 3) + _T("..."); - } - return SmartUtil::escapeMenu(title); + return SmartUtil::escapeMenu(SmartUtil::cutText(title, MAX_TITLE_LENGTH)); } bool WidgetTabView::handleSized(const WidgetSizedEventResult& sz) { Modified: dcplusplus/trunk/win32/DCPlusPlus.rc =================================================================== --- dcplusplus/trunk/win32/DCPlusPlus.rc 2008-02-08 08:43:39 UTC (rev 995) +++ dcplusplus/trunk/win32/DCPlusPlus.rc 2008-02-08 17:19:21 UTC (rev 996) @@ -31,13 +31,16 @@ IDB_ADL_SEARCH BITMAP "res/menu/ADLSearch.bmp" IDB_ARROWS BITMAP "res/arrows.bmp" +IDB_DCPP BITMAP "res/menu/DCPlusPlus.bmp" IDB_DL_QUEUE BITMAP "res/menu/DLQueue.bmp" +IDB_EXIT BITMAP "res/menu/Exit.bmp" IDB_FAVORITE_HUBS BITMAP "res/menu/FavoriteHubs.bmp" IDB_FAVORITE_USERS BITMAP "res/menu/FavoriteUsers.bmp" IDB_FINISHED_DL BITMAP "res/menu/FinishedDL.bmp" IDB_FINISHED_UL BITMAP "res/menu/FinishedUL.bmp" IDB_FOLDERS BITMAP "res/folders.bmp" IDB_FOLLOW BITMAP "res/menu/Follow.bmp" +IDB_HUB BITMAP "res/menu/Hub.bmp" IDB_NETWORK_STATS BITMAP "res/menu/NetworkStats.bmp" IDB_NOTEPAD BITMAP "res/menu/Notepad.bmp" IDB_OPEN_FILE_LIST BITMAP "res/menu/OpenFileList.bmp" Modified: dcplusplus/trunk/win32/HubFrame.cpp =================================================================== --- dcplusplus/trunk/win32/HubFrame.cpp 2008-02-08 08:43:39 UTC (rev 995) +++ dcplusplus/trunk/win32/HubFrame.cpp 2008-02-08 17:19:21 UTC (rev 996) @@ -1170,18 +1170,23 @@ } bool HubFrame::handleTabContextMenu(const SmartWin::ScreenCoordinate& pt) { - WidgetMenuPtr menu = createMenu(true); + 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); + menu->setTitle(SmartUtil::cutText(getText(), SmartWin::WidgetTabView::MAX_TITLE_LENGTH)); + if(!FavoriteManager::getInstance()->isFavoriteHub(url)) { - menu->appendItem(IDC_ADD_TO_FAVORITES, T_("Add To &Favorites"), std::tr1::bind(&HubFrame::addAsFavorite, this)); + menu->appendItem(IDC_ADD_TO_FAVORITES, T_("Add To &Favorites"), std::tr1::bind(&HubFrame::addAsFavorite, this), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_FAVORITE_HUBS))); } - menu->appendItem(IDC_RECONNECT, T_("&Reconnect\tCtrl+R"), std::tr1::bind(&HubFrame::handleReconnect, this)); + menu->appendItem(IDC_RECONNECT, T_("&Reconnect\tCtrl+R"), std::tr1::bind(&HubFrame::handleReconnect, this), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_RECONNECT))); menu->appendItem(IDC_COPY_HUB, T_("Copy &address to clipboard"), std::tr1::bind(&HubFrame::handleCopyHub, this)); prepareMenu(menu, UserCommand::CONTEXT_HUB, url); menu->appendSeparatorItem(); - menu->appendItem(IDC_CLOSE_WINDOW, T_("&Close"), std::tr1::bind(&HubFrame::close, this, true)); + menu->appendItem(IDC_CLOSE_WINDOW, T_("&Close"), std::tr1::bind(&HubFrame::close, this, true), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_EXIT))); inTabMenu = true; Modified: dcplusplus/trunk/win32/MDIChildFrame.h =================================================================== --- dcplusplus/trunk/win32/MDIChildFrame.h 2008-02-08 08:43:39 UTC (rev 995) +++ dcplusplus/trunk/win32/MDIChildFrame.h 2008-02-08 17:19:21 UTC (rev 996) @@ -186,11 +186,13 @@ } bool handleContextMenu(const SmartWin::ScreenCoordinate& pt) { - SmartWin::WidgetMenu::ObjectType menu = SmartWin::WidgetCreator<SmartWin::WidgetMenu>::create(SmartWin::WidgetMenu::Seed(true)); - menu->appendItem(IDC_CLOSE_WINDOW, T_("&Close"), std::tr1::bind(&ThisType::close, this, true)); - + 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); + 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); - return true; } Modified: dcplusplus/trunk/win32/MainWindow.cpp =================================================================== --- dcplusplus/trunk/win32/MainWindow.cpp 2008-02-08 08:43:39 UTC (rev 995) +++ dcplusplus/trunk/win32/MainWindow.cpp 2008-02-08 17:19:21 UTC (rev 996) @@ -186,7 +186,7 @@ { WidgetMenuExtendedPtr file = mainMenu->appendPopup(T_("&File")); - file->appendItem(IDC_QUICK_CONNECT, T_("&Quick Connect ...\tCtrl+Q"), std::tr1::bind(&MainWindow::handleQuickConnect, this)); + file->appendItem(IDC_QUICK_CONNECT, T_("&Quick Connect ...\tCtrl+Q"), std::tr1::bind(&MainWindow::handleQuickConnect, this), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_HUB))); file->appendItem(IDC_FOLLOW, T_("Follow last redirec&t\tCtrl+T"), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_FOLLOW))); file->appendItem(IDC_RECONNECT, T_("&Reconnect\tCtrl+R"), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_RECONNECT))); file->appendSeparatorItem(); @@ -200,7 +200,7 @@ file->appendItem(IDC_SETTINGS, T_("Settings..."), std::tr1::bind(&MainWindow::handleSettings, this), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_SETTINGS))); file->appendSeparatorItem(); - file->appendItem(IDC_EXIT, T_("E&xit"), std::tr1::bind(&MainWindow::handleExit, this)); + file->appendItem(IDC_EXIT, T_("E&xit"), std::tr1::bind(&MainWindow::handleExit, this), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_EXIT))); } { @@ -241,7 +241,7 @@ help->appendItem(IDC_HELP_CONTENTS, T_("Help &Contents\tF1"), std::tr1::bind(&MainWindow::handleMenuHelp, this, _1)); help->appendSeparatorItem(); help->appendItem(IDC_HELP_CHANGELOG, T_("Change Log"), std::tr1::bind(&MainWindow::handleMenuHelp, this, _1)); - help->appendItem(IDC_ABOUT, T_("About DC++..."), std::tr1::bind(&MainWindow::handleAbout, this)); + help->appendItem(IDC_ABOUT, T_("About DC++..."), std::tr1::bind(&MainWindow::handleAbout, this), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_DCPP))); help->appendSeparatorItem(); help->appendItem(IDC_HELP_HOMEPAGE, T_("DC++ Homepage"), std::tr1::bind(&MainWindow::handleLink, this, _1)); help->appendItem(IDC_HELP_DOWNLOADS, T_("Downloads"), std::tr1::bind(&MainWindow::handleLink, this, _1)); Modified: dcplusplus/trunk/win32/PrivateFrame.cpp =================================================================== --- dcplusplus/trunk/win32/PrivateFrame.cpp 2008-02-08 08:43:39 UTC (rev 995) +++ dcplusplus/trunk/win32/PrivateFrame.cpp 2008-02-08 17:19:21 UTC (rev 996) @@ -360,20 +360,25 @@ } bool PrivateFrame::handleTabContextMenu(const SmartWin::ScreenCoordinate& pt) { - WidgetMenuPtr menu = createMenu(true); + 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); + + menu->setTitle(SmartUtil::cutText(getText(), SmartWin::WidgetTabView::MAX_TITLE_LENGTH)); menu->appendItem(IDC_GETLIST, T_("&Get file list"), std::tr1::bind(&PrivateFrame::handleGetList, this)); menu->appendItem(IDC_MATCH_QUEUE, T_("&Match queue"), std::tr1::bind(&PrivateFrame::handleMatchQueue, this)); menu->appendItem(IDC_GRANTSLOT, T_("Grant &extra slot"), std::tr1::bind(&UploadManager::reserveSlot, UploadManager::getInstance(), replyTo)); if(!FavoriteManager::getInstance()->isFavoriteUser(replyTo)) - menu->appendItem(IDC_ADD_TO_FAVORITES, T_("Add To &Favorites"), std::tr1::bind(&FavoriteManager::addFavoriteUser, FavoriteManager::getInstance(), replyTo)); + menu->appendItem(IDC_ADD_TO_FAVORITES, T_("Add To &Favorites"), std::tr1::bind(&FavoriteManager::addFavoriteUser, FavoriteManager::getInstance(), replyTo), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_FAVORITE_USERS))); prepareMenu(menu, UserCommand::CONTEXT_CHAT, ClientManager::getInstance()->getHubs(replyTo->getCID())); menu->appendSeparatorItem(); - menu->appendItem(IDC_CLOSE_WINDOW, T_("&Close"), std::tr1::bind(&PrivateFrame::close, this, true)); + menu->appendItem(IDC_CLOSE_WINDOW, T_("&Close"), std::tr1::bind(&PrivateFrame::close, this, true), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_EXIT))); menu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); - return TRUE; + return true; } void PrivateFrame::runUserCommand(const UserCommand& uc) { Modified: dcplusplus/trunk/win32/resource.h =================================================================== --- dcplusplus/trunk/win32/resource.h 2008-02-08 08:43:39 UTC (rev 995) +++ dcplusplus/trunk/win32/resource.h 2008-02-08 17:19:21 UTC (rev 996) @@ -42,6 +42,9 @@ #define IDB_TOOLBAR20_HOT 168 #define IDB_USERS 169 #define IDB_WAITING_USERS 170 +#define IDB_EXIT 171 +#define IDB_HUB 172 +#define IDB_DCPP 173 #define IDD_ABOUTBOX 200 #define IDD_ADLS_PROPERTIES 201 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2008-02-08 08:43:44
|
Revision: 995 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=995&view=rev Author: arnetheduck Date: 2008-02-08 00:43:39 -0800 (Fri, 08 Feb 2008) Log Message: ----------- Another go at fixing negative users values Modified Paths: -------------- dcplusplus/trunk/win32/TransferView.cpp Modified: dcplusplus/trunk/win32/TransferView.cpp =================================================================== --- dcplusplus/trunk/win32/TransferView.cpp 2008-02-08 03:13:16 UTC (rev 994) +++ dcplusplus/trunk/win32/TransferView.cpp 2008-02-08 08:43:39 UTC (rev 995) @@ -476,15 +476,13 @@ int i = find(ti->path); if(i == -1) { int64_t size = QueueManager::getInstance()->getSize(ti->path); - if(size == -1) { - break; - } TTHValue tth; - if(QueueManager::getInstance()->getTTH(ti->path, tth)) { + if(size != -1 && QueueManager::getInstance()->getTTH(ti->path, tth)) { i = downloads->insert(new DownloadInfo(ti->path, size, tth)); - } else { - break; } + } else { + downloads->getData(i)->users++; + downloads->update(i); } } else if(i->first == DOWNLOADS_TICK) { boost::scoped_ptr<TickInfo> ti(static_cast<TickInfo*>(i->second)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zou...@us...> - 2008-02-08 03:13:20
|
Revision: 994 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=994&view=rev Author: zouzou123gen Date: 2008-02-07 19:13:16 -0800 (Thu, 07 Feb 2008) Log Message: ----------- fancy menus fixes Modified Paths: -------------- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h dcplusplus/trunk/smartwin/source/widgets/WidgetMenuExtended.cpp dcplusplus/trunk/win32/MainWindow.cpp Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h 2008-02-08 01:46:15 UTC (rev 993) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMenuExtended.h 2008-02-08 03:13:16 UTC (rev 994) @@ -179,9 +179,10 @@ typedef std::tr1::shared_ptr< MenuType > WidgetMenuExtendedPtr; struct Seed { - Seed(bool popup_) : popup(popup_) { } + Seed(bool popup_, const MenuColorInfo& colorInfo_) : popup(popup_), colorInfo(colorInfo_) { } Seed() : popup(false) { } bool popup; + MenuColorInfo colorInfo; }; HMENU handle() const { @@ -254,6 +255,9 @@ Widget* itsParent; + // Contains information about menu colors + MenuColorInfo itsColorInfo; + typedef std::map<unsigned, Widget::CallbackType> CallbackMap; CallbackMap callbacks; @@ -334,7 +338,7 @@ * wish to truly be creative and be 100% in control you must handle this Event * and do the actualy drawing of the Menu yourself, but for most people it will * be enough to just manipulate the background colors etc of the MenuItemData - * given to the menu in the appendItem or to call the setColorInfo function <br> + * given to the menu in the appendItem function <br> * Note! <br> * If this event is handled you also MUST handle the Measure Item Event!! */ @@ -466,16 +470,6 @@ /// Sets item text void setItemText( unsigned int id, SmartUtil::tstring text ); - /// Sets color information for the menu - /** The MenuColorInfo declares which colors will be used for drawing the menu ( - * items ) <br> - * Have no effect if you override the onDrawItem/onMeasureItem - */ - void setColorInfo( const MenuColorInfo & info ); - - /// Returns menu color information - MenuColorInfo getColorInfo(); - /// Returns item data MenuItemDataPtr getData( int itemIndex ); @@ -500,9 +494,6 @@ // if true title is drawn as sidebar bool drawSidebar; - // Contains information about menu colors - MenuColorInfo itsColorInfo; - // work around for gcc std::vector< WidgetMenuExtendedPlatformImplementation< WidgetMenuExtended, CurrentPlatform > ::WidgetMenuExtendedPtr > & itsChildrenRef; @@ -546,6 +537,8 @@ template< typename MenuType > void WidgetMenuExtendedPlatformImplementation< MenuType, SmartWinDesktop >::create(const Seed& cs) { + itsColorInfo = cs.colorInfo; + // Create menu if(cs.popup) itsHandle = ::CreatePopupMenu(); @@ -564,7 +557,7 @@ { // create popup menu pointer WidgetMenuExtendedPtr retVal ( new MenuType(this->itsParent) ); - retVal->create( Seed(true) ); + retVal->create( Seed(true, itsColorInfo) ); // init structure for new item MENUITEMINFO info; Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetMenuExtended.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetMenuExtended.cpp 2008-02-08 01:46:15 UTC (rev 993) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetMenuExtended.cpp 2008-02-08 03:13:16 UTC (rev 994) @@ -34,16 +34,6 @@ namespace SmartWin { -void WidgetMenuExtended::setColorInfo( const MenuColorInfo & info ) -{ - itsColorInfo = info; -} - -MenuColorInfo WidgetMenuExtended::getColorInfo() -{ - return itsColorInfo; -} - int WidgetMenuExtended::getItemIndex( unsigned int id ) { int index = 0; @@ -871,8 +861,8 @@ WidgetMenuExtended::WidgetMenuExtended( SmartWin::Widget* parent ) : isSysMenu( false ), -drawSidebar( false ), itsTitleFont( new Font( _T( "Tahoma" ), 20, 10 ) ), +drawSidebar( false ), itsChildrenRef( WidgetMenuExtendedPlatformImplementation< WidgetMenuExtended, CurrentPlatform >::itsChildren ), itsItemDataRef( WidgetMenuExtendedPlatformImplementation< WidgetMenuExtended, CurrentPlatform >::itsItemData ) { Modified: dcplusplus/trunk/win32/MainWindow.cpp =================================================================== --- dcplusplus/trunk/win32/MainWindow.cpp 2008-02-08 01:46:15 UTC (rev 993) +++ dcplusplus/trunk/win32/MainWindow.cpp 2008-02-08 03:13:16 UTC (rev 994) @@ -176,81 +176,85 @@ void MainWindow::initMenu() { dcdebug("initMenu\n"); - mainMenu = createExtendedMenu(); - // DC++ bitmaps use RGB(255, 0, 255) as their background (transparent) color - SmartWin::MenuColorInfo menuColorInfo = mainMenu->getColorInfo(); - menuColorInfo.colorImageBackground = RGB(255, 0, 255); - mainMenu->setColorInfo(menuColorInfo); + { + WidgetMenuExtended::Seed cs; + cs.colorInfo.colorImageBackground = RGB(255, 0, 255); // DC++ bitmaps use RGB(255, 0, 255) as their background (transparent) color + mainMenu = createExtendedMenu(cs); + } - WidgetMenuExtendedPtr file = mainMenu->appendPopup(T_("&File")); - file->setColorInfo(menuColorInfo); + { + WidgetMenuExtendedPtr file = mainMenu->appendPopup(T_("&File")); - file->appendItem(IDC_QUICK_CONNECT, T_("&Quick Connect ...\tCtrl+Q"), std::tr1::bind(&MainWindow::handleQuickConnect, this)); - file->appendItem(IDC_FOLLOW, T_("Follow last redirec&t\tCtrl+T"), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_FOLLOW))); - file->appendItem(IDC_RECONNECT, T_("&Reconnect\tCtrl+R"), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_RECONNECT))); - file->appendSeparatorItem(); + file->appendItem(IDC_QUICK_CONNECT, T_("&Quick Connect ...\tCtrl+Q"), std::tr1::bind(&MainWindow::handleQuickConnect, this)); + file->appendItem(IDC_FOLLOW, T_("Follow last redirec&t\tCtrl+T"), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_FOLLOW))); + file->appendItem(IDC_RECONNECT, T_("&Reconnect\tCtrl+R"), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_RECONNECT))); + file->appendSeparatorItem(); - file->appendItem(IDC_OPEN_FILE_LIST, T_("Open file list...\tCtrl+L"), std::tr1::bind(&MainWindow::handleOpenFileList, this), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_OPEN_FILE_LIST))); - file->appendItem(IDC_OPEN_OWN_LIST, T_("Open own list"), std::tr1::bind(&MainWindow::handleOpenOwnList, this)); - file->appendItem(IDC_MATCH_ALL, T_("Match downloaded lists"), std::tr1::bind(&MainWindow::handleMatchAll, this)); - file->appendItem(IDC_REFRESH_FILE_LIST, T_("Refresh file list\tCtrl+E"), std::tr1::bind(&MainWindow::handleRefreshFileList, this)); - file->appendItem(IDC_OPEN_DOWNLOADS, T_("Open downloads directory"), std::tr1::bind(&MainWindow::handleOpenDownloadsDir, this)); - file->appendSeparatorItem(); + file->appendItem(IDC_OPEN_FILE_LIST, T_("Open file list...\tCtrl+L"), std::tr1::bind(&MainWindow::handleOpenFileList, this), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_OPEN_FILE_LIST))); + file->appendItem(IDC_OPEN_OWN_LIST, T_("Open own list"), std::tr1::bind(&MainWindow::handleOpenOwnList, this)); + file->appendItem(IDC_MATCH_ALL, T_("Match downloaded lists"), std::tr1::bind(&MainWindow::handleMatchAll, this)); + file->appendItem(IDC_REFRESH_FILE_LIST, T_("Refresh file list\tCtrl+E"), std::tr1::bind(&MainWindow::handleRefreshFileList, this)); + file->appendItem(IDC_OPEN_DOWNLOADS, T_("Open downloads directory"), std::tr1::bind(&MainWindow::handleOpenDownloadsDir, this)); + file->appendSeparatorItem(); - file->appendItem(IDC_SETTINGS, T_("Settings..."), std::tr1::bind(&MainWindow::handleSettings, this), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_SETTINGS))); - file->appendSeparatorItem(); - file->appendItem(IDC_EXIT, T_("E&xit"), std::tr1::bind(&MainWindow::handleExit, this)); + file->appendItem(IDC_SETTINGS, T_("Settings..."), std::tr1::bind(&MainWindow::handleSettings, this), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_SETTINGS))); + file->appendSeparatorItem(); + file->appendItem(IDC_EXIT, T_("E&xit"), std::tr1::bind(&MainWindow::handleExit, this)); + } - WidgetMenuExtendedPtr view = mainMenu->appendPopup(T_("&View")); - view->setColorInfo(menuColorInfo); + { + WidgetMenuExtendedPtr view = mainMenu->appendPopup(T_("&View")); - view->appendItem(IDC_PUBLIC_HUBS, T_("&Public Hubs\tCtrl+P"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_PUBLIC_HUBS))); - view->appendItem(IDC_FAVORITE_HUBS, T_("&Favorite Hubs\tCtrl+F"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_FAVORITE_HUBS))); - view->appendItem(IDC_FAVUSERS, T_("Favorite &Users\tCtrl+U"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_FAVORITE_USERS))); - view->appendSeparatorItem(); - view->appendItem(IDC_QUEUE, T_("&Download Queue\tCtrl+D"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_DL_QUEUE))); - view->appendItem(IDC_FINISHED_DL, T_("Finished Downloads"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_FINISHED_DL))); - view->appendItem(IDC_WAITING_USERS, T_("Waiting Users"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_WAITING_USERS))); - view->appendItem(IDC_FINISHED_UL, T_("Finished Uploads"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_FINISHED_UL))); - view->appendSeparatorItem(); - view->appendItem(IDC_SEARCH, T_("&Search\tCtrl+S"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_SEARCH))); - view->appendItem(IDC_ADL_SEARCH, T_("ADL Search"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_ADL_SEARCH))); - view->appendItem(IDC_SEARCH_SPY, T_("Search Spy"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_SEARCH_SPY))); - view->appendSeparatorItem(); - view->appendItem(IDC_NOTEPAD, T_("&Notepad\tCtrl+N"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_NOTEPAD))); - view->appendItem(IDC_SYSTEM_LOG, T_("System Log"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1)); - view->appendItem(IDC_NET_STATS, T_("Network Statistics"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_NETWORK_STATS))); - view->appendItem(IDC_HASH_PROGRESS, T_("Indexing progress"), std::tr1::bind(&MainWindow::handleHashProgress, this)); - - WidgetMenuExtendedPtr window = mainMenu->appendPopup(T_("&Window")); - window->setColorInfo(menuColorInfo); + view->appendItem(IDC_PUBLIC_HUBS, T_("&Public Hubs\tCtrl+P"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_PUBLIC_HUBS))); + view->appendItem(IDC_FAVORITE_HUBS, T_("&Favorite Hubs\tCtrl+F"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_FAVORITE_HUBS))); + view->appendItem(IDC_FAVUSERS, T_("Favorite &Users\tCtrl+U"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_FAVORITE_USERS))); + view->appendSeparatorItem(); + view->appendItem(IDC_QUEUE, T_("&Download Queue\tCtrl+D"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_DL_QUEUE))); + view->appendItem(IDC_FINISHED_DL, T_("Finished Downloads"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_FINISHED_DL))); + view->appendItem(IDC_WAITING_USERS, T_("Waiting Users"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_WAITING_USERS))); + view->appendItem(IDC_FINISHED_UL, T_("Finished Uploads"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_FINISHED_UL))); + view->appendSeparatorItem(); + view->appendItem(IDC_SEARCH, T_("&Search\tCtrl+S"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_SEARCH))); + view->appendItem(IDC_ADL_SEARCH, T_("ADL Search"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_ADL_SEARCH))); + view->appendItem(IDC_SEARCH_SPY, T_("Search Spy"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_SEARCH_SPY))); + view->appendSeparatorItem(); + view->appendItem(IDC_NOTEPAD, T_("&Notepad\tCtrl+N"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_NOTEPAD))); + view->appendItem(IDC_SYSTEM_LOG, T_("System Log"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1)); + view->appendItem(IDC_NET_STATS, T_("Network Statistics"), std::tr1::bind(&MainWindow::handleOpenWindow, this, _1), SmartWin::BitmapPtr(new SmartWin::Bitmap(IDB_NETWORK_STATS))); + view->appendItem(IDC_HASH_PROGRESS, T_("Indexing progress"), std::tr1::bind(&MainWindow::handleHashProgress, this)); + } - window->appendItem(IDC_CLOSE_ALL_DISCONNECTED, T_("Close disconnected"), std::tr1::bind(&MainWindow::handleCloseWindows, this, _1)); - window->appendItem(IDC_CLOSE_ALL_PM, T_("Close all PM windows"), std::tr1::bind(&MainWindow::handleCloseWindows, this, _1)); - window->appendItem(IDC_CLOSE_ALL_OFFLINE_PM, T_("Close all offline PM windows"), std::tr1::bind(&MainWindow::handleCloseWindows, this, _1)); - window->appendItem(IDC_CLOSE_ALL_DIR_LIST, T_("Close all file list windows"), std::tr1::bind(&MainWindow::handleCloseWindows, this, _1)); - window->appendItem(IDC_CLOSE_ALL_SEARCH_FRAME, T_("Close all search windows"), std::tr1::bind(&MainWindow::handleCloseWindows, this, _1)); + { + WidgetMenuExtendedPtr window = mainMenu->appendPopup(T_("&Window")); - WidgetMenuExtendedPtr help = mainMenu->appendPopup(T_("&Help")); - help->setColorInfo(menuColorInfo); + window->appendItem(IDC_CLOSE_ALL_DISCONNECTED, T_("Close disconnected"), std::tr1::bind(&MainWindow::handleCloseWindows, this, _1)); + window->appendItem(IDC_CLOSE_ALL_PM, T_("Close all PM windows"), std::tr1::bind(&MainWindow::handleCloseWindows, this, _1)); + window->appendItem(IDC_CLOSE_ALL_OFFLINE_PM, T_("Close all offline PM windows"), std::tr1::bind(&MainWindow::handleCloseWindows, this, _1)); + window->appendItem(IDC_CLOSE_ALL_DIR_LIST, T_("Close all file list windows"), std::tr1::bind(&MainWindow::handleCloseWindows, this, _1)); + window->appendItem(IDC_CLOSE_ALL_SEARCH_FRAME, T_("Close all search windows"), std::tr1::bind(&MainWindow::handleCloseWindows, this, _1)); + } - help->appendItem(IDC_HELP_CONTENTS, T_("Help &Contents\tF1"), std::tr1::bind(&MainWindow::handleMenuHelp, this, _1)); - help->appendSeparatorItem(); - help->appendItem(IDC_HELP_CHANGELOG, T_("Change Log"), std::tr1::bind(&MainWindow::handleMenuHelp, this, _1)); - help->appendItem(IDC_ABOUT, T_("About DC++..."), std::tr1::bind(&MainWindow::handleAbout, this)); - help->appendSeparatorItem(); - help->appendItem(IDC_HELP_HOMEPAGE, T_("DC++ Homepage"), std::tr1::bind(&MainWindow::handleLink, this, _1)); - help->appendItem(IDC_HELP_DOWNLOADS, T_("Downloads"), std::tr1::bind(&MainWindow::handleLink, this, _1)); - help->appendItem(IDC_HELP_GEOIPFILE, T_("GeoIP database update"), std::tr1::bind(&MainWindow::handleLink, this, _1)); - help->appendItem(IDC_HELP_TRANSLATIONS, T_("Translations"), std::tr1::bind(&MainWindow::handleLink, this, _1)); - help->appendItem(IDC_HELP_FAQ, T_("Frequently asked questions"), std::tr1::bind(&MainWindow::handleLink, this, _1)); - help->appendItem(IDC_HELP_FORUM, T_("Help forum"), std::tr1::bind(&MainWindow::handleLink, this, _1)); - help->appendItem(IDC_HELP_DISCUSS, T_("DC++ discussion forum"), std::tr1::bind(&MainWindow::handleLink, this, _1)); - help->appendItem(IDC_HELP_REQUEST_FEATURE, T_("Request a feature"), std::tr1::bind(&MainWindow::handleLink, this, _1)); - help->appendItem(IDC_HELP_REPORT_BUG, T_("Report a bug"), std::tr1::bind(&MainWindow::handleLink, this, _1)); - help->appendItem(IDC_HELP_DONATE, T_("Donate (paypal)"), std::tr1::bind(&MainWindow::handleLink, this, _1)); + { + WidgetMenuExtendedPtr help = mainMenu->appendPopup(T_("&Help")); + help->appendItem(IDC_HELP_CONTENTS, T_("Help &Contents\tF1"), std::tr1::bind(&MainWindow::handleMenuHelp, this, _1)); + help->appendSeparatorItem(); + help->appendItem(IDC_HELP_CHANGELOG, T_("Change Log"), std::tr1::bind(&MainWindow::handleMenuHelp, this, _1)); + help->appendItem(IDC_ABOUT, T_("About DC++..."), std::tr1::bind(&MainWindow::handleAbout, this)); + help->appendSeparatorItem(); + help->appendItem(IDC_HELP_HOMEPAGE, T_("DC++ Homepage"), std::tr1::bind(&MainWindow::handleLink, this, _1)); + help->appendItem(IDC_HELP_DOWNLOADS, T_("Downloads"), std::tr1::bind(&MainWindow::handleLink, this, _1)); + help->appendItem(IDC_HELP_GEOIPFILE, T_("GeoIP database update"), std::tr1::bind(&MainWindow::handleLink, this, _1)); + help->appendItem(IDC_HELP_TRANSLATIONS, T_("Translations"), std::tr1::bind(&MainWindow::handleLink, this, _1)); + help->appendItem(IDC_HELP_FAQ, T_("Frequently asked questions"), std::tr1::bind(&MainWindow::handleLink, this, _1)); + help->appendItem(IDC_HELP_FORUM, T_("Help forum"), std::tr1::bind(&MainWindow::handleLink, this, _1)); + help->appendItem(IDC_HELP_DISCUSS, T_("DC++ discussion forum"), std::tr1::bind(&MainWindow::handleLink, this, _1)); + help->appendItem(IDC_HELP_REQUEST_FEATURE, T_("Request a feature"), std::tr1::bind(&MainWindow::handleLink, this, _1)); + help->appendItem(IDC_HELP_REPORT_BUG, T_("Report a bug"), std::tr1::bind(&MainWindow::handleLink, this, _1)); + help->appendItem(IDC_HELP_DONATE, T_("Donate (paypal)"), std::tr1::bind(&MainWindow::handleLink, this, _1)); + } + mainMenu->attach(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |