月度存档: 8 月 2015

Styling in HaxeUI

原文链接:http://haxecoder.com/post.php?id=74
参考资源:http://www.openfl.org/learn/
There are several ways to style components in HaxeUI.

Fortunately, HaxeUI tries to follow the convenient CSS + HTML pattern so if you’re familiar with those, you’ll have no problem grasping this concept quickly.

You can style controls in code by accessing and setting values to the properties of their “style” property directly. This is the most obvious but the least convenient way to change the appearance of a component, so let’s jump right into the CSS approach.

You can create CSS descriptions using the static StyleManager class, add them to the layout XML in a “style” node, or store them in a separate CSS file and load that.

To add a style description in code, use the StyleManager.instance.addStyle() method.

Selectors follow the usual CSS syntax, so you can access all components of the type Button and apply the style to them. For example:

StyleManager.instance.addStyle(“Button”, new Style({
color: 0xFF0000,
fontSize: 20,
}));
HaxeUI styling
If you want to style an individual control with a specific ID, use the # selector:

StyleManager.instance.addStyle(“#myButton”, new Style({
color: 0xFF0000,
fontSize: 20,
}));
HaxeUI styling
Similarly to the “class” attribute in HTML, you can apply styles to components using the “styleName” attribute.

yii2_study18_rbac权限控制1

1.数据库添加对应表:
[code]
drop table if exists `auth_assignment`;
drop table if exists `auth_item_child`;
drop table if exists `auth_item`;
drop table if exists `auth_rule`;

create table `auth_rule`
(
`name` varchar(64) not null,
`data` text,
`created_at` integer,
`updated_at` integer, primary key (`name`)
) engine InnoDB;

create table `auth_item`
(
`name` varchar(64) not null,
`type` integer not null,
`description` text,
`rule_name` varchar(64),
`data` text,
`created_at` integer,
`updated_at` integer,
primary key (`name`),
foreign key (`rule_name`) references `auth_rule` (`name`) on delete set null on update cascade,
key `type` (`type`)
) engine InnoDB;

create table `auth_item_child`
(
`parent` varchar(64) not null,
`child` varchar(64) not null,
primary key (`parent`, `child`),
foreign key (`parent`) references `auth_item` (`name`) on delete cascade on update cascade,
foreign key (`child`) references `auth_item` (`name`) on delete cascade on update cascade
) engine InnoDB;

create table `auth_assignment`
(
`item_name` varchar(64) not null,
`user_id` varchar(64) not null,
`created_at` integer,
primary key (`item_name`, `user_id`),
foreign key (`item_name`) references `auth_item` (`name`) on delete cascade on update cascade
) engine InnoDB;
[/code]

2.auth_item表添加三个记录,create-company,1;create-branch,1;admin,1
auth_assignment 添加2个记录 admin,1;create-branch,2
auth_item_child添加2个记录 admin,create-company;admin,create-branch

lampp 命令控制

/opt/lampp/lampp stopftp 停止ftp服务

vb_study_1

[code]
Sub test() ‘定义一个执行函数
Range("a:d").Clear
Range("a1").Value = "id"
Range("b1").Value = "score"
Range("c1").Value = "及格否"
Range("d1").Value = "等级"

Dim i, st As Integer ‘声明变量i,st,’代表注释

For i = 2 To 10 ‘for循环
Range("a" & i).Value = i – 1
Range("b" & i).Value = "=randbetween(0,100)"
Next ‘for循环结束

‘录制宏:复制b列,然后黏贴123,即可去掉randbetween,避免=的时候每次自动执行换数
Range("B2:B10").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

For i = 2 To 10
st = st + Range("b" & i).Value ‘&相当于+连接符

If Range("b" & i).Value >= 60 Then
Range("c" & i).Value = "pass"
Else
Range("c" & i).Value = "fail"
End If

’相当于c语言中的switch…case…
Select Case Range("b" & i).Value
Case Is > 90
Range("d" & i).Value = "A"
Case 60 To 90
Range("d" & i).Value = "B"
Case Else
Range("d" & i).Value = "C"
End Select

Next
Range("b11").Value = "total:" & st

End Sub

][/code]