Recent

Author Topic: [Solved] TValueListEditor controling when user try to edit a value?  (Read 2697 times)

BlueIcaro

  • Hero Member
  • *****
  • Posts: 793
    • Blog personal
Hi, I want to use a TValueListEditor on my program. But when User wants edit a value, I want to use my custom editor.
For example:
If user wants edit a value, when he clicks on value box, I'll show a modal form, when the user can write/edit the value. Then write back the value to the TValueListEditor
How can I do it?
« Last Edit: April 02, 2018, 02:27:03 pm by BlueIcaro »

Blaazen

  • Hero Member
  • *****
  • Posts: 3240
  • POKE 54296,15
    • Eye-Candy Controls
Re: TValueListEditor controling when user try to edit a value?
« Reply #1 on: March 25, 2018, 05:36:06 pm »
Common custom cell editors, like edit, combo etc. are implemented using OnSelectEditor event (TValueEditor is TCustomStringGrid descendant). I never tried dialog (modal form) but I should try to hook in that event.
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/

wp

  • Hero Member
  • *****
  • Posts: 11917
Re: TValueListEditor controling when user try to edit a value?
« Reply #2 on: March 25, 2018, 05:46:20 pm »
It is the same as TStringGrid. Read the grids documentation: http://wiki.lazarus.freepascal.org/Grids_Reference_Page#Builtin_cell_editors

A working example is in the attachment.

BlueIcaro

  • Hero Member
  • *****
  • Posts: 793
    • Blog personal
Re: TValueListEditor controling when user try to edit a value?
« Reply #3 on: April 02, 2018, 02:26:47 pm »
It is the same as TStringGrid. Read the grids documentation: http://wiki.lazarus.freepascal.org/Grids_Reference_Page#Builtin_cell_editors

A working example is in the attachment.
Thanks, It's works as I excepted

/BlueIcaro

 

TinyPortal © 2005-2018