summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/gui_combobox.pas2
-rw-r--r--src/gui/gui_grid.pas25
-rw-r--r--src/gui/gui_popupcalendar.pas14
3 files changed, 32 insertions, 9 deletions
diff --git a/src/gui/gui_combobox.pas b/src/gui/gui_combobox.pas
index 930bd551..1ad527ea 100644
--- a/src/gui/gui_combobox.pas
+++ b/src/gui/gui_combobox.pas
@@ -483,6 +483,8 @@ end;
destructor TfpgAbstractComboBox.Destroy;
begin
+ if Assigned(FDropDown) then
+ FDropDown.Free;
FItems.Free;
FFont.Free;
inherited Destroy;
diff --git a/src/gui/gui_grid.pas b/src/gui/gui_grid.pas
index d764d241..5be33147 100644
--- a/src/gui/gui_grid.pas
+++ b/src/gui/gui_grid.pas
@@ -782,13 +782,34 @@ begin
end;
procedure TfpgCustomStringGrid.DrawCell(ARow, ACol: integer; ARect: TfpgRect;
- AFlags: integer);
+ AFlags: integer);
+var
+ x: TfpgCoord;
begin
if Cells[ACol, ARow] <> '' then
begin
if not Enabled then
Canvas.SetTextColor(clShadow1);
- Canvas.DrawString(ARect.Left+1, ARect.Top+1, Cells[ACol, ARow]);
+
+ case Columns[ACol].Alignment of
+ taLeftJustify:
+ begin
+ x := ARect.Left + 1;
+ end;
+ taCenter:
+ begin
+ x := (ARect.Width - Font.TextWidth(Cells[ACol, ARow])) div 2;
+ Inc(x, ARect.Left);
+ end;
+ taRightJustify:
+ begin
+ x := ARect.Right - Font.TextWidth(Cells[ACol, ARow]) - 1;
+ if x < (ARect.Left + 1) then
+ x := ARect.Left + 1;
+ end;
+ end; { case }
+
+ Canvas.DrawString(x, ARect.Top+1, Cells[ACol, ARow]);
end;
end;
diff --git a/src/gui/gui_popupcalendar.pas b/src/gui/gui_popupcalendar.pas
index 53b9e215..4e90c4a5 100644
--- a/src/gui/gui_popupcalendar.pas
+++ b/src/gui/gui_popupcalendar.pas
@@ -569,13 +569,13 @@ begin
begin
Name := 'grdName1';
SetPosition(0, 23, 233, 119);
- AddColumn('Mon', 33, taLeftJustify);
- AddColumn('Tue', 32, taLeftJustify);
- AddColumn('Wed', 33, taLeftJustify);
- AddColumn('Thu', 32, taLeftJustify);
- AddColumn('Fri', 33, taLeftJustify);
- AddColumn('Sat', 32, taLeftJustify);
- AddColumn('Sun', 33, taLeftJustify);
+ AddColumn('Mon', 33, taCenter);
+ AddColumn('Tue', 32, taCenter);
+ AddColumn('Wed', 33, taCenter);
+ AddColumn('Thu', 32, taCenter);
+ AddColumn('Fri', 33, taCenter);
+ AddColumn('Sat', 32, taCenter);
+ AddColumn('Sun', 33, taCenter);
FontDesc := '#Grid';
HeaderFontDesc := '#GridHeader';
RowCount := 6;