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 » ArrayCtrl & pictures
icon9.gif  ArrayCtrl & pictures [message #43185] Fri, 30 May 2014 13:02 Go to next message
daenerys is currently offline  daenerys
Messages: 2
Registered: May 2014
Location: olnw
Junior Member
Greetings

I've a problem with the following

#include "arr.h"

struct MyDisplay : public Display {
    virtual void Paint(Draw& w, const Rect& r, const Value& q,
                       Color ink, Color paper, dword style) const {
        
        w.DrawRect(r, paper);
        w.DrawImage(5,5,32,32,StreamRaster::LoadFileAny(GetExeDirFile(q.ToString())));
    }
};

arr::arr()
{
	CtrlLayout(*this, "Window title");
	msg.AddColumn ( "text" );
        msg.AddColumn ( "icon" ).SetDisplay(Single<MyDisplay>());
	msg.AddColumn ( "more" );
	msg.Add("","dwarf.bmp","");
}

GUI_APP_MAIN
{
	arr().Run();
}


Problem:
if the icon column is placed first works fine,but if I place it on the second it does not.

What's wrong ?

Thanks
Re: ArrayCtrl & pictures [message #43190 is a reply to message #43185] Mon, 02 June 2014 09:28 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
w.DrawImage(5,5,32,32,StreamRaster::LoadFileAny(GetExeDirFile(q.ToString())));


Rect r says where the cell is placed. Use

w.DrawImage(r.left + 5, r.top + 5,32,32,StreamRaster::LoadFileAny(GetExeDirFile(q.ToString())));

Re: ArrayCtrl & pictures [message #43193 is a reply to message #43185] Mon, 02 June 2014 22:37 Go to previous message
daenerys is currently offline  daenerys
Messages: 2
Registered: May 2014
Location: olnw
Junior Member
many thx
Previous Topic: Painter: writes to free blocks detected
Next Topic: Drawine with Antyalyiasing
Goto Forum:
  


Current Time: Fri Apr 19 18:13:20 CEST 2024

Total time taken to generate the page: 0.01895 seconds