Re: ListView sort problem

new topic     » goto parent     » topic index » view thread      » older message » newer message

Pete Lomax wrote:
> 
> Hi,
> I'm trying to implement ListView column sorting in Arwen. The call 
> back is called the predicted number of times, and the third parameter 
> is as expected, however the first two parameters are ALWAYS both zero!
> What is going on?
> 
> }}}
<eucode>
> without warning
> include arwen.ew
> constant DEMO = create(Window,"ListViews in ARWEN", 0,
> 0,10,10,520,350,0)
> constant LIST1 = create(ListView, {{"a",50,0},{"b",30,0}},	0,
> DEMO,10, 25, 405, 160, LVS_REPORT)
> void = insertLVItems(LIST1, {{"b",3},{"c",1},{"a",2}})
> 
> function LVsort(atom a, atom b, atom lParam)	
> 	?{a,b,lParam} --<<< ALWAYS {0,0,2} <<<<<<
> 	return rand(3)-2
> end function
> 
> function handler_LISTS(integer id, integer msg, object wParam, object
> lParam)
> 	if id = LIST1 then and msg = WM_COMMAND then
> 		if wParam = LVN_COLUMNCLICK then
> 
> void=sendMessage(LIST1,LVM_SORTITEMS,LIST1,call_back(routine_id("LVsort")))
> 		end if
> 	end if
> 	return 0
> 
> end function
> setHandler( LIST1, routine_id("handler_LISTS") )
> WinMain(DEMO, SW_NORMAL)
> </eucode>
{{{

> 
> Pete
> 
> 

Hi Pete,

Explain this:
  constant LIST1 = create(ListView, {{"a",50,0},{"b",30,0}},	0,
  DEMO,10, 25, 405, 160, LVS_REPORT)

Does that create two col's and what does this do:
  void = insertLVItems(LIST1, {{"b",3},{"c",1},{"a",2}})

Im wondering if there is enough data in the list view to operate on.



Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu