tvplanit: Less hints and warnings, some cleanup

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6476 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-06-09 09:22:33 +00:00
parent 820288c8ec
commit 64d3c247b1
10 changed files with 54 additions and 87 deletions

View File

@ -124,42 +124,12 @@ end;
procedure TfrmReportSetup.PositionControls;
var
i, w, h: Integer;
i, w: Integer;
cnv: TControlCanvas;
begin
AutoSize := false;
AlignOKCancel(btnOK, btnCancel, ButtonPanel);
(*
btnOK.AutoSize := true;
btnCancel.AutoSize := true;
w := Max(btnOK.Width, btnCancel.Width);
h := btnOK.Height;
btnOK.AutoSize := false;
btnOK.Width := w;
btnOK.Height := h;
btnCancel.AutoSize := false;
btnCancel.Width := w;
btnCancel.Height := h;
{$IFDEF MSWINDOWS} // button order: OK - Cancel
btnCancel.AnchorSideRight.Control := self;
btnCancel.Anchors := [akTop, akRight];
btnOK.AnchorSideRight.Control := btnCancel;
btnOK.Anchors := [akTop, akRight];
btnOK.TabOrder := PrintFormatCombo.TabOrder;
btnCancel.TabOrder := PrintFormatCombo.TabOrder + 1;
{$ELSE} // button order: Cancel - OK
btnOK.AnchorSideRight.Control := self;
btnOK.Anchors := [akTop, akRight];
btnCancel.AnchorSideRight.Control := btnOK;
btnCancel.Anchors := [akTop, akRight];
btnCancel.TabOrder := PrintFormatCombo.TabOrder;
btnOK.TabOrder := PrintFormatCombo.TabOrder + 1;
{$ENDIF}
*)
cnv := TControlCanvas.Create;
try

View File

@ -5,7 +5,7 @@ unit bufdsdatamodule;
interface
uses
Classes, SysUtils, FileUtil, VpBaseDS, VpBufDS;
Classes, SysUtils, FileUtil, VpBufDS;
type

View File

@ -58,7 +58,7 @@ object MainForm: TMainForm
Height = 528
Top = 48
Width = 834
PageIndex = 0
PageIndex = 2
Align = alClient
TabOrder = 1
TabStop = True
@ -695,41 +695,41 @@ object MainForm: TMainForm
DrawingStyle = dsCoolTab
FolderCollection = <
item
Version = 'v1.10'
Version = 'v1.12'
Caption = 'Planner'
Enabled = True
FolderType = ftDefault
ItemCollection = <
item
Version = 'v1.10'
Version = 'v1.12'
Caption = 'Events'
IconIndex = 0
Name = 'NIEvents'
Tag = 0
end
item
Version = 'v1.10'
Version = 'v1.12'
Caption = 'Month view'
IconIndex = 5
Name = 'NIEventsByMonth'
Tag = 0
end
item
Version = 'v1.10'
Version = 'v1.12'
Caption = 'Week view'
IconIndex = 4
Name = 'NIEventsByWeek'
Tag = 0
end
item
Version = 'v1.10'
Version = 'v1.12'
Caption = 'Day view'
IconIndex = 3
Name = 'NIEventsByDay'
Tag = 0
end
item
Version = 'v1.10'
Version = 'v1.12'
Caption = 'Tasks'
Description = 'Show tasks'
IconIndex = 1
@ -737,7 +737,7 @@ object MainForm: TMainForm
Tag = 0
end
item
Version = 'v1.10'
Version = 'v1.12'
Caption = 'Contacts'
Description = 'Show address book'
IconIndex = 2
@ -749,20 +749,20 @@ object MainForm: TMainForm
Tag = 0
end
item
Version = 'v1.10'
Version = 'v1.12'
Caption = 'Maintenance'
Enabled = True
FolderType = ftDefault
ItemCollection = <
item
Version = 'v1.10'
Version = 'v1.12'
Caption = 'Resources'
IconIndex = 7
Name = 'NIResources'
Tag = 0
end
item
Version = 'v1.10'
Version = 'v1.12'
Caption = 'Settings'
IconIndex = 8
Name = 'NISettings'
@ -800,12 +800,12 @@ object MainForm: TMainForm
Printer.MarginUnits = imPercent
Printer.PrintFormats = <
item
Version = 'v1.10'
Version = 'v1.12'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.10'
Version = 'v1.12'
Caption.Caption = 'Current week'
Caption.Font.Style = [fsItalic]
DayOffset = 0
@ -820,12 +820,12 @@ object MainForm: TMainForm
FormatName = 'Events of current week (dayview)'
end
item
Version = 'v1.10'
Version = 'v1.12'
DayInc = 0
DayIncUnits = duWeek
Elements = <
item
Version = 'v1.10'
Version = 'v1.12'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'WeekView'
@ -839,12 +839,12 @@ object MainForm: TMainForm
FormatName = 'Events of current week (Week view)'
end
item
Version = 'v1.10'
Version = 'v1.12'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.10'
Version = 'v1.12'
DayOffset = 0
DayOffsetUnits = duWeek
ElementName = 'TaskList'
@ -858,12 +858,12 @@ object MainForm: TMainForm
FormatName = 'Tasks of current week'
end
item
Version = 'v1.10'
Version = 'v1.12'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.10'
Version = 'v1.12'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'TaskList'
@ -883,7 +883,7 @@ object MainForm: TMainForm
top = 200
end
object VpResourceEditDialog1: TVpResourceEditDialog
Version = 'v1.10'
Version = 'v1.12'
Options = []
Placement.Position = mpCenter
Placement.Top = 10
@ -2110,7 +2110,7 @@ object MainForm: TMainForm
top = 368
end
object VpPrintPreviewDialog1: TVpPrintPreviewDialog
Version = 'v1.10'
Version = 'v1.12'
BottomMargin = 0
ControlLink = VpControlLink1
EndDate = 42561.5151169907
@ -2129,7 +2129,7 @@ object MainForm: TMainForm
top = 432
end
object VpPrintFormatEditDialog1: TVpPrintFormatEditDialog
Version = 'v1.10'
Version = 'v1.12'
ControlLink = VpControlLink1
Options = []
Placement.Position = mpCenter

View File

@ -275,8 +275,6 @@ procedure UpdateFormatSettings(ALang: String);
{$IFDEF WINDOWS}
var
LCID: Integer;
i: Integer;
codepage: String;
{$ENDIF}
begin
{$IFDEF WINDOWS}
@ -306,6 +304,7 @@ end;
function GetFirstDayOfWeek(ALang: String): TVpDayType;
// Don't know how to determine this from the OS
begin
Unused(ALang);
Result := dtSunday;
end;
@ -1182,7 +1181,8 @@ end;
procedure TMainForm.VpNavBar1ItemClick(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; Index: Integer);
begin
SetActiveView(VpNavBar1.ActiveFolder * 1000 + Index);
Unused(Button, Shift);
SetActiveView(VpNavBar1.ActiveFolder * 1000 + Index);
end;
procedure TMainForm.SetActiveView(AValue: Integer);

View File

@ -165,7 +165,7 @@ type
procedure SetContactIndex(Value: Integer);
procedure SetColumnWidth(Value: Integer);
procedure SetDrawingStyle(const Value: TVpDrawingStyle);
procedure SetColor(const Value: TColor);
procedure SetColor(Value: TColor); override;
procedure SetHScrollPos;
procedure SetPrintNumColumns (const v : Integer);
procedure SetSortBy (const v : TVpContactSort);
@ -814,7 +814,7 @@ begin
end;
{=====}
procedure TVpContactGrid.SetColor(const Value: TColor);
procedure TVpContactGrid.SetColor(Value: TColor);
begin
if FColor <> Value then begin
FColor := Value;
@ -1303,7 +1303,7 @@ begin
cgInPlaceEditor.Move(AddressRect, true);
Canvas.DrawFocusRect(Rect(AddressRect.Left + TextMargin - 1,
AddressRect.Top, AddressRect.Right + 3, AddressRect.Bottom + 3));
cgInPlaceEditor.Text := FActiveContact.Address;
cgInPlaceEditor.Text := FActiveContact.Address1;
end;
{ edit company }
if field = 'Company' then begin
@ -1319,8 +1319,8 @@ begin
cgInPlaceEditor.Move(CSZRect, true);
Canvas.DrawFocusRect(Rect(CSZRect.Left + TextMargin - 1,
CSZRect.Top, CSZRect.Right + 3, CSZRect.Bottom + 3));
cgInPlaceEditor.Text := FActiveContact.City + ', ' + FActiveContact.State
+ ' ' + FActiveContact.Zip;
cgInPlaceEditor.Text := FActiveContact.City1 + ', ' + FActiveContact.State1
+ ' ' + FActiveContact.Zip1;
end;
{ edit email }
if field = 'EMail' then begin
@ -1328,7 +1328,7 @@ begin
cgInPlaceEditor.Move(EMailRect, true);
Canvas.DrawFocusRect(Rect(EMailRect.Left - TextMargin,
EMailRect.Top, EMailRect.Right + 3, EMailRect.Bottom + 3));
cgInPlaceEditor.Text := FActiveContact.EMail;
cgInPlaceEditor.Text := FActiveContact.EMail1;
end;
{ edit Phone1 }
if field = 'Phone1' then begin
@ -1387,8 +1387,8 @@ begin
if cgInPlaceEditor <> nil then begin
{Address}
if cgInPlaceEditor.field = 'Address' then begin
if cgInPlaceEditor.Text <> FActiveContact.Address then begin
FActiveContact.Address := cgInPlaceEditor.Text;
if cgInPlaceEditor.Text <> FActiveContact.Address1 then begin
FActiveContact.Address1 := cgInPlaceEditor.Text;
FActiveContact.Changed := true;
end;
end
@ -1401,20 +1401,20 @@ begin
end
{EMail}
else if cgInPlaceEditor.field = 'EMail' then begin
if cgInPlaceEditor.Text <> FActiveContact.EMail then begin
FActiveContact.EMail := cgInPlaceEditor.Text;
if cgInPlaceEditor.Text <> FActiveContact.EMail1 then begin
FActiveContact.EMail1 := cgInPlaceEditor.Text;
FActiveContact.Changed := true;
end;
end
{City, State, Zip}
else if cgInPlaceEditor.field = 'CSZ' then begin
ParseCSZ(cgInPlaceEditor.Text, City, State, Zip);
if (City <> FActiveContact.City)
or (State <> FActiveContact.State)
or (Zip <> FActiveContact.Zip) then begin
FActiveContact.City := City;
FActiveContact.State := State;
FActiveContact.Zip := Zip;
if (City <> FActiveContact.City1)
or (State <> FActiveContact.State1)
or (Zip <> FActiveContact.Zip1) then begin
FActiveContact.City1 := City;
FActiveContact.State1 := State;
FActiveContact.Zip1 := Zip;
FActiveContact.Changed := true;
end;
end

View File

@ -708,7 +708,6 @@ begin
end;
end;
procedure TVpContactGridPainter.DrawVerticalBars;
var
BarPos, BarCount, I: Integer;

View File

@ -1575,8 +1575,7 @@ var
ShowCustom: Boolean;
Icons: TVpDVIcons;
cat: TVpCategoryInfo;
w, h: Integer;
R: TRect;
w: Integer;
isOverlayed: Boolean;
grp: TVpResourceGroup;
imgList: TCustomImageList;

View File

@ -300,7 +300,7 @@ var
bmp: TBitmap;
ColorRect: TRect;
IconX, IconY: Integer;
hTxt, hGutter, hDist, vMargin, hMargin: Integer;
hTxt, hGutter, hDist, hMargin: Integer;
SavedStyle: TBrushStyle;
imgIndex: Integer;
h: Integer = 0;
@ -312,10 +312,9 @@ var
{$IFEND}
{$ENDIF}
begin
Unused( State);
Unused(Control, State);
hTxt := Category.Canvas.TextHeight('Tj');
vMargin := ScaleY(2, DesignTimeDPI);
hMargin := ScaleX(3, DesignTimeDPI);
hGutter := ScaleX(10, DesignTimeDPI);
hDist := ScaleX(5, DesignTimeDPI);

View File

@ -309,12 +309,6 @@ type
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
const AXProportion, AYProportion: Double); override;
{$ENDIF}
{$IF VP_LCL_SCALING = 2}
procedure ScaleFontsPPI(const AToPPI: Integer; const AProportion: Double); override;
{$ELSEIF VP_LCL_SCALING = 1}
procedure ScaleFontsPPI(const AProportion: Double); override;
{$ENDIF}
{$ENDIF}
procedure CreateParams(var Params: TCreateParams); override;
procedure CreateWnd; override;
@ -403,6 +397,14 @@ type
procedure RemoveItem(AFolderIndex, AItemIndex: Integer);
procedure RenameItem(AFolderIndex, AItemIndex: Integer);
procedure PlaySound(const AWavFile: String; APlaySoundMode: TVpPlaySoundMode);
{$IF VP_LCL_SCALING = 2}
procedure ScaleFontsPPI(const AToPPI: Integer; const AProportion: Double); override;
{$ELSEIF VP_LCL_SCALING = 1}
procedure ScaleFontsPPI(const AProportion: Double); override;
{$ENDIF}
{$ENDIF}
property ActiveItem: Integer read FActiveItem;
property Containers[Index: Integer]: TVpFolderContainer read GetContainer;
property Folders[Index: Integer]: TVpNavFolder read GetFolder;

View File

@ -165,7 +165,6 @@ end;
function VCardDate(AText: String): TDate;
var
fs: TFormatSettings;
value: String;
y, m, d: Integer;
begin
if AText <> '' then begin
@ -395,7 +394,6 @@ const
var
i: Integer;
item: TVpVCardItem;
s: String;
begin
for i := 0 to FItems.Count-1 do begin
item := TVpVCardItem(FItems[i]);