[サンプルコード]
Form Form1 {
X = 0;
Y = 0;
Width = 400;
Height = 300;
FlexView FlexView1 {
X = 15;
Y = 15;
Width = 200;
Height = 90;
FlexRecord FlexRecord1 {
FlexLabel FlexLabel1 {
TitleHorzAlign = $CENTER;
TitleBgColor = $STD;
TitleFgColor = $STD;
Title = "氏名";
HorizontalAlign = $LEFT;
Width = 200;
Function OnTitleLClicked( e ) {
if( e.From.TitleMarker == $UPMARKER ){
^.^.Sort( 0, "d" );
e.From.TitleMarker = $DOWNMARKER;
}else{
^.^.Sort( 0, "a" );
e.From.TitleMarker = $UPMARKER;
}
/* フリガナでソートする場合
if( e.From.TitleMarker == $UPMARKER ){
^.^.Sort( 0, "d", "data" );
e.From.TitleMarker = $DOWNMARKER;
}else{
^.^.Sort( 0, "a", "data" );
e.From.TitleMarker = $UPMARKER;
}
*/
}
}
}
}
if ( !$DESIGNTIME ) {
FlexView1 << new CSVDocument << CSV( FlexLabel1.value,
FlexLabel1.data ){
"青木 一","アオキ ハジメ"
"青木 二郎","アオキ ジロウ"
"青木 三郎","アオキ サブロウ"
};
/* ソート */
FlexView1.Sort( 0, "a" );
/* △▽マークの設定 */
FlexView1.FlexRecord1.FlexLabel1.TitleMarker = $UPMARKER;
}
}
|