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
» PANORAMIC V 1
Un Windows Phone 8 en Panoramic ? Emptypar papydall Aujourd'hui à 2:21

» Gestion d'un système client-serveur.
Un Windows Phone 8 en Panoramic ? Emptypar Klaus Hier à 23:59

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
Un Windows Phone 8 en Panoramic ? Emptypar Marc Hier à 12:14

» @Jack
Un Windows Phone 8 en Panoramic ? Emptypar Jack Mar 30 Avr 2024 - 20:40

» trop de fichiers en cours
Un Windows Phone 8 en Panoramic ? Emptypar papydall Lun 29 Avr 2024 - 23:39

» Une calculatrice en une ligne de programme
Un Windows Phone 8 en Panoramic ? Emptypar jean_debord Dim 28 Avr 2024 - 8:47

» Form(résolu)
Un Windows Phone 8 en Panoramic ? Emptypar leclode Sam 27 Avr 2024 - 17:59

» Bataille navale SM
Un Windows Phone 8 en Panoramic ? Emptypar jjn4 Ven 26 Avr 2024 - 17:39

» Les maths du crocodile
Un Windows Phone 8 en Panoramic ? Emptypar jean_debord Jeu 25 Avr 2024 - 10:37

» Naissance de Crocodile Basic
Un Windows Phone 8 en Panoramic ? Emptypar jean_debord Jeu 25 Avr 2024 - 8:45

» Dessine-moi une galaxie
Un Windows Phone 8 en Panoramic ? Emptypar jjn4 Lun 22 Avr 2024 - 13:47

» Erreur END_SUB
Un Windows Phone 8 en Panoramic ? Emptypar jjn4 Lun 22 Avr 2024 - 13:43

» Bug sur DIM_LOCAL ?
Un Windows Phone 8 en Panoramic ? Emptypar papydall Dim 21 Avr 2024 - 23:30

» 2D_fill_color(résolu)
Un Windows Phone 8 en Panoramic ? Emptypar leclode Sam 20 Avr 2024 - 8:32

» Consommation gaz électricité
Un Windows Phone 8 en Panoramic ? Emptypar leclode Mer 17 Avr 2024 - 11:07

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Mai 2024
LunMarMerJeuVenSamDim
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendrierCalendrier
Le Deal du moment : -39%
Ordinateur portable ASUS Chromebook Vibe CX34 Flip
Voir le deal
399 €

 

 Un Windows Phone 8 en Panoramic ?

Aller en bas 
AuteurMessage
Klaus

Klaus


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

Un Windows Phone 8 en Panoramic ? Empty
MessageSujet: Un Windows Phone 8 en Panoramic ?   Un Windows Phone 8 en Panoramic ? EmptyJeu 8 Aoû 2013 - 22:49

Je viens de remplacer mon téléphone portable par un Windows Phone 8. Découverte intéressante. En particulier l'écran d'accueil ou bureau qui est un clone de l'écran d'accueil de Windows 8 pour PC, juste adapté au format d'écran d'un smartphone.

Alors, je me suis dit: Panoramic peut-il faire cela ?

Réponse: Mais oui, c'est bien sûr...

Et j'ai fait une maquette dont vous trouverez le code ci-après. Au début, le programme affiche un seul carré rouge sur fond noir. Il porte le libellé "Sortir", et un clic dessus est le seul moyen de sortir du programme.

Un double-click sur le fond noir passe en mode "modif" et crée un nouveau carré, qui pour des raisons de simplicitité (ce n'est qu'une démo), se place par-dessus le carré "Sortir". Mais, en mode modification, le fond a changé de couleur, et une fenêtre supplémentaire est apparue. Elle affiche les informations significatives pour le pavé actif (dans notre cas, celui qui vient d'être créé, sinon les infos de n'importe quel pavé sur lequel on fait un simple clic gauche en mode modif). On peut alors, pour le pavé actif:
- changer le libellé et/ou changer la commande qui sera exéutée, puis valider par le bouton "Valider"
- déplacer le pavé par les 4 flèches
- changer le pavé de forme par la touche espace. On passe, de façon cyclique, de (104,104) en passant par (50,104) et (104,50) à (50,50 pour revenir à (104,104). Le libellé est repositionné automatiquement, au centre du pavé.

Un simple-clic gauche dans la partie noire ou la touche Echap sort du mode modif, la fenêtre de saisie disparaît et la couleur de fond redevient noire. Et les pavés réagissent au simple clic gauche en exécutant la commande qui leur est affectée.

Commandes possibles:
- la chaîne de caractères %/% signifie "Sortir". Le programme demande confirmation, puis fait terminate.
- un chemin relatif ou absolu vers un exécutable qui sera alors lancé par la commande execute
- un nom de fichier quelconque avec un chemin relatif ou absolu. Ce fichier sera alors ouvert par le programme associé à son extension
- une adresse URL commençant par http:// . Cette adresse sera alors chargée dans le browser internet par défaut, dans un nouvel onglet

Toutes ces commandes peuvent être placées dans la zone de saisie par ctrl/V (cas d'une URL, par exemple), ou à l'aide du bouton "..." à droite de la zone. Ce bouton ouvre un sélecteur de fichiers.

Voilà, de quoi s'amuser cinq minutes:
Code:

' cases:carrés ou rectangles de 100 ou 50 de côté
' emplacements: lignes et colonnes séparés de 4 pixels

labels()
form0()
form1000()
constantes()
variables()
initialisations()
end

sub labels()
  label click_gauche, click_double, click_check, key_down
  label valider, ouvrir_cmd
end_sub

sub form0()
  border_hide 0
  width 0,220
  color 0,0,0,0
  on_click 0,click_gauche
  on_double_click 0,click_double
  on_key_down 0,key_down
end_sub

sub constantes()
  dim c_taille1% : c_taille1% = 104
  dim c_taille2% : c_taille2% = 50
  ' agrandir variable "delai" s'il y a confusion entre simple et double click
  dim delai% : delai% = 200
end_sub

sub variables()
  dim tailles%(4,2)
  dim n_obj%, obj%(100,10)
  ' 1=taille  2=x  3=y 4,5,6=RGB  7=l  8=l1  9=c  10=c1
  dim obj$(100,2)  : ' 1=libellé  2=commande
  dim n_click%, double%, t%, modif%, scan%, x%, y%, l%, l1%, c%, c1%, t$
end_sub

sub initialisations()
  tailles%(1,1) = c_taille1%
  tailles%(1,2) = c_taille1%
  tailles%(2,1) = c_taille2%
  tailles%(2,2) = c_taille1%
  tailles%(3,1) = c_taille1%
  tailles%(3,2) = c_taille2%
  tailles%(4,1) = c_taille2%
  tailles%(4,2) = c_taille2%
  create_obj(1,1,0,1,0,255,0,0,"Sortie","%/%")
  timer 400 : timer_off 400 : timer_interval 400,delai% : on_timer 400,click_check
end_sub

sub create_obj(taille%,l%,l1%,c%,c1%,r%,g%,b%,lib$,cmd$)
  dim_local x%, y%
  x% = (c%-1)*(c_taille1% + 4) + 4 + c1%*c_taille2%
  y% = (l%-1)*(c_taille1% + 4) + 4 + l1%*c_taille2%
  n_obj% = n_obj% + 1
  obj%(n_obj%,1)  = taille%
  obj%(n_obj%,2)  = x%
  obj%(n_obj%,3)  = y%
  obj%(n_obj%,4)  = r%
  obj%(n_obj%,5)  = g%
  obj%(n_obj%,6)  = b%
  obj%(n_obj%,7)  = l%
  obj%(n_obj%,8)  = l1%
  obj%(n_obj%,9)  = c%
  obj%(n_obj%,10) = c1%
  obj$(n_obj%,1)  = lib$
  obj$(n_obj%,2)  = cmd$
  picture n_obj%
  configure_obj(n_obj%) : ' ,taille%,x%,y%,r%,g%,b%,lib$)
  on_click n_obj%,click_gauche
  on_double_click n_obj%,click_double
end_sub

sub configure_obj(n_obj%) : ' ,taille%,x%,y%,r%,g%,b%,lib$)
  dim_local w%, h%, taille%,x%,y%,r%,g%,b%,lib$
  taille% = obj%(n_obj%,1)
  x% = obj%(n_obj%,2)
  y% = obj%(n_obj%,3)
  r% = obj%(n_obj%,4)
  g% = obj%(n_obj%,5)
  b% = obj%(n_obj%,6)
  lib$ = obj$(n_obj%,1)
  top n_obj%,y% : left n_obj%,x%
  width n_obj%,tailles%(taille%,1)
  height n_obj%,tailles%(taille%,2)
  color n_obj%,r%,g%,b%
  w% = text_width(lib$,n_obj%)
  h% = text_height(lib$,n_obj%)
  print_target_is n_obj%
  2d_target_is n_obj%
  2d_fill_color r%,g%,b%
  print_locate (width(n_obj%)-w%)/2,(height(n_obj%)-h%)/2
  print lib$
end_sub

sub form1000()
  form 1000 : hide 1000 : border_hide 1000 : color 1000,255,127,127
  left 1000,left(0)+width(0)+10 : width 1000,400
  command_target_is 1000
  alpha 1001 : top 1001,20 : left 1001,20 : caption 1001,"Libellé:"
  alpha 1002 : top 1002,50 : left 1002,20 : caption 1002,"Commande:"
  edit 1011 : top 1011,20 : left 1011,120 : width 1011,200
  edit 1012 : top 1012,50 : left 1012,120 : width 1012,200
  button 1031 : top 1031,50 : left 1031,330 : width 1031,20
    caption 1031,"..." : font_bold 1031 : on_click 1031,ouvrir_cmd
  button 1041 : top 1041,100 : left 1041,120 : caption 1041,"Valider"
    on_click 1041,valider
  open_dialog 1099
  command_target_is 0
end_sub


click_gauche:
  double% = 1
  timer_on 400
  return

click_double:
  timer_off 400
  double% = 2
'  if double%=2
    n_click% = number_click
    modif% = 1
    color 0,50,50,50
    show 1000
    if n_click%=0
      create_obj(1,1,0,1,0,255,0,0,"Nouveau","")
      n_click% = n_obj%
      t$ = obj$(n_click%,1)
      text 1011, obj$(n_click%,1)
      text 1012, obj$(n_click%,2)
      if c%=1
        obj$(n_click%,1) = message_text$
        configure_obj(n_click%)
      end_if
    else
      text 1011, obj$(n_click%,1)
      text 1012, obj$(n_click%,2)
    end_if
    double% = 0
'  end_if
  return

click_check:
  timer_off 400
  if double%<>1 then return
  n_click% = number_click
  if n_click%=0
    modif% = 0
    hide 1000
    color 0,0,0,0
  else
    if modif%=0
      if obj$(n_click%,2)="%/%"
        if message_confirmation_yes_no("Terminer ?")=1 then terminate
      else
' message obj$(n_click%,2)
        execute obj$(n_click%,2)
      end_if
    else
      text 1011, obj$(n_click%,1)
      text 1012, obj$(n_click%,2)
    end_if
  end_if
  return
 
key_down:
  if modif%=0 then return
  if n_click%=0 then return
  scan% = scancode
  select scan%
    case 37 : ' gauche
      c% = obj%(n_click%,9)
      c1% = obj%(n_click%,10)
      if (c%=1) and (c1%=0) then return
      if c1%>0
        c1% = 0
      else
        c% = c% - 1
        c1% = 1
      end_if
      x% = (c%-1)*(c_taille1% + 4) + 4 + c1%*(c_taille2%+4)
      obj%(n_click%,2) = x%
      obj%(n_click%,9) = c%
      obj%(n_click%,10) = c1%
      configure_obj(n_click%)
    case 38 : ' haut
      l% = obj%(n_click%,7)
      l1% = obj%(n_click%,8)
      if (l%=1) and (l1%=0) then return
      if l1%>0
        l1% = 0
      else
        l% = l% - 1
        l1% = 1
      end_if
      y% = (l%-1)*(c_taille1% + 4) + 4 + l1%*(c_taille2%+4)
      obj%(n_click%,3) = y%
      obj%(n_click%,7) = l%
      obj%(n_click%,8)  = l1%
      configure_obj(n_click%)
    case 39 : ' droite
      c% = obj%(n_click%,9)
      c1% = obj%(n_click%,10)
      if (obj%(n_click%,1)=1) or (obj%(n_click%,1)=3)
        if c%=2 then return
      end_if
      if (c%=2) and (c1%=1) then return
      if c1%=0
        c1% = 1
      else
        c% = c% + 1
        c1% = 0
      end_if
      x% = (c%-1)*(c_taille1% + 4) + 4 + c1%*(c_taille2%+4)
      obj%(n_click%,2) = x%
      obj%(n_click%,9) = c%
      obj%(n_click%,10) = c1%
      configure_obj(n_click%)
    case 40 : ' bas
      l% = obj%(n_click%,7)
      l1% = obj%(n_click%,8)
      if (l%=8) and (l1%=1) then return
      if l1%=0
        l1% = 1
      else
        l% = l% + 1
        l1% = 0
      end_if
      y% = (l%-1)*(c_taille1% + 4) + 4 + l1%*(c_taille2%+4)
      obj%(n_click%,3) = y%
      obj%(n_click%,7) = l%
      obj%(n_click%,8) = l1%
      configure_obj(n_click%)
    case 32 : ' espace
      t% = obj%(n_click%,1) + 1
      if t%>4 then t% = 1
      obj%(n_click%,1) = t%
      if (obj%(n_click%,1)=1) or (obj%(n_click%,1)=3)
        if obj%(n_click%,9)=2
          c1% = 0
          x% = (c%-1)*(c_taille1% + 4) + 4 + c1%*(c_taille2%+4)
          obj%(n_click%,2) = x%
          obj%(n_click%,10) = c1%
        end_if
      end_if
      configure_obj(n_click%)
    case 27 : ' echap
      modif% = 0
      color 0,0,0,0
      hide 1000
    case 13 : ' CR
      t$ = obj$(n_click%,1)
      c% = message_input("Changement de libellé","Nouveau libellé:",t$)
      if c%=1
        obj$(n_click%,1) = message_text$
        configure_obj(n_click%)
      end_if
    case 36 : ' home
      t$ = obj$(n_click%,2)
      c% = message_input("Changement de commande","Nouvelle commande:",t$)
      if c%=1
        obj$(n_click%,2) = message_text$
        configure_obj(n_click%)
      end_if
  end_select
  return
 
valider:
  if n_click%=0 then return
  obj$(n_click%,1) = trim$(text$(1011))
  obj$(n_click%,2) = trim$(text$(1012))
  configure_obj(n_click%)
  set_focus 0
  return
 
ouvrir_cmd:
  t$ = file_name$(1099)
  if t$="_" then return
  if file_exists(t$)=1 then text 1012,t$
  return
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
 
Un Windows Phone 8 en Panoramic ?
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» panoramic/windows phone ?
» Panoramic et Windows
» ADD_TRACE F
» Panoramic en Windows 7 64bits
» Panoramic sous Windows XP

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: Les inutilitaires-
Sauter vers: