diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-07-14 16:46:46 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-07-14 16:46:46 +0000 |
commit | 9432daf804c88f04f20f89773fd0efdcbe89e360 (patch) | |
tree | 59039315145732b1dd965994a5b8f29ba7a07db3 /src/gui | |
parent | ccbce7ba60305b5438c3ac6311d39374ee2a0e55 (diff) | |
download | fpGUI-9432daf804c88f04f20f89773fd0efdcbe89e360.tar.xz |
* Applied some of the various patch from Jean-Marc.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui_edit.pas | 6 | ||||
-rw-r--r-- | src/gui/gui_editcombo.pas | 15 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/gui/gui_edit.pas b/src/gui/gui_edit.pas index 4be59540..19281258 100644 --- a/src/gui/gui_edit.pas +++ b/src/gui/gui_edit.pas @@ -339,7 +339,7 @@ begin Result.Top := y; Result.Width := w; Result.ShowThousand:= AShowThousand; -// Result.Decimals := ADecimals; + Result.Decimals := ADecimals; if h < TfpgEditFloat(Result).FFont.Height + 6 then Result.Height:= TfpgEditFloat(Result).FFont.Height + 6 else @@ -1752,10 +1752,10 @@ begin fText := fText + DecimalSeparator; if UTF8Length(fText)-Pos(DecimalSeparator, fText) < fDecimals then while UTF8Length(fText)-Pos(DecimalSeparator, fText) < fDecimals do - begin + begin fText := fText + '0'; Inc(FCursorPos); - end; + end; end; end; inherited HandleKeyPress(keycode,shiftstate,consumed); diff --git a/src/gui/gui_editcombo.pas b/src/gui/gui_editcombo.pas index 96d2188f..36c87633 100644 --- a/src/gui/gui_editcombo.pas +++ b/src/gui/gui_editcombo.pas @@ -129,8 +129,8 @@ type end; -function CreateEditCombo(AOwner: TComponent; x, y, w: TfpgCoord; AList:TStringList; - h: TfpgCoord = 0): TfpgEditCombo; +function CreateEditCombo(AOwner: TComponent; x, y, w: TfpgCoord; AList:TStringList; ACompletion: boolean = False; + ANew: TAllowNew = anNo; h: TfpgCoord = 0): TfpgEditCombo; implementation @@ -225,14 +225,16 @@ begin ListBox.PopupFrame := True; end; -function CreateEditCombo(AOwner: TComponent; x, y, w: TfpgCoord; AList: TStringList; - h: TfpgCoord = 0): TfpgEditCombo; +function CreateEditCombo(AOwner: TComponent; x, y, w: TfpgCoord; AList:TStringList; ACompletion: boolean = False; + ANew: TAllowNew = anNo; h: TfpgCoord = 0): TfpgEditCombo; begin Result := TfpgEditCombo.Create(AOwner); Result.Left := x; Result.Top := y; Result.Width := w; Result.Focusable := True; + Result.AutoCompletion := ACompletion; + Result.AllowNew := ANew; if h < TfpgEditCombo(Result).Font.Height + 6 then Result.Height:= TfpgEditCombo(Result).Font.Height + 6 else @@ -528,7 +530,10 @@ begin FItems.Add(FText); anAsk: if TfpgMessageDialog.Question(rsNewItemDetected, Format(rsAddNewItem, [FText])) = mbYes then - FItems.Add(FText) + begin + FItems.Add(FText); + FocusItem := Pred(FItems.Count); + end else begin FNewItem:= False; |