Einzelnen Beitrag anzeigen

MoziGut

Registriert seit: 4. Feb 2014
21 Beiträge
 
#4

AW: Focus richtig setzten?

  Alt 2. Apr 2014, 13:29
Ich lasse das Panel mit einer Swipefunkttion öffnen. Und dann hab ich dort das Calloutpanel mit zwei Buttons. Und nein ich habe dann nicht den direkten Focus auf die Buttons. ICh muss immer zwei mal Drücken...


Delphi-Quellcode:
begin
  if EventInfo.GestureID = sgiLeft then

  begin

    I := strtoint(ListBox1.Selected.itemdata.detail);

    if scall = False then

      inf := TCalloutPanel.Create(Self);

    inf.Parent := ListBox1.Selected;
    inf.Height := 60;
    inf.Width := ListBox1.Width;
    inf.CalloutLength := 0;
    inf.Position.Y := 0;
    inf.Visible := true;
    scall := true;

    btn1 := TButton.Create(Self);
    btn1.Parent := inf;
    btn1.Text := 'Edit';
    btn1.Height := 40;
    btn1.Cursor := crHandPoint;
    btn1.Width := 120;
    btn1.Position.Y := 5;
    btn1.Position.X := 20;
    btn1.Visible := true;
    btn1.Enabled := true;
    btn1.OnClick := editbutton;

    btn2 := TButton.Create(Self);
    btn2.Parent := inf;
    btn2.Text := 'Löschen';
    btn2.Height := 40;
    btn2.Cursor := crHandPoint;
    btn2.Width := 120;
    btn2.Position.Y := 5;
    btn2.Position.X := ListBox1.Width - 140;
    btn2.Visible := true;
    btn2.Enabled := true;
    btn2.OnClick := deletebutton;

  end
  else
  begin
  if EventInfo.GestureID = sgiright then
  begin
  Form2.Show;
  end;
  end;

end;
Bei "deletbutton" und "editbutton" sind normale Events hinterlegt!
  Mit Zitat antworten Zitat