mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-08 23:39:05 +02:00
MG: removed ClientRectBugfix defines
git-svn-id: trunk@743 -
This commit is contained in:
parent
2d9e85e554
commit
7184c53542
@ -4374,49 +4374,52 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function TgtkObject.GetValue (Sender : TObject; data : pointer) : integer;
|
function TgtkObject.GetValue (Sender : TObject; data : pointer) : integer;
|
||||||
var
|
var
|
||||||
Handle : Pointer;
|
Handle : Pointer;
|
||||||
Year,Month,Day : Integer; //used for csCalendar
|
Year,Month,Day : Integer; //used for csCalendar
|
||||||
begin
|
begin
|
||||||
Result := 0; // default if nobody sets it
|
Result := 0; // default if nobody sets it
|
||||||
|
|
||||||
if Sender is TWinControl
|
if Sender is TWinControl then
|
||||||
then Assert(False, Format('Trace: [TgtkObject.GetValue] %s', [Sender.ClassName]))
|
Assert(False, Format('Trace: [TgtkObject.GetValue] %s', [Sender.ClassName]))
|
||||||
else Assert(False, Format('Trace:WARNING: [TgtkObject.GetValue] %s --> No Decendant of TWinControl', [Sender.ClassName]));
|
else
|
||||||
|
Assert(False, Format('Trace:WARNING: [TgtkObject.GetValue] %s --> No Decendant of TWinControl', [Sender.ClassName]));
|
||||||
|
|
||||||
Handle := Pointer(TWinControl(Sender).Handle);
|
Handle := Pointer(TWinControl(Sender).Handle);
|
||||||
Assert (Handle = nil, 'WARNING: [TgtkObject.GetValue] --> got nil pointer (no gtkobject)');
|
Assert (Handle = nil, 'WARNING: [TgtkObject.GetValue] --> got nil pointer (no gtkobject)');
|
||||||
|
|
||||||
case TControl(Sender).fCompStyle of
|
case TControl(Sender).fCompStyle of
|
||||||
csTrackbar :
|
csTrackbar :
|
||||||
if (handle <> nil) then begin
|
if (handle <> nil) then begin
|
||||||
integer(data^) := round(gtk_range_get_adjustment(
|
integer(data^) := round(gtk_range_get_adjustment(
|
||||||
GTK_RANGE (handle))^.value);
|
GTK_RANGE (handle))^.value);
|
||||||
end else
|
end else
|
||||||
integer(data^) := 0;
|
integer(data^) := 0;
|
||||||
|
|
||||||
|
|
||||||
csRadiobutton,
|
csRadiobutton,
|
||||||
csCheckbox : if gtk_toggle_button_get_active (PGtkToggleButton (handle))
|
csCheckbox :
|
||||||
then TCheckBoxState (data^) := cbChecked
|
if gtk_toggle_button_get_active (PGtkToggleButton (handle))
|
||||||
else TCheckBoxState (data^) := cbUnChecked;
|
then TCheckBoxState (data^) := cbChecked
|
||||||
|
else TCheckBoxState (data^) := cbUnChecked;
|
||||||
|
|
||||||
csCalendar :Begin
|
csCalendar :
|
||||||
gtk_calendar_get_date(PgtkCalendar(handle),@Year, @Month, @Day);
|
Begin
|
||||||
//TODO: account for local settings like date format
|
gtk_calendar_get_date(PgtkCalendar(handle),@Year, @Month, @Day);
|
||||||
//Form some reason, the month is zero based.
|
//TODO: account for local settings like date format
|
||||||
TLMCalendar(data^).Date := StrtoDate(Inttostr(Day)+'-'+Inttostr(Month+1)+'-'+Inttostr(Year));
|
//Form some reason, the month is zero based.
|
||||||
|
TLMCalendar(data^).Date :=
|
||||||
|
StrtoDate(Inttostr(Day)+'-'+Inttostr(Month+1)+'-'+Inttostr(Year));
|
||||||
|
end;
|
||||||
|
|
||||||
|
csSpinEdit :
|
||||||
|
Begin
|
||||||
|
Single(Data^):=gtk_spin_button_get_value_As_Float(PgtkSpinButton(Handle));
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
csSpinEdit : Begin
|
else
|
||||||
Single(Data^) := gtk_spin_button_get_value_As_Float(PgtkSpinButton(Handle));
|
Assert (true, Format ('WARNING:[TgtkObject.GetValue] failed for %s', [Sender.ClassName]));
|
||||||
|
end;
|
||||||
end;
|
|
||||||
|
|
||||||
else
|
|
||||||
Assert (true, Format ('WARNING:[TgtkObject.GetValue] failed for %s', [Sender.ClassName]));
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -5347,6 +5350,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.165 2002/08/17 15:45:34 lazarus
|
||||||
|
MG: removed ClientRectBugfix defines
|
||||||
|
|
||||||
Revision 1.164 2002/08/16 17:47:38 lazarus
|
Revision 1.164 2002/08/16 17:47:38 lazarus
|
||||||
MG: added some IDE menuicons, fixed submenu indicator bug
|
MG: added some IDE menuicons, fixed submenu indicator bug
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user