FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC

Développement d'applications avec le langage Panoramic
 
AccueilAccueil  FAQFAQ  RechercherRechercher  S'enregistrerS'enregistrer  MembresMembres  GroupesGroupes  Connexion  
Derniers sujets
» Biomorphe de Pickover
par jean_debord Aujourd'hui à 9:10

» PanExpress : l'éditeur Panoramic avec création d'objet
par Minibug Hier à 22:14

» Planétarium virtuel.
par Pedro Alvarez Hier à 19:50

» Virus/Antivirus
par JL35 Hier à 10:55

» Calculatrice
par papydall Ven 21 Sep 2018 - 22:45

» Orbites de l’ensemble de Mandelbrot
par Minibug Ven 21 Sep 2018 - 21:32

» Demande pour Jack concernant PanExpress
par Minibug Ven 21 Sep 2018 - 11:04

» EPP_V01 éditeur pour Panoramic
par Minibug Mer 19 Sep 2018 - 21:03

» [RESOLU] Quelle ligne est sélectionnée dans SYNEDIT ?
par Jean Claude Mer 19 Sep 2018 - 21:02

» Petit coucou en passant !
par Minibug Dim 16 Sep 2018 - 15:03

» bug SEVERE fnc+sub : variables globales corrompus
par silverman Dim 16 Sep 2018 - 13:38

» Verrouiller un form en avant plan
par silverman Dim 16 Sep 2018 - 12:50

» Fin de l'aventure.
par Pedro Alvarez Sam 15 Sep 2018 - 18:16

» Demande d'explications Sur File_Write & File_writeln
par Jack Sam 15 Sep 2018 - 17:26

» MEMO avec des possibilités de commande
par Oscaribout Mer 12 Sep 2018 - 1:06

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Septembre 2018
LunMarMerJeuVenSamDim
     12
3456789
10111213141516
17181920212223
24252627282930
CalendrierCalendrier

Partagez | 
 

 custom Icon

Aller en bas 
AuteurMessage
jennyk

avatar

Nombre de messages : 3
Age : 32
Date d'inscription : 10/05/2018

MessageSujet: custom Icon   Jeu 10 Mai 2018 - 1:00

Been busy at work, so not had chance to work with 'Panoramic' that much, but I love it, but we need to be able to customise the program icon to our own personal one, surely this cannot be so difficult to implement ?
please keep up the excellent work, I love this language and am always happy to promote it.

Thanks.
Jenny.
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
Klaus

avatar

Nombre de messages : 11088
Age : 69
Localisation : Ile de France
Date d'inscription : 29/12/2009

MessageSujet: Re: custom Icon   Jeu 10 Mai 2018 - 1:25

You an actually do it in 2 ways, but keep in mind that you cannot modify a running EXE file. You only can do it to anot actually running EXE file.

1st possibilité: modify permanently an EXE file, after its creation via Panoramic_Editor:
Use ResHacker - its simple. The new icon will show in File Explorer.

2nd possiblité: modify the main form icon dynamically
create a little Panoramic, using a function from KGF.dll to do the worl. The icon of form 0 will change. Calling this immédiately after startup wil produce the desired effect. Hereis how to do it:
Code:
dim res%, KGF$, icon$
KGF$ = "KGF.dll"  : ' give here the path to the DLL, if not in the same folder
icon$ = "Mycon.ico" : ' give here the path to the icon if not in the same folder
dll_on KGF$
res% = dll_call2("SetFormIcon",handle(0),adr(icon$))

Good luck !

EDIT

Sorry, I forgot the DLL_ON command. It's corrected above...
Revenir en haut Aller en bas
Voir le profil de l'utilisateur http://klauspanoramic.comxa.com/index.html
jennyk

avatar

Nombre de messages : 3
Age : 32
Date d'inscription : 10/05/2018

MessageSujet: Re: custom Icon   Ven 11 Mai 2018 - 1:28

Thanks for your help.
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
jennyk

avatar

Nombre de messages : 3
Age : 32
Date d'inscription : 10/05/2018

MessageSujet: more help   Ven 11 Mai 2018 - 1:49

Please . Where can I find more examples and utilities for 'Panoramic' - And is it possible to use it to package or encapsulate files like a wrapper for a self contained install package ? I know there's the 'Application compile option' but how would I copy the files into a folder ?
Thank you

Jenny.
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
Yannick

avatar

Nombre de messages : 8083
Age : 47
Localisation : Bretagne
Date d'inscription : 15/02/2010

MessageSujet: re   Ven 11 Mai 2018 - 8:22

If you can read French : http://panoramiclemag.pagesperso-orange.fr
and the KGF.dll help is in english too.

also you can ask in this forum and we will help you as much as we can.
Wink
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
Klaus

avatar

Nombre de messages : 11088
Age : 69
Localisation : Ile de France
Date d'inscription : 29/12/2009

MessageSujet: Re: custom Icon   Ven 11 Mai 2018 - 16:57

Citation :
I know there's the 'Application compile option' but how would I copy the files into a folder ?
An "application" is built by Panoramic_Editor including any BMP, JPG and TXT file residing within the same folder as the Panoramic source file. At runtime, a simple FILE_OPEN_... specifying just the file name and extension without any path information will open the file included during application construction. Pysically, an application show as a single EXE file, the embedded BMP, JPG and TXT files are included as resources.

No other file type can be included into an application. But you can "trick" the system ! Just rename any desired file as BMP, JMP or TXT and include it that way. At runtime, open the file(s) with  FILEBIN_OPEN_READ, create a new one (into the folder of your choice !) using FILEBIN_OPEN_WRITE, than copy the input file into the output file using FILEBIN_BLOCK_READ and FILEBIN_BLOCK_WRITE, than close both files. And there you are... You even can include a small TXT file containing information about all "tricked" files (names, file sizes, destinateion folders, ...) in order to automatize the startup procedure. After that, it"s up to you to either delete all these copied files on program exit (using the ON_CLOSE event on form 0), or leave them where they are, and just avoid to redo all this staff if these files already exist.

Good luck !

EDIT

You might even try the FILE_COPY command instead of the binary copy operations described above. Just use the fake TXT file name without path as input and the real file name, eventually with its destination path, as output. It just may work...
Revenir en haut Aller en bas
Voir le profil de l'utilisateur http://klauspanoramic.comxa.com/index.html
Klaus

avatar

Nombre de messages : 11088
Age : 69
Localisation : Ile de France
Date d'inscription : 29/12/2009

MessageSujet: Re: custom Icon   Sam 12 Mai 2018 - 20:09

I made some tests concerning files to be included into a Panoramic Application EXE file. Sadly, Panoramic checks if TXT files are real text files and if the BMP or JPG files have correct format. Thus, my "trick" renaming binary files into TXT files will not work ! Sorry.

But I give you a full solution for this problem. The idea is to convert any desired binary file into a TXT file containing a hexadecimal dump of the binary content. Thus, all these conerted binary files can be included just like any text file. Later, on program startup, they can be extracted and converted back to their original binary format.

I give you here the conversion utility:
Code:
' hexify.bas
'
' This utility converts any binary file into a TXT file containing an hexadecimal dump
' of the binary file, with lines containing BlockSize%*2 characters.
' This kind of file can easyly be included into a Panoramic Application EXE file.
' Thus, any binary file can be used, not only TXT, JPG and BMP files.
' Please use the ExtractFiles procedure from the test_application.bas file to rebuild
' the binary files on program startup - see this program for documentation.

label opn, ext

dim f$, fout$, no%, no1%, no2%, ext$, buf$, siz%, siz0%
dim BlockSize% : BlockSize% = 512

no% = no% + 1 : main_menu no% : no1% = no%
  no% = no% + 1 : sub_menu no% : no2% = no% : parent no%,no1% : caption no%,"Files"
    no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Open" : on_click no%,opn
    no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"-"
    no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Exit" : on_click no%,ext
 
open_dialog 100
progress_bar 101 : top 101,40 : left 101,10 : width 101,width_client(0)-20

end

opn:
  ' ask for file to convert
  f$ = file_name$(100)
  if f$="_" then return
  if file_exists(f$)=0
    message "File not found"
    return
  end_if
  ' build TXT file name
  ext$ = file_extract_extension$(f$)
  fout$ = left$(f$,len(f$)-len(ext$))+".txt"
  ' get binary file size
  filebin_open_read 1,f$
  siz% = filebin_size(1)
  if siz%=0
    message "File is empty"
    filebin_close 1
    return
  end_if
  ' check if file exists
  if file_exists(fout$)=1
    if message_confirmation_yes_no("Output file already exists. Replace ?")<>1
      filebin_close 1
      return
    end_if
    file_delete fout$
  end_if
 
  ' conversion loop
  file_open_write 2,fout$
  siz0% = siz%
  max 101,siz0%
  ' do as many full block reads as possible
  while siz%>=BlockSize%
    position 101,siz0%-siz%
    buf$ = filebin_hexa_read$(1,BlockSize%)
    file_writeln 2,buf$
    siz% = siz% - BlockSize%
  end_while
  ' eventually, do a final partial block
  if siz%>0
    position 101,siz0%
    buf$ = filebin_hexa_read$(1,siz%)
    file_writeln 2,buf$
  end_if
  ' done
  position 101,siz0%  .
  filebin_close 1
  file_close 2
  message "File created:"+chr$(13)+chr$(10)+fout$
  position 101,0
  return
 
ext:
  terminate
 

and a demo program in which I include a hexified version of KGF.dll:
Code:
' test_application.bas
'
' This program is for demonstration purposes only.
' It show how to include any binary file into a Panoramic Application EXE file.
' Using the hexify utility, any binary file can be converted to an hexa dump
' in TXT format. Same file name, but *.TXT extension. Thus, the file will be
' flawlessly integrated into the application.
' As many binary files as required may be included in the same way.
' A supplemental TXT file must be supplied, giving the index of all included
' binary files, in the following format:
'  index file name: IndexOfIncludedFiles.txt
'  index file content:
'    first line: #IndexOfIncludedFiles
'    followed by 2 lines for each binary file. The first of them is the name
'    of the hexified TXT file, without path. The second of them is the target
'    file name, eventually including the destination path
' Example:
'    #IndexOfIncludedFiles      <=== first line as identifyer
'    KGFdll.txt                  <=== name of the hexified TXT file
'    KGF.dll                    <=== name of the resulting binary  output file
'    ...

dim res%, vers$, KGF$
KGF$ = "KGF.dll"

if file_exists(KGF$)=0 then ExtractFiles()
message "Ready..."

end

sub ExtractFiles()
  dim_local s$, fincluded$, foutput$, nobj%, n%
 
  nobj% = 1
  while object_exists(nobj%)=1
    nobj% = nobj% + 1
  end_while
  dlist nobj%
  file_load nobj%,"IndexOfIncludedFiles.txt"
 
  n% = 1
  s$ = item_read$(nobj%,n%)
  if s$<>"#IndexOfIncludedFiles"
    message "Invalid index file"
    delete nobj%
    exit_sub
  end_if
 
  while n%<count(nobj%)
    n% = n% + 1
    fincluded$ = item_read$(nobj%,n%)
    n% = n% + 1
    foutput$ = item_read$(nobj%,n%)
   
    file_open_read 1,fincluded$
    filebin_open_write 2,foutput$
      while file_eof(1)=0
        file_readln 1,s$
        filebin_hexa_write 2,len(s$)/2,s$
      end_while
    filebin_close 2
    file_close 1
  end_while 
  delete nobj%
end_sub

As you can see, at program startup, a check is done to see if KGF.dll is present. If not, the extraction is done, and than, the program goes on.
Revenir en haut Aller en bas
Voir le profil de l'utilisateur http://klauspanoramic.comxa.com/index.html
Contenu sponsorisé




MessageSujet: Re: custom Icon   

Revenir en haut Aller en bas
 
custom Icon
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» acadiane custom
» Icon sujet qui ne change pas lorsqu'il y a un nouveau sujet et manque en bas du forum des icon nouveau message ...
» Toujours pour les férus d'électronique
» Image et touche [RESOLUT]
» Les artistes qui tuent des bizons en short.

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: Vos souhaits d'amélioration de Panoramic-
Sauter vers: