顯示具有 Delphi 標籤的文章。 顯示所有文章
顯示具有 Delphi 標籤的文章。 顯示所有文章

2014年9月25日 星期四

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,




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!