Problema con combosearchbox/ problem combosearchbox

HMG en Español

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Problema con combosearchbox/ problem combosearchbox

Post by Pablo César »

Well for me is working after trailing spaces. Compile Polo's sources and then make trailing spaces and you will see.

Another thing I have observed in your combosearbox that even increasing value in dropheight property, combobox results is no complete element shown at screen. It is missing last line which closes the combobox. See image below:
Screen65.PNG
Screen65.PNG (16.33 KiB) Viewed 3413 times
In case you need Polo corrected code for working, please note:

Code: Select all

/* CSBox ( Combined Search Box ) try
	
	CombosearchBox already inherits all properties events 
	and methods from TextBox
  
	Test it uncommenting the following: frmCSBTest.s1.Value := '*'
*/

#include "hmg.ch"
#include "hfcl.ch"

Function Main()
Local aMunicipios:={}

/*
aMunicipios := HB_ATOKENS( MEMOREAD( "Municipios.lst" ),   CRLF )
for i := 1 to len( aMunicipios )
   aMunicipios[ i ] := alltrim( aMunicipios[ i ] )
next i
ASORT( aMunicipios )                    // This Array MUST be sorted
*/
AEval( hb_atokens( MEMOREAD( "Municipios.lst" ), CRLF ), { |cLine| AaDd( aMunicipios, AllTrim( cLine ) ) } )
DebugMSG(aMunicipios)
    
DEFINE WINDOW frmCSBTest ;
    AT 0,0 ;
    WIDTH 620 ;
    HEIGHT 300 ;
    TITLE 'CSBox ( Combined Search Box ) Test' ;
    MAIN
     
    ON KEY ESCAPE ACTION frmCSBTest.Release
    
    define label countries
        row 25
        col 100
        width 100
        value "Countries"
    end label
     
    define combosearchbox s1
        row 25
        col 190
        width 200
        fontname "Courier"
        fontitalic .t.
        fontbold .t.
        fontcolor {255,255,255}
        backcolor {0,0,255}
        items aMunicipios
        on enter msginfo(frmcsbtest.s1.value)
        anywheresearch .t.
        dropheight 170
    end combosearchbox
     
    @ 55, 190 TEXTBOX txbMessy width 400
    @ 85, 190 TEXTBOX txbMessy1
   
END WINDOW
frmCSBTest.Center
frmCSBTest.Activate
Return Nil

Function DebugMSG
Local i, aTemp := {}
   
For i := 1 to pcount()
    aadd( aTemp, hb_PValue(i))
Next i
MsgBox(hb_valtoexp(aTemp), "Helpful informations")
Return Nil
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Problema con combosearchbox/ problem combosearchbox

Post by esgici »

Hi Rathi and Pablo

Probably it's time of going away from programming affairs for me :(

Because I don't understand you both yet :(

For me after removing trailing space ( with any way ) didn't change anything.

In my opinion: the problem of Polo is : for example : when pressing a letter other than "a" in search text box, doesn't come lines beginning with this letter; instead the list continue with lines beginning of "a" :
Searching a string anywhere of a list
Searching a string anywhere of a list
anywhere.PNG (3.28 KiB) Viewed 3407 times
Sadly, this isn't a problem, simply a normal behavior.

For see always lines beginning with search string, Polo need assign .F. value to anywheresearch property of combosearchbox control.

Correctness of my opinion is depend to confirmation of Polo of course.

TIA :D
Viva INTERNATIONAL HMG :D
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Problema con combosearchbox/ problem combosearchbox

Post by Rathinagiri »

Dear Esgici,

The example in the first post of the thread gives a runtime error if all the string elements of the array are not trimmed. That is the problem.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Problema con combosearchbox/ problem combosearchbox

Post by Pablo César »

Dear amigo Esgici,
esgici wrote:For me after removing trailing space ( with any way ) didn't change anything.
Sorry, sorry and sorry !

We are wrong way thinking. There is nothing wrong with trailing spaces for combosearbox array !
esgici wrote:In my opinion: the problem of Polo is : for example : when pressing a letter other than "a" in search text box, doesn't come lines beginning with this letter; instead the list continue with lines beginning of "a" :
The attachment anywhere.PNG is no longer available
Yes, I guess that so ! Polo needs to appear and confirm.
Sadly, this isn't a problem, simply a normal behavior.
Yes and not. You will see even typying "a" it's going to show all elements which contains an "a". If typed "c", it will show "Acocayagua", "Acajete", "Acala"... son on. But probably user wish on begining character not containing as substring... Certainly you can make one implement amigo Esgici with both of search options. What do you think ?
Pablo César wrote:Another thing I have observed in your combosearbox that even increasing value in dropheight property, combobox results is no complete element shown at screen. It is missing last line which closes the combobox. See image below:
Screen65.PNG
Screen65.PNG (16.33 KiB) Viewed 3396 times
And what about this, Esgici ?
rathinagiri wrote:Dear Esgici,

The example in the first post of the thread gives a runtime error if all the string elements of the array are not trimmed. That is the problem.
Not, dear Rathinagiri. All is OK even not triming spaces. Please check again compiling original Polo codes. We have been wrong in this thinking...
Last edited by Pablo César on Sat Mar 23, 2013 2:20 pm, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Problema con combosearchbox/ problem combosearchbox

Post by esgici »

rathinagiri wrote: The example in the first post of the thread gives a runtime error if all the string elements of the array are not trimmed. That is the problem.
There should be a difference, I couldn't seen any RTE :?
Viva INTERNATIONAL HMG :D
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Problema con combosearchbox/ problem combosearchbox

Post by Rathinagiri »

Well, I am getting a Run time error here. :)

Kindly run the exe file below.

Don't you get any error?
aa.zip
(879.15 KiB) Downloaded 210 times
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Problema con combosearchbox/ problem combosearchbox

Post by esgici »

Sorry yes ( don't got any RTE ) :(

Virus ?

What error ( and err msg ) you got ?

Regards
Viva INTERNATIONAL HMG :D
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Problema con combosearchbox/ problem combosearchbox

Post by esgici »

Pablo César wrote: There is nothing wrong with trailing spaces for combosearbox array !
Thanks to confirmation amigo, I feel better now :D
...What do you think ?
My first opinion ( as suggested earlier) is assign .F. to lAnyWhere by user.

If you are asking "what could make by developer ?" first may assign .F. default value to this property.
And second ( as in early versions of CSBx ) implementing search operation ( lines 226 trough 236 in of combosearchbox.prg in HFCL lib) may be a bit different:

Code: Select all

   cSearchValue := TRIM( UPPER( cCurValue ) ) // Compare TRIM() with HB_TRIM() 
                                              // and     UPPER() with HB_UPPER()
   
   AEVAL( aitems, { | c1 | IF( UPPER( LEFT( c1, LEN( cSearchValue ) ) ) == cSearchValue,;
                    AADD( aResults, c1 ), ) } )
                    
   IF EMPTY( aResults ) .AND. lAnyWhere
      AEVAL( aitems, { | c1 | IF( cSearchValue $ UPPER( c1 ),;
                              AADD( aResults, c1 ), ) } )
   ENDIF


... to be continued ...

Regards
Viva INTERNATIONAL HMG :D
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Problema con combosearchbox/ problem combosearchbox

Post by Rathinagiri »

Ok. Kindly see the attachment video.
error1.zip
(602.63 KiB) Downloaded 202 times
My windows version is 7. My HMG Version is 3.0.46
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Problema con combosearchbox/ problem combosearchbox

Post by Pablo César »

rathinagiri wrote:My windows version is 7. My HMG Version is 3.0.46
Version 3.0.46 ? So that is the problem. Municipios.lst is on UTF-8 format, dear Rathinagiri.

I have commited same error, but after I checked Municipios.lst file format and then I have changed to HMG version 3.1.1.
Last edited by Pablo César on Sat Mar 23, 2013 3:20 pm, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply