FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC

Développement d'applications avec le langage Panoramic
 
AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  MembresMembres  Connexion  
Derniers sujets
» Logiciel de planétarium.
custom Icon Emptypar Pedro Sam 23 Nov 2024 - 15:50

» Un autre pense-bête...
custom Icon Emptypar Froggy One Jeu 21 Nov 2024 - 15:54

» Récupération du contenu d'une page html.
custom Icon Emptypar Pedro Sam 16 Nov 2024 - 14:04

» Décompilation
custom Icon Emptypar JL35 Mar 12 Nov 2024 - 19:57

» Un album photos comme du temps des grands-mères
custom Icon Emptypar jjn4 Mar 12 Nov 2024 - 17:23

» traitement d'une feuille excel
custom Icon Emptypar jjn4 Jeu 7 Nov 2024 - 3:52

» Aide-mémoire mensuel
custom Icon Emptypar jjn4 Lun 4 Nov 2024 - 18:56

» Des incomprèhension avec Timer
custom Icon Emptypar Klaus Mer 30 Oct 2024 - 18:26

» KGF_dll - nouvelles versions
custom Icon Emptypar Klaus Mar 29 Oct 2024 - 17:58

» instructions panoramic
custom Icon Emptypar maelilou Lun 28 Oct 2024 - 19:51

» Figures fractales
custom Icon Emptypar Marc Ven 25 Oct 2024 - 12:18

» Panoramic et Scanette
custom Icon Emptypar Yannick Mer 25 Sep 2024 - 22:16

» Editeur d étiquette avec QR évolutif
custom Icon Emptypar JL35 Lun 23 Sep 2024 - 22:40

» BUG QR Code DelphiZXingQRCode
custom Icon Emptypar Yannick Dim 22 Sep 2024 - 11:40

» fichier.exe
custom Icon Emptypar leclode Ven 20 Sep 2024 - 19:02

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Novembre 2024
LunMarMerJeuVenSamDim
    123
45678910
11121314151617
18192021222324
252627282930 
CalendrierCalendrier
Le Deal du moment :
LEGO Icons 10331 – Le martin-pêcheur
Voir le deal
35 €

 

 custom Icon

Aller en bas 
3 participants
AuteurMessage
jennyk

jennyk


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

custom Icon Empty
MessageSujet: custom Icon   custom Icon EmptyJeu 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
Klaus

Klaus


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

custom Icon Empty
MessageSujet: Re: custom Icon   custom Icon EmptyJeu 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
http://klauspanoramic.comxa.com/index.html
jennyk

jennyk


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

custom Icon Empty
MessageSujet: Re: custom Icon   custom Icon EmptyVen 11 Mai 2018 - 1:28

Thanks for your help.
Revenir en haut Aller en bas
jennyk

jennyk


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

custom Icon Empty
MessageSujet: more help   custom Icon EmptyVen 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
Yannick




Nombre de messages : 8635
Age : 53
Localisation : Bretagne
Date d'inscription : 15/02/2010

custom Icon Empty
MessageSujet: re   custom Icon EmptyVen 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
Klaus

Klaus


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

custom Icon Empty
MessageSujet: Re: custom Icon   custom Icon EmptyVen 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
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


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

custom Icon Empty
MessageSujet: Re: custom Icon   custom Icon EmptySam 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
http://klauspanoramic.comxa.com/index.html
Contenu sponsorisé





custom Icon Empty
MessageSujet: Re: custom Icon   custom Icon Empty

Revenir en haut Aller en bas
 
custom Icon
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Open Icon Library
» Pano Sub Icon Creator

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: