pilgetir Posted October 2, 2012 Share Posted October 2, 2012 Kintaro abinin kendi projelerinde yaptığı tema değiştirme sisteminin işlevini merake ttim onu kendiisne ve bvilenlere soruyorum işlevi nedir naısl yapılıyor örneklendirme yapabilir misiniz Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted October 3, 2012 Editor Share Posted October 3, 2012 Theme işlemi en basit yöntem ile şu şekilde yaparsın.Bir ini dosyası yada bir veritabanı dosyasına themepath=Azure şeklinde veri girersin programında onshow veya on preload kısmına INI yada veri tabanından çektiğin themepath yani tema yolunu getirirsin Onu global bir değişkene atarsan tüm sayfalarda kullanırsın.Daha sonra program Örneğin:_ApplicationFolder.."\\"..themepath.."\\Üstmenu.png" , _ApplicationFolder.."\\"..themepath.."\\Sağmenu.png" şeklinde bölümlerine yüklersin.Daha gelişmiş birşeyler için bu yoldan başlayabilirsin. Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted October 3, 2012 Share Posted October 3, 2012 [font=tahoma,geneva,sans-serif]Derleme işlemini de zip ile yapmıştır diye tahmin ediyorum. Tema değiştirmek için de güzel bir fonksiyon yazarsan gerisi kolay.[/font] Quote Link to comment Share on other sites More sharing options...
KintaRo Posted October 3, 2012 Share Posted October 3, 2012 yok ya zip kullanmadım, sanırım theme klasorundeki tema dosyalarını file.copy() ile projenin kullandığı dosyaların üzerine yazdırıp programı yeniden başlatıyordum. Projeye bakmam lazım, tam hatırlamıyorum ama bu şekilde birşeydi. Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted October 3, 2012 Share Posted October 3, 2012 [font=tahoma,geneva,sans-serif]Yok abi onu demiyorum, ptf uzantılı mıydı neydi tek dosya haline getiriyordun ya onu kastettim. Ben de bir projemde öyle bir yöntem kullanmıştım.[/font] Quote Link to comment Share on other sites More sharing options...
KintaRo Posted October 4, 2012 Share Posted October 4, 2012 o sadece göstermelik, aslında o dosya zip ben uzantısını değiştiriyorum sadece, ama dosya aslında bir zip dosyası. Aynı AMS button dosyalarında olduğu gibi. ZIP fonksiyonunun nasıl kullanıldığını zaten biliyorsunuz. Quote Link to comment Share on other sites More sharing options...
pilgetir Posted October 4, 2012 Author Share Posted October 4, 2012 ufak bir örnek alabilir miyim kintaro abi? Quote Link to comment Share on other sites More sharing options...
KintaRo Posted October 4, 2012 Share Posted October 4, 2012 Bu tema dosyasını ProBox üzerine attığınızda çalışan kodlar: [code] elseif sDragFile.Extension == ".ptf" then TemaAdi = sDragFile.Filename nAra = Folder.Find(_SourceFolder .. "\\Themes", TemaAdi, false, nil) if nAra then Dialog.Message(ini("messages", "error"), ini("messages", "theme_error"), MB_OK, MB_ICONEXCLAMATION) else Folder.Create(_SourceFolder .. "\\Themes\\" .. TemaAdi) Zip.Extract(v, {"*.*"}, _SourceFolder .. "\\Themes\\" .. TemaAdi, false, false, "*************", true, nil) Dialog.Message(sBaslik, ini("messages", "theme_installed")) end [/code] Bu da Tema editöründe temayı kaydederken çalışan kodlar: [code] if Table.Count(tAra) < 10 then Dialog.Message("Error", "Your files corrupted, please check your files.", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1) else Zip.Add(_TempFolder .."\\proboxtemp.zip", tAra, false, "**********", 5, nil, false) sKaydet = Dialog.FileBrowse(false, "Save Theme File", _DesktopFolder, "ProBox Theme File (*.ptf)|*.ptf|", "My Theme", "", false, false) if sKaydet[1] ~= "CANCEL" then File.Copy(_TempFolder .."\\proboxtemp.zip", sKaydet[1], false, true, false, false, nil) Dialog.Message("ProBox TB", "Theme successfully saved!", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1) end end else Dialog.Message("Error", "Please fill all inputs.", MB_OK, MB_ICONEXCLAMATION) end [/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.