Time of Update: 2018-12-07
在學習 BindingSource 屬性時, 可以讓兩個控制項互為繫結來源; TBindExpression 對應的功能是 Direction 屬性.先在表單上添加 Edit1、Edit2、BindingsList1; 然後啟用 Edit1、Edit2 和表單的預設事件.procedure TForm1.FormCreate(Sender: TObject);begin with TBindExpression.Create(BindingsList1) do begin
Time of Update: 2018-12-07
綁定運算式中可以有簡單的運算和字串串連, 但字串需放在雙引號中.還可以使用 TBindingsList.Methods 提供的一組運算式函數(分別來自 System.Bindings.Methods 和 Data.Bind.EngExt
Time of Update: 2018-12-07
TScrollBox -> TCustomListBox -> TListBox; 其元素項是 TListBoxItem 類型.TListBox 的功能在 TCustomListBox 裡就完成了.值得注意的變化是: 1、複選框(相關屬性: ShowCheckboxes、TListBoxItem.IsChecked)2、交替背景(通過繼承還可以調整交替的背景色)3、TListBoxItem 可調整大小、容納其它對象.{ TCustomListBox }public
Time of Update: 2018-12-07
TListBox 有兩個兄弟 TComboListBox、TComboEditListBox; TComboBox、TComboEdit 雖不是不是從它們繼承, 但分別包含了它們, 所以使用起來都有點像 TListBox.TComboBox 更像 TListBox, 比 TComboEdit 多出了 Selected 等成員;TComboEdit 是從 TCustomEdit 繼承, 和 TEdit 是兄弟, 比 TComboBox 多出了 Text 等成員.
Time of Update: 2018-12-07
手頭的程式需要禁止重複啟動, 但需要保留新的、關閉舊的.我想還是從主視窗的類名下手吧; 寫了一個函數, 在 OnCreate 中調用即可:{ 函數 }procedure CloseSameClassNameWindow(ACurrentWindow: HWND; const AClassName: string);var h: HWND; buf: array[0..255] of Char;begin h := ACurrentWindow; while h > 0 do
Time of Update: 2018-12-07
TStringGrid、TGrid 都是從 TCustomGrid 繼承; 區別有:1、它們的列對象分別是: TStringColumn、TColumn;2、TStringGrid 比 TGrid 多出了 Cells[] 屬性.因為 TGrid 沒有 Cells[] 屬性, 暫時不方便使用; 我嘗試取其當前單元值時竟然用了這樣的代碼:(Grid1.Columns[Grid1.ColumnIndex].CellControlByRow(Grid1.Selected) as
Time of Update: 2018-12-07
這是 Midi 之後更完善的通用樂譜格式, 已有 Sibelius 等眾多軟體相容; 官方網站: http://www.musicxml.org/ 或 http://www.recordare.com/musicxml<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 3.0 Partwise//EN"
Time of Update: 2018-12-07
TScrollBox -> TCustomTreeView -> TTreeView 子項類型是 TTreeViewItem.測試, 先在表單上放一個 TTreeView, 並需要它的 OnChange 事件:unit Unit1;interfaceuses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls,
Time of Update: 2018-12-07
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 3.0 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd"><score-partwise version="3.0"> <part-list>
Time of Update: 2018-12-07
很喜歡 FMX 的一些新控制項, 如: TExpander、TArcDial、TComboTrackBar、TPathLabel 等等, 沒時間繼續學習了.對 FMX 的整體感覺: 還不成熟, 但肯定有前景; 它的構架師有遠見、了不起, 很難估計他開啟的是多大一扇門!本將繼續學習:1、TCanvas、TBrush、TApplication;2、FMX 中的 GDI+、D2D、DirectX;3、FMX 3D;4、XE2 中新增的其他內容(譬如新增的 TZipFile 類, 已測試過、下帖附上).
Time of Update: 2018-12-07
TMarshaller(結構) 基於 TMarshal(是有一大堆的 class 方法組成的類) 實現.TMarshaller 可以對緩衝區進行自動(自動釋放)安全地管理, TMarshal 也有前者沒有的重要方法, 譬如: TMarshal.Copy() 方法.有了它們, 以後關於記憶體緩衝區, 字串轉碼等操作就更方便了.{測試}procedure TForm1.FormCreate(Sender: TObject);var M: TMarshaller; pw: TPtrWrapper;
Time of Update: 2018-12-07
%common;%layout;%identity;%attributes;%link;%note;%barline;%direction;%score;]]>%isolat1;%isolat2; ]]> ]]>
Time of Update: 2018-12-07
<?xml version="1.0" standalone="no"?><!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 3.0 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd"><score-partwise version="3.0"> <part-list> <score-part
Time of Update: 2018-12-07
適寬查看ASP/VBScriptCakePHP-1.2CSS-v1CSS-v2FrenchKings and QueensLinux Command LineNaNoWriMo 2011Six Noations 2012Vimeo Advanced API MethodsWikipediaHTML Character EntitiesHTMLJavaScriptMicroformatsMod Rewrite-v1Mod
Time of Update: 2018-12-07
不知什麼時候 System 單元有了 TPtrWrapper 結構體, 它提供了非常小的一點功能: 指標(Pointer)與指標地址(NativeInt)的轉換.很顯然, 以前常用的 Integer(P) 或 Ptr(Number) 已經不適用與 64 位元了, 這時使用 TPtrWrapper 應該是更方便,更保險的選擇.發現在 Delphi 新的源碼中, 幾乎就把 TPtrWrapper 當做指標來使用了.{TPtrWrapper 全功能測試}procedure
Time of Update: 2018-12-07
TMemoryStream 的 Position 變化後, 我曾經認為它的 Memory 屬性也會變化; 只怪不看源碼, 只想當然!procedure TForm1.FormCreate(Sender: TObject);var Stream1,Stream2: TMemoryStream; pw: TPtrWrapper;begin Stream1 := TStringStream.Create('1234567890'); Stream2 :=
Time of Update: 2018-12-07
uses System.IOUtils, System.Types, System.Generics.Collections, System.Generics.Defaults, System.Character;procedure StrArrNumberSort(var Arr: TArray<string>);begin TArray.Sort<string>(Arr, TComparer<string>.Construct(
Time of Update: 2018-12-07
一、使用泛型類:unit Unit1;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs;type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); end;
Time of Update: 2018-12-07
當我把一個"結構體"在類中當做屬性後, 在實用中可以直接讀取結構體成員, 但不能直接寫入...下面是由此引發的小練習:unit Unit1;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;type TForm1 =
Time of Update: 2018-12-07
FMX 的 Canvas 在不同的系統上會分別使用:WinVista、Win7: D2D (FMX.Canvas.D2D.pas)WinXP: GDI+ (FMX.Canvas.GDIP.pas)Mac 系列: Core Graphics (FMX.Canvas.Mac.pas)和 HTML5 中的 Canvas 非常類似, 現在的 Canvas 模糊了 Pen 的概念:之前的 Canvas.Pen 對應: Canvas.Stroke;之前的 Canvas.Brush 對應: