FormControlEditLink does not lose focus.

The same event as the link below is occurring.

https://www.tmssoftware.com/site/forum/forum_posts.asp?TID=6028&PID=22976&SID=3cbb6c46-aa8d-238abca4-9583c3az-z8fc43ac&title=formcontroleditlink-focus-retention#22976

Also, when TAdvEdit is focused, clicking the button does not execute the TAdvEdit OnExit event.
This behavior may cause an access violation or "Abnormal program teamination".

I'm using Windows 10 Pro(1703), C++ Builder 10.1 Berlin Update 2 and TMS Compnent Pack 8.8.4.1.
I also tried it with the latest version 8.8.7.0, but the result is the same.

http://www.tmssoftware.net/public/editlink_test.zip
I compiled in my environment, but it is the same result.

I'm in trouble. Please help me.



In this project, there is no handling of the TAdvEdit.OnExit, so it is unclear how you see this behavior.

When  I test this here with the latest version of TMS Component Pack 8.8.7.0, clicking the button1, shows the message dialog immediately, irrespective of what inplace editor is active.

I understood that there is no problem in your environment.

However, In my environment, clicking twice on button1 will display a message.

I did the following steps.
<br>Click cell[1][1]. Result: focus on AdvEdit1.<br>Click button1. Result: no message dialog<br>Click button1 again. Result: A message dialog is displayed.<br>

Obviously this is the same problem as past posting.

Also, if my teammate compiles "http://www.tmssoftware.net/public/editlink_test.zip" the same problem will occur.
(The project has been replaced by C++ builder from delphi.)

I have to solve this problem.
What should I do?

Can you double-check you effectively compile & link against the latest version of TAdvStringGrid?
Can you do a runtime version check and verify you effectively use v8.3.6.0 by check grid.VersionString?

__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
    Form1->Caption = AdvStringGrid1->VersionString;
}


Result: 8.3.6.0 Apr, 2018
Is this OK?

If there is anything else, please tell me the procedure.

Thank you in advance.

Can you reproduce this with the test project we compiled & tested here:

http://www.tmssoftware.net/public/EditLink_XE7.zip 

sorry. I don't have delphi.

> http://www.tmssoftware.net/public/EditLink_XE7.zip
I ported the code to C++ Builder 10.1 Berlin Update 2 and compiled it.

A problem occurred.

The EXE is included, can you please test our compiled app.

I ran the included EXE.
It worked without problems.

The only reason I can see for this is that you're not compiling with the same version as we do in our test.

What is the next thing I can do?
Is there any information you want?

As explained, the only reason I can see is that you compile / link with a different version.
Do you use runtime packages? If so, verify you are not loading an older runtime package.

Other than this, I cannot understand why you see a different behavior than we do. I can only suggest to retry to have a 100% clean setup of the latest version of the components.

I'm compiling without a runtime package.

I retested on a machine that I do not use for development.
Windows 10, clean install of C++ Builder 10.1 Berlin Update 2 and TMS Component pack 8.8.7.0.
The problem was reproduced on this machine.

The problem is not solved.
I created a new project and executed the following sample program. It has exactly the same result as "https://youtu.be/A2876lx6fdQ".
I compiled this program in multiple environments. All got the same result.
I think that it is a component bugs.

Thank you in advance.

<Unit1.dfm>
object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'Form1'
  ClientHeight = 462
  ClientWidth = 852
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object AdvStringGrid1: TAdvStringGrid
    Left = 56
    Top = 8
    Width = 400
    Height = 250
    Cursor = crDefault
    BiDiMode = bdLeftToRight
    ColCount = 3
    DrawingStyle = gdsClassic
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'Ta homa'
    Font.Style = []
    Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goFixedRowClick]
    ParentBiDiMode = False
    ParentFont = False
    ScrollBars = ssBoth
    TabOrder = 0
    HoverRowCells = [hcNormal, hcSelected]
    OnGetEditorType = AdvStringGrid1GetEditorType
    ActiveCellFont.Charset = DEFAULT_CHARSET
    ActiveCellFont.Color = clWindowText
    ActiveCellFont.Height = -11
    ActiveCellFont.Name = 'Tahoma'
    ActiveCellFont.Style = [fsBold]
    ColumnHeaders.Strings = (
      ''
      'Formcontroleditlink'
      'AdvEditEditLink')
    ControlLook.FixedGradientHoverFrom = clGray
    ControlLook.FixedGradientHoverTo = clWhite
    ControlLook.FixedGradientDownFrom = clGray
    ControlLook.FixedGradientDownTo = clSilver
    ControlLook.DropDownHeader.Font.Charset = DEFAULT_CHARSET
    ControlLook.DropDownHeader.Font.Color = clWindowText
    ControlLook.DropDownHeader.Font.Height = -11
    ControlLook.DropDownHeader.Font.Name = 'Tahoma'
    ControlLook.DropDownHeader.Font.Style = []
    ControlLook.DropDownHeader.Visible = True
    ControlLook.DropDownHeader.Buttons = <>
    ControlLook.DropDownFooter.Font.Charset = DEFAULT_CHARSET
    ControlLook.DropDownFooter.Font.Color = clWindowText
    ControlLook.DropDownFooter.Font.Height = -11
    ControlLook.DropDownFooter.Font.Name = 'Tahoma'
    ControlLook.DropDownFooter.Font.Style = []
    ControlLook.DropDownFooter.Visible = True
    ControlLook.DropDownFooter.Buttons = <>
    Filter = <>
    FilterDropDown.Font.Charset = DEFAULT_CHARSET
    FilterDropDown.Font.Color = clWindowText
    FilterDropDown.Font.Height = -11
    FilterDropDown.Font.Name = 'Tahoma'
    FilterDropDown.Font.Style = []
    FilterDropDown.TextChecked = 'Checked'
    FilterDropDown.TextUnChecked = 'Unchecked'
    FilterDropDownClear = '(All)'
    FilterEdit.TypeNames.Strings = (
      'Starts with'
      'Ends with'
      'Contains'
      'Not contain s'
      'Equal'
      'Not equal'
      'Larger than'
      'Smaller than'
      'Clear')
    FixedRowHeight = 22
    FixedFont.Charset = DEFAULT_CHARSET
    FixedFont.Color = clWindowText
    FixedFont.Height = -11
    FixedFont.Name = 'Tahoma'
    FixedFont.Style = [fsBold]
    FloatFormat = '%.2f'
    FocusHelper.Enabled = True
    HoverButtons.Buttons = <>
    HoverButtons.Position = hbLeftFromColumnLeft
    HTMLSettings.ImageFolder = 'images'
    HTMLSettings.ImageBaseName = 'img'
    MouseActions.DirectEdit = True
    PrintSettings.DateFormat = 'dd/mm/yyyy'
    PrintSettings.Font.Charset = DEFAULT_CHARSET
    PrintSettings.Font.Color = clWindowText
    PrintSettings.Font.Height = -11
    PrintSettings.Font.Name = 'Tahoma'
    PrintSettings.Font.Style = []
    PrintSettings.FixedFont.Charset = DEFAULT_CHARSET
    PrintSettings.FixedFont.Color = clWindowText
    PrintSettings.FixedFont.Height = -11
    PrintSettings.FixedFont.Name = 'Tahoma'
    PrintSettings.FixedFont.Style = []
    PrintSettings.HeaderFont.Charset = DEFAULT_CHARSET
    PrintSettings.HeaderFont.Color = clWindowText
    PrintSettings.HeaderFont.Height = -11
    PrintSettings.HeaderFont.Name = 'Tahoma'
    PrintSettings.HeaderFont.Style = []
    PrintSettings.FooterFont.Charset = DEFAULT_CHARSET
    PrintSettings.FooterFont.Color = clWindowText
    PrintSettings.FooterFont.Height = -11
    PrintSettings.FooterFont.Name = 'Tahoma'
    PrintSettings.FooterFont.Style = []
    PrintSettings.PageNumSep = '/'
    SearchFooter.FindNextCaption = 'Find &next'
    SearchFooter.FindPrevCaption = 'Find &previous'
    SearchFooter.Font.Charset = DEFAULT_CHARSET
    SearchFooter.Font.Color = clWindowText
    SearchFooter.Font.Height = -11
    SearchFooter.Font.Name = 'Tahoma'
    SearchFooter.Font.Style = []
    SearchFooter.HighLightCaption = 'Highlight'
    SearchFooter.HintClose = 'Close'
    SearchFooter.HintFindNext = 'Find next occurrence'
    SearchFooter.HintFindPrev = 'Find p revious occurrence'
    SearchFooter.HintHighlight = 'Highlight occurrences'
    SearchFooter.MatchCaseCaption = 'Match case'
    SearchFooter.ResultFormat = '(%d of %d)'
    SortSettings.DefaultFormat = ssAutomatic
    Version = '8.3.6.0'
    ColWidths = (
      64
      127
      126)
    RowHeights = (
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22)
  end
  object Button1: TButton
    Left = 72
    Top = 286
    Width = 75
    Height = 25
    Caption = 'Button1'
    TabOrder = 1
    OnClick = Button1Click
  end
  object AdvEdit1: TAdvEdit
    Left = 184
    Top = 288
    Width = 121
    Height = 21
    DefaultHandling = True
    EmptyTextStyle = []
    LabelFont.Charset = DEFAULT_CHARSET
    LabelFont.Color = clWindowText
    LabelFont.Height = -11
    LabelFont.Name = 'Tahoma'
    LabelFont.Style = []
    Lookup.Font.Charset = DEFAULT_CHARSET
    Lookup.Font.Color = clWindowText
    Lookup.Font.Height = -11
    Lookup.Font.Name = 'Arial'
    Lookup.Font.Style = []
    Lookup.Separator = ';'
    Color = clWindow
    TabOrder = 2
    Text = 'AdvEdit1'
    Visible = True
    Version = '3.4.5.5'
  end
  object FormControlEditLink1: TFormControlEditLink
    Tag = 0
    WantKeyLeftRight = False
    WantKeyUpDown = False
    WantKeyHomeEnd = False
    WantKeyPriorNext = False
    Control = AdvEdit1
    Left = 360
    Top = 280
  end
  object AdvEditEditLink1: TAdvEditEditLink
    Tag = 0
    WantKeyLeftRight = True
    WantKeyUpDown = False
    WantKeyHomeEnd = True
    WantKeyPriorNext = False
    EditAlign = eaLeft
    EditColor = clWindow
    MaxLength = 0
    ModifiedColor = clRed
    EditType = etString
    ShowModified = False
    Precision = 0
    Signed = False
    ExcelStyleDecimalSeparator = False
    Left = 416
    Top = 280
  end
end



<Unit1.cpp>
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "AdvEdit"
#pragma link "AdvGrid"
#pragma link "AdvObj"
#pragma link "AsgLinks"
#pragma link "BaseGrid"
#pragma link "frmctrllink"
#pragma link "AdvUtil"
#pragma resource "*.dfm"
TForm1 Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent
Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
    Form1->Caption = AdvStringGrid1->VersionString;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::AdvStringGrid1GetEditorType(TObject *Sender, int ACol, int ARow, TEditorType &AEditor)
{
    AEditor = edCustom;

    switch (ACol) {
        case 1:
            AdvStringGrid1->EditLink = FormControlEditLink1;
            break;
        case 2:
            AdvStringGrid1->EditLink = AdvEditEditLink1;
            break;
    default:
        ;
    }
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
    ShowMessage(L"clicked");
}
//---------------------------------------------------------------------------



<Unit1.h>
//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include "AdvEdit.hpp"
#include "AdvGrid.hpp"
#include "AdvObj.hpp"
#include "AsgLinks.hpp"
#include "BaseGrid.hpp"
#include "frmctrllink.hpp"
#include <Vcl.Grids.hpp>
#include "AdvUtil.hpp"
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:    // IDE で管理されるコンポーネント
    TAdvStringGrid *AdvStringGrid1;
    TButton *Button1;
    TAdvEdit *AdvEdit1;
    TFormControlEditLink *FormControlEditLink1;
    TAdvEditEditLink *AdvEditEditLink1;
    void __fastcall FormCreate(TObject *Sender);
    void __fastcall AdvStringGrid1GetEditorType(TObject *Sender, int ACol, int ARow, TEditorType &AEditor);
    void __fastcall Button1Click(TObject Sender);
private:    // ユーザー宣言
public:        // ユーザー宣言
    __fastcall TForm1(TComponent
Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

We got your email and we will followup via email.

We can still not reproduce this with our latest internal version. We will release an update May 2 and I would suggest to test with the update.

Hello,


Can i have an exemple to use edCustom with TAdvStringGrid of using TCheckListBox in c++ ??

Thanks

As you sent the same question via email, it was answered via email.