2016年3月18日 星期五

xe10 seattle with Halcon

If release build shows error , add "$(BDSLIB)\$(PLATFORM)\release" in Project->Option->C++ (Share Options)


2014年9月25日 星期四

Firemonkey how to enable anti-aliasing

In Rad Studio XE2~XE7 canvas anti-aliasing seems to disable by default, while use controls have special shapes will case shape control has its border toothed like this one:



Set form property like Form1.Quality:= HighQuality can turn on anti-aliasing , the result UI will like this:



In some situation , this may now work properly , we need to add more code on Form Event : 

onCreate :


preocdure TForm1.onCreate(Sendor: TObject);

begin
Form1.RecreateCanvas;
Form1.Invalidate;
end; 


Firemonkey Drag and Drop problem when control is placed on layout

In Rad Studio XE5~XE7 when place control on TLayout component , the drag and drop functionality is not work properly . Someone have fix this problem by re-writing FMX.Forms.pas (Link) , I have tried and sure this is working for XE5~XE7.

the following fixed code is from here  (Link

...
function TCommonCustomForm.FindTarget(P: TPointF; const Data: TDragObject): IControl;
var
  i: Integer;
  NewObj: IControl;
begin
  Result := nil;
  for i := 0 to ChildrenCount - 1 do
    // add an exception for layouts
if Supports(Children[i], IControl, NewObj) and NewObj.Visible and (NewObj.HitTest or (NewObj is TLayout)) then
    begin
      NewObj := NewObj.FindTarget(P, Data);


      if Assigned(NewObj) then
        Exit(NewObj);
    end;
end
...
PS. you need to include FMX.Layouts in  FMX.Forms.pas like this:
...
implementation

uses
  System.Variants,
  System.Generics.Defaults,
  System.RTLConsts,
  System.Rtti, System.Actions,
  System.Math.Vectors,
  FMX.Consts,
  FMX.Dialogs,
  // fix drag and drop buf in tlayout , see "FindTarget"
  FMX.Layouts,
  FMX.Platform, FMX.Menus,
  FMX.TextLayout.GPU,
  FMX.Filter, FMX.Materials, FMX.Text,
  FMX.Gestures;
...

2014年4月8日 星期二

Make OSX App run without a dock icon

in IDE menu bar , select Project -> Options... -> Version Info

add new key and value => NSBGOnly  , 1



That's all, compile your firemonkey app and run it , result like this:




If hide this app by calling form1.hide, it will be hard to find the gui for this app,
so you need to implement menu item like windows system tray icon, something like this one,




2014年3月30日 星期日

XE5 Firemonkey bug fix for key value in KeyUp/KeyDown event always 0

In XE5 Firemonkey windows/MacOS application, general key value in Keydown/Up event will always get 0

code:
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word; var KeyChar: Char;
  Shift: TShiftState);
begin
    Memo1.Lines.Add('down : '+IntToHex(Key,2));
end;

procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word; var KeyChar: Char;
  Shift: TShiftState);
begin
    Memo1.Lines.Add('up : '+IntToHex(Key,2));
end;


result:
in Windows
in MacOS


After tracing source code, I fix this problem by replace one line in FMX.Platform.Win.pas,
and work fine:

in Windows
in Macos

the solution is easy, just put FMX.Platform.Win.pas/FMX.Platform.Mac.pas which I fixed inside project folder

example & source code:
code download XE5
code download XE7
code download XE8

2013年12月16日 星期一

"What's New" in Rad Studio Version change (direct link only)


This article is only have direct link to Embarcadero's docwiki and some comments that I think is important.

Maybe help for people who have troubles in recompile between different versions.

What's New in Rad Studio XE7

What's New in Rad Studio XE6

What's New in Rad Studio XE5

Conditional compilation (Delphi XE5)

for example:

{$IF Defined(IOS) }
  // Code for both iOS Device and iOS Simulator.
{$ENDIF}
{$IF Defined(IOS) and Defined(CPUARM) }
  // Code for iOS Device only.
{$ENDIF}
{$IF Defined(IOS) and Defined(CPUX86) }
  // Code for iOS Simulator only.
{$ENDIF}
{$IF Defined(MSWINDOWS)}
{$ENDIF}

Migrating Delphi Code to Mobile from Desktop

watch out the string type and usage have some change!



2013年12月10日 星期二

Rad Studio XE5 執行在Android/iOS Device遇到的問題與解決辦法

這篇主要是紀錄使用Rad Studio XE5 編譯成執行檔執行於 iOS/Android 裝置上時遇到的問題解決方式.

iOS端:
1. 確認在Mac平台上安裝PA Server for XE5.
2. 確認iPhone/iPad...etc 裝置以連接至Mac.
3. 確認有安裝Provisioning檔案.
4. 確認 XCcode的環境可以順利執行程式於裝置上(確認硬體連接無誤).
5. 確認 XCode有安裝Command Line Tool
 PS.若沒安裝則Simulator可以執行,但實機無法執行,會出現錯誤 Error. E0264 /Users/XXX/RADPAServer/scrach-dir/OOOOOO/?????.app: object file format unrecognized,invalid, or unsuitable , 常常發生在更新XCode後忘了安裝Command Line Tool.
6. 確認 XE5 IDE 下的Options頁面設定Connection Profile Manager - Profile Properties 的內容正確無誤, 點 Test Connection 跳出顯示Succceed的對話框.

內容陸續增加中...


Android端:
1. 確認安裝Android裝置的USB device driver.
2. 確認Android裝置上的設定->開發人員選項->USB偵錯.
3. 執行位於開始->所有程式->Embarcadero RAD XE5-> Android Tools , 檢查是否安裝需要的SDK .
PS.XE5 安裝程式會自動安裝開發Android所需要的SDK但並不包含全部版本,需要透過這得軟體下載安裝新舊SDK.

內容陸續增加中...