From: <ah...@us...> - 2008-07-17 15:53:57
|
Revision: 11824 http://jvcl.svn.sourceforge.net/jvcl/?rev=11824&view=rev Author: ahuser Date: 2008-07-17 15:52:36 +0000 (Thu, 17 Jul 2008) Log Message: ----------- - The EditMask was not activated if the date was set using the Text property - Fixed JvDBLookupCombo bug that caused the Lookup to cancel every attempt to edit/insert into the Lookup DataSet Modified Paths: -------------- trunk/jvcl/run/JvDBLookup.pas trunk/jvcl/run/JvDatePickerEdit.pas Modified: trunk/jvcl/run/JvDBLookup.pas =================================================================== --- trunk/jvcl/run/JvDBLookup.pas 2008-07-14 15:39:33 UTC (rev 11823) +++ trunk/jvcl/run/JvDBLookup.pas 2008-07-17 15:52:36 UTC (rev 11824) @@ -3037,7 +3037,7 @@ procedure TJvDBLookupCombo.ListLinkDataChanged; begin if FDataLink.Active {and FDataLink.DataSet.IsLinkedTo(LookupSource)} then - if FListActive then + if FListActive and (FLookupLink.DataSet <> nil) and (FLookupLink.DataSet.State = dsBrowse) then DataLinkRecordChanged(nil); end; Modified: trunk/jvcl/run/JvDatePickerEdit.pas =================================================================== --- trunk/jvcl/run/JvDatePickerEdit.pas 2008-07-14 15:39:33 UTC (rev 11823) +++ trunk/jvcl/run/JvDatePickerEdit.pas 2008-07-17 15:52:36 UTC (rev 11824) @@ -917,11 +917,11 @@ try if ((EditMask = '') or (EditMask <> FMask)) and (Text = NoDateText) {and EditCanModify} then begin - Text := ''; + inherited Text := ''; RestoreMask; end; except - Text := ''; + inherited Text := ''; RestoreMask; raise; end; @@ -1213,6 +1213,8 @@ OldSep := SysUtils.DateSeparator; SysUtils.DateSeparator := Self.DateSeparator; try + if [csDesigning, csLoading] * ComponentState = [] then + RestoreMaskForKeyPress; inherited Text := AValue; finally SysUtils.DateSeparator := OldSep; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2008-07-18 18:05:46
|
Revision: 11825 http://jvcl.svn.sourceforge.net/jvcl/?rev=11825&view=rev Author: ahuser Date: 2008-07-18 18:05:43 +0000 (Fri, 18 Jul 2008) Log Message: ----------- Reverted last changed because they cause more trouble than healing. Modified Paths: -------------- trunk/jvcl/run/JvDBLookup.pas trunk/jvcl/run/JvDatePickerEdit.pas Modified: trunk/jvcl/run/JvDBLookup.pas =================================================================== --- trunk/jvcl/run/JvDBLookup.pas 2008-07-17 15:52:36 UTC (rev 11824) +++ trunk/jvcl/run/JvDBLookup.pas 2008-07-18 18:05:43 UTC (rev 11825) @@ -73,7 +73,6 @@ TLookupSourceLink = class(TDataLink) private FDataControl: TJvLookupControl; - FLockCount: Integer; protected procedure ActiveChanged; override; procedure LayoutChanged; override; @@ -822,15 +821,8 @@ procedure TLookupSourceLink.DataSetChanged; begin - if (FDataControl <> nil) and (FLockCount = 0) then - begin - Inc(FLockCount); - try - FDataControl.ListLinkDataChanged; - finally - Dec(FLockCount); - end; - end; + if FDataControl <> nil then + FDataControl.ListLinkDataChanged; end; //=== { TJvLookupControl } =================================================== @@ -3036,8 +3028,8 @@ procedure TJvDBLookupCombo.ListLinkDataChanged; begin - if FDataLink.Active {and FDataLink.DataSet.IsLinkedTo(LookupSource)} then - if FListActive and (FLookupLink.DataSet <> nil) and (FLookupLink.DataSet.State = dsBrowse) then + if FDataLink.Active and FDataLink.DataSet.IsLinkedTo(LookupSource) then + if FListActive then DataLinkRecordChanged(nil); end; Modified: trunk/jvcl/run/JvDatePickerEdit.pas =================================================================== --- trunk/jvcl/run/JvDatePickerEdit.pas 2008-07-17 15:52:36 UTC (rev 11824) +++ trunk/jvcl/run/JvDatePickerEdit.pas 2008-07-18 18:05:43 UTC (rev 11825) @@ -917,11 +917,11 @@ try if ((EditMask = '') or (EditMask <> FMask)) and (Text = NoDateText) {and EditCanModify} then begin - inherited Text := ''; + Text := ''; RestoreMask; end; except - inherited Text := ''; + Text := ''; RestoreMask; raise; end; @@ -1213,8 +1213,6 @@ OldSep := SysUtils.DateSeparator; SysUtils.DateSeparator := Self.DateSeparator; try - if [csDesigning, csLoading] * ComponentState = [] then - RestoreMaskForKeyPress; inherited Text := AValue; finally SysUtils.DateSeparator := OldSep; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jfu...@us...> - 2008-07-29 21:43:24
|
Revision: 11836 http://jvcl.svn.sourceforge.net/jvcl/?rev=11836&view=rev Author: jfudickar Date: 2008-07-29 21:43:22 +0000 (Tue, 29 Jul 2008) Log Message: ----------- Bugfix when closing Dialog Modified Paths: -------------- trunk/jvcl/run/JvPropertyStoreEditor.dfm trunk/jvcl/run/JvPropertyStoreEditor.pas Modified: trunk/jvcl/run/JvPropertyStoreEditor.dfm =================================================================== --- trunk/jvcl/run/JvPropertyStoreEditor.dfm 2008-07-29 19:57:59 UTC (rev 11835) +++ trunk/jvcl/run/JvPropertyStoreEditor.dfm 2008-07-29 21:43:22 UTC (rev 11836) @@ -13,6 +13,7 @@ OldCreateOrder = False Position = poScreenCenter OnCreate = FormCreate + OnDestroy = FormDestroy PixelsPerInch = 96 TextHeight = 13 end Modified: trunk/jvcl/run/JvPropertyStoreEditor.pas =================================================================== --- trunk/jvcl/run/JvPropertyStoreEditor.pas 2008-07-29 19:57:59 UTC (rev 11835) +++ trunk/jvcl/run/JvPropertyStoreEditor.pas 2008-07-29 21:43:22 UTC (rev 11836) @@ -39,6 +39,7 @@ type TJvPropertyStoreEditorForm = class(TForm) + procedure FormDestroy(Sender: TObject); procedure FormCreate(Sender: TObject); procedure CancelButtonClick(Sender: TObject); procedure JvInspectorAfterItemCreate(Sender: TObject; Item: @@ -134,9 +135,8 @@ if not Assigned(PropertyStore) then Exit; JvPropertyStoreEditorForm := TJvPropertyStoreEditorForm.Create(Application); - SavePropertyStore := TJvCustomPropertyStoreClass(PropertyStore.ClassType).Create(nil); + SavePropertyStore := PropertyStore.Clone(nil); try - SavePropertyStore.Assign(PropertyStore); JvPropertyStoreEditorForm.PropertyStore := SavePropertyStore; Result := JvPropertyStoreEditorForm.ShowModal = mrOk; if Result then @@ -159,6 +159,11 @@ type tAccessCustomPanel = class(tCustomPanel); +procedure TJvPropertyStoreEditorForm.FormDestroy(Sender: TObject); +begin + PropertyStore := NIL; +end; + procedure TJvPropertyStoreEditorForm.CreateFormControls; var BottomPanel, BottomButtonPanel : TWinControl; Button: TButton; @@ -640,7 +645,7 @@ procedure TJvPropertyStoreEditorForm.SetPropertyStore(const Value: TComponent); begin - if not Supports(Value, IJvPropertyEditorHandler) then + if Assigned(Value) and not Supports(Value, IJvPropertyEditorHandler) then Raise Exception.Create ('TJvPropertyStoreEditorForm.SetPropertyStore : PropertyStore must support IJvPropertyEditorHandler'); FPropertyStore := Value; FillTreeView(Value); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jfu...@us...> - 2008-07-29 22:55:19
|
Revision: 11837 http://jvcl.svn.sourceforge.net/jvcl/?rev=11837&view=rev Author: jfudickar Date: 2008-07-29 22:55:16 +0000 (Tue, 29 Jul 2008) Log Message: ----------- New Component : TJvPropertyStoreEditorControl The component is not registered or added to the packages because of the d5 incompatibility to "supports" calls Modified Paths: -------------- trunk/jvcl/run/JvPropertyStoreEditor.dfm trunk/jvcl/run/JvPropertyStoreEditor.pas Modified: trunk/jvcl/run/JvPropertyStoreEditor.dfm =================================================================== --- trunk/jvcl/run/JvPropertyStoreEditor.dfm 2008-07-29 21:43:22 UTC (rev 11836) +++ trunk/jvcl/run/JvPropertyStoreEditor.dfm 2008-07-29 22:55:16 UTC (rev 11837) @@ -13,7 +13,6 @@ OldCreateOrder = False Position = poScreenCenter OnCreate = FormCreate - OnDestroy = FormDestroy PixelsPerInch = 96 TextHeight = 13 end Modified: trunk/jvcl/run/JvPropertyStoreEditor.pas =================================================================== --- trunk/jvcl/run/JvPropertyStoreEditor.pas 2008-07-29 21:43:22 UTC (rev 11836) +++ trunk/jvcl/run/JvPropertyStoreEditor.pas 2008-07-29 22:55:16 UTC (rev 11837) @@ -32,16 +32,19 @@ {$IFDEF UNITVERSIONING} JclUnitVersioning, {$ENDIF UNITVERSIONING} - Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + {$IFDEF HAS_UNIT_VARIANTS} + Variants, + {$ENDIF HAS_UNIT_VARIANTS} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, JvExComCtrls, JvComCtrls, ExtCtrls, JvExControls, JvInspector, StdCtrls, JvExStdCtrls, JvListBox, JvPropertyStore, JvPropertyStoreEditorIntf, JvDynControlEngineIntf; + type - TJvPropertyStoreEditorForm = class(TForm) - procedure FormDestroy(Sender: TObject); - procedure FormCreate(Sender: TObject); - procedure CancelButtonClick(Sender: TObject); + TJvPropertyStoreEditorControl = class(TCustomControl) + procedure ControlDestroy(Sender: TObject); + procedure ControlCreate(Sender: TObject); procedure JvInspectorAfterItemCreate(Sender: TObject; Item: TJvCustomInspectorItem); procedure JvInspectorBeforeItemCreate(Sender: TObject; Data: @@ -53,26 +56,25 @@ procedure ListInsertButtonClick(Sender: TObject); procedure ListUpButtonClick(Sender: TObject); procedure PropertyStoreTreeViewEnter(Sender: TObject); - procedure OkButtonClick(Sender: TObject); procedure PropertyStoreTreeViewChange(Sender: TObject; Node: TTreeNode); procedure PropertyStoreTreeViewChanging(Sender: TObject; Node: TTreeNode; var AllowChange: Boolean); procedure RTTIInspectorEnter(Sender: TObject); private FInspectedObject: TPersistent; - FInspectedObjectEditorHandler: IJvPropertyEditorHandler; - FInspectedObjectListEditorHandler: IJvPropertyListEditorHandler; + FInspectedObjectEditorHandlerIntf: IJvPropertyEditorHandler; + FInspectedObjectListEditorHandlerIntf: IJvPropertyListEditorHandler; FPropertyStore: TComponent; - InfoGroupBoxDynControl: IJvDynControl; - InfoMemoDynControlData: IJvDynControlData; + InfoGroupBoxDynControlIntf: IJvDynControl; + InfoMemoDynControlDataIntf: IJvDynControlData; InfoPanel: TWinControl; Inspector: TWinControl; InspectorPanel: TWinControl; - ListBoxControlItems: IJvDynControlItems; - ListBoxControlItemIndex : IJvDynControlItemIndex; + ListBoxControlItemsIntf: IJvDynControlItems; + ListBoxControlItemIndexIntf: IJvDynControlItemIndex; ListPanel: TWinControl; - PropertyStoreTreeView: IJvDynControlTreeView; - RTTIInspectorControl: IJvDynControlRTTIInspectorControl; + PropertyStoreTreeViewIntf: IJvDynControlTreeView; + RTTIInspectorControlIntf: IJvDynControlRTTIInspectorControl; TreePanel: TWinControl; function GetPropCount(Instance: TPersistent): Integer; function GetPropName(Instance: TPersistent; Index: Integer): string; @@ -82,15 +84,16 @@ string): Boolean; property InspectedObject: TPersistent read FInspectedObject write SetInspectedObject; - property InspectedObjectEditorHandler: IJvPropertyEditorHandler read - FInspectedObjectEditorHandler; + property InspectedObjectEditorHandlerIntf: IJvPropertyEditorHandler read + FInspectedObjectEditorHandlerIntf; procedure FillListBox; protected ListInspectorPanel: TWinControl; - procedure CreateFormControls; + procedure CreateControls; procedure FillTreeView(GotoNodeObject: TPersistent = nil); procedure FillTreeViewByComponent(TreeNodes: TTreeNodes; Parent: TTreeNode; aPropertyStore: TPersistent); + procedure Notification(AComponent: TComponent; Operation: TOperation); override; function OnDisplayProperty(const aPropertyName : String): Boolean; procedure OnPropertyChange(var OldPropertyName, NewPropertyName : string); function OnTranslatePropertyName(const aPropertyName : String): string; @@ -98,10 +101,25 @@ public procedure GotoEditObject(EditObject: TPersistent); property InspectedObjectListEditorHandler: IJvPropertyListEditorHandler read - FInspectedObjectListEditorHandler; + FInspectedObjectListEditorHandlerIntf; property PropertyStore: TComponent read FPropertyStore write SetPropertyStore; end; +type + TJvPropertyStoreEditorForm = class(TForm) + procedure FormCreate(Sender: TObject); + private + FPropertyStore: TComponent; + FPropertyStoreEditorControl: TJvPropertyStoreEditorControl; + procedure CancelButtonClick(Sender: TObject); + procedure OkButtonClick(Sender: TObject); + procedure SetPropertyStore(const Value: TComponent); + protected + procedure CreateFormControls; + public + property PropertyStore: TComponent read FPropertyStore write SetPropertyStore; + end; + function EditPropertyStore(PropertyStore: TJvCustomPropertyStore): Boolean; {$IFDEF UNITVERSIONING} @@ -134,16 +152,16 @@ Result := false; if not Assigned(PropertyStore) then Exit; + SavePropertyStore := PropertyStore.Clone(nil); JvPropertyStoreEditorForm := TJvPropertyStoreEditorForm.Create(Application); - SavePropertyStore := PropertyStore.Clone(nil); try JvPropertyStoreEditorForm.PropertyStore := SavePropertyStore; Result := JvPropertyStoreEditorForm.ShowModal = mrOk; if Result then PropertyStore.Assign(SavePropertyStore); finally + JvPropertyStoreEditorForm.Free; SavePropertyStore.Free; - JvPropertyStoreEditorForm.Free; end; end; @@ -152,34 +170,11 @@ CreateFormControls; end; -procedure TJvPropertyStoreEditorForm.CancelButtonClick(Sender: TObject); -begin - // -end; - type tAccessCustomPanel = class(tCustomPanel); -procedure TJvPropertyStoreEditorForm.FormDestroy(Sender: TObject); -begin - PropertyStore := NIL; -end; - procedure TJvPropertyStoreEditorForm.CreateFormControls; var BottomPanel, BottomButtonPanel : TWinControl; Button: TButton; - TreeView: TWinControl; - TreeSplitter: TSplitter; - EditPanel: TWinControl; - ListSplitter: TSplitter; - DynControlDblClick : IJvDynControlDblClick; - ListButtonPanel: TWinControl; - ListBox: TWinControl; - InfoGroupBox: TWinControl; - InfoMemoPanel: TWinControl; - InfoMemo: TWinControl; - DynControlMemo: IJvDynControlMemo; - DynControlReadOnly: IJvDynControlReadOnly; - DynControl: IJvDynControl; begin BottomPanel := DefaultDynControlEngine.CreatePanelControl(Self, Self, 'BottomPanel', '', alBottom); BottomPanel.Height := 34; @@ -202,6 +197,61 @@ Button.Width := 75; Button.Height := 25; Button.ModalResult := mrCancel; + + FPropertyStoreEditorControl:= TJvPropertyStoreEditorControl.Create(self); + FPropertyStoreEditorControl.Parent := Self; + FPropertyStoreEditorControl.PropertyStore := PropertyStore; + FPropertyStoreEditorControl.Align := alClient; + + Caption := RSPropertyStoreEditorDialogCaptionEditProperties; + +end; + +procedure TJvPropertyStoreEditorForm.SetPropertyStore(const Value: TComponent); +begin + FPropertyStore := Value; + if Assigned(FPropertyStoreEditorControl) then + FPropertyStoreEditorControl.PropertyStore := PropertyStore; +end; + +procedure TJvPropertyStoreEditorForm.OkButtonClick(Sender: TObject); +begin + // Do Not Remove +end; + +procedure TJvPropertyStoreEditorForm.CancelButtonClick(Sender: TObject); +begin + // Do Not Remove +end; + + +procedure TJvPropertyStoreEditorControl.ControlCreate(Sender: TObject); +begin + CreateControls; +end; + +procedure TJvPropertyStoreEditorControl.ControlDestroy(Sender: TObject); +begin + PropertyStore := NIL; +end; + +procedure TJvPropertyStoreEditorControl.CreateControls; +var + TreeView: TWinControl; + TreeSplitter: TSplitter; + EditPanel: TWinControl; + ListSplitter: TSplitter; + DynControlDblClick : IJvDynControlDblClick; + ListButtonPanel: TWinControl; + ListBox: TWinControl; + InfoGroupBox: TWinControl; + InfoMemoPanel: TWinControl; + InfoMemo: TWinControl; + DynControlMemo: IJvDynControlMemo; + DynControlReadOnly: IJvDynControlReadOnly; + DynControl: IJvDynControl; + Button: TButton; +begin TreePanel := DefaultDynControlEngine.CreatePanelControl(Self, Self, 'TreePanel', '', alLeft); TreePanel.Width := 200; if TreePanel is TCustomPanel then @@ -209,15 +259,15 @@ tAccessCustomPanel(TreePanel).BevelOuter := bvNone; tAccessCustomPanel(TreePanel).BorderWidth := 3; end; - TreeView := DefaultDynControlEngine.CreateTreeViewControl(Self, TreePanel, 'PropertyStoreTreeView'); - Supports(TreeView, IJvDynControlTreeView, PropertyStoreTreeView); + TreeView := DefaultDynControlEngine.CreateTreeViewControl(Self, TreePanel, 'PropertyStoreTreeViewIntf'); + Supports(TreeView, IJvDynControlTreeView, PropertyStoreTreeViewIntf); TreeView.Align := alClient; - PropertyStoreTreeView.ControlSetHotTrack (True); - PropertyStoreTreeView.ControlSetOnChange (PropertyStoreTreeViewChange); + PropertyStoreTreeViewIntf.ControlSetHotTrack (True); + PropertyStoreTreeViewIntf.ControlSetOnChange (PropertyStoreTreeViewChange); Supports(TreeView, IJvDynControl, DynControl); DynControl.ControlSetOnEnter(PropertyStoreTreeViewEnter); - PropertyStoreTreeView.ControlSetOnChanging (PropertyStoreTreeViewChanging); - PropertyStoreTreeView.ControlSetSortType(stNone); + PropertyStoreTreeViewIntf.ControlSetOnChanging (PropertyStoreTreeViewChanging); + PropertyStoreTreeViewIntf.ControlSetSortType(stNone); TreeSplitter := TSplitter.Create(Self); TreeSplitter.Align := alLeft; TreeSplitter.Parent := Self; @@ -231,12 +281,11 @@ if InfoPanel is TCustomPanel then begin tAccessCustomPanel(InfoPanel).BevelOuter := bvNone; -// tAccessCustomPanel(InfoPanel).BorderWidth := 3; end; InfoPanel.Height := 100; InfoGroupBox := DefaultDynControlEngine.CreateGroupBoxControl(Self, InfoPanel, 'InfoGroupBox', 'Info'); InfoGroupBox.Align := alClient; - Supports(InfoGroupBox, IJvDynControl, InfoGroupBoxDynControl); + Supports(InfoGroupBox, IJvDynControl, InfoGroupBoxDynControlIntf); InfoMemoPanel := DefaultDynControlEngine.CreatePanelControl(Self, InfoGroupBox, 'InfoMemoPanel', '', alClient); if InfoMemoPanel is TCustomPanel then begin @@ -252,7 +301,7 @@ end; if Supports(InfoMemo, IJvDynControlReadOnly, DynControlReadOnly) then DynControlReadOnly.ControlSetReadOnly(True); - Supports(InfoMemo, IJvDynControlData, InfomemoDynControlData); + Supports(InfoMemo, IJvDynControlData, InfoMemoDynControlDataIntf); ListPanel := DefaultDynControlEngine.CreatePanelControl(Self, EditPanel, 'ListPanel', '', alClient); if ListPanel is TPanel then TPanel(ListPanel).BevelOuter := bvNone; @@ -288,8 +337,8 @@ Button.Width := 40; ListBox := DefaultDynControlEngine.CreateListBoxControl(Self, ListPanel, 'ListBox', Nil); ListBox.Align := alClient; - Supports (ListBox, IJvDynControlItems, ListBoxControlItems); - Supports (ListBox, IJvDynControlItemIndex, ListBoxControlItemIndex); + Supports (ListBox, IJvDynControlItems, ListBoxControlItemsIntf); + Supports (ListBox, IJvDynControlItemIndex, ListBoxControlItemIndexIntf); if Supports(ListBox, IJvDynControlDblClick, DynControlDblClick) then DynControlDblClick.ControlSetOnDblClick(ListEditButtonClick); InspectorPanel := DefaultDynControlEngine.CreatePanelControl(Self, EditPanel, 'InspectorPanel', '', alClient); @@ -298,10 +347,10 @@ Inspector := DefaultDynControlEngine.CreateRTTIInspectorControl(self, InspectorPanel, 'Inspector', OnDisplayProperty, OnTranslatePropertyName); - Supports (Inspector, IJvDynControlRTTIInspectorControl, RTTIInspectorControl); - RTTIInspectorControl.ControlOnPropertyChange := OnPropertyChange; + Supports (Inspector, IJvDynControlRTTIInspectorControl, RTTIInspectorControlIntf); + RTTIInspectorControlIntf.ControlOnPropertyChange := OnPropertyChange; Inspector.Align := alClient; - Supports(RTTIInspectorControl, IJvDynControl, DynControl); + Supports(RTTIInspectorControlIntf, IJvDynControl, DynControl); DynControl.ControlSetOnEnter(RTTIInspectorEnter); Caption := RSPropertyStoreEditorDialogCaptionEditProperties; @@ -309,26 +358,30 @@ SetInformation('', ''); end; -procedure TJvPropertyStoreEditorForm.FillTreeView(GotoNodeObject: TPersistent = +procedure TJvPropertyStoreEditorControl.FillTreeView(GotoNodeObject: TPersistent = nil); begin - PropertyStoreTreeView.ControlItems.BeginUpdate; + if (csDestroying in Componentstate) then + Exit; + if not Assigned(PropertyStoreTreeViewIntf) then + CreateControls; + PropertyStoreTreeViewIntf.ControlItems.BeginUpdate; try - PropertyStoreTreeView.ControlItems.Clear; - FillTreeViewByComponent(PropertyStoreTreeView.ControlItems, nil, PropertyStore); + PropertyStoreTreeViewIntf.ControlItems.Clear; + FillTreeViewByComponent(PropertyStoreTreeViewIntf.ControlItems, nil, PropertyStore); finally - PropertyStoreTreeView.ControlItems.EndUpdate; + PropertyStoreTreeViewIntf.ControlItems.EndUpdate; end; if not Assigned(GotoNodeObject ) then - if PropertyStoreTreeView.ControlItems.Count > 0 then - GotoEditObject(PropertyStoreTreeView.ControlItems[0].Data) + if PropertyStoreTreeViewIntf.ControlItems.Count > 0 then + GotoEditObject(PropertyStoreTreeViewIntf.ControlItems[0].Data) else GotoEditObject(nil) else GotoEditObject(GotoNodeObject); end; -procedure TJvPropertyStoreEditorForm.FillTreeViewByComponent(TreeNodes: +procedure TJvPropertyStoreEditorControl.FillTreeViewByComponent(TreeNodes: TTreeNodes; Parent: TTreeNode; aPropertyStore: TPersistent); var I: Integer; @@ -352,7 +405,7 @@ end else begin - RTTIInspectorControl.ControlInspectedObject := aPropertyStore; + RTTIInspectorControlIntf.ControlInspectedObject := aPropertyStore; for I := 0 to GetPropCount(aPropertyStore) - 1 do begin PropName := GetPropName(aPropertyStore,I); @@ -386,7 +439,7 @@ end; end; -function TJvPropertyStoreEditorForm.GetPropCount(Instance: TPersistent): +function TJvPropertyStoreEditorControl.GetPropCount(Instance: TPersistent): Integer; var Data: PTypeData; @@ -395,7 +448,7 @@ Result := Data.PropCount; end; -function TJvPropertyStoreEditorForm.GetPropName(Instance: TPersistent; Index: +function TJvPropertyStoreEditorControl.GetPropName(Instance: TPersistent; Index: Integer): string; var PropList: PPropList; @@ -420,53 +473,57 @@ {$ENDIF CLR} end; -procedure TJvPropertyStoreEditorForm.GotoEditObject(EditObject: TPersistent); +procedure TJvPropertyStoreEditorControl.GotoEditObject(EditObject: TPersistent); var TreeNode: TTreeNode; i: Integer; begin + if csDestroying in Componentstate then + Exit; if not Assigned(EditObject) then begin - PropertyStoreTreeViewChange(nil, PropertyStoreTreeView.ControlSelected); + PropertyStoreTreeViewChange(nil, PropertyStoreTreeViewIntf.ControlSelected); Exit; end; - for i := 0 to PropertyStoreTreeView.ControlItems.Count - 1 do + for i := 0 to PropertyStoreTreeViewIntf.ControlItems.Count - 1 do begin - TreeNode := PropertyStoreTreeView.ControlItems[i]; + TreeNode := PropertyStoreTreeViewIntf.ControlItems[i]; if Assigned(TreeNode.Data) and (TreeNode.Data = EditObject) then begin TreeNode.Expand(false); - PropertyStoreTreeView.ControlSelected := TreeNode; + PropertyStoreTreeViewIntf.ControlSelected := TreeNode; Exit; end; end; end; -procedure TJvPropertyStoreEditorForm.FillListBox; +procedure TJvPropertyStoreEditorControl.FillListBox; var DetailObjectEditorHandler: IJvPropertyEditorHandler; i: Integer; SubObj: TObject; begin - ListBoxControlItems.ControlItems.Clear; + if csDestroying in Componentstate then + Exit; + ListBoxControlItemsIntf.ControlItems.Clear; for i := 0 to InspectedObjectListEditorHandler.ListEditIntf_ObjectCount - 1 do begin SubObj := InspectedObjectListEditorHandler.ListEditIntf_GetObject(i); if Supports(SubObj, IJvPropertyEditorHandler, DetailObjectEditorHandler) then begin - ListBoxControlItems.ControlItems.AddObject(DetailObjectEditorHandler.EditIntf_GetVisibleObjectName + ' - ' + ' [' + inttostr(i + 1) + '] ', SubObj); + ListBoxControlItemsIntf.ControlItems.AddObject(DetailObjectEditorHandler.EditIntf_GetVisibleObjectName + ' - ' + ' [' + inttostr(i + 1) + '] ', SubObj); end; end; end; -procedure TJvPropertyStoreEditorForm.JvInspectorAfterItemCreate(Sender: +procedure TJvPropertyStoreEditorControl.JvInspectorAfterItemCreate(Sender: TObject; Item: TJvCustomInspectorItem); begin - if Assigned(Item) and Assigned(InspectedObjectEditorHandler) then - Item.DisplayName := InspectedObjectEditorHandler.EditIntf_TranslatePropertyName(Item.Name); + if Assigned(Item) and Assigned(InspectedObjectEditorHandlerIntf) then + Item.DisplayName := InspectedObjectEditorHandlerIntf.EditIntf_TranslatePropertyName(Item.Name); end; -procedure TJvPropertyStoreEditorForm.JvInspectorBeforeItemCreate(Sender: +procedure TJvPropertyStoreEditorControl.JvInspectorBeforeItemCreate(Sender: TObject; Data: TJvCustomInspectorData; var ItemClass: TJvInspectorItemClass); var @@ -484,13 +541,13 @@ end; end; -procedure TJvPropertyStoreEditorForm.ListCopyButtonClick(Sender: TObject); +procedure TJvPropertyStoreEditorControl.ListCopyButtonClick(Sender: TObject); var NewObject: TPersistent; begin if Assigned(InspectedObjectListEditorHandler) then begin - NewObject := InspectedObjectListEditorHandler.ListEditIntf_CloneNewObject(ListBoxControlItemIndex.ControlItemIndex); + NewObject := InspectedObjectListEditorHandler.ListEditIntf_CloneNewObject(ListBoxControlItemIndexIntf.ControlItemIndex); if Assigned(NewObject) then begin FillTreeView (NewObject); @@ -498,47 +555,47 @@ end; end; -procedure TJvPropertyStoreEditorForm.ListDeleteButtonClick(Sender: TObject); +procedure TJvPropertyStoreEditorControl.ListDeleteButtonClick(Sender: TObject); var EditObject: TPersistent; begin if Assigned(InspectedObjectListEditorHandler) then if (MessageDlg(RSPropertyStoreEditorDeleteEntry, mtConfirmation, [mbYes, mbNo], 0) = mrYes) then begin - EditObject := TPersistent(PropertyStoreTreeView.ControlSelected.Data); - InspectedObjectListEditorHandler.ListEditIntf_DeleteObject(ListBoxControlItemIndex.ControlItemIndex); + EditObject := TPersistent(PropertyStoreTreeViewIntf.ControlSelected.Data); + InspectedObjectListEditorHandler.ListEditIntf_DeleteObject(ListBoxControlItemIndexIntf.ControlItemIndex); FillTreeView (EditObject); end; end; -procedure TJvPropertyStoreEditorForm.ListDownButtonClick(Sender: TObject); +procedure TJvPropertyStoreEditorControl.ListDownButtonClick(Sender: TObject); var EditObject: TPersistent; Ind : Integer; begin - if Assigned(InspectedObjectListEditorHandler) and (ListBoxControlItemIndex.ControlItemIndex < ListBoxControlItems.ControlItems.Count) then + if Assigned(InspectedObjectListEditorHandler) and (ListBoxControlItemIndexIntf.ControlItemIndex < ListBoxControlItemsIntf.ControlItems.Count) then begin - EditObject := TPersistent(PropertyStoreTreeView.ControlSelected.Data); - Ind := ListBoxControlItemIndex.ControlItemIndex; - InspectedObjectListEditorHandler.ListEditIntf_MoveObjectPosition(ListBoxControlItemIndex.ControlItemIndex, ListBoxControlItemIndex.ControlItemIndex+1); + EditObject := TPersistent(PropertyStoreTreeViewIntf.ControlSelected.Data); + Ind := ListBoxControlItemIndexIntf.ControlItemIndex; + InspectedObjectListEditorHandler.ListEditIntf_MoveObjectPosition(ListBoxControlItemIndexIntf.ControlItemIndex, ListBoxControlItemIndexIntf.ControlItemIndex+1); FillTreeView (EditObject); - ListBoxControlItemIndex.ControlItemIndex := Ind +1; + ListBoxControlItemIndexIntf.ControlItemIndex := Ind +1; end; end; -procedure TJvPropertyStoreEditorForm.ListEditButtonClick(Sender: TObject); +procedure TJvPropertyStoreEditorControl.ListEditButtonClick(Sender: TObject); var EditObject: TPersistent; begin if Assigned(InspectedObjectListEditorHandler) then begin - EditObject := InspectedObjectListEditorHandler.ListEditIntf_GetObject(ListBoxControlItemIndex.ControlItemIndex); + EditObject := InspectedObjectListEditorHandler.ListEditIntf_GetObject(ListBoxControlItemIndexIntf.ControlItemIndex); if Assigned(EditObject) then GotoEditObject (EditObject); end; end; -procedure TJvPropertyStoreEditorForm.ListInsertButtonClick(Sender: TObject); +procedure TJvPropertyStoreEditorControl.ListInsertButtonClick(Sender: TObject); var newObject: TPersistent; begin @@ -549,51 +606,61 @@ end; end; -procedure TJvPropertyStoreEditorForm.ListUpButtonClick(Sender: TObject); +procedure TJvPropertyStoreEditorControl.ListUpButtonClick(Sender: TObject); var EditObject: TPersistent; Ind : Integer; begin - if Assigned(InspectedObjectListEditorHandler) and (ListBoxControlItemIndex.ControlItemIndex > 0) then + if Assigned(InspectedObjectListEditorHandler) and (ListBoxControlItemIndexIntf.ControlItemIndex > 0) then begin - EditObject := TPersistent(PropertyStoreTreeView.ControlSelected.Data); - Ind := ListBoxControlItemIndex.ControlItemIndex; - InspectedObjectListEditorHandler.ListEditIntf_MoveObjectPosition(ListBoxControlItemIndex.ControlItemIndex, ListBoxControlItemIndex.ControlItemIndex-1); + EditObject := TPersistent(PropertyStoreTreeViewIntf.ControlSelected.Data); + Ind := ListBoxControlItemIndexIntf.ControlItemIndex; + InspectedObjectListEditorHandler.ListEditIntf_MoveObjectPosition(ListBoxControlItemIndexIntf.ControlItemIndex, ListBoxControlItemIndexIntf.ControlItemIndex-1); FillTreeView (EditObject); - ListBoxControlItemIndex.ControlItemIndex := Ind -1; + ListBoxControlItemIndexIntf.ControlItemIndex := Ind -1; end; end; -procedure TJvPropertyStoreEditorForm.PropertyStoreTreeViewEnter(Sender: TObject); +procedure TJvPropertyStoreEditorControl.Notification(AComponent: TComponent; + Operation: TOperation); begin - if Assigned(InspectedObjectEditorHandler) then - SetInformation (InspectedObjectEditorHandler.EditIntf_GetVisibleObjectName, InspectedObjectEditorHandler.EditIntf_GetObjectHint); + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = FPropertyStore) then + begin + PropertyStore := nil; + InspectedObject := nil; + end; end; -procedure TJvPropertyStoreEditorForm.OkButtonClick(Sender: TObject); +procedure TJvPropertyStoreEditorControl.PropertyStoreTreeViewEnter(Sender: TObject); begin - // + if Assigned(InspectedObjectEditorHandlerIntf) then + SetInformation (InspectedObjectEditorHandlerIntf.EditIntf_GetVisibleObjectName, InspectedObjectEditorHandlerIntf.EditIntf_GetObjectHint); end; -function TJvPropertyStoreEditorForm.OnDisplayProperty(const aPropertyName : +function TJvPropertyStoreEditorControl.OnDisplayProperty(const aPropertyName : String): Boolean; begin - if Assigned(InspectedObjectEditorHandler) then - Result := InspectedObjectEditorHandler.EditIntf_DisplayProperty(aPropertyName) - and InspectedObjectEditorHandler.EditIntf_IsPropertySimple(aPropertyName) ; + if Assigned(InspectedObjectEditorHandlerIntf) then + Result := InspectedObjectEditorHandlerIntf.EditIntf_DisplayProperty(aPropertyName) + and InspectedObjectEditorHandlerIntf.EditIntf_IsPropertySimple(aPropertyName) + else + Result := False; end; -procedure TJvPropertyStoreEditorForm.OnPropertyChange(var OldPropertyName, +procedure TJvPropertyStoreEditorControl.OnPropertyChange(var OldPropertyName, NewPropertyName : string); begin - if Assigned(InspectedObjectEditorHandler) then - SetInformation (InspectedObjectEditorHandler.EditIntf_TranslatePropertyName(NewPropertyName), - InspectedObjectEditorHandler.EditIntf_GetPropertyHint(NewPropertyName)); + if Assigned(InspectedObjectEditorHandlerIntf) then + SetInformation (InspectedObjectEditorHandlerIntf.EditIntf_TranslatePropertyName(NewPropertyName), + InspectedObjectEditorHandlerIntf.EditIntf_GetPropertyHint(NewPropertyName)); end; -procedure TJvPropertyStoreEditorForm.PropertyStoreTreeViewChange(Sender: +procedure TJvPropertyStoreEditorControl.PropertyStoreTreeViewChange(Sender: TObject; Node: TTreeNode); begin + if csDestroying in Componentstate then + Exit; if not Assigned(Node) or not Assigned(Node.Data) or not (TObject(Node.Data) is TPersistent) or @@ -604,33 +671,42 @@ TPersistent(Node.Data); end; -procedure TJvPropertyStoreEditorForm.PropertyStoreTreeViewChanging(Sender: +procedure TJvPropertyStoreEditorControl.PropertyStoreTreeViewChanging(Sender: TObject; Node: TTreeNode; var AllowChange: Boolean); var JvPropertyEditorHandler : IJvPropertyEditorHandler; begin - RTTIInspectorControl.ControlSaveEditorValues; - if Assigned(PropertyStoreTreeView.ControlSelected) and - Assigned(PropertyStoreTreeView.ControlSelected.Data) and - (TObject(PropertyStoreTreeView.ControlSelected.Data) is TPersistent) then - if Supports(TObject(PropertyStoreTreeView.ControlSelected.Data), IJvPropertyEditorHandler, JvPropertyEditorHandler) then + if csDestroying in Componentstate then + Exit; + RTTIInspectorControlIntf.ControlSaveEditorValues; + if Assigned(PropertyStoreTreeViewIntf.ControlSelected) and + Assigned(PropertyStoreTreeViewIntf.ControlSelected.Data) and + (TObject(PropertyStoreTreeViewIntf.ControlSelected.Data) is TPersistent) then + if Supports(TObject(PropertyStoreTreeViewIntf.ControlSelected.Data), IJvPropertyEditorHandler, JvPropertyEditorHandler) then if (JvPropertyEditorHandler.EditIntf_GetVisibleObjectName <> '') then - PropertyStoreTreeView.ControlSelected.Text := JvPropertyEditorHandler.EditIntf_GetVisibleObjectName; + PropertyStoreTreeViewIntf.ControlSelected.Text := JvPropertyEditorHandler.EditIntf_GetVisibleObjectName; end; -procedure TJvPropertyStoreEditorForm.SetInspectedObject(const Value: +procedure TJvPropertyStoreEditorControl.SetInspectedObject(const Value: TPersistent); begin + if csDestroying in Componentstate then + begin + FInspectedObject := nil; + FInspectedObjectEditorHandlerIntf := nil; + FInspectedObjectListEditorHandlerIntf := nil; + Exit; + end; FInspectedObject := Value; - Supports(InspectedObject, IJvPropertyEditorHandler, FInspectedObjectEditorHandler); - Supports(InspectedObject, IJvPropertyListEditorHandler, FInspectedObjectListEditorHandler); - RTTIInspectorControl.ControlSaveEditorValues; - RTTIInspectorControl.ControlInspectedObject := Value; - if Assigned(FInspectedObjectListEditorHandler) then + Supports(InspectedObject, IJvPropertyEditorHandler, FInspectedObjectEditorHandlerIntf); + Supports(InspectedObject, IJvPropertyListEditorHandler, FInspectedObjectListEditorHandlerIntf); + RTTIInspectorControlIntf.ControlSaveEditorValues; + RTTIInspectorControlIntf.ControlInspectedObject := Value; + if Assigned(FInspectedObjectListEditorHandlerIntf) then begin ListPanel.visible := True; Inspector.Parent := ListInspectorPanel; InspectorPanel.visible := False; - ListInspectorPanel.visible := RTTIInspectorControl.ControlGetVisibleItemsCount > 0; + ListInspectorPanel.visible := RTTIInspectorControlIntf.ControlGetVisibleItemsCount > 0; FillListBox; end else @@ -639,55 +715,65 @@ ListPanel.visible := False; Inspector.Parent := InspectorPanel; end; - if Assigned(InspectedObjectEditorHandler) then - SetInformation (InspectedObjectEditorHandler.EditIntf_GetVisibleObjectName, InspectedObjectEditorHandler.EditIntf_GetObjectHint); + if Assigned(InspectedObjectEditorHandlerIntf) then + SetInformation (InspectedObjectEditorHandlerIntf.EditIntf_GetVisibleObjectName, InspectedObjectEditorHandlerIntf.EditIntf_GetObjectHint); end; -procedure TJvPropertyStoreEditorForm.SetPropertyStore(const Value: TComponent); +procedure TJvPropertyStoreEditorControl.SetPropertyStore(const Value: TComponent); begin + FPropertyStore := Value; + if csDestroying in Componentstate then + Exit; if Assigned(Value) and not Supports(Value, IJvPropertyEditorHandler) then - Raise Exception.Create ('TJvPropertyStoreEditorForm.SetPropertyStore : PropertyStore must support IJvPropertyEditorHandler'); - FPropertyStore := Value; + Raise Exception.Create ('TJvPropertyStoreEditorControl.SetPropertyStore : PropertyStore must support IJvPropertyEditorHandler'); + if Assigned(FPropertyStore) then + FPropertyStore.FreeNotification(Self); FillTreeView(Value); end; -function TJvPropertyStoreEditorForm.ShowPropertyInTreeView(PropObject: TObject; +function TJvPropertyStoreEditorControl.ShowPropertyInTreeView(PropObject: TObject; const PropertyName: string): Boolean; var PropertyEditorHandler: IJvPropertyEditorHandler; begin Result := True; + if csDestroying in Componentstate then + Exit; if not Assigned(PropObject) then Result := False else - if Supports(PropObject, IJvPropertyEditorHandler, PropertyEditorHandler) then - begin - Result := (not PropertyEditorHandler.EditIntf_IsPropertySimple(PropertyName)); - Result := Result or (not RTTIInspectorControl.ControlIsPropertySupported(PropertyName)) - end - else - Result := not RTTIInspectorControl.ControlIsPropertySupported(PropertyName); + if Supports(PropObject, IJvPropertyEditorHandler, PropertyEditorHandler) then + begin + Result := (not PropertyEditorHandler.EditIntf_IsPropertySimple(PropertyName)); + Result := Result or (not RTTIInspectorControlIntf.ControlIsPropertySupported(PropertyName)) + end + else + Result := not RTTIInspectorControlIntf.ControlIsPropertySupported(PropertyName); end; -function TJvPropertyStoreEditorForm.OnTranslatePropertyName(const aPropertyName : +function TJvPropertyStoreEditorControl.OnTranslatePropertyName(const aPropertyName : String): string; begin Result := aPropertyName; end; -procedure TJvPropertyStoreEditorForm.RTTIInspectorEnter(Sender: +procedure TJvPropertyStoreEditorControl.RTTIInspectorEnter(Sender: TObject); begin - if Assigned(InspectedObjectEditorHandler) and Assigned(RTTIInspectorControl) then - SetInformation (InspectedObjectEditorHandler.EditIntf_TranslatePropertyName(RTTIInspectorControl.ControlGetCurrentPropertyName), - InspectedObjectEditorHandler.EditIntf_GetPropertyHint(RTTIInspectorControl.ControlGetCurrentPropertyName)); + if csDestroying in Componentstate then + Exit; + if Assigned(InspectedObjectEditorHandlerIntf) and Assigned(RTTIInspectorControlIntf) then + SetInformation (InspectedObjectEditorHandlerIntf.EditIntf_TranslatePropertyName(RTTIInspectorControlIntf.ControlGetCurrentPropertyName), + InspectedObjectEditorHandlerIntf.EditIntf_GetPropertyHint(RTTIInspectorControlIntf.ControlGetCurrentPropertyName)); end; -procedure TJvPropertyStoreEditorForm.SetInformation(const iCaption, iInfo: +procedure TJvPropertyStoreEditorControl.SetInformation(const iCaption, iInfo: string); begin - InfoMemoDynControlData.ControlValue := iInfo; - InfoGroupBoxDynControl.ControlSetCaption(iCaption); + if csDestroying in Componentstate then + Exit; + InfoMemoDynControlDataIntf.ControlValue := iInfo; + InfoGroupBoxDynControlIntf.ControlSetCaption(iCaption); InfoPanel.Visible := iInfo <> ''; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jfu...@us...> - 2008-08-07 19:28:00
|
Revision: 11850 http://jvcl.svn.sourceforge.net/jvcl/?rev=11850&view=rev Author: jfudickar Date: 2008-08-07 19:27:56 +0000 (Thu, 07 Aug 2008) Log Message: ----------- Mantis 0004413: JvProgramVersionCheck crashes if AppStorage is not assigned (Mantis #0004413) Modified Paths: -------------- trunk/jvcl/run/JvProgramVersionCheck.pas trunk/jvcl/run/JvResources.pas Modified: trunk/jvcl/run/JvProgramVersionCheck.pas =================================================================== --- trunk/jvcl/run/JvProgramVersionCheck.pas 2008-08-06 16:16:38 UTC (rev 11849) +++ trunk/jvcl/run/JvProgramVersionCheck.pas 2008-08-07 19:27:56 UTC (rev 11850) @@ -1363,6 +1363,8 @@ ReleaseType: TJvProgramReleaseType; begin FExecuteVersionInfo := nil; + if not Assigned(Appstorage) then + Raise Exception.Create (RsPVExceptionAppstorageNotAssigned); if not Appstorage.PathExists(AppStoragePath) then StoreProperties; LoadProperties; Modified: trunk/jvcl/run/JvResources.pas =================================================================== --- trunk/jvcl/run/JvResources.pas 2008-08-06 16:16:38 UTC (rev 11849) +++ trunk/jvcl/run/JvResources.pas 2008-08-07 19:27:56 UTC (rev 11850) @@ -1728,6 +1728,7 @@ RsPVSiceKB = '%6.2f KB'; RsPVSiceMB = '%6.2f MB'; RsPVSiceGB = '%6.2f GB'; + RsPVExceptionAppstorageNotAssigned = 'TJvProgramVersionCheck.Execute : Appstorage must be assigned'; RsPVCReleaseTypeAlpha = 'Alpha'; RsPVCReleaseTypeBeta = 'Beta'; RsPVCReleaseTypeProduction = 'Production'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2008-08-07 21:56:36
|
Revision: 11851 http://jvcl.svn.sourceforge.net/jvcl/?rev=11851&view=rev Author: outchy Date: 2008-08-07 21:56:33 +0000 (Thu, 07 Aug 2008) Log Message: ----------- Compatibility with JCL rev 2412. Revision Links: -------------- http://jvcl.svn.sourceforge.net/jvcl/?rev=2412&view=rev Modified Paths: -------------- trunk/jvcl/run/JvAppXMLStorage.pas trunk/jvcl/run/JvColorProvider.pas trunk/jvcl/run/JvDataProvider.pas trunk/jvcl/run/JvJCLUtils.pas trunk/jvcl/run/JvMemo.pas trunk/jvcl/run/JvParameterList.pas trunk/jvcl/run/JvProgramVersionCheck.pas Modified: trunk/jvcl/run/JvAppXMLStorage.pas =================================================================== --- trunk/jvcl/run/JvAppXMLStorage.pas 2008-08-07 19:27:56 UTC (rev 11850) +++ trunk/jvcl/run/JvAppXMLStorage.pas 2008-08-07 21:56:33 UTC (rev 11851) @@ -323,7 +323,7 @@ I: Integer; begin if Value <> FWhiteSpaceReplacement then - if StrContainsChars(Value, AnsiWhiteSpace, True) then + if StrContainsChars(Value, CharIsWhiteSpace, True) then {$IFDEF CLR} raise EJVCLException.Create(RsEWhiteSpaceReplacementCannotContainSpaces) {$ELSE} @@ -408,7 +408,7 @@ for J := 1 to Length(NodeName) do begin Inc(InsertIndex); - if NodeName[J] in AnsiWhiteSpace then + if CharIsWhiteSpace(NodeName[J]) then case WSRLength of 0: {$IFDEF CLR} Modified: trunk/jvcl/run/JvColorProvider.pas =================================================================== --- trunk/jvcl/run/JvColorProvider.pas 2008-08-07 19:27:56 UTC (rev 11850) +++ trunk/jvcl/run/JvColorProvider.pas 2008-08-07 21:56:33 UTC (rev 11851) @@ -561,7 +561,7 @@ if AnsiSameStr(Prefix, Copy(Mappings[MapIdx].Name, 1, PrefixLen)) then with Mappings[MapIdx] do begin - if StrIsSubset(Copy(Name, PrefixLen + 1, Length(Name) - PrefixLen), DigitSymbols) then + if StrIsSubset(Copy(Name, PrefixLen + 1, Length(Name) - PrefixLen), CharIsDigit) then begin TmpNum := StrToInt64(Copy(Name, PrefixLen + 1, Length(Name) - PrefixLen)); if TmpNum >= SuffixNum then Modified: trunk/jvcl/run/JvDataProvider.pas =================================================================== --- trunk/jvcl/run/JvDataProvider.pas 2008-08-07 19:27:56 UTC (rev 11850) +++ trunk/jvcl/run/JvDataProvider.pas 2008-08-07 21:56:33 UTC (rev 11851) @@ -1454,7 +1454,7 @@ if AnsiSameStr(Prefix, Copy(Contexts.GetContext(CtxIdx).Name, 1, PrefixLen)) then with Contexts.GetContext(CtxIdx) do begin - if StrIsSubset(Copy(Name, PrefixLen + 1, Length(Name) - PrefixLen), DigitSymbols) then + if StrIsSubset(Copy(Name, PrefixLen + 1, Length(Name) - PrefixLen), CharIsDigit) then begin TmpNum := StrToInt64(Copy(Name, PrefixLen + 1, Length(Name) - PrefixLen)); if TmpNum >= SuffixNum then Modified: trunk/jvcl/run/JvJCLUtils.pas =================================================================== --- trunk/jvcl/run/JvJCLUtils.pas 2008-08-07 19:27:56 UTC (rev 11850) +++ trunk/jvcl/run/JvJCLUtils.pas 2008-08-07 21:56:33 UTC (rev 11851) @@ -7821,7 +7821,7 @@ function CharIsMoney(const Ch: Char): Boolean; begin - Result := CharIsDigit(Ch) or (Ch = AnsiSpace) or (Ch = '$') or (Ch = '-') or + Result := CharIsDigit(Ch) or (Ch = NativeSpace) or (Ch = '$') or (Ch = '-') or (Pos(Ch, CurrencyString) > 0); end; @@ -8070,10 +8070,10 @@ if Ch = ':' then Inc(liColons) else - if Ch = AnsiForwardSlash then + if Ch = NativeForwardSlash then Inc(liSlashes) else - if Ch = AnsiSpace then + if CharIsSpace(Ch) then Inc(liSpaces) else if CharIsDigit(Ch) then @@ -8122,7 +8122,7 @@ Ps := LStrReplace(Ps, ShortMonthNames[I], IntToStr(I), False); { remove redundant spaces } - Ps := LStrReplace(Ps, AnsiSpace + AnsiSpace, AnsiSpace, False); + Ps := LStrReplace(Ps, NativeSpace + NativeSpace, NativeSpace, False); Result := Ps; end; Modified: trunk/jvcl/run/JvMemo.pas =================================================================== --- trunk/jvcl/run/JvMemo.pas 2008-08-07 19:27:56 UTC (rev 11850) +++ trunk/jvcl/run/JvMemo.pas 2008-08-07 21:56:33 UTC (rev 11851) @@ -320,7 +320,7 @@ Key := #0; { no text at the end except for delete & backspace } - if (CurrentLine >= MaxLines) and not (Key = AnsiBackSpace) then + if (CurrentLine >= MaxLines) and not (Key = NativeBackSpace) then Key := #0; end; Modified: trunk/jvcl/run/JvParameterList.pas =================================================================== --- trunk/jvcl/run/JvParameterList.pas 2008-08-07 19:27:56 UTC (rev 11850) +++ trunk/jvcl/run/JvParameterList.pas 2008-08-07 21:56:33 UTC (rev 11851) @@ -477,12 +477,12 @@ const cFalse = 'FALSE'; cTrue = 'TRUE'; - cAllowedChars: TSysCharSet = - ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', + cAllowedChars: array [0..62] of Char = + ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '_']; + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '_'); {$IFNDEF HAS_UNIT_VARIANTS} type Modified: trunk/jvcl/run/JvProgramVersionCheck.pas =================================================================== --- trunk/jvcl/run/JvProgramVersionCheck.pas 2008-08-07 19:27:56 UTC (rev 11850) +++ trunk/jvcl/run/JvProgramVersionCheck.pas 2008-08-07 21:56:33 UTC (rev 11851) @@ -966,8 +966,8 @@ if ProgramVersion[I].ProgramReleaseDate > 0 then Result := Result + ' - ' + DateTimeToStr(ProgramVersion[I].ProgramReleaseDate); if ProgramVersion[I].VersionDescription.Count > 0 then - Result := Result + AnsiLineBreak + ProgramVersion[I].VersionDescription.Text; - Result := Result + AnsiLineBreak + AnsiLineBreak; + Result := Result + NativeLineBreak + ProgramVersion[I].VersionDescription.Text; + Result := Result + NativeLineBreak + NativeLineBreak; end; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jfu...@us...> - 2008-08-08 19:20:09
|
Revision: 11853 http://jvcl.svn.sourceforge.net/jvcl/?rev=11853&view=rev Author: jfudickar Date: 2008-08-08 19:20:02 +0000 (Fri, 08 Aug 2008) Log Message: ----------- Mantis 0004413: JvProgramVersionCheck crashes if AppStorage is not assigned - Changed (Mantis #0004413) Modified Paths: -------------- trunk/jvcl/run/JvProgramVersionCheck.pas trunk/jvcl/run/JvResources.pas Modified: trunk/jvcl/run/JvProgramVersionCheck.pas =================================================================== --- trunk/jvcl/run/JvProgramVersionCheck.pas 2008-08-08 08:43:31 UTC (rev 11852) +++ trunk/jvcl/run/JvProgramVersionCheck.pas 2008-08-08 19:20:02 UTC (rev 11853) @@ -1363,9 +1363,7 @@ ReleaseType: TJvProgramReleaseType; begin FExecuteVersionInfo := nil; - if not Assigned(Appstorage) then - Raise Exception.Create (RsPVExceptionAppstorageNotAssigned); - if not Appstorage.PathExists(AppStoragePath) then + if Assigned(Appstorage) and not Appstorage.PathExists(AppStoragePath) then StoreProperties; LoadProperties; if (LastCheck < Now - CheckFrequency) and (LocationTypesSupported <> []) then Modified: trunk/jvcl/run/JvResources.pas =================================================================== --- trunk/jvcl/run/JvResources.pas 2008-08-08 08:43:31 UTC (rev 11852) +++ trunk/jvcl/run/JvResources.pas 2008-08-08 19:20:02 UTC (rev 11853) @@ -1728,7 +1728,6 @@ RsPVSiceKB = '%6.2f KB'; RsPVSiceMB = '%6.2f MB'; RsPVSiceGB = '%6.2f GB'; - RsPVExceptionAppstorageNotAssigned = 'TJvProgramVersionCheck.Execute : Appstorage must be assigned'; RsPVCReleaseTypeAlpha = 'Alpha'; RsPVCReleaseTypeBeta = 'Beta'; RsPVCReleaseTypeProduction = 'Production'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jfu...@us...> - 2008-08-08 21:04:23
|
Revision: 11854 http://jvcl.svn.sourceforge.net/jvcl/?rev=11854&view=rev Author: jfudickar Date: 2008-08-08 21:04:19 +0000 (Fri, 08 Aug 2008) Log Message: ----------- Enhanced Base Actions Engine Modified Paths: -------------- trunk/jvcl/run/JvActionsEngine.pas trunk/jvcl/run/JvControlActionsEngine.pas Modified: trunk/jvcl/run/JvActionsEngine.pas =================================================================== --- trunk/jvcl/run/JvActionsEngine.pas 2008-08-08 19:20:02 UTC (rev 11853) +++ trunk/jvcl/run/JvActionsEngine.pas 2008-08-08 21:04:19 UTC (rev 11854) @@ -77,7 +77,6 @@ FControlEngine: TJvActionBaseEngine; FLastTarget: TObject; FOnChangeActionComponent: TJvChangeActionComponent; - function GetControlEngine: TJvActionBaseEngine; protected function DetectControlEngine(aActionComponent: TComponent): Boolean; virtual; function GetEngineList: TJvActionEngineList; virtual; abstract; @@ -86,8 +85,11 @@ //1 This Procedure is called when the ActionComponent is changed procedure ChangeActionComponent(const AActionComponent: TComponent); virtual; procedure CheckEnabled(var AEnabled: Boolean); virtual; + procedure CheckVisible(var AVisible: Boolean); virtual; procedure SetEnabled(Value: Boolean); - property ControlEngine: TJvActionBaseEngine read GetControlEngine; + procedure SetVisible(Value: Boolean); + procedure SetImageIndex(Value: Integer); + property ControlEngine: TJvActionBaseEngine read FControlEngine; property EngineList: TJvActionEngineList read GetEngineList; property ActionComponent: TComponent read FActionComponent write SetActionComponent; @@ -203,11 +205,6 @@ Result := Assigned(FControlEngine); end; -function TJvActionEngineBaseAction.GetControlEngine: TJvActionBaseEngine; -begin - Result := FControlEngine; -end; - function TJvActionEngineBaseAction.HandlesTarget(Target: TObject): Boolean; begin if Target is TComponent then @@ -261,6 +258,10 @@ begin end; +procedure TJvActionEngineBaseAction.CheckVisible(var AVisible: Boolean); +begin +end; + procedure TJvActionEngineBaseAction.SetEnabled(Value: Boolean); begin CheckEnabled (Value); @@ -268,6 +269,19 @@ Enabled := Value; end; +procedure TJvActionEngineBaseAction.SetVisible(Value: Boolean); +begin + CheckVisible(Value); + if Visible <> Value then + Visible := Value; +end; + +procedure TJvActionEngineBaseAction.SetImageIndex(Value: Integer); +begin + if ImageIndex <> Value then + ImageIndex := Value; +end; + initialization {$IFDEF UNITVERSIONING} RegisterUnitVersion(HInstance, UnitVersioning); Modified: trunk/jvcl/run/JvControlActionsEngine.pas =================================================================== --- trunk/jvcl/run/JvControlActionsEngine.pas 2008-08-08 19:20:02 UTC (rev 11853) +++ trunk/jvcl/run/JvControlActionsEngine.pas 2008-08-08 21:04:19 UTC (rev 11854) @@ -8,7 +8,7 @@ WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for the specific language governing rights and limitations under the License. -The Original Code is: JvDBActions.Pas, released on 2007-03-11. +The Original Code is: JvControlActionsEngine.Pas, released on 2007-03-11. The Initial Developer of the Original Code is Jens Fudickar [jens dott fudicker att oratool dott de] Portions created by Jens Fudickar are Copyright (C) 2002 Jens Fudickar. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2008-08-16 02:21:13
|
Revision: 11861 http://jvcl.svn.sourceforge.net/jvcl/?rev=11861&view=rev Author: outchy Date: 2008-08-16 02:21:10 +0000 (Sat, 16 Aug 2008) Log Message: ----------- Add JclStringConversions to units that relied on JclUnicode (changes in the JCL revision 2416). Revision Links: -------------- http://jvcl.svn.sourceforge.net/jvcl/?rev=2416&view=rev Modified Paths: -------------- trunk/jvcl/run/JvBalloonHint.pas trunk/jvcl/run/JvID3v2Base.pas Modified: trunk/jvcl/run/JvBalloonHint.pas =================================================================== --- trunk/jvcl/run/JvBalloonHint.pas 2008-08-12 10:40:41 UTC (rev 11860) +++ trunk/jvcl/run/JvBalloonHint.pas 2008-08-16 02:21:10 UTC (rev 11861) @@ -309,7 +309,7 @@ {$ENDIF JVCLThemesEnabled} ComCtrls, // needed for GetComCtlVersion JvJVCLUtils, JvThemes, JvWndProcHook, JvResources, JvWin32, - JclUnicode, JvVCL5Utils; + JclStringConversions, JclUnicode, JvVCL5Utils; const { TJvStemSize = (ssSmall, ssNormal, ssLarge); Modified: trunk/jvcl/run/JvID3v2Base.pas =================================================================== --- trunk/jvcl/run/JvID3v2Base.pas 2008-08-12 10:40:41 UTC (rev 11860) +++ trunk/jvcl/run/JvID3v2Base.pas 2008-08-16 02:21:10 UTC (rev 11861) @@ -38,7 +38,7 @@ JclUnitVersioning, {$ENDIF UNITVERSIONING} Classes, SysUtils, - JclUnicode, + JclStringConversions, JclUnicode, JvComponentBase, JvID3v2Types, JvID3v1; const This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jfu...@us...> - 2008-08-17 12:01:32
|
Revision: 11864 http://jvcl.svn.sourceforge.net/jvcl/?rev=11864&view=rev Author: jfudickar Date: 2008-08-17 12:01:29 +0000 (Sun, 17 Aug 2008) Log Message: ----------- Removed With Statements Modified Paths: -------------- trunk/jvcl/run/JvParameterList.pas trunk/jvcl/run/JvParameterListParameter.pas Modified: trunk/jvcl/run/JvParameterList.pas =================================================================== --- trunk/jvcl/run/JvParameterList.pas 2008-08-17 11:59:52 UTC (rev 11863) +++ trunk/jvcl/run/JvParameterList.pas 2008-08-17 12:01:29 UTC (rev 11864) @@ -1040,14 +1040,12 @@ begin AsVariant := Null; if Assigned(WinControl) then - // FValue := WinControlData; AsVariant := WinControlData; end; procedure TJvBaseParameter.SetData; begin if Assigned(WinControl) then - // WinControlData := FValue; WinControlData := AsVariant; end; @@ -1112,16 +1110,13 @@ FIntParameterList := TStringList.Create; FDynControlEngine := DefaultDynControlEngine; FArrangeSettings := TJvArrangeSettings.Create(Self); - with FArrangeSettings do - begin - AutoArrange := True; - WrapControls := True; - AutoSize := asBoth; - DistanceVertical := 3; - DistanceHorizontal := 3; - BorderLeft := 5; - BorderTop := 5; - end; + FArrangeSettings.AutoArrange := True; + FArrangeSettings.WrapControls := True; + FArrangeSettings.AutoSize := asBoth; + FArrangeSettings.DistanceVertical := 3; + FArrangeSettings.DistanceHorizontal := 3; + FArrangeSettings.BorderLeft := 5; + FArrangeSettings.BorderTop := 5; ScrollBox := nil; RightPanel := nil; ArrangePanel := nil; @@ -1340,15 +1335,12 @@ FParameterDialog := DynControlEngine.CreateForm(Messages.Caption, ''); - with TForm(ParameterDialog) do - begin - BorderIcons := []; - DefaultMonitor := dmActiveForm; - BorderStyle := bsDialog; - FormStyle := fsNormal; - Position := poScreenCenter; - OnShow := DialogShow; - end; + TForm(ParameterDialog).BorderIcons := []; + TForm(ParameterDialog).DefaultMonitor := dmActiveForm; + TForm(ParameterDialog).BorderStyle := bsDialog; + TForm(ParameterDialog).FormStyle := fsNormal; + TForm(ParameterDialog).Position := poScreenCenter; + TForm(ParameterDialog).OnShow := DialogShow; if Height > 0 then ParameterDialog.Height := Height; @@ -1359,22 +1351,19 @@ alBottom); if not Supports(BottomPanel, IJvDynControlPanel, ITmpPanel) then raise EIntfCastError.CreateRes(@RsEIntfCastError); - with ITmpPanel do - ControlSetBorder(bvNone, bvRaised, 1, bsNone, 0); + ITmpPanel.ControlSetBorder(bvNone, bvRaised, 1, bsNone, 0); MainPanel := DynControlEngine.CreatePanelControl(Self, ParameterDialog, 'MainPanel', '', alClient); if not Supports(MainPanel, IJvDynControlPanel, ITmpPanel) then raise EIntfCastError.CreateRes(@RsEIntfCastError); - with ITmpPanel do - ControlSetBorder(bvNone, bvRaised, 1, bsNone, 3); + ITmpPanel.ControlSetBorder(bvNone, bvRaised, 1, bsNone, 3); ButtonPanel := DynControlEngine.CreatePanelControl(Self, BottomPanel, 'BottonPanel', '', alRight); if not Supports(ButtonPanel, IJvDynControlPanel, ITmpPanel) then raise EIntfCastError.CreateRes(@RsEIntfCastError); - with ITmpPanel do - ControlSetBorder(bvNone, bvNone, 0, bsNone, 0); + ITmpPanel.ControlSetBorder(bvNone, bvNone, 0, bsNone, 0); OkButton := DynControlEngine.CreateButton(Self, ButtonPanel, 'OkButton', Messages.OkButton, '', OnOkButtonClick, True, False); @@ -1412,47 +1401,36 @@ alLeft); if not Supports(HistoryPanel, IJvDynControlPanel, ITmpPanel) then raise EIntfCastError.CreateRes(@RsEIntfCastError); - with ITmpPanel do - ControlSetBorder(bvNone, bvNone, 0, bsNone, 0); - with HistoryPanel do - Height := 25; + ITmpPanel.ControlSetBorder(bvNone, bvNone, 0, bsNone, 0); + HistoryPanel.Height := 25; LoadButton := DynControlEngine.CreateButton(Self, HistoryPanel, 'LoadButton', Messages.HistoryLoadButton, '', HistoryLoadClick, False, False); - with LoadButton do - begin - Left := 6; - Top := 5; - Height := 20; - Width := + LoadButton.Left := 6; + LoadButton.Top := 5; + LoadButton.Height := 20; + LoadButton.Width := TCustomControlAccessProtected(HistoryPanel).Canvas.TextWidth(Messages.HistoryLoadButton) + 5; - ButtonLeft := Left + Width + 5; - end; + ButtonLeft := LoadButton.Left + LoadButton.Width + 5; SaveButton := DynControlEngine.CreateButton(Self, HistoryPanel, 'SaveButton', - Messages.HistorySaveButton, '', - HistorySaveClick, False, False); - with SaveButton do - begin - Left := ButtonLeft; - Top := 5; - Height := 20; - Width := - TCustomControlAccessProtected(HistoryPanel).Canvas.TextWidth(Messages.HistorySaveButton) + 5; - ButtonLeft := Left + Width + 5; - end; + Messages.HistorySaveButton, '', + HistorySaveClick, False, False); + SaveButton.Left := ButtonLeft; + SaveButton.Top := 5; + SaveButton.Height := 20; + SaveButton.Width := + TCustomControlAccessProtected(HistoryPanel).Canvas.TextWidth(Messages.HistorySaveButton) + 5; + ButtonLeft := SaveButton.Left + SaveButton.Width + 5; ClearButton := DynControlEngine.CreateButton(Self, HistoryPanel, 'ClearButton', Messages.HistoryClearButton, '', HistoryClearClick, False, False); - with ClearButton do - begin - Left := ButtonLeft; - Top := 5; - Height := 20; - Width := - TCustomControlAccessProtected(HistoryPanel).Canvas.TextWidth(Messages.HistoryClearButton) + - 5; - ButtonLeft := Left + Width + 5; - end; + ClearButton.Left := ButtonLeft; + ClearButton.Top := 5; + ClearButton.Height := 20; + ClearButton.Width := + TCustomControlAccessProtected(HistoryPanel).Canvas.TextWidth(Messages.HistoryClearButton) + + 5; + ButtonLeft := ClearButton.Left + ClearButton.Width + 5; HistoryPanel.Width := ButtonLeft; OrgHistoryPanelWidth := ButtonLeft; end @@ -1461,8 +1439,7 @@ CreateWinControlsOnParent(MainPanel); - with MainPanel do - ResizeDialogAfterArrange(nil, Left, Top, Width, Height); + ResizeDialogAfterArrange(nil, MainPanel.Left, MainPanel.Top, MainPanel.Width, MainPanel.Height); end; procedure TJvParameterList.ResizeDialogAfterArrange(Sender: TObject; nLeft, nTop, nWidth, nHeight: @@ -1734,50 +1711,39 @@ end; procedure TJvParameterList.CreateWinControlsOnParent(ParameterParent: TWinControl); -var - I: Integer; begin FreeAndNil(ScrollBox); ScrollBox := TScrollBox.Create(Self); ScrollBox.Parent := ParameterParent; - with ScrollBox do - begin - AutoScroll := False; - BorderStyle := bsNone; - {$IFDEF COMPILER6_UP} - BevelInner := bvNone; - BevelOuter := bvNone; - {$ENDIF COMPILER6_UP} - Align := alClient; - Width := ParameterParent.Width; - end; + ScrollBox.AutoScroll := False; + ScrollBox.BorderStyle := bsNone; + {$IFDEF COMPILER6_UP} + ScrollBox.BevelInner := bvNone; + ScrollBox.BevelOuter := bvNone; + {$ENDIF COMPILER6_UP} + ScrollBox.Align := alClient; + ScrollBox.Width := ParameterParent.Width; RightPanel := TJvPanel.Create(Self); RightPanel.Parent := ScrollBox; - with RightPanel do - begin - Align := alRight; - BorderStyle := bsNone; - BevelInner := bvNone; - BevelOuter := bvNone; - Width := 22; // asn: need to check this - Visible := False; - end; + RightPanel.Align := alRight; + RightPanel.BorderStyle := bsNone; + RightPanel.BevelInner := bvNone; + RightPanel.BevelOuter := bvNone; + RightPanel.Width := 22; // asn: need to check this + RightPanel.Visible := False; FreeAndNil(ArrangePanel); ArrangePanel := TJvPanel.Create(Self); ArrangePanel.Parent := ScrollBox; ArrangePanel.Name := 'MainArrangePanel'; - with ArrangePanel do - begin - Transparent := False; - Align := alNone; - BorderStyle := bsNone; - BevelInner := bvNone; - BevelOuter := bvNone; - Caption := ''; - Left := 0; - Top := 0; - OnResizeParent := ResizeDialogAfterArrange; - end; + ArrangePanel.Transparent := False; + ArrangePanel.Align := alNone; + ArrangePanel.BorderStyle := bsNone; + ArrangePanel.BevelInner := bvNone; + ArrangePanel.BevelOuter := bvNone; + ArrangePanel.Caption := ''; + ArrangePanel.Left := 0; + ArrangePanel.Top := 0; + ArrangePanel.OnResizeParent := ResizeDialogAfterArrange; ArrangePanel.ArrangeSettings := ArrangeSettings; case ArrangePanel.ArrangeSettings.AutoSize of asNone: @@ -1789,18 +1755,7 @@ ArrangePanel.Width := ScrollBox.Width - RightPanel.Width; if MaxWidth > 0 then ArrangePanel.ArrangeSettings.MaxWidth := MaxWidth - RightPanel.Width - 2; - try - ArrangePanel.DisableArrange; - CreateWinControlsOnWinControl(ArrangePanel); - for I := 0 to Count - 1 do - if Parameters[I].Visible and - (Parameters[I] is TJvArrangeParameter) then - TJvArrangeParameter(Parameters[I]).ArrangeControls; - HandleEnableDisable; - finally - ArrangePanel.EnableArrange; - end; - ArrangePanel.ArrangeControls; + CreateWinControlsOnWinControl(ArrangePanel); end; procedure TJvParameterList.CreateWinControlsOnWinControl(ParameterParent: @@ -1808,13 +1763,25 @@ var I: Integer; begin - for I := 0 to Count - 1 do - if Parameters[I].Visible then - begin - Parameters[I].CreateWinControlOnParent( - GetParentByName(ParameterParent, Parameters[I].ParentParameterName)); - Parameters[I].WinControlData := Parameters[I].AsVariant; - end; + try + if ParameterParent is TJvCustomArrangePanel then + TJvCustomArrangePanel(ParameterParent).DisableArrange; + for I := 0 to Count - 1 do + if Parameters[I].Visible then + begin + Parameters[I].CreateWinControlOnParent( + GetParentByName(ParameterParent, Parameters[I].ParentParameterName)); + Parameters[I].WinControlData := Parameters[I].AsVariant; + if (Parameters[I] is TJvArrangeParameter) then + TJvArrangeParameter(Parameters[I]).ArrangeControls; + end; + HandleEnableDisable; + finally + if ParameterParent is TJvCustomArrangePanel then + TJvCustomArrangePanel(ParameterParent).EnableArrange; + end; + if ParameterParent is TJvCustomArrangePanel then + TJvCustomArrangePanel(ParameterParent).ArrangeControls; end; @@ -1952,24 +1919,24 @@ I: Integer; begin if Assigned(AppStorage) then - with ParameterList do - for I := 0 to ParameterList.Count - 1 do - if not (Parameters[I] is TJvNoDataParameter) then - with Parameters[I] do - if StoreValueToAppStorage then - begin - if StoreValueCrypted then - AppStorage.EnablePropertyValueCrypt; - if Parameters[I] is TJvListParameter then - with TJvListParameter(Parameters[I]) do - ItemIndex := AppStorage.ReadInteger(AppStorage.ConcatPaths([AppStoragePath, - SearchName]), ItemIndex) - else - AsString := AppStorage.ReadString(AppStorage.ConcatPaths([AppStoragePath, - SearchName]), AsString); - if StoreValueCrypted then - AppStorage.DisablePropertyValueCrypt; - end; + for I := 0 to ParameterList.Count - 1 do + if not (ParameterList.Parameters[I] is TJvNoDataParameter) then + if ParameterList.Parameters[I].StoreValueToAppStorage then + begin + if ParameterList.Parameters[I].StoreValueCrypted then + AppStorage.EnablePropertyValueCrypt; + if ParameterList.Parameters[I] is TJvListParameter then + TJvListParameter(ParameterList.Parameters[I]).ItemIndex := + AppStorage.ReadInteger(AppStorage.ConcatPaths([AppStoragePath, + ParameterList.Parameters[I].SearchName]), + TJvListParameter(ParameterList.Parameters[I]).ItemIndex) + else + ParameterList.Parameters[I].AsString := AppStorage.ReadString(AppStorage.ConcatPaths([AppStoragePath, + ParameterList.Parameters[I].SearchName]), + ParameterList.Parameters[I].AsString); + if ParameterList.Parameters[I].StoreValueCrypted then + AppStorage.DisablePropertyValueCrypt; + end; end; procedure TJvParameterListPropertyStore.StoreData; @@ -1977,24 +1944,21 @@ I: Integer; begin if Assigned(AppStorage) then - with ParameterList do - for I := 0 to ParameterList.Count - 1 do - if not (Parameters[I] is TJvNoDataParameter) then - with Parameters[I] do - if StoreValueToAppStorage then - begin - if StoreValueCrypted then - AppStorage.EnablePropertyValueCrypt; - if Parameters[I] is TJvListParameter then - with TJvListParameter(Parameters[I]) do - AppStorage.WriteInteger(AppStorage.ConcatPaths([AppStoragePath, SearchName]), - ItemIndex) - else - AppStorage.WriteString(AppStorage.ConcatPaths([AppStoragePath, SearchName]), - AsString); - if StoreValueCrypted then - AppStorage.DisablePropertyValueCrypt; - end; + for I := 0 to ParameterList.Count - 1 do + if not (ParameterList.Parameters[I] is TJvNoDataParameter) then + if ParameterList.Parameters[I].StoreValueToAppStorage then + begin + if ParameterList.Parameters[I].StoreValueCrypted then + AppStorage.EnablePropertyValueCrypt; + if ParameterList.Parameters[I] is TJvListParameter then + AppStorage.WriteInteger(AppStorage.ConcatPaths([AppStoragePath, ParameterList.Parameters[I].SearchName]), + TJvListParameter(ParameterList.Parameters[I]).ItemIndex) + else + AppStorage.WriteString(AppStorage.ConcatPaths([AppStoragePath, ParameterList.Parameters[I].SearchName]), + ParameterList.Parameters[I].AsString); + if ParameterList.Parameters[I].StoreValueCrypted then + AppStorage.DisablePropertyValueCrypt; + end; end; //=== { TJvParameterListSelectList } ========================================= Modified: trunk/jvcl/run/JvParameterListParameter.pas =================================================================== --- trunk/jvcl/run/JvParameterListParameter.pas 2008-08-17 11:59:52 UTC (rev 11863) +++ trunk/jvcl/run/JvParameterListParameter.pas 2008-08-17 12:01:29 UTC (rev 11864) @@ -648,12 +648,11 @@ begin inherited SetWinControlProperties; if Supports(WinControl, IJvDynControlButton, IJvButton) then - with IJvButton do - begin - ControlSetGlyph(Glyph); - ControlSetNumGlyphs(NumGlyphs); - ControlSetLayout(Layout); - end; + begin + IJvButton.ControlSetGlyph(Glyph); + IJvButton.ControlSetNumGlyphs(NumGlyphs); + IJvButton.ControlSetLayout(Layout); + end; end; //=== { TJvRadioButtonParameter } ============================================ @@ -736,10 +735,9 @@ FramePanel.Height := Height; FramePanel.Width := Width; if FramePanel is TPanel then - with TPanel(FramePanel) do begin - BevelInner := bvNone; - BevelOuter := bvNone; + TPanel(FramePanel).BevelInner := bvNone; + TPanel(FramePanel).BevelOuter := bvNone; end; end; @@ -1018,14 +1016,13 @@ begin WinControl := DynControlEngine.CreateImageControl(Self, AParameterParent, GetParameterName); if Supports(WinControl, IJvDynControlImage, ITmpImage) then - with ITmpImage do begin - ControlSetPicture(Picture); - // ControlSetAutoSize(AutoSize); - ControlSetIncrementalDisplay(IncrementalDisplay); - ControlSetCenter(Center); - ControlSetStretch(Stretch); - ControlSetTransparent(Transparent); + ITmpImage.ControlSetPicture(Picture); + // ITmpImage.ControlSetAutoSize(AutoSize); + ITmpImage.ControlSetIncrementalDisplay(IncrementalDisplay); + ITmpImage.ControlSetCenter(Center); + ITmpImage.ControlSetStretch(Stretch); + ITmpImage.ControlSetTransparent(Transparent); end; end; @@ -1599,11 +1596,10 @@ inherited GetData; if Supports(WinControl, IJvDynControlCheckListBox, ITmpCheckListBox) then for I := 0 to ItemList.Count - 1 do - with ITmpCheckListBox, ItemData[I] do begin - ItemEnabled := ITmpCheckListBox.ControlGetItemEnabled(I); - State := ITmpCheckListBox.ControlGetState(I); - Header := ITmpCheckListBox.ControlGetHeader(I); + ItemData[I].ItemEnabled := ITmpCheckListBox.ControlGetItemEnabled(I); + ItemData[I].State := ITmpCheckListBox.ControlGetState(I); + ItemData[I].Header := ITmpCheckListBox.ControlGetHeader(I); end; end; @@ -1615,11 +1611,10 @@ inherited SetData; if Supports(WinControl, IJvDynControlCheckListBox, ITmpCheckListBox) then for I := 0 to ItemList.Count - 1 do - with ITmpCheckListBox, ItemData[I] do begin - ITmpCheckListBox.ControlSetItemEnabled(I, ItemEnabled); - ITmpCheckListBox.ControlSetState(I, State); - ITmpCheckListBox.ControlSetHeader(I, Header); + ITmpCheckListBox.ControlSetItemEnabled(I, ItemData[I].ItemEnabled); + ITmpCheckListBox.ControlSetState(I, ItemData[I].State); + ITmpCheckListBox.ControlSetHeader(I, ItemData[I].Header); end; end; @@ -1628,12 +1623,9 @@ AHeader: Boolean = False); begin ItemList.Add(AText); - with ItemData[ItemList.Count - 1] do - begin - Header := AHeader; - State := AState; - ItemEnabled := AItemEnabled; - end; + ItemData[ItemList.Count - 1].Header := AHeader; + ItemData[ItemList.Count - 1].State := AState; + ItemData[ItemList.Count - 1].ItemEnabled := AItemEnabled; end; function TJvCheckListBoxParameter.GetParameterNameExt: string; @@ -1674,12 +1666,9 @@ if not Assigned(ItemList.Objects[Index]) then begin ItemList.Objects[Index] := TJvCheckListItemDataWrapper.Create; - with TJvCheckListItemDataWrapper(ItemList.Objects[Index]) do - begin - State := cbChecked; - Header := False; - ItemEnabled := True; - end; + TJvCheckListItemDataWrapper(ItemList.Objects[Index]).State := cbChecked; + TJvCheckListItemDataWrapper(ItemList.Objects[Index]).Header := False; + TJvCheckListItemDataWrapper(ItemList.Objects[Index]).ItemEnabled := True; end; Result := TJvCheckListItemDataWrapper(ItemList.Objects[Index]); end @@ -1779,11 +1768,10 @@ begin inherited SetWinControlProperties; if Supports(WinControl, IJvDynControlDate, DynControlDate) then - with DynControlDate do begin - ControlSetFormat(Format); - ControlSetMinDate(MinDate); - ControlSetMaxDate(MaxDate); + DynControlDate.ControlSetFormat(Format); + DynControlDate.ControlSetMinDate(MinDate); + DynControlDate.ControlSetMaxDate(MaxDate); end; end; @@ -1822,11 +1810,10 @@ begin inherited SetWinControlProperties; if Supports(WinControl, IJvDynControlDate, DynControlDate) then - with DynControlDate do begin - ControlSetFormat(Format); - ControlSetMinDate(MinDate); - ControlSetMaxDate(MaxDate); + DynControlDate.ControlSetFormat(Format); + DynControlDate.ControlSetMinDate(MinDate); + DynControlDate.ControlSetMaxDate(MaxDate); end; end; @@ -1943,12 +1930,11 @@ begin inherited SetWinControlProperties; if Supports(WinControl, IJvDynControlSpin, ITmpSpin) then - with ITmpSpin do begin - ControlSetIncrement(Increment); - ControlSetMinValue(MinValue); - ControlSetMaxValue(MaxValue); - ControlSetUseForInteger(True); + ITmpSpin.ControlSetIncrement(Increment); + ITmpSpin.ControlSetMinValue(MinValue); + ITmpSpin.ControlSetMaxValue(MaxValue); + ITmpSpin.ControlSetUseForInteger(True); end; end; @@ -2029,12 +2015,11 @@ begin inherited SetWinControlProperties; if Supports(WinControl, IJvDynControlSpin, ITmpSpin) then - with ITmpSpin do begin - ControlSetIncrement(Increment); - ControlSetMinValue(MinValue); - ControlSetMaxValue(MaxValue); - ControlSetUseForInteger(True); + ITmpSpin.ControlSetIncrement(Increment); + ITmpSpin.ControlSetMinValue(MinValue); + ITmpSpin.ControlSetMaxValue(MaxValue); + ITmpSpin.ControlSetUseForInteger(True); end; end; @@ -2119,15 +2104,14 @@ begin inherited SetWinControlProperties; if Supports(WinControl, IJvDynControlFileName, ITmpControlFileName) then - with ITmpControlFileName do begin - ControlSetDialogKind(DialogKind); - ControlSetDefaultExt(DefaultExt); - ControlSetFilter(Filter); - ControlSetFilterIndex(FilterIndex); - ControlSetInitialDir(InitialDir); - ControlSetDialogOptions(DialogOptions); - ControlSetDialogTitle(DialogTitle); + ITmpControlFileName.ControlSetDialogKind(DialogKind); + ITmpControlFileName.ControlSetDefaultExt(DefaultExt); + ITmpControlFileName.ControlSetFilter(Filter); + ITmpControlFileName.ControlSetFilterIndex(FilterIndex); + ITmpControlFileName.ControlSetInitialDir(InitialDir); + ITmpControlFileName.ControlSetDialogOptions(DialogOptions); + ITmpControlFileName.ControlSetDialogTitle(DialogTitle); end; end; @@ -2209,11 +2193,10 @@ begin inherited SetWinControlProperties; if Supports(WinControl, IJvDynControlDirectory, ITmpControlDirectory) then - with ITmpControlDirectory do begin - ControlSetDialogTitle(DialogTitle); - ControlSetDialogOptions(DialogOptions); - ControlSetInitialDir(InitialDir); + ITmpControlDirectory.ControlSetDialogTitle(DialogTitle); + ITmpControlDirectory.ControlSetDialogOptions(DialogOptions); + ITmpControlDirectory.ControlSetInitialDir(InitialDir); end; end; @@ -2265,12 +2248,11 @@ begin inherited SetWinControlProperties; if Supports(WinControl, IJvDynControlMemo, ITmpMemo) then - with ITmpMemo do begin - ControlSetWantTabs(WantTabs); - ControlSetWantReturns(WantReturns); - ControlSetWordWrap(WordWrap); - ControlSetScrollbars(ScrollBars); + ITmpMemo.ControlSetWantTabs(WantTabs); + ITmpMemo.ControlSetWantReturns(WantReturns); + ITmpMemo.ControlSetWordWrap(WordWrap); + ITmpMemo.ControlSetScrollbars(ScrollBars); end; end; @@ -2301,12 +2283,11 @@ begin inherited SetWinControlProperties; if Supports(WinControl, IJvDynControlMemo, ITmpMemo) then - with ITmpMemo do begin - ControlSetWantTabs(WantTabs); - ControlSetWantReturns(WantReturns); - ControlSetWordWrap(WordWrap); - ControlSetScrollbars(ScrollBars); + ITmpMemo.ControlSetWantTabs(WantTabs); + ITmpMemo.ControlSetWantReturns(WantReturns); + ITmpMemo.ControlSetWordWrap(WordWrap); + ITmpMemo.ControlSetScrollbars(ScrollBars); end; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jfu...@us...> - 2008-08-17 18:58:52
|
Revision: 11865 http://jvcl.svn.sourceforge.net/jvcl/?rev=11865&view=rev Author: jfudickar Date: 2008-08-17 18:58:48 +0000 (Sun, 17 Aug 2008) Log Message: ----------- Removed With Statements Modified Paths: -------------- trunk/jvcl/run/JvAppEvent.pas trunk/jvcl/run/JvAppXMLStorage.pas trunk/jvcl/run/JvBaseDBLogonDialog.pas trunk/jvcl/run/JvBaseDBPasswordDialog.pas trunk/jvcl/run/JvBaseDBThreadedDataset.pas trunk/jvcl/run/JvControlActionsEngineCxGrid.pas trunk/jvcl/run/JvControlActionsEngineCxPivotGrid.pas trunk/jvcl/run/JvControlActionsEngineCxVerticalGrid.pas trunk/jvcl/run/JvDBActionsEngine.pas trunk/jvcl/run/JvDynControlEngineDB.pas trunk/jvcl/run/JvDynControlEngineDBTools.pas trunk/jvcl/run/JvDynControlEngineDBToolscxVGrid.pas Modified: trunk/jvcl/run/JvAppEvent.pas =================================================================== --- trunk/jvcl/run/JvAppEvent.pas 2008-08-17 12:01:29 UTC (rev 11864) +++ trunk/jvcl/run/JvAppEvent.pas 2008-08-17 18:58:48 UTC (rev 11865) @@ -956,26 +956,20 @@ begin if not (csDesigning in ComponentState) then begin - with Application do - begin - HintColor := FHintColor; - HintPause := FHintPause; - ShowHint := FShowHint; - HintShortPause := FHintShortPause; - HintHidePause := FHintHidePause; - ShowMainForm := FShowMainForm; - HintShortCuts := FHintShortCuts; - UpdateFormatSettings := FUpdateFormatSettings; - UpdateMetricSettings := FUpdateMetricSettings; - BiDiMode := FBiDiMode; - BiDiKeyboard := FBiDiKeyboard; - NonBiDiKeyboard := FNonBiDiKeyboard; - with Mouse do - begin - DragImmediate := FMouseDragImmediate; - DragThreshold := FMouseDragThreshold; - end; - end; + Application.HintColor := FHintColor; + Application.HintPause := FHintPause; + Application.ShowHint := FShowHint; + Application.HintShortPause := FHintShortPause; + Application.HintHidePause := FHintHidePause; + Application.ShowMainForm := FShowMainForm; + Application.HintShortCuts := FHintShortCuts; + Application.UpdateFormatSettings := FUpdateFormatSettings; + Application.UpdateMetricSettings := FUpdateMetricSettings; + Application.BiDiMode := FBiDiMode; + Application.BiDiKeyboard := FBiDiKeyboard; + Application.NonBiDiKeyboard := FNonBiDiKeyboard; + Application.Mouse.DragImmediate := FMouseDragImmediate; + Application.Mouse.DragThreshold := FMouseDragThreshold; end; end; Modified: trunk/jvcl/run/JvAppXMLStorage.pas =================================================================== --- trunk/jvcl/run/JvAppXMLStorage.pas 2008-08-17 12:01:29 UTC (rev 11864) +++ trunk/jvcl/run/JvAppXMLStorage.pas 2008-08-17 18:58:48 UTC (rev 11865) @@ -349,12 +349,9 @@ inherited Create(AOwner); (StorageOptions as TJvAppXMLStorageOptions).FStorage := Self; FXml := TJvSimpleXml.Create(nil); - with TJvAppXMLStorageOptions(StorageOptions) do - begin - AutoEncodeValue := True; - AutoEncodeEntity := True; - AutoIndent := True; - end; + TJvAppXMLStorageOptions(StorageOptions).AutoEncodeValue := True; + TJvAppXMLStorageOptions(StorageOptions).AutoEncodeEntity := True; + TJvAppXMLStorageOptions(StorageOptions).AutoIndent := True; // (rom) should probably be a resourcestring RootNodeName := 'Configuration'; end; Modified: trunk/jvcl/run/JvBaseDBLogonDialog.pas =================================================================== --- trunk/jvcl/run/JvBaseDBLogonDialog.pas 2008-08-17 12:01:29 UTC (rev 11864) +++ trunk/jvcl/run/JvBaseDBLogonDialog.pas 2008-08-17 18:58:48 UTC (rev 11865) @@ -475,8 +475,7 @@ var P: TPoint; begin - with AdditionalBtn do - P := Parent.ClientToScreen(Point(Left + Width, Top)); + P := AdditionalBtn.Parent.ClientToScreen(Point(AdditionalBtn.Left + AdditionalBtn.Width, AdditionalBtn.Top)); AdditionalPopupMenu.Popup(P.X, P.Y); end; Modified: trunk/jvcl/run/JvBaseDBPasswordDialog.pas =================================================================== --- trunk/jvcl/run/JvBaseDBPasswordDialog.pas 2008-08-17 12:01:29 UTC (rev 11864) +++ trunk/jvcl/run/JvBaseDBPasswordDialog.pas 2008-08-17 18:58:48 UTC (rev 11865) @@ -241,100 +241,76 @@ IDynControlEdit: IJvDynControlEdit; begin - with aForm do - begin - Name := 'DBChangePasswordDialog'; - Left := 472; - Top := 229; - BorderIcons := [biSystemMenu, biMinimize, biMaximize, biHelp]; - BorderStyle := bsDialog; - Caption := RsChangePassword; - ClientHeight := 415; - ClientWidth := 317; - Position := poScreenCenter; - OnClose := FormClose; - OnShow := FormShow; - end; + aForm.Name := 'DBChangePasswordDialog'; + aForm.Left := 472; + aForm.Top := 229; + aForm.BorderIcons := [biSystemMenu, biMinimize, biMaximize, biHelp]; + aForm.BorderStyle := bsDialog; + aForm.Caption := RsChangePassword; + aForm.ClientHeight := 415; + aForm.ClientWidth := 317; + aForm.Position := poScreenCenter; + aForm.OnClose := FormClose; + aForm.OnShow := FormShow; ButtonPanel := DynControlEngine.CreatePanelControl(aForm, aForm, 'ButtonPanel', '', alBottom); ChangeBtn := DynControlEngine.CreateButton(AForm, ButtonPanel, 'ChangeBtn', RsChangeButtonCaption, '', ChangeBtnClick, True, False); - with ChangeBtn do - begin - Left := 60; - Top := 4; - Width := 90; - Height := 25; - end; + ChangeBtn.Left := 60; + ChangeBtn.Top := 4; + ChangeBtn.Width := 90; + ChangeBtn.Height := 25; CancelBtn := DynControlEngine.CreateButton(AForm, ButtonPanel, 'CancelBtn', RsButtonCancelCaption, '', CancelBtnClick, False, True); - with CancelBtn do - begin - Left := 460; - Top := 4; - Width := 90; - Height := 25; - end; + CancelBtn.Left := 460; + CancelBtn.Top := 4; + CancelBtn.Width := 90; + CancelBtn.Height := 25; ButtonPanel.Height := CancelBtn.Height + 8; MainPanel := DynControlEngine.CreatePanelControl(aForm, aForm, 'MainPanel', '', alClient); - with MainPanel do - begin - TabOrder := 0; - if Supports(MainPanel, IJvDynControlBevelBorder, IDynControlBevelBorder) then - IDynControlBevelBorder.ControlSetBorderWidth(5); - if Supports(MainPanel, IJvDynControlBevelBorder, IDynControlBevelBorder) then - IDynControlBevelBorder.ControlSetBevelOuter(bvNone); - end; + MainPanel.TabOrder := 0; + if Supports(MainPanel, IJvDynControlBevelBorder, IDynControlBevelBorder) then + IDynControlBevelBorder.ControlSetBorderWidth(5); + if Supports(MainPanel, IJvDynControlBevelBorder, IDynControlBevelBorder) then + IDynControlBevelBorder.ControlSetBevelOuter(bvNone); if Options.CheckOldPassword then begin LabelControl := DynControlEngine.CreateLabelControl(aForm, MainPanel, 'OldPasswortLabel', RsOldPasswordLabel, nil); - with LabelControl do - Align := alTop; + LabelControl.Align := alTop; OldPasswordEdit := DynControlEngine.CreateEditControl(aForm, MainPanel, 'OldPasswortEdit'); - with OldPasswordEdit do - begin - Align := alTop; - TabOrder := 0; - Supports(OldPasswordEdit, IJvDynControlData, IOldPasswordEditData); - IOldPasswordEditData.ControlValue := ''; - if Supports(OldPasswordEdit, IJvDynControlEdit, IDynControlEdit) then - IDynControlEdit.ControlSetPasswordChar('*'); - end; + OldPasswordEdit.Align := alTop; + OldPasswordEdit.TabOrder := 0; + Supports(OldPasswordEdit, IJvDynControlData, IOldPasswordEditData); + IOldPasswordEditData.ControlValue := ''; + if Supports(OldPasswordEdit, IJvDynControlEdit, IDynControlEdit) then + IDynControlEdit.ControlSetPasswordChar('*'); if Supports(LabelControl, IJvDynControlLabel, IDynControlLabel) then IDynControlLabel.ControlSetFocusControl(OldPasswordEdit); end; LabelControl := DynControlEngine.CreateLabelControl(aForm, MainPanel, 'NewPasswortLabel', RsNewPasswordLabel, nil); - with LabelControl do - Align := alTop; + LabelControl.Align := alTop; NewPasswordEdit := DynControlEngine.CreateEditControl(aForm, MainPanel, 'NewPasswortEdit'); - with NewPasswordEdit do - begin - Align := alTop; - TabOrder := 1; - Supports(NewPasswordEdit, IJvDynControlData, INewPasswordEditData); - INewPasswordEditData.ControlValue := ''; - if Supports(NewPasswordEdit, IJvDynControlEdit, IDynControlEdit) then - IDynControlEdit.ControlSetPasswordChar('*'); - end; + NewPasswordEdit.Align := alTop; + NewPasswordEdit.TabOrder := 1; + Supports(NewPasswordEdit, IJvDynControlData, INewPasswordEditData); + INewPasswordEditData.ControlValue := ''; + if Supports(NewPasswordEdit, IJvDynControlEdit, IDynControlEdit) then + IDynControlEdit.ControlSetPasswordChar('*'); if Supports(LabelControl, IJvDynControlLabel, IDynControlLabel) then IDynControlLabel.ControlSetFocusControl(NewPasswordEdit); LabelControl := DynControlEngine.CreateLabelControl(aForm, MainPanel, 'NewPasswortLabelRetype', RsConfirmPasswordLabel, nil); - with LabelControl do - Align := alTop; + LabelControl.Align := alTop; NewPasswordRetypeEdit := DynControlEngine.CreateEditControl(aForm, MainPanel, 'NewPasswortRetypeEdit'); - with NewPasswordRetypeEdit do - begin - Align := alTop; - TabOrder := 2; - Supports(NewPasswordRetypeEdit, IJvDynControlData, INewPasswordRetypeEditData); - INewPasswordRetypeEditData.ControlValue := ''; - if Supports(INewPasswordRetypeEditData, IJvDynControlEdit, IDynControlEdit) then - IDynControlEdit.ControlSetPasswordChar('*'); - end; + NewPasswordRetypeEdit.Align := alTop; + NewPasswordRetypeEdit.TabOrder := 2; + Supports(NewPasswordRetypeEdit, IJvDynControlData, INewPasswordRetypeEditData); + INewPasswordRetypeEditData.ControlValue := ''; + if Supports(INewPasswordRetypeEditData, IJvDynControlEdit, IDynControlEdit) then + IDynControlEdit.ControlSetPasswordChar('*'); if Supports(LabelControl, IJvDynControlLabel, IDynControlLabel) then IDynControlLabel.ControlSetFocusControl(NewPasswordRetypeEdit); end; Modified: trunk/jvcl/run/JvBaseDBThreadedDataset.pas =================================================================== --- trunk/jvcl/run/JvBaseDBThreadedDataset.pas 2008-08-17 12:01:29 UTC (rev 11864) +++ trunk/jvcl/run/JvBaseDBThreadedDataset.pas 2008-08-17 18:58:48 UTC (rev 11865) @@ -482,8 +482,7 @@ MainPanel := DynControlEngine.CreatePanelControl(Self, Self, 'MainPanel', '', alClient); if not Supports(MainPanel, IJvDynControlPanel, ITmpPanel) then raise EIntfCastError.CreateRes(@RsEIntfCastError); - with ITmpPanel do - ControlSetBorder(bvNone, bvNone, 0, bsNone, 5); + ITmpPanel.ControlSetBorder(bvNone, bvNone, 0, bsNone, 5); CreateTextPanel(Self, MainPanel, FTimePanel, FTimeLabel, FTimeStaticText, 'Time'); if Supports(FTimeLabel, IJvDynControl, ITmpControl) then @@ -494,12 +493,9 @@ FCancelButtonPanel := DynControlEngine.CreatePanelControl(Self, MainPanel, 'ButtonPanel', '', alTop); FCancelBtn := DynControlEngine.CreateButton(Self, FCancelButtonPanel, 'CancelBtn', RsButtonCancelCaption, '', DefaultCancelBtnClick, True, True); - with FCancelBtn do - begin - Anchors := [akTop]; - Top := 2; - FCancelButtonPanel.Height := FCancelBtn.Height + 3; - end; + FCancelBtn.Anchors := [akTop]; + FCancelBtn.Top := 2; + FCancelButtonPanel.Height := FCancelBtn.Height + 3; BorderIcons := []; BorderStyle := bsDialog; @@ -528,27 +524,20 @@ Panel := DynControlEngine.CreatePanelControl(AOwner, AParent, BaseName + 'Panel', '', alTop); if not Supports(Panel, IJvDynControlPanel, ITmpPanel) then raise EIntfCastError.CreateRes(@RsEIntfCastError); - with ITmpPanel do - ControlSetBorder(bvNone, bvNone, 0, bsNone, 3); + ITmpPanel.ControlSetBorder(bvNone, bvNone, 0, bsNone, 3); LabelCtrl := DynControlEngine.CreateLabelControl(AOwner, Panel, BaseName + 'Label', '', nil); - with LabelCtrl do - begin - Top := 1; - Left := 1; - Width := 90; - end; + LabelCtrl.Top := 1; + LabelCtrl.Left := 1; + LabelCtrl.Width := 90; StaticText := DynControlEngine.CreateStaticTextControl(AOwner, Panel, BaseName + 'StaticText', ''); if Supports(StaticText, IJvDynControlAutoSize, ITmpAutoSize) then ITmpAutoSize.ControlSetAutoSize(False); if Supports(StaticText, IJvDynControlAlignment, ITmpAlignment) then ITmpAlignment.ControlSetAlignment(taCenter); - with StaticText do - begin - Top := 1; - Left := 95; - Height := 18; - Panel.Height := Height + 6; - end; + StaticText.Top := 1; + StaticText.Left := 95; + StaticText.Height := 18; + Panel.Height := StaticText.Height + 6; end; procedure TJvDatasetThreadDialogForm.FillDialogData; @@ -557,19 +546,18 @@ begin if Assigned(ConnectedDatasetHandler) and (ConnectedDatasetHandler.CurrentOpenDuration > 0) then - with ConnectedDatasetHandler do - begin - if DialogOptions.Caption <> '' then - Caption := DialogOptions.Caption +' - '+CurrentOperationAction - else - Caption := CurrentOperationAction ; - if Supports(FRowsStaticText, IJvDynControl, ITmpControl) then - ITmpControl.ControlSetCaption(IntToStr(CurrentRow)); - if Supports(FTimeStaticText, IJvDynControl, ITmpControl) then - ITmpControl.ControlSetCaption( - FormatDateTime('hh:nn:ss', CurrentOpenDuration) + ' / ' + - FormatDateTime('hh:nn:ss', CurrentFetchDuration)); - end + begin + if DialogOptions.Caption <> '' then + Caption := DialogOptions.Caption +' - '+ConnectedDatasetHandler.CurrentOperationAction + else + Caption := ConnectedDatasetHandler.CurrentOperationAction ; + if Supports(FRowsStaticText, IJvDynControl, ITmpControl) then + ITmpControl.ControlSetCaption(IntToStr(ConnectedDatasetHandler.CurrentRow)); + if Supports(FTimeStaticText, IJvDynControl, ITmpControl) then + ITmpControl.ControlSetCaption( + FormatDateTime('hh:nn:ss', ConnectedDatasetHandler.CurrentOpenDuration) + ' / ' + + FormatDateTime('hh:nn:ss', ConnectedDatasetHandler.CurrentFetchDuration)); + end else begin if DialogOptions.Caption <> '' then @@ -908,32 +896,31 @@ S: string; Upper: Boolean; begin - With Dataset do - if Active then - for I := 0 to FieldCount - 1 do - begin - S := LowerCase(Fields[I].DisplayLabel); - Upper := True; - for J := 1 to Length(S) do - if S[J] in ['_', '$', ' '] then - begin - Upper := True; - S[J] := ' '; - end - else - if Upper then - begin - S[J] := UpCase(S[J]); - Upper := False; - end; - if EnhancedOptions.CapitalizeLabelOptions.TrimToFirstBlank then + if Dataset.Active then + for I := 0 to Dataset.FieldCount - 1 do + begin + S := LowerCase(Dataset.Fields[I].DisplayLabel); + Upper := True; + for J := 1 to Length(S) do + if S[J] in ['_', '$', ' '] then begin - J := Pos(' ', S); - if J > 0 then - S := Copy(S, J + 1, Length(S) - J); + Upper := True; + S[J] := ' '; + end + else + if Upper then + begin + S[J] := UpCase(S[J]); + Upper := False; end; - Fields[I].DisplayLabel := S; + if EnhancedOptions.CapitalizeLabelOptions.TrimToFirstBlank then + begin + J := Pos(' ', S); + if J > 0 then + S := Copy(S, J + 1, Length(S) - J); end; + Dataset.Fields[I].DisplayLabel := S; + end; end; function TJvBaseDatasetThreadHandler.CheckContinueRecordFetch: TJvThreadedDatasetContinueCheckResult; Modified: trunk/jvcl/run/JvControlActionsEngineCxGrid.pas =================================================================== --- trunk/jvcl/run/JvControlActionsEngineCxGrid.pas 2008-08-17 12:01:29 UTC (rev 11864) +++ trunk/jvcl/run/JvControlActionsEngineCxGrid.pas 2008-08-17 18:58:48 UTC (rev 11865) @@ -119,14 +119,11 @@ Exit; SaveDialog := TSaveDialog.Create(Self); try - with SaveDialog do - begin - Name := 'SaveDialog'; - DefaultExt := 'XLS'; - Filter := - 'MS-Excel-Files (*.XLS)|*.XLS|XML-Files (*.XML)|*.HTM|HTML-Files (*.HTM)|*.HTM|Text-Files (*.TXT)|*.TXT|All Files (*.*)|*.*'; - Options := [ofOverwritePrompt, ofHideReadOnly, ofPathMustExist]; - end; + SaveDialog.Name := 'SaveDialog'; + SaveDialog.DefaultExt := 'XLS'; + SaveDialog.Filter := + 'MS-Excel-Files (*.XLS)|*.XLS|XML-Files (*.XML)|*.HTM|HTML-Files (*.HTM)|*.HTM|Text-Files (*.TXT)|*.TXT|All Files (*.*)|*.*'; + SaveDialog.Options := [ofOverwritePrompt, ofHideReadOnly, ofPathMustExist]; if SaveDialog.Execute then if SaveDialog.FileName <> '' then begin Modified: trunk/jvcl/run/JvControlActionsEngineCxPivotGrid.pas =================================================================== --- trunk/jvcl/run/JvControlActionsEngineCxPivotGrid.pas 2008-08-17 12:01:29 UTC (rev 11864) +++ trunk/jvcl/run/JvControlActionsEngineCxPivotGrid.pas 2008-08-17 18:58:48 UTC (rev 11865) @@ -113,13 +113,10 @@ Exit; SaveDialog := TSaveDialog.Create(Self); try - with SaveDialog do - begin - Name := 'SaveDialog'; - DefaultExt := 'XLS'; - Filter := 'MS-Excel-Files (*.XLS)|*.XLS|XML-Files (*.XML)|*.HTM|HTML-Files (*.HTM)|*.HTM|Text-Files (*.TXT)|*.TXT|All Files (*.*)|*.*'; - Options := [ofOverwritePrompt, ofHideReadOnly, ofPathMustExist]; - end; + SaveDialog.Name := 'SaveDialog'; + SaveDialog.DefaultExt := 'XLS'; + SaveDialog.Filter := 'MS-Excel-Files (*.XLS)|*.XLS|XML-Files (*.XML)|*.HTM|HTML-Files (*.HTM)|*.HTM|Text-Files (*.TXT)|*.TXT|All Files (*.*)|*.*'; + SaveDialog.Options := [ofOverwritePrompt, ofHideReadOnly, ofPathMustExist]; if SaveDialog.Execute then if SaveDialog.FileName <> '' then begin Modified: trunk/jvcl/run/JvControlActionsEngineCxVerticalGrid.pas =================================================================== --- trunk/jvcl/run/JvControlActionsEngineCxVerticalGrid.pas 2008-08-17 12:01:29 UTC (rev 11864) +++ trunk/jvcl/run/JvControlActionsEngineCxVerticalGrid.pas 2008-08-17 18:58:48 UTC (rev 11865) @@ -101,13 +101,10 @@ Exit; SaveDialog := TSaveDialog.Create(Self); try - with SaveDialog do - begin - Name := 'SaveDialog'; - DefaultExt := 'XLS'; - Filter := 'MS-Excel-Files (*.XLS)|*.XLS|XML-Files (*.XML)|*.HTM|HTML-Files (*.HTM)|*.HTM|Text-Files (*.TXT)|*.TXT|All Files (*.*)|*.*'; - Options := [ofOverwritePrompt, ofHideReadOnly, ofPathMustExist]; - end; + SaveDialog.Name := 'SaveDialog'; + SaveDialog.DefaultExt := 'XLS'; + SaveDialog.Filter := 'MS-Excel-Files (*.XLS)|*.XLS|XML-Files (*.XML)|*.HTM|HTML-Files (*.HTM)|*.HTM|Text-Files (*.TXT)|*.TXT|All Files (*.*)|*.*'; + SaveDialog.Options := [ofOverwritePrompt, ofHideReadOnly, ofPathMustExist]; if SaveDialog.Execute then if SaveDialog.FileName <> '' then begin Modified: trunk/jvcl/run/JvDBActionsEngine.pas =================================================================== --- trunk/jvcl/run/JvDBActionsEngine.pas 2008-08-17 12:01:29 UTC (rev 11864) +++ trunk/jvcl/run/JvDBActionsEngine.pas 2008-08-17 18:58:48 UTC (rev 11865) @@ -565,48 +565,48 @@ if Assigned(grid) then begin ds := grid.DataSource; - with AFieldCreateOptions do +// with AFieldCreateOptions do for I := 0 to TAccessCustomDBGrid(grid).ColCount - 2 do begin Column := TAccessCustomDBGrid(grid).Columns[I]; - if Column.Visible or ShowInvisibleFields then + if Column.Visible or AFieldCreateOptions.ShowInvisibleFields then begin Field := Column.Field; Control := ADynControlEngineDB.CreateDBFieldControl(Field, AParentControl, AParentControl, '', ds); Control.Enabled := not Field.CanModify; - if FieldDefaultWidth > 0 then - Control.Width := FieldDefaultWidth + if AFieldCreateOptions.FieldDefaultWidth > 0 then + Control.Width := AFieldCreateOptions.FieldDefaultWidth else begin - if UseFieldSizeForWidth then + if AFieldCreateOptions.UseFieldSizeForWidth then if Field.Size > 0 then Control.Width := TAccessCustomControl(AParentControl).Canvas.TextWidth('X') * Field.Size else begin if (ADynControlEngineDB.GetFieldControlType(Field)= jctDBMemo) and - (FieldMaxWidth > 0) then - Control.Width := FieldMaxWidth; + (AFieldCreateOptions.FieldMaxWidth > 0) then + Control.Width := AFieldCreateOptions.FieldMaxWidth; end else if Field.DisplayWidth > 0 then Control.Width := TAccessCustomControl(AParentControl).Canvas.TextWidth('X') * Field.DisplayWidth; - if (FieldMaxWidth > 0) and (Control.Width > FieldMaxWidth) then - Control.Width := FieldMaxWidth + if (AFieldCreateOptions.FieldMaxWidth > 0) and (Control.Width > AFieldCreateOptions.FieldMaxWidth) then + Control.Width := AFieldCreateOptions.FieldMaxWidth else - if (FieldMinWidth > 0) and (Control.Width < FieldMinWidth) then - Control.Width := FieldMinWidth; + if (AFieldCreateOptions.FieldMinWidth > 0) and (Control.Width < AFieldCreateOptions.FieldMinWidth) then + Control.Width := AFieldCreateOptions.FieldMinWidth; end; - if UseParentColorForReadOnly then + if AFieldCreateOptions.UseParentColorForReadOnly then if (Assigned(ds.DataSet) and not ds.DataSet.CanModify) or Field.ReadOnly then if isPublishedProp(Control, 'ParentColor') then SetOrdProp(Control, 'ParentColor', Ord(True)); LabelControl := ADynControlEngineDB.DynControlEngine.CreateLabelControlPanel(AParentControl, AParentControl, '', '&' + Column.Title.Caption, Control, True, 0); - if FieldWidthStep > 0 then - if (LabelControl.Width mod FieldWidthStep) <> 0 then - LabelControl.Width := ((LabelControl.Width div FieldWidthStep) + 1) * FieldWidthStep; + if AFieldCreateOptions.FieldWidthStep > 0 then + if (LabelControl.Width mod AFieldCreateOptions.FieldWidthStep) <> 0 then + LabelControl.Width := ((LabelControl.Width div AFieldCreateOptions.FieldWidthStep) + 1) * AFieldCreateOptions.FieldWidthStep; end; end; end; Modified: trunk/jvcl/run/JvDynControlEngineDB.pas =================================================================== --- trunk/jvcl/run/JvDynControlEngineDB.pas 2008-08-17 12:01:29 UTC (rev 11864) +++ trunk/jvcl/run/JvDynControlEngineDB.pas 2008-08-17 18:58:48 UTC (rev 11865) @@ -511,45 +511,44 @@ else CreateOptions := AOptions; try - with CreateOptions do - for I := 0 to ADataSource.DataSet.FieldCount - 1 do - if ADataSource.DataSet.Fields[I].Visible or ShowInvisibleFields then + for I := 0 to ADataSource.DataSet.FieldCount - 1 do + if ADataSource.DataSet.Fields[I].Visible or CreateOptions.ShowInvisibleFields then + begin + Control := CreateDBFieldControl(ADataSource.DataSet.Fields[I], AControl, AControl, '', ADataSource); + if CreateOptions.FieldDefaultWidth > 0 then + Control.Width := CreateOptions.FieldDefaultWidth + else begin - Control := CreateDBFieldControl(ADataSource.DataSet.Fields[I], AControl, AControl, '', ADataSource); - if FieldDefaultWidth > 0 then - Control.Width := FieldDefaultWidth - else - begin - if UseFieldSizeForWidth then - if ADataSource.DataSet.Fields[I].Size > 0 then - Control.Width := - TAccessCustomControl(AControl).Canvas.TextWidth('X') * ADataSource.DataSet.Fields[I].Size - else - if (GetFieldControlType(ADataSource.DataSet.Fields[I])= jctDBMemo) and (FieldMaxWidth > 0) then - Control.Width := FieldMaxWidth - else + if CreateOptions.UseFieldSizeForWidth then + if ADataSource.DataSet.Fields[I].Size > 0 then + Control.Width := + TAccessCustomControl(AControl).Canvas.TextWidth('X') * ADataSource.DataSet.Fields[I].Size else - if ADataSource.DataSet.Fields[I].DisplayWidth > 0 then - Control.Width := - TAccessCustomControl(AControl).Canvas.TextWidth('X') * ADataSource.DataSet.Fields[I].DisplayWidth; - if (FieldMaxWidth > 0) and (Control.Width > FieldMaxWidth) then - Control.Width := FieldMaxWidth - else - if (FieldMinWidth > 0) and (Control.Width < FieldMinWidth) then - Control.Width := FieldMinWidth - end; - - if UseParentColorForReadOnly then - // Use ParentColor when the field is ReadOnly - if not ADataSource.DataSet.CanModify or ADataSource.DataSet.Fields[I].ReadOnly then - if isPublishedProp(Control, 'ParentColor') then - SetOrdProp(Control, 'ParentColor', Ord(True)); - LabelControl := GetDynControlEngine.CreateLabelControlPanel(AControl, AControl, - '', '&' + ADataSource.DataSet.Fields[I].DisplayLabel, Control, LabelOnTop, LabelDefaultWidth); - if FieldWidthStep > 0 then - if (LabelControl.Width mod FieldWidthStep) <> 0 then - LabelControl.Width := ((LabelControl.Width div FieldWidthStep) + 1) * FieldWidthStep; + if (GetFieldControlType(ADataSource.DataSet.Fields[I])= jctDBMemo) and (CreateOptions.FieldMaxWidth > 0) then + Control.Width := CreateOptions.FieldMaxWidth + else + else + if ADataSource.DataSet.Fields[I].DisplayWidth > 0 then + Control.Width := + TAccessCustomControl(AControl).Canvas.TextWidth('X') * ADataSource.DataSet.Fields[I].DisplayWidth; + if (CreateOptions.FieldMaxWidth > 0) and (Control.Width > CreateOptions.FieldMaxWidth) then + Control.Width := CreateOptions.FieldMaxWidth + else + if (CreateOptions.FieldMinWidth > 0) and (Control.Width < CreateOptions.FieldMinWidth) then + Control.Width := CreateOptions.FieldMinWidth end; + + if CreateOptions.UseParentColorForReadOnly then + // Use ParentColor when the field is ReadOnly + if not ADataSource.DataSet.CanModify or ADataSource.DataSet.Fields[I].ReadOnly then + if isPublishedProp(Control, 'ParentColor') then + SetOrdProp(Control, 'ParentColor', Ord(True)); + LabelControl := GetDynControlEngine.CreateLabelControlPanel(AControl, AControl, + '', '&' + ADataSource.DataSet.Fields[I].DisplayLabel, Control, CreateOptions.LabelOnTop, CreateOptions.LabelDefaultWidth); + if CreateOptions.FieldWidthStep > 0 then + if (LabelControl.Width mod CreateOptions.FieldWidthStep) <> 0 then + LabelControl.Width := ((LabelControl.Width div CreateOptions.FieldWidthStep) + 1) * CreateOptions.FieldWidthStep; + end; finally if not Assigned(AOptions) then CreateOptions.Free; Modified: trunk/jvcl/run/JvDynControlEngineDBTools.pas =================================================================== --- trunk/jvcl/run/JvDynControlEngineDBTools.pas 2008-08-17 12:01:29 UTC (rev 11864) +++ trunk/jvcl/run/JvDynControlEngineDBTools.pas 2008-08-17 18:58:48 UTC (rev 11865) @@ -199,21 +199,15 @@ FDynControlEngineDB := nil; FDataSource := nil; FArrangeSettings := TJvArrangeSettings.Create(Self); - with FArrangeSettings do - begin - AutoSize := asBoth; - DistanceHorizontal := 3; - DistanceVertical := 3; - BorderLeft := 3; - BorderTop := 3; - WrapControls := True; - end; + FArrangeSettings.AutoSize := asBoth; + FArrangeSettings.DistanceHorizontal := 3; + FArrangeSettings.DistanceVertical := 3; + FArrangeSettings.BorderLeft := 3; + FArrangeSettings.BorderTop := 3; + FArrangeSettings.WrapControls := True; FArrangeConstraints := TSizeConstraints.Create(nil); - with FArrangeConstraints do - begin - MaxHeight := 480; - MaxWidth := 640; - end; + FArrangeConstraints.MaxHeight := 480; + FArrangeConstraints.MaxWidth := 640; FFieldCreateOptions := TJvCreateDBFieldsOnControlOptions.Create; end; @@ -290,11 +284,8 @@ Form := DynControlEngine.CreateForm(DialogCaption, ''); TForm(Form).Position := Position; TForm(Form).BorderStyle := BorderStyle; - with TForm(Form) do - begin - FormStyle := fsNormal; - BorderIcons := []; - end; + TForm(Form).FormStyle := fsNormal; + TForm(Form).BorderIcons := []; FButtonPanel := DynControlEngine.CreatePanelControl(Form, Form, '', '', alBottom); FButtonPanel.Width := Form.ClientWidth; @@ -394,15 +385,12 @@ FScrollBox.AutoScroll := True; FForm.Constraints := ArrangeConstraints; ArrangePanel := TJvPanel.Create(FForm); - with ArrangePanel do - begin - Align := alTop; - BevelInner := bvNone; - BevelOuter := bvNone; - Parent := FScrollBox; - OnChangedWidth := ArrangePanelChangedWidth; - OnChangedHeight := ArrangePanelChangedHeight; - end; + ArrangePanel.Align := alTop; + ArrangePanel.BevelInner := bvNone; + ArrangePanel.BevelOuter := bvNone; + ArrangePanel.Parent := FScrollBox; + ArrangePanel.OnChangedWidth := ArrangePanelChangedWidth; + ArrangePanel.OnChangedHeight := ArrangePanelChangedHeight; ArrangePanel.ArrangeSettings := ArrangeSettings; if ArrangeSettings.MaxWidth = 0 then ArrangePanel.ArrangeSettings.MaxWidth := ArrangeConstraints.MaxWidth; @@ -412,14 +400,11 @@ Navigator := DynControlEngineDB.CreateDBNavigatorControl(FForm, FNavigatorPanel, '', DataSource); Navigator.Left := 3; Navigator.Top := 3; - with FNavigatorPanel do - begin - Align := alBottom; - BevelInner := bvNone; - BevelOuter := bvNone; - Parent := MainPanel; - Height := Navigator.Height + 6; - end; + FNavigatorPanel.Align := alBottom; + FNavigatorPanel.BevelInner := bvNone; + FNavigatorPanel.BevelOuter := bvNone; + FNavigatorPanel.Parent := MainPanel; + FNavigatorPanel.Height := Navigator.Height + 6; FNavigatorPanel.Visible := IncludeNavigator; if Assigned(OnCreateDataControlsEvent) then OnCreateDataControlsEvent(DataComponent, DynControlEngineDB, ArrangePanel, FieldCreateOptions) Modified: trunk/jvcl/run/JvDynControlEngineDBToolscxVGrid.pas =================================================================== --- trunk/jvcl/run/JvDynControlEngineDBToolscxVGrid.pas 2008-08-17 12:01:29 UTC (rev 11864) +++ trunk/jvcl/run/JvDynControlEngineDBToolscxVGrid.pas 2008-08-17 18:58:48 UTC (rev 11865) @@ -329,11 +329,8 @@ if aCreateColumn then begin EditorRow := TcxDBEditorRow(aVGrid.Add(TcxDBEditorRow)); - with EditorRow.Properties do - begin - DataBinding.FieldName := GridDataBinding.FieldName; - Caption := DataBinding.DefaultCaption; - end; + EditorRow.Properties.DataBinding.FieldName := GridDataBinding.FieldName; + EditorRow.Properties.Caption := EditorRow.Properties.DataBinding.DefaultCaption; end else for j := 0 to aVGrid.Rows.Count - 1 do This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jfu...@us...> - 2008-08-19 22:39:54
|
Revision: 11869 http://jvcl.svn.sourceforge.net/jvcl/?rev=11869&view=rev Author: jfudickar Date: 2008-08-19 22:39:51 +0000 (Tue, 19 Aug 2008) Log Message: ----------- Fixed Behaviour of storing list Elements Modified Paths: -------------- trunk/jvcl/run/JvAppStorage.pas trunk/jvcl/run/JvPropertyStore.pas Modified: trunk/jvcl/run/JvAppStorage.pas =================================================================== --- trunk/jvcl/run/JvAppStorage.pas 2008-08-17 19:31:51 UTC (rev 11868) +++ trunk/jvcl/run/JvAppStorage.pas 2008-08-19 22:39:51 UTC (rev 11869) @@ -2160,11 +2160,11 @@ if not TargetStore.ReadOnly then begin PrevListCount := ReadListItemCount (Path, ItemName); - WriteListItemCount (Path, ItemCount, ItemName); for I := 0 to ItemCount - 1 do OnWriteItem(Self, Path, List, I, ItemName); if (PrevListCount > ItemCount) and Assigned(OnDeleteItems) then OnDeleteItems(Self, Path, List, ItemCount, PrevListCount - 1, ItemName); + WriteListItemCount (Path, ItemCount, ItemName); end; end; Modified: trunk/jvcl/run/JvPropertyStore.pas =================================================================== --- trunk/jvcl/run/JvPropertyStore.pas 2008-08-17 19:31:51 UTC (rev 11868) +++ trunk/jvcl/run/JvPropertyStore.pas 2008-08-19 22:39:51 UTC (rev 11869) @@ -197,6 +197,7 @@ FCreateListEntries default True; property ItemName: string read FItemName write FItemName; property Sorted: Boolean read GetSorted write SetSorted; + function CreateAddObject(const aObjectName: String): TPersistent; //IJvPropertyListEditorHandler = interface function ListEditIntf_ObjectCount: integer; function ListEditIntf_GetObject(Index: integer): TPersistent; @@ -926,6 +927,13 @@ inherited Destroy; end; +function TJvCustomPropertyListStore.CreateAddObject(const aObjectName: String): + TPersistent; +begin + Result := CreateObject; + Items.AddObject(aObjectName, Result); +end; + function TJvCustomPropertyListStore.GetItems: TStringList; begin Result := FItems; @@ -1117,7 +1125,7 @@ var I: Integer; begin - for I := First to Last do + for I := Last downto first do Sender.DeleteValue(Sender.ConcatPaths([Path, Sender.ItemNameIndexPath(ItemName, i)])); end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ob...@us...> - 2008-09-09 20:45:36
|
Revision: 11893 http://jvcl.svn.sourceforge.net/jvcl/?rev=11893&view=rev Author: obones Date: 2008-09-09 20:45:14 +0000 (Tue, 09 Sep 2008) Log Message: ----------- Changes required for D2009/C2009 support, merged from the 3.35 branch Modified Paths: -------------- trunk/jvcl/run/JvAVICapture.pas trunk/jvcl/run/JvActions.pas trunk/jvcl/run/JvAppDBStorage.pas trunk/jvcl/run/JvAppIniStorage.pas trunk/jvcl/run/JvAppStorage.pas trunk/jvcl/run/JvAppXMLStorage.pas trunk/jvcl/run/JvArrowButton.pas trunk/jvcl/run/JvAutoComplete.pas trunk/jvcl/run/JvBDEFilter.pas trunk/jvcl/run/JvBDELists.pas trunk/jvcl/run/JvBDEMemTable.pas trunk/jvcl/run/JvBDEProgress.pas trunk/jvcl/run/JvBDEQBE.pas trunk/jvcl/run/JvBDEQuery.pas trunk/jvcl/run/JvBackgrounds.pas trunk/jvcl/run/JvBalloonHint.pas trunk/jvcl/run/JvBandObject.pas trunk/jvcl/run/JvBaseDBThreadedDataset.pas trunk/jvcl/run/JvBaseEdits.pas trunk/jvcl/run/JvBdeUtils.pas trunk/jvcl/run/JvBrowseFolder.pas trunk/jvcl/run/JvCabFile.pas trunk/jvcl/run/JvCalc.pas trunk/jvcl/run/JvCalendar.pas trunk/jvcl/run/JvCaptionButton.pas trunk/jvcl/run/JvCheckListBox.pas trunk/jvcl/run/JvCipher.pas trunk/jvcl/run/JvClock.pas trunk/jvcl/run/JvComCtrls.pas trunk/jvcl/run/JvCombobox.pas trunk/jvcl/run/JvComputerInfoEx.pas trunk/jvcl/run/JvConsts.pas trunk/jvcl/run/JvConverter.pas trunk/jvcl/run/JvCopyError.pas trunk/jvcl/run/JvCreateProcess.pas trunk/jvcl/run/JvCsvData.pas trunk/jvcl/run/JvCsvParse.pas trunk/jvcl/run/JvCustomItemViewer.pas trunk/jvcl/run/JvDBActionsEngineControlCxGrid.pas trunk/jvcl/run/JvDBCombobox.pas trunk/jvcl/run/JvDBControls.pas trunk/jvcl/run/JvDBDateTimePicker.pas trunk/jvcl/run/JvDBFindEdit.pas trunk/jvcl/run/JvDBGrid.pas trunk/jvcl/run/JvDBGridExport.pas trunk/jvcl/run/JvDBLookup.pas trunk/jvcl/run/JvDBLookupComboEdit.pas trunk/jvcl/run/JvDBRadioPanel.pas trunk/jvcl/run/JvDBRichEdit.pas trunk/jvcl/run/JvDBSearchComboBox.pas trunk/jvcl/run/JvDBUltimGrid.pas trunk/jvcl/run/JvDBUtils.pas trunk/jvcl/run/JvDSADialogs.pas trunk/jvcl/run/JvDdeCmd.pas trunk/jvcl/run/JvDeleteError.pas trunk/jvcl/run/JvDiskPrompt.pas trunk/jvcl/run/JvDockSupportControl.pas trunk/jvcl/run/JvDockTree.pas trunk/jvcl/run/JvDrawImage.pas trunk/jvcl/run/JvDriveCtrls.pas trunk/jvcl/run/JvDynControlEngine.pas trunk/jvcl/run/JvEditor.pas trunk/jvcl/run/JvEditorCommon.pas trunk/jvcl/run/JvFindReplace.pas trunk/jvcl/run/JvFormPlacement.pas trunk/jvcl/run/JvForth.pas trunk/jvcl/run/JvFullColorCtrls.pas trunk/jvcl/run/JvGIF.pas trunk/jvcl/run/JvGnugettext.pas trunk/jvcl/run/JvGrids.pas trunk/jvcl/run/JvHLEditor.pas trunk/jvcl/run/JvHLEditorPropertyForm.pas trunk/jvcl/run/JvHLParser.pas trunk/jvcl/run/JvHint.pas trunk/jvcl/run/JvHtmlParser.pas trunk/jvcl/run/JvID3v2Base.pas trunk/jvcl/run/JvId3v1.pas trunk/jvcl/run/JvId3v2.pas trunk/jvcl/run/JvId3v2Types.pas trunk/jvcl/run/JvImagesViewer.pas trunk/jvcl/run/JvInspDB.pas trunk/jvcl/run/JvInspXVCL.pas trunk/jvcl/run/JvInspector.pas trunk/jvcl/run/JvInterpreter.pas trunk/jvcl/run/JvInterpreterFm.pas trunk/jvcl/run/JvInterpreterParser.pas trunk/jvcl/run/JvInterpreter_DBTables.pas trunk/jvcl/run/JvInterpreter_Db.pas trunk/jvcl/run/JvInterpreter_Forms.pas trunk/jvcl/run/JvInterpreter_JvUtils.pas trunk/jvcl/run/JvInterpreter_SysUtils.pas trunk/jvcl/run/JvJCLUtils.pas trunk/jvcl/run/JvJVCLAboutForm.dfm trunk/jvcl/run/JvJVCLUtils.pas trunk/jvcl/run/JvJanTreeView.pas trunk/jvcl/run/JvListBox.pas trunk/jvcl/run/JvListView.pas trunk/jvcl/run/JvLookOut.pas trunk/jvcl/run/JvMRUList.pas trunk/jvcl/run/JvMRUManager.pas trunk/jvcl/run/JvMail.pas trunk/jvcl/run/JvMarkupLabel.pas trunk/jvcl/run/JvMemoryDataset.pas trunk/jvcl/run/JvMenus.pas trunk/jvcl/run/JvPageList.pas trunk/jvcl/run/JvPerfMon95.pas trunk/jvcl/run/JvPickDate.pas trunk/jvcl/run/JvProgressUtils.pas trunk/jvcl/run/JvPropertyStorage.pas trunk/jvcl/run/JvPropertyStore.pas trunk/jvcl/run/JvPropertyStoreEditor.pas trunk/jvcl/run/JvRadioGroup.pas trunk/jvcl/run/JvRas32.pas trunk/jvcl/run/JvRecentMenuButton.pas trunk/jvcl/run/JvRegistryTreeview.pas trunk/jvcl/run/JvRenameError.pas trunk/jvcl/run/JvRichEdit.pas trunk/jvcl/run/JvRichEditToHtml.pas trunk/jvcl/run/JvSAL.pas trunk/jvcl/run/JvSLDMappingEditorDialog.pas trunk/jvcl/run/JvSchedEvtStore.pas trunk/jvcl/run/JvScheduledEvents.pas trunk/jvcl/run/JvScrollMax.pas trunk/jvcl/run/JvSegmentedLEDDisplay.pas trunk/jvcl/run/JvSimLogic.pas trunk/jvcl/run/JvSimPIDLinker.pas trunk/jvcl/run/JvSimScope.pas trunk/jvcl/run/JvSpeedbar.pas trunk/jvcl/run/JvSpellerForm.pas trunk/jvcl/run/JvSpin.pas trunk/jvcl/run/JvSticker.pas trunk/jvcl/run/JvStringHolder.pas trunk/jvcl/run/JvStrings.pas trunk/jvcl/run/JvTFUtils.pas trunk/jvcl/run/JvTimeLine.pas trunk/jvcl/run/JvToolBar.pas trunk/jvcl/run/JvToolEdit.pas trunk/jvcl/run/JvTranslator.pas trunk/jvcl/run/JvTrayIcon.pas trunk/jvcl/run/JvTurtle.pas trunk/jvcl/run/JvTypes.pas trunk/jvcl/run/JvUnicodeEditor.pas trunk/jvcl/run/JvUnicodeHLEditor.pas trunk/jvcl/run/JvValidateEdit.pas trunk/jvcl/run/JvValidators.pas trunk/jvcl/run/JvWinDialogs.pas trunk/jvcl/run/JvWinampLabel.pas trunk/jvcl/run/JvWizard.pas trunk/jvcl/run/JvXPBar.pas trunk/jvcl/run/JvXmlDatabase.pas trunk/jvcl/run/JvYearGrid.pas trunk/jvcl/run/JvaScrollText.pas trunk/jvcl/run/JvgAskListBox.pas trunk/jvcl/run/JvgExceptionHandler.pas trunk/jvcl/run/JvgHint.pas trunk/jvcl/run/JvgLanguageLoader.pas trunk/jvcl/run/JvgUtils.pas trunk/jvcl/run/JvgXMLSerializer.pas trunk/jvcl/run/JvxSlider.pas trunk/jvcl/run/VFW.pas Modified: trunk/jvcl/run/JvAVICapture.pas =================================================================== --- trunk/jvcl/run/JvAVICapture.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvAVICapture.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -617,7 +617,7 @@ // This is the callback called in case of an error // will only be called if the user chose so with ueError -function ErrorCallback(hWnd: HWND; ErrId: Integer; Str: LPSTR): LRESULT; stdcall; +function ErrorCallback(hWnd: HWND; ErrId: Integer; Str: LPTSTR): LRESULT; stdcall; var SelfObj: TJvAVICapture; begin @@ -639,7 +639,7 @@ // This is the callback called in case of a status change // will only be called if the user chose so with ueStatus -function StatusCallback(hWnd: HWND; nId: Integer; Str: LPSTR): LRESULT; stdcall; +function StatusCallback(hWnd: HWND; nId: Integer; Str: LPTSTR): LRESULT; stdcall; var SelfObj: TJvAVICapture; begin Modified: trunk/jvcl/run/JvActions.pas =================================================================== --- trunk/jvcl/run/JvActions.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvActions.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -170,7 +170,7 @@ function TJvSendMailOptions.GetBody: string; begin - Result := Mailer.Body; + Result := string(Mailer.Body); end; function TJvSendMailOptions.GetFindOptions: TJclEmailFindOptions; @@ -198,12 +198,12 @@ if Mailer.Recipients.Count = 0 then Result := '' else - Result := Mailer.Recipients.Items[0].Address; + Result := string(Mailer.Recipients.Items[0].Address); end; function TJvSendMailOptions.GetSubject: string; begin - Result := Mailer.Subject; + Result := string(Mailer.Subject); end; function TJvSendMailOptions.GetUserLogged: Boolean; @@ -218,7 +218,7 @@ procedure TJvSendMailOptions.SetBody(const Value: string); begin - Mailer.Body := Value; + Mailer.Body := AnsiString(Value); // we know we might lose values here, but MAPI has always been ANSI anyway end; procedure TJvSendMailOptions.SetFindOptions(const Value: TJclEmailFindOptions); @@ -239,12 +239,12 @@ procedure TJvSendMailOptions.SetRecipients(const Value: string); begin Mailer.Recipients.Clear; - Mailer.Recipients.Add(Value); + Mailer.Recipients.Add(AnsiString(Value)); // we know we might lose values here, but MAPI has always been ANSI anyway end; procedure TJvSendMailOptions.SetSubject(const Value: string); begin - Mailer.Subject := Value; + Mailer.Subject := AnsiString(Value); // we know we might lose values here, but MAPI has always been ANSI anyway end; {$ENDIF MSWINDOWS} Modified: trunk/jvcl/run/JvAppDBStorage.pas =================================================================== --- trunk/jvcl/run/JvAppDBStorage.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvAppDBStorage.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -61,7 +61,7 @@ FValueLink: TFieldDataLink; FOnRead: TJvDBStorageReadEvent; FOnWrite: TJvDBStorageWriteEvent; - FBookmark: TBookmarkStr; + FBookmark: {$IFDEF RTL200_UP}TBookmark{$ELSE}TBookmarkStr{$ENDIF RTL200_UP}; procedure SetDataSource(const Value: TDataSource); function GetDataSource: TDataSource; function GetKeyField: string; @@ -138,8 +138,11 @@ implementation uses + {$IFDEF SUPPORTS_INLINE} + Windows, + {$ENDIF SUPPORTS_INLINE} JclMime, - JvJCLUtils, JvResources, JclAnsiStrings; + JvJCLUtils, JvResources, JclStrings; constructor TJvCustomAppDBStorage.Create(AOwner: TComponent); begin @@ -194,11 +197,11 @@ function TJvCustomAppDBStorage.DoReadBinary(const Path: string; Buf: TJvBytes; BufSize: Integer): Integer; var - Value: string; + Value: AnsiString; begin raise EJvAppDBStorageError.CreateRes(@RsENotSupported); // TODO -cTESTING -oJVCL: NOT TESTED!!! - Value := JclMime.MimeDecodeString(DoReadString(Path, '')); + Value := JclMime.MimeDecodeString(AnsiString(DoReadString(Path, ''))); // the cast to AnsiString converts with loss under D2009 Result := Length(Value); if Result > BufSize then raise EJvAppDBStorageError.CreateResFmt(@RsEBufTooSmallFmt, [Result]); @@ -348,11 +351,11 @@ procedure TJvCustomAppDBStorage.RestoreDataset; begin - if FBookmark = '' then + if FBookmark = {$IFDEF RTL200_UP}nil{$ELSE}''{$ENDIF RTL200_UP} then Exit; if FieldsAssigned then DataSource.DataSet.Bookmark := FBookmark; - FBookmark := ''; + FBookmark := {$IFDEF RTL200_UP}nil{$ELSE}''{$ENDIF RTL200_UP}; end; function TJvCustomAppDBStorage.GetPhysicalReadOnly: Boolean; @@ -408,7 +411,7 @@ procedure TJvCustomAppDBStorage.StoreDataset; begin - if FBookmark <> '' then + if FBookmark <> {$IFDEF RTL200_UP}nil{$ELSE}''{$ENDIF RTL200_UP} then RestoreDataset; if FieldsAssigned and DataSource.DataSet.Active then begin Modified: trunk/jvcl/run/JvAppIniStorage.pas =================================================================== --- trunk/jvcl/run/JvAppIniStorage.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvAppIniStorage.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -169,7 +169,7 @@ SysUtils, JvJCLUtils, // BinStrToBuf & BufToBinStr JvVCL5Utils, JvConsts, JvResources, - JclAnsiStrings; // JvConsts or PathDelim under D5 and BCB5 + JclStrings; // JvConsts or PathDelim under D5 and BCB5 const cNullDigit = '0'; Modified: trunk/jvcl/run/JvAppStorage.pas =================================================================== --- trunk/jvcl/run/JvAppStorage.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvAppStorage.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -94,6 +94,7 @@ Windows, {$ENDIF COMPILER9_UP} {$ENDIF CLR} + JclStrings, // must be included before WideStrings {$IFDEF COMPILER10_UP} WideStrings, {$ENDIF COMPILER10_UP} @@ -944,7 +945,10 @@ {$IFDEF HAS_UNIT_STRUTILS} StrUtils, {$ENDIF HAS_UNIT_STRUTILS} - JclFileUtils, JclStrings, JclSysInfo, JclRTTI, JclMime, + JclFileUtils, JclSysInfo, JclRTTI, JclMime, + {$IFNDEF COMPILER12_UP} + JvJCLUtils, + {$ENDIF ~COMPILER12_UP} JvPropertyStore, JvConsts, JvResources, JvStrings, JclSynch; type @@ -1362,9 +1366,9 @@ try GetPropInfos(Instance.ClassInfo, PropList); PropInfo := PropList^[Index]; - Result := PropInfo^.Name; + Result := {$IFDEF SUPPORTS_UNICODE}UTF8ToString{$ENDIF SUPPORTS_UNICODE}(PropInfo^.Name); finally - FreeMem(PropList, Data^.PropCount * SizeOf(PPropInfo)); + FreeMem(PropList); end; {$ENDIF CLR} end; @@ -1439,15 +1443,15 @@ procedure TJvCustomAppStorage.ReadWideStringListItem(Sender: TJvCustomAppStorage; const Path: string; const List: TObject; const Index: Integer; const ItemName: string); begin - if List is TWideStrings then - TWideStrings(List).Add(Sender.ReadWideString(ConcatPaths([Path, ItemName + IntToStr(Index)]))); + if List is WideStrings.TWideStrings then + WideStrings.TWideStrings(List).Add(Sender.ReadWideString(ConcatPaths([Path, ItemName + IntToStr(Index)]))); end; procedure TJvCustomAppStorage.WriteWideStringListItem(Sender: TJvCustomAppStorage; const Path: string; const List: TObject; const Index: Integer; const ItemName: string); begin - if List is TWideStrings then - Sender.WriteWideString(ConcatPaths([Path, ItemName + IntToStr(Index)]), TWideStrings(List)[Index]); + if List is WideStrings.TWideStrings then + Sender.WriteWideString(ConcatPaths([Path, ItemName + IntToStr(Index)]), WideStrings.TWideStrings(List)[Index]); end; procedure TJvCustomAppStorage.DeleteWideStringListItem(Sender: TJvCustomAppStorage; @@ -1455,7 +1459,7 @@ var I: Integer; begin - if List is TWideStrings then + if List is WideStrings.TWideStrings then for I := First to Last do Sender.DeleteValue(ConcatPaths([Path, ItemName + IntToStr(I)])); end; @@ -1932,7 +1936,7 @@ NameStart := AnsiStrRScan(PChar(Name), PathDelim); if NameStart = nil then NameStart := PChar(Name); - Result := (AnsiStrLIComp(NameStart, cItem, 4) = 0) and (NameStart[4] in DigitSymbols); + Result := (AnsiStrLIComp(NameStart, cItem, 4) = 0) and CharInSet(NameStart[4], DigitSymbols); end; {$ENDIF CLR} @@ -2629,6 +2633,7 @@ if not Assigned(PersObj) then Exit; case PropType(PersObj, PropName) of + {$IFDEF UNICODE} tkUString, {$ENDIF} tkLString, tkString: SetStrProp(PersObj, PropName, ReadString(Path, GetStrProp(PersObj, PropName))); tkWString: @@ -2765,6 +2770,7 @@ Exit; case PropType(PersObj, PropName) of + {$IFDEF UNICODE} tkUString, {$ENDIF} tkLString, tkString: if StorageOptions.StoreDefaultValues or not IsDefaultStrProp(P) then WriteString(Path, GetStrProp(PersObj, PropName)); @@ -2912,7 +2918,7 @@ function TJvCustomAppStorage.GetCharName(Ch: Char): string; begin - if Ch in ['!'..'z'] then + if CharInSet(Ch, ['!'..'z']) then Result := 'Char_' + Ch else Result := 'Char#' + IntToStr(Ord(Ch)); @@ -2928,7 +2934,7 @@ if Assigned(FOnEncryptPropertyValue) and IsPropertyValueCryptEnabled then begin FOnEncryptPropertyValue(Value); - Value := MimeEncodeString(Value); + Value := string(MimeEncodeString(AnsiString(Value))); end; Result := Value; end; @@ -2937,7 +2943,7 @@ begin if Assigned(FOnDecryptPropertyValue) and IsPropertyValueCryptEnabled then begin - Value := MimeDecodeString(Value); + Value := string(MimeDecodeString(AnsiString(Value))); FOnDecryptPropertyValue(Value); end; Result := Value; @@ -3118,7 +3124,7 @@ if Assigned(AMethod) then begin JclMutex := TJclMutex.Create(nil, False, - B64Encode(RsJvAppStorageSynchronizeProcedureName + AIdentifier)); + string(B64Encode(AnsiString(RsJvAppStorageSynchronizeProcedureName + AIdentifier)))); try if JclMutex.WaitForever = wrSignaled then try @@ -3145,13 +3151,17 @@ function TJvCustomAppStorage.ReadWideString(const Path: string; const Default: WideString = ''): WideString; begin + {$IFDEF COMPILER12_UP} + Result := UTF8ToWideString(RawByteString(ReadString(Path, string(UTF8Encode(Default))))); + {$ELSE} Result := UTF8Decode(ReadString(Path, UTF8Encode(Default))); + {$ENDIF COMPILER12_UP} end; procedure TJvCustomAppStorage.WriteWideString(const Path: string; const Value: WideString); begin - WriteString(Path, UTF8Encode(Value)); + WriteString(Path, string(UTF8Encode(Value))); end; {$ENDIF COMPILER6_UP} Modified: trunk/jvcl/run/JvAppXMLStorage.pas =================================================================== --- trunk/jvcl/run/JvAppXMLStorage.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvAppXMLStorage.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -308,7 +308,7 @@ if Value <> FInvalidCharReplacement then begin for I := 1 to Length(Value) do - if not (Value[I] in AllowedNodeNameChars) then + if not CharInSet(Value[I], AllowedNodeNameChars) then {$IFDEF CLR} raise EJVCLException.CreateFmt(RsENotAllowedCharacterForProperty, [Value[I], 'InvalidCharReplacement']); {$ELSE} @@ -332,7 +332,7 @@ else begin for I := 1 to Length(Value) do - if not (Value[I] in AllowedNodeNameChars) then + if not CharInSet(Value[I], AllowedNodeNameChars) then {$IFDEF CLR} raise EJVCLException.CreateFmt(RsENotAllowedCharacterForProperty, [Value[I], 'WhiteSpaceReplacement']); {$ELSE} @@ -425,7 +425,7 @@ end; end // case WSRLength of else - if not (NodeName[J] in AllowedNodeNameChars) then + if not CharInSet(NodeName[J], AllowedNodeNameChars) then case ICRLength of 0: {$IFDEF CLR} Modified: trunk/jvcl/run/JvArrowButton.pas =================================================================== --- trunk/jvcl/run/JvArrowButton.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvArrowButton.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -1255,7 +1255,7 @@ if ThemeServices.ThemesEnabled and Enabled and not Flat then begin R := BoundsRect; - InvalidateRect(Parent.Handle, R, True); + Windows.InvalidateRect(Parent.Handle, {$IFNDEF COMPILER12_UP}@{$ENDIF ~COMPILER12_UP}R, True); end else {$ENDIF JVCLThemesEnabled} @@ -1320,7 +1320,7 @@ if ThemeServices.ThemesEnabled and Enabled and not Flat then begin R := BoundsRect; - InvalidateRect(Parent.Handle, R, True); + Windows.InvalidateRect(Parent.Handle, {$IFNDEF COMPILER12_UP}@{$ENDIF ~COMPILER12_UP}R, True); end; {$ENDIF JVCLThemesEnabled} end; @@ -1341,7 +1341,7 @@ if ThemeServices.ThemesEnabled and Enabled and not Flat then begin R := BoundsRect; - InvalidateRect(Parent.Handle, R, True); + Windows.InvalidateRect(Parent.Handle, {$IFNDEF COMPILER12_UP}@{$ENDIF ~COMPILER12_UP}R, True); end; {$ENDIF JVCLThemesEnabled} end; Modified: trunk/jvcl/run/JvAutoComplete.pas =================================================================== --- trunk/jvcl/run/JvAutoComplete.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvAutoComplete.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -253,6 +253,10 @@ {$ENDIF HAS_UNIT_STRUTILS} {$IFDEF CLR} JvJCLUtils, + {$ELSE} + {$IFNDEF COMPILER12_UP} + JvJCLUtils, + {$ENDIF ~COMPILER12_UP} {$ENDIF CLR} JvConsts; @@ -432,7 +436,7 @@ else SaveText := FFilter + Key; - if Key in LeadBytes then + if CharInSet(Key, LeadBytes) then begin if PeekMessage(Msg, GetEditHandle, 0, 0, PM_NOREMOVE) and (Msg.Message = WM_CHAR) then begin Modified: trunk/jvcl/run/JvBDEFilter.pas =================================================================== --- trunk/jvcl/run/JvBDEFilter.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvBDEFilter.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -517,7 +517,7 @@ DsSetRecordCount(DS, 1); { FActiveRecord + 1 } DsSetCanModify(DS, False); SetLength(BufPtr, 1); - BufPtr[0] := PChar(RecBuf); + BufPtr[0] := {$IFDEF COMPILER12_UP}PByte{$ELSE}PAnsiChar{$ENDIF COMPILER12_UP}(RecBuf); DsSetBuffers(DS, BufPtr); { call user defined function } Result := Ord(FOnFiltering(Self, DS)); Modified: trunk/jvcl/run/JvBDELists.pas =================================================================== --- trunk/jvcl/run/JvBDELists.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvBDELists.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -424,12 +424,12 @@ function TJvCustomDatabaseItems.CreateHandle: HDBICur; var - WildCard: PChar; - Pattern: array [0..DBIMAXTBLNAMELEN] of Char; + WildCard: PAnsiChar; + Pattern: array [0..DBIMAXTBLNAMELEN] of AnsiChar; begin WildCard := nil; if FileMask <> '' then - WildCard := AnsiToNative(DBLocale, FileMask, Pattern, SizeOf(Pattern) - 1); + WildCard := AnsiToNative(DBLocale, AnsiString(FileMask), Pattern, SizeOf(Pattern) - 1); // cast to AnsiString might lead to loss in D2009 case FItemType of dtTables: Check(DbiOpenTableList(DBHandle, FExtended, FSystemItems, WildCard, Result)); @@ -537,13 +537,13 @@ function TJvCustomTableItems.CreateHandle: HDBICur; var - STableName: PChar; + STableName: PAnsiChar; begin if FTableName = '' then _DBError(SNoTableName); - STableName := StrAlloc(Length(FTableName) + 1); + STableName := {$IFDEF SUPPORTS_UNICODE}AnsiStrAlloc{$ELSE}StrAlloc{$ENDIF SUPPORTS_UNICODE}(Length(FTableName) + 1); try - AnsiToNative(DBLocale, FTableName, STableName, Length(FTableName)); + AnsiToNative(DBLocale, AnsiString(FTableName), STableName, Length(FTableName)); // Cast to AnsiString may lead to data loss in D2009 case FItemType of dtFields: while not CheckOpen(DbiOpenFieldList(DBHandle, STableName, nil, @@ -579,10 +579,10 @@ constructor TJvDatabaseDesc.Create(const DatabaseName: string); var - Buffer: PChar; + Buffer: PAnsiChar; begin inherited Create; - Buffer := StrPCopy(StrAlloc(Length(DatabaseName) + 1), DatabaseName); + Buffer := StrPCopy({$IFDEF SUPPORTS_UNICODE}AnsiStrAlloc{$ELSE}StrAlloc{$ENDIF SUPPORTS_UNICODE}(Length(DatabaseName) + 1), AnsiString(DatabaseName)); try Check(DbiGetDatabaseDesc(Buffer, @FDescription)); finally @@ -592,10 +592,10 @@ constructor TJvDriverDesc.Create(const DriverType: string); var - Buffer: PChar; + Buffer: PAnsiChar; begin inherited Create; - Buffer := StrPCopy(StrAlloc(Length(DriverType) + 1), DriverType); + Buffer := StrPCopy({$IFDEF SUPPORTS_UNICODE}AnsiStrAlloc{$ELSE}StrAlloc{$ENDIF SUPPORTS_UNICODE}(Length(DriverType) + 1), AnsiString(DriverType)); try Check(DbiGetDriverDesc(Buffer, FDescription)); finally Modified: trunk/jvcl/run/JvBDEMemTable.pas =================================================================== --- trunk/jvcl/run/JvBDEMemTable.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvBDEMemTable.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -257,7 +257,7 @@ function TJvBDEMemoryTable.GetFieldData(Field: TField; Buffer: Pointer): Boolean; var IsBlank: LongBool; - RecBuf: PChar; + RecBuf: {$IFDEF COMPILER12_UP}PByte{$ELSE}PAnsiChar{$ENDIF COMPILER12_UP}; begin Result := inherited GetFieldData(Field, Buffer); if not Result then @@ -383,7 +383,7 @@ if TableName = '' then AnsiToNative(Locale, InternalMemTableName1, szTblName, SizeOf(szTblName) - 1) else - AnsiToNative(Locale, TableName, szTblName, SizeOf(szTblName) - 1); + AnsiToNative(Locale, AnsiString(TableName), szTblName, SizeOf(szTblName) - 1); SetLength(FldDescList, iFldCount); FieldDescs := BDE.PFLDDesc(FldDescList); for I := 0 to FieldDefs.Count - 1 do @@ -433,7 +433,7 @@ with FieldDesc do begin FillChar(szName, SizeOf(szName), 0); - AnsiToNative(Locale, Name, szName, SizeOf(szName) - 1); + AnsiToNative(Locale, AnsiString(Name), szName, SizeOf(szName) - 1); iFldType := FieldLogicMap(DataType); iSubType := FieldSubtypeMap(DataType); if iSubType = fldstAUTOINC then Modified: trunk/jvcl/run/JvBDEProgress.pas =================================================================== --- trunk/jvcl/run/JvBDEProgress.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvBDEProgress.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -512,7 +512,7 @@ Exit; end; if CurFlag in TraceFlags then - FOnTrace(Self, CurFlag, StrPas(PTraceDesc(CBInfo)^.pszTrace)); + FOnTrace(Self, CurFlag, string(StrPas(PTraceDesc(CBInfo)^.pszTrace))); end; end; @@ -561,7 +561,7 @@ if CallInfo^.iPercentDone >= 0 then SetPercent(CallInfo^.iPercentDone) else - SetMessage(StrPas(CallInfo^.szMsg)); + SetMessage(string(StrPas(CallInfo^.szMsg))); end; function TJvDBProgress.QryProgressCallback(CBInfo: Pointer): CBRType; Modified: trunk/jvcl/run/JvBDEQBE.pas =================================================================== --- trunk/jvcl/run/JvBDEQBE.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvBDEQBE.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -64,8 +64,8 @@ procedure FreeStatement; function GetQBE: TStrings; function GetQueryCursor(GenHandle: Boolean): HDBICur; - procedure GetStatementHandle(QBEText: PChar); - procedure PrepareQBE(Value: PChar); + procedure GetStatementHandle(QBEText: PAnsiChar); + procedure PrepareQBE(Value: PAnsiChar); procedure QueryChanged(Sender: TObject); procedure SetQBE(Value: TStrings); procedure SetParams(Value: TParams); @@ -344,7 +344,7 @@ procedure TJvQBEQuery.SetPrepared(Value: Boolean); var TempQBE: TStrings; - AText: PChar; + AText: PAnsiChar; begin if Handle <> nil then _DBError(SDataSetOpen); @@ -359,7 +359,7 @@ try TempQBE.Assign(QBE); ReplaceParams(TempQBE); - AText := PChar(TempQBE.Text); + AText := PAnsiChar(AnsiString(TempQBE.Text)); try FreeStatement; if StrLen(AText) > 1 then @@ -375,7 +375,7 @@ else begin if StrLen(PChar(Text)) > 1 then - PrepareQBE(PChar(Text)) + PrepareQBE(PAnsiChar(AnsiString(Text))) else _DBError(SEmptySQLStatement); end; @@ -544,12 +544,12 @@ end; end; -procedure TJvQBEQuery.PrepareQBE(Value: PChar); +procedure TJvQBEQuery.PrepareQBE(Value: PAnsiChar); begin GetStatementHandle(Value); end; -procedure TJvQBEQuery.GetStatementHandle(QBEText: PChar); +procedure TJvQBEQuery.GetStatementHandle(QBEText: PAnsiChar); const DataType: array [Boolean] of Longint = (Ord(wantCanned), Ord(wantLive)); begin Modified: trunk/jvcl/run/JvBDEQuery.pas =================================================================== --- trunk/jvcl/run/JvBDEQuery.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvBDEQuery.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -67,7 +67,7 @@ function GetRealSQL: TStrings; protected procedure InternalFirst; override; - function GetRecord(Buffer: PChar; GetMode: TGetMode; DoCheck: Boolean): TGetResult; override; + function GetRecord(Buffer: {$IFDEF COMPILER12_UP}PByte{$ELSE}PChar{$ENDIF COMPILER12_UP}; GetMode: TGetMode; DoCheck: Boolean): TGetResult; override; procedure Loaded; override; function CreateHandle: HDBICur; override; procedure OpenCursor(InfoQuery: Boolean); override; @@ -197,13 +197,16 @@ RTLConsts, {$ENDIF HAS_UNIT_RTLCONSTS} Forms, Consts, BDEConst, + {$IFNDEF COMPILER12_UP} + JvJCLUtils, + {$ENDIF ~COMPILER12_UP} JvDBUtils, JvBdeUtils; { Parse SQL utility routines } function NameDelimiters(C: Char; Delims: TSysCharSet): Boolean; begin - Result := NameDelimiter(C) or (C in Delims); + Result := NameDelimiter(C) or CharInSet(C, Delims); end; procedure CreateQueryParams(List: TParams; const Value: PChar; Macro: Boolean; @@ -333,7 +336,7 @@ inherited InternalFirst; end; -function TJvQuery.GetRecord(Buffer: PChar; GetMode: TGetMode; +function TJvQuery.GetRecord(Buffer: {$IFDEF COMPILER12_UP}PByte{$ELSE}PChar{$ENDIF COMPILER12_UP}; GetMode: TGetMode; DoCheck: Boolean): TGetResult; begin //!!!!!! @@ -428,7 +431,7 @@ if SQL.Count > 0 then begin FOpenStatus := qsFailed; - Check(DbiQExecDirect(DBHandle, qryLangSQL, PChar(inherited SQL.Text), + Check(DbiQExecDirect(DBHandle, qryLangSQL, PAnsiChar(AnsiString(inherited SQL.Text)), nil)); FOpenStatus := qsExecuted; end @@ -828,8 +831,7 @@ Action := saFail; S := Format(SParseError, [SMsgdlgError, LineNo]); if E is EDBEngineError then - TDBError.Create(EDBEngineError(E), 0, LineNo, - PChar(S)) + TDBError.Create(EDBEngineError(E), 0, LineNo, {$IFNDEF COMPILER12_UP}PChar{$ENDIF ~COMPILER12_UP}(S)) else begin if E.Message <> '' then Modified: trunk/jvcl/run/JvBackgrounds.pas =================================================================== --- trunk/jvcl/run/JvBackgrounds.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvBackgrounds.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -1325,7 +1325,7 @@ procedure TJvBackgroundClientLink.ClientInvalidate; begin if not (csReading in FBackground.ComponentState) and not (csDestroying in FClient.ComponentState) then - InvalidateRect(ClientHandle, nil, True); + Windows.InvalidateRect(ClientHandle, nil, True); end; function GetMDIClientScrollDelta(ClientHandle: HWND; ScrollBar: Integer; @@ -1385,7 +1385,7 @@ procedure InvalidateBackground; begin - InvalidateRect(ClientHandle, nil, True); + Windows.InvalidateRect(ClientHandle, nil, True); end; begin Modified: trunk/jvcl/run/JvBalloonHint.pas =================================================================== --- trunk/jvcl/run/JvBalloonHint.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvBalloonHint.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -69,8 +69,8 @@ (Used the check on resize of the anchor window whether the stem point is still inside the balloon window): } RStemPointPosition: TPoint; - RUTF8Header: string; - RUTF8Hint: string; + RUTF8Header: {$IFDEF RTL200_UP}UTF8String{$ELSE}string{$ENDIF RTL200_UP}; + RUTF8Hint: {$IFDEF RTL200_UP}UTF8String{$ELSE}string{$ENDIF RTL200_UP}; RIconKind: TJvIconKind; RImageIndex: TImageIndex; RVisibleTime: Integer; @@ -141,7 +141,7 @@ procedure ActivateHint(Rect: TRect; const AHint: string); override; function CalcHintRect(MaxWidth: Integer; const AHint: string; AData: Pointer): TRect; override; - function CalcHintRectUTF8(MaxWidth: Integer; const AUTF8Hint: string; + function CalcHintRectUTF8(MaxWidth: Integer; const AUTF8Hint: {$IFDEF RTL200_UP}UTF8String{$ELSE}string{$ENDIF RTL200_UP}; AData: Pointer): TRect; virtual; function CalcHintRectW(MaxWidth: Integer; const AHint: WideString; AData: Pointer): TRect; virtual; @@ -307,7 +307,13 @@ TmSchema, {$ENDIF !COMPILER7_UP} {$ENDIF JVCLThemesEnabled} + {$IFDEF SUPPORTS_INLINE} + Types, + {$ENDIF SUPPORTS_INLINE} ComCtrls, // needed for GetComCtlVersion + {$IFNDEF COMPILER12_UP} + JvJCLUtils, + {$ENDIF ~COMPILER12_UP} JvJVCLUtils, JvThemes, JvWndProcHook, JvResources, JvWin32, JclStringConversions, JclUnicode, JvVCL5Utils; @@ -380,7 +386,7 @@ { The Microsoft Layer for Unicode dll UNICOWS.DLL does probably the same as the following: } S := WideCharLenToString(PWideChar(WS), Length(WS)); - Result := DrawTextA(hDC, PChar(S), Length(S), lpRect, uFormat); + Result := DrawTextA(hDC, PAnsiChar(AnsiString(S)), Length(S), lpRect, uFormat); end; end; @@ -491,7 +497,7 @@ begin // GetThemeFont is defined wrong; so cast it Result := GetThemeFont(ThemeServices.Theme[teToolTip], 0, TTP_BALLOONTITLE, 0, - TMT_FONT, PLogFontA(@LogFontW)^) = S_OK; + TMT_FONT, {$IFDEF COMPILER12_UP}PLogFontW{$ELSE}PLogFontA{$ENDIF COMPILER12_UP}(@LogFontW)^) = S_OK; if Result then begin @@ -517,7 +523,11 @@ while (Head^ <> WideNull) and (LineCount < 2) do begin Tail := Head; + {$IFDEF COMPILER12_UP} + while not CharInSet(Tail^, [WideNull, WideLineFeed, WideCarriageReturn, WideVerticalTab, WideFormFeed]) and + {$ELSE} while not (Tail^ in [WideNull, WideLineFeed, WideCarriageReturn, WideVerticalTab, WideFormFeed]) and + {$ENDIF COMPILER12_UP} (Tail^ <> WideLineSeparator) and (Tail^ <> WideParagraphSeparator) do Inc(Tail); Inc(LineCount); @@ -725,9 +735,9 @@ end; function TJvBalloonWindow.CalcHintRectUTF8(MaxWidth: Integer; - const AUTF8Hint: string; AData: Pointer): TRect; + const AUTF8Hint: {$IFDEF RTL200_UP}UTF8String{$ELSE}string{$ENDIF RTL200_UP}; AData: Pointer): TRect; begin - Result := CalcHintRectW(MaxWidth, UTF8ToWideString(AUTF8Hint), AData); + Result := CalcHintRectW(MaxWidth, {$IFDEF RTL200_UP}System.{$ENDIF RTL200_UP}UTF8ToWideString(AUTF8Hint), AData); end; function TJvBalloonWindow.CalcHintRectW(MaxWidth: Integer; @@ -1205,7 +1215,7 @@ while P^ <> #0 do begin Start := P; - while not (P^ in [#0, #10, #13]) do + while not CharInSet(P^, [#0, #10, #13]) do P := StrNextChar(P); SetString(S, Start, P - Start); W := Self.Canvas.TextWidth(S); @@ -1302,7 +1312,7 @@ try Region := CreateRectRgn(0, 0, 0, 0); RegionType := GetWindowRgn(Handle, Region); - if RegionType <> ERROR then + if RegionType <> Windows.ERROR then FrameRgn(Msg.DC, Region, BrushBlack, 1, 1); DeleteObject(Region); finally @@ -1319,7 +1329,7 @@ try Region := CreateRectRgn(0, 0, 0, 0); RegionType := GetWindowRgn(Handle, Region); - if RegionType <> ERROR then + if RegionType <> Windows.ERROR then begin FillRgn(Msg.DC, Region, Brush); // draw black border @@ -1383,10 +1393,10 @@ with FData do begin - RUTF8Hint := WideStringToUTF8(AHint); + RUTF8Hint := {$IFDEF RTL200_UP}UTF8Encode{$ELSE}WideStringToUTF8{$ENDIF RTL200_UP}(AHint); RIconKind := ikCustom; RImageIndex := AImageIndex; - RUTF8Header := WideStringToUTF8(AHeader); + RUTF8Header := {$IFDEF RTL200_UP}UTF8Encode{$ELSE}WideStringToUTF8{$ENDIF RTL200_UP}(AHeader); RVisibleTime := VisibleTime; end; @@ -1403,8 +1413,8 @@ with FData do begin - RUTF8Hint := WideStringToUTF8(AHint); - RUTF8Header := WideStringToUTF8(AHeader); + RUTF8Hint := {$IFDEF RTL200_UP}UTF8Encode{$ELSE}WideStringToUTF8{$ENDIF RTL200_UP}(AHint); + RUTF8Header := {$IFDEF RTL200_UP}UTF8Encode{$ELSE}WideStringToUTF8{$ENDIF RTL200_UP}(AHeader); RVisibleTime := VisibleTime; RIconKind := ikNone; end; @@ -1422,10 +1432,10 @@ with FData do begin - RUTF8Hint := WideStringToUTF8(AHint); + RUTF8Hint := {$IFDEF RTL200_UP}UTF8Encode{$ELSE}WideStringToUTF8{$ENDIF RTL200_UP}(AHint); RIconKind := AIconKind; RImageIndex := -1; - RUTF8Header := WideStringToUTF8(AHeader); + RUTF8Header := {$IFDEF RTL200_UP}UTF8Encode{$ELSE}WideStringToUTF8{$ENDIF RTL200_UP}(AHeader); RVisibleTime := VisibleTime; end; @@ -1443,8 +1453,8 @@ begin RAnchorWindow := AAnchorWindow; RAnchorPosition := AAnchorPosition; - RUTF8Header := WideStringToUTF8(AHeader); - RUTF8Hint := WideStringToUTF8(AHint); + RUTF8Header := {$IFDEF RTL200_UP}UTF8Encode{$ELSE}WideStringToUTF8{$ENDIF RTL200_UP}(AHeader); + RUTF8Hint := {$IFDEF RTL200_UP}UTF8Encode{$ELSE}WideStringToUTF8{$ENDIF RTL200_UP}(AHint); RVisibleTime := VisibleTime; RIconKind := AIconKind; RImageIndex := AImageIndex; @@ -1464,8 +1474,8 @@ begin RAnchorWindow := nil; RAnchorPosition := Point((ARect.Left + ARect.Right) div 2, ARect.Bottom); - RUTF8Header := WideStringToUTF8(AHeader); - RUTF8Hint := WideStringToUTF8(AHint); + RUTF8Header := {$IFDEF RTL200_UP}UTF8Encode{$ELSE}WideStringToUTF8{$ENDIF RTL200_UP}(AHeader); + RUTF8Hint := {$IFDEF RTL200_UP}UTF8Encode{$ELSE}WideStringToUTF8{$ENDIF RTL200_UP}(AHint); RVisibleTime := VisibleTime; RIconKind := AIconKind; RImageIndex := AImageIndex; @@ -1629,7 +1639,7 @@ begin { Use defaults if necessairy: } if boUseDefaultHeader in Options then - RUTF8Header := WideStringToUTF8(DefaultHeader); + RUTF8Header := {$IFDEF RTL200_UP}UTF8Encode{$ELSE}WideStringToUTF8{$ENDIF RTL200_UP}(DefaultHeader); if boUseDefaultIcon in Options then RIconKind := DefaultIcon; if boUseDefaultImageIndex in Options then @@ -1684,7 +1694,7 @@ if boPlaySound in Options then GlobalCtrl.PlaySound(RIconKind); - FHint.InternalActivateHint(Rect, RUTF8Hint); + FHint.InternalActivateHint(Rect, {$IFDEF RTL200_UP}System.UTF8ToString{$ENDIF RTL200_UP}(RUTF8Hint)); { Now we can determine the actual anchor & stempoint position: } if Assigned(RAnchorWindow) then @@ -2104,9 +2114,9 @@ begin FImageIndex := RImageIndex; FIconKind := RIconKind; - FHeader := UTF8ToWideString(RUTF8Header); + FHeader := {$IFDEF RTL200_UP}System.{$ENDIF RTL200_UP}UTF8ToWideString(RUTF8Header); if FHeader = '' then - FHeader := RUTF8Header; + FHeader := WideString(RUTF8Header); FShowHeader := FHeader > ''; FShowIcon := (FIconKind <> ikNone) and Modified: trunk/jvcl/run/JvBandObject.pas =================================================================== --- trunk/jvcl/run/JvBandObject.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvBandObject.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -1134,14 +1134,14 @@ MenuItem := BandContextMenu.FindItem(idCmd, fkCommand); if MenuItem = nil then Exit; - StrCopy(pszName, PChar(MenuItem.Hint)); + StrCopy(pszName, PAnsiChar(AnsiString(MenuItem.Hint))); // text lost here, unicode version should be considered end; GCS_VERB: begin MenuItem := BandContextMenu.FindItem(idCmd, fkCommand); if MenuItem = nil then Exit; - StrCopy(pszName, PChar(GetContextMenuCaption(MenuItem))); + StrCopy(pszName, PAnsiChar(AnsiString(GetContextMenuCaption(MenuItem)))); // text lost here, unicode version should be considered end; GCS_VALIDATE: Result := NOERROR; Modified: trunk/jvcl/run/JvBaseDBThreadedDataset.pas =================================================================== --- trunk/jvcl/run/JvBaseDBThreadedDataset.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvBaseDBThreadedDataset.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -420,6 +420,9 @@ uses Dialogs, + {$IFNDEF COMPILER12_UP} + JvJCLUtils, + {$ENDIF ~COMPILER12_UP} JvDynControlEngineIntf, JvDSADialogs, JvResources; //=== { TJvDatasetThreadDialog } ============================================= @@ -902,7 +905,7 @@ S := LowerCase(Dataset.Fields[I].DisplayLabel); Upper := True; for J := 1 to Length(S) do - if S[J] in ['_', '$', ' '] then + if CharInSet(S[J], ['_', '$', ' ']) then begin Upper := True; S[J] := ' '; Modified: trunk/jvcl/run/JvBaseEdits.pas =================================================================== --- trunk/jvcl/run/JvBaseEdits.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvBaseEdits.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -354,7 +354,7 @@ begin Result := False; for I := 1 to Length(Value) do - if not (Value[I] in [DecimalSeparator, '-', '+', '0'..'9', 'e', 'E']) then + if not CharInSet(Value[I], [DecimalSeparator, '-', '+', '0'..'9', 'e', 'E']) then Exit; {$IFDEF CLR} Result := TryStrToFloat(Value, d); @@ -371,7 +371,7 @@ begin Result := ''; MaxSym := Length(S); - IsSign := (MaxSym > 0) and (S[1] in SignSymbols); + IsSign := (MaxSym > 0) and CharInSet(S[1], SignSymbols); if IsSign then MinSym := 2 else @@ -471,7 +471,7 @@ function xTextToValText(const AValue: string): string; begin Result := DelRSpace(AValue); - if DecimalSeparator <> AnsiChar(ThousandSeparator) then + if AnsiChar(DecimalSeparator) <> AnsiChar(ThousandSeparator) then Result := DelChars(Result, ThousandSeparator); if (DecimalSeparator <> '.') and (ThousandSeparator <> '.') then Result := ReplaceStr(Result, '.', DecimalSeparator); @@ -514,18 +514,18 @@ procedure TJvCustomNumEdit.KeyPress(var Key: Char); begin - if PopupVisible and (UpCase(Key) in + if PopupVisible and CharInSet(UpCase(Key), DigitSymbols + [DecimalSeparator, '.', ',', '+', '-', '*', '/', '_', '=', 'C', 'R', 'Q', '%', Backspace, Cr] - - [AnsiChar(ThousandSeparator)]) then + [ThousandSeparator]) then begin TJvPopupWindowAccessProtected(FPopup).KeyPress(Key); Key := #0; end; - if Key in ['.', ','] - [AnsiChar(ThousandSeparator)] then - Key := Char(DecimalSeparator); + if CharInSet(Key, ['.', ','] - [ThousandSeparator]) then + Key := DecimalSeparator; inherited KeyPress(Key); - if (Key in [#32..#255]) and not IsValidChar(Key) then + if CharInSet(Key, [#32..#255]) and not IsValidChar(Key) then begin DoBeepOnError; Key := #0; @@ -1007,7 +1007,7 @@ for I := 1 to Length(CurrencyString) do begin C := CurrencyString[I]; - if C in [',', '.'] then + if CharInSet(C, [',', '.']) then CurrStr := CurrStr + '''' + C + '''' else CurrStr := CurrStr + C; Modified: trunk/jvcl/run/JvBdeUtils.pas =================================================================== --- trunk/jvcl/run/JvBdeUtils.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvBdeUtils.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -105,7 +105,7 @@ function GetQuoteChar(Database: TDatabase): string; procedure ExecuteQuery(const DbName, QueryText: string); procedure ExecuteQueryEx(const SessName, DbName, QueryText: string); -procedure BdeTranslate(Locale: TLocale; Source, Dest: PChar; ToOem: Boolean); +procedure BdeTranslate(Locale: TLocale; Source, Dest: PAnsiChar; ToOem: Boolean); function FieldLogicMap(FldType: TFieldType): Integer; function FieldSubtypeMap(FldType: TFieldType): Integer; procedure ConvertStringToLogicType(Locale: TLocale; FldLogicType: Integer; @@ -363,7 +363,7 @@ try case FldLogicType of fldZSTRING: - AnsiToNative(Locale, Value, PChar(Buffer), FldSize); + AnsiToNative(Locale, AnsiString(Value), PAnsiChar(Buffer), FldSize); // potential data loss under D2009 because of AnsiString cast fldBYTES, fldVARBYTES: Move(Value[1], Buffer^, Min(Length(Value), FldSize)); fldINT16, fldINT32, fldUINT16, fldINT64: @@ -384,7 +384,7 @@ if L = 0 then B := False else - B := Value[1] in ['Y', 'y', 'T', 't', '1']; + B := CharInSet(Value[1], ['Y', 'y', 'T', 't', '1']); Move(B, Buffer^, SizeOf(WordBool)); end; fldFLOAT, fldBCD: @@ -516,10 +516,10 @@ idSQLUserID = 'USERID'; var ParamList: TStringList; - DBPath: string[127]; - TempStr, AppConName: string[127]; - UserName: string[30]; - ExeName: string[12]; + DBPath: string; + TempStr, AppConName: string; + UserName: string; + ExeName: string; IniFile: TIniFile; begin ParamList := TStringList.Create; @@ -574,10 +574,10 @@ I := 1; while I <= Length(DatabaseName) do begin - if DatabaseName[I] in LeadBytes then + if CharInSet(DatabaseName[I], LeadBytes) then Inc(I) else - if DatabaseName[I] in [':', '\'] then + if CharInSet(DatabaseName[I], [':', '\']) then Exit; Inc(I); end; @@ -591,13 +591,13 @@ Params: TStrings; begin Result := ''; - StrPLCopy(SAlias, AliasName, SizeOf(SAlias) - 1); + StrPLCopy(SAlias, AnsiString(AliasName), SizeOf(SAlias) - 1); AnsiToOem(SAlias, SAlias); Check(DbiGetDatabaseDesc(SAlias, @Desc)); if StrIComp(Desc.szDbType, szCFGDBSTANDARD) = 0 then begin OemToAnsi(Desc.szPhyName, Desc.szPhyName); - Result := StrPas(Desc.szPhyName); + Result := string(StrPas(Desc.szPhyName)); end else begin @@ -995,7 +995,7 @@ NewIndex := ''; for I := Low(IndexFields) to High(IndexFields) do begin - NewIndex := NewIndex + TVarRec(IndexFields[I]).VString^; + NewIndex := NewIndex + string(TVarRec(IndexFields[I]).VString^); if I <> High(IndexFields) then NewIndex := NewIndex + ';'; end; @@ -1055,7 +1055,7 @@ { Uses as a handle to the database } hDb: hDBIDb; { Path to the currently opened table } - TablePath: array [0..dbiMaxPathLen] of Char; + TablePath: array [0..dbiMaxPathLen] of AnsiChar; Exclusive: Boolean; begin if not Table.Active then @@ -1070,7 +1070,7 @@ with TblDesc do begin { Place the table name in descriptor } - StrPCopy(szTblName, Table.TableName); + StrPCopy(szTblName, AnsiString(Table.TableName)); { Place the table type in descriptor } StrCopy(szTblType, CurProp.szTableType); bPack := True; @@ -1293,7 +1293,7 @@ I: Integer; S, Path: string; BatchMove: TBatchMove; - TablePath: array[0..dbiMaxPathLen] of Char; + TablePath: array[0..dbiMaxPathLen] of AnsiChar; begin if Source = nil then _DBError(SDataSetEmpty); @@ -1350,7 +1350,7 @@ DestTable.Open; try Check(DbiGetDirectory(DestTable.DBHandle, False, TablePath)); - Path := NormalDir(OemToAnsiStr(StrPas(TablePath))); + Path := NormalDir(string(OemToAnsiStr(StrPas(TablePath)))); finally DestTable.Close; end; @@ -1445,7 +1445,7 @@ _DBError(SDatabaseClosed); end; -procedure BdeTranslate(Locale: TLocale; Source, Dest: PChar; ToOem: Boolean); +procedure BdeTranslate(Locale: TLocale; Source, Dest: PAnsiChar; ToOem: Boolean); var Len: Cardinal; begin @@ -1458,10 +1458,10 @@ Dest[Len] := #0; end; -function TrimMessage(Msg: PChar): PChar; +function TrimMessage(Msg: PAnsiChar): PAnsiChar; var Blank: Boolean; - Source, Dest: PChar; + Source, Dest: PAnsiChar; begin Source := Msg; Dest := Msg; @@ -1501,7 +1501,7 @@ if Msg[0] = #0 then Result := Format(SBDEError, [ErrorCode]) else - Result := StrPas(Msg); + Result := string(StrPas(Msg)); while True do begin StrCopy(LastMsg, Msg); @@ -1568,7 +1568,7 @@ FileName: DBIPATH; begin Check(DbiDebugLayerOptions(Options[Active], StrPLCopy(FileName, - DebugFile, SizeOf(DBIPATH) - 1))); + AnsiString(DebugFile), SizeOf(DBIPATH) - 1))); end; { begin JvDBUtil } @@ -1606,7 +1606,7 @@ Rem := False; while (Length(S) > 0) do begin - if (S[1] in [' ', Cr, Lf]) then + if CharInSet(S[1], [' ', Cr, Lf]) then Delete(S, 1, 1) else if Rem then @@ -1674,7 +1674,7 @@ begin S1 := Q; N2 := 0; - while (Length(S1) > 0) and (S1[1] in [' ', Cr, Lf]) do + while (Length(S1) > 0) and CharInSet(S1[1], [' ', Cr, Lf]) do begin Delete(S1, 1, 1); Inc(N2); @@ -1950,7 +1950,7 @@ OpType: CROpType; begin SetLength(Dir, dbiMaxNameLen + 1); - Check(DbiGetDirectory(Tbl.DBHandle, False, PChar(Dir))); + Check(DbiGetDirectory(Tbl.DBHandle, False, PAnsiChar(AnsiString(Dir)))); SetLength(Dir, StrLen(PChar(Dir))); RInt := AllocMem(SizeOf(RINTDesc)); try @@ -1958,11 +1958,11 @@ Tbl.DisableControls; Tbl.Close; Check(DbiOpenDatabase(nil, nil, dbiReadWrite, dbiOpenExcl, nil, 0, nil, nil, hDb)); - Check(DbiSetDirectory(hDb, PChar(Dir))); + Check(DbiSetDirectory(hDb, PAnsiChar(AnsiString(Dir)))); with RInt^ do begin - StrPCopy(szRintName, RefName); - StrPCopy(szTblName, MasterTable); + StrPCopy(szRintName, AnsiString(RefName)); + StrPCopy(szTblName, AnsiString(MasterTable)); eType := rintDEPENDENT; eModOp := ModOp; eDelOp := DelOp; @@ -1974,7 +1974,7 @@ TblDesc.pRINTDesc := RInt; OpType := crADD; TblDesc.pecrRintOp := @OpType; - StrPCopy(TblDesc.szTblName, Tbl.TableName); + StrPCopy(TblDesc.szTblName, AnsiString(Tbl.TableName)); StrCopy(TblDesc.szTblType, szPARADOX); Check(DbiDoRestructure(hDb, 1, @TblDesc, nil, nil, nil, False)); finally @@ -2049,11 +2049,11 @@ with TblDesc do begin { Place the table name in descriptor } - StrPCopy(szTblName, Table.TableName); + StrPCopy(szTblName, AnsiString(Table.TableName)); { Place the table type in descriptor } StrCopy(szTblType, szPARADOX); { Master Password, Password } - StrPCopy(szPassword, pswd); + StrPCopy(szPassword, AnsiString(pswd)); { Set bProtected to True } bProtected := RESTRUCTURE_TRUE; end; @@ -2098,13 +2098,13 @@ // Get the database handle from the table's cursor handle... Check(DbiGetObjFromObj(hDBIObj(Table.Handle), objDATABASE, hDBIObj(hDb))); // Put the table name in the table descriptor... - StrPCopy(TableDesc.szTblName, Table.TableName); + StrPCopy(TableDesc.szTblName, AnsiString(Table.TableName)); // Put the table type in the table descriptor... StrPCopy(TableDesc.szTblType, Props.szTableType); // Set the Pack option in the table descriptor to True... TableDesc.bPack := True; { Master Password, Password } - StrPCopy(TableDesc.szPassword, pswd); + StrPCopy(TableDesc.szPassword, AnsiString(pswd)); { Set bProtected to True } TableDesc.bProtected := RESTRUCTURE_TRUE; // Close the table so the restructure can complete... Modified: trunk/jvcl/run/JvBrowseFolder.pas =================================================================== --- trunk/jvcl/run/JvBrowseFolder.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvBrowseFolder.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -327,7 +327,7 @@ {$ELSE} type TSHGetFolderPathProc = function(hWnd: HWND; CSIDL: Integer; hToken: THandle; - dwFlags: DWORD; pszPath: PAnsiChar): HResult; stdcall; + dwFlags: DWORD; pszPath: PChar): HResult; stdcall; var SHGetFolderPathProc: TSHGetFolderPathProc = nil; @@ -484,7 +484,7 @@ begin case StrRet.uType of STRRET_CSTR: - SetString(Result, StrRet.cStr, lStrLen(StrRet.cStr)); + SetString(Result, StrRet.cStr, lStrLenA(StrRet.cStr)); STRRET_OFFSET: begin P := @PIDL.mkid.abID[StrRet.uOffset - SizeOf(PIDL.mkid.cb)]; @@ -685,7 +685,11 @@ { You never know, maybe someone does not have SHFolder.dll, thus load on request } SHFolderHandle := GetModuleHandle(SHFolderDll); if SHFolderHandle <> 0 then + {$IFDEF UNICODE} + SHGetFolderPathProc := GetProcAddress(SHFolderHandle, 'SHGetFolderPathW'); + {$ELSE} SHGetFolderPathProc := GetProcAddress(SHFolderHandle, 'SHGetFolderPathA'); + {$ENDIF UNICODE} end; {$ENDIF CLR} @@ -729,7 +733,7 @@ APath := ''; {$ELSE} - GetMem(Buffer, MAX_PATH); + GetMem(Buffer, MAX_PATH * SizeOf(Char)); try if not Assigned(SHGetFolderPathProc) then InitSHFolder; Modified: trunk/jvcl/run/JvCabFile.pas =================================================================== --- trunk/jvcl/run/JvCabFile.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvCabFile.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -171,7 +171,7 @@ function CExtract(Context: Pointer; Notification: UINT; Param1, Param2: UINT_PTR): UINT; stdcall; var - CAB: PFileInCabinetInfoA; + CAB: PFileInCabinetInfo; Sender: TJvCABFile; CABInfo: TCABInfo; Cont: Boolean; @@ -268,7 +268,7 @@ procedure TJvCABFile.RefreshFiles; begin Files.Clear; - if SetupIterateCabinetA(PChar(FFileName), 0, CBack, @Self) then + if SetupIterateCabinet(PChar(FFileName), 0, CBack, @Self) then if Assigned(FOnFiles) then FOnFiles(Self); end; @@ -278,7 +278,7 @@ if DestPath[Length(DestPath)] <> PathDelim then DestPath := DestPath + PathDelim; FDestPath := DestPath; - Result := SetupIterateCabinetA(PChar(FFileName), 0, CExtract, @Self); + Result := SetupIterateCabinet(PChar(FFileName), 0, CExtract, @Self); end; function TJvCABFile.ExtractFile(FileName, DestPath: string): Boolean; @@ -286,7 +286,7 @@ if DestPath[Length(DestPath)] <> PathDelim then DestPath := DestPath + PathDelim; FDestPath := DestPath + FileName; - Result := SetupIterateCabinetA(PChar(FFileName), 0, CExtract, @Self); + Result := SetupIterateCabinet(PChar(FFileName), 0, CExtract, @Self); end; {$IFDEF UNITVERSIONING} Modified: trunk/jvcl/run/JvCalc.pas =================================================================== --- trunk/jvcl/run/JvCalc.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvCalc.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -307,7 +307,7 @@ function CreateCalcBtn(AParent: TWinControl; AKind: TCalcBtnKind; AOnClick: TNotifyEvent; ALayout: TCalcPanelLayout): TJvCalcButton; const - BtnCaptions: array [cbSgn..cbMC] of string[4] = + BtnCaptions: array [cbSgn..cbMC] of string = ('', ',', '/', '*', '-', '+', 'sqrt', '%', '1/x', '=', '<-', 'C', 'MP', 'MS', 'MR', 'MC'); begin @@ -871,7 +871,7 @@ Key := #0; if Assigned(FOnCalcKey) then FOnCalcKey(Self, Key); - if Key in [AnsiChar(DecimalSeparator{$IFDEF CLR}[1]{$ENDIF}), '.', ','] then + if CharInSet(Key, [DecimalSeparator{$IFDEF CLR}[1]{$ENDIF}, '.', ',']) then begin CheckFirst; if Pos(DecimalSeparator, Text) = 0 then @@ -945,7 +945,7 @@ end; FOperator := Key; FOperand := GetDisplay; - if Key in ResultKeys then + if CharInSet(Key, ResultKeys) then if Assigned(FOnResult) then FOnResult(Self); end; @@ -1031,7 +1031,7 @@ I: Integer; BtnTag: Longint; begin - if Key in [AnsiChar(DecimalSeparator{$IFDEF CLR}[1]{$ENDIF}), '.', ','] then + if CharInSet(Key, [DecimalSeparator{$IFDEF CLR}[1]{$ENDIF}, '.', ',']) then Key := '.' else if Key = Cr then Modified: trunk/jvcl/run/JvCalendar.pas =================================================================== --- trunk/jvcl/run/JvCalendar.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvCalendar.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -1060,7 +1060,7 @@ procedure TJvCustomMonthCalendar.ColorChanged; begin inherited ColorChanged; - InvalidateRect(Handle, nil, True); + Windows.InvalidateRect(Handle, nil, True); end; procedure TJvCustomMonthCalendar.FontChanged; @@ -1068,7 +1068,7 @@ inherited FontChanged; // if HandleAllocated then // Perform(WM_SIZE,0,0); - InvalidateRect(Handle, nil, True); + Windows.InvalidateRect(Handle, nil, True); end; procedure TJvCustomMonthCalendar.SetMultiSelect(Value: Boolean); Modified: trunk/jvcl/run/JvCaptionButton.pas =================================================================== --- trunk/jvcl/run/JvCaptionButton.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvCaptionButton.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -2076,12 +2076,26 @@ // if the mouse is in the area of the button if PtInRect(LButtonRect, CurPos) then + {$IFDEF SUPPORTS_UNICODE} + if Msg.NMHdr.code = TTN_NEEDTEXTW then + begin + with PNMTTDispInfoW(Msg.NMHdr)^ do + begin + // then we return the hint + lpszText := PChar(FHint); // we do loose text here, but unicode should have kicked in anyway + hinst := 0; + uFlags := TTF_IDISHWND; + hdr.idFrom := ParentFormHandle; + end; + end + else + {$ENDIF SUPPORTS_UNICODE} if Msg.NMHdr.code = TTN_NEEDTEXTA then begin with PNMTTDispInfoA(Msg.NMHdr)^ do begin // then we return the hint - lpszText := PChar(FHint); + lpszText := PAnsiChar(AnsiString(FHint)); // we do loose text here, but unicode should have kicked in anyway hinst := 0; uFlags := TTF_IDISHWND; hdr.idFrom := ParentFormHandle; Modified: trunk/jvcl/run/JvCheckListBox.pas =================================================================== --- trunk/jvcl/run/JvCheckListBox.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvCheckListBox.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -841,7 +841,7 @@ begin R := ClientRect; R.Right := R.Left + 20; - InvalidateRect(Handle, {$IFNDEF CLR}@{$ENDIF}R, False); + Windows.InvalidateRect(Handle, {$IFNDEF CLR}@{$ENDIF}R, False); end; end; if Assigned(FOnHScroll) then Modified: trunk/jvcl/run/JvCipher.pas =================================================================== --- trunk/jvcl/run/JvCipher.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvCipher.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -262,7 +262,7 @@ begin if Size > 0 then begin - N := StrToIntDef(Key, 13); + N := StrToIntDef(string(Key), 13); if (N <= 0) or (N >= 256) then N := 13; for I := 0 to Size - 1 do @@ -277,7 +277,7 @@ begin if Size > 0 then begin - N := StrToIntDef(Key, 13); + N := StrToIntDef(string(Key), 13); if (N <= 0) or (N >= 256) then N := 13; for I := 0 to Size - 1 do Modified: trunk/jvcl/run/JvClock.pas =================================================================== --- trunk/jvcl/run/JvClock.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvClock.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -281,7 +281,7 @@ procedure InvalidTime(Hour, Min, Sec: Word); var - sTime: string[50]; + sTime: string; begin sTime := IntToStr(Hour) + TimeSeparator + IntToStr(Min) + TimeSeparator + IntToStr(Sec); Modified: trunk/jvcl/run/JvComCtrls.pas =================================================================== --- trunk/jvcl/run/JvComCtrls.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvComCtrls.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -391,7 +391,7 @@ procedure SetReduceMemoryUse(const Value: Boolean); procedure SetTabPainter(const Value: TJvTabControlPainter); protected - function HintShow(var HintInfo: THintInfo): Boolean; override; + function HintShow(var HintInfo: {$IFDEF RTL200_UP}Controls.{$ENDIF RTL200_UP}THintInfo): Boolean; override; function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; override; @@ -484,7 +484,7 @@ public class function CreateEnh(AOwner: TTreeNodes): TJvTreeNode; - constructor Create(AOwner: TTreeNodes); {$IFDEF CLR}reintroduce;{$ENDIF} virtual; + constructor Create(AOwner: TTreeNodes); {$IFDEF CLR}reintroduce;{$ENDIF} {$IFDEF RTL200_UP}override{$ELSE}virtual{$ENDIF RTL200_UP}; destructor Destroy; override; procedure MoveTo(Destination: TTreeNode; Mode: TNodeAttachMode); override; @@ -2048,7 +2048,7 @@ inherited; end; -function TJvPageControl.HintShow(var HintInfo: THintInfo): Boolean; +function TJvPageControl.HintShow(var HintInfo: {$IFDEF RTL200_UP}Controls.{$ENDIF RTL200_UP}THintInfo): Boolean; var TabNo: Integer; Tab: TTabSheet; @@ -2703,7 +2703,7 @@ if Assigned(Node) and Node.IsVisible then begin R := Node.DisplayRect(True); - InvalidateRect(Handle, {$IFNDEF CLR}@{$ENDIF} R, False); + Windows.InvalidateRect(Handle, {$IFNDEF CLR}@{$ENDIF} R, False); end; end; @@ -2716,7 +2716,7 @@ R := Node.DisplayRect(True); R.Right := R.Left; R.Left := R.Left - Images.Width * 3; - InvalidateRect(Handle, {$IFNDEF CLR}@{$ENDIF} R, True); + Windows.InvalidateRect(Handle, {$IFNDEF CLR}@{$ENDIF} R, True); end; end; Modified: trunk/jvcl/run/JvCombobox.pas =================================================================== --- trunk/jvcl/run/JvCombobox.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ trunk/jvcl/run/JvCombobox.pas 2008-09-09 20:45:14 UTC (rev 11893) @@ -83,7 +83,7 @@ property Updating: Boolean read FUpdating; property DestroyCount: Integer read FDestroyCnt; public - constructor Create; {$IFDEF CLR} override; {$ENDIF CLR} + constructor Create; {$IFDEF CLR}override;{$ENDIF CLR}{$IFDEF RTL200_UP}override;{$ENDIF RTL200_UP} destructor Destroy; override; function Add(const S: string): Integer; override; procedure Clear; override; Modified: trunk/jvcl/run/JvComputerInfoEx.pas =================================================================== --- trunk/jvcl/run/JvComputerInfoEx.pas 2008-09-09 20:35:07 UTC (rev 11892) +++ t... [truncated message content] |
From: <jfu...@us...> - 2008-09-23 22:45:09
|
Revision: 11917 http://jvcl.svn.sourceforge.net/jvcl/?rev=11917&view=rev Author: jfudickar Date: 2008-09-23 22:45:06 +0000 (Tue, 23 Sep 2008) Log Message: ----------- Fixes for Mantis 4473 to synchronize the behaviours TJvCustomAppXMLStorage.EnumValues : Foldernames are no longer delivered TJvCustomAppIniStorage.EnumFolders : No duplicate delimiters (Mantis #4473) Modified Paths: -------------- trunk/jvcl/run/JvAppIniStorage.pas trunk/jvcl/run/JvAppXMLStorage.pas Modified: trunk/jvcl/run/JvAppIniStorage.pas =================================================================== --- trunk/jvcl/run/JvAppIniStorage.pas 2008-09-23 20:42:56 UTC (rev 11916) +++ trunk/jvcl/run/JvAppIniStorage.pas 2008-09-23 22:45:06 UTC (rev 11917) @@ -508,7 +508,7 @@ Strings.Delete(I) else if RefPath <> '' then - Strings[I] := Copy(Strings[I], 1 + Length(RefPath), Length(Strings[I]) - Length(RefPath)); + Strings[I] := Copy(Strings[I], 2 + Length(RefPath), Length(Strings[I]) - Length(RefPath)); Dec(I); end; finally Modified: trunk/jvcl/run/JvAppXMLStorage.pas =================================================================== --- trunk/jvcl/run/JvAppXMLStorage.pas 2008-09-23 20:42:56 UTC (rev 11916) +++ trunk/jvcl/run/JvAppXMLStorage.pas 2008-09-23 22:45:06 UTC (rev 11917) @@ -786,9 +786,17 @@ begin Name := Node.Items[I].Name; if (not PathIsList or (not AnsiSameText(cCount, Name) and - not NameIsListItem(Name))) then + not NameIsListItem(Name))) //and not IsFolder(FullName) + then Strings.Add(Name); end; + i := Strings.Count-1; + while i >= 0 do + begin + if ListStored(ConcatPaths([Path, Strings[i]])) or IsFolder(ConcatPaths([Path, Strings[i]])) then + Strings.Delete(i); + Dec(i); + end; finally Strings.EndUpdate; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jfu...@us...> - 2008-09-24 21:02:54
|
Revision: 11918 http://jvcl.svn.sourceforge.net/jvcl/?rev=11918&view=rev Author: jfudickar Date: 2008-09-24 21:02:48 +0000 (Wed, 24 Sep 2008) Log Message: ----------- Fixes for Mantis 4473 (Mantis #4473) Modified Paths: -------------- trunk/jvcl/run/JvAppIniStorage.pas trunk/jvcl/run/JvAppStorage.pas trunk/jvcl/run/JvAppXMLStorage.pas Modified: trunk/jvcl/run/JvAppIniStorage.pas =================================================================== --- trunk/jvcl/run/JvAppIniStorage.pas 2008-09-23 22:45:06 UTC (rev 11917) +++ trunk/jvcl/run/JvAppIniStorage.pas 2008-09-24 21:02:48 UTC (rev 11918) @@ -489,30 +489,38 @@ var RefPath: string; I: Integer; + TempStrings : tStrings; + s : String; + p : Integer; + lr : Integer; begin + TempStrings := TStringlist.Create; Strings.BeginUpdate; try RefPath := GetAbsPath(Path); - if RefPath = '' then - RefPath := DefaultSection; ReloadIfNeeded; - IniFile.ReadSections(Strings); - I := Strings.Count - 1; - while I >= 0 do + IniFile.ReadSections(TempStrings); + lr := Length(RefPath); + for i := 0 to TempStrings.Count - 1 do begin - if (RefPath <> '') and ((Copy(Strings[I], 1, Length(RefPath) + 1) <> RefPath + PathDelim) or - (Pos(PathDelim, Copy(Strings[I], 2 + Length(RefPath), Length(Strings[I]) - Length(RefPath))) > 0)) then - Strings.Delete(I) - else - if ReportListAsValue and ValueExists(Strings[I], cCount) then - Strings.Delete(I) - else + s := TempStrings[i]; + if (RefPath <> '') and (Copy(s, 1, lr + 1) <> RefPath + PathDelim) then + Continue; + if ReportListAsValue and ValueExists(s, cCount) then + Continue; if RefPath <> '' then - Strings[I] := Copy(Strings[I], 2 + Length(RefPath), Length(Strings[I]) - Length(RefPath)); - Dec(I); + s := Copy(s, 2 + lr, Length(s) - lr); + p := Pos(PathDelim, s); + if p > 0 then + s := Copy(s, 1, p-1); + if (RefPath = '') and (s = DefaultSection) then + Continue; + if Strings.IndexOf(s) < 0 then + Strings.Add(s); end; finally Strings.EndUpdate; + TempStrings.Free; end; end; Modified: trunk/jvcl/run/JvAppStorage.pas =================================================================== --- trunk/jvcl/run/JvAppStorage.pas 2008-09-23 22:45:06 UTC (rev 11917) +++ trunk/jvcl/run/JvAppStorage.pas 2008-09-24 21:02:48 UTC (rev 11918) @@ -1664,8 +1664,8 @@ Strings.AddObject(PrefixPath + TempList[I], TObject(aptFolder)); end; if aeoRecursive in Options then - InternalGetStoredValues(PrefixPath + TempList[I] + PathDelim, - SearchPath + PathDelim + TempList[I], + InternalGetStoredValues(ConcatPaths([PrefixPath, TempList[I]]) + PathDelim, + ConcatPaths([SearchPath, TempList[I]]), Strings, Options); end; end; Modified: trunk/jvcl/run/JvAppXMLStorage.pas =================================================================== --- trunk/jvcl/run/JvAppXMLStorage.pas 2008-09-23 22:45:06 UTC (rev 11917) +++ trunk/jvcl/run/JvAppXMLStorage.pas 2008-09-24 21:02:48 UTC (rev 11918) @@ -747,17 +747,18 @@ try Strings.Clear; for I := 0 to Node.Items.Count - 1 do - Strings.Add(Node.Items[I].Name); + if Node.Items[i].Items.Count > 0 then + Strings.Add(Node.Items[I].Name); finally Strings.EndUpdate; end; end - else - {$IFDEF CLR} - raise EJVCLException.CreateFmt(RsEPathDoesntExists, [RefPath]); - {$ELSE} - raise EJVCLException.CreateResFmt(@RsEPathDoesntExists, [RefPath]); - {$ENDIF CLR} +// else +// {$IFDEF CLR} +// raise EJVCLException.CreateFmt(RsEPathDoesntExists, [RefPath]); +// {$ELSE} +// raise EJVCLException.CreateResFmt(@RsEPathDoesntExists, [RefPath]); +// {$ENDIF CLR} end; procedure TJvCustomAppXMLStorage.EnumValues(const Path: string; @@ -801,12 +802,12 @@ Strings.EndUpdate; end; end - else - {$IFDEF CLR} - raise EJVCLException.CreateFmt(RsEPathDoesntExists, [RefPath]); - {$ELSE} - raise EJVCLException.CreateResFmt(@RsEPathDoesntExists, [RefPath]); - {$ENDIF CLR} +// else +// {$IFDEF CLR} +// raise EJVCLException.CreateFmt(RsEPathDoesntExists, [RefPath]); +// {$ELSE} +// raise EJVCLException.CreateResFmt(@RsEPathDoesntExists, [RefPath]); +// {$ENDIF CLR} end; function TJvCustomAppXMLStorage.IsFolderInt(const Path: string; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jfu...@us...> - 2008-09-24 22:49:22
|
Revision: 11919 http://jvcl.svn.sourceforge.net/jvcl/?rev=11919&view=rev Author: jfudickar Date: 2008-09-24 21:36:04 +0000 (Wed, 24 Sep 2008) Log Message: ----------- Mantis 0004481: bug in JvTFUtils.IncMonths (Mantis #0004481) Modified Paths: -------------- trunk/jvcl/run/JvTFGlance.pas trunk/jvcl/run/JvTFUtils.pas Modified: trunk/jvcl/run/JvTFGlance.pas =================================================================== --- trunk/jvcl/run/JvTFGlance.pas 2008-09-24 21:02:48 UTC (rev 11918) +++ trunk/jvcl/run/JvTFGlance.pas 2008-09-24 21:36:04 UTC (rev 11919) @@ -2869,7 +2869,7 @@ var ExtraDesc : string; begin - if FViewer.ShowSchedNamesInHint then + if Assigned(FViewer) and FViewer.ShowSchedNamesInHint then {$IFDEF USEJVCL} ExtraDesc := StringsToStr(SchedNames, ', ', False); {$ELSE} Modified: trunk/jvcl/run/JvTFUtils.pas =================================================================== --- trunk/jvcl/run/JvTFUtils.pas 2008-09-24 21:02:48 UTC (rev 11918) +++ trunk/jvcl/run/JvTFUtils.pas 2008-09-24 21:36:04 UTC (rev 11919) @@ -261,10 +261,12 @@ // N defaults to 1 var Y, M, D, EOMD: Word; + X : Cardinal; begin DecodeDate(ADate, Y, M, D); - Inc(Y, N div 12); - Inc(M, N mod 12); + X := ((Y * 12) + M - 1 + N); + Y := X div 12; + M := (X mod 12) + 1; // Be careful not to get invalid date in Feb. if M = 2 then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jfu...@us...> - 2008-10-05 21:59:06
|
Revision: 11938 http://jvcl.svn.sourceforge.net/jvcl/?rev=11938&view=rev Author: jfudickar Date: 2008-10-05 21:59:03 +0000 (Sun, 05 Oct 2008) Log Message: ----------- Mantis 0004473: Second fix for GetStoredValues Implementation (Mantis #0004473) Modified Paths: -------------- trunk/jvcl/run/JvAppIniStorage.pas trunk/jvcl/run/JvAppStorage.pas Modified: trunk/jvcl/run/JvAppIniStorage.pas =================================================================== --- trunk/jvcl/run/JvAppIniStorage.pas 2008-10-05 07:52:43 UTC (rev 11937) +++ trunk/jvcl/run/JvAppIniStorage.pas 2008-10-05 21:59:03 UTC (rev 11938) @@ -688,28 +688,47 @@ function TJvCustomAppIniStorage.IsFolderInt(const Path: string; ListIsValue: Boolean): Boolean; var RefPath: string; - ValueNames: TStrings; + ValueNames: TStringList; + Sections : TStringList; I: Integer; begin RefPath := GetAbsPath(Path); if RefPath = '' then RefPath := DefaultSection; ReloadIfNeeded; - Result := IniFile.SectionExists(RefPath); - if Result and ListIsValue and IniFile.ValueExists(RefPath, cCount) then + if IniFile.SectionExists(RefPath) then + if ListIsValue and IniFile.ValueExists(RefPath, cCount) then + begin + ValueNames := TStringList.Create; + try + EnumValues(Path, ValueNames, True); + I := ValueNames.Count - 1; + Result := i > 0; + while Result and (I >= 0) do + begin + Result := not AnsiSameText(ValueNames[I], cCount) and not NameIsListItem(ValueNames[I]); + Dec(I); + end; + finally + ValueNames.Free; + end; + end + else + Result := True + else begin - Result := False; - ValueNames := TStringList.Create; + Sections := tStringList.Create; try - EnumValues(Path, ValueNames, True); - I := ValueNames.Count - 1; - while Result and (I >= 0) do - begin - Result := not AnsiSameText(ValueNames[I], cCount) and not NameIsListItem(ValueNames[I]); - Dec(I); - end; + IniFile.ReadSections(Sections); + for i := 0 to Sections.Count - 1 do + if Pos(RefPath+PathDelim, Sections[i]) = 1 then + begin + Result := True; + Exit; + end; + Result := False; finally - ValueNames.Free; + Sections.Free; end; end; end; Modified: trunk/jvcl/run/JvAppStorage.pas =================================================================== --- trunk/jvcl/run/JvAppStorage.pas 2008-10-05 07:52:43 UTC (rev 11937) +++ trunk/jvcl/run/JvAppStorage.pas 2008-10-05 21:59:03 UTC (rev 11938) @@ -1624,7 +1624,12 @@ I: Integer; S: string; PrevIdx: Integer; + InsertPath : string; begin + if PrefixPath = PathDelim then + InsertPath := '' + else + InsertPath := PrefixPath; TempList := TStringList.Create; try if aeoValues in Options then @@ -1635,7 +1640,7 @@ if TempList[I] = '' then S := Copy(PrefixPath, 1, Length(PrefixPath) - 1) else - S := PrefixPath + TempList[I]; + S := InsertPath + TempList[I]; if S <> '' then begin PrevIdx := Strings.IndexOf(S); @@ -1656,12 +1661,12 @@ if (aeoFolders in Options) and IsFolder(SearchPath + PathDelim + TempList[I], aeoReportListAsValue in Options) then begin - PrevIdx := Strings.IndexOf(PrefixPath + TempList[I]); + PrevIdx := Strings.IndexOf(InsertPath + TempList[I]); if PrevIdx > -1 then Strings.Objects[PrevIdx] := TObject(Integer(Strings.Objects[PrevIdx]) or aptFolder) else - Strings.AddObject(PrefixPath + TempList[I], TObject(aptFolder)); + Strings.AddObject(InsertPath + TempList[I], TObject(aptFolder)); end; if aeoRecursive in Options then InternalGetStoredValues(ConcatPaths([PrefixPath, TempList[I]]) + PathDelim, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ob...@us...> - 2008-10-16 16:22:09
|
Revision: 11964 http://jvcl.svn.sourceforge.net/jvcl/?rev=11964&view=rev Author: obones Date: 2008-10-16 16:22:00 +0000 (Thu, 16 Oct 2008) Log Message: ----------- Fixed warnings in D2009 Modified Paths: -------------- trunk/jvcl/run/JvAppDBStorage.pas trunk/jvcl/run/JvSegmentedLEDDisplay.pas Modified: trunk/jvcl/run/JvAppDBStorage.pas =================================================================== --- trunk/jvcl/run/JvAppDBStorage.pas 2008-10-16 09:12:52 UTC (rev 11963) +++ trunk/jvcl/run/JvAppDBStorage.pas 2008-10-16 16:22:00 UTC (rev 11964) @@ -247,7 +247,7 @@ SetLength(Buf1, BufSize); Move(Buf, Buf1[1], BufSize); JclMime.MimeEncode(Buf1[1], BufSize, Value[1]); - DoWriteString(Path, Value); + DoWriteString(Path, string(Value)); end; end; Modified: trunk/jvcl/run/JvSegmentedLEDDisplay.pas =================================================================== --- trunk/jvcl/run/JvSegmentedLEDDisplay.pas 2008-10-16 09:12:52 UTC (rev 11963) +++ trunk/jvcl/run/JvSegmentedLEDDisplay.pas 2008-10-16 16:22:00 UTC (rev 11964) @@ -243,7 +243,7 @@ procedure Paint; procedure PaintSegment(Index: Integer); - class function MapperFileID: string; virtual; + class function MapperFileID: AnsiString; virtual; property BaseTop: Integer read GetBaseTop; property Height: Integer read GetHeight; @@ -356,7 +356,7 @@ function GetUseColon: T7SegColonUsage; procedure SetUseColon(Value: T7SegColonUsage); procedure RecalcSegments; override; - class function MapperFileID: string; override; + class function MapperFileID: AnsiString; override; procedure CalcCHSeg(Index: Integer); virtual; procedure CalcCLSeg(Index: Integer); virtual; public @@ -373,7 +373,7 @@ TJv14SegmentedLEDDigit = class(TJvBaseSegmentedLEDDigit) protected procedure RecalcSegments; override; - class function MapperFileID: string; override; + class function MapperFileID: AnsiString; override; procedure CalcG1Seg(Index: Integer); virtual; procedure CalcG2Seg(Index: Integer); virtual; procedure CalcHSeg(Index: Integer); virtual; @@ -395,7 +395,7 @@ TJv16SegmentedLEDDigit = class(TJv14SegmentedLEDDigit) protected procedure RecalcSegments; override; - class function MapperFileID: string; override; + class function MapperFileID: AnsiString; override; procedure CalcA1Seg(Index: Integer); virtual; procedure CalcA2Seg(Index: Integer); virtual; procedure CalcD1Seg(Index: Integer); virtual; @@ -1273,7 +1273,7 @@ Result := FSegmentStates; end; -class function TJvCustomSegmentedLEDDigit.MapperFileID: string; +class function TJvCustomSegmentedLEDDigit.MapperFileID: AnsiString; begin // DO NOTHING. // THIS CAN'T BE AN ABSTRACT CLASS METHOD AS THIS IS NOT @@ -1757,13 +1757,13 @@ procedure TJvSegmentedLEDCharacterMapper.LoadDefaultMapping; var - resName: string; + resName: AnsiString; Stream: TStream; begin resName := Display.DigitClass.MapperFileID + '_DEFAULT'; - if FindResource(HInstance, PChar(resName), RT_RCDATA) <> 0 then + if FindResource(HInstance, PChar(string(resName)), RT_RCDATA) <> 0 then begin - Stream := TResourceStream.Create(HInstance, Display.DigitClass.MapperFileID + '_DEFAULT', RT_RCDATA); + Stream := TResourceStream.Create(HInstance, string(Display.DigitClass.MapperFileID + '_DEFAULT'), RT_RCDATA); try LoadFromStream(Stream); FMappingChanged := False; @@ -1923,7 +1923,7 @@ CalcCHSeg(9); end; -class function TJv7SegmentedLEDDigit.MapperFileID: string; +class function TJv7SegmentedLEDDigit.MapperFileID: AnsiString; begin Result := 'SLDCM_7SEG'; end; @@ -2069,7 +2069,7 @@ Result := ''; end; -class function TJv14SegmentedLEDDigit.MapperFileID: string; +class function TJv14SegmentedLEDDigit.MapperFileID: AnsiString; begin Result := 'SLDCM_14SEG'; end; @@ -2179,7 +2179,7 @@ Result := seg16Names[Index]; end; -class function TJv16SegmentedLEDDigit.MapperFileID: string; +class function TJv16SegmentedLEDDigit.MapperFileID: AnsiString; begin Result := 'SLDCM_16SEG'; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2008-10-18 09:52:29
|
Revision: 11966 http://jvcl.svn.sourceforge.net/jvcl/?rev=11966&view=rev Author: ahuser Date: 2008-10-18 09:48:18 +0000 (Sat, 18 Oct 2008) Log Message: ----------- Mantis #4540: Can't use sLineBreak in D2009 for JvEditor.pas GetSelText Modified Paths: -------------- trunk/jvcl/run/JvConsts.pas trunk/jvcl/run/JvEditor.pas trunk/jvcl/run/JvUnicodeEditor.pas Modified: trunk/jvcl/run/JvConsts.pas =================================================================== --- trunk/jvcl/run/JvConsts.pas 2008-10-16 19:07:03 UTC (rev 11965) +++ trunk/jvcl/run/JvConsts.pas 2008-10-18 09:48:18 UTC (rev 11966) @@ -171,6 +171,7 @@ sLineBreak = #10; {$ENDIF UNIX} {$ENDIF COMPILER5} + sLineBreakStr = string(sLineBreak); // "native string" line break constant sLineBreakLen = Length(sLineBreak); CrLf = #13#10; Modified: trunk/jvcl/run/JvEditor.pas =================================================================== --- trunk/jvcl/run/JvEditor.pas 2008-10-16 19:07:03 UTC (rev 11965) +++ trunk/jvcl/run/JvEditor.pas 2008-10-18 09:48:18 UTC (rev 11966) @@ -532,7 +532,7 @@ while Y > Count - 1 do begin {--- UNDO ---} - TJvReLineUndo.Create(JvEditor, L, JvEditor.CaretY, sLineBreak); + TJvReLineUndo.Create(JvEditor, L, JvEditor.CaretY, sLineBreakStr); {--- /UNDO ---} L := 0; Add(''); @@ -1005,7 +1005,7 @@ X := CaretX; Y := CaretY; { --- UNDO --- } - TJvInsertUndo.Create(Self, CaretX, CaretY, sLineBreak); + TJvInsertUndo.Create(Self, CaretX, CaretY, sLineBreakStr); { --- /UNDO --- } if FLines.Count = 0 then FLines.Add(''); @@ -1037,7 +1037,7 @@ AdjustPersistentBlockSelection(CaretX, CaretY, amLineBreak, []); UpdateEditorSize; - TextModified(CaretX - 1, CaretY, maInsert, sLineBreak); + TextModified(CaretX - 1, CaretY, maInsert, sLineBreakStr); finally UnlockUpdate; if WasSelected then @@ -1060,13 +1060,13 @@ LockUpdate; try { --- UNDO --- } - TJvInsertUndo.Create(Self, CaretX, CaretY, sLineBreak); + TJvInsertUndo.Create(Self, CaretX, CaretY, sLineBreakStr); { --- /UNDO --- } FLines.Add(''); finally UnlockUpdate; end; - TextModified(0, Y - 1, maInsert, sLineBreak); + TextModified(0, Y - 1, maInsert, sLineBreakStr); UpdateEditorSize; Invalidate; Changed; @@ -1352,7 +1352,7 @@ UnlockUpdate; end; UpdateEditorSize; - TextModified(X, Y, maDelete, sLineBreak); + TextModified(X, Y, maDelete, sLineBreakStr); Invalidate; Changed; end; @@ -1393,7 +1393,7 @@ begin //{ at the end of line - \xE2 \xEA\xEE\xED\xF6\xE5 \xF1\xF2\xF0\xEE\xEA\xE8} { --- UNDO --- } - TJvDeleteUndo.Create(Self, CaretX, CaretY, sLineBreak); + TJvDeleteUndo.Create(Self, CaretX, CaretY, sLineBreakStr); CaretUndo := False; { --- /UNDO --- } // persistent blocks: adjust selection (before DeleteText) @@ -1402,7 +1402,7 @@ FLines.DeleteText(X, Y, -1, Y + 1); UpdateEditorSize; - TextModified(CaretX, CaretY, maDelete, sLineBreak); + TextModified(CaretX, CaretY, maDelete, sLineBreakStr); Invalidate; Changed; end; @@ -1512,7 +1512,7 @@ if I < SelEndY then begin - Move(sLineBreak[1], P^, sLineBreakLen * SizeOf(Char)); + Move(sLineBreakStr[1], P^, sLineBreakLen * SizeOf(Char)); Inc(P, sLineBreakLen); end; end; @@ -1536,7 +1536,7 @@ end; // line break - Move(sLineBreak[1], P^, sLineBreakLen * SizeOf(Char)); + Move(sLineBreakStr[1], P^, sLineBreakLen * SizeOf(Char)); Inc(P, sLineBreakLen); // lines between @@ -1548,7 +1548,7 @@ Inc(P, Length(S)); // line break - Move(sLineBreak[1], P^, sLineBreakLen * SizeOf(Char)); + Move(sLineBreakStr[1], P^, sLineBreakLen * SizeOf(Char)); Inc(P, sLineBreakLen); end; @@ -1744,7 +1744,7 @@ S := Spaces(2); for Y := BegY to EndY - 1 do - S := S + sLineBreak + Spaces(2); + S := S + sLineBreakStr + Spaces(2); InsertColumnText(X, BegY, S); @@ -1794,7 +1794,7 @@ FLines.Internal[Y] := S; end; if Y < EndY then - UnindentedText := UnindentedText + sLineBreak; + UnindentedText := UnindentedText + sLineBreakStr; end; finally UnlockUpdate; @@ -1863,7 +1863,7 @@ begin X := 0; if (ClipS = '') or (ClipS[Length(ClipS)] <> Lf) then - ClipS := ClipS + sLineBreak; + ClipS := ClipS + sLineBreakStr; end; { --- UNDO --- } @@ -2560,7 +2560,7 @@ for I := SelBegY to SelEndY do begin S := GetEditor.FLines[I]; - Insert(SubStrBySeparator(FText, I - SelBegY, sLineBreak), S, SelBegX + 1); + Insert(SubStrBySeparator(FText, I - SelBegY, sLineBreakStr), S, SelBegX + 1); GetEditor.FLines.Internal[I] := S; end; GetEditor.TextModified(SelBegX, SelBegY, maInsertColumn, FText); @@ -2629,10 +2629,10 @@ end; cmTemplates: begin - S := ReplaceString(NewString, FCRLF, sLineBreak + Spaces(CaretX - + S := ReplaceString(NewString, FCRLF, sLineBreakStr + Spaces(CaretX - Length(W))); S := ReplaceString(S, FCaretChar, ''); - NewCaret := Pos(FCaretChar, ReplaceString(NewString, FCRLF, sLineBreak)) - 1; + NewCaret := Pos(FCaretChar, ReplaceString(NewString, FCRLF, sLineBreakStr)) - 1; end; else raise EJvEditorError.CreateRes(@RsEInvalidCompletionMode); Modified: trunk/jvcl/run/JvUnicodeEditor.pas =================================================================== --- trunk/jvcl/run/JvUnicodeEditor.pas 2008-10-16 19:07:03 UTC (rev 11965) +++ trunk/jvcl/run/JvUnicodeEditor.pas 2008-10-18 09:48:18 UTC (rev 11966) @@ -519,7 +519,7 @@ while JvEditor.CaretY > Count - 1 do begin {--- UNDO ---} - TJvReLineUndo.Create(JvEditor, L, JvEditor.CaretY, sLineBreak); + TJvReLineUndo.Create(JvEditor, L, JvEditor.CaretY, sLineBreakStr); {--- /UNDO ---} L := 0; Add(''); @@ -988,7 +988,7 @@ X := CaretX; Y := CaretY; { --- UNDO --- } - TJvInsertUndo.Create(Self, CaretX, CaretY, sLineBreak); + TJvInsertUndo.Create(Self, CaretX, CaretY, sLineBreakStr); { --- /UNDO --- } if FLines.Count = 0 then FLines.Add(''); @@ -1020,7 +1020,7 @@ AdjustPersistentBlockSelection(CaretX, CaretY, amLineBreak, []); UpdateEditorSize; - TextModified(CaretX - 1, CaretY, maInsert, sLineBreak); + TextModified(CaretX - 1, CaretY, maInsert, sLineBreakStr); finally UnlockUpdate; if WasSelected then @@ -1043,13 +1043,13 @@ LockUpdate; try { --- UNDO --- } - TJvInsertUndo.Create(Self, CaretX, CaretY, sLineBreak); + TJvInsertUndo.Create(Self, CaretX, CaretY, sLineBreakStr); { --- /UNDO --- } FLines.Add(''); finally UnlockUpdate; end; - TextModified(0, Y - 1, maInsert, sLineBreak); + TextModified(0, Y - 1, maInsert, sLineBreakStr); UpdateEditorSize; Invalidate; Changed; @@ -1333,7 +1333,7 @@ UnlockUpdate; end; UpdateEditorSize; - TextModified(X, Y, maDelete, sLineBreak); + TextModified(X, Y, maDelete, sLineBreakStr); Invalidate; Changed; end; @@ -1374,7 +1374,7 @@ begin //{ at the end of line - \xE2 \xEA\xEE\xED\xF6\xE5 \xF1\xF2\xF0\xEE\xEA\xE8} { --- UNDO --- } - TJvDeleteUndo.Create(Self, CaretX, CaretY, sLineBreak); + TJvDeleteUndo.Create(Self, CaretX, CaretY, sLineBreakStr); CaretUndo := False; { --- /UNDO --- } // persistent blocks: adjust selection (before DeleteText) @@ -1383,7 +1383,7 @@ FLines.DeleteText(X, Y, -1, Y + 1); UpdateEditorSize; - TextModified(CaretX, CaretY, maDelete, sLineBreak); + TextModified(CaretX, CaretY, maDelete, sLineBreakStr); Invalidate; Changed; end; @@ -1493,7 +1493,7 @@ if I < SelEndY then begin - MoveWideChar(sLineBreak[1], P^, sLineBreakLen); + MoveWideChar(sLineBreakStr[1], P^, sLineBreakLen); Inc(P, sLineBreakLen); end; end; @@ -1517,7 +1517,7 @@ end; // line break - MoveWideChar(sLineBreak[1], P^, sLineBreakLen); + MoveWideChar(sLineBreakStr[1], P^, sLineBreakLen); Inc(P, sLineBreakLen); // lines between @@ -1529,7 +1529,7 @@ Inc(P, Length(S)); // line break - MoveWideChar(sLineBreak[1], P^, sLineBreakLen); + MoveWideChar(sLineBreakStr[1], P^, sLineBreakLen); Inc(P, sLineBreakLen); end; @@ -1725,7 +1725,7 @@ S := SpacesW(2); for Y := BegY to EndY - 1 do - S := S + sLineBreak + SpacesW(2); + S := S + sLineBreakStr + SpacesW(2); InsertColumnText(X, BegY, S); @@ -1775,7 +1775,7 @@ FLines.Internal[Y] := S; end; if Y < EndY then - UnindentedText := UnindentedText + sLineBreak; + UnindentedText := UnindentedText + sLineBreakStr; end; finally UnlockUpdate; @@ -1844,7 +1844,7 @@ begin X := 0; if (ClipS = '') or (ClipS[Length(ClipS)] <> Lf) then - ClipS := ClipS + sLineBreak; + ClipS := ClipS + sLineBreakStr; end; { --- UNDO --- } @@ -2195,13 +2195,7 @@ S := FLines.Text; Msg.Result := Min(Length(S) + 1, Msg.TextMax); if Msg.Result > 0 then - {$IFDEF COMPILER12} - // Call to MoveWideChar gives F2084 internal error I12178 because of [1]. - // Remove it from the first argument and it compiles fine - Move(S[1], Msg.Text^, Msg.Result * SizeOf(WideChar)); - {$ELSE} MoveWideChar(S[1], Msg.Text^, Msg.Result); - {$ENDIF COMPILER12} end; end; @@ -2547,7 +2541,7 @@ for I := SelBegY to SelEndY do begin S := GetEditor.FLines[I]; - Insert(SubStrBySeparatorW(FText, I - SelBegY, sLineBreak), S, SelBegX + 1); + Insert(SubStrBySeparatorW(FText, I - SelBegY, sLineBreakStr), S, SelBegX + 1); GetEditor.FLines.Internal[I] := S; end; GetEditor.TextModified(SelBegX, SelBegY, maInsertColumn, FText); @@ -2616,10 +2610,10 @@ end; cmTemplates: begin - S := ReplaceString(NewString, FCRLF, sLineBreak + SpacesW(CaretX - + S := ReplaceString(NewString, FCRLF, sLineBreakStr + SpacesW(CaretX - Length(W))); S := ReplaceString(S, FCaretChar, ''); - NewCaret := Pos(FCaretChar, ReplaceString(NewString, FCRLF, sLineBreak)) - 1; + NewCaret := Pos(FCaretChar, ReplaceString(NewString, FCRLF, sLineBreakStr)) - 1; end; else raise EJvEditorError.CreateRes(@RsEInvalidCompletionMode); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2008-10-18 10:38:29
|
Revision: 11969 http://jvcl.svn.sourceforge.net/jvcl/?rev=11969&view=rev Author: ahuser Date: 2008-10-18 10:38:19 +0000 (Sat, 18 Oct 2008) Log Message: ----------- 4529: TJvInterpreter has a Bug when using a Set property Modified Paths: -------------- trunk/jvcl/run/JvInterpreter.pas trunk/jvcl/run/JvVCL5Utils.pas Modified: trunk/jvcl/run/JvInterpreter.pas =================================================================== --- trunk/jvcl/run/JvInterpreter.pas 2008-10-18 10:17:48 UTC (rev 11968) +++ trunk/jvcl/run/JvInterpreter.pas 2008-10-18 10:38:19 UTC (rev 11969) @@ -5507,7 +5507,7 @@ begin FCurrArgs.Clear; InternalGetValue(nil, 0, V1); - if VarType(V1) <> varInteger then + if not VarIsOrdinal(V1) then JvInterpreterError(ieIntegerRequired, PosBeg); Result := Result or 1 shl Integer(V1); end; Modified: trunk/jvcl/run/JvVCL5Utils.pas =================================================================== --- trunk/jvcl/run/JvVCL5Utils.pas 2008-10-18 10:17:48 UTC (rev 11968) +++ trunk/jvcl/run/JvVCL5Utils.pas 2008-10-18 10:38:19 UTC (rev 11969) @@ -187,6 +187,7 @@ function VarIsStr(const V: Variant): Boolean; function VarIsType(const V: Variant; AVarType: TVarType): Boolean; function VarCompareValue(const A, B: Variant): TVariantRelationship; +function VarIsOrdinal(const V: Variant): Boolean; // Misc function GetMonitorWorkareaRect(Monitor: TMonitor): TRect; @@ -1167,7 +1168,16 @@ Result := vrGreaterThan; end; +function VarIsOrdinal(const V: Variant): Boolean; +begin + Result := False; + case VarType(V) of + varSmallInt, varInteger, varBoolean, varByte: + Result := True; + end; +end; + //=== { TCustomImageList } =================================================== {procedure TCustomImageList.Draw(Canvas: TCanvas; X, Y, Index: Integer; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2008-10-18 11:52:19
|
Revision: 11971 http://jvcl.svn.sourceforge.net/jvcl/?rev=11971&view=rev Author: ahuser Date: 2008-10-18 11:52:10 +0000 (Sat, 18 Oct 2008) Log Message: ----------- Mantis #4537: JvJVCLUtils - Update and added function's description Modified Paths: -------------- trunk/jvcl/run/JvJVCLUtils.pas trunk/jvcl/run/JvResources.pas trunk/jvcl/run/JvVCL5Utils.pas Modified: trunk/jvcl/run/JvJVCLUtils.pas =================================================================== --- trunk/jvcl/run/JvJVCLUtils.pas 2008-10-18 10:53:45 UTC (rev 11970) +++ trunk/jvcl/run/JvJVCLUtils.pas 2008-10-18 11:52:10 UTC (rev 11971) @@ -855,18 +855,51 @@ function GetGraphicObject(AStream: TStream): TGraphic; overload; function GetGraphicObject(AStream: TStream; ASender: TObject; AOnProc: TJvGetGraphicClassEvent): TGraphic; overload; -// Rect functions added by dejoy +// Coordinate Space/rectangle and Transformation Functions added by dejoy -function RectChildToParent(APoint: TPoint; AControl: TControl): TPoint; // not equal to TControl.ClientToParent +{Translates child coordinates to parent coordinates. + not found by iterating up the chain of Parent, not equal to TControl.ClientToParent + If AParent is nil (Delphi) or NULL (C++), the AChild control's immediate parent is used. +} +function PointChildToParent(APoint: TPoint; AChild: TControl; AParent: TWinControl = nil): TPoint; +{extended PointChildToParent to TRect} +function RectChildToParent(ARect: TRect; AChild: TControl; AParent: TWinControl = nil): TRect; +{union TControl.ClientToScreen from Point to Rect} function RectClientToScreen(AClientRect: TRect; AControl: TControl): TRect; +{union TControl.ScreenToClient from Point to Rect} function RectScreenToClient(AScreenRect: TRect; AControl: TControl): TRect; +{converts (maps) a rect from a control client area coordinates to another control client area coordinates} function MapControlRect(ACtlFrom, ACtlTo: TControl; AClientRect: TRect): TRect; +{converts (maps) a point from a control client area coordinates to another control client area coordinates} function MapControlPoint(ACtlFrom, ACtlTo: TControl; APoint: TPoint): TPoint; -function GetControlRect(AControl: TControl): TRect; // not equal to TControl.ClientRect +{converts (maps) a rect from a coordinate space relative to one window to a coordinate space relative to another window} +function MapWindowRect(hWndFrom, hWndTo: HWND; ARect: TRect): TRect; +{specifies the size (in pixels) of a control's windows area. + TControl.ClientRect likely, but including client area and noclient area.} +function GetControlRect(AControl: TControl): TRect; +{pecifies the screen coordinates of a control's windows area is generated by GetControlRect.} function GetControlScreenRect(AControl: TControl): TRect; +{retrieves a handle of a device context (DC) for the client area of the control} +function GetControlDC(Control: TControl; var WindowHandle: HWND): HDC; +{retrieves the device context (DC) for the entire window, + including title bar, menus, and scroll bars, that client area and noclient area + } +function GetControlWindowDC(Control: TControl; var WindowHandle: HWND): HDC; +{retrieves the max rectangle of combined with all child controls of AContainer, + expressed in the coordinate system of the AContainer control. + equal to AContainer.BoundsRect if AContainer.ControlCount = 0. +} +function GetContainerMaxBoundsRect(AContainer: TWinControl): TRect; +{retrieves the top handle of a specified control,function GetParentForm likely. } +function GetParentWindow(ASender: TWinControl): HWnd; + +function BeginClipRect(DC: HDC; AClipRect: TRect; fnMode: Integer = RGN_COPY): Integer; +function EndClipRect(DC: HDC): Integer; + function GetTopOwner(aCmp: TComponent): TComponent; function GetTopForm(aCmp: TComponent): TCustomForm; +function IsOwnedComponent(aCmp, aOwner: TComponent): Boolean; function IsChildWindow(const AChild, AParent: THandle): Boolean; // This function generates a unique name for a component inside the list of all @@ -7228,28 +7261,27 @@ // moved from JvHTControls and renamed function HTMLPrepareText(const Text: string): string; type - THtmlCode = {packed }record - Html: string{$IFNDEF RTL200_UP}[10]{$ENDIF ~RTL200_UP}; - Text: Char; + THtmlCode = record + Html: string; + Text: UTF8String; end; const - Conversions: array [0..6] of THtmlCode = - ( - (Html: '&'; Text: '&'), - (Html: '"'; Text: '"'), - (Html: '®'; Text: '\xAE'), - (Html: '©'; Text: '\xA9'), - (Html: '™'; Text: '\x99'), - (Html: '€'; Text: '\x80'), - (Html: ' '; Text: ' ') - ); + Conversions: array [0..6] of THtmlCode = ( + (Html: '&'; Text: '&'), + (Html: '"'; Text: '"'), + (Html: '®'; Text: #$C2#$AE), + (Html: '©'; Text: #$C2#$A9), + (Html: '™'; Text:#$E2#$84#$A2), + (Html: '€'; Text: #$E2#$82#$AC), + (Html: ' '; Text: ' ') + ); var I: Integer; begin Result := Text; for I := Low(Conversions) to High(Conversions) do with Conversions[I] do - Result := StringReplace(Result, Html, Text, [rfReplaceAll, rfIgnoreCase]); + Result := StringReplace(Result, Html, Utf8ToAnsi(Text), [rfReplaceAll, rfIgnoreCase]); Result := StringReplace(Result, sLineBreak, '', [rfReplaceAll, rfIgnoreCase]); // only <BR> can be new line Result := StringReplace(Result, cBR, sLineBreak, [rfReplaceAll, rfIgnoreCase]); Result := StringReplace(Result, cHR, cHR + sLineBreak, [rfReplaceAll, rfIgnoreCase]); // fixed <HR><BR> @@ -7911,13 +7943,51 @@ Result := nil; end; -function RectChildToParent(APoint: TPoint; AControl: TControl): TPoint; +function PointChildToParent(APoint: TPoint; AChild: TControl; AParent: TWinControl): TPoint; +var + LParent: TWinControl; begin - Result := APoint; - Inc(Result.X, AControl.Left); - Inc(Result.Y, AControl.Top); + if AChild = nil then + raise EInvalidOperation.Create(RsEChildControlMissing); + + with AChild do + begin + if AParent = nil then + AParent := Parent; + if AParent = nil then + raise EInvalidOperation.CreateFmt(SParentRequired, [Name]); + Result := APoint; + LParent := Parent; + if AParent.ContainsControl(AChild) then + begin + Inc(Result.X, Left); + Inc(Result.Y, Top); + while (LParent <> nil) do + begin + if (LParent.Parent <> nil) and (LParent <> AParent) then + begin + Inc(Result.X, LParent.Left); + Inc(Result.Y, LParent.Top); + end; + if LParent = AParent then + Break + else + LParent := LParent.Parent; + end; + end else + raise EInvalidOperation.CreateFmt({$IFDEF COMPILER5}SParentRequired{$ELSE}SParentGivenNotAParent{$ENDIF}, [Name]); + end; end; +function RectChildToParent(ARect: TRect; AChild: TControl; AParent: TWinControl = nil): TRect; +var + Pt1, Pt2: TPoint; +begin + Pt1 := PointChildToParent(ARect.TopLeft, AChild, AParent); + Pt2 := PointChildToParent(ARect.BottomRight, AChild, AParent); + Result := Rect(Pt1.X, Pt1.Y, Pt2.X, Pt2.Y); +end; + function RectClientToScreen(AClientRect: TRect; AControl: TControl): TRect; begin Result.TopLeft := AControl.ClientToScreen(AClientRect.TopLeft); @@ -7943,8 +8013,16 @@ Result := ACtlTo.ScreenToClient(Result); end; +function MapWindowRect(hWndFrom, hWndTo: HWND; ARect: TRect): TRect; +begin + MapWindowPoints(hWndFrom, hWndTo, ARect, 2); + Result := ARect; +end; + function GetControlRect(AControl: TControl): TRect; begin + if AControl = nil then + raise EInvalidOperation.Create('Control is nil.'); Result := Rect(0, 0, AControl.Width, AControl.Height); end; @@ -7953,6 +8031,129 @@ Result := RectClientToScreen(GetControlRect(AControl), AControl); end; +function GetControlDC(Control: TControl; var WindowHandle: HWND): HDC; +var + lWinCtl: TWinControl; +begin + Result := 0; + if Control = nil then + Exit; + if Control is TWinControl then + begin + lWinCtl := TWinControl(Control); + if not lWinCtl.HandleAllocated then + Exit; + Result := GetDC(lWinCtl.Handle); + WindowHandle := lWinCtl.Handle; + end + else + begin + lWinCtl := Control.Parent; + if lWinCtl = nil then + raise EInvalidOperation.CreateFmt(SParentRequired, [Control.Name]); + + if not lWinCtl.HandleAllocated then + Exit; + Result := GetDC(lWinCtl.Handle); + WindowHandle := lWinCtl.Handle; + with Control do + begin + SetViewportOrgEx(Result, Left, Top, nil); + IntersectClipRect(Result, 0, 0, Width, Height); + end; + end; +end; + +function GetControlWindowDC(Control: TControl; var WindowHandle: HWND): HDC; +var + lWinCtl: TWinControl; +begin + Result := 0; + if Control = nil then + Exit; + if Control is TWinControl then + begin + lWinCtl := TWinControl(Control); + Result := GetWindowDC(lWinCtl.Handle); + WindowHandle := lWinCtl.Handle; + end + else + begin + Result:= GetControlDC(Control,WindowHandle); + end; +end; + +function GetContainerMaxBoundsRect(AContainer: TWinControl): TRect; +var + I: Integer; +begin + if (AContainer = nil) or not Assigned(AContainer) then + Exit; + + if AContainer.ControlCount = 0 then + Result := AContainer.BoundsRect + else + begin + for I := 0 to AContainer.ControlCount - 1 do + begin + with AContainer.Controls[I] do + begin + if I = 0 then + Result := Bounds(Left, Top, Width, Height) + else + begin + if Top < Result.Top then + Result.Top := Top; + if Left < Result.Left then + Result.Left := Left; + if Left + Width > Result.Right then + Result.Right := Left + Width; + if Top + Height > Result.Bottom then + Result.Bottom := Top + Height; + end; + end; + end; + end; +end; + +function GetParentWindow(ASender: TWinControl): HWND; +var + Last, P: HWND; +begin + if ASender = nil then + raise EInvalidOperation.Create(RsEChildControlMissing); + + Last := ASender.Handle; + P := GetParent(ASender.Handle); + while P <> 0 do + begin + Last := P; + P := GetParent(P); + end; + Result := Last; +end; + +function BeginClipRect(DC: HDC; AClipRect: TRect; fnMode: Integer): Integer; +var + MyRgn: HRGN; +begin + Result := RGN_ERROR; + if not IsRectEmpty(AClipRect) then + begin + MyRgn := CreateRectRgnIndirect(AClipRect); + try + Result := ExtSelectClipRgn(DC, MyRgn, fnMode); + finally + DeleteObject(MyRgn); + end; + end; +end; + +function EndClipRect(DC: HDC): Integer; +begin + Result := SelectClipRgn(DC, 0); +end; + function GetTopOwner(aCmp: TComponent): TComponent; begin if aCmp = nil then @@ -7978,6 +8179,22 @@ Result := TCustomForm(aCmp); end; +function IsOwnedComponent(aCmp, aOwner: TComponent): Boolean; +begin + Result := False; + if not (Assigned(aCmp) or Assigned(aOwner)) then + Exit; + + Result := True; + while aCmp.Owner <> nil do + begin + if aCmp.Owner = aOwner then + Exit; + aCmp := aCmp.Owner; + end; + Result := False; +end; + function IsChildWindow(const AChild, AParent: THandle): Boolean; var LParent: HWND; Modified: trunk/jvcl/run/JvResources.pas =================================================================== --- trunk/jvcl/run/JvResources.pas 2008-10-18 10:53:45 UTC (rev 11970) +++ trunk/jvcl/run/JvResources.pas 2008-10-18 11:52:10 UTC (rev 11971) @@ -1440,6 +1440,7 @@ RsEBitCountNotImplemented = 'BitmapToMemoryStream: bit count not implemented'; RsECantGetShortCut = 'Target FileName for ShortCut %s not available'; RsEBadGraphicSignature = 'Bad Graphic Signature'; + RsEChildControlMissing = 'Child control is nil'; //=== JvLinkedControls.pas =================================================== resourcestring Modified: trunk/jvcl/run/JvVCL5Utils.pas =================================================================== --- trunk/jvcl/run/JvVCL5Utils.pas 2008-10-18 10:53:45 UTC (rev 11970) +++ trunk/jvcl/run/JvVCL5Utils.pas 2008-10-18 11:52:10 UTC (rev 11971) @@ -195,6 +195,9 @@ type UTF8String = type string; +function Utf8Decode(const S: UTF8String): WideString; +function Utf8ToAnsi(const S: UTF8String): string; + // System type TVarType = Word; @@ -1177,7 +1180,32 @@ end; end; +{ UTF8 Support } +function Utf8Decode(const S: UTF8String): WideString; +var + Len: Integer; +begin + Result := ''; + if S = '' then + Exit; + + Len := MultiByteToWideChar(CP_UTF8, 0, PAnsiChar(S), Length(S), nil, 0); + if Len > 0 then + begin + SetLength(Result, Len); + MultiByteToWideChar(CP_UTF8, 0, PAnsiChar(S), Length(S), PWideChar(Result), Len); + end + else + Result := ''; +end; + +function Utf8ToAnsi(const S: UTF8String): string; +begin + Result := Utf8Decode(S); +end; + + //=== { TCustomImageList } =================================================== {procedure TCustomImageList.Draw(Canvas: TCanvas; X, Y, Index: Integer; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2008-10-23 19:24:07
|
Revision: 11975 http://jvcl.svn.sourceforge.net/jvcl/?rev=11975&view=rev Author: ahuser Date: 2008-10-23 19:24:05 +0000 (Thu, 23 Oct 2008) Log Message: ----------- Incorporated Mantis #4550: TjTFWeeks, TjTFMonths, TjTFScheduler, JvTFGlanceTextViewer bugs and requests Modified Paths: -------------- trunk/jvcl/run/JvTFGlance.pas trunk/jvcl/run/JvTFGlanceTextViewer.pas trunk/jvcl/run/JvTFManager.pas trunk/jvcl/run/JvTFMonths.pas trunk/jvcl/run/JvTFWeeks.pas Modified: trunk/jvcl/run/JvTFGlance.pas =================================================================== --- trunk/jvcl/run/JvTFGlance.pas 2008-10-20 16:13:40 UTC (rev 11974) +++ trunk/jvcl/run/JvTFGlance.pas 2008-10-23 19:24:05 UTC (rev 11975) @@ -52,8 +52,8 @@ TJvTFGlanceViewer = class; TJvTFCellPics = class; - TJvTFUpdateTitleEvent = procedure(Sender: TObject; var NewTitle: string) - of object; + TJvTFUpdateTitleEvent = procedure(Sender: TObject; var NewTitle: string) of object; + TJvApptHintEvent = procedure(Sender: TObject; Appt: TJvTFAppt; var Handled: Boolean) of object; TJvTFCellPic = class(TCollectionItem) private @@ -468,6 +468,7 @@ FSchedNames: TStringList; FSelAppt: TJvTFAppt; + FOnApptHint: TJvApptHintEvent; function GetSchedNames: TStrings; procedure SetBorderStyle(Value: TBorderStyle); @@ -640,7 +641,8 @@ property OnDropAppt: TJvTFGlanceDropApptEvent read FOnDropAppt write FOnDropAppt; property OnUpdateCellTitleText: TJvTFUpdateCellTitleTextEvent read FOnUpdateCellTitleText write FOnUpdateCellTitleText; - //inherited properties + property OnApptHint: TJvApptHintEvent read FOnApptHint write FOnApptHint; + property DateFormat; // from TJvTFControl property TimeFormat; // from TJvTFControl @@ -688,6 +690,9 @@ FPhysicalCell: TJvTFGlanceCell; FRepeatGrouped: Boolean; FShowSchedNamesInHint: Boolean; + FShowStartEndTimeInHint: Boolean; + FOnApptHint: TJvApptHintEvent; + procedure DoGlanceControlApptHint(Sender: TObject; Appt: TJvTFAppt; var Handled: Boolean); procedure SetShowSchedNamesInHint(const Value: Boolean); function GetRepeatAppt(Index: Integer): TJvTFAppt; function GetSchedule(Index: Integer): TJvTFSched; @@ -695,6 +700,7 @@ procedure SetRepeatGrouped(Value: Boolean); function GetDistinctAppt(Index: Integer): TJvTFAppt; function GetAppt(Index: Integer): TJvTFAppt; + procedure SetShowStartEndTimeInHint(const Value: Boolean); protected FInPlaceEdit: Boolean; @@ -735,7 +741,9 @@ published property RepeatGrouped: Boolean read FRepeatGrouped write SetRepeatGrouped default True; property ShowSchedNamesInHint: Boolean read FShowSchedNamesInHint write SetShowSchedNamesInHint default True; + property ShowStartEndTimeInHint: Boolean read FShowStartEndTimeInHint write SetShowStartEndTimeInHint default True; property InPlaceEdit: Boolean read FInPlaceEdit write SetInplaceEdit default True; + property ApptHint: TJvApptHintEvent read FOnApptHint write FOnApptHint; end; TJvTFGlance = class(TJvTFCustomGlance) @@ -2867,7 +2875,8 @@ procedure TJvTFCustomGlance.CheckApptHint(Info: TJvTFGlanceCoord); var - ExtraDesc : string; + ExtraDesc: string; + Handled: Boolean; begin if Assigned(FViewer) and FViewer.ShowSchedNamesInHint then {$IFDEF USEJVCL} @@ -2880,7 +2889,12 @@ {$ENDIF USEJVCL} ExtraDesc := ExtraDesc + #13#10; - FHint.ApptHint(Info.Appt, Info.AbsX + 8, Info.AbsY + 8, True, True, False, ExtraDesc); + Handled := False; + if Assigned(OnApptHint) then + FOnApptHint(Self, Info.Appt, Handled); + if not Handled then + FHint.ApptHint(Info.Appt, Info.AbsX + 8, Info.AbsY + 8, + not Assigned(FViewer) or FViewer.ShowStartEndTimeInHint, True, False, ExtraDesc); end; procedure TJvTFCustomGlance.CheckViewerApptHint(X, Y: Integer); @@ -3647,6 +3661,8 @@ procedure TJvTFGlanceViewer.SetGlanceControl(Value: TJvTFCustomGlance); begin FGlanceControl := Value; + if Assigned(FGlanceControl) then + FGlanceControl.OnApptHint := DoGlanceControlApptHint; end; procedure TJvTFGlanceViewer.SetInplaceEdit(const Value: Boolean); @@ -4088,6 +4104,22 @@ end; end; +procedure TJvTFGlanceViewer.SetShowStartEndTimeInHint(const Value: Boolean); +begin + if FShowStartEndTimeInHint <> Value then + begin + FShowStartEndTimeInHint := Value; + Refresh; + end; +end; + +procedure TJvTFGlanceViewer.DoGlanceControlApptHint(Sender: TObject; + Appt: TJvTFAppt; var Handled: Boolean); +begin + if Assigned(FOnApptHint) then + FOnApptHint(Sender, Appt, Handled); +end; + {$IFDEF USEJVCL} {$IFDEF UNITVERSIONING} initialization @@ -4099,4 +4131,3 @@ {$ENDIF USEJVCL} end. - Modified: trunk/jvcl/run/JvTFGlanceTextViewer.pas =================================================================== --- trunk/jvcl/run/JvTFGlanceTextViewer.pas 2008-10-20 16:13:40 UTC (rev 11974) +++ trunk/jvcl/run/JvTFGlanceTextViewer.pas 2008-10-23 19:24:05 UTC (rev 11975) @@ -59,6 +59,10 @@ RelLineNum: Integer; end; + TJvDrawApptEvent = procedure(Sender: TObject; ACanvas: TCanvas; DrawInfo: TJvTFGlTxtVwDrawInfo; + Appt: TJvTFAppt; Rect:TRect; var Handled: Boolean) of object; + TJvApptHintEvent = procedure(Sender: TObject; Appt: TJvTFAppt; var Handled: Boolean) of object; + TJvTFGVTxtEditor = class(TMemo) private FLinkedAppt: TJvTFAppt; @@ -215,6 +219,8 @@ FOnDblClick: TNotifyEvent; FOnClick: TNotifyEvent; FOnEnter: TNotifyEvent; + FOnDrawAppt: TJvDrawApptEvent; + procedure SetLineSpacing(Value: Integer); procedure SetSelApptAttr(Value: TJvTFTxtVwApptAttr); procedure SetEditorAlign(Value: TJvTFGlTxtVwEditorAlign); @@ -232,6 +238,8 @@ procedure DoDblClick(); virtual; procedure DoClick; virtual; procedure DoEnter; virtual; + procedure DoDrawAppt(ACanvas: TCanvas; DrawInfo: TJvTFGlTxtVwDrawInfo; + Appt: TJvTFAppt; Rect: TRect; var Handled: Boolean); procedure ParentReconfig; override; procedure SetSelAppt(Value: TJvTFAppt); @@ -269,6 +277,8 @@ property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick; property OnClick: TNotifyEvent read FOnClick write FOnClick; property OnEnter: TNotifyEvent read FOnEnter write FOnEnter; + property OnDrawAppt: TJvDrawApptEvent read FOnDrawAppt write FOnDrawAppt; + property OnApptHint; end; {$IFDEF USEJVCL} @@ -425,7 +435,7 @@ procedure TJvTFGVTextControl.PaintTo(ACanvas: TCanvas; DrawInfo: TJvTFGlTxtVwDrawInfo); var - I, NextLineTop, LastLine: Integer; + I, NextLineTop, LastLine, Line: Integer; aRect, LineRect, TxtRect, BtnRect: TRect; Flags: UINT; Txt: string; @@ -433,6 +443,7 @@ Appt: TJvTFAppt; RegFontColor, RegBrushColor: TColor; + DrawingHandled: Boolean; begin Viewer.SetTo(DrawInfo.Cell); @@ -475,7 +486,12 @@ Txt := 'Appt ' + IntToStr(I) else begin - Appt := Viewer.Appts[AbsToRel(I)]; + Line := AbsToRel(I); + if Line < 0 then + Line := 0; + if Line >= Viewer.Appts.Count then + Line := 0; + Appt := Viewer.Appts[Line]; Txt := ''; if Viewer.ShowStartEnd then @@ -513,11 +529,19 @@ TxtRect := LineRect; Windows.InflateRect(TxtRect, -1, -1); - PTxt := StrAlloc((Length(Txt) + 4) * SizeOf(Char)); - StrPCopy(PTxt, Txt); - Windows.DrawText(ACanvas.Handle, PTxt, -1, TxtRect, Flags); - StrDispose(PTxt); + DrawingHandled := False; + if Assigned(Viewer) then + Viewer.DoDrawAppt(ACanvas, DrawInfo, Appt, LineRect, DrawingHandled); + if not DrawingHandled then + begin + // PTxt := StrAlloc((Length(Txt) + 4) * SizeOf(Char)); + // StrPCopy(PTxt, Txt); + // Windows.DrawText(ACanvas.Handle, PTxt, -1, TxtRect, Flags); + // StrDispose(PTxt); + Windows.DrawText(ACanvas.Handle, PChar(Txt), Length(Txt), TxtRect, Flags); + end; + Inc(NextLineTop, CalcLineHeight); end; end; @@ -1484,6 +1508,13 @@ Result := FViewControl.ShowDDButton; end; +procedure TJvTFGlanceTextViewer.DoDrawAppt(ACanvas: TCanvas; + DrawInfo: TJvTFGlTxtVwDrawInfo; Appt: TJvTFAppt; Rect: TRect; var Handled: Boolean); +begin + if Assigned(FOnDrawAppt) then + FOnDrawAppt(Self, ACanvas, DrawInfo, Appt, Rect, Handled); +end; + procedure TJvTFGlanceTextViewer.SetShowLineDDButton(const Value: Boolean); begin FViewControl.ShowDDButton := Value; Modified: trunk/jvcl/run/JvTFManager.pas =================================================================== --- trunk/jvcl/run/JvTFManager.pas 2008-10-20 16:13:40 UTC (rev 11974) +++ trunk/jvcl/run/JvTFManager.pas 2008-10-23 19:24:05 UTC (rev 11975) @@ -3089,7 +3089,12 @@ end; if LoadedNow then - NeedAppts(Result); + begin + if SchedLoadMode = slmOnDemand then + NeedAppts(Result) + else + AddToBatch(Result); + end; end; function TJvTFScheduleManager.RequestSchedule(Comp: TJvTFComponent; @@ -3106,7 +3111,12 @@ end; if ApptsNeeded then - NeedAppts(Result); + begin + if SchedLoadMode = slmOnDemand then + NeedAppts(Result) + else + AddToBatch(Result); + end; end; function TJvTFScheduleManager.RequestSchedule(Comp: TJvTFComponent; @@ -3121,7 +3131,12 @@ end; if LoadedNow then - NeedAppts(Result); + begin + if SchedLoadMode = slmOnDemand then + NeedAppts(Result) + else + AddToBatch(Result); + end; end; procedure TJvTFScheduleManager.ReleaseSchedule(ApptCtrl: TJvTFControl; @@ -4549,14 +4564,10 @@ PhysHeight, TopMarginPels, BottomMarginPels, HeaderPels, FooterPels: Integer; begin PhysHeight := Windows.GetDeviceCaps(Printer.Handle, PHYSICALHEIGHT); - TopMarginPels := ConvertMeasure(PageLayout.MarginTop, Measure, pmPixels, - False); - BottomMarginPels := ConvertMeasure(PageLayout.MarginBottom, Measure, pmPixels, - False); - HeaderPels := ConvertMeasure(PageLayout.HeaderHeight, Measure, pmPixels, - False); - FooterPels := ConvertMeasure(PageLayout.FooterHeight, Measure, pmPixels, - False); + TopMarginPels := ConvertMeasure(PageLayout.MarginTop, Measure, pmPixels, False); + BottomMarginPels := ConvertMeasure(PageLayout.MarginBottom, Measure, pmPixels, False); + HeaderPels := ConvertMeasure(PageLayout.HeaderHeight, Measure, pmPixels, False); + FooterPels := ConvertMeasure(PageLayout.FooterHeight, Measure, pmPixels, False); Result := PhysHeight - TopMarginPels - BottomMarginPels - HeaderPels - FooterPels; Modified: trunk/jvcl/run/JvTFMonths.pas =================================================================== --- trunk/jvcl/run/JvTFMonths.pas 2008-10-20 16:13:40 UTC (rev 11974) +++ trunk/jvcl/run/JvTFMonths.pas 2008-10-23 19:24:05 UTC (rev 11975) @@ -54,6 +54,8 @@ FOffDayCellAttr: TJvTFGlanceCellAttr; FScrollSize: TJvTFMonthsScrollSize; FSplitSatSun: Boolean; + FDayFormat: string; + FFirstDayOfMonthFormat: string; function GetMonth: Word; procedure SetMonth(Value: Word); function GetYear: Word; @@ -65,6 +67,8 @@ procedure SetExtraDayCellAttr(Value: TJvTFGlanceCellAttr); procedure SetOffDayCellAttr(Value: TJvTFGlanceCellAttr); procedure SetSplitSatSun(Value: Boolean); + procedure SetDayFormat(const Value: string); + procedure SetFirstDayOfMonthFormat(const Value: string); protected procedure SetStartOfWeek(Value: TTFDayOfWeek); override; procedure SetColCount(Value: Integer); override; @@ -105,6 +109,8 @@ property OnUpdateTitle: TJvTFUpdateTitleEvent read FOnUpdateTitle write FOnUpdateTitle; property StartOfWeek; property ColCount; + property FirstDayOfMonthFormat: string read FFirstDayOfMonthFormat write SetFirstDayOfMonthFormat; + property DayFormat: string read FDayFormat write SetDayFormat; // property Navigator; // property OnNavigate; end; @@ -149,6 +155,9 @@ FExtraDayCellAttr.TitleAttr.Color := clWhite; FOffDayCellAttr.TitleAttr.Color := clWhite; + FDayFormat := 'd'; + FFirstDayOfMonthFormat := 'mmm d'; + FDWTitleAttr := TJvTFGlanceTitle.Create(Self); with FDWTitleAttr do begin @@ -392,11 +401,10 @@ function TJvTFMonths.GetCellTitleText(Cell: TJvTFGlanceCell): string; begin - if CellIsExtraDay(Cell) and (IsFirstOfMonth(Cell.CellDate) or - EqualDates(Cell.CellDate, OriginDate)) then - Result := FormatDateTime('mmm d', Cell.CellDate) + if CellIsExtraDay(Cell) and (IsFirstOfMonth(Cell.CellDate) or EqualDates(Cell.CellDate, OriginDate)) then + Result := FormatDateTime(FirstDayOfMonthFormat, Cell.CellDate) else - Result := FormatDateTime('d', Cell.CellDate); + Result := FormatDateTime(DayFormat, Cell.CellDate); end; function TJvTFMonths.GetDataTop: Integer; @@ -482,6 +490,15 @@ inherited SetColCount(Value); end; +procedure TJvTFMonths.SetDayFormat(const Value: string); +begin + if Value <> FDayFormat then + begin + FDayFormat := Value; + Invalidate; + end; +end; + procedure TJvTFMonths.SetDisplayDate(Value: TDate); begin FDisplayDate := Value; @@ -507,6 +524,15 @@ FExtraDayCellAttr.Assign(Value); end; +procedure TJvTFMonths.SetFirstDayOfMonthFormat(const Value: string); +begin + if Value <> FFirstDayOfMonthFormat then + begin + FFirstDayOfMonthFormat := Value; + Invalidate; + end; +end; + procedure TJvTFMonths.SetMonth(Value: Word); var Y, M, D: Word; @@ -610,4 +636,3 @@ {$ENDIF USEJVCL} end. - Modified: trunk/jvcl/run/JvTFWeeks.pas =================================================================== --- trunk/jvcl/run/JvTFWeeks.pas 2008-10-20 16:13:40 UTC (rev 11974) +++ trunk/jvcl/run/JvTFWeeks.pas 2008-10-23 19:24:05 UTC (rev 11975) @@ -377,7 +377,10 @@ begin if WeekCount = 1 then Result := DWNames.GetDWName(DayOfWeek(Cell.CellDate)) + ', '; - Result := Result + FormatDateTime('mmm d', Cell.CellDate); + if DateFormat = '' then + Result := Result + FormatDateTime('mmm d', Cell.CellDate) + else + Result := Result + FormatDateTime(DateFormat, Cell.CellDate); end else Result := FormatDateTime(DateFormat, Cell.CellDate); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2008-10-24 20:55:19
|
Revision: 11981 http://jvcl.svn.sourceforge.net/jvcl/?rev=11981&view=rev Author: ahuser Date: 2008-10-24 20:55:14 +0000 (Fri, 24 Oct 2008) Log Message: ----------- Added TJvDataConnector.GetDataLink Modified Paths: -------------- trunk/jvcl/run/JvDataSource.pas trunk/jvcl/run/JvDataSourceIntf.pas trunk/jvcl/run/JvSpin.pas Modified: trunk/jvcl/run/JvDataSource.pas =================================================================== --- trunk/jvcl/run/JvDataSource.pas 2008-10-24 20:48:58 UTC (rev 11980) +++ trunk/jvcl/run/JvDataSource.pas 2008-10-24 20:55:14 UTC (rev 11981) @@ -90,6 +90,7 @@ { DataSet } public + function GetDataLink: TObject; function GetDataSet: TObject; procedure DataSetEdit; // DataSet.Edit function CanModify: Boolean; @@ -314,6 +315,11 @@ Result := FDataConnectors.Count; end; +function TJvDataSource.GetDataLink: TObject; +begin + Result := FDataLink; +end; + procedure TJvDataSource.Notify(Msg: Integer); var M: TJvDataConnectorMsg; Modified: trunk/jvcl/run/JvDataSourceIntf.pas =================================================================== --- trunk/jvcl/run/JvDataSourceIntf.pas 2008-10-24 20:48:58 UTC (rev 11980) +++ trunk/jvcl/run/JvDataSourceIntf.pas 2008-10-24 20:55:14 UTC (rev 11981) @@ -114,6 +114,7 @@ property Enabled: Boolean read GetEnabled; { DataSet } + function GetDataLink: TObject; function GetDataSet: TObject; procedure DataSetEdit; // DataSet.Edit function CanModify: Boolean; @@ -314,6 +315,7 @@ constructor Create; destructor Destroy; override; procedure Assign(Source: TPersistent); override; + function GetDataLink: TObject; function FieldByName(const FieldName: TDataFieldString): TJvDataConnectorField; function FindField(const FieldName: TDataFieldString): TJvDataConnectorField; @@ -412,6 +414,14 @@ inherited Destroy; end; +function TJvDataConnector.GetDataLink: TObject; +begin + if DataSource <> nil then + Result := DataSource.GetDataLink + else + Result := nil; +end; + procedure TJvDataConnector.ActiveChanged; begin Notify(DC_RECORDCHANGED); Modified: trunk/jvcl/run/JvSpin.pas =================================================================== --- trunk/jvcl/run/JvSpin.pas 2008-10-24 20:48:58 UTC (rev 11980) +++ trunk/jvcl/run/JvSpin.pas 2008-10-24 20:55:14 UTC (rev 11981) @@ -374,6 +374,7 @@ procedure SetHour24(Value: Boolean); procedure SetDataConnector(const Value: TJvCustomTimeEditDataConnector); protected + procedure CMGetDataLink(var Msg: TMessage); message CM_GETDATALINK; procedure WMPaste(var Msg: TMessage); message WM_PASTE; procedure WMCut(var Msg: TMessage); message WM_CUT; procedure UpdateTimeDigits(Increment: Boolean); @@ -2669,7 +2670,7 @@ constructor TJvCustomTimeEdit.Create(AOwner: TComponent); begin inherited Create(AOwner); - ControlStyle := ControlStyle - [csSetCaption]; + ControlStyle := ControlStyle - [csSetCaption] + [csReplicatable]; FDataConnector := CreateDataConnector; FHour24 := True; Time := Now; // updates Text @@ -2910,6 +2911,11 @@ inherited; end; +procedure TJvCustomTimeEdit.CMGetDataLink(var Msg: TMessage); +begin + Msg.Result := LResult(DataConnector.GetDataLink); +end; + procedure TJvCustomTimeEdit.UpClick(Sender: TObject); begin UpdateTimeDigits(True); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2008-10-25 15:34:13
|
Revision: 11986 http://jvcl.svn.sourceforge.net/jvcl/?rev=11986&view=rev Author: ahuser Date: 2008-10-25 15:34:10 +0000 (Sat, 25 Oct 2008) Log Message: ----------- - Mantis #4462: With a form on a secondary monitor, JvDBLookupCombo drops down to the wrong monitor - Fixed: TJvDateEdit popup didn't work on secondary monitor Modified Paths: -------------- trunk/jvcl/run/JvDBLookup.pas trunk/jvcl/run/JvPickDate.pas Modified: trunk/jvcl/run/JvDBLookup.pas =================================================================== --- trunk/jvcl/run/JvDBLookup.pas 2008-10-25 14:25:59 UTC (rev 11985) +++ trunk/jvcl/run/JvDBLookup.pas 2008-10-25 15:34:10 UTC (rev 11986) @@ -2658,7 +2658,6 @@ {$ENDIF COMPILER6_UP} RecordCount: Integer; Monitor: TMonitor; - SR: TJvSizeRect; Rect: TRect; begin if not FListVisible and {FListActive} CanModify then @@ -2721,14 +2720,10 @@ Monitor := FindMonitor(MonitorFromWindow(Handle, MONITOR_DEFAULTTONEAREST)); Rect := GetWorkAreaRect(Monitor); - SR.Top := Rect.Top; - SR.Left := Rect.Left; - SR.Width := Rect.Right - Rect.Left; - SR.Height := Rect.Bottom - Rect.Top; P := Parent.ClientToScreen(Point(Left, Top)); Y := P.Y + Height; - if Y + FDataList.Height > SR.Height then + if Y + FDataList.Height > Rect.Bottom then Y := P.Y - FDataList.Height; case FDropDownAlign of daRight: @@ -2736,8 +2731,8 @@ daCenter: Dec(P.X, (FDataList.Width - Width) div 2); end; - if P.X + FDataList.Width > SR.Width then - P.X := SR.Width - FDataList.Width; + if P.X + FDataList.Width > Rect.Right then + P.X := Rect.Right - FDataList.Width; {$IFDEF COMPILER6_UP} { Use slide-open effect for combo boxes if wanted. This is also possible Modified: trunk/jvcl/run/JvPickDate.pas =================================================================== --- trunk/jvcl/run/JvPickDate.pas 2008-10-25 14:25:59 UTC (rev 11985) +++ trunk/jvcl/run/JvPickDate.pas 2008-10-25 15:34:10 UTC (rev 11986) @@ -162,8 +162,9 @@ implementation uses - Math, Consts, - JvThemes, JvConsts, JvResources, JvJCLUtils, JvToolEdit, JvSpeedButton, JvComponent; + Math, Consts, MultiMon, + JvThemes, JvConsts, JvResources, JvJCLUtils, JvToolEdit, JvSpeedButton, + JvComponent, JvJVCLUtils; procedure FontSetDefault(AFont: TFont); @@ -1648,29 +1649,34 @@ var D: TJvSelectDateDlg; I: Integer; - P: TPoint; // Polaris + P: TPoint; + Rect: TRect; + Monitor: TMonitor; begin Result := False; D := CreateDateDialog(DlgCaption, MinDate, MaxDate); try - // Polaris for Popup position + // for popup position if Assigned(Sender) then - with D do - begin - Position := poDesigned; - P := (Sender.ClientOrigin); - Top := P.Y + Sender.Height - 1; - if (Top + Height) > Screen.Height then - Top := P.Y - Height + 1; - if Top < 0 then - Top := P.Y + Sender.Height - 1; - Left := (P.X + Sender.Width) - Width; - if (Left + Width) > Screen.Width then - Left := Screen.Width - Width; - if Left < 0 then - Left := Max(P.X, 0); - end; + begin + D.Position := poDesigned; + P := Sender.ClientOrigin; + D.Top := P.Y + Sender.Height - 1; + Monitor := FindMonitor(MonitorFromWindow(Sender.Handle, MONITOR_DEFAULTTONEAREST)); + Rect := GetWorkAreaRect(Monitor); + + if (D.Top + D.Height) > Rect.Bottom then + D.Top := P.Y - D.Height + 1; + if D.Top < 0 then + D.Top := P.Y + Sender.Height - 1; + D.Left := (P.X + Sender.Width) - D.Width; + if (D.Left + D.Width) > Rect.Right then + D.Left := Rect.Right - D.Width; + if D.Left < 0 then + D.Left := Max(P.X, 0); + end; + D.Date := Date; with D.Calendar do begin This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ob...@us...> - 2008-11-12 14:47:14
|
Revision: 12045 http://jvcl.svn.sourceforge.net/jvcl/?rev=12045&view=rev Author: obones Date: 2008-11-12 14:47:11 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Use of the W versions if Unicode is defined (D2009), as indicated by Henry Modified Paths: -------------- trunk/jvcl/run/JvRas32.pas trunk/jvcl/run/JvWinDialogs.pas Modified: trunk/jvcl/run/JvRas32.pas =================================================================== --- trunk/jvcl/run/JvRas32.pas 2008-11-11 18:15:17 UTC (rev 12044) +++ trunk/jvcl/run/JvRas32.pas 2008-11-12 14:47:11 UTC (rev 12045) @@ -192,16 +192,16 @@ FDll := SafeLoadLibrary(RsRasDllName); if FDll <> 0 then begin - FRasDial := GetProcAddress(FDll, 'RasDialA'); - FRasEnumConnections := GetProcAddress(FDll, 'RasEnumConnectionsA'); - FRasEnumEntries := GetProcAddress(FDll, 'RasEnumEntriesA'); - FRasGetConnectStatus := GetProcAddress(FDll, 'RasGetConnectStatusA'); - FRasGetErrorstring := GetProcAddress(FDll, 'RasGetErrorstringA'); - FRasHangUp := GetProcAddress(FDll, 'RasHangUpA'); - FRasGetEntryDialParams := GetProcAddress(FDll, 'RasGetEntryDialParamsA'); - FRasValidateEntryName := GetProcAddress(FDll, 'RasValidateEntryNameA'); - FRasCreatePhonebookEntry := GetProcAddress(FDll, 'RasCreatePhonebookEntryA'); - FRasEditPhonebookEntry := GetProcAddress(FDll, 'RasEditPhonebookEntryA'); + FRasDial := GetProcAddress(FDll, {$IFDEF UNICODE}'RasDialW'{$ELSE}'RasDialA'{$ENDIF UNICODE}); + FRasEnumConnections := GetProcAddress(FDll, {$IFDEF UNICODE}'RasEnumConnectionsW'{$ELSE}'RasEnumConnectionsA'{$ENDIF UNICODE}); + FRasEnumEntries := GetProcAddress(FDll, {$IFDEF UNICODE}'RasEnumEntriesW'{$ELSE}'RasEnumEntriesA'{$ENDIF UNICODE}); + FRasGetConnectStatus := GetProcAddress(FDll, {$IFDEF UNICODE}'RasGetConnectStatusW'{$ELSE}'RasGetConnectStatusA'{$ENDIF UNICODE}); + FRasGetErrorstring := GetProcAddress(FDll, {$IFDEF UNICODE}'RasGetErrorstringW'{$ELSE}'RasGetErrorstringA'{$ENDIF UNICODE}); + FRasHangUp := GetProcAddress(FDll, {$IFDEF UNICODE}'RasHangUpW'{$ELSE}'RasHangUpA'{$ENDIF UNICODE}); + FRasGetEntryDialParams := GetProcAddress(FDll, {$IFDEF UNICODE}'RasGetEntryDialParamsW'{$ELSE}'RasGetEntryDialParamsA'{$ENDIF UNICODE}); + FRasValidateEntryName := GetProcAddress(FDll, {$IFDEF UNICODE}'RasValidateEntryNameW'{$ELSE}'RasValidateEntryNameA'{$ENDIF UNICODE}); + FRasCreatePhonebookEntry := GetProcAddress(FDll, {$IFDEF UNICODE}'RasCreatePhonebookEntryW'{$ELSE}'RasCreatePhonebookEntryA'{$ENDIF UNICODE}); + FRasEditPhonebookEntry := GetProcAddress(FDll, {$IFDEF UNICODE}'RasEditPhonebookEntryW'{$ELSE}'RasEditPhonebookEntryA'{$ENDIF UNICODE}); FHandle := AllocateHWndEx(WndProc); RASEvent := RegisterWindowMessage(RASDialEvent); if RASEvent = 0 then Modified: trunk/jvcl/run/JvWinDialogs.pas =================================================================== --- trunk/jvcl/run/JvWinDialogs.pas 2008-11-11 18:15:17 UTC (rev 12044) +++ trunk/jvcl/run/JvWinDialogs.pas 2008-11-12 14:47:11 UTC (rev 12045) @@ -102,7 +102,7 @@ OPF_PATHNAME = $02; type - TOpenFileNameEx = packed record + TOpenFileNameExA = packed record lStructSize: DWORD; // Size of the structure in bytes. hWndOwner: HWND; // Handle that is the parent of the dialog. hInstance: HINST; // Application instance handle. @@ -130,6 +130,40 @@ FlagsEx: DWORD; // Extended Flags. end; + TOpenFileNameExW = packed record + lStructSize: DWORD; // Size of the structure in bytes. + hWndOwner: HWND; // Handle that is the parent of the dialog. + hInstance: HINST; // Application instance handle. + lpstrFilter: PWideChar; // String containing filter information. + lpstrCustomFilter: PWideChar; // Will hold the filter chosen by the user. + nMaxCustFilter: DWORD; // Size of lpstrCustomFilter, in bytes. + nFilterIndex: DWORD; // Index of the filter to be shown. + lpstrFile: PWideChar; // File name to start with (and retrieve). + nMaxFile: DWORD; // Size of lpstrFile, in bytes. + lpstrFileTitle: PWideChar; // File name without path will be returned. + nMaxFileTitle: DWORD; // Size of lpstrFileTitle, in bytes. + lpstrInitialDir: PWideChar; // Starting directory. + lpstrTitle: PWideChar; // Title of the open dialog. + Flags: DWORD; // Controls user selection Options. + nFileOffset: Word; // Offset of file name in filepath=lpstrFile. + nFileExtension: Word; // Offset of extension in filepath=lpstrFile. + lpstrDefExt: PWideChar; // Default extension if no extension typed. + lCustData: LPARAM; // Custom data to be passed to hook. + lpfnHook: function(Wnd: THandle; Msg: UINT; wParam: WPARAM; + lParam: LPARAM): UINT stdcall; // Hook. + lpTemplateName: PWideChar; // Template dialog, if applicable. + // Extended structure starts here. + pvReserved: Pointer; // Reserved, use nil. + dwReserved: DWORD; // Reserved, use 0. + FlagsEx: DWORD; // Extended Flags. + end; + + {$IFDEF UNICODE} + TOpenFileNameEx = TOpenFileNameExW; + {$ELSE} + TOpenFileNameEx = TOpenFileNameExA; + {$ENDIF UNICODE} + TShellObjectType = (sdPathObject, sdPrinterObject); TShellObjectTypes = set of TShellObjectType; @@ -549,16 +583,22 @@ CmdShow: Integer); stdcall; GetOpenFileNameExProc = function(var OpenFile: TOpenFileNameEx): BOOL; stdcall; GetSaveFileNameExProc = function(var SaveFile: TOpenFileNameEx): BOOL; stdcall; - URLAssociationDialogProcA = function(hwndParent: THandle; dwInFlags: DWORD; const pcszFile: PChar; const pcszURL: PChar; - pszBuff: PChar; ucAppBufLen: UINT): HRESULT; stdcall; + + URLAssociationDialogProcA = function(hwndParent: THandle; dwInFlags: DWORD; const pcszFile: PAnsiChar; const pcszURL: PAnsiChar; + pszBuff: PAnsiChar; ucAppBufLen: UINT): HRESULT; stdcall; URLAssociationDialogProcW = function(hwndParent: THandle; dwInFlags: DWORD; const pcszFile: PWideChar; const pcszURL: PWideChar; pszBuff: PWideChar; ucAppBufLen: UINT): HRESULT; stdcall; + URLAssociationDialogProc = {$IFDEF UNICODE}URLAssociationDialogProcW{$ELSE}URLAssociationDialogProcA{$ENDIF UNICODE}; + MIMEAssociationDialogProcA = function(hwndParent: THandle; dwInFlags: DWORD; - const pcszFile: PChar; const pcszMIMEContentType: PChar; pszAppBuf: PChar; ucAppBufLen: UINT): HRESULT; stdcall; + const pcszFile: PAnsiChar; const pcszMIMEContentType: PAnsiChar; pszAppBuf: PAnsiChar; ucAppBufLen: UINT): HRESULT; stdcall; MIMEAssociationDialogProcW = function(hwndParent: THandle; dwInFlags: DWORD; const pcszFile: PWideChar; const pcszMIMEContentType: PWideChar; pszAppBuf: PWideChar; ucAppBufLen: UINT): HRESULT; stdcall; + + MIMEAssociationDialogProc = {$IFDEF UNICODE}MIMEAssociationDialogProcW{$ELSE}MIMEAssociationDialogProcA{$ENDIF UNICODE}; + SoftwareUpdateMessageBoxProc = function(hWnd: THandle; szDistUnit: LPCWSTR; dwFlags: DWORD; var psdi: TSoftDistInfo): DWORD; stdcall; @@ -580,10 +620,8 @@ SHOpenWith: SHOpenWithProc = nil; SHChangeIcon: SHChangeIconProc = nil; SHChangeIconW: SHChangeIconProcW = nil; - URLAssociationDialogA: URLAssociationDialogProcA = nil; - MIMEAssociationDialogA: MIMEAssociationDialogProcA = nil; -// URLAssociationDialogW: URLAssociationDialogProcW = nil; -// MIMEAssociationDialogW: MIMEAssociationDialogProcW = nil; + URLAssociationDialog: URLAssociationDialogProc = nil; + MIMEAssociationDialog: MIMEAssociationDialogProc = nil; SoftwareUpdateMessageBox: SoftwareUpdateMessageBoxProc = nil; {$IFDEF UNITVERSIONING} @@ -642,21 +680,18 @@ CommHandle := SafeLoadLibrary('comdlg32.dll'); if CommHandle <> 0 then begin - @GetOpenFileNameEx := GetProcAddress(CommHandle, PAnsiChar('GetOpenFileNameA')); - @GetSaveFileNameEx := GetProcAddress(CommHandle, PAnsiChar('GetSaveFileNameA')); + @GetOpenFileNameEx := GetProcAddress(CommHandle, {$IFDEF UNICODE}'GetOpenFileNameW'{$ELSE}'GetOpenFileNameA'{$ENDIF UNICODE}); + @GetSaveFileNameEx := GetProcAddress(CommHandle, {$IFDEF UNICODE}'GetSaveFileNameW'{$ELSE}'GetSaveFileNameA'{$ENDIF UNICODE}); end; AppWizHandle := SafeLoadLibrary('appwiz.cpl'); if AppWizHandle <> 0 then - @NewLinkHere := GetProcAddress(AppWizHandle, PAnsiChar('NewLinkHereA')); + @NewLinkHere := GetProcAddress(AppWizHandle, {$IFDEF UNICODE}'NewLinkHereW'{$ELSE}'NewLinkHereA'{$ENDIF UNICODE}); URLHandle := SafeLoadLibrary('url.dll'); if URLHandle <> 0 then begin - @URLAssociationDialogA := GetProcAddress(URLHandle, 'URLAssociationDialogA'); - @MIMEAssociationDialogA := GetProcAddress(URLHandle, 'MIMEAssociationDialogA'); - // the ANSI versions works on NT too, so don't load Unicode alternative -// @URLAssociationDialogW := GetProcAddress(URLHandle,'URLAssociationDialogW'); -// @MIMEAssociationDialogW := GetProcAddress(URLHandle,'MIMEAssociationDialogW'); + @URLAssociationDialog := GetProcAddress(URLHandle, {$IFDEF UNICODE}'URLAssociationDialogW'{$ELSE}'URLAssociationDialogA'{$ENDIF UNICODE}); + @MIMEAssociationDialog := GetProcAddress(URLHandle, {$IFDEF UNICODE}'MIMEAssociationDialogW'{$ELSE}'MIMEAssociationDialogA'{$ENDIF UNICODE}); end; SHDocvwHandle := SafeLoadLibrary('shdocvw.dll'); if SHDocvwHandle <> 0 then @@ -1667,7 +1702,7 @@ FAssociatedApp := ''; if Pos(':', URL) < 1 then FURL := FDefaultProtocol + FURL; - if Assigned(URLAssociationDialogA) then + if Assigned(URLAssociationDialog) then begin dwFlags := 0; FillChar(Buf[0], SizeOf(Buf), 0); @@ -1675,7 +1710,7 @@ dwFlags := dwFlags or URLASSOCDLG_FL_USE_DEFAULT_NAME; if uaRegisterAssoc in Options then dwFlags := dwFlags or URLASSOCDLG_FL_REGISTER_ASSOC; - FReturnValue := URLAssociationDialogA(GetParentHandle, dwFlags, + FReturnValue := URLAssociationDialog(GetParentHandle, dwFlags, PChar(FileName), PChar(URL), Buf, SizeOf(Buf)); Result := ReturnValue = S_OK; FAssociatedApp := Buf; @@ -1708,7 +1743,7 @@ begin Result := False; FReturnValue := S_FALSE; - if Assigned(MIMEAssociationDialogA) then + if Assigned(MIMEAssociationDialog) then begin FillChar(Buf[0], SizeOf(Buf), 0); FAssociatedApp := ''; @@ -1716,7 +1751,7 @@ dwFlags := MIMEASSOCDLG_FL_REGISTER_ASSOC else dwFlags := 0; - FReturnValue := MIMEAssociationDialogA(GetParentHandle, dwFlags, + FReturnValue := MIMEAssociationDialog(GetParentHandle, dwFlags, PChar(FileName), PChar(ContentType), Buf, SizeOf(Buf)); Result := ReturnValue = 0; FAssociatedApp := Buf; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |