Re: HOW???

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

-----Original Message-----
From: Wayne Overman

>Hello,

>In the below example I am trying to overlay Listviews in the same spot in
the same window.

>1. The problem is when I flip between the Listviews I'm essentially
createing a new List
>   (which I dont want to do.)

I think you're coming at this from the wrong perspective.  Rather than have
multiple lists, all you really need to do is change the contents of each
list.  I'm partly at fault, since there's no easy way (right now) to change
columns.

There's another solution to this one (and it's basically what I did in my
demo).  First, keep a variable to track which list is currently being
displayed.  Then, when a button is clicked, you can check to see if the same
list is already being displayed.  Use deleteItem( LV, -1 ) to clear all the
items from the list.

>2. What method can I use to return to the original List if I have selected
the same list twice.
>   (the answer to the first question should take care of this...)

Yup.

>3. Also, the first Listview item button sends me back to the very first
Listview I created.
>   (which I dont want to do either.)

I don't think I follow you here.

>(I Think) that [sendMessage] should clear these two problems up however,
I'm not completely
>understanding the methods used. I write this after many attempts, and am in
total need of help.

I haven't wrapped this yet, but you can put this procedure into your code
(or into win32lib) to allow you to change the column headers:

-- Begin code
global procedure setColumn( integer id, integer column, sequence text )
    atom LV_COLUMN, ok

    LV_COLUMN = struct_LVCOLUMN( LVCF_TEXT, 0, 0, text, 0)

    ok = sendMessage( LV, LVM_SETCOLUMN, column - 1 , LV_COLUMN )
    -- Note:  wParam (0 above) is the column number (it's a zero-based
index)
    --      lParam is the pointer to the listview column structure

    free(LV_COLUMN)
    free_strings()

end procedure
-- End code

Then, in Which_List(), you'd need to add this:

setColumn( LV, 1, lView[Butt_No])

to change the column header.


procedure Which_List(integer Butt_No)
sequence lView

lView = {"Mechanical","Electrical","Hydraulic","Pneumatic","Misc"}

       LV = create( ListView,
                  { lView[Butt_No], "Part No", "Supplier" },
                    ChildWin_work_class,200,50,495,370,
                    or_all({LVS_REPORT, LVS_SHOWSELALWAYS}))

end procedure

Which_List(1)

procedure Mech_Butt()
Which_List(1)
end procedure

procedure Elec_Butt()
Which_List(2)
end procedure

procedure Hydr_Butt()
Which_List(3)
end procedure

onClick[btnMech] = routine_id( "Mech_Butt"  )
onClick[btnElec] = routine_id( "Elec_Butt"  )
onClick[btnHydr] = routine_id( "Hydr_Butt"  )

WinMain(MainWin,Maximize)

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

Search



Quick Links

User menu

Not signed in.

Misc Menu