Color of processbar

Archived discussion about features (predating the use of Bugzilla as a bug and feature tracker)

Moderator: Moderators

Locked
Locutus
Posts: 21
Joined: 2003-01-05 15:25

Color of processbar

Post by Locutus » 2003-02-23 11:05

I would like to be able to specify colors for upload processindicator and download indicator aswell (like green for download and red for upload)
Web-Programmer - Application Developer

KLesK
Posts: 23
Joined: 2003-02-10 07:40
Location: sweden

Post by KLesK » 2003-02-23 13:58

temp. solution : run oDC ( it have this option ) 'til dc++ get it :)

Locutus
Posts: 21
Joined: 2003-01-05 15:25

Post by Locutus » 2003-02-23 14:17

I used oDC once.... didn't like it... hrumpf... DC++ ripoff :)
Web-Programmer - Application Developer

iK
Posts: 10
Joined: 2003-01-08 18:49
Contact:

Post by iK » 2003-02-23 15:02

actually, it gets the colors from your windows title bar color settings right now :/

Locutus
Posts: 21
Joined: 2003-01-05 15:25

Post by Locutus » 2003-02-23 15:06

That surely can be changed?
Web-Programmer - Application Developer

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2003-02-23 15:42

Locutus wrote:That surely can be changed?
Yes, someone could just take the code out of oDC++ and send it to Arne as a patch, and he might very well accept it.

Locutus
Posts: 21
Joined: 2003-01-05 15:25

Post by Locutus » 2003-02-23 15:46

HINT HINT
Web-Programmer - Application Developer

Phantom
Posts: 72
Joined: 2003-01-11 20:13
Location: New Zealand

Post by Phantom » 2003-02-23 16:01

I changed these colours before oDC released that version. My way is pratcially the same as his.

in mainfrm.cpp at about 1236:

if(cd->iSubItem == COLUMN_STATUS) {
ItemInfo* ii = (ItemInfo*)cd->nmcd.lItemlParam;
if(ii->status == ItemInfo::STATUS_RUNNING) {
// draw something nice...
char buf[256];
ctrlTransfers.GetItemText((int)cd->nmcd.dwItemSpec, COLUMN_STATUS, buf, 255);
buf[255] = 0;

ctrlTransfers.GetSubItemRect((int)cd->nmcd.dwItemSpec, COLUMN_STATUS, LVIR_BOUNDS, rc);
CRect rc2 = rc;
rc2.left += 6;
//::Rectangle(cd->nmcd.hdc, rc.left, rc.top, rc.right, rc.bottom);
//rc.DeflateRect(1, 1, 1, 1);
if(ii->size == 0)
ii->size = 1;
rc.right = rc.left + (int) (((int64_t)rc.Width()) * ii->pos / ii->size);
//ADDED {
HBRUSH hbrush = SETTING(PROGRESS_CUSTOM) ?
CreateSolidBrush((ii->type == ItemInfo::TYPE_UPLOAD) ?
SETTING(PROGRESS_COLOUR_UP) : SETTING(PROGRESS_COLOUR_DOWN)) : GetSysColorBrush(COLOR_HIGHLIGHT);
HGDIOBJ old = ::SelectObject(cd->nmcd.hdc, hbrush);
//ADDED }
::Rectangle(cd->nmcd.hdc, rc.left, rc.top,
rc.right, rc.bottom);
::SelectObject(cd->nmcd.hdc, old);
COLORREF oldcol = ::SetTextColor(cd->nmcd.hdc, cd->clrText);
::DrawText(cd->nmcd.hdc, buf, strlen(buf), rc2, DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
::SetTextColor(cd->nmcd.hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));
rc2.right = rc.right;
::DrawText(cd->nmcd.hdc, buf, strlen(buf), rc2, DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
::SelectObject(cd->nmcd.hdc, old);
::SetTextColor(cd->nmcd.hdc, oldcol);
//ADDED {
DeleteObject(hbrush);
//ADDED }



Then all you need to do is to make sure that you define PROGRESS_COLOUR_UP/DOWN in settingsmanager and put some control to change them.
I did it quickly with a / command, its pretty inefficient at the moment, but I don't really care. in hubframe.cpp :

} else if(Util::stricmp(s.c_str(), "upcolour") == 0) {
if (param.empty())
addClientLine("Error: usage /upcolour xxx,xxx,xxx where xxx,xxx,xxx = Red,Green,Blue 0-255");
else {
int red = 0;
int i = 0;
int j = 0;
while (param >= '0' && param <='9' && i < j + 3)
red = (red * 10) + (param[i++] - '0');
if (((red > 255) || (red < 0)) || param[i++] != ',')
addClientLine("Error: usage /upcolour xxx,xxx,xxx where xxx,xxx,xxx = Red,Green,Blue 0-255");
else {
j = i;
int green = 0;
while (param >= '0' && param <='9' && i < j + 3)
green = (green * 10) + (param[i++] - '0');
if (((green > 255) || (green < 0)) || param[i++] != ',')
addClientLine("Error: usage /upcolour xxx,xxx,xxx where xxx,xxx,xxx = Red,Green,Blue 0-255");
else {
j = i;
int blue = 0;
while (param >= '0' && param <='9' && i < j + 3)
blue = (blue * 10) + (param[i++] - '0');
if (((blue > 255) || (blue < 0)))
addClientLine("Error: usage /upcolour xxx,xxx,xxx where xxx,xxx,xxx = Red,Green,Blue 0-255");
else {
progressUpColour = RGB(red, green, blue);
SettingsManager::getInstance()->set(SettingsManager::PROGRESS_COLOUR_UP, (int)progressUpColour);
addClientLine("Upload progress bar colour changed");
}
}
}
}
} else if(Util::stricmp(s.c_str(), "downcolour") == 0) {
if (param.empty())
addClientLine("Error: usage /downcolour xxx,xxx,xxx where xxx,xxx,xxx = Red,Green,Blue 0-255");
else {
int red = 0;
int i = 0;
int j = 0;
while (param >= '0' && param <='9' && i < j + 3)
red = (red * 10) + (param[i++] - '0');
if (((red > 255) || (red < 0)) || param[i++] != ',')
addClientLine("Error: usage /downcolour xxx,xxx,xxx where xxx,xxx,xxx = Red,Green,Blue 0-255");
else {
j = i;
int green = 0;
while (param >= '0' && param <='9' && i < j + 3)
green = (green * 10) + (param[i++] - '0');
if (((green > 255) || (green < 0)) || param[i++] != ',')
addClientLine("Error: usage /downcolour xxx,xxx,xxx where xxx,xxx,xxx = Red,Green,Blue 0-255");
else {
j = i;
int blue = 0;
while (param[i] >= '0' && param[i] <='9' && i < j + 3)
blue = (blue * 10) + (param[i++] - '0');
if (((blue > 255) || (blue < 0)))
addClientLine("Error: usage /downcolour xxx,xxx,xxx where xxx,xxx,xxx = Red,Green,Blue 0-255");
else {
progressDownColour = RGB(red, green, blue);
SettingsManager::getInstance()->set(SettingsManager::PROGRESS_COLOUR_DOWN, (int)progressDownColour);
addClientLine("Download progress bar colour changed");
}
}
}
}

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2003-02-23 16:05

Phantom, try the [ CODE ] tags in future posts...

Phantom
Posts: 72
Joined: 2003-01-11 20:13
Location: New Zealand

Post by Phantom » 2003-02-23 16:38

hehe ok :)

NoFiX
Posts: 19
Joined: 2003-02-23 10:39

Post by NoFiX » 2003-02-25 08:57

He was too busy trying to show off shitty code, forgive him.

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2003-02-25 12:14

Phantom wrote:hehe ok :)
As a clarification, based on the above post, what I said was meant in a friendly spirit. Even though I have an avatar of someone with his mouth open (yelling?) doesn't mean that I was actually doing so. It's just a picture.

Opera
Programmer
Posts: 15
Joined: 2003-02-21 13:45

Post by Opera » 2003-02-27 16:17

Locutus, you are welcome to tell me what you don't like about my fork.

Phantom, or you can use oDC which has these settings in the Settings dialog...

Opera
Creator of the dc++ fork, oDC found at:
http://gempond.com/odc

Locutus
Posts: 21
Joined: 2003-01-05 15:25

Post by Locutus » 2003-02-27 16:44

I don't know, it was just a feeling I had when I used the program

Because while DC++ adds large features, you seem to add small improvements... so why not combine the two?

What do you do when a new DC++ is released? do you patch your own client?
Web-Programmer - Application Developer

Phantom
Posts: 72
Joined: 2003-01-11 20:13
Location: New Zealand

Post by Phantom » 2003-02-27 20:40

Opera, yeah your client is nice. Only thing is the /me bug, which i'm sure you are aware of. I'm not so good with GUI stuff, so I make everything command line style. Thats until I make enough features worthy of a GUI settings page.

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2003-02-28 12:24

Phantom wrote:I'm not so good with GUI stuff, so I make everything command line style. Thats until I make enough features worthy of a GUI settings page.
It's really... cake. Just use the resource editor to add some edit boxes, change the ID on them, then add them to the list that PropPage uses to pull/save SettingManager settings with. If you really have a hard time with it, just look at the source to mods that have added their own page... Arne seems to have laid a nice good foundation here, quite easy to add on to.

Opera
Programmer
Posts: 15
Joined: 2003-02-21 13:45

Post by Opera » 2003-03-01 19:31

Phantom wrote:Opera, yeah your client is nice. Only thing is the /me bug, which i'm sure you are aware of. I'm not so good with GUI stuff, so I make everything command line style. Thats until I make enough features worthy of a GUI settings page.
No I don't know about that, but this is not the right forum to talk about that =)

Btw, I don't think my features are That small, even though it's absurd comparing me to arne (yet atleast;), since in my "mod" he still owns 90% of the code..
So, without arne, no dc++, no oDC. without me, dc++, but no oDC... that's kinda it =)
I would never complain about his efforts, ever.

Opera
Creator of the dc++ fork, oDC found at:
http://gempond.com/odc

Locutus
Posts: 21
Joined: 2003-01-05 15:25

Post by Locutus » 2003-03-01 21:23

I tried your client, Opera, that sucky sucky way of downloading whole directories is in your client... so I changed back to DC++
Web-Programmer - Application Developer

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2003-03-03 11:57

Locutus wrote:I tried your client, Opera, that sucky sucky way of downloading whole directories is in your client... so I changed back to DC++
Are you sure it wasn't the same behavior that was in 0.231 or 0.232? Arne did change the directory downloading method, then switched it back after unpopularity. Opera should only be blamed for bugs in her (his?) client...

Locutus
Posts: 21
Joined: 2003-01-05 15:25

Post by Locutus » 2003-03-03 12:03

Thats what I am saying?

It seems his client is based on the version of DC++ where the method of downloading a whole directory was... bugged/bad

Which is why I won't use his client, since I hate this behavior

So.... that's what I am saying!
Web-Programmer - Application Developer

Locked