From: <arn...@us...> - 2008-03-26 14:13:09
|
Revision: 1063 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1063&view=rev Author: arnetheduck Date: 2008-03-26 07:13:06 -0700 (Wed, 26 Mar 2008) Log Message: ----------- cshelp in favorite hubs; don't require the control id for tooltips Modified Paths: -------------- dcplusplus/trunk/help/cshelp.h dcplusplus/trunk/help/cshelp.txt dcplusplus/trunk/help/resource.h dcplusplus/trunk/help/window_favorite_hubs.html dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectHelp.h dcplusplus/trunk/win32/ADLSearchFrame.cpp dcplusplus/trunk/win32/CommandDlg.cpp dcplusplus/trunk/win32/FavHubsFrame.cpp dcplusplus/trunk/win32/MainWindow.cpp dcplusplus/trunk/win32/SettingsDialog.cpp dcplusplus/trunk/win32/SettingsDialog.h dcplusplus/trunk/win32/WinUtil.cpp dcplusplus/trunk/win32/WinUtil.h dcplusplus/trunk/win32/resource.h dcplusplus/trunk/win32/stdafx.h Property Changed: ---------------- dcplusplus/trunk/ Property changes on: dcplusplus/trunk ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-03-25 11:06:59.213000059 +0100 committer: Jacek Sieka <arn...@gm...> properties: branch-nick: dcplusplus + timestamp: 2008-03-25 18:52:16.157999992 +0100 committer: zouzou123gen properties: branch-nick: bzr Name: bzr:file-ids - smartwin/include/smartwin/Events.h events.h-20080325100557-k77vniqlbeo19c72-1 smartwin/source/Events.cpp events.cpp-20080325100557-k77vniqlbeo19c72-2 + Name: bzr:revision-id:v3-trunk1 - 1027 arn...@gm...-20080323183926-schknwnkgeo7ivdn 1028 zouzou123gen-20080323220411-r8usuc3qxwuh7zsn 1029 zouzou123gen-20080323221249-0su72zaj13e706mk 1030 arn...@gm...-20080324140623-muba1dl46m000o8c 1031 zouzou123gen-20080324141933-qbgr93ugpe0297m6 1032 arn...@gm...-20080324153706-siidja05n84i00b1 1033 arn...@gm...-20080324153823-lhn3awurnu77riln 1034 arn...@gm...-20080324165650-zapppziji67yf5a2 1035 zouzou123gen-20080324175936-4mqc2kh0lo5wtdu2 1036 zouzou123gen-20080325004602-6wdsoym95mjuhwd3 1037 arn...@gm...-20080325100659-8fqy6q65itmghlep + 1027 arn...@gm...-20080323183926-schknwnkgeo7ivdn 1028 zouzou123gen-20080323220411-r8usuc3qxwuh7zsn 1029 zouzou123gen-20080323221249-0su72zaj13e706mk 1030 arn...@gm...-20080324140623-muba1dl46m000o8c 1031 zouzou123gen-20080324141933-qbgr93ugpe0297m6 1032 arn...@gm...-20080324153706-siidja05n84i00b1 1033 arn...@gm...-20080324153823-lhn3awurnu77riln 1034 arn...@gm...-20080324165650-zapppziji67yf5a2 1035 zouzou123gen-20080324175936-4mqc2kh0lo5wtdu2 1036 zouzou123gen-20080325004602-6wdsoym95mjuhwd3 1037 arn...@gm...-20080325100659-8fqy6q65itmghlep 1038 zouzou123gen-20080325175216-s297sdiucukfvijh Modified: dcplusplus/trunk/help/cshelp.h =================================================================== --- dcplusplus/trunk/help/cshelp.h 2008-03-26 14:11:12 UTC (rev 1062) +++ dcplusplus/trunk/help/cshelp.h 2008-03-26 14:13:06 UTC (rev 1063) @@ -105,5 +105,11 @@ #define IDH_USER_COMMAND_HUB 11099 #define IDH_USER_COMMAND_NICK 11100 #define IDH_USER_COMMAND_ONCE 11101 +#define IDH_FAVORITE_HUBS_CONNECT 11102 +#define IDH_FAVORITE_HUBS_ADD 11103 +#define IDH_FAVORITE_HUBS_PROPERTIES 11104 +#define IDH_FAVORITE_HUBS_MOVE_UP 11105 +#define IDH_FAVORITE_HUBS_MOVE_DOWN 11106 +#define IDH_FAVORITE_HUBS_REMOVE 11107 #endif Modified: dcplusplus/trunk/help/cshelp.txt =================================================================== --- dcplusplus/trunk/help/cshelp.txt 2008-03-26 14:11:12 UTC (rev 1062) +++ dcplusplus/trunk/help/cshelp.txt 2008-03-26 14:13:06 UTC (rev 1063) @@ -202,3 +202,15 @@ Private Message recipient .topic IDH_USER_COMMAND_ONCE Send only once per user from search frame, regardless of how many files you've selected from that user +.topic IDH_FAVORITE_HUBS_CONNECT +Connect to selected hubs. +.topic IDH_FAVORITE_HUBS_ADD +Create a new favorite hub. +.topic IDH_FAVORITE_HUBS_PROPERTIES +Change pre-existing hub properties for the selected hub. +.topic IDH_FAVORITE_HUBS_MOVE_UP +Move up selected hubs in the list. If several hubs have auto connect enabled, the highest hub will be connected to first. +.topic IDH_FAVORITE_HUBS_MOVE_DOWN +Move down selected hubs in the list. If several hubs have auto connect enabled, the lowest hub will be connected to last. +.topic IDH_FAVORITE_HUBS_REMOVE +Removes selected hubs from the favorite hubs list. Modified: dcplusplus/trunk/help/resource.h =================================================================== --- dcplusplus/trunk/help/resource.h 2008-03-26 14:11:12 UTC (rev 1062) +++ dcplusplus/trunk/help/resource.h 2008-03-26 14:13:06 UTC (rev 1063) @@ -5,8 +5,6 @@ #include "cshelp.h" -#define IDH_TOPICS_BEGIN 10000 - #define IDH_STARTPAGE 10000 #define IDH_CHANGELOG 10001 #define IDH_KEYBOARD 10002 @@ -50,6 +48,8 @@ #define IDH_CERTIFICATESPAGE 10313 #define IDH_TABSPAGE 10314 -#define IDH_TOPICS_END 10999 +// reserved for cshelp ids +#define IDH_CSHELP_BEGIN 11000 +#define IDH_CSHELP_END 11999 #endif Modified: dcplusplus/trunk/help/window_favorite_hubs.html =================================================================== --- dcplusplus/trunk/help/window_favorite_hubs.html 2008-03-26 14:11:12 UTC (rev 1062) +++ dcplusplus/trunk/help/window_favorite_hubs.html 2008-03-26 14:13:06 UTC (rev 1063) @@ -25,7 +25,7 @@ <h2>Buttons</h2> <dl style="margin-left: 40px;"> <dt>Connect</dt> - <dd>Connects to selected hubs.<dd> + <dd>Connect to selected hubs.<dd> <dt>New</dt> <dd>Create a new favorite hub.</dd> <dt>Properties</dt> Modified: dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectHelp.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectHelp.h 2008-03-26 14:11:12 UTC (rev 1062) +++ dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectHelp.h 2008-03-26 14:13:06 UTC (rev 1063) @@ -8,7 +8,7 @@ template<typename WidgetType> class AspectHelp { struct Dispatcher { - typedef std::tr1::function<void (unsigned, HWND, unsigned)> F; + typedef std::tr1::function<void (HWND, unsigned)> F; Dispatcher(const F& f_) : f(f_) { } @@ -16,7 +16,7 @@ LPHELPINFO lphi = reinterpret_cast<LPHELPINFO>(msg.lParam); if(lphi->iContextType != HELPINFO_WINDOW) return false; - f(lphi->iCtrlId, reinterpret_cast<HWND>(lphi->hItemHandle), lphi->dwContextId); + f(reinterpret_cast<HWND>(lphi->hItemHandle), lphi->dwContextId); ret = TRUE; return true; } Modified: dcplusplus/trunk/win32/ADLSearchFrame.cpp =================================================================== --- dcplusplus/trunk/win32/ADLSearchFrame.cpp 2008-03-26 14:11:12 UTC (rev 1062) +++ dcplusplus/trunk/win32/ADLSearchFrame.cpp 2008-03-26 14:13:06 UTC (rev 1063) @@ -92,7 +92,7 @@ cs.caption = T_("&Help"); help = createButton(cs); - help->onClicked(std::tr1::bind(&WinUtil::help, 0, handle(), IDH_ADL_SEARCH)); + help->onClicked(std::tr1::bind(&WinUtil::help, handle(), IDH_ADL_SEARCH)); addWidget(help); } Modified: dcplusplus/trunk/win32/CommandDlg.cpp =================================================================== --- dcplusplus/trunk/win32/CommandDlg.cpp 2008-03-26 14:11:12 UTC (rev 1062) +++ dcplusplus/trunk/win32/CommandDlg.cpp 2008-03-26 14:13:06 UTC (rev 1063) @@ -77,7 +77,7 @@ { onInitDialog(std::tr1::bind(&CommandDlg::handleInitDialog, this)); onFocus(std::tr1::bind(&CommandDlg::handleFocus, this)); - onHelp(std::tr1::bind(&WinUtil::help, _1, _2, _3)); + onHelp(std::tr1::bind(&WinUtil::help, _1, _2)); } CommandDlg::~CommandDlg() { @@ -158,12 +158,12 @@ button = attachButton(IDHELP); button->setText(T_("Help")); - button->onClicked(std::tr1::bind(&WinUtil::help, 0, handle(), IDH_USER_COMMAND)); + button->onClicked(std::tr1::bind(&WinUtil::help, handle(), IDH_USER_COMMAND)); } if(bOpenHelp) { // launch the help file, instead of having the help in the dialog - WinUtil::help(0, handle(), IDH_USER_COMMAND); + WinUtil::help(handle(), IDH_USER_COMMAND); } if(type == UserCommand::TYPE_SEPARATOR) { Modified: dcplusplus/trunk/win32/FavHubsFrame.cpp =================================================================== --- dcplusplus/trunk/win32/FavHubsFrame.cpp 2008-03-26 14:11:12 UTC (rev 1062) +++ dcplusplus/trunk/win32/FavHubsFrame.cpp 2008-03-26 14:13:06 UTC (rev 1063) @@ -71,31 +71,37 @@ cs.caption = T_("&Connect"); connect = createButton(cs); + connect->setHelpId(IDH_FAVORITE_HUBS_CONNECT); connect->onClicked(std::tr1::bind(&FavHubsFrame::openSelected, this)); addWidget(connect); cs.caption = T_("&New..."); add = createButton(cs); + add->setHelpId(IDH_FAVORITE_HUBS_ADD); add->onClicked(std::tr1::bind(&FavHubsFrame::handleAdd, this)); addWidget(add); cs.caption = T_("&Properties"); properties = createButton(cs); + properties->setHelpId(IDH_FAVORITE_HUBS_PROPERTIES); properties->onClicked(std::tr1::bind(&FavHubsFrame::handleProperties, this)); addWidget(properties); cs.caption = T_("Move &Up"); up = createButton(cs); + up->setHelpId(IDH_FAVORITE_HUBS_MOVE_UP); up->onClicked(std::tr1::bind(&FavHubsFrame::handleUp, this)); addWidget(up); cs.caption = T_("Move &Down"); down = createButton(cs); + down->setHelpId(IDH_FAVORITE_HUBS_MOVE_DOWN); down->onClicked(std::tr1::bind(&FavHubsFrame::handleDown, this)); addWidget(down); cs.caption = T_("&Remove"); remove = createButton(cs); + remove->setHelpId(IDH_FAVORITE_HUBS_REMOVE); remove->onClicked(std::tr1::bind(&FavHubsFrame::handleRemove, this)); addWidget(remove); } Modified: dcplusplus/trunk/win32/MainWindow.cpp =================================================================== --- dcplusplus/trunk/win32/MainWindow.cpp 2008-03-26 14:11:12 UTC (rev 1062) +++ dcplusplus/trunk/win32/MainWindow.cpp 2008-03-26 14:13:06 UTC (rev 1063) @@ -87,7 +87,7 @@ onActivate(std::tr1::bind(&MainWindow::handleActivate, this, _1)); onSized(std::tr1::bind(&MainWindow::handleSized, this, _1)); onSpeaker(std::tr1::bind(&MainWindow::handleSpeaker, this, _1, _2)); - onHelp(std::tr1::bind(&WinUtil::help, _1, _2, _3)); + onHelp(std::tr1::bind(&WinUtil::help, _1, _2)); onRaw(std::tr1::bind(&MainWindow::handleTrayIcon, this, _2), SmartWin::Message(WM_APP + 242)); updateStatus(); @@ -130,7 +130,7 @@ speak(PARSE_COMMAND_LINE); if(SETTING(NICK).empty()) { - WinUtil::help(0, handle(), IDH_GENERALPAGE); + WinUtil::help(handle(), IDH_GENERALPAGE); postMessage(WM_COMMAND, IDC_SETTINGS); } @@ -240,9 +240,9 @@ { WidgetMenuPtr help = mainMenu->appendPopup(T_("&Help")); - help->appendItem(IDH_STARTPAGE, T_("Help &Contents\tF1"), std::tr1::bind(&WinUtil::help, 0, handle(), _1)); + help->appendItem(IDH_STARTPAGE, T_("Help &Contents\tF1"), std::tr1::bind(&WinUtil::help, handle(), _1)); help->appendSeparatorItem(); - help->appendItem(IDH_CHANGELOG, T_("Change Log"), std::tr1::bind(&WinUtil::help, 0, handle(), _1)); + help->appendItem(IDH_CHANGELOG, T_("Change Log"), std::tr1::bind(&WinUtil::help, handle(), _1)); 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)); Modified: dcplusplus/trunk/win32/SettingsDialog.cpp =================================================================== --- dcplusplus/trunk/win32/SettingsDialog.cpp 2008-03-26 14:11:12 UTC (rev 1062) +++ dcplusplus/trunk/win32/SettingsDialog.cpp 2008-03-26 14:13:06 UTC (rev 1063) @@ -52,7 +52,7 @@ SettingsDialog::SettingsDialog(SmartWin::Widget* parent) : WidgetFactory<SmartWin::WidgetModalDialog>(parent), currentPage(0) { onInitDialog(std::tr1::bind(&SettingsDialog::initDialog, this)); - onHelp(std::tr1::bind(&SettingsDialog::handleHelp, this, _1, _2, _3)); + onHelp(std::tr1::bind(&SettingsDialog::handleHelp, this, _1, _2)); } int SettingsDialog::run() { @@ -84,7 +84,7 @@ button = attachButton(IDHELP); button->setText(T_("Help")); - button->onClicked(std::tr1::bind(&SettingsDialog::handleHelp, this, 0, handle(), IDH_STARTPAGE)); + button->onClicked(std::tr1::bind(&SettingsDialog::handleHelp, this, handle(), IDH_STARTPAGE)); } addPage(T_("Personal information"), new GeneralPage(this)); @@ -106,10 +106,10 @@ return false; } -void SettingsDialog::handleHelp(unsigned ctrlId, HWND hWnd, unsigned helpId) { - if(helpId == IDH_STARTPAGE && currentPage) - helpId = currentPage->getHelpId(); - WinUtil::help(ctrlId, hWnd, helpId); +void SettingsDialog::handleHelp(HWND hWnd, unsigned id) { + if(id == IDH_STARTPAGE && currentPage) + id = currentPage->getHelpId(); + WinUtil::help(hWnd, id); } void SettingsDialog::addPage(const tstring& title, PropPage* page) { Modified: dcplusplus/trunk/win32/SettingsDialog.h =================================================================== --- dcplusplus/trunk/win32/SettingsDialog.h 2008-03-26 14:11:12 UTC (rev 1062) +++ dcplusplus/trunk/win32/SettingsDialog.h 2008-03-26 14:13:06 UTC (rev 1063) @@ -42,7 +42,7 @@ void write(); bool initDialog(); - void handleHelp(unsigned ctrlId, HWND hWnd, unsigned helpId); + void handleHelp(HWND hWnd, unsigned id); void handleOKClicked(); void selectionChanged(); void showPage(PropPage* page); Modified: dcplusplus/trunk/win32/WinUtil.cpp =================================================================== --- dcplusplus/trunk/win32/WinUtil.cpp 2008-03-26 14:11:12 UTC (rev 1062) +++ dcplusplus/trunk/win32/WinUtil.cpp 2008-03-26 14:13:06 UTC (rev 1063) @@ -575,25 +575,33 @@ return true; } -void WinUtil::help(unsigned ctrlId, HWND hWnd, unsigned helpId) { - dcdebug("WinUtil::help; ctrlId: %u; hWnd: %p; helpId: %u\n", ctrlId, hWnd, helpId); +void WinUtil::help(HWND hWnd, unsigned id) { + dcdebug("WinUtil::help; hWnd: %p; id: %u\n", hWnd, id); string path = Util::getDataPath() + "DCPlusPlus.chm"; if(File::getSize(path) == -1) return; tstring helpFile = Text::toT(path); - if(helpId >= IDH_TOPICS_BEGIN && helpId <= IDH_TOPICS_END) - ctrlId = 0; - if(ctrlId && helpId) { - // a control ID has been given; display a toolTip - DWORD ids[3]; - ids[0] = ctrlId; - ids[1] = helpId; - ids[2] = 0; - ::HtmlHelp(hWnd, helpFile.c_str(), HH_TP_HELP_WM_HELP, reinterpret_cast<DWORD_PTR>(ids)); + if(id >= IDH_CSHELP_BEGIN && id <= IDH_CSHELP_END) { + // context-sensitive help; display a tooltip + HH_POPUP popup = { 0 }; + popup.cbStruct = sizeof(HH_POPUP); + popup.idString = id; + + RECT rect; + ::GetWindowRect(hWnd, &rect); + popup.pt.x = (rect.left + rect.right) / 2; + popup.pt.y = rect.top; + + popup.rcMargins.left = 5; + popup.rcMargins.top = 5; + popup.rcMargins.right = 5; + popup.rcMargins.bottom = 5; + + ::HtmlHelp(hWnd, helpFile.c_str(), HH_DISPLAY_TEXT_POPUP, reinterpret_cast<DWORD_PTR>(&popup)); } else - ::HtmlHelp(hWnd, helpFile.c_str(), helpId ? HH_HELP_CONTEXT : HH_DISPLAY_TOC, helpId); + ::HtmlHelp(hWnd, helpFile.c_str(), id ? HH_HELP_CONTEXT : HH_DISPLAY_TOC, id); } bool WinUtil::getVersionInfo(OSVERSIONINFOEX& ver) { Modified: dcplusplus/trunk/win32/WinUtil.h =================================================================== --- dcplusplus/trunk/win32/WinUtil.h 2008-03-26 14:11:12 UTC (rev 1062) +++ dcplusplus/trunk/win32/WinUtil.h 2008-03-26 14:13:06 UTC (rev 1063) @@ -169,7 +169,7 @@ static void parseADChubUrl(const tstring& /*aUrl*/); static void parseMagnetUri(const tstring& /*aUrl*/, bool aOverride = false); - static void help(unsigned ctrlId, HWND hWnd, unsigned helpId); + static void help(HWND hWnd, unsigned id); static bool getVersionInfo(OSVERSIONINFOEX& ver); Modified: dcplusplus/trunk/win32/resource.h =================================================================== --- dcplusplus/trunk/win32/resource.h 2008-03-26 14:11:12 UTC (rev 1062) +++ dcplusplus/trunk/win32/resource.h 2008-03-26 14:13:06 UTC (rev 1063) @@ -457,10 +457,10 @@ #define IDC_DOWNLOAD_WHOLE_TARGET 5000 #define IDC_USER_COMMAND 5200 #define ID_SHELLCONTEXTMENU_MIN 7000 -#define ID_SHELLCONTEXTMENU_MAX 8000 +#define ID_SHELLCONTEXTMENU_MAX 7999 // reserved for help ids #define IDH_BEGIN 10000 -#define IDH_END 12000 +#define IDH_END 11999 #endif Modified: dcplusplus/trunk/win32/stdafx.h =================================================================== --- dcplusplus/trunk/win32/stdafx.h 2008-03-26 14:11:12 UTC (rev 1062) +++ dcplusplus/trunk/win32/stdafx.h 2008-03-26 14:13:06 UTC (rev 1063) @@ -43,7 +43,6 @@ using namespace dcpp; using std::tr1::placeholders::_1; using std::tr1::placeholders::_2; -using std::tr1::placeholders::_3; #define LOCALEDIR dcpp::Util::getLocalePath().c_str() #define PACKAGE "dcpp-win32" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |