Jump to content

Dragdrop Yaparken Dialog Açılabilirmi?


 Share

Recommended Posts

Benim bu dragdropla bir sorunum vardı

kodlar bu şekilde

Buradaki kodu
[spoiler][code]function CopyCallback (Source,Destination,Copied,Total)
Progress.SetCurrentPos("Progress1", (Copied / Total) * 100);
Label.SetText("Label1", String.SplitPath(Destination).Filename..""..String.SplitPath(Destination).Extension)
Label.SetText("Label3", String.GetFormattedSize(Copied, FMTSIZE_MB, true))
Label.SetText("Label4", String.GetFormattedSize(Total, FMTSIZE_MB, true))
yuzde = Math.Floor((Copied / Total) * 100);
Progress.SetText("Progress1", "%"..yuzde.."");
end
File.Copy("AutoPlay\\Docs\\AIDA 64.EXE", _DesktopFolder, true, true, false, true, CopyCallback);
error = Application.GetLastError();
if error ~= 0 then
Dialog.Message("Hata!", "Kopyalanma sırasında bir hata oluştu!", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end[/code][/spoiler]

Buradakiyle Dialog açtırarak yaptırmasını istiyorum


[spoiler][code]DragAndDrop.SetDataFormat(DataFormat.FileDrop);
DragAndDrop.Start(Application.GetWndHandle());
nFile = DragAndDrop.GetDataObject();

for i,v in pairs(nFile) do
if String.SplitPath(v).Extension == ".exe" then
File.Copy(v, _SourceFolder.."\\AutoPlay\\Docs\\Programlar", true, true, false, true, CopyCallback);
sys.init();
end
end
[/code][/spoiler]
Link to comment
Share on other sites

[quote name='pairs' date='23 May 2012 - 10:43 ' timestamp='1337759038' post='1204034']
Dialog açtırarak derken anlamadım oluşturdugun fonksiyonu drag droptamı kullanmak istiyorsun.
[/quote]

Evet abi ben denedim ama fareyi hareket ettirince dialog açıldı :D

Link to comment
Share on other sites

  • Editor

Dragdrop plugini proje üzerine bir nesne bırakınca çalışır sende sanırım proje üzerine atılan dosyaları bir yere kopyalatacaksın.

Link to comment
Share on other sites

Şİmdi abi amaç şu;

Kullanıcı dosyayı tutup program üzerine getirecek

Dosya kopyalanması Dialog içinde gösterilecek (program adı boyutu vs. Bu kod fonksiyonda var)

İsteğim bu ama yapamadım ben sizden yardım istedim umarım yapabilirsiniz...

Link to comment
Share on other sites

  • Editor

--####Global function###--
function CopyCallback (Source,Destination,Copied,Total)
Progress.SetCurrentPos("Progress1", (Copied / Total) * 100);
Label.SetText("Label1", String.SplitPath(Destination).Filename..""..String.SplitPath(Destination).Extension)
Label.SetText("Label3", String.GetFormattedSize(Copied, FMTSIZE_MB, true))
Label.SetText("Label4", String.GetFormattedSize(Total, FMTSIZE_MB, true))
yuzde = Math.Floor((Copied / Total) * 100);
Progress.SetText("Progress1", "%"..yuzde.."");
end
--#####################--



DragAndDrop.SetDataFormat(DataFormat.FileDrop);
DragAndDrop.Start(Application.GetWndHandle());
nFile = DragAndDrop.GetDataObject();

for i,v in pairs(nFile) do
if String.SplitPath(v).Extension == ".exe" then
File.Copy(v,_SourceFolder.."\\AutoPlay\\Docs\\Programlar", true, true, false, true, CopyCallback);
error = Application.GetLastError();
if error ~= 0 then
Dialog.Message("Hata!", "Kopyalanma sırasında bir hata oluştu!", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end
sys.init();
end
end

Link to comment
Share on other sites

[quote name='pairs' date='23 May 2012 - 11:07 ' timestamp='1337760449' post='1204046']
--####Global function###--
function CopyCallback (Source,Destination,Copied,Total)
Progress.SetCurrentPos("Progress1", (Copied / Total) * 100);
Label.SetText("Label1", String.SplitPath(Destination).Filename..""..String.SplitPath(Destination).Extension)
Label.SetText("Label3", String.GetFormattedSize(Copied, FMTSIZE_MB, true))
Label.SetText("Label4", String.GetFormattedSize(Total, FMTSIZE_MB, true))
yuzde = Math.Floor((Copied / Total) * 100);
Progress.SetText("Progress1", "%"..yuzde.."");
end
--#####################--



DragAndDrop.SetDataFormat(DataFormat.FileDrop);
DragAndDrop.Start(Application.GetWndHandle());
nFile = DragAndDrop.GetDataObject();

for i,v in pairs(nFile) do
if String.SplitPath(v).Extension == ".exe" then
File.Copy(v,_SourceFolder.."\\AutoPlay\\Docs\\Programlar", true, true, false, true, CopyCallback);
error = Application.GetLastError();
if error ~= 0 then
Dialog.Message("Hata!", "Kopyalanma sırasında bir hata oluştu!", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end
sys.init();
end
end

[quote name='pairs' date='23 May 2012 - 11:05 ' timestamp='1337760328' post='1204044']
Tamamda bütün dosyaları aynı dizinemi kopyalayacak.
[/quote]

Evet dosyaları _SourceFolder.."\\AutoPlay\\Docs\\Programlar" dizinine kopyalayacak
[/quote]

Abi teşekkür edrim fakat dialog açtırmayı nasıl yapıcaz?

Progress.SetCurrentPos("Progress1", (Copied / Total) * 100);
Label.SetText("Label1", String.SplitPath(Destination).Filename..""..String.SplitPath(Destination).Extension)
Label.SetText("Label3", String.GetFormattedSize(Copied, FMTSIZE_MB, true))
Label.SetText("Label4", String.GetFormattedSize(Total, FMTSIZE_MB, true))
yuzde = Math.Floor((Copied / Total) * 100);
Progress.SetText("Progress1", "%"..yuzde.."");

Bu koddaki objeler dialogda kopyalanırken bunların olmasını istiyorum mümkünmüdür?

Edited by nightmare3519
Link to comment
Share on other sites

  • Editor

Drag Drop Olayı ekledim pencere üstüne bırakınca çalışması için o yüzden eskisini sildim.

http://www.mediafire.com/download.php?r356oc3d05vpq5o

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...