コード例 #1
1
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);
    }
}
コード例 #2
0
function draw_htmlcontrol($buffer, $caption, $xstart, $ystart, $width, $height, $style, $value)
{
    global $wb, $cl;
    if ($wb->wireframe || $wb->ghoststate) {
        draw_pushbutton($buffer, $caption, $xstart, $ystart, $width, $height, $style);
    } else {
        if ($style & WBC_BORDER) {
            draw_sunkenframe($buffer, "", $xstart, $ystart, $width, $height, $style, $value);
        } else {
            wb_draw_rect($buffer, $xstart, $ystart, $width, $height, $style & WBC_DISABLED ? $cl->disabled : $cl->edit, true);
        }
    }
    // Draw image
    if (!$wb->wireframe && !$wb->ghoststate) {
        // Bitmaps are loaded right here because initializing these bitmaps
        // in another place (like start_drawing_functions()) or as static
        // variables generates black bitmaps because of some bug in WinBinder!
        $image = wb_load_image(PATH_RESPVT . "draw_htmlcontrol.bmp");
        wb_draw_image($buffer, $image, $xstart + 2, $ystart + 2, $width - 20, $height - 4);
        wb_destroy_image($image);
    }
    draw_scrollbar($buffer, $caption, $xstart + $width - 19, $ystart + 1, 18, $height - 2, $style, $value);
}
コード例 #3
0
if (!defined('IDC_HTMLCONTROL1019')) {
    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);