Refresh button
Moderator: Moderators
Refresh button
I'm pretty lazy so it would be great to have a button to refresh filelist etc.
Tell me exactly how to do that. All I know that I have to add an icon to toolbar. But hopefully you can tell me what else to do .
Oh, and I'm using Microsoft Visual Studio .NET 2003 and DC++ 0.403 source now...
So it would be something like "EasyDC++"
Tell me exactly how to do that. All I know that I have to add an icon to toolbar. But hopefully you can tell me what else to do .
Oh, and I'm using Microsoft Visual Studio .NET 2003 and DC++ 0.403 source now...
So it would be something like "EasyDC++"
-
- Forum Moderator
- Posts: 1420
- Joined: 2003-04-22 14:37
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
Re: Refresh button
Toolbar modifications were one of the first bits I did to DC++. It's not easy, but if you try to figure it out, you should be able to.Makemies wrote:I'm pretty lazy so it would be great to have a button to refresh filelist etc.
Tell me exactly how to do that.
Coming back with specific questions, instead of asking us to learn for you, will garner you much friendlier help.
I downloaded some other clients source codes from internet that have some extra buttons. Then i tried to copy code from those and this is what i did:
Well, first I added the icon to toolbar .bmp files.
Then I added text TOOLBAR_REFRESH, // "Refresh filelist" to StringDefs.h.
Then i added this to the MainFrm.cpp:
What next? Did I do everything wrong?
EDIT: I did something else and now i get these errors:
Well, first I added the icon to toolbar .bmp files.
Then I added text TOOLBAR_REFRESH, // "Refresh filelist" to StringDefs.h.
Then i added this to the MainFrm.cpp:
Code: Select all
if(ShareManager::getInstance()->refresh() && !anyMF->ctrlToolbar.IsButtonChecked(IDC_TOOLBAR_REFRESH)) {
anyMF->ctrlToolbar.CheckButton(IDC_TOOLBAR_REFRESH,true);
What next? Did I do everything wrong?
EDIT: I did something else and now i get these errors:
Code: Select all
fatal error C1075: end of file found before the left brace '{' at 'windows\MainFrm.cpp(512)' was matched
fatal error C1004: unexpected end of file found
error C2601: 'MainFrame::updateTray' : local function definitions are illegal
error C2601: 'MainFrame::updateShutdown' : local function definitions are illegal
error C2601: 'MainFrame::UpdateLayout' : local function definitions are illegal
error C2601: 'MainFrame::setNormalTrayIcon' : local function definitions are illegal
error C2601: 'MainFrame::OnViewTransferView' : local function definitions are illegal
error C2601: 'MainFrame::OnViewToolBar' : local function definitions are illegal
error C2601: 'MainFrame::OnViewStatusBar' : local function definitions are illegal
error C2601: 'MainFrame::onUploadQueue' : local function definitions are illegal
error C2601: 'MainFrame::onTrayIcon' : local function definitions are illegal
error C2601: 'MainFrame::onToolbarAway' : local function definitions are illegal
error C2601: 'MainFrame::onSize' : local function definitions are illegal
error C2601: 'MainFrame::onServerSocket' : local function definitions are illegal
error C2601: 'MainFrame::onRefreshFileList' : local function definitions are illegal
error C2601: 'MainFrame::onRecents' : local function definitions are illegal
error C2601: 'MainFrame::onOpenFileList' : local function definitions are illegal
error C2601: 'MainFrame::onLink' : local function definitions are illegal
error C2601: 'MainFrame::onImport' : local function definitions are illegal
error C2601: 'MainFrame::onGetToolTip' : local function definitions are illegal
error C2601: 'MainFrame::onFinishedUploads' : local function definitions are illegal
error C2601: 'MainFrame::onFinished' : local function definitions are illegal
error C2601: 'MainFrame::onEndSession' : local function definitions are illegal
error C2601: 'MainFrame::onCloseDisconnected' : local function definitions are illegal
error C2601: 'MainFrame::OnClose' : local function definitions are illegal
error C2601: 'MainFrame::onAppCommand' : local function definitions are illegal
error C2601: 'MainFrame::onActivateApp' : local function definitions are illegal
error C2601: 'MainFrame::on' : local function definitions are illegal
error C2601: 'MainFrame::on' : local function definitions are illegal
error C2601: 'MainFrame::on' : local function definitions are illegal
error C2601: 'MainFrame::on' : local function definitions are illegal
error C2601: 'MainFrame::autoConnect' : local function definitions are illegal
error C2447: '{' : missing function header (old-style formal list?)
error C2296: '&&' : illegal, left operand has type 'void'
error C2180: controlling expression has type 'void'
error C2143: syntax error : missing ';' before '{'
error C2059: syntax error : 'if'
error C2059: syntax error : 'else'
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
What you did wrong is you failed to read the error message.Makemies wrote:What next? Did I do everything wrong?
EDIT: I did something else and now i get these errors:Code: Select all
fatal error C1075: end of file found before the left brace '{' at 'windows\MainFrm.cpp(512)' was matched fatal error C1004: unexpected end of file found
The code snippet has no closing brace.
Also, you never added a COMMAND_ID_HANDLER to the MainFrm message map (unnecessary if you're reusing the refresh command's ID), and you never added the ID to the toolbar. If you do a simple search for "toolbar", in MainFrm, you (almost) cannot miss it.
I give up this refresh button thing, but i still have one question... My english isn't very good so this will be hard to explain, but i'll give it a try: When i open my DC++, userlist is ordered by nickname (OP:s first, then other users in alphabetical order), but i like it when its ordered by share... So is there some point in source where i can change the default order thing? If someone knows, please tell me, because this is important... I have about 50 hubs in favorites and its not fun to change the user order every time i boot DC++ I hope you understand what i'm saying
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
HubFrame.cpp
Code: Select all
ctrlUsers.setSortColumn(COLUMN_NICK);
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us