PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of José Augusto Ferreira Franco   PHP-Gtk winDialog   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example with this class
Class: PHP-Gtk winDialog
Generic class to handle with notice messages
Author: By
Last change:
Date: 18 years ago
Size: 3,932 bytes
 

Contents

Class file image Download
<?php

// +----------------------------------------------------------------------+
// | Proprietary License Onidesk I.C.S. - PORTUGAL |
// +----------------------------------------------------------------------+
// | Author: José Augusto Ferreira Franco < http://onidesk.sytes.net> |
// +----------------------------------------------------------------------+
//

/**
  * < SOBRE A CLASSE winDIALOG >
  *
  * Esta classe é um pequeno exemplo de como criar janelas de mensagens tipo
  * 'caixa de diálogo' para apresentar as mensagens decorrentes dos processos
  * nas aplicações escritas em PHP-GTK
  * Apesar da sua enorme utilidade esta classe é uma DEMOSTRAÇÃO.
  * A versão completa incluí algumas dezenas de backgrounds de extrema qualidade
  * em formato aberto Photoshop e xpm de forma a dar maior destaque visual
  * e qualidade às suas aplicações .
  * Poderá também utilizar botões multiplos com 'callbacks' distintos e usar a classe dentro de outras classes
  * ou se preferir usá-la fora de qualquer classe
  * A classe pode ser adquirida por apenas 25 € (euros), a mesma quantia em dolares USA
  * Se estiver interessado em usar e adquiri esta classe contacte-me via email
  * para guto.onidesk@gmail.com
  *
  * < ABOUT THE CLASS winDIALOG >
  *
  * This classe it´s just a short example how to create windows notice messages as 'dialog boxes',
  * to show the decurrent messages of applications written on PHP-GTK
  * Instead its biggest utility , this classe is only a demostration
  * The full version includes sets of ten backbrounds in open format made on Photoshop and as weel
  * on xpm format , that you can use with the windows by adding to your application a great appearance
  * and quality
  * On full version you have available multiple buttons that you can connect to multiple methods, and use them inside or
  * outside classes, no matter what
  * To get full version , you only need 25 € (euros), the same value on USA dollars.
  * Just in case you are interested on buy it, just contact me via email at guto.onidesk@gmail.com
 




/**
  * Incluí a livraria do PHP-GTK
  *
  * Includes the PHP-GTK dll
  **/

    
$OS = strtoupper(substr(PHP_OS, 0,3));
         if (
$OS == 'WIN')
        
dl('php_gtk.dll');
            else
           
dl('php_gtk.so');

/**
  * Faz a inlusão da classe winDialog
  *
  * Includes the classe winDialog
  ***/

 
require 'winDialog.inc.php';

/**
 * Exemplo simples usando a classe winDialog
 * Simple classe example using the classe winDialog
 **/
 
new App;

 
GTK::main();

 class
App{

      var
$strText;

      function
app()
      {
       
$app = &new GTKWindow();
       
#$app->set_default_size(400,200);
       
$app->connect('destroy',array(&$this,'close'));
       
$fixed = &new GTKFixed();
       
$fixed->set_usize(400,200);
       
$entry = &new GTKEntry();
       
$button = &new GTKButton("Send");
       
$button->set_usize(75,25);
       
$button->connect_object("pressed",array(&$this,"popUpDialog"),$entry);
       
$fixed->put($entry,80,40);
       
$fixed->put($button,80,100);
       
$app->add($fixed);
       
$app->show_all();
      }




      function
popUpDialog ($object)
      {
       
$this->value = $object->get_text();
       
$this->strText .= "".$this->value."";
        if(
$this->value ==''):
       
$this->popUp = new winDialog('winDialog','hide',"The field name is empty !\n Please fill your name !");
        else:
       
$this->popUp = new winDialog(&$this,'close','Press twice to close',$this->strText);
        endif;
        }

      function
close()
      {
       
$this->Lisense .= "Proprietary License (pl) Onidesk ICS\n";
       
$this->Lisense .= ".:: Guto Ferreira Creations 2005";
        print
$this->Lisence;
       
GTK::main_quit();
      }

  }


 
?>