TColorBox的Bug~~
现象:
TColorBox::Style属性加上cbCustomColor,运行后选择Custom...跳出颜色对话框~~
选择自定义颜色中未定义的一组,将抛出异常(Delphi6、Delphi7都有)~~
function TCustomColorBox.PickCustomColor: Boolean;
var
LColor: TColor;
begin
with TColorDialog.Create(nil) do
try
LColor := ColorToRGB(TColor(Items.Objects[0]));
Color := LColor;
CustomColors.Text := Format('ColorA=%.8x', [LColor]);
Result := Execute;
if Result then
begin
Items.Objects[0] := TObject(Color); //Color值为-1
Self.Invalidate;
end;
finally
Free;
end;
end;
原因:
function TCustomComboBoxStrings.GetObject(Index: Integer): TObject;
begin
Result := TObject(SendMessage(ComboBox.Handle, CB_GETITEMDATA, Index, 0));
if Longint(Result) = CB_ERR then //ComboBox获取Item的Data时-1正好是错误标识CB_ERR~
Error(SListIndexError, Index);
end;
TColorBox::Style属性加上cbCustomColor,运行后选择Custom...跳出颜色对话框~~
选择自定义颜色中未定义的一组,将抛出异常(Delphi6、Delphi7都有)~~
function TCustomColorBox.PickCustomColor: Boolean;
var
LColor: TColor;
begin
with TColorDialog.Create(nil) do
try
LColor := ColorToRGB(TColor(Items.Objects[0]));
Color := LColor;
CustomColors.Text := Format('ColorA=%.8x', [LColor]);
Result := Execute;
if Result then
begin
Items.Objects[0] := TObject(Color); //Color值为-1
Self.Invalidate;
end;
finally
Free;
end;
end;
原因:
function TCustomComboBoxStrings.GetObject(Index: Integer): TObject;
begin
Result := TObject(SendMessage(ComboBox.Handle, CB_GETITEMDATA, Index, 0));
if Longint(Result) = CB_ERR then //ComboBox获取Item的Data时-1正好是错误标识CB_ERR~
Error(SListIndexError, Index);
end;
...全文
相关推荐
poster_template:使用tcolorbox包的海报演示文稿的乳胶模板。 为了简化盒子的布局,删除了所有自动页边距,将海报分为100列,以使用纸张宽度的百分比进行盒子定位(在我的情况下,我到处都保持1%的页边距)。 颜色由Caroline Von Borm海报(http
poster_template 使用tcolorbox包的Latex模板。 为了简化框的位置,已删除所有自动页边距,并且系统地将海报系统分成100列,以使用纸张宽度的百分比。 颜色来自Caroline
pandoc-latex-admonition:用于在特定div或代码块元素上设置警告的pandoc过滤器
它使用tcolorbox LaTeX包生成警告,并使用脚注LaTeX包正确
c++绘图编程
- **示例代码**: ```cpp TColorBox* ColorBox = new TColorBox(); ColorBox->OnColorChange = OnColorChanged; `
探索LaTeX主题的多样性:定制文档外观的艺术
本文探讨了LaTeX中多种文档主题的使用与自定义方法,涵盖标准文档类、KOMA-Script、memoir及beamer等环境下的主题配置。通过引入xcolor、fontawesome和tcolorb
delphi7组件参考
**TColorBox组件**:TColorBox为用户提供颜色选择界面,可以设置不同的颜色样式,让用户方便地从下拉列表中选择颜色。


