Recent

Author Topic: [BUG] TCustomCheckListBox LM_CHANGED message  (Read 3790 times)

freeman35

  • Jr. Member
  • **
  • Posts: 92
[BUG] TCustomCheckListBox LM_CHANGED message
« on: February 05, 2013, 05:07:12 pm »
Code: [Select]
procedure DoChange(var Msg: TLMessage); message LM_CHANGED;This code not working.
Open new project, TCheckListBox put on form add more then 1 items, add this events and code and see just OnItemClick event triggered and work, other events not working.
I need find, when change selected Item in chceklistbox and that string, click or user can use keyboard. In delphi click event always triggered. In Lazarus LM_CHANGED not working

Code: [Select]
procedure TForm1.CHK_lstClick(Sender: TObject);
begin
 Self.Caption := 'Click( ' +TimeToStr(now);
end;
procedure TForm1.CHK_lstClickCheck(Sender: TObject);
begin
    Self.Caption := 'Click Check( ' +TimeToStr(now);
end;
procedure TForm1.CHK_lstItemClick( Sender: TObject; Index: integer);
begin
    Self.Caption := 'Item Click( ' +TimeToStr(now);
end;

My system is debian x86_amd64-linux-gtk 2  fpc and lazarus svn build last subversion

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: [BUG] TCustomCheckListBox LM_CHANGED message
« Reply #1 on: February 05, 2013, 05:31:52 pm »
I don't understand this sentence well:
Quote
I need find, when change selected Item in chceklistbox and that string, click or user can use keyboard.
What do you need?

Otherwise, I have opened the bugreport some time ago, also related to TCheckListBox: http://bugs.freepascal.org/view.php?id=23746
Point is that it is not native control but it is designed by LCL.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

freeman35

  • Jr. Member
  • **
  • Posts: 92
Re: [BUG] TCustomCheckListBox LM_CHANGED message
« Reply #2 on: February 05, 2013, 07:29:10 pm »
No, we are talking about littlebit diffrent, you wanna, check or uncheck when you click to item's caption, but not enough and little bit diffrent. can be problem, if user want just focus to checklistbox,
this link better explain me
http://lists.lazarus.freepascal.org/pipermail/lazarus/2008-July/037073.html
My needed is,  user when click  or move selected item via keyboard, selected item's string value fill in TEdit, and if user change this string, I'll sent back to checklist Items.
Think checklistbox, this is options list for my program, user want translate this options list to him,her language, or change word.
for example: in Checklistbox  "Cancel" but user want change to "Discard". This is an example to translate my idea, ofcourse can do this diffrent way

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: [BUG] TCustomCheckListBox LM_CHANGED message
« Reply #3 on: February 05, 2013, 08:08:51 pm »
do it some other way then it is very user unfriendly for translation purposes mainly because the original string is not visible any more by the end user making verification impossible also a check box is not needed it will makes things more difficult for the developer and adds no extra info for the translator.

a string grid where in the first column I can see the original string and on the second the translation I have typed is the only way I would accept to work on any translation and I have worked on a couple.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

freeman35

  • Jr. Member
  • **
  • Posts: 92
Re: [BUG] TCustomCheckListBox LM_CHANGED message
« Reply #4 on: February 05, 2013, 08:52:52 pm »
@taazz I was write its just example for explain. I'm not use this for translate. I'm try write component, I need this in Property editor so if no answer this bug I cancel use checklistbox and create normal checkbox on runtime.

freeman35

  • Jr. Member
  • **
  • Posts: 92
Re: [BUG] TCustomCheckListBox LM_CHANGED message
« Reply #5 on: February 06, 2013, 03:13:38 pm »
@Blaazen
TListView  work what you want, Diffrent working code then TChecklistbox, but result is same. I Mean TListView has "Checkboxes" property, default is False, on Object Inspecter. When change to True All item has a Checkbox and for acces that value, easy add extra glyph too
Code: [Select]
AItem : TListItem;
   AItem := LV_.Items.Add;
   AItem.Caption := C;
   AItem.Checked := I in P^.CheckedPerm;
/lazarus/examples/listview  has example in this folder

TChecklistbox has a bug (My idea)
1-)OnClick not working on my system x86_amd64 wheezy KDE 4.8.4 ang gtk2, but in kubuntu and ubuntu gtk2 OnClick event is working. this event hasto work when component clicked
2-)OnClickCheck not work. It hasto work when clcik to square box or keyboard pressed space, 'cos user try check or uncheck. And this event hasto ItemIndex Property, so clicked to which Item can find.
3-)OnItemClick event working ( Just :) ) This event works like my Second idea :) This event name can be "OnItemSelected"


 

TinyPortal © 2005-2018