WxPHP

Last updated
wxPHP
Developer(s) Mário Soares
Jefferson González
Initial release2003;20 years ago (2003)
Stable release
3.0.2.0 / May 30, 2015;8 years ago (2015-05-30) [1]
Repository
Written in C, C++, PHP
Operating system Cross-platform: Windows, Linux, macOS
Type Programming library
License PHP
Website wxphp.org

wxPHP (for wxWidgets for PHP) is an extension the programming language PHP that wraps the wxWidgets library, which allows writing cross-platform software desktop applications that make use of the native graphical components available to the different platforms. It supports the three major operating systems: Windows, Linux, and macOS by using PHP. Applications are written in PHP, which is an interpreted language. Thus, it needs no intermediate compiling step to run an application, if the PHP interpreter has the extension available.

Contents

History

Near 2003, a group of enthusiastic people began writing on mailing lists [2] and forums presenting the idea of a PHP extension that wrapped the wxWidgets library in a similar way to what PHP-GTK does for GTK+. A SourceForge project was created [3] and many people joined [4] in an effort to move the cause forward and make it a reality. Despite the will of the project members, no progress was made, [5] until Mário Soares decided to join. [6] After the join, the first commits occurred to the Concurrent Versions System (CVS) repository on SourceForge. The first commits consisted of wrapping the wxApp class, wxFrame, and some other basic controls, this is when wxPHP first saw the light. Inspired by wrapper generators like Simplified Wrapper and Interface Generator (SWIG), development was begun for a simple code generator that read the output of GCCXML [7] ran over wxWidgets and transformed into a serialized PHP array. This helped save much time on the monotonous task of writing the same code repeatedly for each class and its methods. After having some basic functions and controls, an application was written using wxPHP, to assist the code generator on the selection of class methods that it could handle correctly.

In August 2011, Jefferson González wrote an email to the maintainer then, offering to make a website to boost wxPHP presence and attract more people and contributors. When the website was up and running, he began working with the wxPHP source code. Later, he decided to enable more methods and classes, discovering on the way that many features were unsupported by the code generator and extension. After several emails, the prior developer had the idea to parse the XML output generated by Doxygen from the wxWidget documentation. He undertook the work and began improving the code generator until it was rewritten, adding missing documentation and many features that would enable adding more wxWidgets functions.

Present

As of 2012, wxPHP supports around 400 wxWidgets classes and thousands of methods, making it usable to develop a desktop commercial application. The project source code is now hosted on GitHub. A reference generator was written that serves as the documentation of the functions supported by the wxPHP extension. Also an interface generator [8] has been written to get code completion on integrated development environments (IDEs) like NetBeans and Eclipse. Planning is underway to rewrite the code generator yet again using a modular and object-oriented programming approach that permits others to use it to generate code for other PHP wrappers. [9]

GUI Designer

Support for PHP code generation was added to wxFormBuilder to easily create applications, and get people not familiar to the library to get up to speed on learning it.

Example

A minimal frame example that shows how to add a menu bar with menu items, button, status bar and connection of click events.

<?phpclassMainFrameextendswxFrame{functiononQuit(){$this->Destroy();}functiononAbout(){$dlg=newwxMessageDialog($this,"Welcome to wxPHP!!\nBased on wxWidgets 3.0.0\n\nThis is a minimal wxPHP sample!","About box...",wxICON_INFORMATION);$dlg->ShowModal();}function__construct(){parent::__construct(null,null,"Minimal wxPHP App",wxDefaultPosition,newwxSize(350,260));$mb=newwxMenuBar();$mn=newwxMenu();$mn->Append(2,"E&xit","Quit this program");$mb->Append($mn,"&File");$mn=newwxMenu();$mn->AppendCheckItem(4,"&About...","Show about dialog");$mb->Append($mn,"&Help");$this->SetMenuBar($mb);$scite=newwxStyledTextCtrl($this);$sbar=$this->CreateStatusBar(2);$sbar->SetStatusText("Welcome to wxPHP...");$this->Connect(2,wxEVT_COMMAND_MENU_SELECTED,array($this,"onQuit"));$this->Connect(4,wxEVT_COMMAND_MENU_SELECTED,array($this,"onAbout"));}}$mf=newmainFrame();$mf->Show();wxEntry();?>

See also

Related Research Articles

wxWidgets Widget toolkit

wxWidgets is a widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. wxWidgets enables a program's GUI code to compile and run on several computer platforms with minimal or no code changes. A wide choice of compilers and other tools to use with wxWidgets facilitates development of sophisticated applications. wxWidgets supports a comprehensive range of popular operating systems and graphical libraries, both proprietary and free, and is widely deployed in prominent organizations.

<span class="mw-page-title-main">FLTK</span>

Fast Light Toolkit is a cross-platform widget library for graphical user interfaces (GUIs), developed by Bill Spitzak and others. Made to accommodate 3D graphics programming, it has an interface to OpenGL, but it is also suitable for general GUI programming.

<span class="mw-page-title-main">Graphical widget</span> Element of interaction in a graphical user interface

A graphical widget in a graphical user interface is an element of interaction, such as a button or a scroll bar. Controls are software components that a computer user interacts with through direct manipulation to read or edit information about an application. User interface libraries such as Windows Presentation Foundation, Qt, GTK, and Cocoa, contain a collection of controls and the logic to render these.

wxBasic is a free software / open-source software, cross-platform BASIC interpreter. As it is based on syntax of the BASIC language, it is designed to be simple to learn and understand, and allow novice programmers to write applications for graphical environments like Windows and Linux with minimal effort. wxBasic is a bytecode based language, like Perl or Java. It is licensed under the LGPL, so proprietary software's source code can be linked against it.

<span class="mw-page-title-main">PyQt</span> Python GUI library

PyQt is a Python binding of the cross-platform GUI toolkit Qt, implemented as a Python plug-in. PyQt is free software developed by the British firm Riverbank Computing. It is available under similar terms to Qt versions older than 4.5; this means a variety of licenses including GNU General Public License (GPL) and commercial license, but not the GNU Lesser General Public License (LGPL). PyQt supports Microsoft Windows as well as various kinds of UNIX, including Linux and MacOS.

<span class="mw-page-title-main">PyGTK</span> Set of Python wrappers for the GTK graphical user interface library

PyGTK is a set of Python wrappers for the GTK graphical user interface library. PyGTK is free software and licensed under the LGPL. It is analogous to PyQt/PySide and wxPython, the Python wrappers for Qt and wxWidgets, respectively. Its original author is GNOME developer James Henstridge. There are six people in the core development team, with various other people who have submitted patches and bug reports. PyGTK has been selected as the environment of choice for applications running on One Laptop Per Child systems.

wxPython Python wrapper for wxWidgets

wxPython is a wrapper for the cross-platform GUI API wxWidgets for the Python programming language. It is one of the alternatives to Tkinter. It is implemented as a Python extension module.

<span class="mw-page-title-main">PHP-GTK</span> PHP library for GTK+ GUI applications

PHP-GTK is a set of language bindings for the programming language PHP which allow GTK graphical user interface (GUI) applications to be written in PHP. PHP-GTK provides an object-oriented programming interface to GTK classes and functions. PHP-GTK partly supports GTK2, but GTK3 is unsupported.

<span class="mw-page-title-main">Graphical user interface builder</span> Software development tool

A graphical user interface builder, also known as GUI designer or sometimes RAD IDE, is a software development tool that simplifies the creation of GUIs by allowing the designer to arrange graphical control elements using a drag-and-drop WYSIWYG editor. Without a GUI builder, a GUI must be built by manually specifying each widget's parameters in the source code, with no visual feedback until the program is run. Such tools are usually called the term RAD IDE.

<span class="mw-page-title-main">GLib</span> Software library

GLib is a bundle of three low-level system libraries written in C and developed mainly by GNOME. GLib's code was separated from GTK, so it can be used by software other than GNOME and has been developed in parallel ever since.

Tkinter is a Python binding to the Tk GUI toolkit. It is the standard Python interface to the Tk GUI toolkit, and is Python's de facto standard GUI. Tkinter is included with standard Linux, Microsoft Windows and macOS installs of Python.

<span class="mw-page-title-main">Scintilla (software)</span> Free and open text editor component

Scintilla is a free, open source library that provides a text editing component function, with an emphasis on advanced features for source code editing.

<span class="mw-page-title-main">JUCE</span> C++ Cross-Platform Application Development Framework

JUCE is an open-source cross-platform C++ application framework, used for the development of desktop and mobile applications. JUCE is used in particular for its GUI and plug-ins libraries. It is dual licensed under the GPLv3 and a commercial license.

<span class="mw-page-title-main">Hildon</span>

Hildon is an application framework originally developed for mobile devices running the Linux operating system as well as the Symbian operating system. The Symbian variant of Hildon was discontinued with the cancellation of Series 90. It was developed by Nokia for the Maemo operating system. It focuses on providing a finger-friendly interface. It is primarily a set of GTK extensions that provide mobile-device–oriented functionality, but also provides a desktop environment that includes a task navigator for opening and switching between programs, a control panel for user settings, and status bar, task bar and home applets. It is standard on the Maemo platform used by the Nokia Internet Tablets and the Nokia N900 smartphone.

<span class="mw-page-title-main">CodeLite</span> Integrated development environment

CodeLite is a free and open-source IDE for the C, C++, PHP, and JavaScript (Node.js) programming languages.

<span class="mw-page-title-main">GTK</span> Free and open-source cross-platform widget toolkit for creating graphical user interfaces

GTK is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and proprietary software to use it. It is one of the most popular toolkits for the Wayland and X11 windowing systems.

In computing, SPICE is a remote-display system built for virtual environments which allows users to view a computing "desktop" environment – not only on its computer-server machine, but also from anywhere on the Internet – using a wide variety of machine architectures.

Nana is a cross-platform C++ library for creating graphical user interfaces. It uses a platform-independent API and currently supports Windows, Linux and FreeBSD.

Client-side decoration (CSD) is the concept of allowing a graphical application software to be responsible for drawing its own window decorations, historically the responsibility of the window manager.

References

  1. "Changes" on GitHub
  2. "wxPHP?" . Retrieved 2012-06-06.
  3. "wxPHP has Risen" . Retrieved 2012-06-06.
  4. "wxPHP SourceForge Mailing list" . Retrieved 2012-06-06.
  5. "wxPHP Progress" . Retrieved 2012-06-06.
  6. "Working Version" . Retrieved 2012-06-07.
  7. "GCC-XML" . Retrieved 2012-06-06.
  8. "Code Completion Interface File" . Retrieved 2012-06-06.
  9. "PEG: A PHP Extension Generator".