Welcome, Guest
Username: Password: Remember me
General Purpose Components and Libraries, discussions, problems and suggestions
  • Page:
  • 1

TOPIC:

TComboBox OnKeyPress bug 12 years 7 months ago #1928

  • recardo
  • recardo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 0
Hello

I'm not sure where to write about problem/bugs, so I decided to write here.
OnKeyPress is never fired for TComboBox when application in compiled and running on Windows CE. It's fired for TMemo and other components but not for TComboBox.
Same code but compiled for Win32, works (windows 7).
Please for fix, because I must rewrote few procedures which are designed to work on OnKeyPress only (they was wroted on windows 7)
I have use codetyphon 2.5. I do not install 2.6 yet(because I do not see any bug fix releated with TComboBox)

b.r.

Please Log in or Create an account to join the conversation.

Last edit: by recardo.

Re: TComboBox OnKeyPress bug 12 years 7 months ago #1932

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4540
  • Thank you received: 1117
Thanks Sir
we will check this
PilotLogic Architect and Core Programmer
The following user(s) said Thank You: recardo

Please Log in or Create an account to join the conversation.

Re: TComboBox OnKeyPress bug 12 years 7 months ago #1937

  • recardo
  • recardo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 0
:cheer: Oka thanks. Tell me approx time. I mean if I need to wait to next release of codetyphon or any fast patch is possible?
I do not want to presure You but I need to know it , to wait or modify my functions.

btw. "TO DO" option looks like not working too. It do not show "TO DO" comments in source

b.r.

Please Log in or Create an account to join the conversation.

Last edit: by recardo.

Re: TComboBox OnKeyPress bug 12 years 7 months ago #1938

  • Konstantinos Papadoulas
  • Konstantinos Papadoulas's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 131
  • Thank you received: 19
TODO works fine for me. I have CT 2.60 installed.
Do you have your TODO comments formated the proper way?

Here is a TODO comment in my code:
{ TODO 1 -oppdk -cApplication : Options Dialog }

and here is an item that has been DONE:
{ DONE 1 -oppdk -cIR_Functions : Compacting }
The following user(s) said Thank You: recardo

Please Log in or Create an account to join the conversation.

Last edit: by Konstantinos Papadoulas.

Re: TComboBox OnKeyPress bug 12 years 7 months ago #1939

  • recardo
  • recardo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 0
I use yet CT 2.50. Yes it works :blink: I tested now few times and works.
It must be something wrong with environment running for long time while I tested it. Now on fresh run it works :)
Sorry for false signal.

Today I'll install CT 2.60
Is possible to install CT 2.60 without delete CT 2.50? For example by rename codetyphon directory to __codetyphon, and install CT 2.60 and in case of any problems undelete and back to 2.50?

Another bug I found is in GR32 component on WinCE. TextOut for TBitmapLayer do not works properly.
On Win32:

- It do not accept any color

On WinCE

- It do not accept any color - problem still exists
- It do not accept any font and font size
fixed in CT 2.60 with new GR32 !!! :woohoo:

Also RenderText have some problems on WinCE(on Win32 works correctly):

- It do not accept any font and font size
- Antialiasing make font smaller, depend of AA level
Both fixed in CT 2.60 with new GR32 !!! :woohoo:


Fast FIX found:

After install CT 2.60 WinCE project do not compile coz of GR32_Image.pas
Fix if to change {$IFDEF Windows} to {$IFDEF Win32} at line 2107 :cheer:
Please include it in next CT versions :)

b.r.

Please Log in or Create an account to join the conversation.

Last edit: by recardo.

Re: TComboBox OnKeyPress bug 12 years 7 months ago #1959

  • recardo
  • recardo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 0
Any news about ComboBox OnKeyPress bug?

b.r.

Please Log in or Create an account to join the conversation.

Re: TComboBox OnKeyPress bug 12 years 7 months ago #1965

  • Konstantinos Papadoulas
  • Konstantinos Papadoulas's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 131
  • Thank you received: 19
I didn't ask earlier but does OnKeyUp and OnKeyDown work as expected? What is the thing you are trying to do by using OnKeyPress. Maybe i can help to find a way around...

Please Log in or Create an account to join the conversation.

Re: TComboBox OnKeyPress bug 12 years 7 months ago #1968

  • recardo
  • recardo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 0
OnKeyUp and OnKeyDown working. I need OnKeyPress because I check and replace some characters in one execution only. Exactly I checking for date format like 2012-05-13. When user push any key then depend of length/position, function insert "-" char when is needed:

combobox is dynamically created
Procedure TMain.Event_Combo_onKeyPress_Date(Sender: TObject; var Key: Char);
Var
 CursPos,SelLen:Integer;
 Str:String;
 ComboBox:TComboBox;
begin
ComboBox:=TComboBox(Sender);
 If NOT (Key in [#13, #8, '-','0'..'9']) Then Key:=#0;
 If Key=#13 Then Begin ComboBox.Items.Insert(0,ComboBox.Text);Exit;End;
 If (Length(ComboBox.Text)>=ComboBox.MaxLength) AND (ComboBox.SelLength=0) Then ComboBox.SelLength:=1;
 CursPos:=ComboBox.SelStart;
 SelLen:=ComboBox.SelLength;
 Str:=ComboBox.Text;
  If SelLen>0 Then
  Begin
   Delete(Str,CursPos+1,SelLen);
   ComboBox.Text:=Str;
   ComboBox.SelStart:=CursPos;
  End;
  If (CursPos=4) OR (CursPos=7) Then
  Begin
   ComboBox.SelLength:=1;
   Str:=ComboBox.Text;
    If Length(Str)>CursPos Then Str[CursPos+1]:='-' Else Str:=Str + '-';
   ComboBox.Text:=Str;
   Inc(CursPos);
   ComboBox.SelStart:=CursPos;
  End;
end;

Please Log in or Create an account to join the conversation.

Last edit: by recardo.

Re: TComboBox OnKeyPress bug 12 years 7 months ago #2018

  • recardo
  • recardo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 0
Hello

So where I should report bugs? I do not see any answer for week about this problem.
Do I should to move to pure lazarus ? I Like CodeTyphon, but it looks it lack of support :silly:

b.r.

Please Log in or Create an account to join the conversation.

Re: TComboBox OnKeyPress bug 12 years 7 months ago #2019

  • 4aiman
  • 4aiman's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Comix creator
  • Posts: 227
  • Thank you received: 12
Recardo, just why (?) you're so badly desire to do this with OnKeyPress event?
I mean, just what place in your code makes it impossible to use OnKeyUp?
Yes, this way you wouldn't be sure, which control was focused by the time user would PRESS the key...
But you're still be able to know if he or she RELEASE the key while your combobox is focused.
I mean, anyway you're checking for keys, not a finger's or cursor movement or "clicking" (if we just could say so).

I'm honestly don't understand, how you or anyone else could possibly end up with pressing a key while one control is focused and release this key when another one became focused? (Okay, there is "tab" key, but for what purpose one would want to press a key, then press "tab" while holding first one and then release sequentially "tab" and the key he or she was holding all this time?)

Anyway, let us suggest there ARE some difference. Then.... Then I suggest that you just switch to OnKeyUp replacing #13 with vk_return and the other keys with their virtual codes (like vk_0 through vk_9 etc.). And all you need to get this codes recognized is to add LCLType to your "uses" clause.

Why? Well, if you want to check whether key was pressed while combobox if focused, you could REMEMBER the key with OnKeyDown event (in the any global var). Then, OnKeyPress you could check, whether RELEASED key is the same key that was PRESSED OnKeyDown. And after that just clear the variable, so there would be no second... err... (don't know the englis for it, and the google isn't very helpful) it wouldn't work for a second time if you cleared the variable.


Secondary... I think, that CT is "supported" much better then pure Lazarus. The greatest part of it's support is hundreds of working components. Just try to install some of CT's library into pure lazarus and we'll se what you'll get ;)
Well, if you're needs do not exceed the pure thing (considering that your code above works there well), than maybe (just "maybe") it is really better for you to stay with it.
コンソールマニアック

Please Log in or Create an account to join the conversation.

Last edit: by 4aiman.

Re: TComboBox OnKeyPress bug 12 years 7 months ago #2032

  • recardo
  • recardo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 0
I must use OnKeyPress because is not for detect clicked key, but for date formatting like "2012-05-24". It's device with virtual keyboard without arrows, so code is wroted to perfect format and insert "-" in correct place. Also is designed to overwrite digits when all date is filled up. So ComboBox is working like EditMask with some differences. I'm using variable menu which is created dynamically and many comboboxes are created. With OnKeyDown and OnKeyUp I must rewrite code, remember sender for every combobox, which number can be 1 or 20. I know I can create dynamic buffer, but it's not a way of programming what I preffer (I'm limited of memory,speed of device too). You asking why? Because I'm tired to find fixes for WinCE compilation(already 3 months spend on project where 30% are for fixing bugs like this one). I have no more time to thinking why it working on Win32 but not on WinCE etc. That's why.
I report bug, I got reply that will be fixed, but no approx time or any other response.
Yea, I agree that components support, examples etc. are really nice, that's why I chose CT(with pure lazarus I had problems with install GR32 for example), but believe me, that I have no more time digging problems, so it's first time when I report bug with hope to get fix like other peoples got fast(SQL problem)...

b.r.

Please Log in or Create an account to join the conversation.

Re: TComboBox OnKeyPress bug 12 years 7 months ago #2033

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4540
  • Thank you received: 1117
Sir
we will focus on this problem
PilotLogic Architect and Core Programmer
The following user(s) said Thank You: recardo

Please Log in or Create an account to join the conversation.

Re: TComboBox OnKeyPress bug 12 years 7 months ago #2034

  • 4aiman
  • 4aiman's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Comix creator
  • Posts: 227
  • Thank you received: 12
Well, it's good to see the problem is to be solved ;)

Absolutely, totally, ultimately NO ofence.

I must use OnKeyPress because is not for detect clicked key, but for date formatting like "2012-05-24"

Well, I still can see, why you cant change combobox text upon onkeyup - there's nothing special about keypress that obliged you to using latter ;)

With OnKeyDown and OnKeyUp I must rewrite code

I could understand that you're tired, but rewriting for some reason (optimization, for example) is a common thing. You're stil to write some code and probably still to optimize it (you've said that your device is short on the resources).

(I'm too "fighting", but with glscene, and wheter I'm tiredor)

remember sender for every combobox,
...
I know I can create dynamic buffer

It's not necessary to remember anyting - just create a simple ancestor of tcombobox. It'll save you a lot of time.

which number can be 1 or 20.

If 20 is too many - then with or without onkeyup/down it's all the same.

Because I'm tired to find fixes for WinCE compilation

If you find so many bugs, then you should probably report all of them or/and present a path for that bugs.
No ofence, but when I'm fighting with glscene - I allways post my solutions for things that I've found working in a wrong way. And even If you found not a solutition but just workaround - it's still highly appreciated. That way you'll save the time and nerves for the others.

like other peoples got fast(SQL problem)...

Well, no one would argue that working with database is more common than building winCE apps. Simply bacause latter is not so... "common" (?). I mean not so many people have an WinCE controlled device ;)
コンソールマニアック

Please Log in or Create an account to join the conversation.

Re: TComboBox OnKeyPress bug 12 years 7 months ago #2042

  • recardo
  • recardo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 0
@sternas
Thank You. I wish to help, but I have no idea where to check. Problem can be simple tested on WinCE emulator.


@4aiman
Main problem is that project what I do is continued with extra time. I'll finish it long time ago if no many (non programming) problems.
Some bugs I cannot report coz they was not related with CT itself. For example GR32 component and TextOut function. All was fixed with latest CT2.6 release and updated(after loooong delay) GR32 component. :)
Anyway I leave it yet as last thing to fix, maybe CT team will release any fix, if not then will rewrite procedure.

B.r.

Please Log in or Create an account to join the conversation.

Last edit: by recardo.

Re: TComboBox OnKeyPress bug 12 years 6 months ago #2116

  • recardo
  • recardo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 0
Hello

Now I'm totally stuck. I rewrote procedure to works on OnKeyDown which is fired. I use PostMessage to send WM_CHAR to ComboBox handle (because it's virtual keyboard) but this will never works because WM_CHAR is OnKeyPress equivalent. WM_KEYDOWN and WM_KEYUP can simulate special keys and UPPERCASE letters only(I need both)
So dear experts, what to do now?

b.r.

Please Log in or Create an account to join the conversation.

Last edit: by recardo.

Re: TComboBox OnKeyPress bug 12 years 6 months ago #2137

  • 4aiman
  • 4aiman's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Comix creator
  • Posts: 227
  • Thank you received: 12
@recardo
It seems that WM_CHAR isn't perfect itself! Look at this article. Maybe it'll help you a bit.
コンソールマニアック

Please Log in or Create an account to join the conversation.

Re: TComboBox OnKeyPress bug 12 years 6 months ago #2145

  • recardo
  • recardo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 0
thanks will take a look !

b.r.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1