当用户选择许多项目(标签)时,它们会按字母顺序自动排序.如何使用Select2 4.0防止自动排序并保持用户的订单?
更新:
提到的"可能的dublicate问题"是针对旧版本的Select2 v3 ...我问的是版本4 ...它与旧版本不同,并提到答案不能解决问题.
我有一个框架和一些控件(编辑,按钮等).如何拦截在帧控件上任意位置按ENTER键并转换为TAB键(考虑SHIFT状态)?
我已编码图像,并希望在我的程序中解码它们.图像解码基于Loren Pechtel的答案:图像文件在Stream中加载,解码,转换为MemoryStream,然后由TSynPicture类从MemoryStream加载.Delphi代码如下:
function loadEncodedImage(filename, keycode : string) : TBitmap;
syn : TSynPicture;
fs : TFileStream;
ms : TMemoryStream;
buf : AnsiString;
begin
result := nil;
try
fs := TFileStream.Create(filename, fmOpenRead);
SetLength( buf, fs.Size );
fs.ReadBuffer( buf[1], fs.Size );
// ....
// Here I decode data stored in buf and put it into buf again.
// ....
ms := TMemoryStream.Create();
ms.SetSize( fs.Size );
ms.WriteBuffer( buf[1], fs.Size );
syn := TSynPicture.Create();
syn.LoadFromStream( ms );
result := syn.ToBitmap;
finally …Run Code Online (Sandbox Code Playgroud) 我尝试使用TShape在TEdit字段周围绘制彩色边框.我定义了以下组件:
type TGEdit = class(TEdit)
private
m_shape : TShape;
protected
procedure setBorderColor( brd_col : TColor );
procedure setBorderWidth( brd_wid : integer );
public
constructor create(AOwner : TComponent); override;
destructor destroy(); override;
published
property borderColor : TColor read m_border_color write setBorderColor default clBlack;
property borderWidth : integer read m_border_width write setBorderWidth default 1;
end;
Run Code Online (Sandbox Code Playgroud)
在构造函数中定义TShape对象.
constructor TGEdit.create(AOwner : TComponent);
begin
inherited;
Self.BorderStyle:= bsNone;
m_border_color := clBlack;
m_border_width := 1;
m_shape := TShape.Create(AOwner);
m_shape.Parent := Self.Parent;
m_shape.Shape := stRectangle;
m_shape.Width := Self.Width+2*m_border_width; …Run Code Online (Sandbox Code Playgroud)