mainwin = wb_create_window(NULL, AppWindow, APPNAME . " - PHP " . PHP_VERSION, 320, 240); wb_set_handler($wb->mainwin, "process_main"); wb_set_image($wb->mainwin, PATH_RES . "hyper.ico"); // Create menu wb_create_control($wb->mainwin, Menu, array( "&File", array(ID_OPEN, "&Open...\tCtrl+O", NULL, PATH_RES . "menu_open.bmp", "Ctrl+O"), null, // Separator array(IDCLOSE, "E&xit\tAlt+F4", NULL, PATH_RES . "menu_exit.bmp"), "&Help", array(ID_ABOUT, "&About...", NULL, PATH_RES . "menu_help.bmp") )); // Create toolbar wb_create_control($wb->mainwin, ToolBar, array( null, // Toolbar separator array(ID_OPEN, NULL, "Open a file", 1), null, // Toolbar separator array(ID_ABOUT, NULL, "About this application", 13), array(IDCLOSE, NULL, "Exit this application", 14), ), 0, 0, 16, 15, 0, 0, PATH_RES . "toolbar.bmp"); // Create status bar $wb->statusbar = wb_create_control($wb->mainwin, StatusBar, APPNAME); // Create label control inside the window wb_create_control($wb->mainwin, Label, "This is a demo 'Hello world'\n" . "application made with WinBinder.\n" . "It has a toolbar, a status bar and a menu.", 10, 70, 290, 80, 0, WBC_CENTER); } /* Process main window commands */ function process_main($window, $id) { global $wb; // Here is the global variable declaration switch($id) { case ID_ABOUT: wb_message_box($window, "WinBinder version " . WBC_VERSION . "\nPHP version " . PHP_VERSION . "\n" . wb_get_system_info("osversion"), "About " . APPNAME, WBC_INFO); break; case ID_OPEN: $wb->filename = wb_sys_dlg_open($window, "Get It", $wb->file_filter); if($wb->filename) wb_set_text($wb->statusbar, $wb->filename); break; case IDCLOSE: // IDCLOSE is predefined wb_destroy_window($window); break; } } //------------------------------------------------------------------ END OF FILE ?>