tvplanit: Fix some translation-related layout issues in several forms. Add missing resourcestrings. Fix trask items being painted with task header font.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4708 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-06-10 16:12:14 +00:00
parent d5bbf9165c
commit b703a9f89e
12 changed files with 104 additions and 70 deletions

View File

@ -249,10 +249,6 @@ msgstr "Firma"
msgid "Company:"
msgstr "Firma:"
#: vpsr.rscomplete
msgid "Task complete"
msgstr "Aufgabe fertiggestellt"
#: vpsr.rscompletedon
msgid "Completed on"
msgstr "Fertiggestellt am"
@ -427,6 +423,15 @@ msgstr "Ereignis"
msgid "Print Preview"
msgstr "Druckvorschau"
#: vpsr.rsdlgreseditcaption
msgid "Resource Edit"
msgstr "Ressource bearbeiten"
#: vpsr.rsdlgreseditdescription
msgctxt "vpsr.rsdlgreseditdescription"
msgid "Description"
msgstr "Beschreibung"
#: vpsr.rsdlgtaskedit
msgid "Task"
msgstr "Aufgabe"
@ -851,6 +856,10 @@ msgstr "Termin-Wiederholung:"
msgid "Reminder"
msgstr "Erinnerung"
#: vpsr.rsresource
msgid "Resource"
msgstr "Ressource"
#: vpsr.rssaturday
msgid "Saturday"
msgstr "Samstag"
@ -900,6 +909,11 @@ msgstr "Sonntag"
msgid "Wy"
msgstr "Wy"
#: vpsr.rstaskcomplete
msgctxt "vpsr.rstaskcomplete"
msgid "Task complete"
msgstr "Aufgabe fertiggestellt"
#: vpsr.rstaskpopupadd
msgid "Add Task..."
msgstr "Aufgabe hinzufügen..."

View File

@ -239,10 +239,6 @@ msgstr ""
msgid "Company:"
msgstr ""
#: vpsr.rscomplete
msgid "Task complete"
msgstr ""
#: vpsr.rscompletedon
msgid "Completed on"
msgstr ""
@ -417,6 +413,15 @@ msgstr ""
msgid "Print Preview"
msgstr ""
#: vpsr.rsdlgreseditcaption
msgid "Resource Edit"
msgstr ""
#: vpsr.rsdlgreseditdescription
msgctxt "vpsr.rsdlgreseditdescription"
msgid "Description"
msgstr ""
#: vpsr.rsdlgtaskedit
msgid "Task"
msgstr ""
@ -841,6 +846,10 @@ msgstr ""
msgid "Reminder"
msgstr ""
#: vpsr.rsresource
msgid "Resource"
msgstr ""
#: vpsr.rssaturday
msgid "Saturday"
msgstr ""
@ -890,6 +899,11 @@ msgstr ""
msgid "Wy"
msgstr ""
#: vpsr.rstaskcomplete
msgctxt "vpsr.rstaskcomplete"
msgid "Task complete"
msgstr ""
#: vpsr.rstaskpopupadd
msgid "Add Task..."
msgstr ""

View File

@ -359,26 +359,6 @@ end;
{=====}
procedure TContactEditForm.ResizeControls;
function GetLabelWidth (ALabel : TLabel) : Integer;
var
OldFont : TFont;
begin
OldFont := TFont.Create;
try
OldFont.Assign (Canvas.Font);
try
Canvas.Font.Assign (ALabel.Font);
Result := Canvas.TextWidth (ALabel.Caption);
finally
Canvas.Font.Assign (OldFont);
end;
finally
OldFont.Free;
end;
end;
const
ComboArrowWidth = 32;
FieldVertSep = 25;

View File

@ -39,10 +39,10 @@ object DlgEventEdit: TDlgEventEdit
ParentFont = False
end
object OKBtn: TButton
Left = 509
Left = 528
Height = 25
Top = 8
Width = 85
Width = 75
Anchors = [akTop, akRight]
Caption = '&OK'
Default = True
@ -51,10 +51,10 @@ object DlgEventEdit: TDlgEventEdit
TabStop = False
end
object CancelBtn: TButton
Left = 602
Left = 608
Height = 25
Top = 8
Width = 85
Width = 75
Anchors = [akTop, akRight]
Cancel = True
Caption = '&Cancel'
@ -70,7 +70,7 @@ object DlgEventEdit: TDlgEventEdit
Width = 679
Anchors = [akTop, akLeft, akRight]
Caption = 'Appointment'
ClientHeight = 199
ClientHeight = 198
ClientWidth = 675
TabOrder = 0
object DescriptionLbl: TLabel
@ -290,7 +290,7 @@ object DlgEventEdit: TDlgEventEdit
end
object StartTime: TComboBox
Left = 231
Height = 22
Height = 23
Top = 104
Width = 93
ItemHeight = 15
@ -300,7 +300,7 @@ object DlgEventEdit: TDlgEventEdit
end
object EndTime: TComboBox
Left = 231
Height = 22
Height = 23
Top = 131
Width = 93
ItemHeight = 15
@ -321,7 +321,7 @@ object DlgEventEdit: TDlgEventEdit
end
object RecurringType: TComboBox
Left = 379
Height = 22
Height = 23
Top = 104
Width = 187
ItemHeight = 15
@ -344,7 +344,7 @@ object DlgEventEdit: TDlgEventEdit
end
object AlarmAdvType: TComboBox
Left = 231
Height = 22
Height = 23
Top = 167
Width = 93
ItemHeight = 15

View File

@ -39,7 +39,7 @@ uses
{$ELSE}
Windows, Consts,
{$ENDIF}
Buttons, Classes, Controls, ExtCtrls, Forms, Graphics, Messages,
Buttons, Classes, Controls, StdCtrls, ExtCtrls, Forms, Graphics, Messages,
SysUtils, VpBase, VpData, VpConst;
type
@ -127,6 +127,8 @@ function LineToStartTime(Line: Integer; Granularity: TVpGranularity): TDateTime;
function GetLineDuration(Granularity: TVpGranularity): Double;
function GetLabelWidth(ALabel : TLabel) : Integer;
implementation
uses
@ -576,4 +578,15 @@ begin
end;
{=====}
function GetLabelWidth(ALabel : TLabel) : Integer;
var
canvas: TControlCanvas;
begin
canvas := TControlCanvas.Create;
canvas.Control := ALabel;
Result := canvas.TextWidth(ALabel.Caption);
canvas.Free;
end;
end.

View File

@ -60,7 +60,7 @@ object ResEditForm: TResEditForm
TabOrder = 0
object tabResource: TTabSheet
Caption = 'Resource'
ClientHeight = 182
ClientHeight = 181
ClientWidth = 392
object lblDescription: TLabel
Left = 8
@ -122,7 +122,7 @@ object ResEditForm: TResEditForm
end
object NotesMemo: TMemo
Left = 8
Height = 103
Height = 102
Top = 67
Width = 374
Anchors = [akTop, akLeft, akRight, akBottom]

View File

@ -98,6 +98,9 @@ implementation
{$R *.dfm}
{$ENDIF}
uses
vpSR, vpMisc;
function ExecuteResourceDlg(Resource: TVpResource): Boolean;
var
EditForm: TResEditForm;
@ -196,6 +199,17 @@ procedure TResEditForm.PopulateSelf;
begin
DescriptionEdit.Text := Resource.Description;
NotesMemo.Text := Resource.Notes;
Caption := RSDlgResEditCaption;
tabResource.Caption := RSResource;
lblDescription.Caption := RSDlgResEditDescription;
lblNotes.Caption := RSNotes;
OKBtn.Caption := RSOKBtn;
CancelBtn.Caption := RSCancelBtn;
DescriptionEdit.Left := lblDescription.Left + GetLabelWidth(lblDescription) + 8;
DescriptionEdit.Width := imgResources.Left - 16 - DescriptionEdit.Left;
end;
{=====}

View File

@ -252,11 +252,16 @@ resourcestring
RSDlgTaskEdit = 'Task';
RSDueDate = 'Due Date:';
RSDetails = 'Details:';
RSComplete = 'Task complete';
RSTaskComplete = 'Task complete';
RSDaysOverdue = ' Days overdue';
RSCreatedOn = 'Created on';
RSCompletedOn = 'Completed on';
{ Resource Edit Dialog Captions }
RSDlgResEditCaption = 'Resource Edit';
RSDlgResEditDescription = 'Description';
RSResource = 'Resource';
{ Reminder Dialog Captions}
RSReminder = 'Reminder';
RSOverdue = 'OVERDUE!';
@ -273,28 +278,6 @@ resourcestring
RS1Day = '1 day';
RSXDays = '%d days';
RS1Week = '1 week';
{
RS5Minutes = '5 Minutes';
RS10Minutes = '10 Minutes';
RS15Minutes = '15 Minutes';
RS30Minutes = '30 Minutes';
RS45Minutes = '45 Minutes';
RS1Hour = '1 Hour';
RS2Hours = '2 Hours';
RS3Hours = '3 Hours';
RS4Hours = '4 Hours';
RS5Hours = '5 Hours';
RS6Hours = '6 Hours';
RS7Hours = '7 Hours';
RS8Hours = '8 Hours';
RS1Days = '1 Day';
RS2Days = '2 Days';
RS3Days = '3 Days';
RS4Days = '4 Days';
RS5Days = '5 Days';
RS6Days = '6 Days';
RS1Week = '1 Week';
}
{ Calendar }
RSCalendarPrevMonth = 'Previous Month';

View File

@ -74,7 +74,7 @@ object TaskEditForm: TTaskEditForm
TabOrder = 0
object tabTask: TTabSheet
Caption = 'Task'
ClientHeight = 276
ClientHeight = 275
ClientWidth = 539
object DueDateLbl: TLabel
Left = 52
@ -94,7 +94,7 @@ object TaskEditForm: TTaskEditForm
ParentColor = False
end
object CompletedOnLbl: TLabel
Left = 313
Left = 333
Height = 15
Top = 69
Width = 79
@ -227,7 +227,7 @@ object TaskEditForm: TTaskEditForm
Transparent = True
end
object imgCompleted: TImage
Left = 272
Left = 290
Height = 32
Top = 38
Width = 32
@ -269,16 +269,16 @@ object TaskEditForm: TTaskEditForm
Text = 'DescriptionEdit'
end
object CompleteCB: TCheckBox
Left = 313
Left = 333
Height = 19
Top = 41
Top = 43
Width = 72
Caption = 'Complete'
TabOrder = 2
end
object DetailsMemo: TMemo
Left = 4
Height = 147
Height = 146
Top = 96
Width = 529
Anchors = [akTop, akLeft, akRight, akBottom]

View File

@ -105,6 +105,9 @@ type
implementation
uses
VpMisc;
{$IFDEF LCL}
{$R *.lfm}
{$ELSE}
@ -132,6 +135,7 @@ end;
procedure TTaskEditForm.PopulateSelf;
begin
ResourceNameLbl.Caption := Resource.Description;
CompleteCB.Caption := RSTaskComplete;
DueDateLbl.Caption := RSDueDate;
OKBtn.Caption := RSOKBtn;
CancelBtn.Caption := RSCancelBtn;
@ -148,6 +152,8 @@ begin
CompletedOnLbl.Visible := CompleteCB.Checked;
CreatedOnLbl.Caption := RSCreatedOn + ' ' +
FormatDateTime(ShortDateFormat, Task.CreatedOn);
DueDateEdit.Left := DueDateLbl.Left + GetLabelWidth(DueDateLbl) + 8;
end;
{=====}

View File

@ -902,6 +902,7 @@ var
end;
end;
RenderCanvas.Font.Assign(Font);
for I := StartLine to pred(tlAllTaskList.Count) do begin
Task := tlAllTaskList[I];
if (LineRect.Top + Trunc(RowHeight * 0.5) <= RealBottom) then begin
@ -996,15 +997,19 @@ var
HeadRect.Bottom := RealTop + RenderCanvas.TextHeight ('YyGg0') +
TextMargin * 2;
TPSFillRect (RenderCanvas, Angle, RenderIn, HeadRect);
{ draw the header cell borders }
if FDrawingStyle = dsFlat then begin
{ draw an outer and inner bevel }
{ wp: no bevel in flat style!
HeadRect.Left := HeadRect.Left - 1;
HeadRect.Top := HeadRect.Top - 1;
DrawBevelRect (RenderCanvas,
TPSRotateRectangle (Angle, RenderIn, HeadRect),
BevelShadow,
BevelShadow);
}
end else if FDrawingStyle = ds3d then begin
{ draw a 3d bevel }
HeadRect.Right := HeadRect.Right - 1;
@ -1035,6 +1040,7 @@ var
Bmp.Free;
end;
end;
{ draw the text }
if ShowResourceName
and (DataStore <> nil)

View File

@ -1039,6 +1039,9 @@ var
{ draw the header cell and borders }
if FDrawingStyle = dsFlat then begin
{ draw an outer and inner bevel }
HeadRect := Rect(RealLeft, RealTop, RealRight, RealTop + wvHeaderHeight + 2);
TPSFillRect(RenderCanvas, Angle, RenderIn, HeadRect);
{ wp: above lines replace the next ones - no bevel in flat style!
HeadRect.Left := RealLeft + 1;
HeadRect.Top := RealTop + 1;
HeadRect.Right := RealRight - 1;
@ -1047,6 +1050,7 @@ var
DrawBevelRect (RenderCanvas,
TPSRotateRectangle (Angle, RenderIn, HeadRect),
BevelHighlightColor, BevelShadowColor);
}
end else if FDrawingStyle = ds3d then begin
{ draw a 3d bevel }
HeadRect.Left := RealLeft + 2;