You've already forked lazarus-ccr
tvplanit: Fix crash (with heaptrace on) due to incomplete Notification. Cosmetic changes.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5149 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -95,9 +95,6 @@
|
|||||||
</Linking>
|
</Linking>
|
||||||
<Other>
|
<Other>
|
||||||
<CustomOptions Value="-dBUFDATASET"/>
|
<CustomOptions Value="-dBUFDATASET"/>
|
||||||
<OtherDefines Count="1">
|
|
||||||
<Define0 Value="BUFDATASET"/>
|
|
||||||
</OtherDefines>
|
|
||||||
</Other>
|
</Other>
|
||||||
</CompilerOptions>
|
</CompilerOptions>
|
||||||
<Debugging>
|
<Debugging>
|
||||||
|
@ -675,6 +675,10 @@ msgstr "keine"
|
|||||||
msgid "(None)"
|
msgid "(None)"
|
||||||
msgstr "(Nichts)"
|
msgstr "(Nichts)"
|
||||||
|
|
||||||
|
#: vpsr.rsnooverlayedevents
|
||||||
|
msgid "none"
|
||||||
|
msgstr "keine"
|
||||||
|
|
||||||
#: vpsr.rsnoprintformats
|
#: vpsr.rsnoprintformats
|
||||||
msgid "No print formats have been defined"
|
msgid "No print formats have been defined"
|
||||||
msgstr "Es sind keine Druckformate definiert."
|
msgstr "Es sind keine Druckformate definiert."
|
||||||
|
@ -681,6 +681,10 @@ msgstr "Aucun"
|
|||||||
msgid "(None)"
|
msgid "(None)"
|
||||||
msgstr "(Aucun)"
|
msgstr "(Aucun)"
|
||||||
|
|
||||||
|
#: vpsr.rsnooverlayedevents
|
||||||
|
msgid "none"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: vpsr.rsnoprintformats
|
#: vpsr.rsnoprintformats
|
||||||
msgid "No print formats have been defined"
|
msgid "No print formats have been defined"
|
||||||
msgstr "Formats d'impression non-défini"
|
msgstr "Formats d'impression non-défini"
|
||||||
@ -1496,3 +1500,4 @@ msgstr "Spécificateur d'axe inconnu"
|
|||||||
#: vpsr.sxmldecnotatbeg
|
#: vpsr.sxmldecnotatbeg
|
||||||
msgid "The XML declaration must appear before the first element"
|
msgid "The XML declaration must appear before the first element"
|
||||||
msgstr "La déclaration XML doit apparaître avant le premier élément"
|
msgstr "La déclaration XML doit apparaître avant le premier élément"
|
||||||
|
|
||||||
|
@ -675,6 +675,10 @@ msgstr "Geen"
|
|||||||
msgid "(None)"
|
msgid "(None)"
|
||||||
msgstr "(Geen)"
|
msgstr "(Geen)"
|
||||||
|
|
||||||
|
#: vpsr.rsnooverlayedevents
|
||||||
|
msgid "none"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: vpsr.rsnoprintformats
|
#: vpsr.rsnoprintformats
|
||||||
msgid "No print formats have been defined"
|
msgid "No print formats have been defined"
|
||||||
msgstr "Er zijn geen afdrukformaten gedefinieerd."
|
msgstr "Er zijn geen afdrukformaten gedefinieerd."
|
||||||
@ -1490,3 +1494,4 @@ msgstr "Onbekende as specificatie: %s"
|
|||||||
#: vpsr.sxmldecnotatbeg
|
#: vpsr.sxmldecnotatbeg
|
||||||
msgid "The XML declaration must appear before the first element"
|
msgid "The XML declaration must appear before the first element"
|
||||||
msgstr "De XML declaratie moet voor het eerste element staan"
|
msgstr "De XML declaratie moet voor het eerste element staan"
|
||||||
|
|
||||||
|
@ -665,6 +665,10 @@ msgstr ""
|
|||||||
msgid "(None)"
|
msgid "(None)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: vpsr.rsnooverlayedevents
|
||||||
|
msgid "none"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: vpsr.rsnoprintformats
|
#: vpsr.rsnoprintformats
|
||||||
msgid "No print formats have been defined"
|
msgid "No print formats have been defined"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -675,6 +675,10 @@ msgstr "Нет"
|
|||||||
msgid "(None)"
|
msgid "(None)"
|
||||||
msgstr "(Нет)"
|
msgstr "(Нет)"
|
||||||
|
|
||||||
|
#: vpsr.rsnooverlayedevents
|
||||||
|
msgid "none"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: vpsr.rsnoprintformats
|
#: vpsr.rsnoprintformats
|
||||||
msgid "No print formats have been defined"
|
msgid "No print formats have been defined"
|
||||||
msgstr "Не определён формат печати"
|
msgstr "Не определён формат печати"
|
||||||
@ -1490,3 +1494,4 @@ msgstr ""
|
|||||||
#: vpsr.sxmldecnotatbeg
|
#: vpsr.sxmldecnotatbeg
|
||||||
msgid "The XML declaration must appear before the first element"
|
msgid "The XML declaration must appear before the first element"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -75,8 +75,8 @@ type
|
|||||||
TVpNoLocalizationFile = procedure (Sender: TObject;
|
TVpNoLocalizationFile = procedure (Sender: TObject;
|
||||||
FileName: string) of object;
|
FileName: string) of object;
|
||||||
|
|
||||||
TVpDateChangedEvent = procedure (Sender: TObject;
|
TVpDateChangedEvent = procedure (Sender: TObject;
|
||||||
Date: TDateTime) of object;
|
Date: TDateTime) of object;
|
||||||
|
|
||||||
{ contact events }
|
{ contact events }
|
||||||
TVpContactEvent = procedure(Sender: TObject; Contact: TVpContact) of object;
|
TVpContactEvent = procedure(Sender: TObject; Contact: TVpContact) of object;
|
||||||
@ -87,8 +87,8 @@ type
|
|||||||
TVpOwnerDrawContactEvent = procedure(Sender: TObject; const Canvas: TCanvas;
|
TVpOwnerDrawContactEvent = procedure(Sender: TObject; const Canvas: TCanvas;
|
||||||
R: TRect; Contact: TVpContact; var Drawn: Boolean) of object;
|
R: TRect; Contact: TVpContact; var Drawn: Boolean) of object;
|
||||||
|
|
||||||
TVpCGColWidthChangeEvent = procedure(Sender: TObject;
|
TVpCGColWidthChangeEvent = procedure(Sender: TObject;
|
||||||
NewColWidth: Integer) of object;
|
NewColWidth: Integer) of object;
|
||||||
|
|
||||||
{ task events }
|
{ task events }
|
||||||
TVpBeforeEditTask = procedure(Sender: TObject; Task: TVpTask;
|
TVpBeforeEditTask = procedure(Sender: TObject; Task: TVpTask;
|
||||||
@ -97,7 +97,7 @@ type
|
|||||||
TVpAfterEditTask = procedure(Sender: TObject; Task: TVpTask) of object;
|
TVpAfterEditTask = procedure(Sender: TObject; Task: TVpTask) of object;
|
||||||
|
|
||||||
TVpEditTask = procedure(Sender: TObject; Task: TVpTask;
|
TVpEditTask = procedure(Sender: TObject; Task: TVpTask;
|
||||||
Resource: TVpResource; var AllowIt: Boolean) of object;
|
Resource: TVpResource; var AllowIt: Boolean) of object;
|
||||||
|
|
||||||
TVpOwnerDrawTask = procedure(Sender: TObject; const Canvas: TCanvas;
|
TVpOwnerDrawTask = procedure(Sender: TObject; const Canvas: TCanvas;
|
||||||
R: TRect; Task: TVpTask; var Drawn: Boolean) of object;
|
R: TRect; Task: TVpTask; var Drawn: Boolean) of object;
|
||||||
@ -113,8 +113,8 @@ type
|
|||||||
TVpEditEvent = procedure(Sender: TObject; Event: TVpEvent;
|
TVpEditEvent = procedure(Sender: TObject; Event: TVpEvent;
|
||||||
Resource:TVpResource; var AllowIt: Boolean) of object;
|
Resource:TVpResource; var AllowIt: Boolean) of object;
|
||||||
|
|
||||||
TVpOnAddNewEvent = procedure (Sender: TObject;
|
TVpOnAddNewEvent = procedure (Sender: TObject;
|
||||||
Event: TVpEvent) of object;
|
Event: TVpEvent) of object;
|
||||||
|
|
||||||
{ resource events }
|
{ resource events }
|
||||||
|
|
||||||
@ -229,7 +229,7 @@ type
|
|||||||
FOnDisconnect : TNotifyEvent;
|
FOnDisconnect : TNotifyEvent;
|
||||||
FOnAlert : TVpEventEvent;
|
FOnAlert : TVpEventEvent;
|
||||||
FOnResourceChange : TVpResourceEvent;
|
FOnResourceChange : TVpResourceEvent;
|
||||||
FOnDateChanged : TVpDateChangedEvent;
|
FOnDateChanged : TVpDateChangedEvent;
|
||||||
FOnPlaySound : TVpPlaySoundEvent;
|
FOnPlaySound : TVpPlaySoundEvent;
|
||||||
|
|
||||||
procedure dsOnTimer(Sender: TObject);
|
procedure dsOnTimer(Sender: TObject);
|
||||||
@ -243,6 +243,7 @@ type
|
|||||||
procedure SetDayBuffer(Value: Integer);
|
procedure SetDayBuffer(Value: Integer);
|
||||||
procedure SetRange(StartTime, EndTime: TDateTime);
|
procedure SetRange(StartTime, EndTime: TDateTime);
|
||||||
|
|
||||||
|
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||||
procedure NotifyLinked;
|
procedure NotifyLinked;
|
||||||
procedure LinkToControls(AOwner: TComponent);
|
procedure LinkToControls(AOwner: TComponent);
|
||||||
procedure UnlinkFromControls(AOwner: TComponent);
|
procedure UnlinkFromControls(AOwner: TComponent);
|
||||||
@ -310,8 +311,8 @@ type
|
|||||||
read FOnAlert write FOnAlert;
|
read FOnAlert write FOnAlert;
|
||||||
property OnConnect: TNotifyEvent
|
property OnConnect: TNotifyEvent
|
||||||
read FOnConnect write FOnConnect;
|
read FOnConnect write FOnConnect;
|
||||||
property OnDateChanged: TVpDateChangedEvent
|
property OnDateChanged: TVpDateChangedEvent
|
||||||
read FOnDateChanged write FOnDateChanged;
|
read FOnDateChanged write FOnDateChanged;
|
||||||
property OnDisconnect: TNotifyEvent
|
property OnDisconnect: TNotifyEvent
|
||||||
read FOnDisconnect write FOnDisconnect;
|
read FOnDisconnect write FOnDisconnect;
|
||||||
property OnResourceChange: TVpResourceEvent
|
property OnResourceChange: TVpResourceEvent
|
||||||
@ -324,11 +325,12 @@ type
|
|||||||
{TVpLinkableControl}
|
{TVpLinkableControl}
|
||||||
TVpLinkableControl = class(TVpCustomControl)
|
TVpLinkableControl = class(TVpCustomControl)
|
||||||
protected{private}
|
protected{private}
|
||||||
FDataStore : TVpCustomDataStore;
|
FDataStore: TVpCustomDataStore;
|
||||||
FReadOnly : Boolean;
|
FReadOnly: Boolean;
|
||||||
FControlLink : TVpControlLink;
|
FControlLink: TVpControlLink;
|
||||||
FLastPrintLine : Integer;
|
FLastPrintLine: Integer;
|
||||||
function CheckCreateResource : Boolean;
|
function CheckCreateResource : Boolean;
|
||||||
|
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||||
procedure SetDataStore (const Value : TVpCustomDataStore); virtual;
|
procedure SetDataStore (const Value : TVpCustomDataStore); virtual;
|
||||||
procedure SetControlLink (const Value : TVpControlLink);
|
procedure SetControlLink (const Value : TVpControlLink);
|
||||||
procedure CMEnter(var Msg: {$IFDEF DELPHI}TMessage{$ELSE}TLMessage{$ENDIF}); message CM_ENTER;
|
procedure CMEnter(var Msg: {$IFDEF DELPHI}TMessage{$ELSE}TLMessage{$ENDIF}); message CM_ENTER;
|
||||||
@ -350,15 +352,15 @@ type
|
|||||||
property DataStore: TVpCustomDataStore read FDataStore write SetDataStore;
|
property DataStore: TVpCustomDataStore read FDataStore write SetDataStore;
|
||||||
property ControlLink: TVpControlLink read FControlLink write SetControlLink;
|
property ControlLink: TVpControlLink read FControlLink write SetControlLink;
|
||||||
|
|
||||||
property Color;
|
property Color;
|
||||||
property Font;
|
property Font;
|
||||||
property ParentColor;
|
property ParentColor;
|
||||||
property ParentFont;
|
property ParentFont;
|
||||||
property ParentShowHint;
|
property ParentShowHint;
|
||||||
|
|
||||||
property AfterEnter;
|
property AfterEnter;
|
||||||
property AfterExit;
|
property AfterExit;
|
||||||
property OnMouseWheel;
|
property OnMouseWheel;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -369,7 +371,7 @@ type
|
|||||||
FPrinter : TVpPrinter;
|
FPrinter : TVpPrinter;
|
||||||
FDataStore : TVpCustomDataStore;
|
FDataStore : TVpCustomDataStore;
|
||||||
FOnGetVariable : TVpOnGetVariableEvent;
|
FOnGetVariable : TVpOnGetVariableEvent;
|
||||||
FOnNoLocalizationFile : TVpNoLocalizationFile;
|
FOnNoLocalizationFile : TVpNoLocalizationFile;
|
||||||
FOnPageStart : TVpOnPageStartEvent;
|
FOnPageStart : TVpOnPageStartEvent;
|
||||||
FOnPageEnd : TVpOnPageEndEvent;
|
FOnPageEnd : TVpOnPageEndEvent;
|
||||||
FLocalization : TVpLocalization;
|
FLocalization : TVpLocalization;
|
||||||
@ -433,10 +435,10 @@ begin
|
|||||||
FResources := TVpResources.Create(Self);
|
FResources := TVpResources.Create(Self);
|
||||||
FTimeRange := TVpTimeRange.Create(Self);
|
FTimeRange := TVpTimeRange.Create(Self);
|
||||||
FCategoryColorMap := TVpCategoryColorMap.Create;
|
FCategoryColorMap := TVpCategoryColorMap.Create;
|
||||||
FActiveDate := Now;
|
FActiveDate := Now;
|
||||||
FDayBuffer := 31; {One full month before and after the current date. }
|
FDayBuffer := 31; {One full month before and after the current date. }
|
||||||
FTimeRange.StartTime := Now - FDayBuffer;
|
FTimeRange.StartTime := Now - FDayBuffer;
|
||||||
FTimeRange.EndTime := Now + FDayBuffer;
|
FTimeRange.EndTime := Now + FDayBuffer;
|
||||||
|
|
||||||
FPlayEventSounds := true;
|
FPlayEventSounds := true;
|
||||||
|
|
||||||
@ -600,16 +602,21 @@ begin
|
|||||||
Result := FMediaFolder <> '';
|
Result := FMediaFolder <> '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TVpCustomDatastore.Notification(AComponent: TComponent; Operation: TOperation);
|
||||||
|
begin
|
||||||
|
inherited Notification(AComponent, Operation);
|
||||||
|
if (Operation = opRemove) and (AComponent = FLinkedOwner) then
|
||||||
|
FLinkedOwner := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TVpCustomDataStore.NotifyLinked;
|
procedure TVpCustomDataStore.NotifyLinked;
|
||||||
var
|
var
|
||||||
i : Integer;
|
i: Integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
for i := 0 to FNotifiers.Count - 1 do
|
for i := 0 to FNotifiers.Count - 1 do
|
||||||
if Assigned (FNotifiers[i]) then
|
if Assigned(FNotifiers[i]) then
|
||||||
PostMessage (PVpWatcher (FNotifiers[i]).Handle, Vp_DataStoreChanged, 0, 0);
|
PostMessage(PVpWatcher(FNotifiers[i]).Handle, Vp_DataStoreChanged, 0, 0);
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpCustomDataStore.SetActiveDate(Value: TDateTime);
|
procedure TVpCustomDataStore.SetActiveDate(Value: TDateTime);
|
||||||
var
|
var
|
||||||
@ -632,8 +639,8 @@ begin
|
|||||||
RefreshEvents;
|
RefreshEvents;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Assigned(FOnDateChanged) then
|
if Assigned(FOnDateChanged) then
|
||||||
FOnDateChanged(Self, FActiveDate);
|
FOnDateChanged(Self, FActiveDate);
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
@ -675,9 +682,9 @@ begin
|
|||||||
if FResource = nil then
|
if FResource = nil then
|
||||||
Exit;
|
Exit;
|
||||||
FResourceID := Value;
|
FResourceID := Value;
|
||||||
RefreshEvents;
|
RefreshEvents;
|
||||||
RefreshContacts;
|
RefreshContacts;
|
||||||
RefreshTasks;
|
RefreshTasks;
|
||||||
if Assigned(FOnResourceChange) then
|
if Assigned(FOnResourceChange) then
|
||||||
FOnResourceChange(Self, FResource);
|
FOnResourceChange(Self, FResource);
|
||||||
if not Loading then
|
if not Loading then
|
||||||
@ -690,12 +697,12 @@ procedure TVpCustomDataStore.SetResource(Value: TVpResource);
|
|||||||
begin
|
begin
|
||||||
if Value <> FResource then begin
|
if Value <> FResource then begin
|
||||||
FResource := Value;
|
FResource := Value;
|
||||||
if FResource <> nil then begin
|
if FResource <> nil then begin
|
||||||
FResourceID := FResource.ResourceID;
|
FResourceID := FResource.ResourceID;
|
||||||
RefreshEvents;
|
RefreshEvents;
|
||||||
RefreshContacts;
|
RefreshContacts;
|
||||||
RefreshTasks;
|
RefreshTasks;
|
||||||
end else
|
end else
|
||||||
FResourceID := -1;
|
FResourceID := -1;
|
||||||
if not Loading then
|
if not Loading then
|
||||||
NotifyDependents;
|
NotifyDependents;
|
||||||
@ -769,37 +776,33 @@ begin
|
|||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
procedure TVpCustomDataStore.PurgeResource(Res: TVpResource);
|
procedure TVpCustomDataStore.PurgeResource(Res: TVpResource);
|
||||||
begin
|
begin
|
||||||
Unused(Res);
|
Unused(Res);
|
||||||
if not Loading then
|
if not Loading then
|
||||||
NotifyDependents;
|
NotifyDependents;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpCustomDataStore.PurgeEvents(Res: TVpResource);
|
procedure TVpCustomDataStore.PurgeEvents(Res: TVpResource);
|
||||||
begin
|
begin
|
||||||
Res.Schedule.ClearEvents;
|
Res.Schedule.ClearEvents;
|
||||||
if not Loading then
|
if not Loading then
|
||||||
NotifyDependents;
|
NotifyDependents;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpCustomDataStore.PurgeContacts(Res: TVpResource);
|
procedure TVpCustomDataStore.PurgeContacts(Res: TVpResource);
|
||||||
begin
|
begin
|
||||||
Res.Contacts.ClearContacts;
|
Res.Contacts.ClearContacts;
|
||||||
if not Loading then
|
if not Loading then
|
||||||
NotifyDependents;
|
NotifyDependents;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpCustomDataStore.PurgeTasks(Res: TVpResource);
|
procedure TVpCustomDataStore.PurgeTasks(Res: TVpResource);
|
||||||
begin
|
begin
|
||||||
Res.Tasks.ClearTasks;
|
Res.Tasks.ClearTasks;
|
||||||
if not Loading then
|
if not Loading then
|
||||||
NotifyDependents;
|
NotifyDependents;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpCustomDatastore.UpdateGroupEvents;
|
procedure TVpCustomDatastore.UpdateGroupEvents;
|
||||||
var
|
var
|
||||||
@ -1034,11 +1037,8 @@ begin
|
|||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
OnChange := ResourceChanged;
|
OnChange := ResourceChanged;
|
||||||
|
FResourceUpdateStyle := ruOnChange;
|
||||||
FResourceUpdateStyle := ruOnChange;
|
|
||||||
|
|
||||||
Style := csDropDownList;
|
Style := csDropDownList;
|
||||||
|
|
||||||
DoubleBuffered := true;
|
DoubleBuffered := true;
|
||||||
|
|
||||||
{ If the ResourceCombo is being dropped onto a form for the first }
|
{ If the ResourceCombo is being dropped onto a form for the first }
|
||||||
@ -1059,15 +1059,15 @@ end;
|
|||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
{$IFNDEF LCL}
|
{$IFNDEF LCL}
|
||||||
procedure TVpResourceCombo.CNCommand (var Msg: TWMCommand);
|
procedure TVpResourceCombo.CNCommand (var Msg: TWMCommand);
|
||||||
begin
|
begin
|
||||||
if Msg.NotifyCode = CBN_CLOSEUP then begin
|
if Msg.NotifyCode = CBN_CLOSEUP then begin
|
||||||
if (FResourceUpdateStyle = ruOnDropDownClose) then
|
if (FResourceUpdateStyle = ruOnDropDownClose) then
|
||||||
ResourceChanged (Self)
|
ResourceChanged(Self)
|
||||||
else
|
else
|
||||||
inherited;
|
inherited;
|
||||||
end else
|
end else
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{=====}
|
{=====}
|
||||||
@ -1132,27 +1132,29 @@ begin
|
|||||||
//Empty on purpose
|
//Empty on purpose
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
procedure TVpResourceCombo.SetResourceUpdateStyle (
|
procedure TVpResourceCombo.SetResourceUpdateStyle(const v: TVpResourceUpdate);
|
||||||
const v : TVpResourceUpdate);
|
begin
|
||||||
begin
|
if v <> FResourceUpdateStyle then begin
|
||||||
if v <> FResourceUpdateStyle then begin
|
FResourceUpdateStyle := v;
|
||||||
FResourceUpdateStyle := v;
|
case FResourceUpdateStyle of
|
||||||
case FResourceUpdateStyle of
|
ruOnChange:
|
||||||
ruOnChange : begin
|
begin
|
||||||
OnChange := ResourceChanged;
|
OnChange := ResourceChanged;
|
||||||
OnExit := nil;
|
OnExit := nil;
|
||||||
end;
|
end;
|
||||||
ruOnExit : begin
|
ruOnExit:
|
||||||
OnChange := nil;
|
begin
|
||||||
OnExit := ResourceChanged;
|
OnChange := nil;
|
||||||
end;
|
OnExit := ResourceChanged;
|
||||||
ruOnDropDownClose : begin
|
end;
|
||||||
OnChange := nil;
|
ruOnDropDownClose:
|
||||||
OnExit := nil;
|
begin
|
||||||
end;
|
OnChange := nil;
|
||||||
end;
|
OnExit := nil;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
procedure TVpResourceCombo.SetDataStore(const Value: TVpCustomDataStore);
|
procedure TVpResourceCombo.SetDataStore(const Value: TVpCustomDataStore);
|
||||||
@ -1181,8 +1183,8 @@ var
|
|||||||
I: Integer;
|
I: Integer;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
{ If the control is being dropped onto a form for the first time then }
|
{ If the control is being dropped onto a form for the first time then
|
||||||
{ Auto connect to the first ControlLink component found }
|
auto-connect to the first ControlLink component found }
|
||||||
if (csDesigning in ComponentState) and not (csLoading in ComponentState) then
|
if (csDesigning in ComponentState) and not (csLoading in ComponentState) then
|
||||||
begin
|
begin
|
||||||
I := 0;
|
I := 0;
|
||||||
@ -1204,58 +1206,69 @@ begin
|
|||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
function TVpLinkableControl.CheckCreateResource : Boolean;
|
function TVpLinkableControl.CheckCreateResource : Boolean;
|
||||||
var
|
var
|
||||||
ResEdit : TVpResourceEditDialog;
|
ResEdit: TVpResourceEditDialog;
|
||||||
frmSelectResource : TfrmSelectResource;
|
frmSelectResource: TfrmSelectResource;
|
||||||
|
begin
|
||||||
begin
|
Result := False;
|
||||||
Result := False;
|
if not Assigned(DataStore) then
|
||||||
if not Assigned (DataStore) then
|
Exit;
|
||||||
Exit;
|
if not Assigned(DataStore.Resource) then begin
|
||||||
if not Assigned (DataStore.Resource) then begin
|
if DataStore.Resources.Count > 0 then begin
|
||||||
if DataStore.Resources.Count > 0 then begin
|
{ No resource is selected, select one }
|
||||||
{ No resource is selected, select one }
|
if MessageDlg(RSSelectResource, mtConfirmation, [mbYes, mbNo], 0) = mrYes then
|
||||||
if MessageDlg (RSSelectResource, mtConfirmation,
|
begin
|
||||||
[mbYes, mbNo], 0) = mrYes then begin
|
frmSelectResource := TfrmSelectResource.Create(Self);
|
||||||
frmSelectResource := TfrmSelectResource.Create (Self);
|
try
|
||||||
try
|
frmSelectResource.VpResourceCombo1.DataStore := DataStore;
|
||||||
frmSelectResource.VpResourceCombo1.DataStore := DataStore;
|
frmSelectResource.VpResourceEditDialog1.DataStore := DataStore;
|
||||||
frmSelectResource.VpResourceEditDialog1.DataStore := DataStore;
|
if frmSelectResource.ShowModal = mrOk then begin
|
||||||
if frmSelectResource.ShowModal = mrOk then begin
|
Result := True;
|
||||||
Result := True;
|
end else
|
||||||
end else
|
Exit;
|
||||||
Exit;
|
finally
|
||||||
finally
|
frmSelectResource.Free;
|
||||||
frmSelectResource.Free;
|
end;
|
||||||
end;
|
end else
|
||||||
end else
|
Exit;
|
||||||
Exit;
|
end else
|
||||||
end else begin
|
begin
|
||||||
{ There are no resources at all, add one }
|
{ There are no resources at all, add one }
|
||||||
if MessageDlg (RSAddNewResource, mtConfirmation,
|
if MessageDlg(RSAddNewResource, mtConfirmation, [mbYes, mbNo], 0) = mrYes then
|
||||||
[mbYes, mbNo], 0) = mrYes then begin
|
begin
|
||||||
ResEdit := TVpResourceEditDialog.Create (Self);
|
ResEdit := TVpResourceEditDialog.Create(Self);
|
||||||
try
|
try
|
||||||
ResEdit.DataStore := DataStore;
|
ResEdit.DataStore := DataStore;
|
||||||
Result := ResEdit.AddNewResource;
|
Result := ResEdit.AddNewResource;
|
||||||
Exit;
|
Exit;
|
||||||
finally
|
finally
|
||||||
ResEdit.Free;
|
ResEdit.Free;
|
||||||
end;
|
end;
|
||||||
end else
|
end else
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
end else
|
end else
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{=====}
|
function TVpLinkableControl.GetLastPrintLine: Integer;
|
||||||
function TVpLinkableControl.GetLastPrintLine : Integer;
|
|
||||||
begin
|
begin
|
||||||
Result := FLastPrintLine;
|
Result := FLastPrintLine;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
procedure TVpLinkableControl.Notification(AComponent: TComponent;
|
||||||
|
Operation: TOperation);
|
||||||
|
begin
|
||||||
|
inherited Notification(AComponent, Operation);
|
||||||
|
if (Operation = opRemove) then begin
|
||||||
|
if (AComponent = FDatastore) then
|
||||||
|
FDatastore := nil;
|
||||||
|
if (AComponent = FControlLink) then
|
||||||
|
FControlLink := nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TVpLinkableControl.SetDataStore(const Value: TVpCustomDataStore);
|
procedure TVpLinkableControl.SetDataStore(const Value: TVpCustomDataStore);
|
||||||
begin
|
begin
|
||||||
if Value = nil then begin
|
if Value = nil then begin
|
||||||
@ -1398,7 +1411,7 @@ procedure TVpControlLink.Detach(Sender: TComponent);
|
|||||||
var
|
var
|
||||||
I: Integer;
|
I: Integer;
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
for I := 0 to pred(DependentList.Count) do
|
for I := 0 to pred(DependentList.Count) do
|
||||||
// if TVpDependentInfo(DependentList.List^[I]).Component = Sender then
|
// if TVpDependentInfo(DependentList.List^[I]).Component = Sender then
|
||||||
if TVpDependentInfo(DependentList[I]).Component = Sender then
|
if TVpDependentInfo(DependentList[I]).Component = Sender then
|
||||||
@ -1410,9 +1423,9 @@ begin
|
|||||||
TVpLinkableControl(Sender).ControlLink := nil;
|
TVpLinkableControl(Sender).ControlLink := nil;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
except
|
except
|
||||||
// swallow exceptions
|
// swallow exceptions
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
@ -1503,9 +1516,9 @@ begin
|
|||||||
if not FileExists(fn) then begin
|
if not FileExists(fn) then begin
|
||||||
if Assigned(FOnNoLocalizationFile) then
|
if Assigned(FOnNoLocalizationFile) then
|
||||||
FOnNoLocalizationFile(Self, fn);
|
FOnNoLocalizationFile(Self, fn);
|
||||||
end else
|
end else
|
||||||
FLocalization.LoadFromFile(fn, False);
|
FLocalization.LoadFromFile(fn, False);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
@ -723,7 +723,7 @@ begin
|
|||||||
AMenu.Add(newItem);
|
AMenu.Add(newItem);
|
||||||
|
|
||||||
newSubItem := TMenuItem.Create(AMenu.Owner);
|
newSubItem := TMenuItem.Create(AMenu.Owner);
|
||||||
newSubItem.Caption := 'none';
|
newSubItem.Caption := RSNoOverlayedEvents;
|
||||||
newSubItem.OnClick := AEventHandler;
|
newSubItem.OnClick := AEventHandler;
|
||||||
newSubItem.GroupIndex := 1;
|
newSubItem.GroupIndex := 1;
|
||||||
newSubItem.AutoCheck := true;
|
newSubItem.AutoCheck := true;
|
||||||
|
@ -154,6 +154,7 @@ resourcestring
|
|||||||
RSStartEndTimeError = 'Incorrect order of start and end times. ' +
|
RSStartEndTimeError = 'Incorrect order of start and end times. ' +
|
||||||
'Do you want to flip them?';
|
'Do you want to flip them?';
|
||||||
RSCannotEditOverlayedEvent= 'Cannot edit this overlayed event.';
|
RSCannotEditOverlayedEvent= 'Cannot edit this overlayed event.';
|
||||||
|
RSNoOverlayedEvents = 'none';
|
||||||
|
|
||||||
{Task Specific}
|
{Task Specific}
|
||||||
RSConfirmDeleteTask = 'Delete this task from your list?';
|
RSConfirmDeleteTask = 'Delete this task from your list?';
|
||||||
|
Reference in New Issue
Block a user