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