I have been able to add the button to the window but the stumbling point comes in getting it to actually do anything.
The relevant portions of code I have added are given below:
Code: Select all
Index: windows/HubFrame.h
===================================================================
RCS file: /cvsroot/dcplusplus/dcplusplus/windows/HubFrame.h,v
retrieving revision 1.45
diff -u -r1.45 HubFrame.h
--- windows/HubFrame.h 30 Apr 2004 07:14:56 -0000 1.45
+++ windows/HubFrame.h 14 May 2004 23:14:56 -0000
@@ -71,6 +73,7 @@
COMMAND_ID_HANDLER(IDC_ADD_AS_FAVORITE, onAddAsFavorite)
COMMAND_ID_HANDLER(IDC_COPY_NICK, onCopyNick)
COMMAND_ID_HANDLER(IDC_CLOSE_WINDOW, onCloseWindow)
+ COMMAND_ID_HANDLER(IDC_CLEAR, onClear)
CHAIN_COMMANDS(ucBase)
CHAIN_COMMANDS(uibBase)
CHAIN_MSG_MAP(baseClass)
@@ -100,6 +103,7 @@
LRESULT onTabContextMenu(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
LRESULT onChar(UINT uMsg, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled);
LRESULT onShowUsers(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled);
+ LRESULT onClear(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT onFollow(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT onLButton(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
LRESULT onEnterUsers(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/);
I have not included any code that related to the GUI. IDC_CLEAR exists. I have absolutely no idea what the parameters in the method signature mean, but I copied them from the buttons in the Download Queue window (Find, etc).
Code: Select all
Index: windows/HubFrame.cpp
===================================================================
RCS file: /cvsroot/dcplusplus/dcplusplus/windows/HubFrame.cpp,v
retrieving revision 1.61
diff -u -r1.61 HubFrame.cpp
--- windows/HubFrame.cpp 3 May 2004 12:38:05 -0000 1.61
+++ windows/HubFrame.cpp 14 May 2004 23:14:56 -0000
@@ -314,6 +318,11 @@
return 0;
}
+LRESULT HubFrame::onClear(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
+ ctrlClient.SetWindowText("");
+ return 0;
+}
+
bool HubFrame::updateUser(const User::Ptr& u) {
int i = findUser(u);
Can anyone point out the simple mistake I am making?
If you need any more details, such as the GUI code and so on, let me know.
Cheers
EDIT: Hmm. Interesting offtopic thing I noticed. In the post preview page, the post is allowed to be as wide as necessary, so the code doesn't span multiple lines and is therefore legible. In the final post though, the post is restricted to a fixed width, making te code a bitch to read.