From 261c138e923fcb6134c006f293f70b426970ff30 Mon Sep 17 00:00:00 2001 From: yoffy Date: Fri, 4 Jun 2004 07:15:05 +0000 Subject: [PATCH] =?utf8?q?[=E7=B7=A8=E9=9B=86]=20-=20[=E5=BC=95=E7=94=A8?= =?utf8?q?=E3=81=97=E3=81=A6=E8=B2=BC=E3=82=8A=E4=BB=98=E3=81=91]=20?= =?utf8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Editor.dfm | 30 ++++++++++++++++++++--------- Editor.pas | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 83 insertions(+), 11 deletions(-) diff --git a/Editor.dfm b/Editor.dfm index 657de65..5660e8e 100644 --- a/Editor.dfm +++ b/Editor.dfm @@ -36,7 +36,7 @@ object EditorForm: TEditorForm TextHeight = 12 object StatusBar: TStatusBar Left = 0 - Top = 335 + Top = 327 Width = 632 Height = 19 Panels = < @@ -56,11 +56,11 @@ object EditorForm: TEditorForm Left = 0 Top = 30 Width = 632 - Height = 305 - ActivePage = PreviewTab + Height = 297 + ActivePage = EditorTab Align = alClient MultiLine = True - TabIndex = 1 + TabIndex = 0 TabOrder = 0 OnChange = EditorPageChange object EditorTab: TTabSheet @@ -69,7 +69,7 @@ object EditorForm: TEditorForm Left = 0 Top = 60 Width = 624 - Height = 218 + Height = 210 Align = alClient ScrollBars = ssBoth TabOrder = 0 @@ -105,7 +105,7 @@ object EditorForm: TEditorForm Width = 149 Height = 20 DropDownCount = 20 - ItemHeight = 0 + ItemHeight = 12 TabOrder = 0 end object MailComboBox: TComboBox @@ -114,7 +114,7 @@ object EditorForm: TEditorForm Width = 149 Height = 20 DropDownCount = 20 - ItemHeight = 0 + ItemHeight = 12 TabOrder = 1 OnChange = MailComboBoxChange end @@ -168,12 +168,12 @@ object EditorForm: TEditorForm Left = 0 Top = 0 Width = 624 - Height = 278 + Height = 270 Align = alClient TabOrder = 0 OnStatusTextChange = BrowserStatusTextChange ControlData = { - 4C0000007E400000BB1C00000000000000000000000000000000000000000000 + 4C0000007E400000E81B00000000000000000000000000000000000000000000 000000004C000000000000000000000001000000E0D057007335CF11AE690800 2B2E126208000000000000004C0000000114020000000000C000000000000046 8000000000000000000000000000000000000000000000000000000000000000 @@ -299,6 +299,9 @@ object EditorForm: TEditorForm object PasteMenu: TMenuItem Action = PasteAction end + object QuotePasteMenuItem: TMenuItem + Action = QuotePasteAction + end object N2: TMenuItem Caption = '-' end @@ -1524,6 +1527,15 @@ object EditorForm: TEditorForm OnExecute = CopyActionExecute OnUpdate = CopyActionUpdate end + object QuotePasteAction: TAction + Category = #32232#38598 + Caption = #24341#29992#12375#12390#36028#12426#20184#12369'(&P)' + Hint = #24341#29992#12375#12390#36028#12426#20184#12369 + ImageIndex = 5 + ShortCut = 24662 + OnExecute = QuotePasteActionExecute + OnUpdate = PasteActionUpdate + end end object IdLogDebug: TIdLogDebug OnReceive = IdLogDebugReceive diff --git a/Editor.pas b/Editor.pas index 9743a2d..619285f 100644 --- a/Editor.pas +++ b/Editor.pas @@ -4,7 +4,7 @@ interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, - Dialogs, StdCtrls, ComCtrls, ExtCtrls, ToolWin, Menus, OleCtrls, + Dialogs, StdCtrls, ComCtrls, ExtCtrls, ToolWin, Menus, OleCtrls, Registry, {$IF Defined(DELPRO) } SHDocVw, {$ELSE} @@ -88,6 +88,8 @@ type N2: TMenuItem; SelectAll1: TMenuItem; Timer1: TTimer; + QuotePasteAction: TAction; + QuotePasteMenuItem: TMenuItem; procedure EditorPageChange(Sender: TObject); procedure FormCreate(Sender: TObject); procedure BrowserStatusTextChange(Sender: TObject; @@ -124,6 +126,7 @@ type procedure Timer1Timer(Sender: TObject); procedure FormActivate(Sender: TObject); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure QuotePasteActionExecute(Sender: TObject); private FThreadItem: TThreadItem; FBoard: TBoard; @@ -157,7 +160,9 @@ type procedure WriteSambaTime(const AHost: string; ATime: TDateTime); function ReadSettingTime(const AHost: string): Integer; function CheckSambaTime(const AHost: string; ATime: TDateTime): Boolean; - procedure SetSamba24(AURL: string); + procedure SetSamba24(AURL: string); + // ˆø—p•„‚̎擾 + function GetOEIndentChar : string; protected procedure CreateParams(var Params: TCreateParams); override; public @@ -1263,5 +1268,60 @@ begin CanClose := not FWork; end; +function TEditorForm.GetOEIndentChar : string; +var + regKey : TRegistry; + Identities : string; + IndentChar : DWORD; +const + DEFAULT_CHAR = '> '; + OE_MAIL_PATH = '\Software\Microsoft\Outlook Express\5.0\Mail'; + INDENT_CHAR = 'Indent Char'; +begin + + Result := DEFAULT_CHAR; + regKey := TRegistry.Create; + try + try + regKey.RootKey := HKEY_CURRENT_USER; + if not regKey.OpenKey( 'Identities', False ) then + Exit; + Identities := regKey.ReadString( 'Default User ID' ); + if Identities = '' then + Exit; + if not regKey.OpenKey( Identities + OE_MAIL_PATH, False ) then + Exit; + IndentChar := regKey.ReadInteger( INDENT_CHAR ); + Result := Char( IndentChar ) + ' '; + except + end; + finally + regKey.Free; + end; + +end; + +procedure TEditorForm.QuotePasteActionExecute(Sender: TObject); +var + s : TStringList; + i : Integer; + quote : string; +begin + + quote := GetOEIndentChar; + s := TStringList.Create; + try + s.Text := Clipboard.AsText; + + for i := s.Count - 1 downto 0 do + s[ i ] := quote + s[ i ]; + + BodyEdit.SelText := s.Text; + finally + s.Free; + end; + +end; + end. -- 2.11.0