全球彩票平台_全球彩票注册平台|官网下载地址

热门关键词: 全球彩票平台,全球彩票注册平台,全球彩官网下载地址

【全球彩票注册平台】Delphi速选组件,封装组件

Delphi速选组件,delphi组件

{*******************************************************}
{                                                                             }
{       速选组件                                                       }
{                                                                            }
{       版权所有 (C) 2015.5 hbfan                           }
{                                                                            }
{*******************************************************}

unit FastSelect;


interface

uses
  Classes, Controls, StdCtrls, CheckLst;

type
  TFASTSELECT = class(TComponent)
  private
    FSelectAllRaiseObject: TwinControl;
    FSelectClearRaiseObject: TwinControl;
    FSelectionSource: TwinControl;
    FSelectReversedRaiseObject: TwinControl;
    procedure SetSelectAllRaiseObject(const Value: TwinControl);
    procedure SetSelectClearRaiseObject(const Value: TwinControl);
    procedure SetSelectReversedRaiseObject(const Value: TwinControl);

    { Private declarations }
  protected
    { Protected declarations }
  public
    { Public declarations }
     // 全选
     procedure OnSelectedAll(sender: Tobject);
     // 清空
     procedure OnSelectedClear(sender: Tobject);
  published
    { Published declarations }
    // 全选组件
    property SelectAllRaiseObject: TwinControl read FSelectAllRaiseObject write
        SetSelectAllRaiseObject;
    // 清空组件
    property SelectClearRaiseObject: TwinControl read FSelectClearRaiseObject write
        SetSelectClearRaiseObject;
    // 反选组件
    property SelectReversedRaiseObject: TwinControl read FSelectReversedRaiseObject
        write SetSelectReversedRaiseObject;
    // 数据源组件
    property SelectionSource: TwinControl read FSelectionSource write
        FSelectionSource;

  end;

procedure Register;

implementation
{$R *.dcr}

procedure Register;
begin
  RegisterComponents('hbfan', [TFastSelect]);
end;

procedure TFastSelect.OnSelectedAll(sender: Tobject);
var
   i: integer;
   FSourceListBox: TcheckListBox;
begin
  if FSelectionSource is TcheckListBox then
  begin
    FSourceListBox := (FselectionSource as TcheckListBox);
    for i := 0 to FSourceListBox.Count - 1 do
      FsourceListBox.Checked[i] := true;
  end;
end;

procedure TFastSelect.OnSelectedClear(sender: Tobject);
var
   i: integer;
   FSourceListBox: TcheckListBox;
begin
  if FSelectionSource is TcheckListBox then
  begin
    FSourceListBox := (FselectionSource as TcheckListBox);
    for i := 0 to FSourceListBox.Count - 1 do
      FsourceListBox.Checked[i] := false;
  end;
end;

procedure TFastSelect.SetSelectAllRaiseObject(const Value: TwinControl);
begin
  FSelectAllRaiseObject := Value;
  if Value is Tbutton then
  begin
    (value as Tbutton).Caption := '全选';
    (value as Tbutton).OnClick := OnSelectedAll;
  end;
end;

procedure TFastSelect.SetSelectClearRaiseObject(const Value: TwinControl);
begin
  FSelectClearRaiseObject := Value;                                                                                                                       
  if Value is Tbutton then
  begin
    (value as Tbutton).Caption := '清空';
    (value as Tbutton).OnClick := OnSelectedClear;
  end;
end;

procedure TFastSelect.SetSelectReversedRaiseObject(
  const Value: TwinControl);
begin
  FSelectReversedRaiseObject := Value;
  if Value is Tbutton then
  begin
    (value as Tbutton).Caption := '反选';
    (value as Tbutton).OnClick := OnSelectedReversed;
  end;
end;

end.

{*******************************************************}{ }{ 速选组件 }{ }{ 版权所有 (C) 二零一四.5 hbfan }{ }{******************************...

Delphi速选组件

{*******************************************************}
{                                                                             }
{       速选组件                                                       }
{                                                                            }
{       版权所有 (C) 2015.5 hbfan                           }
{                                                                            }
{*******************************************************}

unit FastSelect;


interface

uses
  Classes, Controls, StdCtrls, CheckLst;

type
  TFASTSELECT = class(TComponent)
  private
    FSelectAllRaiseObject: TwinControl;
    FSelectClearRaiseObject: TwinControl;
    FSelectionSource: TwinControl;
    FSelectReversedRaiseObject: TwinControl;
    procedure SetSelectAllRaiseObject(const Value: TwinControl);
    procedure SetSelectClearRaiseObject(const Value: TwinControl);
    procedure SetSelectReversedRaiseObject(const Value: TwinControl);

    { Private declarations }
  protected
    { Protected declarations }
  public
    { Public declarations }
     // 全选
     procedure OnSelectedAll(sender: Tobject);
     // 清空
     procedure OnSelectedClear(sender: Tobject);
  published
    { Published declarations }
    // 全选组件
    property SelectAllRaiseObject: TwinControl read FSelectAllRaiseObject write
        SetSelectAllRaiseObject;
    // 清空组件
    property SelectClearRaiseObject: TwinControl read FSelectClearRaiseObject write
        SetSelectClearRaiseObject;
    // 反选组件
    property SelectReversedRaiseObject: TwinControl read FSelectReversedRaiseObject
        write SetSelectReversedRaiseObject;
    // 数据源组件
    property SelectionSource: TwinControl read FSelectionSource write
        FSelectionSource;

  end;

procedure Register;

implementation
{$R *.dcr}

procedure Register;
begin
  RegisterComponents('hbfan', [TFastSelect]);
end;

procedure TFastSelect.OnSelectedAll(sender: Tobject);
var
   i: integer;
   FSourceListBox: TcheckListBox;
begin
  if FSelectionSource is TcheckListBox then
  begin
    FSourceListBox := (FselectionSource as TcheckListBox);
    for i := 0 to FSourceListBox.Count - 1 do
      FsourceListBox.Checked[i] := true;
  end;
end;

procedure TFastSelect.OnSelectedClear(sender: Tobject);
var
   i: integer;
   FSourceListBox: TcheckListBox;
begin
  if FSelectionSource is TcheckListBox then
  begin
    FSourceListBox := (FselectionSource as TcheckListBox);
    for i := 0 to FSourceListBox.Count - 1 do
      FsourceListBox.Checked[i] := false;
  end;
end;

procedure TFastSelect.SetSelectAllRaiseObject(const Value: TwinControl);
begin
  FSelectAllRaiseObject := Value;
  if Value is Tbutton then
  begin
    (value as Tbutton).Caption := '全选';
    (value as Tbutton).OnClick := OnSelectedAll;
  end;
end;

procedure TFastSelect.SetSelectClearRaiseObject(const Value: TwinControl);
begin
  FSelectClearRaiseObject := Value;                                                                                                                       
  if Value is Tbutton then
  begin
    (value as Tbutton).Caption := '清空';
    (value as Tbutton).OnClick := OnSelectedClear;
  end;
end;

procedure TFastSelect.SetSelectReversedRaiseObject(
  const Value: TwinControl);
begin
  FSelectReversedRaiseObject := Value;
  if Value is Tbutton then
  begin
    (value as Tbutton).Caption := '反选';
    (value as Tbutton).OnClick := OnSelectedReversed;
  end;
end;

end.

{*******************************************************}{ }{ 速选组件 }{ }{ 版权全部 (C) 二〇一四.5 hbfan }{ }{*********************************************...

环境:

Angular 4.0.0
Angular2 Material2 2.0.0-beta.3
node v7.4.0
npm 4.0.5

[Bootstrap]组件(三),bootstrap组件

输入框组

增多额外成分.input-group-addon

外包成分.input-group>input-group-addon form-control

<div class="input-group">
  额外元素
  <input type="text" class="form-control"/>
</div>

 

输入框组尺寸

控制类.input-group-*: .input-group-lg/.input-group-sm

<div class="input-group input-group-lg">
  额外元素
  <input type="text" class="form-control">
</div>

 

额外成分增加单选或多选

在附比索素中嵌套单选或多选按键成分

<div class="input-group">

    <input type="radio" />

  <input type="text" class="form-control" />
</div>

 

外新币素为按钮

额外按键类.input-group-btn

<div class="input-group">

     <button class="btn btn-default">额外元素按钮</button>

  <input type="text"class="form-control" />
</div>

 

额外元素为下拉开关菜单

.input-group-btn包涵下拉开关菜单成分(包罗触发器和下拉菜单)

<div class="input-group">
  <div class="input-group-btn">
    <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">button </button>
    <ul class="dropdown-menu">
      <li><a href="">item1</a></li>
      <li><a href="">item2</a></li>
    </ul>
  </div>
  <input type="text" class="form-control" />
</div>

 

外港成分为差距式开关下拉菜单

外日元素富含不相同式按钮下拉菜单(开关,触发器和下拉菜单)

<div class="input-group">
  <div class="input-group-btn">
    <button class="btn btn-default dropdown-toggle">button</button>
    <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"></button>
    <ul class="dropdown-menu">
     <li><a href="">item1</a></li>
     <li><a href="">item2</a></li>
     </ul>
  </div>
  <input type="text" class="form-control" />
</div>

 

导航

基类.nav  {padding-left/margin-bottom/list-style}

 

标签页导航

标签页类.nav-tabs  活动选项类.active 选项增加role="presentation"

<ul class="nav nav-tabs">
  <li role="presentation" class="active"><a href="#home">Home</a></li>
  <li role="presentation"><a href="#profile">Profile</a></li>
  <li role="presentation"><a href="#messages">Messages</a></li>
</ul>

 

胶囊式标签导航.nav-pills

<ul class="nav nav-pills">
  <li role="presentation" class="active"><a href="#home">Home</a></li>
  <li role="presentation"><a href="#profile">Profile</a></li>
  <li role="presentation"><a href="#messages">Messages</a></li>
</ul>

胶囊式标签导航(堆放状).nav-stacked

<ul class="nav nav-pills nav-stacked">
  <li role="presentation" class="active"><a href="#home">Home</a></li>
  <li role="presentation"><a href="#profile">Profile</a></li>
  <li role="presentation"><a href="#messages">Messages</a></li>
</ul>

 

剥夺的链接

 对选拔增多类.disabled

<ul class="nav nav-tabs">
  <li role="presentation" class="active"><a href="#">Home</a></li>
  <li role="presentation" class="disabled"><a href="#">Profile</a></li>
  <li role="presentation"><a href="#">Messages</a></li>
</ul>

 

口疮拉菜单的标签页面

在某二个接纳中加多下拉菜单组件

<ul class="nav nav-*">
  <li role="presentation" class="active"><a href="#">Home</a></li>
  <li role="presentation"><a href="#">Profile</a></li>
  <li role="presentation" class="dropdown">
    <a href="" class="dropdown-toggle" data-toggle="dropdown">
      Messages 
    </a>
    <ul class="dropdown-menu">
      <li>
        <a href="">item1</a>
        <a href="">item2</a>
      </li>
    </ul>
  </li>
</ul>

 

下拉领航页面

外包成分>{[导航ul(基类.nav+样式类.*s)>选项li(基本选项role="persentation"+下拉摘取)]+[选料对应内容]}

<div>
  <ul class="nav nav-*s" role="tablist">
    <li role="presentation" class="active"><a href="#item1" data-toggle="*">item1</a></li>
    <li role="presentation"><a href="#item2" data-toggle="*">item2</a></li>
    <li role="presentation"><a href="#item3" data-toggle="*">item3</a></li>
    <li role="presentation" class="dropdown">
      <a href="#" class="dropdown-toggle" data-toggle="dropdown">
          item4 
      </a>
      <ul class="dropdown-menu">
          <li><a href="#item4-1" data-toggle="*">item4-1</a></li>
          <li><a href="#item4-2" data-toggle="*">item4-2</a></li>
          <li><a href="#item4-3" data-toggle="*">item4-3</a></li>
        </ul>
      </li>
  </ul>

  <div class="tab-content">
    <div role="tabpanel" class="tab-pane active" id="item1">item1-content</div>
    <div role="tabpanel" class="tab-pane" id="item2">item2-content</div>
    <div role="tabpanel" class="tab-pane" id="item3">item3-content</div>
    <div role="tabpanel" class="tab-pane" id="item4-1">item4-1-content</div>
    <div role="tabpanel" class="tab-pane" id="item4-2">item4-2-content</div>
    <div role="tabpanel" class="tab-pane" id="item4-3">item4-3-content</div>
  </div>
</div>

 

输入框组 增加额外成分.input-group-addon 外包成分.input-groupinput-group-addon form-control div class ="input-group" span...

日前在整理了瞬间长满灰的尘印象笔记,发掘前面摘录的一篇作品:)

1.多选列表组件

React 是以整合组件的花样协会的,组件因为相互是互为独立的,从传递消息的剧情上看,

1)定义组件

差非常少具有品种的音讯都能够达成传递,比方字符串、数组、对象、方法或自定义组件等。所以,

multiple.component.ts
import { Component, OnInit, HostListener, Input } from '@angular/core';


@Component({
    selector: 'multiple',
    templateUrl: 'multiple.component.html',
    styleUrls: ['_multiple.component.scss']
})

export class MultipleComponent implements OnInit {

    @Input() items: any = {};
    @Input() colsTitle: any;
    @Input() keyArray: any;
    @Input() assignFilterItem: string;

    constructor() {
    }

    public ngOnInit() {
        this.keyArray = this.keyArray.split(",");
        this.colsTitle = this.colsTitle.split(",");
    }

    // 设置全选状态
    private setSelectedAll = function() {
        // 全选
        let data = this.items;
        let count = 0;
        for (let i in data) {
            if (data[i].checked) {
                count  ;
            }
        }

        if (count === data.length) {
            this.slideToggleModel = true;
        } else {
            this.slideToggleModel = false;
        }
    }

    // 选中,反选
    onToggle(item) {
        item.checked = !item.checked;

        this.setSelectedAll();
    }

    // 在已选项列表中取消选中
    cancleSelected(item) {
        item.checked = false;

        this.setSelectedAll();
    }

    // 全选
    selectAll(checked) {

        var data = this.items;

        if (checked) {
            for (var i in data) {
                data[i].checked = true;
            }
        } else {
            for (var i in data) {
                data[i].checked = false;
            }
        }
    }

}

在嵌套关系上,就会有 3 种不一样的大概:父组件向子组件通讯(最常见的点子)、子组件向父组件通讯和未有嵌套关系的机件之间通讯

multiple.component.html
<div class="clearfix">
    <div class="col-md-12">
        <md-input-container>
            <input mdInput placeholder="请键入筛选项..." value="" [(ngModel)]="searchText"></md-input-container>
    </div>

    <div class="col-md-12 multiple-data-list">
        <md-grid-list [cols]=colsTitle.length 1 rowHeight="35px">
            <md-grid-tile>
                <md-slide-toggle (change)="selectAll(slideToggleModel)" [(ngModel)]="slideToggleModel" [checked]="slideToggleModel">全选</md-slide-toggle>
            </md-grid-tile>
            <md-grid-tile class="text-center" *ngFor="let title of colsTitle">
                <h3>{{title}}</h3>
            </md-grid-tile>
            <div *ngFor="let item of items | searchTextFilter: [searchText, assignFilterItem]">
                <md-grid-tile>
                    <md-checkbox (change)="onToggle(item)" [checked]="item.checked"></md-checkbox>
                </md-grid-tile>
                <md-grid-tile *ngFor="let key of keyArray">{{item[key]}}</md-grid-tile>
            </div>
        </md-grid-list>
    </div>
    <div class="col-md-12">
        <h2 class="multiple-title">已选项</h2>
        <div class="multiple-selected">
            <div class="multiple-selected-item" *ngFor="let item of items">
                <md-chip *ngIf="item.checked" [selected]="item.checked"  class="chip-item" hover (click)="cancleSelected(item)">
                    {{item[assignFilterItem]}} <i class="icon-close-cyan selectedItem-close"></i>
                </md-chip>
            </div>
        </div>
    </div>
</div>

2)使用方法

在标签<multiple></multiple>设置相应属性

属性 描述
items 数据源
colsTitle string,列表的表头。eg. colsTitle="Title,Name"
keyArray string,列表的列项内容属性。eg. keyArray="title,name"
assignFilterItem <ol><li>string, searchText筛选的属性。<br />eg.数据源的属性为:title,name,number 假设输入searchText需要筛选的是Title,则assignFilterItem="title";</li><li>已选项展示的值,assignFilterItem="title", 即设置已选项展示的数据是title的值。</li></ol>

在用 React 在此之前的机件开拓方式时,平常必要接受组件运营时的情况,那时大家常用的点子

3)例子

有以下二种。

multiple-example.component.html
<multiple [items]="listData" colsTitle="Title" keyArray="title" assignFilterItem="title"></multiple>

1、利用回调函数:那是 JavaScript 灵活方便之处,那样就可以获得运维时景况。

本文由全球彩票平台发布于全球彩票注册平台编程,转载请注明出处:【全球彩票注册平台】Delphi速选组件,封装组件

TAG标签: 全球彩票平台
Ctrl+D 将本页面保存为书签,全面了解最新资讯,方便快捷。