You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

591 lines
17 KiB
Plaintext

11 months ago
unit u_info_shareDoc;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, dxExEdtr, DB, ADODB, StdCtrls, ComCtrls, DBCtrls, Mask,shellapi,
dxDBGrid, ExtCtrls, bsSkinCtrls, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl,
dxCntner, ImgList, ToolWin, ActnList;
type
Tfrm_info_shareDoc = class(TForm)
Panel1: TPanel;
bsSkinButton7: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinButton8: TbsSkinButton;
bsSkinPanel1: TbsSkinPanel;
Splitter1: TSplitter;
dxDBGrid2: TdxDBGrid;
dxDBGrid2fid: TdxDBGridMaskColumn;
dxDBGrid2rl_id: TdxDBGridMaskColumn;
dxDBGrid2Column3: TdxDBGridColumn;
dxDBGrid2Column4: TdxDBGridColumn;
dxDBGrid2Column5: TdxDBGridColumn;
dxDBGrid2Column6: TdxDBGridDateColumn;
dxDBGrid2Column7: TdxDBGridColumn;
dxDBGrid2Column8: TdxDBGridColumn;
bsSkinPanel2: TbsSkinPanel;
Label1: TLabel;
DBEdit1: TDBEdit;
Editor: TDBRichEdit;
bsSkinPanel3: TbsSkinPanel;
bsSkinButton2: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinButton11: TbsSkinButton;
bsSkinButton10: TbsSkinButton;
t_info_sharedoc: TADOQuery;
t_info_sharedoc1: TDataSource;
qrytmp: TADOQuery;
t_info_file: TADOQuery;
dsrFuJian: TDataSource;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
DBEdit2: TDBEdit;
Label2: TLabel;
bsSkinPanel4: TbsSkinPanel;
dxDBGrid1: TdxDBGrid;
dxDBGrid1sc_id: TdxDBGridMaskColumn;
dxDBGrid1Column6: TdxDBGridColumn;
dxDBGrid1Column2: TdxDBGridColumn;
dxDBGrid1Column4: TdxDBGridColumn;
dxDBGrid1Column5: TdxDBGridColumn;
bsSkinPanel5: TbsSkinPanel;
Edit1: TEdit;
Label3: TLabel;
bsSkinButton12: TbsSkinButton;
bsSkinPanel6: TbsSkinPanel;
ToolbarImages: TImageList;
ActionList1: TActionList;
ActionList2: TActionList;
EditUndoCmd: TAction;
EditCutCmd: TAction;
EditCopyCmd: TAction;
EditPasteCmd: TAction;
EditFontCmd: TAction;
OpenDialog: TOpenDialog;
FontDialog1: TFontDialog;
SaveDialog: TSaveDialog;
bsSkinSpeedButton1: TbsSkinSpeedButton;
FontName: TComboBox;
FontSize: TEdit;
UpDown1: TUpDown;
bsSkinSpeedButton2: TbsSkinSpeedButton;
bsSkinSpeedButton3: TbsSkinSpeedButton;
LeftAlign: TbsSkinSpeedButton;
CenterAlign: TbsSkinSpeedButton;
RightAlign: TbsSkinSpeedButton;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton7Click(Sender: TObject);
procedure bsSkinButton6Click(Sender: TObject);
procedure bsSkinButton8Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure t_info_sharedocAfterInsert(DataSet: TDataSet);
procedure t_info_sharedocBeforePost(DataSet: TDataSet);
procedure t_info_sharedocBeforeEdit(DataSet: TDataSet);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure FormResize(Sender: TObject);
procedure DBEdit1KeyPress(Sender: TObject; var Key: Char);
procedure dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinButton11Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure t_info_fileBeforeEdit(DataSet: TDataSet);
procedure dxDBGrid2Exit(Sender: TObject);
procedure bsSkinButton12Click(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
procedure FileNewCmdExecute(Sender: TObject);
procedure bsSkinSpeedButton1Click(Sender: TObject);
procedure bsSkinSpeedButton2Click(Sender: TObject);
procedure bsSkinSpeedButton3Click(Sender: TObject);
procedure FontNameChange(Sender: TObject);
procedure FontSizeChange(Sender: TObject);
procedure LeftAlignClick(Sender: TObject);
procedure EditorSelectionChange(Sender: TObject);
private
FUpdating:boolean;
{ Private declarations }
procedure UpLoadPro(fname:string); //fname<6D><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
procedure DownLoadPro(fname:string); //<2F><><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
function CurrText: TTextAttributes;
procedure GetFontNames;
public
{ Public declarations }
end;
var
frm_info_shareDoc: Tfrm_info_shareDoc;
implementation
{$R *.dfm}
uses u_main, my_sys_function,u_sys_progress;
function EnumFontsProc(var LogFont: TLogFont; var TextMetric: TTextMetric;
FontType: Integer; Data: Pointer): Integer; stdcall;
begin
TStrings(Data).Add(LogFont.lfFaceName);
Result := 1;
end;
procedure Tfrm_info_shareDoc.GetFontNames;
var
DC: HDC;
begin
DC := GetDC(0);
EnumFonts(DC, nil, @EnumFontsProc, Pointer(FontName.Items));
ReleaseDC(0, DC);
FontName.Sorted := True;
end;
procedure Tfrm_info_shareDoc.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
frm_info_shareDoc.Hide;
frm_info_shareDoc.ManualFloat(frm_info_shareDoc.BoundsRect );
frm_main.freeTabs('frm_info_shareDoc');
action:=cafree;
frm_info_shareDoc:=nil;
end;
procedure Tfrm_info_shareDoc.FormShow(Sender: TObject);
begin
with t_info_shareDoc,sql do
begin
close ;clear ;
add('select * from t_info_sharedoc ');
add('where ¼<><C2BC><EFBFBD><EFBFBD>='+''''+employee+''' or ') ;
add(open_data('9005','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no')) ;
add(' order by ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ');
Open;
end ;
t_info_file.Open ;
GetFontNames;
end;
procedure Tfrm_info_shareDoc.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_info_shareDoc.bsSkinButton7Click(Sender: TObject);
begin
table_Prior(t_info_shareDoc);
end;
procedure Tfrm_info_shareDoc.bsSkinButton6Click(Sender: TObject);
begin
table_next(t_info_shareDoc);
end;
procedure Tfrm_info_shareDoc.bsSkinButton8Click(Sender: TObject);
begin
table_post(t_info_shareDoc);
if t_info_file.State in [dsedit,dsinsert] then t_info_file.post ;
end;
procedure Tfrm_info_shareDoc.bsSkinButton4Click(Sender: TObject);
begin
if not if_open('247') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
if do_data('9005',t_info_sharedoc.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring,'','','','','')=false then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩɾ<C8A8><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>');
abort;
end;
if t_info_shareDoc.isempty then
exit;
if application.MessageBox('<27><>ȷ<EFBFBD><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?','<27><><EFBFBD><EFBFBD>:',MB_OKCANCEL)=IDOK then
begin
with qrytmp,sql do //ɾ<><C9BE><EFBFBD>ӱ<EFBFBD>
begin
close ; clear ;
add('delete from t_info_sharedoc_file where sc_id=:scid');
parameters.ParamByName('scid').Value:=t_info_sharedoc.fieldbyname('sc_id').value ;
execsql ;
end ;
t_info_sharedoc.delete;
end ;
end;
procedure Tfrm_info_shareDoc.bsSkinButton3Click(Sender: TObject);
begin
table_cancel(t_info_sharedoc);
end;
procedure Tfrm_info_shareDoc.bsSkinButton1Click(Sender: TObject);
begin
if not if_open('245') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
t_info_sharedoc.insert;
end;
procedure Tfrm_info_shareDoc.t_info_sharedocAfterInsert(DataSet: TDataSet);
begin
t_info_sharedoc['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
t_info_sharedoc['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
DBEdit1.SetFocus;
end;
procedure Tfrm_info_shareDoc.t_info_sharedocBeforePost(DataSet: TDataSet);
begin
table_before_post(t_info_sharedoc,'<27>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_info_sharedoc,'<27><><EFBFBD><EFBFBD>');
end;
procedure Tfrm_info_shareDoc.t_info_sharedocBeforeEdit(DataSet: TDataSet);
begin
if do_data('9005',t_info_sharedoc.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring,'','','','','')=false then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>޸ģ<DEB8><C4A3><EFBFBD>');
abort;
end;
end;
procedure Tfrm_info_shareDoc.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
CanClose:=close_query(t_info_sharedoc);
end;
procedure Tfrm_info_shareDoc.FormResize(Sender: TObject);
var
i:integer;
begin
i:=round(panel1.Width/7);
bsSkinButton7.Width:=i;
bsSkinButton8.Width:=i;
bsSkinButton6.Width:=i;
bsSkinButton1.Width:=i;
bsSkinButton4.Width:=i;
bsSkinButton3.Width:=i;
DBEdit1.Width:=bsSkinPanel2.Width-DBEdit1.Left-6;
end;
procedure Tfrm_info_shareDoc.DBEdit1KeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key:=#0;
Editor.SetFocus;
end;
end;
procedure Tfrm_info_shareDoc.dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort(Column,t_info_sharedoc,'¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_info_shareDoc.DownLoadPro(fname: string);
const
MaxBufSize=$F000;
var
myfilename:string;//<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
myfileStream,exeBlobStream:TStream;
Count,BufSize,N: Integer;
Buffer:PChar;
begin
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress:=tfrm_sys_progress.Create(self);
frm_sys_progress.bsSkinGauge1.ProgressText:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱥ򡣡<C8BA><F2A1A3A1><EFBFBD>';
frm_sys_progress.Show;
frm_sys_progress.Update;
myfilename:=FName ;
with t_info_file do
begin
myfilename:=myfilename ; //+fieldbyname('<27><><EFBFBD><EFBFBD>').asstring ;
myfileStream :=TFileStream.Create(myfilename,fmCreate);//<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
try //SaveToStream(Stream);
ExeBlobStream:=CreateBlobStream(FieldByName('<27><><EFBFBD><EFBFBD>'),bmRead); //<2F><><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD>ȡ<EFBFBD>ü<EFBFBD>¼
Count:=0;
try
if Count=0 then
begin
ExeBlobStream.Position:=0;
Count:=ExeBlobStream.Size;//showmessage(inttostr(count));
end;
if Count>MaxBufSize then BufSize:=MaxBufSize else BufSize:=Count;
GetMem(Buffer,BufSize);
frm_sys_progress.bsSkinGauge1.MaxValue:=(Count div BufSize)+2;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
try
while Count<>0 do
begin
if Count>BufSize then N:=BufSize else N:=Count;
ExeBlobStream.ReadBuffer(Buffer^,N);//<2F><><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
MyFileStream.WriteBuffer(Buffer^,N);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>ļ<EFBFBD>
Dec(Count,N);
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
end;
finally
FreeMem(Buffer,BufSize);
end;
finally
ExeBlobStream.Free;
end;
finally
myfileStream.Free;
end;
end;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
frm_sys_progress.close;
frm_sys_progress:=nil;
end;
procedure Tfrm_info_shareDoc.UpLoadPro(fname: string);
const
BufSize=$F000;
var
Counter, N: Integer;
Buffer: PAnsiChar;
FieldStrm: TStream;
ExeFileStream:TFileStream;
size_tmp: Double;
filename,fileExt:string ;
begin
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress:=tfrm_sys_progress.Create(self);
frm_sys_progress.bsSkinGauge1.ProgressText:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱥ򡣡<C8BA><F2A1A3A1><EFBFBD>';
frm_sys_progress.Show;
frm_sys_progress.Update;
filename:=ExtractFileName(fname) ;
fileExt:=ExtractFileExt(filename) ;
with t_info_file do
begin
Open;
append;
try
ExeFileStream:=TFileStream.Create(fname,fmopenRead); //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
FieldStrm := CreateBlobStream(FieldByName('<27><><EFBFBD><EFBFBD>'),bmWrite);
GetMem(Buffer,BufSize);
try
Counter := ExeFileStream.Size;
size_tmp :=ExeFileStream.Size;
frm_sys_progress.bsSkinGauge1.MaxValue:=(Counter div BufSize)+2;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
while Counter<>0 do
begin
if Counter>BufSize then N :=BufSize else N:=Counter;
ExeFileStream.ReadBuffer(Buffer^,N);
FieldStrm.WriteBuffer(Buffer^, N);
Dec(Counter, N);
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
// Application.ProcessMessages;
end;
finally
FreeMem(Buffer,BufSize);
FieldStrm.Free;
end;
FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=filename;
FieldByName('<27><>С').AsFloat:=size_tmp;
FieldByName('<27>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>').AsDateTime:=now();
FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asstring:=employee;
FieldByName('<27><><EFBFBD><EFBFBD>').Asstring:=fileExt;
Post;
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!','<27><>ʾ',MB_OK+MB_IconInformation);
finally
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
frm_sys_progress.close;
frm_sys_progress:=nil;
ExeFileStream.Free;
end;
end;
end;
procedure Tfrm_info_shareDoc.bsSkinButton2Click(Sender: TObject);
begin
if not if_open('245') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
if t_info_sharedoc.State in [dsedit,dsinsert] then t_info_sharedoc.Post ;
if t_info_sharedoc.FieldByName('<27>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD>').asstring='' then
begin
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD>ƣ<EFBFBD>');
exit ;
end ;
if OpenDialog1.Execute then UpLoadPro(Opendialog1.FileName)
else exit ;
end;
procedure Tfrm_info_shareDoc.bsSkinButton9Click(Sender: TObject);
begin
if SaveDialog1.Execute then
DownLoadPro(Savedialog1.FileName+t_info_file.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)
else exit ;
end;
procedure Tfrm_info_shareDoc.bsSkinButton11Click(Sender: TObject);
var
arr: array[0..MAX_PATH] of Char;
num: DWORD;
tmpfile:string ;
begin
try
GetTempPath(MAX_PATH, arr);
tmpfile:=arr+t_info_file.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring ;
DownLoadPro(tmpfile) ;
ShellExecute(Handle, nil, pchar(tmpfile), nil, nil, SW_NORMAL);
except
showmessage('<27><><EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵȴ<D3B5><C8B4><EFBFBD><EFBFBD><EFBFBD>');
end ;
end;
procedure Tfrm_info_shareDoc.bsSkinButton10Click(Sender: TObject);
begin
if not if_open('247') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
if do_data('9005',t_info_file.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'','','','','')=false then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩɾ<C8A8><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>');
abort;
end;
if t_info_sharedoc.State in [dsedit,dsinsert] then t_info_sharedoc.post ;
if application.MessageBox('<27><>ȷ<EFBFBD><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?','<27><><EFBFBD><EFBFBD>:',MB_OKCANCEL)=IDOK then
t_info_file.delete ;
end;
procedure Tfrm_info_shareDoc.t_info_fileBeforeEdit(DataSet: TDataSet);
begin
if t_info_file.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring<>employee then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߣ<EFBFBD><DFA3><EFBFBD>Ȩ<EFBFBD>޸ģ<DEB8>');
abort ;
end ;
end;
procedure Tfrm_info_shareDoc.dxDBGrid2Exit(Sender: TObject);
begin
if t_info_file.state in [dsedit,dsinsert] then t_info_file.post ;
end;
procedure Tfrm_info_shareDoc.bsSkinButton12Click(Sender: TObject);
begin
with t_info_shareDoc,sql do
begin
close ;clear ;
add('select * from t_info_sharedoc ');
add('where 1=1 and ') ;
if trim(edit1.text)<>'' then begin
add(' <20>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD> like ''%'+edit1.text+'%''and ') ;
end;
add(open_data('9005','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no')) ;
add(' order by ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ');
Open;
end ;
t_info_file.Open ;
end;
procedure Tfrm_info_shareDoc.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if Key=#13 then
bsSkinButton12.OnClick(Sender);
end;
function Tfrm_info_shareDoc.CurrText: TTextAttributes;
begin
if Editor.SelLength > 0 then Result := Editor.SelAttributes
else Result := Editor.DefAttributes;
end;
procedure Tfrm_info_shareDoc.FileNewCmdExecute(Sender: TObject);
begin
Editor.Lines.Clear;
end;
procedure Tfrm_info_shareDoc.bsSkinSpeedButton1Click(Sender: TObject);
begin
if fsBold in Editor.SelAttributes.Style then
CurrText.Style := CurrText.Style - [fsBold]
else
CurrText.Style := CurrText.Style + [fsBold];
end;
procedure Tfrm_info_shareDoc.bsSkinSpeedButton2Click(Sender: TObject);
begin
if fsItalic in Editor.SelAttributes.Style then
CurrText.Style := CurrText.Style - [fsItalic]
else
CurrText.Style := CurrText.Style + [fsItalic];
end;
procedure Tfrm_info_shareDoc.bsSkinSpeedButton3Click(Sender: TObject);
begin
if fsUnderline in Editor.SelAttributes.Style then
CurrText.Style := CurrText.Style - [fsUnderline]
else
CurrText.Style := CurrText.Style + [fsUnderline];
end;
procedure Tfrm_info_shareDoc.FontNameChange(Sender: TObject);
begin
if FUpdating then Exit;
CurrText.Name := FontName.Items[FontName.ItemIndex];
end;
procedure Tfrm_info_shareDoc.FontSizeChange(Sender: TObject);
begin
if FUpdating then Exit;
CurrText.Size := StrToInt(FontSize.Text);
end;
procedure Tfrm_info_shareDoc.LeftAlignClick(Sender: TObject);
begin
Editor.Paragraph.Alignment := TAlignment(TControl(Sender).Tag);
end;
procedure Tfrm_info_shareDoc.EditorSelectionChange(Sender: TObject);
begin
with Editor.Paragraph do
try
FUpdating := True;
FontSize.Text := IntToStr(Editor.SelAttributes.Size);
FontName.Text := Editor.SelAttributes.Name;
case Ord(Alignment) of
0: LeftAlign.Down := True;
1: RightAlign.Down := True;
2: CenterAlign.Down := True;
end;
finally
FUpdating := False;
end;
end;
end.