tvplanit: Cosmetic changes in VpBase. Refactor TVpCategoryMap. Add missing German translations.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4780 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-06-20 09:06:30 +00:00
parent 5d527e1d69
commit 8cd357069e
5 changed files with 169 additions and 200 deletions

View File

@ -171,45 +171,9 @@ msgstr "Abbrechen"
msgid "Category"
msgstr "Kategorie"
#: vpsr.rscategorydesc0
msgid "Category 0"
msgstr "Kategorie 0"
#: vpsr.rscategorydesc1
msgid "Category 1"
msgstr "Kategorie 1"
#: vpsr.rscategorydesc2
msgid "Category 2"
msgstr "Kategorie 2"
#: vpsr.rscategorydesc3
msgid "Category 3"
msgstr "Kategorie 3"
#: vpsr.rscategorydesc4
msgid "Category 4"
msgstr "Kategorie 4"
#: vpsr.rscategorydesc5
msgid "Category 5"
msgstr "Kategorie 5"
#: vpsr.rscategorydesc6
msgid "Category 6"
msgstr "Kategorie 6"
#: vpsr.rscategorydesc7
msgid "Category 7"
msgstr "Kategorie 7"
#: vpsr.rscategorydesc8
msgid "Category 8"
msgstr "Kategorie 8"
#: vpsr.rscategorydesc9
msgid "Category 9"
msgstr "Kategorie 9"
#: vpsr.rscategorydesc
msgid "Category %d"
msgstr "Kategorie %d"
#: vpsr.rscategorylabel1
msgid "Business"
@ -403,7 +367,7 @@ msgstr "Löschen"
#: vpsr.rsdeletecontactfromschedule
msgid "Delete contact %s from your schedule?"
msgstr ""
msgstr "Kontakt %s aus Ihrem Terminplan löschen?"
#: vpsr.rsdescriptionlbl
msgctxt "vpsr.rsdescriptionlbl"
@ -416,7 +380,7 @@ msgstr "Details:"
#: vpsr.rsdismissbtn
msgid "&Dismiss"
msgstr "Ablehnen"
msgstr "Bestätigen"
#: vpsr.rsdlgcontactedit
msgctxt "vpsr.rsdlgcontactedit"
@ -1372,4 +1336,3 @@ msgstr "Unbekannte Achsen-Spezifikation: %s"
#: vpsr.sxmldecnotatbeg
msgid "The XML declaration must appear before the first element"
msgstr "Die XML-Deklaration muss vor dem ersten Element erscheinen."

View File

@ -161,44 +161,8 @@ msgstr ""
msgid "Category"
msgstr ""
#: vpsr.rscategorydesc0
msgid "Category 0"
msgstr ""
#: vpsr.rscategorydesc1
msgid "Category 1"
msgstr ""
#: vpsr.rscategorydesc2
msgid "Category 2"
msgstr ""
#: vpsr.rscategorydesc3
msgid "Category 3"
msgstr ""
#: vpsr.rscategorydesc4
msgid "Category 4"
msgstr ""
#: vpsr.rscategorydesc5
msgid "Category 5"
msgstr ""
#: vpsr.rscategorydesc6
msgid "Category 6"
msgstr ""
#: vpsr.rscategorydesc7
msgid "Category 7"
msgstr ""
#: vpsr.rscategorydesc8
msgid "Category 8"
msgstr ""
#: vpsr.rscategorydesc9
msgid "Category 9"
#: vpsr.rscategorydesc
msgid "Category %d"
msgstr ""
#: vpsr.rscategorylabel1

View File

@ -63,8 +63,7 @@ type
h_09, h_10, h_11, h_12, h_13, h_14, h_15, h_16, h_17,
h_18, h_19, h_20, h_21, h_22, h_23);
TVpGranularity = (gr05Min, gr06Min, gr10Min, gr15Min, gr20Min, gr30Min,
gr60Min);
TVpGranularity = (gr05Min, gr06Min, gr10Min, gr15Min, gr20Min, gr30Min, gr60Min);
TVpEditorReturnCode = (rtCommit, rtAbandon);
@ -81,8 +80,8 @@ type
TVpDrawingStyle = (dsFlat, ds3d, dsNone);
{ event method types }
TVpMouseWheelEvent = procedure(Sender : TObject; Shift : TShiftState;
Delta, XPos, YPos : Word) of object;
TVpMouseWheelEvent = procedure(Sender: TObject; Shift: TShiftState;
Delta, XPos, YPos: Word) of object;
TVpOwnerDrawEvent = procedure(Sender: TObject; const Canvas: TCanvas;
R: TRect; var Drawn: Boolean) of object;
@ -93,10 +92,10 @@ type
TVpOwnerDrawDayEvent = procedure(Sender: TObject; const Canvas: TCanvas;
R: TRect; Day: Integer; var Drawn: Boolean) of object;
TVpItemSelectedEvent = procedure(Sender : TObject;
Index : Integer) of object;
TVpItemSelectedEvent = procedure(Sender: TObject;
Index: Integer) of object;
TVpGetEditorCaption = procedure(var Caption : string) of object;
TVpGetEditorCaption = procedure(var Caption: string) of object;
TVpPlaySoundEvent = procedure(Sender: TObject; const AWavFile: String;
AMode: TVpPlaySoundMode) of object;
@ -109,8 +108,7 @@ type
seFilePos : Longint;
public
constructor CreateError(const FilePos: Longint; const Reason: DOMString);
property FilePos: Longint
read seFilePos;
property FilePos: Longint read seFilePos;
end;
EVpFilterError = class(EVpStreamError)
@ -121,8 +119,8 @@ type
public
constructor CreateError(const FilePos, Line, LinePos: Longint; const Reason: DOMString);
property Reason : DOMString read feReason;
property Line : Longint read feLine;
property LinePos : Longint read feLinePos;
property Line: Longint read feLine;
property LinePos: Longint read feLinePos;
end;
EVpParserError = class(EVpFilterError)
@ -145,13 +143,13 @@ type
{ Ancestor for all Visual PlanIt visual controls }
TVpCustomControl = class(TCustomControl)
protected { private }
FAfterEnter : TNotifyEvent;
FAfterExit : TNotifyEvent;
FOnMouseWheel : TVpMouseWheelEvent;
FAutoScroll : Boolean;
FAfterEnter: TNotifyEvent;
FAfterExit: TNotifyEvent;
FOnMouseWheel: TVpMouseWheelEvent;
FAutoScroll: Boolean;
function GetVersion : string;
procedure SetVersion(const Value : string);
procedure CMVisibleChanged(var Msg : TMessage); message CM_VISIBLECHANGED;
procedure SetVersion(const Value: string);
procedure CMVisibleChanged(var Msg: TMessage); message CM_VISIBLECHANGED;
{$IFNDEF LCL}
procedure WMMouseWheel(var Msg : TMessage); message WM_MOUSEWHEEL;
procedure DoOnMouseWheel(Shift: TShiftState; Delta, XPos, YPos: SmallInt); dynamic;
@ -192,11 +190,11 @@ type
private
FCategoryIndex: Integer;
protected
FBackgroundColor : TColor;
FColor : TColor;
FDescription : string;
FIndex : Integer;
FBitmap : TBitmap;
FBackgroundColor: TColor;
FColor: TColor;
FDescription: string;
FIndex: Integer;
FBitmap: TBitmap;
procedure SetBackgroundColor (const v : TColor);
procedure SetBitmap (v : TBitmap);
procedure SetColor(Value: TColor);
@ -205,8 +203,8 @@ type
constructor Create;
destructor Destroy; override;
published
property BackgroundColor : TColor read FBackgroundColor write SetBackgroundColor
default clWindow;
property BackgroundColor: TColor
read FBackgroundColor write SetBackgroundColor default clWindow;
property Bitmap : TBitmap read FBitmap write SetBitmap;
property Color: TColor read FColor write SetColor;
property Description: string read FDescription write SetDescription;
@ -215,32 +213,49 @@ type
TVpCategoryColorMap = class(TPersistent)
protected
FCat0 : TVpCategoryInfo;
FCat1 : TVpCategoryInfo;
FCat2 : TVpCategoryInfo;
FCat3 : TVpCategoryInfo;
FCat4 : TVpCategoryInfo;
FCat5 : TVpCategoryInfo;
FCat6 : TVpCategoryInfo;
FCat7 : TVpCategoryInfo;
FCat8 : TVpCategoryInfo;
FCat9 : TVpCategoryInfo;
FCat: array[0..9] of TVpCategoryInfo;
function GetCat(AIndex: Integer): TVpCategoryInfo;
procedure SetCat(AIndex: Integer; AValue: TVpCategoryInfo);
{
FCat0: TVpCategoryInfo;
FCat1: TVpCategoryInfo;
FCat2: TVpCategoryInfo;
FCat3: TVpCategoryInfo;
FCat4: TVpCategoryInfo;
FCat5: TVpCategoryInfo;
FCat6: TVpCategoryInfo;
FCat7: TVpCategoryInfo;
FCat8: TVpCategoryInfo;
FCat9: TVpCategoryInfo;
}
public
constructor Create;
destructor Destroy; override;
function GetColor(Index: Integer): TColor;
function GetName(Index: Integer):string;
published
property Category0 : TVpCategoryInfo read FCat0 write FCat0;
property Category1 : TVpCategoryInfo read FCat1 write FCat1;
property Category2 : TVpCategoryInfo read FCat2 write FCat2;
property Category3 : TVpCategoryInfo read FCat3 write FCat3;
property Category4 : TVpCategoryInfo read FCat4 write FCat4;
property Category5 : TVpCategoryInfo read FCat5 write FCat5;
property Category6 : TVpCategoryInfo read FCat6 write FCat6;
property Category7 : TVpCategoryInfo read FCat7 write FCat7;
property Category8 : TVpCategoryInfo read FCat8 write FCat8;
property Category9 : TVpCategoryInfo read FCat9 write FCat9;
property Category0: TVpCategoryInfo index 0 read GetCat write SetCat;
property Category1: TVpCategoryInfo index 1 read GetCat write SetCat;
property Category2: TVpCategoryInfo index 2 read GetCat write SetCat;
property Category3: TVpCategoryInfo index 3 read GetCat write SetCat;
property Category4: TVpCategoryInfo index 4 read GetCat write SetCat;
property Category5: TVpCategoryInfo index 5 read GetCat write SetCat;
property Category6: TVpCategoryInfo index 6 read GetCat write SetCat;
property Category7: TVpCategoryInfo index 7 read GetCat write SetCat;
property Category8: TVpCategoryInfo index 8 read GetCat write SetCat;
property Category9: TVpCategoryInfo index 9 read GetCat write SetCat;
{
property Category0: TVpCategoryInfo read FCat0 write FCat0;
property Category1: TVpCategoryInfo read FCat1 write FCat1;
property Category2: TVpCategoryInfo read FCat2 write FCat2;
property Category3: TVpCategoryInfo read FCat3 write FCat3;
property Category4: TVpCategoryInfo read FCat4 write FCat4;
property Category5: TVpCategoryInfo read FCat5 write FCat5;
property Category6: TVpCategoryInfo read FCat6 write FCat6;
property Category7: TVpCategoryInfo read FCat7 write FCat7;
property Category8: TVpCategoryInfo read FCat8 write FCat8;
property Category9: TVpCategoryInfo read FCat9 write FCat9;
}
end;
{ TVpFont }
@ -271,22 +286,22 @@ type
TVpCollection = class(TCollection)
protected { private }
{ property variables }
FItemEditor : TForm;
FReadOnly : Boolean;
FOwner : TPersistent;
FItemEditor: TForm;
FReadOnly: Boolean;
FOwner: TPersistent;
{ event variables }
FOnChanged : TNotifyEvent;
FOnItemSelected : TVpItemSelectedEvent;
FOnGetEditorCaption : TVpGetEditorCaption;
FOnChanged: TNotifyEvent;
FOnItemSelected: TVpItemSelectedEvent;
FOnGetEditorCaption: TVpGetEditorCaption;
{ Internal variables }
InLoaded : Boolean;
IsLoaded : Boolean;
InChanged : Boolean;
InLoaded: Boolean;
IsLoaded: Boolean;
InChanged: Boolean;
protected
function GetCount : Integer;
function GetCount: Integer;
procedure Loaded;
public
constructor Create(AOwner : TPersistent; ItemClass : TCollectionItemClass); virtual;
constructor Create(AOwner: TPersistent; ItemClass: TCollectionItemClass); virtual;
destructor Destroy; override;
property ItemEditor: TForm read FItemEditor write FItemEditor;
function Add: TVpCollectionItem; dynamic;
@ -301,11 +316,11 @@ type
function ItemByName(const Name: string) : TVpCollectionItem;
function ParentForm: TForm;
property Count: Integer read GetCount;
property Item[Index: Integer] : TVpCollectionItem read GetItem write SetItem; default;
property OnGetEditorCaption : TVpGetEditorCaption read FOnGetEditorCaption write FOnGetEditorCaption;
property ReadOnly : Boolean read FReadOnly write FReadOnly default False;
property OnChanged : TNotifyEvent read FOnChanged write FOnChanged;
property OnItemSelected : TVpItemSelectedEvent read FOnItemSelected write FOnItemSelected;
property Item[Index: Integer]: TVpCollectionItem read GetItem write SetItem; default;
property OnGetEditorCaption: TVpGetEditorCaption read FOnGetEditorCaption write FOnGetEditorCaption;
property ReadOnly: Boolean read FReadOnly write FReadOnly default False;
property OnChanged: TNotifyEvent read FOnChanged write FOnChanged;
property OnItemSelected: TVpItemSelectedEvent read FOnItemSelected write FOnItemSelected;
end;
TVpContainerList = class(TList)
@ -407,7 +422,7 @@ end;
(*****************************************************************************)
{ TVpCustomControl }
constructor TVpCustomControl.Create (AOwner: TComponent);
constructor TVpCustomControl.Create(AOwner: TComponent);
begin
inherited Create (AOwner);
TabStop := True;
@ -664,8 +679,22 @@ end;
{ TVpCategoryColorMap }
constructor TVpCategoryColorMap.Create;
const
CAT_COLORS: Array[0..9] of TColor = (
clNavy, clRed, clYellow, clLime, clPurple, clTeal, clFuchsia, clOlive, clAqua, clMaroon
);
var
i: Integer;
begin
inherited Create;
for i:=0 to High(FCat) do
begin
FCat[i] := TVpCategoryInfo.Create;
FCat[i].FIndex := i;
FCat[i].Color := CAT_COLORS[i];
FCat[i].Description := Format(RSCategoryDesc, [i]);
end;
{
FCat0 := TVpCategoryInfo.Create;
FCat0.Color := clNavy;
FCat0.Description := RSCategoryDesc0;
@ -706,11 +735,16 @@ begin
FCat9.Color := clMaroon;
FCat9.Description := RSCategoryDesc9;
FCat9.FIndex := 9;
}
end;
{=====}
destructor TVpCategoryColorMap.Destroy;
var
i: Integer;
begin
for i:=0 to High(FCat) do FCat[i].Free;
{
FCat0.Free;
FCat1.Free;
FCat2.Free;
@ -721,12 +755,23 @@ begin
FCat7.Free;
FCat8.Free;
FCat9.Free;
}
inherited;
end;
{=====}
function TVpCategoryColorMap.GetCat(AIndex: Integer): TVpCategoryInfo;
begin
Result := FCat[AIndex];
end;
function TVpCategoryColorMap.GetColor(Index: Integer): TColor;
begin
if Index <= High(FCat) then
Result := FCat[Index].Color
else
Result := clBlack;
{
case Index of
0 : result := FCat0.Color;
1 : result := FCat1.Color;
@ -741,11 +786,17 @@ begin
else
result := clBlack;
end;
}
end;
{=====}
function TVpCategoryColorMap.GetName(Index: Integer): string;
begin
if Index <= High(FCat) then
Result := FCat[Index].Description
else
Result := '';
{
case Index of
0 : result := FCat0.Description;
1 : result := FCat1.Description;
@ -760,9 +811,15 @@ begin
else
result := '';
end;
}
end;
{=====}
procedure TVpCategoryColorMap.SetCat(AIndex: Integer; AValue: TVpCategoryInfo);
begin
FCat[AIndex] := AValue;
end;
(*****************************************************************************)
{ TVpCategoryInfo }
@ -787,7 +844,7 @@ end;
procedure TVpCategoryInfo.SetBitmap(v: TBitmap);
begin
FBitmap.Assign (v);
FBitmap.Assign(v);
end;
procedure TVpCategoryInfo.SetColor(Value: TColor);
@ -863,8 +920,6 @@ end;
{=====}
(*****************************************************************************)
{ TVpTimeSlotColor }

View File

@ -376,7 +376,6 @@ resourcestring
sUCS_U8ConverErr = 'Cannot convert UCS-4 character to UTF-8';
{ Misc Exceptions and Errors }
RSOutOfRange = 'Out of range';
RSNotSupported = 'not supported';
RSNeedElementName = 'Please supply an Element Name';
@ -392,24 +391,12 @@ resourcestring
RSNoLocalizationFile = 'Localization file not found.'; {!!.02}
{ Misc strings }
RSCategoryDesc0 = 'Category 0'; {!!.01}
RSCategoryDesc1 = 'Category 1'; {!!.01}
RSCategoryDesc2 = 'Category 2'; {!!.01}
RSCategoryDesc3 = 'Category 3'; {!!.01}
RSCategoryDesc4 = 'Category 4'; {!!.01}
RSCategoryDesc5 = 'Category 5'; {!!.01}
RSCategoryDesc6 = 'Category 6'; {!!.01}
RSCategoryDesc7 = 'Category 7'; {!!.01}
RSCategoryDesc8 = 'Category 8'; {!!.01}
RSCategoryDesc9 = 'Category 9'; {!!.01}
RSCategoryDesc = 'Category %d';
{ Print Format Editor }
RSEditPrintFormat = 'Edit Print Formats...';
{ Automatic resource adding/selection} {!!.01}
RSAddNewResource = 'No resources have been defined. Would you ' + {!!.01}
'like to add one now?'; {!!.01}
RSSelectResource = 'No resource has been selected. Would you ' + {!!.01}