diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-04-05 12:43:49 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-04-05 12:43:49 +0200 |
commit | 83300860141a91e8b6f36da1d61ffa83794c9ed7 (patch) | |
tree | ded26934452251c3e720b68770d90c7972c99a7d /tools/imageconvert | |
parent | b8e882653f313a1976d4aaddd45e845c995520ce (diff) | |
download | fpGUI-83300860141a91e8b6f36da1d61ffa83794c9ed7.tar.xz |
imgcnv: File DND now works under Windows too.
Diffstat (limited to 'tools/imageconvert')
-rw-r--r-- | tools/imageconvert/frm_main.pas | 24 | ||||
-rw-r--r-- | tools/imageconvert/imgcnv.lpi | 7 |
2 files changed, 22 insertions, 9 deletions
diff --git a/tools/imageconvert/frm_main.pas b/tools/imageconvert/frm_main.pas index 0dc77299..3ab50dbc 100644 --- a/tools/imageconvert/frm_main.pas +++ b/tools/imageconvert/frm_main.pas @@ -52,7 +52,12 @@ procedure TMainForm.MemoDragEnter(Sender, Source: TObject; var s: string; begin - s := 'text/uri-list'; // 'text/plain'; + {TODO: Once Windows DND backend is 100% complete, this IFDEF can be removed.} + {$IFDEF MSWINDOWS} + s := 'FileName'; + {$ELSE} + s := 'text/uri-list'; + {$ENDIF} Accept := AMimeList.IndexOf(s) > -1; if Accept then begin @@ -71,15 +76,18 @@ begin sl := TStringList.Create; try sl.Text := AData; - memImages.BeginUpdate; - for i := 0 to sl.Count-1 do - begin - fileName := sl[i]; - fileName := StringReplace(fileName, 'file://', '', []); - memImages.Text := memImages.Text + ConvertImage(fileName); + try + memImages.BeginUpdate; + for i := 0 to sl.Count-1 do + begin + fileName := sl[i]; + fileName := StringReplace(fileName, 'file://', '', []); + memImages.Text := memImages.Text + ConvertImage(fileName); + end; + finally + memImages.EndUpdate; end; finally - memImages.EndUpdate; sl.Free; end; end; diff --git a/tools/imageconvert/imgcnv.lpi b/tools/imageconvert/imgcnv.lpi index 9c3c8eb9..76f8b644 100644 --- a/tools/imageconvert/imgcnv.lpi +++ b/tools/imageconvert/imgcnv.lpi @@ -38,12 +38,17 @@ <PackageName Value="fpgui_toolkit"/> </Item1> </RequiredPackages> - <Units Count="1"> + <Units Count="2"> <Unit0> <Filename Value="imgcnv.lpr"/> <IsPartOfProject Value="True"/> <UnitName Value="imgcnv"/> </Unit0> + <Unit1> + <Filename Value="frm_main.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="frm_main"/> + </Unit1> </Units> </ProjectOptions> <CompilerOptions> |