function create_classes_dlg($parent)
{
    global $wb, $classes_table;
    $nclasses = count($wb->classes);
    // Create window
    $pos = wb_get_position($parent);
    $width = 88;
    $height = 23 + 26 * ceil($nclasses / 3);
    $wb->classdlg = wb_create_window($parent, ToolDialog, "Controls", max(0, $pos[0] - $width), max(0, $pos[1]), $width, $height);
    wb_set_handler($wb->classdlg, "process_classes");
    // Create buttons, one for each control
    for ($i = 0; $i < $nclasses; $i++) {
        $const = "IDC_" . strtoupper($wb->classes[$i][1]);
        $c = wb_create_control($wb->classdlg, ImageButton, $wb->classes[$i][1], 4 + 25 * ($i % 3), 4 + 25 * (int) ($i / 3), 24, 24, constant($const), 0);
        $img = wb_load_image(PATH_RESPVT . "ctrl_{$wb->classes[$i][1]}3.bmp");
        wb_set_image($c, $img, 0, 0, 3);
        wb_destroy_image($img);
    }
}
function test_lists($window)
{
    // ListView
    $list = wb_get_control($window, IDC_LISTVIEW2027);
    wb_set_text($list, array(array("Home", 120), "Status", array("More", 50), array(0, 80)));
    wb_create_items($list, array(array("0", "First", "Done", "Less"), array(0, 0, "Second", "Hi"), array(200, 300, "Hi!", 876)));
    wb_set_text($list, array(444, 555, 666));
    //	wb_set_style($list, WBC_CHECKBOXES);
    wb_set_image($list, PATH_RES . "treeview.bmp", 0, GREEN, 10);
    //	wb_set_item_image($list, array(1, 1), 4);
    //	wb_delete_items($list, 0);
    wb_set_value($list, array(1, 2));
    wb_set_value($list, array(1, 3));
    //	wbtemp_set_listview_item_checked($list, 0, 1);
    // ListView II
    $list = wb_get_control($window, IDC_LISTVIEW2067);
    wb_set_text($list, array("No grid lines", "on this control!"));
    wb_create_items($list, array(array("To do this,", "set"), array("the control style", "to WS_BORDER")));
    // List boxes / combo boxes
    wb_set_text(wb_get_control($window, IDC_LISTBOX2018), "List 1\r\nOne more\rAnother\nEtc.\r\nMore...");
    wb_set_text(wb_get_control($window, IDC_COMBOBOX2010), array("Option 1", "Option 2", "More", "Etc."));
    wb_set_value(wb_get_control($window, IDC_UPDOWN2069), null, 0, 3);
    // Handler
    //	wb_set_handler($window, "process_test_lists");
}
示例#3
0
function create_main_window()
{
    global $wb;
    include PATH_FORM . "yc_contact.form.inc.php";
    $wb = new Wb();
    require_once PATH_CLASS . "ClientEnv.class.php";
    $wb->add_ip = getenv('REMOTE_ADDR');
    $wb->setting = parse_ini(file_get_contents(PATH_INI . SEETING_DAT));
    $wb->vars = parse_ini(file_get_contents(PATH_LANG . $wb->setting["Settings"]["lang_set"] . '.ini'));
    //zh-cn.ini
    include_once PATH_FORM . "yc_main.form.inc.php";
    include_once PATH_FORM . "yc_contact_search.form.inc.php";
    include_once PATH_FORM . "yc_contact_category_search.form.inc.php";
    //	db init
    $wb->db = new DB_Sql();
    $Host = $wb->setting["Settings"]["db_host"];
    $Database = $wb->setting["Settings"]["db_dbname"];
    $User = $wb->setting["Settings"]["db_username"];
    $Password = $wb->setting["Settings"]["db_password"];
    $wb->db->connect($Database, $Host, $User, $Password);
    $wb->right_control = null;
    $wb->del_ids = null;
    $wb->current_ids = null;
    $wb->current_form_state = true;
    $wb->current_module = "contact";
    $wb->current_action = "insert";
    displayContactForm();
    wb_set_image($wb->mainwin, PATH_RES . "favicon.ico");
    wb_set_handler($wb->mainwin, "process_main");
}
function create_cat_dlg($parent)
{
    // Remove the line below while not under development
    file_put_contents("dlg_cat.rc.php", "<?php\n\n" . parse_rc(file_get_contents(PATH_DATA . "dlg_cat.rc"), '$dlg', '$parent', 'ModalDialog') . "\n?>");
    include "dlg_cat.rc.php";
    wb_set_handler($dlg, "process_cat");
    wb_set_image(wb_get_control($dlg, ID_TREE), PATH_RES . "treeview.bmp", GREEN, 0, 10);
    wb_set_enabled(wb_get_control($dlg, ID_SETITEM), false);
    wb_set_enabled(wb_get_control($dlg, ID_DELETEITEM), false);
    update_cat_controls($dlg);
    update_tree($dlg);
    // Temporarily disabled
    wb_set_text($dlg, "Edit categories (TEMPORARILY DISABLED)");
}
function process_test_static($window, $id, $ctrl = 0, $lparam = 0)
{
    switch ($id) {
        case IDC_BUTTON5068:
            $ctrl = wb_get_control($window, IDC_STATIC5062);
            wb_set_image($ctrl, PATH_RES . "hyper.ico");
            wb_set_style($ctrl, 0, 2);
            //			wb_set_style($ctrl, 0x00020000, true);
            $ctrl = wb_get_control($window, IDC_STATIC5063);
            wb_set_image($ctrl, PATH_RES . "up_arrow.bmp", 0, GREEN);
            wb_set_style($ctrl, 0);
            //			wb_set_style($ctrl, 0x00000000, true);
            return true;
    }
    return false;
}
function create_form($parent, $title, $width, $height)
{
    global $wb;
    start_drawing_functions();
    // Create the form
    $wb->formwin = wb_create_window($parent, ResizableWindow, $title, 0, 0, $width, $height, WBC_INVISIBLE | WBC_CUSTOMDRAW | WBC_NOTIFY, WBC_REDRAW | WBC_RESIZE | WBC_MOUSEDOWN | WBC_MOUSEUP | WBC_MOUSEMOVE | WBC_DBLCLICK);
    // Remove unwanted window buttons
    $style = GetWindowStyle($wb->formwin);
    SetWindowStyle($wb->formwin, $style & ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
    EnableCloseButton($wb->formwin, false);
    // Set more window properties
    wb_set_area($wb->formwin, WBC_MINSIZE, 0, 0, 80, 60);
    wb_set_handler($wb->formwin, "process_form");
    wb_set_image($wb->formwin, PATH_RESPVT . "form.ico");
    // Initialize form data
    reset_form(DEFAULT_WINCLASS, $parent, $title, $width, $height);
}
示例#7
0
function create_main_window()
{
    global $wb, $langObj;
    $wb = new Wb();
    $wb->vars = parse_ini(file_get_contents(PATH_LANG . 'zh-cn.ini'));
    $wb->setting = parse_ini(file_get_contents(PATH_INI . 'system.dat'));
    include_once PATH_FORM . "YCRM.form.php";
    include_once PATH_CLASS . "db_mysql.php";
    //	db init
    $wb->db = new DB_Sql();
    $Host = $wb->setting["Settings"]["db_host"];
    $Database = $wb->setting["Settings"]["db_dbname"];
    $User = $wb->setting["Settings"]["db_username"];
    $Password = $wb->setting["Settings"]["db_password"];
    $wb->db->connect($Database, $Host, $User, $Password);
    //	$wb->current_page=1;
    // Create main menu
    $wb->mainmenu = wb_create_control($wb->mainwin, Menu, array("&File", array(ID_NEW, "&New project\tCtrl+N", "", PATH_RES . "menu_new.bmp", "Ctrl+N")));
    $wb->statusbar = wb_create_control($wb->mainwin, StatusBar, "");
    // Set minimum window size
    wb_set_image($wb->mainwin, "resource/favicon.ico");
    wb_set_handler($wb->mainwin, "process_main");
}
<?php

/**
 *
 * yc_main.form.inc.php
 *
 * @package    core
 * @author     John.meng <*****@*****.**>
 * @author     цот╤РШ
 * @author     QQ:3440895
 * @version    CVS: $Id: yc_main.form.inc.php,v 1.2 2006/12/24 01:17:28 arzen Exp $
 */
include_once PATH_FORM . "yc_main.form.php";
wb_set_image($wb->tree_view, PATH_RES . "treeview.bmp", GREEN, 0, 10);
$items = wb_create_items($wb->tree_view, array(array($wb->vars["Lang"]["lang_cust"] . $wb->vars["Lang"]["lang_manage"], 2001), array($wb->vars["Lang"]["lang_contact"], 2002, 1), array($wb->vars["Lang"]["lang_company"], 2003, 1), array($wb->vars["Lang"]["lang_product"], 2004, 1), array($wb->vars["Lang"]["lang_sale"] . $wb->vars["Lang"]["lang_manage"], 2005), array($wb->vars["Lang"]["lang_opportunity"], 2006, 1), array($wb->vars["Lang"]["lang_order"], 2007, 1), array($wb->vars["Lang"]["lang_agreement"], 2008, 1), array($wb->vars["Lang"]["lang_afterservice"] . $wb->vars["Lang"]["lang_manage"], 2009), array($wb->vars["Lang"]["lang_complaints"], 2010, 1), array($wb->vars["Lang"]["lang_refundment"], 2011, 1), array($wb->vars["Lang"]["lang_review"], 2012, 1)));
wb_set_state($wb->tree_view, $items[0], true);
wb_set_state($wb->tree_view, $items[4], true);
wb_set_state($wb->tree_view, $items[8], true);
wb_create_control($maintab, Frame, "", 464, 9, 1, 61, IDC_SHAPE5057, WBC_VISIBLE | WBC_ENABLED, 0, 2);
$_tmp_ctrl_ = wb_create_control($maintab, Frame, "dn_arrow.bmp", 4, 139, 112, 45, IDC_STATIC5062, WBC_VISIBLE | WBC_ENABLED | WBC_BORDER | WBC_IMAGE | WBC_CENTER, 0, 2);
wb_set_image($_tmp_ctrl_, 'C:\\@desenv\\WinBinder\\phpcode\\examples/../resources/dn_arrow.bmp', GREEN);
unset($_tmp_ctrl_);
wb_create_control($maintab, Label, "This text is centered.", 464, 79, 61, 35, IDC_STATIC5060, WBC_VISIBLE | WBC_ENABLED | WBC_CENTER, 0, 2);
wb_create_control($maintab, Label, "For a 'sunken' frame or label, use WinBinder style WBC_BORDER (WS_EX_STATICEDGE).", 4, 84, 181, 45, IDC_SHAPE5061, WBC_VISIBLE | WBC_ENABLED | WBC_BORDER | WBC_MULTILINE, 0, 2);
$_tmp_ctrl_ = wb_create_control($maintab, Frame, "hyper.ico", 124, 139, 112, 45, IDC_STATIC5063, WBC_VISIBLE | WBC_ENABLED | WBC_IMAGE | WBC_CENTER, 0, 2);
wb_set_image($_tmp_ctrl_, 'C:\\@desenv\\WinBinder\\phpcode\\examples/../resources/hyper.ico', GREEN);
unset($_tmp_ctrl_);
wb_create_control($maintab, Label, "This label control wraps words if they do not fit in the availble space.", 4, 195, 130, 45, IDC_SHAPE5065, WBC_VISIBLE | WBC_ENABLED | WBC_MULTILINE, 0, 2);
wb_create_control($maintab, Label, "This one does not wrap anything.", 139, 195, 151, 16, IDC_SHAPE5066, WBC_VISIBLE | WBC_ENABLED, 0, 2);
wb_create_control($maintab, Label, "This one uses ellipsis to display the text.", 139, 219, 110, 21, IDC_SHAPE5067, WBC_VISIBLE | WBC_ENABLED | WBC_ELLIPSIS, 0, 2);
wb_create_control($maintab, PushButton, "&Test", 364, 24, 76, 26, IDC_BUTTON5068, WBC_VISIBLE | WBC_ENABLED | WBC_BORDER, 0, 2);
wb_create_control($maintab, PushButton, "&Test", 280, 24, 76, 26, IDC_BUTTON5068, WBC_VISIBLE | WBC_ENABLED, 0, 2);
$_tmp_ctrl_ = wb_create_control($maintab, Frame, "up_arrow.bmp", 250, 134, 65, 50, IDC_STATIC5070, WBC_VISIBLE | WBC_ENABLED | WBC_IMAGE | WBC_CENTER, 0, 2);
wb_set_image($_tmp_ctrl_, 'C:\\@desenv\\WinBinder\\phpcode\\examples/../resources/up_arrow.bmp', GREEN);
unset($_tmp_ctrl_);
wb_create_control($maintab, Label, "This text is right-aligned.", 370, 79, 85, 35, IDC_STATIC5071, WBC_VISIBLE | WBC_ENABLED | WBC_RIGHT, 0, 2);
// End controls
// Control identifiers
if (!defined("IDD_DLG6001")) {
    define("IDD_DLG6001", 6001);
}
if (!defined("IDC_EDIT6002")) {
    define("IDC_EDIT6002", 6002);
}
if (!defined("ID_LOWLEVEL")) {
    define("ID_LOWLEVEL", 6003);
}
if (!defined("ID_RESETHANDLER")) {
    define("ID_RESETHANDLER", 6004);
if (!defined("ID_NAME")) {
    define("ID_NAME", 2113);
}
if (!defined("ID_NEWITEM")) {
    define("ID_NEWITEM", 2115);
}
if (!defined("ID_DELETEITEM")) {
    define("ID_DELETEITEM", 2116);
}
if (!defined("ID_SETITEM")) {
    define("ID_SETITEM", 2117);
}
if (!defined("ID_PRIORITYLIST")) {
    define("ID_PRIORITYLIST", 2112);
}
// Create window
$dlg = wb_create_window($parent, 103, "Edit Priorities", WBC_CENTER, WBC_CENTER, 337, 295, 0, 0);
// Insert controls
$_tmp_ctrl_ = wb_create_control($dlg, PushButton, "up_arrow.bmp", 178, 65, 20, 21, ID_MOVEUP, WBC_VISIBLE | WBC_ENABLED, 0);
wb_set_image($_tmp_ctrl_, 'C:\\@desenv\\WinBinder\\phpcode\\todo/../resources/up_arrow.bmp', GREEN);
unset($_tmp_ctrl_);
$_tmp_ctrl_ = wb_create_control($dlg, PushButton, "dn_arrow.bmp", 205, 65, 20, 21, ID_MOVEDOWN, WBC_VISIBLE | WBC_ENABLED, 0);
wb_set_image($_tmp_ctrl_, 'C:\\@desenv\\WinBinder\\phpcode\\todo/../resources/dn_arrow.bmp', GREEN);
unset($_tmp_ctrl_);
wb_create_control($dlg, EditBox, "", 178, 8, 146, 21, ID_NAME, WBC_VISIBLE | WBC_ENABLED, 0);
wb_create_control($dlg, PushButton, "&Close", 250, 238, 74, 24, IDCANCEL, WBC_VISIBLE | WBC_ENABLED, 0);
wb_create_control($dlg, PushButton, "&New", 4, 238, 74, 24, ID_NEWITEM, WBC_VISIBLE | WBC_ENABLED, 0);
wb_create_control($dlg, PushButton, "&Delete", 88, 238, 74, 24, ID_DELETEITEM, WBC_VISIBLE | WBC_ENABLED, 0);
wb_create_control($dlg, PushButton, "&Set", 169, 238, 74, 24, ID_SETITEM, WBC_VISIBLE | WBC_ENABLED, 0);
wb_create_control($dlg, ListBox, "", 4, 6, 166, 224, ID_PRIORITYLIST, WBC_VISIBLE | WBC_ENABLED, 0);
// End controls
wb_create_control($mainwin, PushButton, "Öмä", 10, 60, 50, 20, ID_BALCENTER);
wb_create_control($mainwin, PushButton, "Ñ­»·", 250, 40, 50, 20, ID_SURROUND);
// volumen and balance
wb_create_control($mainwin, Slider, "", 70, 40, 150, 20, ID_VOLUMEN);
wb_create_control($mainwin, Slider, "", 70, 60, 150, 20, ID_BALANCE);
wb_create_control($mainwin, Slider, "²¥·Å½ø¶È", 70, 100, 250, 20, ID_PLAY_POS);
wb_set_range(wb_get_control($mainwin, ID_VOLUMEN), 0, 255);
wb_set_value(wb_get_control($mainwin, ID_VOLUMEN), 255);
wb_set_range(wb_get_control($mainwin, ID_BALANCE), 0, 255);
wb_set_value(wb_get_control($mainwin, ID_BALANCE), 127);
wb_set_range(wb_get_control($mainwin, ID_PLAY_POS), 0, 100);
wb_set_value(wb_get_control($mainwin, ID_PLAY_POS), 0);
// timer
wb_create_timer($mainwin, ID_INFOTIMER, 1000);
// run application
wb_set_image($mainwin, "resource/musicm.ico");
wb_set_handler($mainwin, "process_main");
wb_main_loop();
//-------------------------------------------------------------- HANDLE PROCESS
function process_main($window, $id, $ctrl)
{
    global $statusbar, $fmod, $mainwin;
    switch ($id) {
        case ID_INFOTIMER:
            $status = "´ÅÅÌ: " . $fmod->fmod_GetOutputName() . " ";
            $status .= "¸èÇú³¤¶È: " . $fmod->fmod_GetLenght(true) . " ·ÖÖÓ ";
            $status .= "ÒѲ¥·Å: " . $fmod->fmod_Msec2Time($fmod->fmod_GetTime(true)) . " sec ";
            if ($song_name = $fmod->fmodStreamUrl) {
                $status .= "Ãû³Æ: {$song_name} ";
            }
            wb_set_text($statusbar, $status);
示例#12
0
$label_year = wb_create_control($mainwin, Label, date("Y年"), 102, 30, 50, 15, 0, WBC_CENTER);
wb_set_font($label_week, wb_create_font("Tahoma", 8));
wb_set_font($label_day, wb_create_font("Tahoma", 8));
wb_set_font($label_year, wb_create_font("Tahoma", 8));
// Create status bar
$top_bar = wb_create_control($mainwin, Label, "", 10, 2, 100, 10, 0, WBC_CENTER);
wb_set_font($top_bar, wb_create_font("Simsun", 8));
$foot_bar = wb_create_control($mainwin, Label, '', 0, 35, 100, 10, 0, WBC_CENTER);
wb_set_font($foot_bar, wb_create_font("Simsun", 8));
$statusbar = wb_create_control($mainwin, StatusBar, "");
wb_set_font($statusbar, wb_create_font("Simsun", 10));
// Create the timer
wb_create_timer($mainwin, ID_APP_TIMER, 500);
wb_create_timer($mainwin, ID_NEWS_TIMER, 30000);
// Enter application loop
wb_set_image($mainwin, "resource/time.ico");
wb_main_loop();
//-------------------------------------------------------------------- FUNCTIONS
/* Process main window commands */
function process_main($window, $id)
{
    global $label, $statusbar, $top_bar, $foot_bar, $news_str, $wb;
    static $pos, $top_pos, $foot_pos;
    $disks_str = "";
    $news_str = $wb->newscontent;
    //	if ((date("i")%3)==0)
    //	{
    //		$news_str="滚动新闻:".getNews ();
    //
    ////		$disks = explode(" ", wb_get_system_info("diskdrives"));
    ////		for ($index = 0; $index < sizeof($disks); $index++)
    define('IDC_HTMLCONTROL1019', 1019);
}
if (!defined('IDC_TREEVIEW1021')) {
    define('IDC_TREEVIEW1021', 1021);
}
if (!defined('IDC_LISTVIEW1022')) {
    define('IDC_LISTVIEW1022', 1022);
}
// Create window
$winmain = wb_create_window(null, AppWindow, '(Empty Form)', WBC_CENTER, WBC_CENTER, 593, 484, 0x1000, 1234);
// Insert controls
$tab = wb_create_control($winmain, TabControl, 'Tab1,Tab2,Tab3', 10, 215, 195, 85, IDC_TABCONTROL1020, 0x0, 0, 0);
wb_create_control($winmain, PushButton, 'PushButton1', 10, 15, 100, 25, IDC_PUSHBUTTON1001, 0x0, 0, 0);
$ctrl = $ctrl = wb_create_control($winmain, ImageButton, 'ImageButton2', 120, 15, 90, 60, IDC_IMAGEBUTTON1002, 0x0, 0, 0);
$img = wb_load_image('resources\\symb_imagebutton.bmp');
wb_set_image($ctrl, $img, NOCOLOR, 0, 0);
wb_destroy_image($img);
wb_create_control($winmain, InvisibleArea, 'InvisibleArea3', 220, 15, 70, 60, IDC_INVISIBLEAREA1003, 0x0, 0, 0);
wb_create_control($winmain, CheckBox, 'CheckBox4', 300, 20, 120, 15, IDC_CHECKBOX1004, 0x0, 0, 0);
wb_create_control($winmain, RadioButton, 'RadioButton5', 300, 40, 120, 15, IDC_RADIOBUTTON1005, 0x0, 0, 0);
wb_create_control($winmain, HyperLink, 'HyperLink6', 405, 25, 165, 15, IDC_HYPERLINK1006, 0x880, 12582912, 0);
wb_create_control($winmain, Label, 'Label7', 10, 50, 100, 15, 0, 0x0, 0, 0);
wb_create_control($winmain, EditBox, 'EditBox8', 220, 225, 200, 20, IDC_EDITBOX1008, 0x0, 0, 0);
wb_create_control($winmain, RTFEditBox, 'RTFEditBox9', 300, 65, 120, 140, IDC_RTFEDITBOX1009, 0x0, 0, 0);
wb_create_control($winmain, Frame, 'Frame10', 10, 75, 280, 130, 0, 0x0, 0, 0);
$ctrl = wb_create_control($winmain, ListBox, 'ListBox11', 25, 95, 120, 95, IDC_LISTBOX1011, 0x0, 0, 0);
wb_set_text($ctrl, explode(',', 'ListBox11'));
$ctrl = wb_create_control($winmain, ComboBox, 'ComboBox12', 155, 95, 120, 95, IDC_COMBOBOX1013, 0x0, 0, 0);
wb_set_text($ctrl, explode(',', 'ComboBox12'));
wb_create_control($winmain, Spinner, 'Spinner13', 440, 410, 20, 20, IDC_SPINNER1014, 0x0, 0, 0);
$ctrl = wb_create_control($winmain, ScrollBar, 'ScrollBar14', 435, 305, 140, 20, IDC_SCROLLBAR1015, 0x0, 0, 0);