Page 3 of 4 <1234>
Topic Options
#87907 - 2002-09-21 11:14 AM Re: Kixforms 2.0.5 Released
Vig Offline
Starting to like KiXtart

Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
Shawn, I have a request.

Is it possible to add a property like removecopies or removeduplicates for listbox/combobox? In case the suggested property name doesn't explain it well enough. I'm asking for a property that will cause listbox/combobox to ignore multiple occurances of the same string.

Example:
$array = "1","1","2","2","3","3"
$MyBox = Listbox(,,,,)
$MyBox.List = $array

The listbox should contain 1 2 3 4 instead of 1 1 2 2 3 3 4 4.

Also, is there a way to have a listbox automatically scroll down when items are added?

Thanks

Top
#87908 - 2002-09-21 06:07 PM Re: Kixforms 2.0.5 Released
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
There doesn't seem to be a ListBox or ComboBox style or property that allows one to have or filter a unique list of items (can you or anybody else find any references ?).

One solution I found revolved around simply purging the array of duplicates before the list was populated. Heres that link:

One solution

Im going to keep looking and thinking about this one though. For the second question - automatically scrolling and selecting items as they are added. Well - for a listbox that is not sorted, you can always set the ListIndex (current selection) to last item in the list.

Assuming you have a ListBox called ListBox1 and a CommandButton called CommanButton1, heres the code for that:

code:
Function CommandButton1_Click()

$ListBox1.AddItem(RND(9))

$ListBox1.ListIndex = $ListBox1.ListCount - 1

EndFunction

For a SORTED ListBox - its a whole new story - this was discussed and the problem demonstrated in the 4TH post of this thread :

Topic: Kixforms: Version 2.0.5 Build 33 Heads Up

[ 21. September 2002, 18:12: Message edited by: Shawn ]

Top
#87909 - 2002-09-21 06:18 PM Re: Kixforms 2.0.5 Released
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
hmmm .. the more I think about that unqiue item thingy - the more i like. Just because VB and VBA doesn't support it - doesn't mean we can't [Wink] ... I think this request is "generic" enough to be included as a behavior of the ListBox ... will stick it on todo stack ... trying to think of a good name for this property.
Top
#87910 - 2002-09-22 06:40 AM Re: Kixforms 2.0.5 Released
Vig Offline
Starting to like KiXtart

Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
Here is what I'm currently using to remove duplicates from an array. It's written assuming each string in the array begins with 0-9 or A-Z, but can easily encompass the entire ascii table (even shorter if I created all the variables dynamically).

code:
Function StripCopies($striArray) 
$on = 1
Dim $searArr,$a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m,$n,$o,$p,
$q,$r,$s,$t,$u,$v,$w,$x,$y,$z,$0,$1,$2,$3,$4,$5,$6,$7,$8,$9
For Each $add in $StriArray
$dyn = SubStr($add,1,1)
$nul = Execute('if ubound($$$dyn) = -1
ReDim $$$dyn[0] $$$dyn[Ubound($$$dyn)] = $$add
EndIf
$$counter = 0
While Ubound($$$dyn)+1 <> $$counter
If $$add = $$$dyn[$$counter]
$$on = 1
EndIf
$$counter = $$counter+1
Loop
$$counter = 0
If $$on = 0
ReDim preserve $$$dyn[Ubound($$$dyn)+1]
$$$dyn[Ubound($$$dyn)] = $$add
EndIf')
$on = 0
Next
$ProgComp.Value = 0
$ProgSoft.Value = 0
$count = 48
While $count <> 91 $dyna = Chr($count)
$nul = Execute('for each $$addto in $$$dyna
ReDim preserve $$seararr[Ubound($$seararr)+1]
$$seararr[Ubound($$seararr)] = $$addto
Next')
$count = $count + 1
If $count = 58
$count = $count + 7
EndIf
Loop
$StripCopies = $SearArr
EndFunction

I rewrote an older UDF I posted a few weeks back because it was taking entirely to long to strip the duplicates. In testing the older UDF took about 45 seconds to strip 464 unique strings from the 1220 original, this script cut that down to about 6 seconds. Of course the effectiveness of this script depends on the the original array's contants 1st characters varrying. In other words the function is faster if the first character of the strings in the array are not all the same.

Sorry, not trying to hijack the thread. I just wanted to make sure you didn't think I was asking you to write something for me because I was to lazy to do it myself.

Thanks for the input.

Top
#87911 - 2002-09-22 06:44 PM Re: Kixforms 2.0.5 Released
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Vig - how about we meet half-way in the short term ? There are two .NET type methods for the ListBox that I can implement called the following:

Index = $ListBox.FindString(string)

Index = $ListBox.FindStringExact(string)

Think they are pretty self explainatory ... all you would have to do is construct a for-each-in loop, do a findstring and if not found, add it to the list ...

-Shawn

[ 22. September 2002, 18:45: Message edited by: Shawn ]

Top
#87912 - 2002-09-22 08:11 PM Re: Kixforms 2.0.5 Released
Vig Offline
Starting to like KiXtart

Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
Hmm, let me get this straight. With the FindString and FindStringExact property you can check an entire array for the existance of a string? Wow! Instead of doing a one to one check on each string in an array you can check the entire array in one shot? I can only imagine how much time that would save.

I love it, please please add them.

Edit:
Well then again, I guess it's not really an array your checking, since Listbox.List is write only. Still has alot of potential though, a fast stripcopies. I can even see where I'd use these properties and not even show the list box, just use the behavior.

I'll have to play around with it.

[ 22. September 2002, 20:31: Message edited by: Vig ]

Top
#87913 - 2002-09-24 12:02 AM Re: Kixforms 2.0.5 Released
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I like the idea too...

then I have to ask, when the "table" (multicolumn listbox) comes along, can we match against one cell only?

what comes to the name, I have several names in my mind and none of them seems good enough to be the one...
 
_________________________
!

download KiXnet

Top
#87914 - 2002-09-26 06:53 PM Re: Kixforms 2.0.5 Released
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
anyone notice that the form background is 'missing/transparent' when you run a script while bbchecker is running
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#87915 - 2002-09-26 07:00 PM Re: Kixforms 2.0.5 Released
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Haven't noticed that but will try it tonight C ... what happens if you run BBChecker from one command window (using KIX32.EXE as opposed to WKIX32.EXE) and run the other script from another command window.
Top
#87916 - 2002-09-26 07:10 PM Re: Kixforms 2.0.5 Released
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
seems to work fine that way
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#87917 - 2002-09-26 07:58 PM Re: Kixforms 2.0.5 Released
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
that discovery from pat is also quite good:
if you just play around with taskmanager the checker's misc will crack similarly.
more info on checker topic.
_________________________
!

download KiXnet

Top
#87918 - 2002-09-26 08:13 PM Re: Kixforms 2.0.5 Released
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Thinking it has something to do with that TOPMOST property ... TaskMgr runs with TOPMOST as well.

[edit - hmmm - i know i stated the obvious there but MISC doesn't run with TOPMOST right ? - but the slider does right ?] - maybe if you disabled TOPMOST on the slider while it isn't sliding ?

[ 26. September 2002, 20:23: Message edited by: Shawn ]

Top
#87919 - 2002-09-27 03:22 PM Re: Kixforms 2.0.5 Released
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
can't the timer be disabled???

I thought it was just a matter of enabled=0 but it does not seem to affect... [Frown]
_________________________
!

download KiXnet

Top
#87920 - 2002-09-29 06:13 PM Re: Kixforms 2.0.5 Released
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
shawn, is it possible to have part of the textbox's text in some color and rest in other...

also, may I get the filemenu somehow?

if these are there already, sorry for my stupidity.

 
_________________________
!

download KiXnet

Top
#87921 - 2002-09-29 06:18 PM Re: Kixforms 2.0.5 Released
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Jooel - your right - both of those features are not there. The TextBox multi-color text thingy will never be there because the TextBox doesn't support that. The RichEdit box would though [Wink]

The MenuItem thingy will be back in sometime after 2.1 ... not sure when because I was planning on starting RichEdit right after that.

Top
#87922 - 2002-09-29 06:21 PM Re: Kixforms 2.0.5 Released
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
so, how is 2.1 going?
 
_________________________
!

download KiXnet

Top
#87923 - 2002-09-29 06:46 PM Re: Kixforms 2.0.5 Released
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
mmm...
I might have some more requests along the road as I've started sketching KixEdit...

what comes to the lanman (btw) I don't think it can fit under the namespace of kixforms.

there could be add-on library consisting of separate dll's or one collection...

anyway, these add-ons like kixforms should (my opinion) get their way to the kixtart-package.

and some, like winsock, could even be build into to the main-exe...

well, just thoughts
 
_________________________
!

download KiXnet

Top
#87924 - 2002-09-30 05:08 AM Re: Kixforms 2.0.5 Released
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
 

the tooltip does not worky on my trying to set it for combo... should it? doc (kixlist) says it's for all?

 

update: it seems to worky anyway...
but weirdly it does not worky on whole area...

[ 30. September 2002, 05:17: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#87925 - 2002-09-30 05:22 AM Re: Kixforms 2.0.5 Released
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Does it work if you "touch" the drop-down arrow thingy ?

[edit] I mean "hover" over it.

[ 30. September 2002, 05:23: Message edited by: Shawn ]

Top
#87926 - 2002-09-30 05:25 AM Re: Kixforms 2.0.5 Released
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
mmm...
as the arrow is only place it works.
if I "touch" (click) it, it does not worky anywhere on it.
_________________________
!

download KiXnet

Top
Page 3 of 4 <1234>


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 833 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.075 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org