It is currently Mon Dec 09, 2019 2:59 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 71 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: Tue May 20, 2008 4:38 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Apr 25, 2003 7:06 pm
Posts: 2244
Location: Argentina
If someone uses the #ACO_SEARCH, how to know if user pick up this option?
As far as i can see it uses the word "Search " in the language of the user, so by this way is hard to find it.
I guess there is some correct way to find it out.

Thanks in advance


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri May 30, 2008 9:24 am 
Offline
Enthusiast
Enthusiast

Joined: Sun Nov 06, 2005 6:07 am
Posts: 162
Location: Perth Western Australia
Hi,

I have been playing aound with the autocomplete gadget and it is proving to be very handy.

I would like to know how to find out which element of the Srting$ array has been selected, as I would like to populate some other gadgets with text from an array depending on what is selected with the autocomplete.

At the moment I am using a comboboxgadget and it works but it is not as nice as the autocomplete.

Code:
Case #String_6
               If GetGadgetText(#String_6)>""
                  Result = GetGadgetState(#String_6)
                  result= result+1
                  SetGadgetText(#String_7,Supplier.s(Result,2))
                  SetGadgetText(#String_8,Supplier.s(Result,3)+" "+Supplier.s(Result,4)+" "+Supplier.s(Result,5))
                  SetGadgetText(#String_9,Supplier.s(Result,12))
                  SetGadgetText(#String_10,Supplier.s(Result,13))
                  SetGadgetText(#String_11,Supplier.s(Result,10))
                EndIf


Is there a way to find out which element was selected in the autocomplete gadget.

Thanx Leo

_________________
Regards
Leo


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Aug 09, 2008 9:36 am 
Offline
User
User

Joined: Fri Jul 25, 2008 6:09 am
Posts: 29
Location: England
Hi.

I have just found this code and while I have no idea what all the additional bits do since the first set of code (which works perfectly for me), I have a question.

Is there a way for a user to see ALL the possible options in the autocomplete list. So if you hit the down arrow you see all options in the list rather than having to press a key to see all entiries starting with that letter/number?

This would make this perfect for what I need to do if that was possible.

Thanks

Aree.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Aug 09, 2008 1:06 pm 
Offline
User
User

Joined: Fri Jul 25, 2008 6:09 am
Posts: 29
Location: England
leodh wrote:
Hi,

I have been playing aound with the autocomplete gadget and it is proving to be very handy.

I would like to know how to find out which element of the Srting$ array has been selected, as I would like to populate some other gadgets with text from an array depending on what is selected with the autocomplete.

At the moment I am using a comboboxgadget and it works but it is not as nice as the autocomplete.

Code:
Case #String_6
               If GetGadgetText(#String_6)>""
                  Result = GetGadgetState(#String_6)
                  result= result+1
                  SetGadgetText(#String_7,Supplier.s(Result,2))
                  SetGadgetText(#String_8,Supplier.s(Result,3)+" "+Supplier.s(Result,4)+" "+Supplier.s(Result,5))
                  SetGadgetText(#String_9,Supplier.s(Result,12))
                  SetGadgetText(#String_10,Supplier.s(Result,13))
                  SetGadgetText(#String_11,Supplier.s(Result,10))
                EndIf


Is there a way to find out which element was selected in the autocomplete gadget.

Thanx Leo


I wondered this as I need to know this as well.

I came up with this basic (and probably overly complicated way):

Code:
Result$=GetGadgetText(#String_0)
For C=0 To PeekL(Strings() - 8)-1
If Strings(C)=Result$
Element=C
Debug Str(C)+" : "+GetGadgetText(#String_0)
EndIf
Next C


Works prefectly in my tests and is quick as well.

I hope this what you wanted.

Arcee


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Sep 05, 2008 5:00 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Mon Jun 02, 2003 1:42 am
Posts: 2010
Location: Ashland, KY
Ran into another problem somewhat like the one I had last summer. Different combo box, different error..

I get "Invalid memory access. (read error at address 0)

On the ProcedureReturn here :

Code:
If count = celt
    ProcedureReturn #S_OK ;; error here
  Else
    ProcedureReturn #S_FALSE
  EndIf


I open the window with the autocomplete'd gadget on it, type a letter, everything works fine. Close the window. Re-open it, type a character in the autocompleted combo and the crash happens every time.

PB 4.20, threadsafe on Windows XP SP3

The full offending procedure :

Code:
Procedure IEnumString_Next(*THIS.EnumString, celt, *rgelt.Long, *pceltFetched.Long)
  If *THIS\Enumerator + celt <= *THIS\StringCount
    count = celt
  Else
    count = *THIS\StringCount - *THIS\Enumerator
  EndIf
 
  For i = 0 To count-1
    *rgelt\l = *THIS\Buffer\Strings[*THIS\Enumerator + i]
    *rgelt + 4
  Next i
 
  *THIS\Enumerator + count
 
  If *pceltFetcted
    *pceltFetched\l = count
  EndIf
 
  If count = celt
    ProcedureReturn #S_OK ;; error here
  Else
    ProcedureReturn #S_FALSE
  EndIf
EndProcedure



I've used the heap validation routine that freak posted and it doesn't seem to be the same thing that happened before- the ValidatePBHeap() procedure returns all is well.

_________________
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Sep 08, 2008 7:37 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Mon Jun 02, 2003 1:42 am
Posts: 2010
Location: Ashland, KY
Does anyone have any ideas on this one? I'm drawing a blank.

_________________
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Sep 08, 2008 8:26 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 5:21 pm
Posts: 5783
Location: Germany
I ran into the same problem a while ago. But i have no solution so far either.
It appears to be crashing in the AutoComplete object's code itself, after my code correctly returned the first string. I have no idea why.

_________________
quidquid Latine dictum sit altum videtur


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Sep 08, 2008 8:31 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Mon Jun 02, 2003 1:42 am
Posts: 2010
Location: Ashland, KY
Thanks!

Do you know of any other way to create the end result (an auto completing, editable combo box)?

_________________
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Sep 08, 2008 9:01 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Mon Jun 02, 2003 1:42 am
Posts: 2010
Location: Ashland, KY
I found another problem last night as well. Copy/paste something into a combo with this autocomplete code in any version of Vista and it crashes pretty violently :-(

_________________
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Sep 08, 2008 9:19 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 5:21 pm
Posts: 5783
Location: Germany
The only other way is to code it all manually afaik.

_________________
quidquid Latine dictum sit altum videtur


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 20, 2008 8:01 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jun 12, 2007 10:30 am
Posts: 617
Location: not there...
I`m a little confused: I always get an IMA at the last line when using Freak`s Code from the first post (exact the same).

The strange thing: I`m using Freak`s Code in an application without any problems. Never had problems until today....

Does anyone know, what could be? Because I want to implement that again....

_________________
5.70


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 20, 2008 8:04 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Mon Jun 02, 2003 1:42 am
Posts: 2010
Location: Ashland, KY
IMA?

_________________
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 20, 2008 8:13 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jun 12, 2007 10:30 am
Posts: 617
Location: not there...
Yes, IMA (read error at address 197....).

I just run the first code. Press 'e' -> select a word -> Close the window -> IMA.

Never happened before....Could you try it, please?
I can`t believe it...

_________________
5.70


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 20, 2008 8:22 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jun 12, 2007 10:30 am
Posts: 617
Location: not there...
I just found out, when closing the window with CloseWindow(), it works (no IMA).

Code:
      Repeat
        event=WaitWindowEvent()
        Select event
          Case #PB_Event_CloseWindow
            If EventWindow()=#window_0
            CloseWindow(#window_0)
            quit=1
            EndIf
        EndSelect
      Until quit = 1


It also doesn`t crash, when doing this:
Code:
      Repeat
        event=WaitWindowEvent()
      Until event = #PB_Event_CloseWindow
      CloseWindow(#window_0)
Image

_________________
5.70


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 20, 2008 8:39 pm 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5755
Location: Berlin - Germany
@Marco2007
I think you or the code uses a callback without testing of existing the control.
CloseWindow is the simple way to solve this :wink:

_________________
PureBasic 5.71 | SpiderBasic 2.21 | Windows 10 Pro (x64) | Linux Mint 19.2 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 71 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye