Jump to content

Tema Sistemi Nasıl Işliyor?


pilgetir
 Share

Recommended Posts

  • Editor

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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]

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...