11,6 → 11,8 |
You can obtain SynEdit via Embarcadero GetIt |
*) |
|
// TODO: "DragAcceptFiles" does not work with Delphi Dark Design Template !!! |
|
// TODO: if a scrapfile is already open, create a new scrap file (scrap2.php) |
// TODO: localize |
// TODO: wieso geht copy paste im twebbrowser nicht??? |
183,6 → 185,7 |
function InputRequestCallback(var data: AnsiString): boolean; |
function OutputNotifyCallback(const data: AnsiString): boolean; |
procedure RightTrimAll; |
procedure WMDropFiles(var Msg: TWMDropFiles); message WM_DROPFILES; |
protected |
ChmIndex: TMemIniFile; |
FScrapFile: string; |
819,6 → 822,46 |
Cancel := true; |
end; |
|
procedure TForm1.WMDropFiles(var Msg: TWMDropFiles); |
var |
DropH: HDROP; // drop handle |
DroppedFileCount: Integer; // number of files dropped |
FileNameLength: Integer; // length of a dropped file name |
FileName: string; // a dropped file name |
I: Integer; // loops thru all dropped files |
DropPoint: TPoint; // point where files dropped |
begin |
inherited; |
// Store drop handle from the message |
DropH := Msg.Drop; |
try |
// Get count of files dropped |
DroppedFileCount := DragQueryFile(DropH, $FFFFFFFF, nil, 0); |
// Get name of each file dropped and process it |
for I := 0 to Pred(DroppedFileCount) do |
begin |
// get length of file name |
FileNameLength := DragQueryFile(DropH, I, nil, 0); |
// create string large enough to store file |
SetLength(FileName, FileNameLength); |
// get the file name |
DragQueryFile(DropH, I, PChar(FileName), FileNameLength + 1); |
// process file name (application specific) |
// ... processing code here |
ShellExecute(0, 'open', PChar(ParamStr(0)), PChar('"' + FileName + '"'), '', SW_NORMAL); |
end; |
// Optional: Get point at which files were dropped |
DragQueryPoint(DropH, DropPoint); |
// ... do something with drop point here |
finally |
// Tidy up - release the drop handle |
// don't use DropH again after this |
DragFinish(DropH); |
end; |
// Note we handled message |
Msg.Result := 0; |
end; |
|
procedure TForm1.BeforeNavigate(const URL: OleVariant; var Cancel: WordBool); |
var |
s, myURL: string; |
928,6 → 971,7 |
|
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); |
begin |
DragAcceptFiles(Handle, False); |
TFastPHPConfig.FontSize := SynEdit1.Font.Size; |
end; |
|
1062,6 → 1106,8 |
DoubleBuffered := true; |
StartCodeExplorer; |
|
DragAcceptFiles(Handle, True); |
|
StartupTimer.Enabled := true; |
end; |
|