mIRC Home    About    Download    Register    News    Help

Print Thread
Changing the font size of the treebar items #164414 12/11/06 12:00 AM
Joined: Dec 2002
Posts: 580
N
NaquadaServ Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
I have written a DLL that sets the Treebar font and font size. Only problem is that icons don't center in it's available height when the font size is larger than default.



It would also be nice if the icons could be scaled in size, I have no idea if that is possible either. grin

I'm not very comfortable with using WM_PAINT. With that in mind, can anyone offer any suggestions that could fix these problems? You can download my source here if you want to.


NaquadaBomb
www.mirc-dll.com
Re: Changing the font size of the treebar items #164415 15/11/06 12:06 PM
Joined: Jan 2003
Posts: 249
C
ClickHeRe Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Jan 2003
Posts: 249
Just override the NM_CUSTOMDRAW handler for the parts you want to modify. This message is sent multiple times for each stage of the drawing process of the control and each item. Intercept what you want to draw yourself and let the control draw the rest itself.

You can thus draw bigger icons, center them vertically, etc.

Re: Changing the font size of the treebar items #164416 16/11/06 04:41 AM
Joined: Dec 2002
Posts: 580
N
NaquadaServ Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
I tried that, yet Khaled code is drawn as well (slightly offset horizontally), I think because he is modifying the treeview control's WM_PAINT message directly, instead of using custom draw. I've test my custom drawing code with an unaltered treeview control and it works great.


NaquadaBomb
www.mirc-dll.com
Re: Changing the font size of the treebar items [Re: NaquadaServ] #183352 19/08/07 09:22 AM
Joined: Nov 2006
Posts: 3
M
me0w Offline
Self-satisified door
Offline
Self-satisified door
M
Joined: Nov 2006
Posts: 3
Hey NaquadaServ, do you have any intentions updating this to the new mIRC? I would like to use it as treebar fonts are still not skinned properly. Thanks!

Re: Changing the font size of the treebar items [Re: NaquadaServ] #184192 26/08/07 02:12 PM
Joined: Sep 2003
Posts: 30
O
Ook Offline
Ameglian cow
Offline
Ameglian cow
O
Joined: Sep 2003
Posts: 30
Originally Posted By: NaquadaServ
I tried that, yet Khaled code is drawn as well (slightly offset horizontally), I think because he is modifying the treeview control's WM_PAINT message directly, instead of using custom draw. I've test my custom drawing code with an unaltered treeview control and it works great.


I've managed to take over the drawing of treebar items from mIRC by subclassing the mIRC_Treebar window & the child treeview control.
Then having the NM_CUSTOMDRAW notification sent to the treeviews parent (mIRC_TreeBar) return CDRF_DODEFAULT & the WM_ERASEBKGND message sent to the treeview control itself return FALSE

The normal treeview commands then work fine for changing the controls appearance (icons, colours, etc...)

The problem i'm left with is how to tell which type of window a given item refers too when trying to decide which icon to draw as all items have icon zero set.