function wb_create_control($parent, $class, $caption = "", $xpos = 0, $ypos = 0, $width = 0, $height = 0, $id = null, $style = 0, $lparam = null, $ntab = 0)
{
    switch ($class) {
        case Accel:
            return wbtemp_set_accel_table($parent, $caption);
        case ToolBar:
            return wbtemp_create_toolbar($parent, $caption, $width, $height, $lparam);
        case Menu:
            return wbtemp_create_menu($parent, $caption);
        case HyperLink:
            return wbtemp_create_control($parent, $class, $caption, $xpos, $ypos, $width, $height, $id, $style, is_null($lparam) ? NOCOLOR : $lparam, $ntab);
        default:
            return wbtemp_create_control($parent, $class, $caption, $xpos, $ypos, $width, $height, $id, $style, $lparam, $ntab);
    }
}
예제 #2
0
function wb_create_control($parent, $class, $caption = "", $xpos = 0, $ypos = 0, $width = 0, $height = 0, $id = null, $style = 0, $lparam = null, $ntab = 0)
{
    switch ($class) {
        case Accel:
            return wbtemp_set_accel_table($parent, $caption);
        case ToolBar:
            return wbtemp_create_toolbar($parent, $caption, $width, $height, $lparam);
        case Menu:
            return wbtemp_create_menu($parent, $caption);
        case HyperLink:
            return wbtemp_create_control($parent, $class, $caption, $xpos, $ypos, $width, $height, $id, $style, is_null($lparam) ? NOCOLOR : $lparam, $ntab);
        case ComboBox:
        case ListBox:
        case ListView:
            $ctrl = wbtemp_create_control($parent, $class, $caption, $xpos, $ypos, $width, $height, $id, $style, $lparam, $ntab);
            if (is_array($caption)) {
                wb_set_text($ctrl, $caption[0]);
            }
            return $ctrl;
        case TreeView:
            $ctrl = wbtemp_create_control($parent, $class, $caption, $xpos, $ypos, $width, $height, $id, $style, $lparam, $ntab);
            if (is_array($caption)) {
                wb_set_text($ctrl, $caption[0]);
            }
            return $ctrl;
        case Gauge:
        case Slider:
        case ScrollBar:
            $ctrl = wbtemp_create_control($parent, $class, $caption, $xpos, $ypos, $width, $height, $id, $style, $lparam, $ntab);
            if ($lparam) {
                wb_set_value($ctrl, $lparam);
            }
            return $ctrl;
        default:
            return wbtemp_create_control($parent, $class, $caption, $xpos, $ypos, $width, $height, $id, $style, $lparam, $ntab);
    }
}