PHP WinBinder 2: WinBinder portable: Difference between revisions

m
Reverted edits by Upazixorys (Talk); changed back to last version by BobS
No edit summary
m (Reverted edits by Upazixorys (Talk); changed back to last version by BobS)
 
Line 1: Line 1:
=[http://oqagacyti.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
{{Nav PHP WinBinder 2}}
{{Nav PHP WinBinder 2}}
'''''WinBinder Part 2'''''
'''''WinBinder Part 2'''''
Line 19: Line 18:
Form editor is an excellent tool for positioning Windows controls. This overview will quickly get you up and running:
Form editor is an excellent tool for positioning Windows controls. This overview will quickly get you up and running:
{|
{|
|-valign="top"
|-valign="top"
|
|
Navigate to folder C:\us_wb\wb\'''form_editor''' and
Navigate to folder C:\us_wb\wb\'''form_editor''' and
Line 31: Line 30:




* '''E)''' After adding controls, they are listed in this window. Click any item in the<br /> list to select a control; alternatively click on a control in the application design window.
* '''E)''' After adding controls, they are listed in this window. Click any item in the<br /> list to select a control; alternatively click on a control in the application design window.
* '''F)''' This window displays additional styles that you can add to a control.
* '''F)''' This window displays additional styles that you can add to a control.
* '''G)''' These four controls allow you to finely tune the position of a selected control.
* '''G)''' These four controls allow you to finely tune the position of a selected control.
Line 38: Line 37:
'''Explore'''
'''Explore'''


Explore the form-editor, add controls move them around.&lt;br /&gt;Get a feel for laying out controls.
Explore the form-editor, add controls move them around.<br />Get a feel for laying out controls.


'''Delete a control'''
'''Delete a control'''


You can delete a control by first selecting it and using menu '''Edit &gt; Delete control'''
You can delete a control by first selecting it and using menu '''Edit > Delete control'''
   
   
'''Preview application'''
'''Preview application'''


* Select '''View &gt; Preview form'''
* Select '''View > Preview form'''
* Displays what an application will look like   
* Displays what an application will look like   


Line 75: Line 74:
==== Basic Windows app ====
==== Basic Windows app ====
{|
{|
|-valign=&quot;top&quot;
|-valign="top"
|
|
'''''Basic Windows app'':'''
'''''Basic Windows app'':'''
Line 90: Line 89:


Running '''z_basic.bat''' (Double click on file) produces the following:
Running '''z_basic.bat''' (Double click on file) produces the following:
&lt;pre&gt;
<pre>
The system cannot find the path specified.
The system cannot find the path specified.
Press any key to continue . . .
Press any key to continue . . .
&lt;/pre&gt;
</pre>
The error message is clear: both files contain incorrect paths.
The error message is clear: both files contain incorrect paths.


These files contain relative paths &quot;'''..\php'''.&quot; The two periods means move up one folder level and down into folder php. but it cannot find the folder php. This folder resides inside folder &quot;'''wb'''&quot; and must be included in the paths as shown in the next section.
These files contain relative paths "'''..\php'''." The two periods means move up one folder level and down into folder php. but it cannot find the folder php. This folder resides inside folder "'''wb'''" and must be included in the paths as shown in the next section.
|
|
&amp;nbsp;
&nbsp;
|
|
'''z_basic.bat'''
'''z_basic.bat'''
&lt;pre&gt;
<pre>
..\php\php.exe -c ..\php\php-wb.ini z_basic.phpw
..\php\php.exe -c ..\php\php-wb.ini z_basic.phpw
&lt;/pre&gt;
</pre>
'''z_basic.phpw'''
'''z_basic.phpw'''
&lt;pre&gt;
<pre>
&lt;?php
<?php
Include &quot;../php/include/winbinder.php&quot;;      // Location Of Winbinder Library
Include "../php/include/winbinder.php";      // Location Of Winbinder Library


//--- Constants ---------------------------------------------------------------
//--- Constants ---------------------------------------------------------------


//=== 1) Create main window ---------------------------------------------------
//=== 1) Create main window ---------------------------------------------------
$mainwin = wb_create_window(NULL, AppWindow, &quot;z_basic&quot;, 320, 240);
$mainwin = wb_create_window(NULL, AppWindow, "z_basic", 320, 240);


//=== 2) Create controls for the main window ----------------------------------
//=== 2) Create controls for the main window ----------------------------------


//=== 3) Assign handler function to the main window  --------------------------
//=== 3) Assign handler function to the main window  --------------------------
wb_set_handler($mainwin, &quot;process_main&quot;);       
wb_set_handler($mainwin, "process_main");       


//=== 5) Enter application loop -----------------------------------------------
//=== 5) Enter application loop -----------------------------------------------
Line 132: Line 131:
   }
   }
}
}
?&gt;
?>
&lt;/pre&gt;
</pre>
|}
|}


==== Basic Windows app with corrected paths ====
==== Basic Windows app with corrected paths ====
{|
{|
|-valign=&quot;top&quot;
|-valign="top"
|
|
'''''Basic Windows app with corrected paths'':'''
'''''Basic Windows app with corrected paths'':'''
Line 165: Line 164:


|
|
&amp;nbsp;
&nbsp;
|
|
'''z_basic.bat'''
'''z_basic.bat'''
&lt;pre&gt;
<pre>
..\wb\php\php.exe -c ..\wb\php\php-wb.ini z_basic.phpw
..\wb\php\php.exe -c ..\wb\php\php-wb.ini z_basic.phpw
&lt;/pre&gt;
</pre>
'''z_basic.phpw'''
'''z_basic.phpw'''
&lt;pre&gt;
<pre>
&lt;?php
<?php
Include &quot;../wb/php/include/winbinder.php&quot;;      // Location Of Winbinder Library
Include "../wb/php/include/winbinder.php";      // Location Of Winbinder Library


//--- Constants ---------------------------------------------------------------
//--- Constants ---------------------------------------------------------------


//=== 1) Create main window ---------------------------------------------------
//=== 1) Create main window ---------------------------------------------------
$mainwin = wb_create_window(NULL, AppWindow, &quot;z_basic&quot;, 320, 240);
$mainwin = wb_create_window(NULL, AppWindow, "z_basic", 320, 240);


//=== 2) Create controls for the main window ----------------------------------
//=== 2) Create controls for the main window ----------------------------------


//=== 3) Assign handler function to the main window  --------------------------
//=== 3) Assign handler function to the main window  --------------------------
wb_set_handler($mainwin, &quot;process_main&quot;);       
wb_set_handler($mainwin, "process_main");       


//=== 5) Enter application loop -----------------------------------------------
//=== 5) Enter application loop -----------------------------------------------
Line 199: Line 198:
   }
   }
}
}
?&gt;
?>
&lt;/pre&gt;
</pre>
|}
|}


Line 207: Line 206:


{|
{|
|-valign=&quot;top&quot;
|-valign="top"
|
|
Before creating a form, it is best to create a new folder that will contain the resulting form (referred to as a project). Create a new folder named '''my_project''' (or any other name) in folder C:\'''us_wb'''  
Before creating a form, it is best to create a new folder that will contain the resulting form (referred to as a project). Create a new folder named '''my_project''' (or any other name) in folder C:\'''us_wb'''  
Line 227: Line 226:


Save the project with name '''my.prj''' to folder '''my_proj''' as follows:
Save the project with name '''my.prj''' to folder '''my_proj''' as follows:
* Top menu, select '''File &gt; Save Project as'''
* Top menu, select '''File > Save Project as'''
* Navigate to folder '''my_project'''
* Navigate to folder '''my_project'''
* Enter '''my.prj'''
* Enter '''my.prj'''
* Click save
* Click save
* Exit form editor, select '''File &gt; Exit'''
* Exit form editor, select '''File > Exit'''
|
|
[[Image:WinBinder_FE_2.gif]]
[[Image:WinBinder_FE_2.gif]]
Line 241: Line 240:


In this example, it is named '''my.form.php''' and has the following content:
In this example, it is named '''my.form.php''' and has the following content:
&lt;pre&gt;
<pre>
&lt;?php
<?php


/*******************************************************************************
/*******************************************************************************
Line 274: Line 273:
// End controls
// End controls


?&gt;
?>
&lt;/pre&gt;
</pre>


==== Copy and paste ====
==== Copy and paste ====
Line 289: Line 288:
==== Assign Images ====
==== Assign Images ====
Use the following code to assign images to the frames. Place code at end of section “2) Create controls for the main window”  
Use the following code to assign images to the frames. Place code at end of section “2) Create controls for the main window”  
&lt;pre&gt;
<pre>
// Assign images to frames
// Assign images to frames
wb_set_image(wb_get_control($mainwin, IDC_FRAMERED1),'red.bmp', NOCOLOR);     
wb_set_image(wb_get_control($mainwin, IDC_FRAMERED1),'red.bmp', NOCOLOR);     
Line 295: Line 294:
wb_set_image(wb_get_control($mainwin, IDC_FRAMERED2),  'red.bmp', NOCOLOR);   
wb_set_image(wb_get_control($mainwin, IDC_FRAMERED2),  'red.bmp', NOCOLOR);   
wb_set_image(wb_get_control($mainwin, IDC_FRAMEGREEN2),'green.bmp', NOCOLOR);  
wb_set_image(wb_get_control($mainwin, IDC_FRAMEGREEN2),'green.bmp', NOCOLOR);  
&lt;/pre&gt;
</pre>




Add a logo image to the application window.
Add a logo image to the application window.
&lt;pre&gt;
<pre>
//=== 3) Assign handler function to the main window  --------------------------
//=== 3) Assign handler function to the main window  --------------------------
wb_set_handler($mainwin, &quot;process_main&quot;);
wb_set_handler($mainwin, "process_main");
   wb_set_image($mainwin, &quot;uslogo.ico&quot;);  // Add logo  
   wb_set_image($mainwin, "uslogo.ico");  // Add logo  
&lt;/pre&gt;
</pre>


==== Test ====
==== Test ====
{|
{|
|-valign=&quot;top&quot;
|-valign="top"
|
|
* Run C:\us_wb\my_app\'''z_basic.bat'''
* Run C:\us_wb\my_app\'''z_basic.bat'''