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 create_project_dlg($parent) { global $wb; include "fe_project.form.php"; // Read various settings foreach ($wb->project_array as $var) { $var = strtolower($var); $ctrl = wb_get_control($wb->winproject, constant("IDC_" . strtoupper($var))); if (preg_match("/[\\d\\.\\,]+/", $wb->form[$wb->currentform]->{$var})) { wb_set_value($ctrl, $wb->form[$wb->currentform]->{$var}); } else { if (wb_get_class($ctrl) != RadioButton && wb_get_class($ctrl) != CheckBox) { wb_set_text($ctrl, $wb->form[$wb->currentform]->{$var}); } } } // Disable / enable controls according to context wb_set_enabled(wb_get_control($wb->winproject, IDC_LOCPREFIX), wb_get_value(wb_get_control($wb->winproject, IDC_LOCALIZE))); $val = wb_get_value(wb_get_control($wb->winproject, IDC_ISTABPAGE)); wb_set_enabled(wb_get_control($wb->winproject, IDC_TABNUMBER), $val); wb_set_enabled(wb_get_control($wb->winproject, IDC_TABNUMBERSPINNER), $val); $hastext = wb_get_text(wb_get_control($wb->winproject, IDC_CTRLVAR)) !== ''; wb_set_enabled(wb_get_control($wb->winproject, IDC_STARTCTRLVAL), $hastext); wb_set_handler($wb->winproject, "process_project"); wb_set_visible($wb->winproject, true); set_default_accel($wb->winproject, false); }
/** * * yc_contact_search.form.inc.php. * * @package core * @author John.meng <*****@*****.**> * @author цот╤РШ * @author QQ:3440895 * @version CVS: $Id: yc_contact_category_search.form.inc.php,v 1.1 2006/12/20 04:49:59 arzen Exp $ */ function create_category_contact_search_dlg($parent) { global $wb; include PATH_FORM . "yc_contact_category_search.form.php"; wb_set_handler($wb->contact_search, "process_contact_category_search"); wb_set_visible($wb->contact_search, true); }
/** * * yc_about.form.inc.php * * @package core * @author John.meng <*****@*****.**> * @author цот╤РШ * @author QQ:3440895 * @version CVS: $Id: yc_about.form.inc.php,v 1.1 2006/12/24 01:17:28 arzen Exp $ */ function display_about_dlg() { global $wb; include PATH_FORM . "yc_about.form.php"; wb_set_visible($winmain, true); wb_set_handler($winmain, "process_about"); }
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"); }
/** * * yc_order_category_search.form.inc.php. * * @package core * @author John.meng <*****@*****.**> * @author цот╤РШ * @author QQ:3440895 * @version CVS: $Id: yc_order_category_search.form.inc.php,v 1.1 2006/12/24 11:46:48 arzen Exp $ */ function create_order_category_search_dlg() { global $wb; include PATH_FORM . "yc_order_category_search.form.php"; wb_set_handler($search_form, "process_order_category_search"); wb_set_visible($search_form, true); }
/** * * yc_agreement_search.form.inc.php. * * @package core * @author John.meng <*****@*****.**> * @author цот╤РШ * @author QQ:3440895 * @version CVS: $Id: yc_agreement_search.form.inc.php,v 1.1 2006/12/24 11:46:48 arzen Exp $ */ function create_agreement_search_dlg() { global $wb; include PATH_FORM . "yc_agreement_search.form.php"; wb_set_handler($search_form, "process_agreement_search"); wb_set_visible($search_form, true); }
/** * * yc_contact_search.form.inc.php. * * @package core * @author John.meng <*****@*****.**> * @author цот╤РШ * @author QQ:3440895 * @version CVS: $Id: yc_contact_search.form.inc.php,v 1.2 2006/12/20 04:49:59 arzen Exp $ */ function create_contact_search_dlg($parent) { global $wb; include PATH_FORM . "yc_contact_search.form.php"; wb_set_handler($wb->contact_search, "process_contact_search"); wb_set_visible($wb->contact_search, true); // set_default_accel($wb->contact_search, false); }
function dummy_callback($window, $id) { switch ($id) { case ID_RESETHANDLER: wb_set_text(wb_get_control($window, IDC_EDIT6002), "Resetting window handler..."); wb_set_handler($window, "process_main"); break; } }
/** * * yc_company.form.inc.php * * @package core * @author John.meng <*****@*****.**> * @author цот╤РШ * @author QQ:3440895 * @version CVS: $Id: yc_company.form.inc.php,v 1.7 2006/12/25 05:36:38 arzen Exp $ */ function displayCompanyMainTabForm() { global $wb; include PATH_FORM . "yc_company.form.php"; $wb->right_control = $maintab = $tab; include PATH_FORM . "yc_company_tab.form.php"; $wb->current_page = 1; $wb->total_page = 1; wb_set_text(wb_get_control($maintab, IDC_COMPANY_LIST), array(array($wb->vars["Lang"]["lang_id"], 60), array($wb->vars["Lang"]["lang_name"], 150), array($wb->vars["Lang"]["lang_linkman"], 100), array($wb->vars["Lang"]["lang_phone"], 100), array($wb->vars["Lang"]["lang_email"], 180), array($wb->vars["Lang"]["lang_addrees"], 200))); reset_company_view(); wb_set_handler($wb->right_control, "process_company"); }
/** * * yc_opportunity.form.inc.php * * @package core * @author John.meng <*****@*****.**> * @author цот╤РШ * @author QQ:3440895 * @version CVS: $Id: yc_opportunity.form.inc.php,v 1.3 2006/12/25 05:36:38 arzen Exp $ */ function display_opportunity_main_tab_form() { global $wb; include PATH_FORM . "yc_opportunity.form.php"; $wb->right_control = $maintab = $tab; include PATH_FORM . "yc_opportunity_tab.form.php"; $wb->current_page = 1; $wb->total_page = 1; wb_set_text(wb_get_control($maintab, IDC_OPPORTUNITY_LIST), array(array($wb->vars["Lang"]["lang_id"], 60), array($wb->vars["Lang"]["lang_title"], 150), array($wb->vars["Lang"]["lang_linkman"], 100), array($wb->vars["Lang"]["lang_phone"], 100), array($wb->vars["Lang"]["lang_state"], 60), array($wb->vars["Lang"]["lang_addrees"], 200))); reset_opportunity_view(); wb_set_handler($wb->right_control, "process_opportunity"); }
/** * * yc_review.form.inc.php * * @package core * @author John.meng <*****@*****.**> * @author цот╤РШ * @author QQ:3440895 * @version CVS: $Id: yc_review.form.inc.php,v 1.6 2006/12/26 05:13:25 arzen Exp $ */ function display_review_main_tab_form() { global $wb; include PATH_FORM . "yc_review.form.php"; $wb->right_control = $maintab = $tab; include PATH_FORM . "yc_review_tab.form.php"; $wb->current_page = 1; $wb->total_page = 1; wb_set_text(wb_get_control($maintab, IDC_REVIEW_LIST), array(array($wb->vars["Lang"]["lang_id"], 60), array($wb->vars["Lang"]["lang_company"], 150), array($wb->vars["Lang"]["lang_linkman"], 100), array($wb->vars["Lang"]["lang_reviewdate"], 150), array($wb->vars["Lang"]["lang_category"], 60), array($wb->vars["Lang"]["lang_createdat"], 150))); reset_review_view(); wb_set_handler($wb->right_control, "process_review"); }
function create_prior_dlg($parent) { global $prior_table; // Remove the line below while not under development file_put_contents("dlg_prior.rc.php", "<?php\n\n" . parse_rc(file_get_contents(PATH_DATA . "dlg_prior.rc"), '$dlg', '$parent', 'ModalDialog') . "\n?>"); include "dlg_prior.rc.php"; wb_set_handler($dlg, "process_prior"); $prior_table = "priority"; wb_set_enabled(wb_get_control($dlg, ID_SETITEM), false); wb_set_enabled(wb_get_control($dlg, ID_DELETEITEM), false); update_prior_controls($dlg); update_priors($dlg); }
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)"); }
/** * * yc_about.form.inc.php * * @package core * @author John.meng <*****@*****.**> * @author цот╤РШ * @author QQ:3440895 * @version CVS: $Id: yc_setting.form.inc.php,v 1.4 2006/12/25 12:37:27 arzen Exp $ */ function display_setting_dlg() { global $wb; include PATH_FORM . "yc_setting.form.php"; wb_set_text(wb_get_control($winmain, IDC_DB_HOST), $wb->setting["Settings"]["db_host"]); wb_set_text(wb_get_control($winmain, IDC_DB_USERNAME), $wb->setting["Settings"]["db_username"]); wb_set_text(wb_get_control($winmain, IDC_DB_PASSWORD), $wb->setting["Settings"]["db_password"]); wb_set_text(wb_get_control($winmain, IDC_DB_NAME), $wb->setting["Settings"]["db_dbname"]); include PATH_CONFIG . "common.php"; $items = array_values($LangOption); wb_set_text(wb_get_control($winmain, IDC_LANGUAGE), $items); wb_set_text(wb_get_control($winmain, IDC_LANGUAGE), $LangOption[$wb->setting["Settings"]["lang_set"]]); // wb_set_selected(wb_get_control($winmain, IDC_LANGUAGE),$LangOption[$wb->setting["Settings"]["lang_set"]]); wb_set_visible($winmain, true); wb_set_handler($winmain, "process_setting"); }
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); }
function displayContactForm() { global $wb; include PATH_FORM . "yc_contact.form.php"; if (empty($wb->current_page)) { $wb->current_page = 1; $wb->total_page = 1; $wb->current_category_page = 1; $wb->total_category_page = 1; } wb_set_text($wb->contact_list, array(array($wb->vars["Lang"]["lang_id"], 60), array($wb->vars["Lang"]["lang_name"], 150), array($wb->vars["Lang"]["lang_gender"], 40), array($wb->vars["Lang"]["lang_phone"], 100), array($wb->vars["Lang"]["lang_mobile"], 100), array($wb->vars["Lang"]["lang_email"], 180), array($wb->vars["Lang"]["lang_addrees"], 200))); reset_contact_view(); // Create Category ListView header wb_set_text($wb->contact_category_list, array(array($wb->vars["Lang"]["lang_id"], 100), array($wb->vars["Lang"]["lang_category"] . $wb->vars["Lang"]["lang_name"], 220), array($wb->vars["Lang"]["lang_state"], 140))); reset_contact_category_view(); wb_set_handler($wb->right_control, "process_contact"); }
/** * * yc_company.form.inc.php * * @package core * @author John.meng <*****@*****.**> * @author цот╤РШ * @author QQ:3440895 * @version CVS: $Id: yc_product.form.inc.php,v 1.5 2006/12/25 05:36:38 arzen Exp $ */ function display_product_main_tab_form() { global $wb; include PATH_FORM . "yc_product.form.php"; $wb->right_control = $maintab = $tab; include PATH_FORM . "yc_product_tab.form.php"; include PATH_FORM . "yc_product_category_tab.form.php"; $wb->current_page = 1; $wb->total_page = 1; $wb->current_category_page = 1; $wb->total_category_page = 1; wb_set_text(wb_get_control($maintab, IDC_PRODUCT_LIST), array(array($wb->vars["Lang"]["lang_id"], 60), array($wb->vars["Lang"]["lang_name"], 150), array($wb->vars["Lang"]["lang_price"], 100))); reset_product_view(); // category header define wb_set_text(wb_get_control($maintab, IDC_PRODUCT_CATEGORY_LIST), array(array($wb->vars["Lang"]["lang_id"], 100), array($wb->vars["Lang"]["lang_category"] . $wb->vars["Lang"]["lang_name"], 220), array($wb->vars["Lang"]["lang_state"], 140))); reset_product_category_view(); // wb_set_handler($wb->right_control, "process_product"); }
/** * * yc_refundment.form.inc.php * * @package core * @author John.meng <*****@*****.**> * @author цот╤РШ * @author QQ:3440895 * @version CVS: $Id: yc_refundment.form.inc.php,v 1.5 2006/12/26 05:13:25 arzen Exp $ */ function display_refundment_main_tab_form() { global $wb; include PATH_FORM . "yc_refundment.form.php"; $wb->right_control = $maintab = $tab; include PATH_FORM . "yc_refundment_tab.form.php"; include PATH_FORM . "yc_refundment_category_tab.form.php"; $wb->current_page = 1; $wb->total_page = 1; $wb->current_category_page = 1; $wb->total_category_page = 1; wb_set_text(wb_get_control($maintab, IDC_REFUNDMENT_LIST), array(array($wb->vars["Lang"]["lang_id"], 60), array($wb->vars["Lang"]["lang_category"], 60), array($wb->vars["Lang"]["lang_company"], 80), array($wb->vars["Lang"]["lang_refundmenter"], 60), array($wb->vars["Lang"]["lang_reasons"], 140), array($wb->vars["Lang"]["lang_reply"], 40), array($wb->vars["Lang"]["lang_state"], 60), array($wb->vars["Lang"]["lang_userid"], 60), array($wb->vars["Lang"]["lang_createdat"], 140))); reset_refundment_view(); // category header define wb_set_text(wb_get_control($maintab, IDC_REFUNDMENT_CATEGORY_LIST), array(array($wb->vars["Lang"]["lang_id"], 100), array($wb->vars["Lang"]["lang_category"] . $wb->vars["Lang"]["lang_name"], 220))); reset_refundment_category_view(); // wb_set_handler($wb->right_control, "process_refundment"); }
/** * * yc_agreement.form.inc.php * * @package core * @author John.meng <*****@*****.**> * @author цот╤РШ * @author QQ:3440895 * @version CVS: $Id: yc_agreement.form.inc.php,v 1.3 2006/12/25 05:36:38 arzen Exp $ */ function display_agreement_main_tab_form() { global $wb; include PATH_FORM . "yc_agreement.form.php"; $wb->right_control = $maintab = $tab; include PATH_FORM . "yc_agreement_tab.form.php"; include PATH_FORM . "yc_agreement_category_tab.form.php"; $wb->current_page = 1; $wb->total_page = 1; $wb->current_category_page = 1; $wb->total_category_page = 1; wb_set_text(wb_get_control($maintab, IDC_AGREEMENT_LIST), array(array($wb->vars["Lang"]["lang_id"], 60), array($wb->vars["Lang"]["lang_noid"], 80), array($wb->vars["Lang"]["lang_category"], 60), array($wb->vars["Lang"]["lang_effectdate"], 140), array($wb->vars["Lang"]["lang_expireddate"], 140), array($wb->vars["Lang"]["lang_buyer"], 140), array($wb->vars["Lang"]["lang_vender"], 140), array($wb->vars["Lang"]["lang_buyersignature"], 80), array($wb->vars["Lang"]["lang_vendersignature"], 80), array($wb->vars["Lang"]["lang_userid"], 60), array($wb->vars["Lang"]["lang_createdat"], 140))); reset_agreement_view(); // category header define wb_set_text(wb_get_control($maintab, IDC_AGREEMENT_CATEGORY_LIST), array(array($wb->vars["Lang"]["lang_id"], 100), array($wb->vars["Lang"]["lang_category"] . $wb->vars["Lang"]["lang_name"], 220), array($wb->vars["Lang"]["lang_state"], 140))); reset_agreement_category_view(); // wb_set_handler($wb->right_control, "process_agreement"); }
/** * * yc_order.form.inc.php * * @package core * @author John.meng <*****@*****.**> * @author цот╤РШ * @author QQ:3440895 * @version CVS: $Id: yc_order.form.inc.php,v 1.3 2006/12/25 05:36:38 arzen Exp $ */ function display_order_main_tab_form() { global $wb; include PATH_FORM . "yc_order.form.php"; $wb->right_control = $maintab = $tab; include PATH_FORM . "yc_order_tab.form.php"; include PATH_FORM . "yc_order_category_tab.form.php"; $wb->current_page = 1; $wb->total_page = 1; $wb->current_category_page = 1; $wb->total_category_page = 1; wb_set_text(wb_get_control($maintab, IDC_ORDER_LIST), array(array($wb->vars["Lang"]["lang_id"], 60), array($wb->vars["Lang"]["lang_noid"], 80), array($wb->vars["Lang"]["lang_category"], 60), array($wb->vars["Lang"]["lang_contactid"], 80), array($wb->vars["Lang"]["lang_amount"], 60), array($wb->vars["Lang"]["lang_money"], 100), array($wb->vars["Lang"]["lang_discount"], 60), array($wb->vars["Lang"]["lang_deliverydatetime"], 140), array($wb->vars["Lang"]["lang_state"], 80), array($wb->vars["Lang"]["lang_userid"], 60), array($wb->vars["Lang"]["lang_createdat"], 140))); reset_order_view(); // category header define wb_set_text(wb_get_control($maintab, IDC_ORDER_CATEGORY_LIST), array(array($wb->vars["Lang"]["lang_id"], 100), array($wb->vars["Lang"]["lang_category"] . $wb->vars["Lang"]["lang_name"], 220), array($wb->vars["Lang"]["lang_state"], 140))); reset_order_category_view(); // wb_set_handler($wb->right_control, "process_order"); }
function create_contact_edit_dlg() { global $wb; include PATH_FORM . "yc_contact_edit.form.php"; //-------- view detail ------- if ($id = $wb->current_ids) { getContactByID($winmain, $id); // wb_message_box($wb->mainwin,$id);//implode(",",$all_ctrl) } if ($wb->current_action == "insert") { wb_set_enabled(wb_get_control($winmain, IDC_CONTACT_SAVE), true); wb_set_enabled(wb_get_control($winmain, IDC_CONTACT_UPDATE), false); } else { wb_set_enabled(wb_get_control($winmain, IDC_CONTACT_SAVE), false); wb_set_enabled(wb_get_control($winmain, IDC_CONTACT_UPDATE), true); } wb_set_handler($winmain, "process_contact_edit"); wb_set_visible($winmain, true); }
function create_edit_dlg($parent, $id, $cat = null) { global $id_edit, $curr_cat; $id_edit = $id; $curr_cat = $cat; // Remove the line below while not under development file_put_contents("dlg_item.rc.php", "<?php\n\n" . parse_rc(file_get_contents(PATH_DATA . "dlg_item.rc"), '$dlg', '$parent', 'ModalDialog', null, WBC_CENTER, WBC_CENTER, WBC_CENTER, WBC_CENTER, 'WBC_INVISIBLE') . "\n?>"); include "dlg_item.rc.php"; wb_set_handler($dlg, "process_item"); wb_set_text($dlg, $id ? "Edit item #{$id}" : "Create new item"); // Fill up the lists $item_data = db_get_data("cat", null, array("name")); wb_set_text(wb_get_control($dlg, ID_CATLIST), $item_data); $item_data = db_get_data("priority", null, array("name")); wb_set_text(wb_get_control($dlg, ID_PRIORLIST), $item_data); $item_data = db_get_data("severity", null, array("name")); wb_set_text(wb_get_control($dlg, ID_SEVERLIST), $item_data); update_item_controls($dlg); wb_set_visible($dlg, true); }
function create_refundment_edit_dlg() { global $wb; include PATH_FORM . "yc_refundment_edit.form.php"; wb_set_text(wb_get_control($winmain, IDC_REFUNDMENT_HANDLEDATE), date("0000-00-00 00:00:00")); //-------- view detail ------- if ($id = $wb->current_ids) { get_refundment_by_id($winmain, $id); // wb_message_box($wb->mainwin,$id);//implode(",",$all_ctrl) } if ($wb->current_action == "insert") { wb_set_enabled(wb_get_control($winmain, IDC_SAVE), true); wb_set_enabled(wb_get_control($winmain, IDC_UPDATE), false); } else { wb_set_enabled(wb_get_control($winmain, IDC_SAVE), false); wb_set_enabled(wb_get_control($winmain, IDC_UPDATE), true); } wb_set_handler($winmain, "process_refundment_edit"); wb_set_visible($winmain, true); }
function create_options_dlg($parent) { global $wb; include "fe_options.form.php"; // Read various settings foreach ($wb->options_array as $var) { $var = strtolower($var); $ctrl = wb_get_control($wb->winoptions, constant("IDC_" . strtoupper($var))); if (preg_match("/[\\d\\.\\,]+/", $wb->{$var})) { wb_set_value($ctrl, $wb->{$var}); } else { if (wb_get_class($ctrl) != RadioButton && wb_get_class($ctrl) != CheckBox) { wb_set_text($ctrl, $wb->{$var}); } } } wb_set_handler($wb->winoptions, "process_options"); wb_set_visible($wb->winoptions, true); set_default_accel($wb->winoptions, false); }
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"); }
function create_review_edit_dlg() { global $wb; include PATH_FORM . "yc_review_edit.form.php"; include PATH_CONFIG . "common.php"; $items = array_values($ReviewwayOption); wb_set_text(wb_get_control($winmain, IDC_REVIEW_CATEGORY), $items); wb_set_text(wb_get_control($winmain, IDC_REVIEW_REVIEWDATE), date("Y-m-d H:i:s")); // wb_set_visible (wb_get_control($winmain, IDC_REVIEW_CALENDAR), false); //-------- view detail ------- if ($id = $wb->current_ids) { get_review_by_id($winmain, $id); // wb_message_box($wb->mainwin,$id);//implode(",",$all_ctrl) } if ($wb->current_action == "insert") { wb_set_enabled(wb_get_control($winmain, IDC_SAVE), true); wb_set_enabled(wb_get_control($winmain, IDC_UPDATE), false); } else { wb_set_enabled(wb_get_control($winmain, IDC_SAVE), false); wb_set_enabled(wb_get_control($winmain, IDC_UPDATE), true); } wb_set_handler($winmain, "process_review_edit"); wb_set_visible($winmain, true); }
//------------------------------------------------------------ SYSTEM PARAMETERS define("PATH_SCRIPT", dirname(__FILE__) . "/"); define("PATH_DATA", PATH_SCRIPT); define("PATH_INC", PATH_SCRIPT . "include/"); define("PATH_RES", PATH_SCRIPT . "resources/"); //----------------------------------------------------------------- DEPENDENCIES include_once "include/winbinder.php"; //-------------------------------------------------------------------- CONSTANTS define("APPNAME", "MP3"); // Application name // Control identifiers define("ID_OPEN", 101); //-------------------------------------------------------------- EXECUTABLE CODE // Create main window, then assign a procedure and an icon to it $mainwin = wb_create_window(NULL, AppWindow, APPNAME, 220, 100); wb_set_handler($mainwin, "process_main"); // Create menu wb_create_control($mainwin, Menu, array("&File", array(ID_OPEN, "&Open...\tCtrl+O", NULL, NULL, "Ctrl+O"), null, array(IDCLOSE, "E&xit\tAlt+F4", NULL, NULL, "Alt+F4"))); // Enter application loop wb_main_loop(); //-------------------------------------------------------------------- FUNCTIONS /* Process main window commands */ function process_main($window, $id) { // Try to load the multimedia dll $winmmlib = wb_load_library("winmm"); $mciSendString = wb_get_function_address("mciSendString", $winmmlib); static $file_filter = array(array("MP3 file", "*.mp3")); switch ($id) { case ID_OPEN: $filename = wb_sys_dlg_open($window, "Get It", $file_filter);
function renderCategoryForm($p_ctl) { global $wb; // navigator $dim = wb_get_size($p_ctl, true); $form_y = $dim[1] - 280 + 30; $form_x = 20; $search_frame = wb_create_control($p_ctl, Frame, $wb->vars["Lang"]["lang_search"], $form_x, $form_y, $dim[0] - 120, 40, 0, WBC_VISIBLE, 0, 1); $this->category_keyword = wb_create_control($search_frame, EditBox, "", 50, 15, 150, 21, IDC_CATEGORY_KEYWORD, WBC_VISIBLE | WBC_ENABLED, 0, 1); $category_nav_last = wb_create_control($search_frame, PushButton, $wb->vars["Lang"]["lang_search"], 220, 15, 80, 22, IDC_CATEGORY_SEARCH_SUBMIT, WBC_VISIBLE, 0, 1); wb_set_handler($search_frame, "process_main"); // detail form $detail_frame = wb_create_control($p_ctl, Frame, $wb->vars["Lang"]["lang_detail"], $form_x, $form_y + 40, $dim[0] - 120, 120, 0, WBC_VISIBLE, 0, 1); wb_create_control($detail_frame, Label, $wb->vars["Lang"]["lang_category"] . $wb->vars["Lang"]["lang_name"], 60, 15, 150, 14, 0, WBC_VISIBLE, 0, 1); $this->category_name = wb_create_control($detail_frame, EditBox, "", 120, 15, 150, 21, IDC_CATEGORY_KEYWORD, WBC_VISIBLE | WBC_ENABLED, 0, 1); // Group A include_once PATH_CONFIG . 'common.php'; $i = 0; foreach ($ActiveOption as $key => $value) { $this->category_active = wb_create_control($detail_frame, RadioButton, $key, 80 + $i * 70, 40, 70, 14, IDC_CATEGORY_ACTIVE, 0, 0); $i++; } wb_create_control($detail_frame, PushButton, $wb->vars["Lang"]["lang_new"], 130, 80, 90, 25, IDC_CATEGORY_SUBMIT, 0x0, 0, 0); wb_set_handler($detail_frame, "process_main"); }
function wb_gotWindow($Timer = 0, $Title = 'Привет! :)', $Text = array(), $Wdth = 220, $Rate = 0.75, $X = null, $Y = null) { //© roxblnfk ;) $wid = WB_FloatWindow; // window id $Wa = explode(' ', wb_get_system_info('workarea')); $W = intval(max($Wdth, 200)); $H = 150; WinAPI_USER::GetCursorPos($xx, $yy); if (is_array($Text)) { if (($j = count($Text)) > 5) { $H = 50 + $j * 20; } } else { $H = 200; } if (!isset($X)) { $X = $Wa[2] - $W; } elseif ($X === true) { $X = $xx; } if (!isset($Y)) { $Y = $Wa[3] - $H; } elseif ($Y === true) { $Y = $yy; } if (isset(self::$wb_windows[$wid])) { $NEW = false; /* if(wb_get_visible(self::$wb_windows[$wid])) wb_destroy_timer(self::$wb_windows[$wid],WB_FloatWindow_Timer); else wb_set_visible(self::$wb_windows[$wid],true); wb_set_position(self::$wb_windows[$wid],$X,$Y); wb_set_size(self::$wb_windows[$wid], $W, $H); wb_set_size(self::$wb_controls[$wid][WB_FloatWindow_Title],$W-4,20); wb_set_text(self::$wb_controls[$wid][WB_FloatWindow_Title],$Title); wb_set_position(self::$wb_controls[$wid][WB_FloatWindow_Title],2,2); */ $keys = array_keys(self::$wb_controls[$wid][WB_FloatWindow_Labels]); for ($i = 0, $j = count($keys); $i < $j; $i++) { wb_destroy_control(self::$wb_controls[$wid][WB_FloatWindow_Labels][$keys[$i]]); unset(self::$wb_controls[$wid][WB_FloatWindow_Labels][$keys[$i]]); // if(isset(self::$wb_controls[$wid][СКЕТЧ ЦЕННОСТЬ][$keys[$i]])){ // wb_destroy_control(self::$wb_controls[$wid][СКЕТЧ ЦЕННОСТЬ][$keys[$i]]); // unset(self::$wb_controls[$wid][СКЕТЧ ЦЕННОСТЬ][$keys[$i]]); // } } } else { $NEW = true; self::$wb_windows[$wid] = wb_create_window(null, NakedWindow, "ololo", $X, $Y, $W, $H, WBC_NOTIFY, WBC_MOUSEUP); //wb_set_visible(self::$wb_windows[$wid], false); //alert(self::$wb_windows[$wid]); self::$wb_controls[$wid] = array(); self::$wb_controls[$wid][WB_FloatWindow_Title] = wb_create_control(self::$wb_windows[$wid], Label, $Title, 2, 2, $W - 4, 20, WB_FloatWindow_Title, WBC_CENTER, 0, 0); } /* if(is_array($Text)){ $keys=array_keys($Text); $l1=intval(($W-15)*$Rate); for($i=0,$j=count($keys);$i<$j;$i++){ $k=$keys[$i]; if(!is_array($Text[$k]))$Text[$k]=array($Text[$k]); if(count($Text[$k])>=2){ self::$wb_controls[$wid][WB_FloatWindow_Labels][$i]= wb_create_control(self::$wb_windows[$wid],Label,$Text[$k][0],10,30+$i*20,$l1,20,0,WBC_RIGHT,0,0); // self::$wb_controls[$wid][СКЕТЧ ЦЕННОСТЬ][$i]= wb_create_control(self::$wb_windows[$wid],Label,$Text[$k][1],15+$l1,30+$i*20,$W-20-$l1,20,0,WBC_LEFT,0,0); continue; }else{ $Text[$k]=reset($Text[$k]); self::$wb_controls[$wid][WB_FloatWindow_Labels][$i]= wb_create_control(self::$wb_windows[$wid],Label,strval($Text[$k]),10,30+$i*20,$W-15,20,0,WBC_CENTER,0,0); } } }else self::$wb_controls[$wid][WB_FloatWindow_Labels][0]= wb_create_control(self::$wb_windows[$wid],RTFEditBox,strval($Text),2,25,$W-4,$H-40,WB_FloatWindow_Labels,WBC_READONLY,0,0); //*/ if ($Timer < 100) { $Timer = intval(2147483640); } wb_create_timer(self::$wb_windows[$wid], WB_FloatWindow_Timer, $Timer); if ($NEW) { self::$wb_controls[$wid][WB_FloatWindow_Font] = wb_create_font('Calibri', 12, BLACK, FTA_BOLD); wb_set_font(self::$wb_controls[$wid][WB_FloatWindow_Title], self::$wb_controls[$wid][WB_FloatWindow_Font]); wb_set_handler(self::$wb_windows[$wid], 'dsSpy::wb_procWindow'); } wb_set_size(self::$wb_windows[$wid], WBC_NORMAL); //self::showWindow(self::$wb_windows[$wid],500); //WinAPI_USER::CloseWindow(wb_get_id(self::$wb_windows[$wid])); }