You've already forked lazarus-ccr
tvplanit: New TVpControlLink property CityStateZip defining the country-dependant order and structure of the city-state-zip part of the address.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4866 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -25,9 +25,9 @@ object MainForm: TMainForm
|
||||
Height = 532
|
||||
Top = 48
|
||||
Width = 780
|
||||
ActivePage = TabEvents
|
||||
ActivePage = TabSettings
|
||||
Align = alClient
|
||||
TabIndex = 0
|
||||
TabIndex = 4
|
||||
TabOrder = 0
|
||||
object TabEvents: TTabSheet
|
||||
Caption = 'Events'
|
||||
@ -485,6 +485,30 @@ object MainForm: TMainForm
|
||||
OnChange = Cb3DChange
|
||||
TabOrder = 4
|
||||
end
|
||||
object LblAddressBuilder: TLabel
|
||||
Left = 16
|
||||
Height = 15
|
||||
Top = 149
|
||||
Width = 82
|
||||
Caption = 'Address builder'
|
||||
ParentColor = False
|
||||
end
|
||||
object CbAddressBuilder: TComboBox
|
||||
Left = 112
|
||||
Height = 23
|
||||
Top = 144
|
||||
Width = 172
|
||||
ItemHeight = 15
|
||||
Items.Strings = (
|
||||
'(default)'
|
||||
'@ZIP @CITY'
|
||||
'@CITY, @STATE @ZIP'
|
||||
'@CITY @ZIP'
|
||||
)
|
||||
OnChange = CbAddressBuilderChange
|
||||
Style = csDropDownList
|
||||
TabOrder = 5
|
||||
end
|
||||
end
|
||||
end
|
||||
object HeaderPanel: TPanel
|
||||
@ -626,7 +650,7 @@ object MainForm: TMainForm
|
||||
end
|
||||
object VpControlLink1: TVpControlLink
|
||||
DataStore = VpBufDSDataStore1
|
||||
LocalizationFile = '../../source\vplocalize.xml'
|
||||
LocalizationFile = '../../source/vplocalize.xml'
|
||||
Printer.BottomMargin = 0
|
||||
Printer.DayStart = h_08
|
||||
Printer.DayEnd = h_05
|
||||
|
@ -17,6 +17,7 @@ TMAINFORM.LBLTIMEFORMAT.CAPTION=Time format
|
||||
TMAINFORM.LBLFIRSTDAYOFWEEK.CAPTION=First day of week
|
||||
TMAINFORM.CBALLOWINPLACEEDITING.CAPTION=Allow inplace editing
|
||||
TMAINFORM.CB3D.CAPTION=3d display mode
|
||||
TMAINFORM.LBLADDRESSBUILDER.CAPTION=Address builder
|
||||
TMAINFORM.TITLELBL.CAPTION=TitleLbl
|
||||
TMAINFORM.MENUITEM1.CAPTION=File
|
||||
TMAINFORM.MNUQUIT.CAPTION=Quit
|
||||
|
@ -24,8 +24,10 @@ type
|
||||
CbFirstDayOfWeek: TComboBox;
|
||||
CbAllowInplaceEditing: TCheckBox;
|
||||
Cb3D: TCheckBox;
|
||||
CbAddressBuilder: TComboBox;
|
||||
Img: TImage;
|
||||
ImageList1: TImageList;
|
||||
LblAddressBuilder: TLabel;
|
||||
LblFirstDayOfWeek: TLabel;
|
||||
LblTimeFormat: TLabel;
|
||||
LblGranularity: TLabel;
|
||||
@ -71,6 +73,7 @@ type
|
||||
procedure BtnNewResClick(Sender: TObject);
|
||||
procedure BtnEditResClick(Sender: TObject);
|
||||
procedure Cb3DChange(Sender: TObject);
|
||||
procedure CbAddressBuilderChange(Sender: TObject);
|
||||
procedure CbAllowInplaceEditingChange(Sender: TObject);
|
||||
procedure CbFirstDayOfWeekChange(Sender: TObject);
|
||||
procedure CbGranularityChange(Sender: TObject);
|
||||
@ -252,6 +255,14 @@ begin
|
||||
VpMonthView1.DrawingStyle := ds;
|
||||
end;
|
||||
|
||||
procedure TMainForm.CbAddressBuilderChange(Sender: TObject);
|
||||
begin
|
||||
if CbAddressBuilder.ItemIndex <= 0 then
|
||||
VpControlLink1.CityStateZipFormat := ''
|
||||
else
|
||||
VpControlLink1.CityStateZipFormat := CbAddressBuilder.Items[CbAddressBuilder.ItemIndex];
|
||||
end;
|
||||
|
||||
procedure TMainForm.CbAllowInplaceEditingChange(Sender: TObject);
|
||||
begin
|
||||
VpContactGrid1.AllowInplaceEditing := CbAllowInplaceEditing.Checked;
|
||||
|
@ -157,6 +157,10 @@ msgstr "Editieren an Ort und Stelle erlauben"
|
||||
msgid "30 Min"
|
||||
msgstr "30 Min"
|
||||
|
||||
#: tmainform.lbladdressbuilder.caption
|
||||
msgid "Address builder"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.lblfirstdayofweek.caption
|
||||
msgid "First day of week"
|
||||
msgstr "Die Woche beginnt am"
|
||||
|
@ -146,6 +146,10 @@ msgstr ""
|
||||
msgid "30 Min"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.lbladdressbuilder.caption
|
||||
msgid "Address builder"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.lblfirstdayofweek.caption
|
||||
msgid "First day of week"
|
||||
msgstr ""
|
||||
|
@ -358,11 +358,13 @@ type
|
||||
FLocalization : TVpLocalization;
|
||||
FLocalizationFile : string;
|
||||
FDefaultCountry : string;
|
||||
FCityStateZipFormat: String;
|
||||
protected{private}
|
||||
DependentList: TList;
|
||||
procedure Attach (Sender : TComponent);
|
||||
procedure Detach (Sender : TComponent);
|
||||
procedure ReleaseDependents;
|
||||
procedure SetCityStateZipFormat(const Value: String);
|
||||
procedure SetDataStore (const Value : TVpCustomDataStore);
|
||||
procedure SetDefaultCountry (const v : string);
|
||||
procedure SetLocalizationFile (const v : string);
|
||||
@ -378,6 +380,8 @@ type
|
||||
procedure TriggerOnPageStart (Sender: TObject; PageNum: Integer; ADate: TDateTime);
|
||||
property Localization : TVpLocalization read FLocalization write FLocalization;
|
||||
published
|
||||
property CityStateZipFormat: String read FCityStateZipFormat write SetCityStateZipFormat;
|
||||
// Use symbols @CITY, @STATE, @ZIP to define the order of these strings
|
||||
property DataStore: TVpCustomDataStore read FDataStore write SetDataStore;
|
||||
property DefaultCountry : string read FDefaultCountry write SetDefaultCountry;
|
||||
property LocalizationFile : string read FLocalizationFile write SetLocalizationFile;
|
||||
@ -1336,6 +1340,12 @@ begin
|
||||
end;
|
||||
{=====}
|
||||
|
||||
procedure TVpControlLink.SetCityStateZipFormat(const Value: String);
|
||||
begin
|
||||
if FCityStateZipFormat <> Value then
|
||||
FCityStateZipFormat := Value
|
||||
end;
|
||||
|
||||
procedure TVpControlLink.SetDataStore(const Value: TVpCustomDataStore);
|
||||
begin
|
||||
if FDataStore <> Value then
|
||||
|
@ -216,6 +216,7 @@ type
|
||||
procedure LoadLanguage;
|
||||
procedure LinkHandler(Sender: TComponent;
|
||||
NotificationType: TVpNotificationType; const Value: Variant); override;
|
||||
function GetCityStateZipFormat: String;
|
||||
function GetControlType : TVpItemType; override;
|
||||
procedure DeleteActiveContact(Verify: Boolean);
|
||||
procedure PaintToCanvas (ACanvas: TCanvas; ARect: TRect; Angle: TVpRotationAngle);
|
||||
@ -518,6 +519,13 @@ begin
|
||||
end;
|
||||
{=====}
|
||||
|
||||
function TVpContactGrid.GetCityStateZipFormat: String;
|
||||
begin
|
||||
if ControlLink <> nil then
|
||||
Result := ControlLink.CityStateZipFormat else
|
||||
Result := '';
|
||||
end;
|
||||
|
||||
function TVpContactGrid.GetControlType : TVpItemType;
|
||||
begin
|
||||
Result := itContacts;
|
||||
|
@ -46,6 +46,7 @@ type
|
||||
implementation
|
||||
|
||||
uses
|
||||
StrUtils,
|
||||
VpCanvasUtils, VpMisc, VpSR;
|
||||
|
||||
type
|
||||
@ -415,15 +416,24 @@ begin
|
||||
DrawContactLine(TmpBmp, TmpCon.Address, '', WholeRect, AddrRect);
|
||||
|
||||
{ do City, State, Zip }
|
||||
Str := TmpCon.City;
|
||||
if Str <> '' then
|
||||
Str := Str + ', ' + TmpCon.State
|
||||
else
|
||||
Str := TmpCon.State;
|
||||
if Str <> '' then
|
||||
Str := Str + ' ' + TmpCon.Zip
|
||||
else
|
||||
Str := TmpCon.Zip;
|
||||
str := FContactGrid.GetCityStateZipFormat;
|
||||
if str = '' then
|
||||
begin
|
||||
str := TmpCon.City;
|
||||
if (str <> '') and (TmpCon.State <> '') then
|
||||
Str := Str + ', ' + TmpCon.State;
|
||||
if (str <> '') and (TmpCon.Zip <> '') then
|
||||
Str := Str + ' ' + TmpCon.Zip;
|
||||
end else
|
||||
begin
|
||||
Str := ReplaceStr(Str, '@CITY', TmpCon.City);
|
||||
Str := ReplaceStr(Str, '@STATE', TmpCon.State);
|
||||
Str := ReplaceStr(Str, '@ZIP', TmpCon.Zip);
|
||||
while (Length(Str) > 0) and (Str[1] in [' ', ',', '.']) do
|
||||
Delete(Str, 1, 1);
|
||||
while (Length(Str) > 0) and (Str[Length(Str)] in [' ', ',', '.']) do
|
||||
Delete(Str, Length(Str), 1);
|
||||
end;
|
||||
DrawContactLine(TmpBmp, Str, '', WholeRect, CSZRect);
|
||||
|
||||
{ do Phone1 }
|
||||
|
Reference in New Issue
Block a user