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 » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Problem with Drag&Drop in ArrayCtrl
Re: Problem with Drag&Drop in ArrayCtrl [message #22556 is a reply to message #22552] Sun, 26 July 2009 23:50 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3437
Registered: August 2008
Senior Veteran
luzr wrote on Sun, 26 July 2009 17:28

koldo wrote on Sat, 18 July 2009 07:51

More simple:

Is it possible to update/refresh only one row in an ArrayCtrl ?

Best regards
Koldo


void ArrayCtrl::RefreshRow(int i);



Hello Mirek

Unfortunately RefreshRow() does not repaint the row.

To force the repaint I have to scroll up and down and then I see the row repainted.

Using instead UpdateRefresh() repaints the rows properly, but it seems it cancels the Drag & Drop possibility.

It is difficult to prepare a sample case as the application is rather big. Here I put some details:

The variable is declared under the TopWindow class as
ArrayCtrl filesList;


The layout is in:
	filesList.AddColumn("Thumbnail").SetDisplay(Single<DisplayThumbnail>()).HeaderTab().Min(50);
	filesList.AddColumn("Properties").HeaderTab().Min(50);
	filesList.MultiSelect().HeaderObject().Absolute().Clipboard();
	filesList.HeaderTab(0).SetRatio(10);
	filesList.ColumnWidths("100 100");
	filesList.WhenDropInsert = 	THISBACK(DropInsertFilelist);
	filesList.WhenDrag = 		THISBACK(DragFilelist);
	filesList.WhenDrop = 		THISBACK(DropFilelist);


DisplayThumbnail declaration:
struct DisplayThumbnail : public Display {
    virtual void Paint(Draw& w, const Rect& r, const Value& val, Color ink, Color paper, dword style) const; 
};


And Drag & Drop functions
	void DropFilelist(PasteClip& d)
	{
		if(AcceptText(d)) {
			filesList.Add(GetString(d), GetString(d));
			filesList.SetFocus();
		}
	}
	void DropInsertFilelist(int line, PasteClip& d)
	{
		if(AcceptInternal<ArrayCtrl>(d, "array")) {
			filesList.InsertDrop(line, d);
			filesList.SetFocus();
			filesList.SetLineCy(70);
		}
	}
	void DragFilelist()
	{
		filesList.DoDragAndDrop(InternalClip(filesList, "array"));
	}


Best regards
Koldo


Best regards
IƱaki
 
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
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Substring formating in ArrayCtrl (SqlCtrl)
Next Topic: Right Click on GridCtrl
Goto Forum:
  


Current Time: Fri Jul 18 07:35:00 CEST 2025

Total time taken to generate the page: 0.03486 seconds