mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 18:58:04 +02:00
Merged revision(s) 61053 #6096106179, 61740 #563a44c1d6, 61945-61947 #96eee65d5d-#96eee65d5d, 62031 #9cad1b3feb from trunk:
LCL: Handle mouse events through shaped TWinControl. Issue #35270, patch from ptvs. ........ lcl, fix TDbgrid wrong width of first column if FixedCells>1 and dgIndicator is turned off, issue #35716 ........ LCL: override TSpinEdit.GetLimitedValue so it cannot return values outside the integer range. Issue #0032793. ........ LCL: fix crash in TStringGrid.InsertRowWithValues is Columns.Enabled is True. Issue #0036067 ........ LCL: fix TTaskDialog.ModalResult if closebutton (in CommonButtons) is clicked. Issue #0036069. ........ LCL/grids: Fix misplaced horizontal grid scrollbar after form maximize. Issue #35472, patch by Pavol S. ........ git-svn-id: branches/fixes_2_0@62082 -
This commit is contained in:
parent
4455557d6e
commit
1583512c04
@ -2536,7 +2536,7 @@ function TCustomGrid.GetColWidths(Acol: Integer): Integer;
|
||||
var
|
||||
C: TGridColumn;
|
||||
begin
|
||||
if not Columns.Enabled or (aCol<FixedCols) then
|
||||
if not Columns.Enabled or (aCol<FirstGridColumn) then
|
||||
begin
|
||||
if (aCol<ColCount) and (aCol>=0) then
|
||||
Result:=FCols[aCol]
|
||||
@ -7798,14 +7798,17 @@ end;
|
||||
|
||||
procedure TCustomGrid.UpdateHorzScrollBar(const aVisible: boolean;
|
||||
const aRange,aPage,aPos: Integer);
|
||||
var
|
||||
NeedUpdate: Boolean;
|
||||
begin
|
||||
{$ifdef DbgScroll}
|
||||
DebugLn('TCustomGrid.UpdateHorzScrollbar: Vis=%s Range=%d Page=%d aPos=%d',
|
||||
[dbgs(aVisible),aRange, aPage, aPos]);
|
||||
{$endif}
|
||||
if FHSbVisible<>Ord(aVisible) then
|
||||
NeedUpdate := FHSbVisible <> Ord(AVisible);
|
||||
if NeedUpdate then
|
||||
ScrollBarShow(SB_HORZ, aVisible);
|
||||
if aVisible then
|
||||
if aVisible or NeedUpdate then
|
||||
ScrollBarRange(SB_HORZ, aRange, aPage, aPos);
|
||||
end;
|
||||
|
||||
@ -11673,11 +11676,19 @@ end;
|
||||
procedure TCustomStringGrid.InsertRowWithValues(Index: Integer;
|
||||
Values: array of String);
|
||||
var
|
||||
i, OldRC: Integer;
|
||||
i, OldRC, Diff: Integer;
|
||||
begin
|
||||
OldRC := RowCount;
|
||||
if Length(Values) > ColCount then
|
||||
ColCount := Length(Values);
|
||||
Diff := Length(Values) - ColCount;
|
||||
if Diff > 0 then
|
||||
begin
|
||||
if Columns.Enabled then
|
||||
begin
|
||||
for i := 1 to Diff do with Columns.Add do Title.Caption := '';
|
||||
end
|
||||
else
|
||||
ColCount := Length(Values);
|
||||
end;
|
||||
InsertColRow(false, Index);
|
||||
//if RowCount was 0, then setting ColCount restores RowCount (from FGridPropBackup)
|
||||
//which is unwanted here, so reset it (Issue #0026943)
|
||||
|
@ -272,4 +272,14 @@ begin
|
||||
FDecimals := 0;
|
||||
end;
|
||||
|
||||
function TCustomSpinEdit.GetLimitedValue(const AValue: Double): Double;
|
||||
begin
|
||||
//The WS may call this function for both TSpinEdit and TFloatSPinEdit, so we cannot change signature to have integer parameters
|
||||
Result := inherited GetLimitedValue(AValue);
|
||||
if Result > MaxInt then
|
||||
Result := MaxInt;
|
||||
if Result < Low(Integer) then
|
||||
Result := Low(Integer);
|
||||
end;
|
||||
|
||||
// included by spin.pp
|
||||
|
@ -99,7 +99,19 @@ function TCustomTaskDialog.ButtonIDToModalResult(const AButtonID: Integer
|
||||
): TModalResult;
|
||||
begin
|
||||
if AButtonID<100 then
|
||||
Result := AButtonID
|
||||
begin
|
||||
case AButtonID of
|
||||
IDOK: Result := mrOK;
|
||||
IDCANCEL: Result := mrCancel;
|
||||
IDABORT: Result := mrAbort;
|
||||
IDRETRY: Result := mrRetry;
|
||||
IDIGNORE: Result := mrIgnore;
|
||||
IDYES: Result := mrYes;
|
||||
IDNO: Result := mrNo;
|
||||
IDCLOSE: Result := mrClose;
|
||||
else Result := AButtonID
|
||||
end;
|
||||
end
|
||||
else if (AButtonID-100<Buttons.Count) then
|
||||
Result := Buttons[AButtonID-100].ModalResult
|
||||
else
|
||||
|
@ -4709,15 +4709,7 @@ begin
|
||||
else
|
||||
begin
|
||||
// do query wincontrol children, in case they overlap
|
||||
Control := ControlAtPos(SmallPointToPoint(MouseMessage.Pos),
|
||||
[capfAllowWinControls]);
|
||||
if Control is TWinControl then
|
||||
begin
|
||||
// there is a TWinControl child at this position
|
||||
// TWinControl children get their own messages
|
||||
// => ignore here
|
||||
Control := nil;
|
||||
end;
|
||||
Control := ControlAtPos(SmallPointToPoint(MouseMessage.Pos), []);
|
||||
end;
|
||||
|
||||
//DebugLn(['TWinControl.IsControlMouseMsg B ',DbgSName(Self),' Control=',DbgSName(Control),' Msg=',TheMessage.Msg]);
|
||||
|
@ -446,7 +446,7 @@ end;
|
||||
|
||||
const
|
||||
TD_BTNMOD: array[TCommonButton] of Integer = (
|
||||
mrOk, mrYes, mrNo, mrCancel, mrRetry, mrAbort);
|
||||
mrOk, mrYes, mrNo, mrCancel, mrRetry, mrClose);
|
||||
|
||||
function TD_BTNS(button: TCommonButton): pointer;
|
||||
begin
|
||||
|
@ -144,6 +144,7 @@ type
|
||||
procedure SetValue(const AValue: integer); overload; virtual;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
function GetLimitedValue(const AValue: Double): Double; override;
|
||||
public
|
||||
property Value: integer read GetValue write SetValue default 0;
|
||||
property MinValue: integer read GetMinValue write SetMinValue default 0;
|
||||
|
Loading…
Reference in New Issue
Block a user