Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Get volume name of shares ... (Try to get a shares volume name)
Re: Get volume name of shares ... [message #56210 is a reply to message #56207] Mon, 08 February 2021 23:18 Go to previous messageGo to previous message
dschoni is currently offline  dschoni
Messages: 15
Registered: January 2021
Location: Switzerland
Promising Member
I'm using a tree and some modifications on the library files:
----------------------------------------------------------------------------------------
used mods
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
FileSel.h: adding
----------------------------------------------------------------------------------------
Image GetDirIcon(const String& s);
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
CtrlLib.h:
----------------------------------------------------------------------------------------
#define NEWSTYLE
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
TreeCtrl.cpp:1023
----------------------------------------------------------------------------------------
            if(yh >= 0 && yl < sz.cy) {
				int x = levelcx + levelcx * l.level + levelcx2 - org.x;
#ifdef NEWSTYLE
#else
				w.DrawRect(x, yl, 1, yh - yl, SColorShadow);
#endif
			}
TreeCtrl.cpp:1051	
		if(w.IsPainting(0, y, sz.cx, msz.cy) && msz.cy > 0) {
			if (multiroot) {
				if(m.canopen || m.child.GetCount()) {
#ifdef NEWSTYLE
					Image im = m.isopen ? CtrlImg::SmallDown() : CtrlImg::SmallRight();
#else
					Image im = m.isopen ? CtrlImg::treeminus() : CtrlImg::treeplus();
#endif
					op -= CtrlImg::cross().GetSize() / 2;
					w.DrawImage(op.x, op.y, imgEmpty);
				}
			}
			else {
#ifdef NEWSTYLE
#else
				w.DrawRect(op.x, op.y, levelcx2, 1, SColorShadow);
#endif
				if(m.canopen || m.child.GetCount()) {
#ifdef NEWSTYLE
					Image im = m.isopen ? CtrlImg::SmallDown() : CtrlImg::SmallRight();
#else
					Image im = m.isopen ? CtrlImg::treeminus() : CtrlImg::treeplus();
#endif
					op -= im.GetSize() / 2;
					w.DrawImage(op.x, op.y, im);
				}
			}
			w.DrawImage(x, y + (msz.cy - isz.cy) / 2, m.image);
			x += isz.cx;
			Color fg, bg;
			dword st;
			Size csz = m.GetCtrlSize();
			if(m.ctrl && !highlight_ctrl) // 2008-04-08 mrjt
				x += csz.cx;
			if(x < sz.cx) {
				const Display *d = GetStyle(i, fg, bg, st);
				int ctx = highlight_ctrl * csz.cx;
				Rect br = RectC(x, y, vsz.cx + 2 * m.margin + ctx, msz.cy);
				if(!IsNull(m.value) || m.ctrl && highlight_ctrl) {
#ifdef NEWSTYLE
#else
					w.DrawRect(br, bg);
#endif
					Rect r = RectC(x + ctx + m.margin, y + (msz.cy - vsz.cy) / 2, vsz.cx, vsz.cy);
					w.Clip(r);
					d->Paint(w, r, m.value, fg, bg, st);
					w.End();
				}
				if(i == cursor && !nocursor && multiselect && GetSelectCount() != 1 && HasFocus()
				   && !IsDragAndDropTarget())
					DrawFocus(w, br, st & Display::SELECT ? SColorPaper() : SColorText());
			}
		}
----------------------------------------------------------------------------------------

If there is an easier way to modify the tree, I would be glad to hear.

Best Regards, Daniel

[Updated on: Mon, 08 February 2021 23:19]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: CallbackN<> storing pointer to member function
Next Topic: [Solved]Vector<Vector<int>> problem
Goto Forum:
  


Current Time: Sun Aug 31 06:15:12 CEST 2025

Total time taken to generate the page: 0.03236 seconds