mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-13 21:02:55 +02:00
git-svn-id: trunk@11587 -
This commit is contained in:
parent
04f56784d8
commit
9a4689733f
@ -47,10 +47,15 @@ var
|
||||
begin
|
||||
PrevValue := FValue;
|
||||
FValueChanged := True;
|
||||
|
||||
if Value <> PrevValue then FValueEmpty := False;
|
||||
|
||||
inherited;
|
||||
|
||||
DebugLn('TCustomFloatSpinEdit.TextChanged Text: ' + Text + ' Value: ' + DbgS(Value));
|
||||
|
||||
if Value <> PrevValue then
|
||||
begin
|
||||
FValueEmpty := False;
|
||||
|
||||
inherited;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomFloatSpinEdit.SetMaxValue(const AValue: Single);
|
||||
@ -144,13 +149,6 @@ begin
|
||||
SetInitialBounds(0, 0, 50, 23);
|
||||
end;
|
||||
|
||||
procedure TCustomFloatSpinEdit.EditingDone;
|
||||
begin
|
||||
Text := ValueToStr(FValue);
|
||||
|
||||
inherited EditingDone;
|
||||
end;
|
||||
|
||||
function TCustomFloatSpinEdit.GetLimitedValue(const AValue: Single): Single;
|
||||
begin
|
||||
Result := AValue;
|
||||
|
@ -3380,6 +3380,11 @@ begin
|
||||
ConnectSenderSignal(gCore, 'changed', @gtkchanged_editbox)
|
||||
else if ALCLObject is TCustomCheckbox then
|
||||
ConnectSenderSignal(gObject, 'toggled', @gtktoggledCB)
|
||||
{$IFDEF GTK2}
|
||||
// in gtk2 callback signal of SpinEdit is 'value-changed' (in gtk1- 'changed')
|
||||
else if ALCLObject is TCustomFloatSpinEdit then
|
||||
ConnectSenderSignal(gObject, 'value-changed', @gtkchanged_editbox)
|
||||
{$ENDIF}
|
||||
else
|
||||
ConnectSenderSignal(gObject, 'changed', @gtkchanged_editbox);
|
||||
end;
|
||||
|
@ -98,8 +98,13 @@ end;
|
||||
class function TGtkWSCustomFloatSpinEdit.GetValue(
|
||||
const ACustomFloatSpinEdit: TCustomFloatSpinEdit): single;
|
||||
begin
|
||||
Result:=gtk_spin_button_get_value_as_float(
|
||||
PGtkSpinButton(ACustomFloatSpinEdit.Handle));
|
||||
{$IFDEF GTK2}
|
||||
// developer.gnome.org/doc/API/2.2/gtk/GtkSpinButton.html:
|
||||
// "function gtk_spin_button_get_value_as_float is deprecated, use gtk_spin_button_get_value() instead"
|
||||
Result:=Single(gtk_spin_button_get_value(PGtkSpinButton(ACustomFloatSpinEdit.Handle)));
|
||||
{$ELSE}
|
||||
Result:=gtk_spin_button_get_value_as_float(PGtkSpinButton(ACustomFloatSpinEdit.Handle));
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
class procedure TGtkWSCustomFloatSpinEdit.SetSelStart(const ACustomEdit: TCustomEdit;
|
||||
|
@ -30,7 +30,7 @@ unit Spin;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, Controls, SysUtils, LCLType, LMessages, ClipBrd, StdCtrls;
|
||||
Classes, Controls, SysUtils, LCLType, LCLProc, LMessages, ClipBrd, StdCtrls;
|
||||
|
||||
type
|
||||
{ TCustomFloatSpinEdit }
|
||||
@ -62,7 +62,6 @@ type
|
||||
procedure Loaded; override;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
procedure EditingDone; override;
|
||||
function GetLimitedValue(const AValue: Single): Single;
|
||||
function ValueToStr(const AValue: Single): String;
|
||||
function StrToValue(const S: String): Single;
|
||||
|
Loading…
Reference in New Issue
Block a user