Procházet zdrojové kódy

Add Anchors support.

Martijn Laan před 6 roky
rodič
revize
6eb7246e39
3 změnil soubory, kde provedl 36 přidání a 3 odebrání
  1. 1 1
      Components/UniPs
  2. 26 2
      ISHelp/isxclasses.pas
  3. 9 0
      Projects/ScriptClasses_C.pas

+ 1 - 1
Components/UniPs

@@ -1 +1 @@
-Subproject commit 86b5b61f6542e6e5109ac65ef88fd1689ae8dbf7
+Subproject commit 3ee6af752a1cb74f1d2b483bd97d3296175b4951

+ 26 - 2
ISHelp/isxclasses.pas

@@ -159,6 +159,10 @@ end;
 
 TAlign = (alNone, alTop, alBottom, alLeft, alRight, alClient);
 
+TAnchorKind = (akLeft, akTop, akRight, akBottom);
+
+TAnchors = set of TAnchorKind;
+
 TControl = class(TComponent)
   constructor Create(AOwner: TComponent);
   procedure BringToFront;
@@ -242,6 +246,7 @@ TForm = class(TScrollingWinControl)
   procedure Release;
   property Active: Boolean; read;
   property ActiveControl: TWinControl; read write;
+  property Anchors: TAnchors; read write;
   property BorderIcons: TBorderIcons; read write;
   property BorderStyle: TFormBorderStyle; read write;
   property Caption: String; read write;
@@ -274,6 +279,7 @@ TAlignment = (taLeftJustify, taRightJustify, taCenter);
 
 TLabel = class(TCustomLabel)
   property Alignment: TAlignment; read write;
+  property Anchors: TAnchors; read write;
   property AutoSize: Boolean; read write;
   property Caption: String; read write;
   property Color: TColor; read write;
@@ -300,6 +306,7 @@ TBorderStyle = TFormBorderStyle;
 TEditCharCase = (ecNormal, ecUpperCase, ecLowerCase);
 
 TEdit = class(TCustomEdit)
+  property Anchors: TAnchors; read write;
   property AutoSelect: Boolean; read write;
   property AutoSize: Boolean; read write;
   property BorderStyle: TBorderStyle; read write;
@@ -329,12 +336,13 @@ end;
 TScrollStyle = (ssNone, ssHorizontal, ssVertical, ssBoth);
 
 TMemo = class(TCustomMemo)
-  property Lines: TStrings; read write;
   property Alignment: TAlignment; read write;
+  property Anchors: TAnchors; read write;
   property BorderStyle: TBorderStyle; read write;
   property Color: TColor; read write;
   property Font: TFont; read write;
   property HideSelection: Boolean; read write;
+  property Lines: TStrings; read write;
   property MaxLength: Integer; read write;
   property ReadOnly: Boolean; read write;
   property ScrollBars: TScrollStyle; read write;
@@ -361,12 +369,13 @@ end;
 TComboBoxStyle = (csDropDown, csSimple, csDropDownList, csOwnerDrawFixed, csOwnerDrawVariable);
 
 TComboBox = class(TCustomComboBox)
-  property Style: TComboBoxStyle; read write;
+  property Anchors: TAnchors; read write;
   property Color: TColor; read write;
   property DropDownCount: Integer; read write;
   property Font: TFont; read write;
   property MaxLength: Integer; read write;
   property Sorted: Boolean; read write;
+  property Style: TComboBoxStyle; read write;
   property Text: String; read write;
   property OnChange: TNotifyEvent; read write;
   property OnClick: TNotifyEvent; read write;
@@ -384,6 +393,7 @@ TButtonControl = class(TWinControl)
 end;
 
 TButton = class(TButtonControl)
+  property Anchors: TAnchors; read write;
   property Cancel: Boolean; read write;
   property Caption: String; read write;
   property Default: Boolean; read write;
@@ -403,6 +413,7 @@ TCheckBoxState = (cbUnchecked, cbChecked, cbGrayed);
 TCheckBox = class(TCustomCheckBox)
   property Alignment: TAlignment; read write;
   property AllowGrayed: Boolean; read write;
+  property Anchors: TAnchors; read write;
   property Caption: String; read write;
   property Checked: Boolean; read write;
   property Color: TColor; read write;
@@ -416,6 +427,7 @@ end;
 
 TRadioButton = class(TButtonControl)
   property Alignment: TAlignment; read write;
+  property Anchors: TAnchors; read write;
   property Caption: String; read write;
   property Checked: Boolean; read write;
   property Color: TColor; read write;
@@ -437,6 +449,7 @@ end;
 TListBoxStyle = (lbStandard, lbOwnerDrawFixed, lbOwnerDrawVariable);
 
 TListBox = class(TCustomListBox)
+  property Anchors: TAnchors; read write;
   property BorderStyle: TBorderStyle; read write;
   property Color: TColor; read write;
   property Font: TFont; read write;
@@ -460,6 +473,7 @@ TBevelShape = (bsBox, bsFrame, bsTopLine, bsBottomLine, bsLeftLine, bsRightLine,
 TBevelStyle = (bsLowered, bsRaised);
 
 TBevel = class(TGraphicControl)
+  property Anchors: TAnchors; read write;
   property Shape: TBevelShape; read write;
   property Style: TBevelStyle; read write;
 end;
@@ -475,6 +489,7 @@ TBorderWidth = Longint;
 
 TPanel = class(TCustomPanel)
   property Alignment: TAlignment; read write;
+  property Anchors: TAnchors; read write;
   property BevelInner: TPanelBevel; read write;
   property BevelKind: TBevelKind; read write;
   property BevelOuter: TPanelBevel; read write;
@@ -490,6 +505,7 @@ end;
 
 TNewStaticText = class(TWinControl)
   function AdjustHeight: Integer;
+  property Anchors: TAnchors; read write;
   property AutoSize: Boolean; read write;
   property Caption: String; read write;
   property Color: TColor; read write;
@@ -509,6 +525,7 @@ TNewCheckListBox = class(TCustomListBox)
   function AddGroup(ACaption, ASubItem: String; ALevel: Byte; AObject: TObject): Integer;
   function AddRadioButton(const ACaption, ASubItem: String; ALevel: Byte; AChecked, AEnabled: Boolean; AObject: TObject): Integer;
   function CheckItem(const Index: Integer; const AOperation: TCheckItemOperation): Boolean;
+  property Anchors: TAnchors; read write;
   property Checked[Index: Integer]: Boolean; read write;
   property State[Index: Integer]: TCheckBoxState; read write;
   property ItemCaption[Index: Integer]: String; read write;
@@ -539,6 +556,7 @@ TNewProgressBarState = (npbsNormal, npbsError, npbsPaused);
 TNewProgressBarStyle = (npbstNormal, npbstMarquee);
 
 TNewProgressBar = class(TWinControl)
+  property Anchors: TAnchors; read write;
   property Min: Longint; read write;
   property Max: Longint; read write;
   property Position: Longint; read write;
@@ -548,6 +566,7 @@ TNewProgressBar = class(TWinControl)
 end;
 
 TRichEditViewer = class(TMemo)
+  property Anchors: TAnchors; read write;
   property BevelKind: TBevelKind; read write;
   property BorderStyle: TBorderStyle; read write;
   property RTFText: AnsiString; write;
@@ -555,6 +574,7 @@ TRichEditViewer = class(TMemo)
 end;
 
 TPasswordEdit = class(TCustomEdit)
+  property Anchors: TAnchors; read write;
   property AutoSelect: Boolean; read write;
   property AutoSize: Boolean; read write;
   property BorderStyle: TBorderStyle; read write;
@@ -582,12 +602,14 @@ end;
 TFolderRenameEvent = procedure(Sender: TCustomFolderTreeView; var NewName: String; var Accept: Boolean);
 
 TFolderTreeView = class(TCustomFolderTreeView)
+  property Anchors: TAnchors; read write;
   property OnChange: TNotifyEvent; read write;
   property OnRename: TFolderRenameEvent; read write;
 end;
 
 TStartMenuFolderTreeView = class(TCustomFolderTreeView)
   procedure SetPaths(const AUserPrograms, ACommonPrograms, AUserStartup, ACommonStartup: String);
+  property Anchors: TAnchors; read write;
   property OnChange: TNotifyEvent; read write;
   property OnRename: TFolderRenameEvent; read write;
 end;
@@ -595,6 +617,7 @@ end;
 TAlphaFormat = (afIgnored, afDefined, afPremultiplied);
 
 TBitmapImage = class(TGraphicControl)
+  property Anchors: TAnchors; read write;
   property AutoSize: Boolean; read write;
   property BackColor: TColor; read write;
   property Center: Boolean; read write;
@@ -608,6 +631,7 @@ end;
 
 TNewNotebook = class(TWinControl)
   function FindNextPage(CurPage: TNewNotebookPage; GoForward: Boolean): TNewNotebookPage;
+  property Anchors: TAnchors; read write;
   property PageCount: Integer; read write;
   property Pages[Index: Integer]: TNewNotebookPage; read;
   property ActivePage: TNewNotebookPage; read write;

+ 9 - 0
Projects/ScriptClasses_C.pas

@@ -42,6 +42,7 @@ begin
   with Cl.AddClassN(Cl.FindClass('TWinControl'), 'TNewStaticText') do
   begin
     RegisterMethod('function AdjustHeight: Integer');
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('AutoSize', 'Boolean', iptrw);
     RegisterProperty('Caption', 'String', iptrw);
     RegisterProperty('Color', 'TColor', iptrw);
@@ -79,6 +80,7 @@ begin
     RegisterMethod('function AddGroup(const ACaption, ASubItem: string; ALevel: Byte; AObject: TObject): Integer');
     RegisterMethod('function AddRadioButton(const ACaption, ASubItem: string; ALevel: Byte; AChecked, AEnabled: Boolean; AObject: TObject): Integer');
     RegisterMethod('function CheckItem(const Index: Integer; const AOperation: TCheckItemOperation): Boolean');
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('Checked', 'Boolean Integer', iptrw);
     RegisterProperty('State', 'TCheckBoxState Integer', iptr);
     RegisterProperty('ItemCaption', 'String Integer', iptrw);
@@ -130,6 +132,7 @@ begin
   cl.AddTypeS('TNewProgressBarStyle', '(npbstNormal, npbstMarquee)');
   with Cl.AddClassN(Cl.FindClass('TWinControl'), 'TNewProgressBar') do
   begin
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('Min', 'Longint', iptrw);
     RegisterProperty('Max', 'Longint', iptrw);
     RegisterProperty('Position', 'Longint', iptrw);
@@ -142,6 +145,7 @@ procedure RegisterRichEditViewer_C(Cl: TPSPascalCompiler);
 begin
   with Cl.AddClassN(Cl.FindClass('TMemo'), 'TRichEditViewer') do
   begin
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('BevelKind', 'TBevelKind', iptrw);
     RegisterProperty('BorderStyle', 'TBorderStyle', iptrw);
     RegisterProperty('RTFText', 'AnsiString', iptw);
@@ -153,6 +157,7 @@ procedure RegisterPasswordEdit_C(Cl: TPSPascalCompiler);
 begin
   with Cl.AddClassN(cl.FindClass('TCustomEdit'), 'TPasswordEdit') do
   begin
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('AutoSelect', 'Boolean', iptrw);
     RegisterProperty('AutoSize', 'Boolean', iptrw);
     RegisterProperty('BorderStyle', 'TBorderStyle', iptrw);
@@ -209,6 +214,7 @@ procedure RegisterFolderTreeView_C(Cl: TPSPascalCompiler);
 begin
   with Cl.AddClassN(Cl.FindClass('TCustomFolderTreeView'),'TFolderTreeView') do
   begin
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('OnChange', 'TNotifyEvent', iptrw);
     RegisterProperty('OnRename', 'TFolderRenameEvent', iptrw);
   end;
@@ -219,6 +225,7 @@ begin
   with Cl.AddClassN(Cl.FindClass('TCustomFolderTreeView'),'TStartMenuFolderTreeView') do
   begin
     RegisterMethod('procedure SetPaths(const AUserPrograms, ACommonPrograms, AUserStartup, ACommonStartup: String)');
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('OnChange', 'TNotifyEvent', iptrw);
     RegisterProperty('OnRename', 'TFolderRenameEvent', iptrw);
   end;
@@ -233,6 +240,7 @@ begin
   end;
   with Cl.AddClassN(CL.FindClass('TGraphicControl'),'TBitmapImage') do
   begin
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('AutoSize', 'Boolean', iptrw);
     RegisterProperty('BackColor', 'TColor', iptrw);
     RegisterProperty('Center', 'Boolean', iptrw);
@@ -263,6 +271,7 @@ begin
   with Cl.AddClassN(Cl.FindClass('TWinControl'),'TNewNotebook') do
   begin
     RegisterMethod('function FindNextPage(CurPage: TNewNotebookPage; GoForward: Boolean): TNewNotebookPage');
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('PageCount', 'Integer', iptr);
     RegisterProperty('Pages', 'TNewNotebookPage Integer', iptr);
     RegisterProperty('ActivePage', 'TNewNotebookPage', iptrw);