anchor.diff:      function    GetText: string; virtual;
       function    HasText: boolean; virtual;
       procedure   SetText(const AValue: string); virtual;
  +    procedure   ShowDefaultPopupMenu(const x, y: integer; const shiftstate: TShiftState); virtual;
       procedure   HandleResize(AWidth, AHeight: TfpgCoord); override;
       procedure   HandleKeyChar(var AText: TfpgChar; var shiftstate: TShiftState; var consumed: Boolean); override;
       procedure   HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: Boolean); override;
       procedure   HandleLMouseDown(x, y: integer; shiftstate: TShiftState); override;
       procedure   HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override;
  +    procedure   HandleRMouseDown(x, y: integer; shiftstate: TShiftState); override;
  +    procedure   HandleRMouseUp(x, y: integer; shiftstate: TShiftState); override;
       procedure   HandlePaint; override;
       property    AutoCompletion: Boolean read FAutocompletion write FAutoCompletion default False;
       property    AllowNew: TAllowNew read FAllowNew write SetAllowNew default anNo;
  
positive.code:   PaintInternalButton;
  end;
  
  procedure TfpgBaseEditCombo.HandlePaint;
  var
    r: TfpgRect;
  
negative.code:   Repaint;
  end;
  
  procedure TfpgBaseEditCombo.DefaultPopupInsertFromCharmap(Sender: TObject);
  var
    s: TfpgString;
  begin
    if FAllowNew= anNo then
      Exit;
    s := fpgShowCharMap;
    if s <> '' then
      //SetText(s);
      DoPaste(s);
  end;
  
  procedure TfpgBaseEditCombo.DoPaste(const AText: TfpgString);
  var
    s: string;
    prevval: TfpgString;
    i: integer;
  begin
    prevval := FText;
    s := AText;
      if (FMaxLength <= 0) or (UTF8Length(FText) < FMaxLength) then
      begin
        UTF8Insert(s, FText, FCursorPos + UTF8Length(s));
        Inc(FCursorPos);
        FSelStart := FCursorPos;
        if Assigned(FDropDown) then
          FDropDown.Close;
        FSelectedItem := -1;
        for i := 0 to FItems.Count-1 do
          if SameText(UTF8Copy(FItems.Strings[i], 1, UTF8Length(FText)), FText) then
          begin
            FSelectedItem:= i;
            DoDropDown;
            Break;
          end;
        if FSelectedItem = -1 then
          FNewItem:= True;
      end;
    Repaint;
    if prevval <> Text then
      DoOnChange;
  end;
  
  procedure TfpgBaseEditCombo.SetDefaultPopupMenuItemsState;
  var
    i: integer;
    itm: TfpgMenuItem;
  begin
    //for i := 0 to FDefaultPopupMenu.ComponentCount-1 do
    //begin
    //  if FDefaultPopupMenu.Components[i] is TfpgMenuItem then
    //  begin
    //    itm := TfpgMenuItem(FDefaultPopupMenu.Components[i]);
    //    // enabled/disable menu items
    //    if itm.Name = ipmCut then
    //      itm.Enabled := (not ReadOnly) and (FSelOffset <> 0)
    //    else if itm.Name = ipmCopy then
    //      itm.Enabled := FSelOffset <> 0
    //    else if itm.Name = ipmPaste then
    //      itm.Enabled := (not ReadOnly) and (fpgClipboard.Text <> '')
    //    else if itm.Name = ipmClearAll then
    //      itm.Enabled := (not ReadOnly) and (Text <> '')
    //    else if itm.Name = ipmCharmap then
    //      itm.Enabled := (not ReadOnly);
    //  end;
    //end;
  end;
  
  procedure TfpgBaseEditCombo.SetText(const AValue: string);
  var
    i: integer;
  