Re: Win32lib question
- Posted by Derek Parnell <dparnell at BIGPOND.NET.AU> Nov 15, 2000
- 495 views
Hi "Feta", at this stage you cannot do this. But it's very easy to implement and I've been think of doing it anyway, so I'll put it into the next release. It'll be something like .... info = getControlInfo( id , item) where item can be either a single keyword or a list of keywords. It would return the item(s) requested by the keywords. eg. sequence info info = getControlInfo(s[i], w32CI_Type) if info[1] = True then -- A valid ID and valid types supplied. if info[2] is an EditText control then t=append(t, getText(s[i]) ) elsif info[2] is an DropDownList control then t=append(t, getIndex(s[i]) ) elsif etc .... end if end if This is just an idea for now. Does anybody else have opinions about this issue? Of course another way would be to do this... s = {} . . . s = append(s, {create(...), EditText}) s = append(s, {create(...), DropDownList}) . . . for i=1 to length(s) do if integer ( s[i][1] ) and s[i][1] != 0 then -- if it's a valid id if s[i][2] is an EditText control then t=append(t, getText(s[i][1]) ) elsif s[i][2] is an DropDownList control then t=append(t, getIndex(s[i][1]) ) elsif etc .... end if end if end for ------ Derek Parnell Melbourne, Australia (Vote [1] The Cheshire Cat for Internet Mascot) ----- Original Message ----- From: "Feta" <mb11363 at CHELLO.BE> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Wednesday, November 15, 2000 6:56 AM Subject: Win32lib question > Humm, we can do a lot of things with this wonderful library, but is there a > way to know the class of a control > with just an id ? > why ? I have a lot of controls IDs in a sequence like this : > > sequence s > .... > s[1] = create( EditText, "", Win, 95, 0, 105, 20, 0 ) > s[2] = create( DropDownList, "", Win, 95, 20, 105, 80, 0 ) > s[3] = create( Radio, "", Win, 95, 60, 55, 20, 0 ) > etc ... > > and I want to copy all the values of these controls in one other sequence t > by example. > > So I think I should probably do a thing like that : > > for i=1 to length(s) do > if integer ( s[i] ) and s[i] != 0 then -- if it's a valid id > > if s[i] is an EditText control then > t=append(t, getText(s[i]) ) > elsif s[i] is an DropDownList control then > t=append(t, getIndex(s[i]) ) > elsif etc .... > > end if > > end if > end for > > But I don't know how to do.