|
From: Carlo B. <car...@us...> - 2004-11-17 20:59:59
|
Update of /cvsroot/instantobjects/Source/Design In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22650/Source/Design Modified Files: InstantAttributeEditor.pas InstantModelExpert.pas InstantModelExplorer.dfm Log Message: VERSION 1.6.7 - Info into Readme.txt Index: InstantModelExplorer.dfm =================================================================== RCS file: /cvsroot/instantobjects/Source/Design/InstantModelExplorer.dfm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InstantModelExplorer.dfm 20 Jul 2004 11:07:49 -0000 1.2 --- InstantModelExplorer.dfm 17 Nov 2004 20:59:49 -0000 1.3 *************** *** 17,21 **** OldCreateOrder = True Position = poScreenCenter - OnCreate = FormCreate OnShow = FormShow PixelsPerInch = 96 --- 17,20 ---- Index: InstantAttributeEditor.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Design/InstantAttributeEditor.pas,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** InstantAttributeEditor.pas 1 Nov 2004 08:25:44 -0000 1.7 --- InstantAttributeEditor.pas 17 Nov 2004 20:59:49 -0000 1.8 *************** *** 26,29 **** --- 26,30 ---- * Contributor(s): * Carlo Barazzetta, Adrea Petrelli: porting Kylix + * Steven Mitchell: updating for OFExpt in MM7 * * ***** END LICENSE BLOCK ***** *) *************** *** 47,50 **** --- 48,53 ---- type TInstantStringsEvent = procedure(Sender: TObject; Items: TStrings) of object; + TInstantAttrStringsEvent = procedure(Sender: TObject; const ClassName: String; + Items: TStrings) of object; TInstantAttributeEditorForm = class(TInstantEditForm) *************** *** 110,116 **** --- 113,121 ---- procedure ExternalLinkedNameEditEnter(Sender: TObject); private + FInMM: boolean; // True if in ModelMaker, default is False FLimited: Boolean; FModel: TInstantCodeModel; FOnLoadClasses: TInstantStringsEvent; + FOnLoadClassAttributes: TInstantAttrStringsEvent; function GetSubject: TInstantCodeAttribute; procedure SetSubject(const Value: TInstantCodeAttribute); *************** *** 119,123 **** protected procedure LoadClasses; ! procedure LoadClassAttributes; procedure LoadData; override; procedure LoadEnums(TypeInfo: PTypeInfo; Items: TStrings; --- 124,128 ---- protected procedure LoadClasses; ! procedure LoadClassAttributes; procedure LoadData; override; procedure LoadEnums(TypeInfo: PTypeInfo; Items: TStrings; *************** *** 132,138 **** --- 137,145 ---- procedure UpdateControls; public + property InMM: boolean read FInMM write FInMM; property Limited: Boolean read FLimited write SetLimited; property Model: TInstantCodeModel read FModel write SetModel; property OnLoadClasses: TInstantStringsEvent read FOnLoadClasses write FOnLoadClasses; + property OnLoadClassAttributes: TInstantAttrStringsEvent read FOnLoadClassAttributes write FOnLoadClassAttributes; property Subject: TInstantCodeAttribute read GetSubject write SetSubject; end; *************** *** 152,155 **** --- 159,163 ---- PageControl.ActivePage := DefinitionSheet; ActiveControl := NameEdit; + FInMM := False; end; *************** *** 328,332 **** end; end; ! inherited; end; --- 336,343 ---- end; end; ! if InMM then ! SaveData ! else ! inherited; end; *************** *** 433,439 **** with TypeEdit do SubjectExposer.AssignFieldValue(Field, Text); LoadVisibilities; LoadIsExternal; - UpdateControls; end; --- 444,452 ---- with TypeEdit do SubjectExposer.AssignFieldValue(Field, Text); + // Controls need to be enabled first to + // reliably load combo dropdown lists in MM OFExpt + UpdateControls; LoadVisibilities; LoadIsExternal; end; *************** *** 460,469 **** var HasName, HasClass, HasExternalStoredName, HasExternalLinkedName: Boolean; ! IsComplex, IsContainer, IsExternal, IsMaskable, IsString, IsValid: Boolean; begin ! if (Subject.AttributeType<>atParts) and (Subject.AttributeType<>atReferences) then Subject.IsExternal := ceNo; ! if Subject.IsExternal = ceLinked then Subject.ExternalStoredName := ''; ! if Subject.IsExternal = ceStored then Subject.ExternalLinkedName := ''; HasName := NameEdit.Text <> ''; --- 473,485 ---- var HasName, HasClass, HasExternalStoredName, HasExternalLinkedName: Boolean; ! IsComplex, IsContainer, CanBeExternal, IsExternal, IsMaskable, IsString, IsValid: Boolean; begin ! CanBeExternal := Subject.AttributeType in [atPart, atParts, atReferences]; ! if not CanBeExternal then Subject.IsExternal := ceNo; ! if Subject.IsExternal = ceLinked then ! Subject.ExternalStoredName := ''; ! if Subject.IsExternal = ceStored then ! Subject.ExternalLinkedName := ''; HasName := NameEdit.Text <> ''; *************** *** 478,482 **** IsString := Subject.AttributeType in [atString, atMemo]; IsValid := HasName and (not IsComplex or HasClass) and ! (not IsExternal or (HasExternalStoredName or HasExternalLinkedName) ); DisableSubControls(DefinitionSheet, Limited); --- 494,498 ---- IsString := Subject.AttributeType in [atString, atMemo]; IsValid := HasName and (not IsComplex or HasClass) and ! (not IsExternal or (HasExternalStoredName or HasExternalLinkedName)); DisableSubControls(DefinitionSheet, Limited); *************** *** 497,510 **** EnableCtrl(MethodRemoveCheckBox, IsContainer); ! EnableCtrl(IsExternalEdit, IsContainer); ! EnableCtrl(IsExternalLabel, IsContainer); end; ! EnableCtrl(StorageNameLabel, not (IsContainer and IsExternal) ); ! EnableCtrl(StorageNameEdit, not (IsContainer and IsExternal) ); ! EnableCtrl(ExternalLinkedNameLabel, IsContainer and (Subject.IsExternal=ceLinked) ); ! EnableCtrl(ExternalLinkedNameEdit, IsContainer and (Subject.IsExternal=ceLinked) ); ! EnableCtrl(ExternalStoredNameLabel, IsContainer and (Subject.IsExternal=ceStored) ); ! EnableCtrl(ExternalStoredNameEdit, IsContainer and (Subject.IsExternal=ceStored) ); EnableCtrl(SizeLabel, IsString); --- 513,526 ---- EnableCtrl(MethodRemoveCheckBox, IsContainer); ! EnableCtrl(IsExternalEdit, CanBeExternal); ! EnableCtrl(IsExternalLabel, CanBeExternal); end; ! EnableCtrl(StorageNameLabel, not IsExternal); ! EnableCtrl(StorageNameEdit, not IsExternal); ! EnableCtrl(ExternalLinkedNameLabel, IsExternal and (Subject.IsExternal = ceLinked)); ! EnableCtrl(ExternalLinkedNameEdit, IsExternal and (Subject.IsExternal = ceLinked)); ! EnableCtrl(ExternalStoredNameLabel, IsExternal and (Subject.IsExternal = ceStored)); ! EnableCtrl(ExternalStoredNameEdit, IsExternal and (Subject.IsExternal = ceStored)); EnableCtrl(SizeLabel, IsString); *************** *** 546,553 **** try Items.Clear; ! if Assigned(FModel) then ! if Assigned(FModel.FindClass(ObjectClassEdit.Text)) then ! for I := 0 to Pred(FModel.FindClass(ObjectClassEdit.Text).AttributeCount) do ! Items.Add(FModel.FindClass(ObjectClassEdit.Text).Attributes[i].Name); finally Items.EndUpdate; --- 562,574 ---- try Items.Clear; ! if Assigned(FOnLoadClassAttributes) then begin ! FOnLoadClassAttributes(Self, ObjectClassEdit.Text, Items); ! end ! else begin ! if Assigned(FModel) then ! if Assigned(FModel.FindClass(ObjectClassEdit.Text)) then ! for I := 0 to Pred(FModel.FindClass(ObjectClassEdit.Text).AttributeCount) do ! Items.Add(FModel.FindClass(ObjectClassEdit.Text).Attributes[i].Name); ! end; finally Items.EndUpdate; Index: InstantModelExpert.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Design/InstantModelExpert.pas,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** InstantModelExpert.pas 29 Jul 2004 20:43:15 -0000 1.4 --- InstantModelExpert.pas 17 Nov 2004 20:59:49 -0000 1.5 *************** *** 41,44 **** --- 41,46 ---- type + TIOMetaDataCheckState = (mcNeverChecked, mcCheckError, mcCheckCorrect); + { When the IDE is being shut down, items in the Database-menu are destroyed even if they don't belong to the menu. Since we want to *************** *** 76,79 **** --- 78,82 ---- FUpdateDisableCount: Integer; FUpdateTimer: TTimer; + MetaDataCheckState : TIOMetaDataCheckState; procedure ExplorerApplyClass(Sender: TObject; AClass: TInstantCodeClass; ChangeInfo: TInstantCodeClassChangeInfo); *************** *** 108,111 **** --- 111,115 ---- procedure EnumSources(Modules: TInterfaceList; Enumerator: TSourceEnumerator); + procedure CheckIOMetadataKeyword(const FileName, Source: string); procedure ExplorerItemClick(Sender: TObject); procedure GetModelModules(Modules: TInterfaceList); *************** *** 120,123 **** --- 124,128 ---- procedure IDEModuleNotification(Sender: TObject; NotifyCode: TNotifyCode; const FileName: string); + function IsProjectUnit(FileName: string): Boolean; function IsModelUnit(FileName: string): Boolean; procedure ShowExplorer; *************** *** 154,158 **** uses SysUtils, TypInfo, InstantDesignUtils, InstantUtils, InstantUnitSelect, ! Registry, InstantConnectionManager; const --- 159,163 ---- uses SysUtils, TypInfo, InstantDesignUtils, InstantUtils, InstantUnitSelect, ! Registry, InstantConnectionManager, Dialogs; const *************** *** 253,257 **** begin Result := Result + S + List[I]; ! S := ', '; end; end; --- 258,262 ---- begin Result := Result + S + List[I]; ! S := ', ' + sLineBreak + ' '; end; end; *************** *** 864,868 **** case NotifyCode of fnFileOpened: ! ; fnFileClosing: if IsModelUnit(FileName) then --- 869,874 ---- case NotifyCode of fnFileOpened: ! if IsProjectUnit(FileName) then ! MetaDataCheckState := mcNeverChecked; fnFileClosing: if IsModelUnit(FileName) then *************** *** 884,887 **** --- 890,898 ---- end; + function TInstantModelExpert.IsProjectUnit(FileName: string): Boolean; + begin + Result := Assigned(ActiveProject) and SameText(ActiveProject.FileName, FileName); + end; + function TInstantModelExpert.IsModelUnit(FileName: string): Boolean; var *************** *** 991,994 **** --- 1002,1013 ---- try CollectModules(Project, Modules, Units); + if MetaDataCheckState = mcNeverChecked then + begin + MetaDataCheckState := mcCheckCorrect; + EnumSources(Modules, CheckIOMetadataKeyword); + if MetaDataCheckState = mcCheckError then + MessageDlg(Format('WARNING: Project %s contains some class metadata without IOMETADATA keyword. Please refer to IOMETADATA_keyword.txt in instantobjects\doc folder.', + [FActiveProjectName]), mtWarning, [mbOK], 0); + end; Result := (CheckTime = 0) or ModuleModified(Project, CheckTime) or *************** *** 1147,1149 **** --- 1166,1174 ---- end; + procedure TInstantModelExpert.CheckIOMetadataKeyword(const FileName, Source: string); + begin + if pos('{ stored', Source) > 0 then + MetaDataCheckState := mcCheckError; + end; + end. |