git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.DevExpressVCL@7 05c56307-c608-d34a-929d-697000501d7a
113 lines
4.3 KiB
ObjectPascal
113 lines
4.3 KiB
ObjectPascal
{********************************************************************}
|
|
{ }
|
|
{ Developer Express Visual Component Library }
|
|
{ ExpressVerticalGrid }
|
|
{ }
|
|
{ Copyright (c) 1998-2006 Developer Express Inc. }
|
|
{ ALL RIGHTS RESERVED }
|
|
{ }
|
|
{ The entire contents of this file is protected by U.S. and }
|
|
{ International Copyright Laws. Unauthorized reproduction, }
|
|
{ reverse-engineering, and distribution of all or any portion of }
|
|
{ the code contained in this file is strictly prohibited and may }
|
|
{ result in severe civil and criminal penalties and will be }
|
|
{ prosecuted to the maximum extent possible under the law. }
|
|
{ }
|
|
{ RESTRICTIONS }
|
|
{ }
|
|
{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES }
|
|
{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE }
|
|
{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS }
|
|
{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL }
|
|
{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. }
|
|
{ }
|
|
{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED }
|
|
{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE }
|
|
{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE }
|
|
{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT }
|
|
{ AND PERMISSION FROM DEVELOPER EXPRESS INC. }
|
|
{ }
|
|
{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON }
|
|
{ ADDITIONAL RESTRICTIONS. }
|
|
{ }
|
|
{********************************************************************}
|
|
unit cxOIStringsEd;
|
|
|
|
{$I cxVer.inc}
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
|
StdCtrls, Buttons, ExtCtrls, cxLookAndFeels, cxLookAndFeelPainters,
|
|
cxButtons, cxControls, cxContainer, cxEdit, cxTextEdit, cxMemo, ComCtrls;
|
|
|
|
type
|
|
TcxfmStringsEditor = class(TForm)
|
|
pnlBottom: TPanel;
|
|
pnlBottomRight: TPanel;
|
|
pnlClient: TPanel;
|
|
GroupBox: TGroupBox;
|
|
pnlClientTop: TPanel;
|
|
Label1: TLabel;
|
|
pnlClientClient: TPanel;
|
|
Memo1: TcxMemo;
|
|
btnOK: TcxButton;
|
|
btnCancel: TcxButton;
|
|
StatusBar1: TStatusBar;
|
|
procedure Memo1PropertiesChange(Sender: TObject);
|
|
protected
|
|
procedure DoShow; override;
|
|
end;
|
|
|
|
PcxStringsEditorDlgData = ^TcxStringsEditorDlgData;
|
|
TcxStringsEditorDlgData = record
|
|
Caption: string;
|
|
LookAndFeel: TcxLookAndFeel;
|
|
Text: string;
|
|
end;
|
|
|
|
function cxShowStringsEditor(const AData: PcxStringsEditorDlgData): Boolean;
|
|
|
|
implementation
|
|
|
|
uses
|
|
cxClasses, cxVGridConsts;
|
|
|
|
{$R *.DFM}
|
|
|
|
function cxShowStringsEditor(const AData: PcxStringsEditorDlgData): Boolean;
|
|
var
|
|
Form: TcxfmStringsEditor;
|
|
begin
|
|
Form := TcxfmStringsEditor.Create(nil);
|
|
with Form do
|
|
try
|
|
Caption := AData.Caption;
|
|
Memo1.Text := AData.Text;
|
|
Memo1.Style.LookAndFeel.MasterLookAndFeel := AData.LookAndFeel;
|
|
btnOK.Caption := cxGetResourceString(@cxSvgOKCaption);
|
|
btnOK.LookAndFeel.MasterLookAndFeel := AData.LookAndFeel;
|
|
btnCancel.Caption := cxGetResourceString(@cxSvgCancelCaption);
|
|
btnCancel.LookAndFeel.MasterLookAndFeel := AData.LookAndFeel;
|
|
Result := Form.ShowModal = mrOK;
|
|
if Result then
|
|
AData^.Text := Memo1.Text;
|
|
finally
|
|
Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TcxfmStringsEditor.DoShow;
|
|
begin
|
|
inherited DoShow;
|
|
Memo1PropertiesChange(nil);
|
|
end;
|
|
|
|
procedure TcxfmStringsEditor.Memo1PropertiesChange(Sender: TObject);
|
|
begin
|
|
Label1.Caption := IntToStr(Memo1.InnerControl.Perform(EM_GETLINECOUNT, 0, 0)) + ' line(s)';
|
|
end;
|
|
|
|
end.
|